]> git.tue.mpg.de Git - paraslash.git/commitdiff
wmadec: Simplify wma_init().
authorAndre Noll <maan@tuebingen.mpg.de>
Tue, 7 Jan 2025 22:27:35 +0000 (23:27 +0100)
committerAndre Noll <maan@tuebingen.mpg.de>
Wed, 22 Jan 2025 20:10:02 +0000 (21:10 +0100)
This equivalent transformation saves a few lines and one level of
indentation.

wmadec_filter.c

index 5b3d9874bf5f905ef19c6b3689fd8006ad95c759..922a8aaea648a00720c52e9eb215a9183d063e53 100644 (file)
@@ -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;
                }
        }