Commit b47a1e5c authored by Rostislav Pehlivanov's avatar Rostislav Pehlivanov

aacenc: create and initialize an LTP context

This commit only creates and initializes an LTP
context which is needed for upcoming commits (TNS).
Signed-off-by: 's avatarRostislav Pehlivanov <atomnuker@gmail.com>
parent 23e786be
...@@ -676,6 +676,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx) ...@@ -676,6 +676,7 @@ static av_cold int aac_encode_end(AVCodecContext *avctx)
ff_mdct_end(&s->mdct1024); ff_mdct_end(&s->mdct1024);
ff_mdct_end(&s->mdct128); ff_mdct_end(&s->mdct128);
ff_psy_end(&s->psy); ff_psy_end(&s->psy);
ff_lpc_end(&s->lpc);
if (s->psypp) if (s->psypp)
ff_psy_preprocess_end(s->psypp); ff_psy_preprocess_end(s->psypp);
av_freep(&s->buffer.samples); av_freep(&s->buffer.samples);
...@@ -775,6 +776,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx) ...@@ -775,6 +776,7 @@ static av_cold int aac_encode_init(AVCodecContext *avctx)
goto fail; goto fail;
s->psypp = ff_psy_preprocess_init(avctx); s->psypp = ff_psy_preprocess_init(avctx);
s->coder = &ff_aac_coders[s->options.aac_coder]; 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) if (HAVE_MIPSDSPR1)
ff_aac_coder_init_mips(s); ff_aac_coder_init_mips(s);
......
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
#include "audio_frame_queue.h" #include "audio_frame_queue.h"
#include "psymodel.h" #include "psymodel.h"
#include "lpc.h"
typedef enum AACCoder { typedef enum AACCoder {
AAC_CODER_FAAC = 0, AAC_CODER_FAAC = 0,
AAC_CODER_ANMR, AAC_CODER_ANMR,
...@@ -75,6 +77,7 @@ typedef struct AACEncContext { ...@@ -75,6 +77,7 @@ typedef struct AACEncContext {
AVFloatDSPContext *fdsp; AVFloatDSPContext *fdsp;
float *planar_samples[6]; ///< saved preprocessed input float *planar_samples[6]; ///< saved preprocessed input
LPCContext lpc; ///< used by TNS
int samplerate_index; ///< MPEG-4 samplerate index int samplerate_index; ///< MPEG-4 samplerate index
int channels; ///< channel count int channels; ///< channel count
const uint8_t *chan_map; ///< channel configuration map const uint8_t *chan_map; ///< channel configuration map
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment