}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;
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);
extern AACCoefficientsEncoder ff_aac_coders[];
+typedef struct AACQuantizeBandCostCacheEntry {
+ float rd;
+ float energy;
+ int bits; ///< -1 means uninitialized entry
+ char cb;
+ char rtz;
+ char padding[2]; ///< Keeps the entry size a multiple of 32 bits
+} AACQuantizeBandCostCacheEntry;
+
/**
* AAC encoder context
*/
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
int last_frame;
int random_state;
float lambda;
+ float lambda_sum; ///< sum(lambda), for Qvg reporting
+ int lambda_count; ///< count(lambda), for Qvg reporting
enum RawDataBlockType cur_type; ///< channel group type cur_channel belongs to
AudioFrameQueue afq;
DECLARE_ALIGNED(16, int, qcoefs)[96]; ///< quantized coefficients
DECLARE_ALIGNED(32, float, scoefs)[1024]; ///< scaled coefficients
+ AACQuantizeBandCostCacheEntry quantize_band_cost_cache[256][128]; ///< memoization area for quantize_band_cost
+
struct {
float *samples;
} buffer;
} AACEncContext;
void ff_aac_coder_init_mips(AACEncContext *c);
+void ff_quantize_band_cost_cache_init(struct AACEncContext *s);
+
#endif /* AVCODEC_AACENC_H */