diff options
author | Lynne <dev@lynne.ee> | 2021-01-09 17:27:16 +0100 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2021-01-14 01:44:18 +0100 |
commit | 238b2d4155d9779d770fccb3594076bb32742c82 (patch) | |
tree | 22c9e2e26fe214cf508bbc248f64b539b726e6e6 /libavcodec/ac3enc_float.c | |
parent | 784c08af3005390cb1d74add13b58edf1663cd40 (diff) | |
download | ffmpeg-238b2d4155d9779d770fccb3594076bb32742c82.tar.gz |
ac3enc: halve the MDCT window size by using vector_fmul_reverse
This brings the encoder in-line with the rest of ours and saves
on a bit of memory.
Diffstat (limited to 'libavcodec/ac3enc_float.c')
-rw-r--r-- | libavcodec/ac3enc_float.c | 15 |
1 files changed, 4 insertions, 11 deletions
diff --git a/libavcodec/ac3enc_float.c b/libavcodec/ac3enc_float.c index b17b3a2365..74f3ab8d86 100644 --- a/libavcodec/ac3enc_float.c +++ b/libavcodec/ac3enc_float.c @@ -108,23 +108,16 @@ static av_cold void ac3_float_mdct_end(AC3EncodeContext *s) */ static av_cold int ac3_float_mdct_init(AC3EncodeContext *s) { - float *window; - int i, n, n2; - - n = 1 << 9; - n2 = n >> 1; - - window = av_malloc_array(n, sizeof(*window)); + float *window = av_malloc_array(AC3_BLOCK_SIZE, sizeof(*window)); if (!window) { av_log(s->avctx, AV_LOG_ERROR, "Cannot allocate memory.\n"); return AVERROR(ENOMEM); } - ff_kbd_window_init(window, 5.0, n2); - for (i = 0; i < n2; i++) - window[n-1-i] = window[i]; + + ff_kbd_window_init(window, 5.0, AC3_BLOCK_SIZE); s->mdct_window = window; - return ff_mdct_init(&s->mdct, 9, 0, -2.0 / n); + return ff_mdct_init(&s->mdct, 9, 0, -2.0 / AC3_WINDOW_SIZE); } |