]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/aacenc.h
aacenc_tns: simplify encoding function
[ffmpeg] / libavcodec / aacenc.h
index 98b38a4bdea3171fd19690660b63ab24b7a856dd..d8bed82abe7c789f46294635c71bcdd90e135679 100644 (file)
@@ -42,11 +42,12 @@ typedef enum AACCoder {
 }AACCoder;
 
 typedef struct AACEncOptions {
-    int stereo_mode;
-    int aac_coder;
+    int coder;
     int pns;
     int tns;
+    int ltp;
     int pred;
+    int mid_side;
     int intensity_stereo;
 } AACEncOptions;
 
@@ -60,14 +61,19 @@ typedef struct AACCoefficientsEncoder {
     void (*quantize_and_encode_band)(struct AACEncContext *s, PutBitContext *pb, const float *in, float *out, int size,
                                      int scale_idx, int cb, const float lambda, int rtz);
     void (*encode_tns_info)(struct AACEncContext *s, SingleChannelElement *sce);
+    void (*encode_ltp_info)(struct AACEncContext *s, SingleChannelElement *sce, int common_window);
     void (*encode_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
-    void (*adjust_common_prediction)(struct AACEncContext *s, ChannelElement *cpe);
+    void (*adjust_common_pred)(struct AACEncContext *s, ChannelElement *cpe);
+    void (*adjust_common_ltp)(struct AACEncContext *s, ChannelElement *cpe);
     void (*apply_main_pred)(struct AACEncContext *s, SingleChannelElement *sce);
     void (*apply_tns_filt)(struct AACEncContext *s, SingleChannelElement *sce);
+    void (*update_ltp)(struct AACEncContext *s, SingleChannelElement *sce);
+    void (*ltp_insert_new_frame)(struct AACEncContext *s);
     void (*set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce);
     void (*search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
     void (*mark_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce);
     void (*search_for_tns)(struct AACEncContext *s, SingleChannelElement *sce);
+    void (*search_for_ltp)(struct AACEncContext *s, SingleChannelElement *sce, int common_window);
     void (*search_for_ms)(struct AACEncContext *s, ChannelElement *cpe);
     void (*search_for_is)(struct AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe);
     void (*search_for_pred)(struct AACEncContext *s, SingleChannelElement *sce);
@@ -94,7 +100,7 @@ typedef struct AACEncContext {
     FFTContext mdct1024;                         ///< long (1024 samples) frame transform context
     FFTContext mdct128;                          ///< short (128 samples) frame transform context
     AVFloatDSPContext *fdsp;
-    float *planar_samples[6];                    ///< saved preprocessed input
+    float *planar_samples[8];                    ///< saved preprocessed input
 
     int profile;                                 ///< copied from avctx
     LPCContext lpc;                              ///< used by TNS