---
 libavcodec/ac3.h    |    1 +
 libavcodec/ac3enc.c |    8 ++++----
 2 files changed, 5 insertions(+), 4 deletions(-)

diff --git libavcodec/ac3.h libavcodec/ac3.h
index 7cfa51a..1840766 100644
--- libavcodec/ac3.h
+++ libavcodec/ac3.h
@@ -36,6 +36,7 @@
 #define AC3_BLOCK_SIZE  256
 #define AC3_MAX_BLOCKS    6
 #define AC3_FRAME_SIZE (AC3_MAX_BLOCKS * 256)
+#define AC3_WINDOW_SIZE (AC3_BLOCK_SIZE * 2)
 
 /* exponent encoding strategy */
 #define EXP_REUSE 0
diff --git libavcodec/ac3enc.c libavcodec/ac3enc.c
index 7235dd8..57f42fc 100644
--- libavcodec/ac3enc.c
+++ libavcodec/ac3enc.c
@@ -360,9 +360,9 @@ static void lshift_tab(int16_t *tab, int n, int lshift)
  */
 static int normalize_samples(AC3EncodeContext *s)
 {
-    int v = 14 - log2_tab(s->windowed_samples, AC3_BLOCK_SIZE*2);
+    int v = 14 - log2_tab(s->windowed_samples, AC3_WINDOW_SIZE);
     v = FFMAX(0, v);
-    lshift_tab(s->windowed_samples, AC3_BLOCK_SIZE*2, v);
+    lshift_tab(s->windowed_samples, AC3_WINDOW_SIZE, v);
     return v - 9;
 }
 
@@ -392,7 +392,7 @@ static void apply_mdct(AC3EncodeContext *s)
             int16_t *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];
 
             apply_window(s->windowed_samples, input_samples, ff_ac3_window,
-                         AC3_BLOCK_SIZE*2);
+                         AC3_WINDOW_SIZE);
 
             s->blocks[blk].exp_shift[ch] = normalize_samples(s);
 
@@ -1075,7 +1075,7 @@ static av_cold int AC3_encode_init(AVCodecContext *avctx)
 
     /* allocate context arrays */
     FF_ALLOC_OR_GOTO(avctx, s->windowed_samples,
-                     AC3_BLOCK_SIZE*2 * sizeof(*s->windowed_samples),
+                     AC3_WINDOW_SIZE * sizeof(*s->windowed_samples),
                      alloc_fail);
     for (ch = 0; ch < s->channels; ch++) {
         FF_ALLOCZ_OR_GOTO(avctx, s->planar_samples[ch],
_______________________________________________
FFmpeg-soc mailing list
[email protected]
https://lists.mplayerhq.hu/mailman/listinfo/ffmpeg-soc

Reply via email to