diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c index 5e3308235a..e5730d4078 100644 --- a/libavcodec/aacenc.c +++ b/libavcodec/aacenc.c @@ -676,6 +676,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx) ff_mdct_end(&s->mdct1024); ff_mdct_end(&s->mdct128); ff_psy_end(&s->psy); + ff_lpc_end(&s->lpc); if (s->psypp) ff_psy_preprocess_end(s->psypp); av_freep(&s->buffer.samples); @@ -775,6 +776,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); if (HAVE_MIPSDSPR1) ff_aac_coder_init_mips(s); diff --git a/libavcodec/aacenc.h b/libavcodec/aacenc.h index 80ada0774b..c7ca2159f7 100644 --- a/libavcodec/aacenc.h +++ b/libavcodec/aacenc.h @@ -30,6 +30,8 @@ #include "audio_frame_queue.h" #include "psymodel.h" +#include "lpc.h" + typedef enum AACCoder { AAC_CODER_FAAC = 0, AAC_CODER_ANMR, @@ -75,6 +77,7 @@ typedef struct AACEncContext { AVFloatDSPContext *fdsp; float *planar_samples[6]; ///< saved preprocessed input + LPCContext lpc; ///< used by TNS int samplerate_index; ///< MPEG-4 samplerate index int channels; ///< channel count const uint8_t *chan_map; ///< channel configuration map