aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec
diff options
context:
space:
mode:
authorJustin Ruggles <justin.ruggles@gmail.com>2010-12-30 22:13:37 +0000
committerJustin Ruggles <justin.ruggles@gmail.com>2010-12-30 22:13:37 +0000
commit34d5074e6d1c2a5b3c611aaecd978f5746411a1c (patch)
tree1ad3103d6301101236fac636cf9c0bbeb821485e /libavcodec
parentb5293036b99d5aad44cd99cec54d3dde40ae4144 (diff)
downloadffmpeg-34d5074e6d1c2a5b3c611aaecd978f5746411a1c.tar.gz
Add a window field to AC3MDCTContext and use it as an input to apply_window()
instead of using the ff_ac3_window[] table directly. Originally committed as revision 26172 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ac3enc.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libavcodec/ac3enc.c b/libavcodec/ac3enc.c
index 031718afa4..b10c2d2ae9 100644
--- a/libavcodec/ac3enc.c
+++ b/libavcodec/ac3enc.c
@@ -56,6 +56,7 @@ typedef struct IComplex {
} IComplex;
typedef struct AC3MDCTContext {
+ const int16_t *window; ///< MDCT window function
int nbits; ///< log2(transform size)
int16_t *costab; ///< FFT cos table
int16_t *sintab; ///< FFT sin table
@@ -262,6 +263,8 @@ static av_cold int mdct_init(AVCodecContext *avctx, AC3MDCTContext *mdct,
if (ret)
return ret;
+ mdct->window = ff_ac3_window;
+
FF_ALLOC_OR_GOTO(avctx, mdct->xcos1, n4 * sizeof(*mdct->xcos1), mdct_alloc_fail);
FF_ALLOC_OR_GOTO(avctx, mdct->xsin1, n4 * sizeof(*mdct->xsin1), mdct_alloc_fail);
FF_ALLOC_OR_GOTO(avctx, mdct->rot_tmp, n * sizeof(*mdct->rot_tmp), mdct_alloc_fail);
@@ -498,7 +501,7 @@ static void apply_mdct(AC3EncodeContext *s)
AC3Block *block = &s->blocks[blk];
const int16_t *input_samples = &s->planar_samples[ch][blk * AC3_BLOCK_SIZE];
- apply_window(s->windowed_samples, input_samples, ff_ac3_window, AC3_WINDOW_SIZE);
+ apply_window(s->windowed_samples, input_samples, s->mdct.window, AC3_WINDOW_SIZE);
block->exp_shift[ch] = normalize_samples(s);