aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRostislav Pehlivanov <atomnuker@gmail.com>2017-02-18 01:11:58 +0000
committerRostislav Pehlivanov <atomnuker@gmail.com>2017-02-18 01:13:13 +0000
commitb71f62a9c84940575b71613d61c45f163c69338b (patch)
treeeae18549c539af3e8f434d980bffd66a8302ee74
parent4bc7268f2b5fdef03b907279b4e6173cb0e5b835 (diff)
downloadffmpeg-b71f62a9c84940575b71613d61c45f163c69338b.tar.gz
opusenc: initialize the emphasis coefficients on init
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
-rw-r--r--libavcodec/opusenc.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libavcodec/opusenc.c b/libavcodec/opusenc.c
index b774e28c65..56368dbb91 100644
--- a/libavcodec/opusenc.c
+++ b/libavcodec/opusenc.c
@@ -1077,6 +1077,9 @@ static av_cold int opus_encode_init(AVCodecContext *avctx)
if ((ret = ff_mdct15_init(&s->mdct[i], 0, i + 3, 68 << (CELT_BLOCK_NB - 1 - i))))
return AVERROR(ENOMEM);
+ for (i = 0; i < OPUS_MAX_FRAMES_PER_PACKET; i++)
+ s->frame[i].block[0].emph_coeff = s->frame[i].block[1].emph_coeff = 0.0f;
+
/* Zero out previous energy (matters for inter first frame) */
for (ch = 0; ch < s->channels; ch++)
for (i = 0; i < CELT_MAX_BANDS; i++)