From: Andre Noll Date: Tue, 7 Jan 2025 22:27:35 +0000 (+0100) Subject: wmadec: Simplify wma_init(). X-Git-Url: http://git.tue.mpg.de/?a=commitdiff_plain;h=a11b48b6fcaa194483df7431c0d24a56686b5168;p=paraslash.git wmadec: Simplify wma_init(). This equivalent transformation saves a few lines and one level of indentation. --- 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; } }