X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=libavcodec%2Faac.h;h=6022ca66be04f019c49fdf485aae38813b891da6;hb=87a9173679118beef867c7e9626868b4a3dfc837;hp=91b18a13f607627d95d520d66aa453e93056b947;hpb=9ffd5c1cee8d46128bf6b3faad8befb886763ae3;p=ffmpeg diff --git a/libavcodec/aac.h b/libavcodec/aac.h index 91b18a13f60..6022ca66be0 100644 --- a/libavcodec/aac.h +++ b/libavcodec/aac.h @@ -27,8 +27,8 @@ * @author Maxim Gavrilov ( maxim.gavrilov gmail com ) */ -#ifndef FFMPEG_AAC_H -#define FFMPEG_AAC_H +#ifndef AVCODEC_AAC_H +#define AVCODEC_AAC_H #include "avcodec.h" #include "dsputil.h" @@ -46,7 +46,6 @@ #define MAX_ELEM_ID 16 #define TNS_MAX_ORDER 20 -#define PNS_MEAN_ENERGY 3719550720.0f // sqrt(3.0) * 1<<31 enum AudioObjectType { AOT_NULL, @@ -133,6 +132,20 @@ enum CouplingPoint { AFTER_IMDCT = 3, }; +/** + * Predictor State + */ +typedef struct { + float cor0; + float cor1; + float var0; + float var1; + float r0; + float r1; +} PredictorState; + +#define MAX_PREDICTORS 672 + /** * Individual Channel Stream */ @@ -146,8 +159,25 @@ typedef struct { int num_swb; ///< number of scalefactor window bands int num_windows; int tns_max_bands; + int predictor_present; + int predictor_initialized; + int predictor_reset_group; + uint8_t prediction_used[41]; + PredictorState predictor_state[MAX_PREDICTORS]; } IndividualChannelStream; +/** + * Temporal Noise Shaping + */ +typedef struct { + int present; + int n_filt[8]; + int length[8][4]; + int direction[8][4]; + int order[8][4]; + float coef[8][4][TNS_MAX_ORDER]; +} TemporalNoiseShaping; + /** * Dynamic Range Control - decoded from the bitstream but not processed further. */ @@ -178,8 +208,8 @@ typedef struct { int num_coupled; ///< number of target elements enum RawDataBlockType type[8]; ///< Type of channel element to be coupled - SCE or CPE. int id_select[8]; ///< element id - int ch_select[8]; /**< [0] shared list of gains; [1] list of gains for left channel; - * [2] list of gains for right channel; [3] lists of gains for both channels + int ch_select[8]; /**< [0] shared list of gains; [1] list of gains for right channel; + * [2] list of gains for left channel; [3] lists of gains for both channels */ float gain[16][120]; } ChannelCoupling; @@ -194,7 +224,7 @@ typedef struct { int band_type_run_end[120]; ///< band type run end points float sf[120]; ///< scalefactors DECLARE_ALIGNED_16(float, coeffs[1024]); ///< coefficients for IMDCT - DECLARE_ALIGNED_16(float, saved[1024]); ///< overlap + DECLARE_ALIGNED_16(float, saved[512]); ///< overlap DECLARE_ALIGNED_16(float, ret[1024]); ///< PCM output } SingleChannelElement; @@ -231,6 +261,13 @@ typedef struct { ChannelElement * che[4][MAX_ELEM_ID]; /** @} */ + /** + * @defgroup temporary aligned temporary buffers (We do not want to have these on the stack.) + * @{ + */ + DECLARE_ALIGNED_16(float, buf_mdct[1024]); + /** @} */ + /** * @defgroup tables Computed / set up during initialization. * @{ @@ -253,4 +290,4 @@ typedef struct { } AACContext; -#endif /* FFMPEG_AAC_H */ +#endif /* AVCODEC_AAC_H */