Go to the documentation of this file.
22 #ifndef AVCODEC_AACENC_H
23 #define AVCODEC_AACENC_H
42 #define CLIP_AVOIDANCE_FACTOR 0.95f
146 int win,
int group_len,
const float lambda);
148 int scale_idx,
int cb,
const float lambda,
int rtz);
int counted[16]
per-channel bits the trellis accounted for in the last solve
enum BandType band_alt[128]
alternative band type
void(* apply_tns_filt)(struct AACEncContext *s, SingleChannelElement *sce)
void(* encode_window_bands_info)(struct AACEncContext *s, SingleChannelElement *sce, int win, int group_len, const float lambda)
float * planar_samples[16]
saved preprocessed input
void(* search_for_quantizers)(AVCodecContext *avctx, struct AACEncContext *s, SingleChannelElement *sce, const float lambda)
struct PredictorState * predictor_state
uint8_t can_pns[128]
band is allowed to PNS (informative)
int needs_pce
flag for non-standard layout
int frames_since_short
long-block frames since the last short run (the "gap"): large = isolated transient
static double cb(void *priv, double x, double y)
struct AACEncContext::@38 buffer
uint8_t zeroes[128]
band is not coded
int64_t rc_frame_num
frame the reservoir was last advanced for
int coef_idx[8][4][TNS_MAX_ORDER]
void(* search_for_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce)
void(* search_for_ms)(struct AACEncContext *s, ChannelElement *cpe)
AACNMRCurves * nmr
NMR coder scratch (NULL unless coder == nmr)
int samplerate_index
MPEG-4 samplerate index.
float side_ema
running estimate of real-minus-counted bits per frame
void(* search_for_tns)(struct AACEncContext *s, SingleChannelElement *sce)
SingleChannelElement ch[2]
const uint8_t * chan_map
channel configuration map
static float win(SuperEqualizerContext *s, float n, int N)
int num_swb
number of scalefactor window bands
uint64_t stat_tns_short
TNS-active channels among long / short blocks.
void ff_quantize_band_cost_cache_init(struct AACEncContext *s)
int nb[128][NMR_NCAND]
spectral bits per candidate
float coeffs[1024]
coefficients for IMDCT, maybe processed
float ret_buf[2048]
PCM output buffer.
int ms_mode
Signals mid/side stereo flags coding mode.
uint8_t window_clipping[8]
set if a certain window is near clipping
AACEncOptions options
encoding options
uint64_t stat_pns
coded channel-bands, of which PNS
IndividualChannelStream ics
int rc_fill
virtual bit reservoir fill, + = bits saved vs nominal
uint64_t stat_short
coded channels, of which short-block (transient)
int lambda_count
count(lambda), for Qvg reporting
float clip_avoidance_factor
set if any window is near clipping to the necessary atennuation factor to avoid it
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
uint8_t index[4][8]
front, side, back, lfe
float lambda_sum
sum(lambda), for Qvg reporting
const AACCoefficientsEncoder ff_aac_coders[]
const uint8_t * swb_sizes
table of scalefactor band sizes for a particular window
int nmr_speed
NMR coder speed level: 0 = slowest/best, higher is faster.
const uint8_t * reorder_map
lavc to aac reorder map
Individual Channel Stream.
uint8_t reorder_map[16]
maps channels from lavc to aac order
float lam_rc
global-lambda rate control: operating lambda, 0 until bootstrapped
float lam[16]
per-channel operating lambda of the previous frame, 0 = none yet
Describe the class of an AVClass context structure.
uint8_t is_mask[128]
Set if intensity stereo is used.
uint8_t pairing[3][8]
front, side, back
float is_ener[128]
Intensity stereo pos.
uint8_t use_kb_window[2]
If set, use Kaiser-Bessel window, otherwise use a sine window.
enum RawDataBlockType cur_type
channel group type cur_channel belongs to
uint8_t ms_mask[128]
Set if mid/side stereo is used for each scalefactor window band.
uint16_t quantize_band_cost_cache_generation
NMR coder per-band candidate cost curves (~96 KiB) and rate-control carry-over.
int sf_idx[128]
scalefactor indices
int qcoefs[96]
quantized coefficients
enum WindowSequence window_sequence[2]
void(* set_special_band_scalefactors)(struct AACEncContext *s, SingleChannelElement *sce)
int channels
channel count
An AVChannelLayout holds information about the channel layout of audio data.
#define DECLARE_ALIGNED(n, t, v)
int prev_was_short
previous frame was a short block (for run-start detection)
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)
#define NMR_NCAND
per-band scalefactor candidates above the finest codeable sf (NMR coder)
int common_window
Set if channels share a common 'IndividualChannelStream' in bitstream.
void(* mark_pns)(struct AACEncContext *s, AVCodecContext *avctx, SingleChannelElement *sce)
int side_inited
side_ema holds a measurement
AVTXContext * mdct1024
long (1024 samples) frame transform context
enum BandType band_type[128]
band types
float pns_ener[128]
Noise energy values.
int cur_channel
current channel for coder context
float nd[128][NMR_NCAND]
dist / threshold per candidate
uint8_t config_map[16]
configs the encoder's channel specific settings
Single Channel Element - used for both SCE and LFE elements.
void(* search_for_is)(struct AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe)
float pcoeffs[1024]
coefficients for IMDCT, pristine
channel element - generic struct for SCE/CPE/CCE/LFE
const uint16_t * swb_offset
table of offsets to the lowest spectral coefficient of a scalefactor band, sfb, for a particular wind...
uint8_t num_ele[4]
front, side, back, lfe
AACQuantizeBandCostCacheEntry quantize_band_cost_cache[256][128]
memoization area for quantize_band_cost
int profile
copied from avctx
LPCContext lpc
used by TNS
float run_burst
transient bit-burst factor, set at run start and held across the short run
float coef[8][4][TNS_MAX_ORDER]
AACPCEInfo pce
PCE data, if needed.
void(* encode_tns_info)(struct AACEncContext *s, SingleChannelElement *sce)
int last_frame_pb_count
number of bits for the previous frame
main external API structure.
AVTXContext * mdct128
short (128 samples) frame transform context
float scoefs[1024]
scaled coefficients
uint8_t is_mode
Set if any bands have been encoded using intensity stereo.
const AACCoefficientsEncoder * coder
uint64_t stat_is
coded CPE pair-bands, of which M/S, I/S
uint8_t max_sfb
number of scalefactor bands per group
int bandwidth
coding bandwidth in Hz, fixed at init; the psy model and the coders' band cutoff agree on it
context used by psychoacoustic model
ChannelElement * cpe
channel elements