Go to the documentation of this file.
34 int start,
int w,
int g,
float ener0,
36 int use_pcoeffs,
int phase)
43 float *L34 = &
s->scoefs[256*0], *R34 = &
s->scoefs[256*1];
44 float *IS = &
s->scoefs[256*2], *I34 = &
s->scoefs[256*3];
48 if (
ener01 <= 0 || ener0 <= 0) {
54 FFPsyBand *band0 = &
s->psy.ch[
s->cur_channel+0].psy_bands[(
w+w2)*16+
g];
55 FFPsyBand *band1 = &
s->psy.ch[
s->cur_channel+1].psy_bands[(
w+w2)*16+
g];
56 int is_band_type, is_sf_idx =
FFMAX(1, sce0->
sf_idx[
w*16+
g]-4);
58 float maxval, dist_spec_err = 0.0f;
78 is_sf_idx, is_band_type,
81 dist_spec_err += (L34[
i] - I34[
i])*(L34[
i] - I34[
i]);
82 dist_spec_err += (R34[
i] - I34[
i]*e01_34)*(R34[
i] - I34[
i]*e01_34);
84 dist_spec_err *=
s->lambda / minthr;
85 dist2 += dist_spec_err;
102 int start = 0, count = 0,
w, w2,
g,
i, prev_sf1 = -1, prev_bt = -1, prev_is = 0;
104 uint8_t nextband1[128];
119 float ener0 = 0.0f, ener1 = 0.0f,
ener01 = 0.0f, ener01p = 0.0f;
123 float coef0 = sce0->
coeffs[start+(
w+w2)*128+
i];
124 float coef1 = sce1->
coeffs[start+(
w+w2)*128+
i];
125 ener0 += coef0*coef0;
126 ener1 += coef1*coef1;
127 ener01 += (coef0 + coef1)*(coef0 + coef1);
128 ener01p += (coef0 - coef1)*(coef0 - coef1);
132 ener0, ener1, ener01p, 0, -1);
134 ener0, ener1,
ener01, 0, +1);
135 best = (ph_err1.
pass && ph_err1.
error < ph_err2.
error) ? &ph_err1 : &ph_err2;
int sample_rate
samples per second
uint8_t zeroes[128]
band is not coded
static int ff_sfdelta_can_remove_band(const SingleChannelElement *sce, const uint8_t *nextband, int prev_sf, int band)
SingleChannelElement ch[2]
int num_swb
number of scalefactor window bands
IndividualChannelStream ics
@ NOISE_BT
Spectral data are scaled white noise not coded in the bitstream.
INTFLOAT coeffs[1024]
coefficients for IMDCT, maybe processed
const uint8_t * swb_sizes
table of scalefactor band sizes for a particular window
@ INTENSITY_BT2
Scalefactor data are intensity stereo positions (out of phase).
@ INTENSITY_BT
Scalefactor data are intensity stereo positions (in phase).
uint8_t is_mask[128]
Set if intensity stereo is used.
float is_ener[128]
Intensity stereo pos.
uint8_t ms_mask[128]
Set if mid/side stereo is used for each scalefactor window band.
single band psychoacoustic information
static void ff_init_nextband_map(const SingleChannelElement *sce, uint8_t *nextband)
int sf_idx[128]
scalefactor indices
int common_window
Set if channels share a common 'IndividualChannelStream' in bitstream.
enum BandType band_type[128]
band types
static float pos_pow34(float a)
Single Channel Element - used for both SCE and LFE elements.
#define i(width, name, range_min, range_max)
static int find_min_book(float maxval, int sf)
float pcoeffs[1024]
coefficients for IMDCT, pristine
channel element - generic struct for SCE/CPE/CCE/LFE
void ff_aac_search_for_is(AACEncContext *s, AVCodecContext *avctx, ChannelElement *cpe)
@ RESERVED_BT
Band types following are encoded differently from others.
struct AACISError ff_aac_is_encoding_err(AACEncContext *s, ChannelElement *cpe, int start, int w, int g, float ener0, float ener1, float ener01, int use_pcoeffs, int phase)
#define INT_STEREO_LOW_LIMIT
Frequency in Hz for lower limit of intensity stereo.
main external API structure.
uint8_t is_mode
Set if any bands have been encoded using intensity stereo.
static float quantize_band_cost(struct AACEncContext *s, const float *in, const float *scaled, int size, int scale_idx, int cb, const float lambda, const float uplim, int *bits, float *energy)
static float find_max_val(int group_len, int swb_size, const float *scaled)