[FFmpeg-cvslog] aacenc: create and initialize an LTP context

Rostislav Pehlivanov git at videolan.org
Fri Aug 21 20:47:00 CEST 2015


ffmpeg | branch: master | Rostislav Pehlivanov <atomnuker at gmail.com> | Fri Aug 21 18:43:09 2015 +0100| [b47a1e5c5f585da714b0361a3077b9ded46c8c54] | committer: 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: Rostislav Pehlivanov <atomnuker at gmail.com>

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

 libavcodec/aacenc.c |    2 ++
 libavcodec/aacenc.h |    3 +++
 2 files changed, 5 insertions(+)

diff --git a/libavcodec/aacenc.c b/libavcodec/aacenc.c
index 5e33082..e5730d4 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 80ada07..c7ca215 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



More information about the ffmpeg-cvslog mailing list