mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2024-11-26 19:01:44 +02:00
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@gmail.com>
This commit is contained in:
parent
0818705bf3
commit
49854c56c2
@ -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);
|
||||
|
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user