Go to the documentation of this file.
41 union {
unsigned u;
int s; } v = { previous_val * 1664525
u + 1013904223 };
63 INTFLOAT *coef = sce->AAC_RENAME(coeffs);
67 const INTFLOAT *sf = sce->AAC_RENAME(sf);
68 const enum BandType *band_type = sce->band_type;
79 const unsigned cbt_m1 = band_type[idx] - 1;
85 for (group = 0; group < (
AAC_SIGNE)g_len; group++, cfo+=128) {
86 memset(cfo, 0, off_len *
sizeof(*cfo));
89 for (group = 0; group < (
AAC_SIGNE)g_len; group++, cfo+=128) {
92 for (k = 0; k < off_len; k++) {
93 ac->random_state =
lcg_random(ac->random_state);
94 cfo[k] = ac->random_state >> 3;
97 band_energy = ac->fdsp->scalarproduct_fixed(cfo, cfo, off_len);
103 for (k = 0; k < off_len; k++) {
104 ac->random_state =
lcg_random(ac->random_state);
105 cfo[k] = ac->random_state;
108 band_energy = ac->fdsp->scalarproduct_float(cfo, cfo, off_len);
110 ac->fdsp->vector_fmul_scalar(cfo, cfo,
scale, off_len);
120 switch (cbt_m1 >> 1) {
122 for (group = 0; group < (
AAC_SIGNE)g_len; group++, cfo+=128) {
136 cf =
VMUL4(cf, vq, cb_idx, sf + idx);
143 for (group = 0; group < (
AAC_SIGNE)g_len; group++, cfo+=128) {
156 nnz = cb_idx >> 8 & 15;
169 for (group = 0; group < (
AAC_SIGNE)g_len; group++, cfo+=128) {
183 cf =
VMUL2(cf, vq, cb_idx, sf + idx);
191 for (group = 0; group < (
AAC_SIGNE)g_len; group++, cfo+=128) {
204 nnz = cb_idx >> 8 & 15;
205 sign = nnz ?
SHOW_UBITS(re, gb, nnz) << (cb_idx >> 12) : 0;
210 cf =
VMUL2S(cf, vq, cb_idx, sign, sf + idx);
217 for (group = 0; group < (
AAC_SIGNE)g_len; group++, cfo+=128) {
223 uint32_t *icf = (uint32_t *) cf;
238 if (cb_idx == 0x0000) {
249 for (j = 0; j < 2; j++) {
284 unsigned v = ((
const uint32_t*)vq)[cb_idx & 15];
285 *icf++ = (
bits & 1
U<<31) | v;
293 ac->fdsp->vector_fmul_scalar(cfo, cfo, sf[idx], off_len);
306 for (
i = 0;
i < pulse->num_pulse;
i++) {
307 INTFLOAT co = coef_base[ pulse->pos[
i] ];
308 while (
offsets[idx + 1] <= pulse->pos[
i])
310 if (band_type[idx] !=
NOISE_BT && sf[idx]) {
314 ico = co + (co > 0 ? -ico : ico);
316 coef_base[ pulse->pos[
i] ] = ico;
322 coef_base[ pulse->pos[
i] ] =
cbrtf(
fabsf(ico)) * ico * sf[idx];
334 const unsigned cbt_m1 = band_type[idx] - 1;
340 for (group = 0; group < (int)g_len; group++, cfo+=128) {
391 for (
c = 0;
c < num_gain;
c++) {
401 if ((
abs(gain_cache)-1024) >> 3 > 30)
406 coup->gain[
c][0] = gain_cache;
409 for (sfb = 0; sfb < sce->
ics.
max_sfb; sfb++, idx++) {
422 if ((
abs(gain_cache)-1024) >> 3 > 30)
427 coup->gain[
c][idx] = gain_cache;
438 #define SET(member) aac_proc->member = AAC_RENAME(member)
442 #define SET(member) aac_proc->member = AV_JOIN(ff_aac_, AAC_RENAME(member));
443 SET(sbr_ctx_alloc_init);
444 SET(sbr_decode_extension);
enum RawDataBlockType type[8]
Type of channel element to be coupled - SCE or CPE.
static int AAC_RENAME() decode_spectrum_and_dequant(AACDecContext *ac, GetBitContext *gb, const Pulse *pulse, SingleChannelElement *sce)
Decode spectral data; reference: table 4.50.
Filter the word “frame” indicates either a video frame or a group of audio as stored in an AVFrame structure Format for each input and each output the list of supported formats For video that means pixel format For audio that means channel sample they are references to shared objects When the negotiation mechanism computes the intersection of the formats supported at each end of a all references to both lists are replaced with a reference to the intersection And when a single format is eventually chosen for a link amongst the remaining all references to the list are updated That means that if a filter requires that its input and output have the same format amongst a supported all it has to do is use a reference to the same list of formats query_formats can leave some formats unset and return AVERROR(EAGAIN) to cause the negotiation mechanism toagain later. That can be used by filters with complex requirements to use the format negotiated on one link to set the formats supported on another. Frame references ownership and permissions
static float * VMUL2(float *dst, const float *v, unsigned idx, const float *scale)
Dequantization-related.
#define u(width, name, range_min, range_max)
static av_cold void AAC_RENAME() aac_proc_init(AACDecProc *aac_proc)
const float *const ff_aac_codebook_vector_vals[]
static int * DEC_UQUAD(int *dst, unsigned idx, unsigned sign)
#define GET_VLC(code, name, gb, table, bits, max_depth)
If the vlc code is invalid and max_depth=1, then no bits will be removed.
static float * VMUL2S(float *dst, const float *v, unsigned idx, unsigned sign, const float *scale)
static int AAC_RENAME() decode_cce(AACDecContext *ac, GetBitContext *gb, ChannelElement *che)
Decode coupling_channel_element; reference: table 4.8.
#define UPDATE_CACHE(name, gb)
int ff_aac_decode_ics(AACDecContext *ac, SingleChannelElement *sce, GetBitContext *gb, int common_window, int scale_flag)
Decode an individual_channel_stream payload; reference: table 4.44.
static void vector_pow43(int *coefs, int len)
#define GET_CACHE(name, gb)
static unsigned int get_bits(GetBitContext *s, int n)
Read 1-25 bits.
enum CouplingPoint coupling_point
The point during decoding at which coupling is applied.
int id_select[8]
element id
static int * DEC_SQUAD(int *dst, unsigned idx)
static void noise_scale(int *coefs, int scale, int band_energy, int len)
static __device__ float fabsf(float a)
IndividualChannelStream ics
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ ZERO_BT
Scalefactors and spectral data are all zero.
#define CLOSE_READER(name, gb)
@ NOISE_BT
Spectral data are scaled white noise not coded in the bitstream.
static const int offsets[]
int num_coupled
number of target elements
@ INTENSITY_BT2
Scalefactor data are intensity stereo positions (out of phase).
static float * VMUL4(float *dst, const float *v, unsigned idx, const float *scale)
#define SKIP_BITS(name, gb, num)
Individual Channel Stream.
static int * DEC_UPAIR(int *dst, unsigned idx, unsigned sign)
static unsigned int get_bits1(GetBitContext *s)
#define LAST_SKIP_BITS(name, gb, num)
static __device__ float sqrtf(float a)
static av_always_inline int get_vlc2(GetBitContext *s, const VLCElem *table, int bits, int max_depth)
Parse a vlc code.
Undefined Behavior In the C some operations are like signed integer dereferencing freed accessing outside allocated Undefined Behavior must not occur in a C it is not safe even if the output of undefined operations is unused The unsafety may seem nit picking but Optimizing compilers have in fact optimized code on the assumption that no undefined Behavior occurs Optimizing code based on wrong assumptions can and has in some cases lead to effects beyond the output of computations The signed integer overflow problem in speed critical code Code which is highly optimized and works with signed integers sometimes has the problem that often the output of the computation does not c
uint32_t ff_cbrt_tab[1<< 13]
static void subband_scale(int *dst, int *src, int scale, int offset, int len, void *log_context)
#define OPEN_READER(name, gb)
static int * DEC_SPAIR(int *dst, unsigned idx)
enum BandType band_type[128]
band types
static float * VMUL4S(float *dst, const float *v, unsigned idx, unsigned sign, const float *scale)
Single Channel Element - used for both SCE and LFE elements.
#define i(width, name, range_min, range_max)
and forward the test the status of outputs and forward it to the corresponding return FFERROR_NOT_READY If the filters stores internally one or a few frame for some it can consider them to be part of the FIFO and delay acknowledging a status change accordingly Example code
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...
static av_always_inline float cbrtf(float x)
int ch_select[8]
[0] shared list of gains; [1] list of gains for right channel; [2] list of gains for left channel; [3...
main AAC decoding context
static const float cce_scale[]
#define SHOW_UBITS(name, gb, num)
static av_always_inline int lcg_random(unsigned previous_val)
linear congruential pseudorandom number generator
static void scale(int *out, const int *in, const int w, const int h, const int shift)
const VLCElem * ff_vlc_spectral[11]
VLCElem ff_vlc_scalefactors[352]
Decode-specific primitives.
uint8_t max_sfb
number of scalefactor bands per group
#define AVERROR_INVALIDDATA
Invalid data found when processing input.
static av_always_inline int fixed_sqrt(int x, int bits)
Calculate the square root.