[FFmpeg-cvslog] aacenc: initialize LPC context with MAX_LPC_ORDER

Rostislav Pehlivanov git at videolan.org
Sat Aug 29 20:26:08 CEST 2015


ffmpeg | branch: master | Rostislav Pehlivanov <atomnuker at gmail.com> | Sat Aug 29 19:15:52 2015 +0100| [49854c56c2346a7e82ccb6b6e19fa2d2c159d4b9] | committer: Rostislav Pehlivanov

aacenc: initialize LPC context with MAX_LPC_ORDER

The order should never go above TNS_MAX_ORDER (and thus cause
the context to be reinitialized) but this is just in case.

Also fix a comparison, since the coefficients are zero-indexed.

Signed-off-by: Rostislav Pehlivanov <atomnuker at gmail.com>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=49854c56c2346a7e82ccb6b6e19fa2d2c159d4b9
---

 libavcodec/aacenc.c     |    2 +-
 libavcodec/aacenc_tns.c |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 09dd0dd..a32f0d4 100644
--- a/libavcodec/aacenc.c
+++ b/libavcodec/aacenc.c
@@ -822,7 +822,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
         goto fail;
     s->psypp = ff_psy_preprocess_init(avctx);
     s->coder = &ff_aac_coders[s->options.aac_coder];
-    ff_lpc_init(&s->lpc, avctx->frame_size, TNS_MAX_ORDER, FF_LPC_TYPE_LEVINSON);
+    ff_lpc_init(&s->lpc, avctx->frame_size, MAX_LPC_ORDER, FF_LPC_TYPE_LEVINSON);
 
     if (HAVE_MIPSDSPR1)
         ff_aac_coder_init_mips(s);
diff --git a/libavcodec/aacenc_tns.c b/libavcodec/aacenc_tns.c
index e948b32..5e02c4f 100644
--- a/libavcodec/aacenc_tns.c
+++ b/libavcodec/aacenc_tns.c
@@ -205,7 +205,7 @@ void ff_aac_search_for_tns(AACEncContext *s, SingleChannelElement *sce)
 
         if (sfb_len <= 0 || coef_len <= 0)
             continue;
-        if (coef_start + coef_len > 1024)
+        if (coef_start + coef_len >= 1024)
             coef_len = 1024 - coef_start;
 
         /* LPC */



More information about the ffmpeg-cvslog mailing list