Browse code

cosmetics: Define AC3_WINDOW_SIZE and use it instead of AC3_BLOCK_SIZE*2.

Originally committed as revision 25951 to svn://svn.ffmpeg.org/ffmpeg/trunk

Justin Ruggles authored on 2010/12/14 23:50:40
Showing 2 changed files
... ...
@@ -36,6 +36,7 @@
36 36
 #define AC3_BLOCK_SIZE  256
37 37
 #define AC3_MAX_BLOCKS    6
38 38
 #define AC3_FRAME_SIZE (AC3_MAX_BLOCKS * 256)
39
+#define AC3_WINDOW_SIZE (AC3_BLOCK_SIZE * 2)
39 40
 
40 41
 /* exponent encoding strategy */
41 42
 #define EXP_REUSE 0
... ...
@@ -1187,7 +1187,7 @@ static int AC3_encode_frame(AVCodecContext *avctx,
1187 1187
     AC3EncodeContext *s = avctx->priv_data;
1188 1188
     const int16_t *samples = data;
1189 1189
     int i, j, k, v, ch;
1190
-    int16_t input_samples[AC3_BLOCK_SIZE*2];
1190
+    int16_t input_samples[AC3_WINDOW_SIZE];
1191 1191
     int32_t mdct_coef[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS][AC3_MAX_COEFS];
1192 1192
     uint8_t exp[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS][AC3_MAX_COEFS];
1193 1193
     uint8_t exp_strategy[AC3_MAX_BLOCKS][AC3_MAX_CHANNELS];
... ...
@@ -1219,17 +1219,17 @@ static int AC3_encode_frame(AVCodecContext *avctx,
1219 1219
             for(j=0;j<AC3_BLOCK_SIZE;j++) {
1220 1220
                 input_samples[j] = MUL16(input_samples[j],
1221 1221
                                          ff_ac3_window[j]) >> 15;
1222
-                input_samples[AC3_BLOCK_SIZE*2-j-1] = MUL16(input_samples[AC3_BLOCK_SIZE*2-j-1],
1222
+                input_samples[AC3_WINDOW_SIZE-j-1] = MUL16(input_samples[AC3_WINDOW_SIZE-j-1],
1223 1223
                                              ff_ac3_window[j]) >> 15;
1224 1224
             }
1225 1225
 
1226 1226
             /* Normalize the samples to use the maximum available
1227 1227
                precision */
1228
-            v = 14 - log2_tab(input_samples, AC3_BLOCK_SIZE*2);
1228
+            v = 14 - log2_tab(input_samples, AC3_WINDOW_SIZE);
1229 1229
             if (v < 0)
1230 1230
                 v = 0;
1231 1231
             exp_samples[i][ch] = v - 9;
1232
-            lshift_tab(input_samples, AC3_BLOCK_SIZE*2, v);
1232
+            lshift_tab(input_samples, AC3_WINDOW_SIZE, v);
1233 1233
 
1234 1234
             /* do the MDCT */
1235 1235
             mdct512(mdct_coef[i][ch], input_samples);