From a11b48b6fcaa194483df7431c0d24a56686b5168 Mon Sep 17 00:00:00 2001 From: Andre Noll Date: Tue, 7 Jan 2025 23:27:35 +0100 Subject: [PATCH] wmadec: Simplify wma_init(). This equivalent transformation saves a few lines and one level of indentation. --- wmadec_filter.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/wmadec_filter.c b/wmadec_filter.c index 5b3d9874..922a8aae 100644 --- a/wmadec_filter.c +++ b/wmadec_filter.c @@ -363,21 +363,17 @@ static int wma_init(struct private_wmadec_data *pwd) pwd->reset_block_lengths = true; if (pwd->use_noise_coding) { + unsigned int seed = 1; + float norm; /* init the noise generator */ if (pwd->ahi.use_exp_vlc) pwd->noise_mult = 0.02; else pwd->noise_mult = 0.04; - - { - unsigned int seed; - float norm; - seed = 1; - norm = (1.0 / (float) (1LL << 31)) * sqrt(3) * pwd->noise_mult; - for (i = 0; i < NOISE_TAB_SIZE; i++) { - seed = seed * 314159 + 1; - pwd->noise_table[i] = (float) ((int) seed) * norm; - } + norm = (1.0 / (float)(1LL << 31)) * sqrt(3) * pwd->noise_mult; + for (i = 0; i < NOISE_TAB_SIZE; i++) { + seed = seed * 314159 + 1; + pwd->noise_table[i] = (float)((int)seed) * norm; } } -- 2.39.5