]> git.sesse.net Git - ffmpeg/commitdiff
opusenc: initialize the emphasis coefficients on init
authorRostislav Pehlivanov <atomnuker@gmail.com>
Sat, 18 Feb 2017 01:11:58 +0000 (01:11 +0000)
committerRostislav Pehlivanov <atomnuker@gmail.com>
Sat, 18 Feb 2017 01:13:13 +0000 (01:13 +0000)
Signed-off-by: Rostislav Pehlivanov <atomnuker@gmail.com>
libavcodec/opusenc.c

index b774e28c65e4310551f9b3f7c7f2569caf1d5b14..56368dbb914c766362c95e6930b53c37f67a05ea 100644 (file)
@@ -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++)