FFmpeg
|
#include "aac/aacdec.h"
#include "aac/aacdec_tab.h"
#include "avcodec.h"
#include "libavutil/qsort.h"
#include "libavutil/mem.h"
Go to the source code of this file.
Data Structures | |
struct | ExtChannelElement |
Functions | |
static SpectralBandReplication * | get_sbr (ChannelElement *ch) |
av_cold void AAC_RENAME() | ff_aac_sbr_init (void) |
Initialize SBR. More... | |
static void | sbr_turnoff (SpectralBandReplication *sbr) |
Places SBR in pure upsampling mode. More... | |
av_cold int AAC_RENAME() | ff_aac_sbr_ctx_alloc_init (AACDecContext *ac, ChannelElement **che, int id_aac) |
Allocate an ExtChannelElement (if necessary) and initialize the SBR context contained in it. More... | |
av_cold void AAC_RENAME() | ff_aac_sbr_ctx_close (ChannelElement *che) |
Close the SBR context implicitly contained in a ChannelElement. More... | |
static int | qsort_comparison_function_int16 (const void *a, const void *b) |
static int | in_table_int16 (const int16_t *table, int last_el, int16_t needle) |
static void | sbr_make_f_tablelim (SpectralBandReplication *sbr) |
Limiter Frequency Band Table (14496-3 sp04 p198) More... | |
static unsigned int | read_sbr_header (SpectralBandReplication *sbr, GetBitContext *gb, int is_usac) |
static int | array_min_int16 (const int16_t *array, int nel) |
static int | check_n_master (AVCodecContext *avctx, int n_master, int bs_xover_band) |
static int | sbr_make_f_master (AACDecContext *ac, SpectralBandReplication *sbr, SpectrumParameters *spectrum) |
Master Frequency Band Table (14496-3 sp04 p194) More... | |
static int | sbr_hf_calc_npatches (AACDecContext *ac, SpectralBandReplication *sbr) |
High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46) More... | |
static int | sbr_make_f_derived (AACDecContext *ac, SpectralBandReplication *sbr) |
Derived Frequency Band Tables (14496-3 sp04 p197) More... | |
static av_always_inline void | get_bits1_vector (GetBitContext *gb, uint8_t *vec, int elements) |
static int | read_sbr_grid (AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data) |
static void | copy_sbr_grid (SBRData *dst, const SBRData *src) |
static void | read_sbr_dtdf (SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data, int indep_flag) |
Read how the envelope and noise floor data is delta coded. More... | |
static void | read_sbr_invf (SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data) |
Read inverse filtering data. More... | |
static int | read_sbr_envelope (AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data, int ch) |
static int | read_sbr_noise (AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, SBRData *ch_data, int ch) |
static void | read_sbr_extension (AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, int bs_extension_id, int *num_bits_left) |
static int | read_sbr_single_channel_element (AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb) |
static int | read_sbr_channel_pair_element (AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb) |
static unsigned int | read_sbr_data (AACDecContext *ac, SpectralBandReplication *sbr, GetBitContext *gb, int id_aac) |
static void | sbr_reset (AACDecContext *ac, SpectralBandReplication *sbr) |
int AAC_RENAME() | ff_aac_sbr_decode_extension (AACDecContext *ac, ChannelElement *che, GetBitContext *gb_host, int crc, int cnt, int id_aac) |
Decode Spectral Band Replication extension data; reference: table 4.55. More... | |
static void | copy_usac_default_header (SpectralBandReplication *sbr, AACUsacElemConfig *ue) |
int | ff_aac_sbr_config_usac (AACDecContext *ac, ChannelElement *che, AACUsacElemConfig *ue) |
Due to channel allocation not being known upon SBR parameter transmission, supply the parameters separately. More... | |
int | ff_aac_sbr_decode_usac_data (AACDecContext *ac, ChannelElement *che, AACUsacElemConfig *ue, GetBitContext *gb, int sbr_ch, int indep_flag) |
Decode frame SBR data, USAC. More... | |
static void | sbr_qmf_analysis (AVFloatDSPContext *dsp, AVTXContext *mdct, av_tx_fn mdct_fn, SBRDSPContext *sbrdsp, const INTFLOAT *in, INTFLOAT *x, INTFLOAT z[320], INTFLOAT W[2][32][32][2], int buf_idx) |
Analysis QMF Bank (14496-3 sp04 p206) More... | |
static void | sbr_qmf_synthesis (AVTXContext *mdct, av_tx_fn mdct_fn, SBRDSPContext *sbrdsp, AVFloatDSPContext *dsp, INTFLOAT *out, INTFLOAT X[2][38][64], INTFLOAT mdct_buf[2][64], INTFLOAT *v0, int *v_off, const unsigned int div) |
Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank (14496-3 sp04 p206) More... | |
static int | sbr_lf_gen (SpectralBandReplication *sbr, INTFLOAT X_low[32][40][2], const INTFLOAT W[2][32][32][2], int buf_idx) |
Generate the subband filtered lowband. More... | |
static int | sbr_hf_gen (AACDecContext *ac, SpectralBandReplication *sbr, INTFLOAT X_high[64][40][2], const INTFLOAT X_low[32][40][2], const INTFLOAT(*alpha0)[2], const INTFLOAT(*alpha1)[2], const INTFLOAT bw_array[5], const uint8_t *t_env, int bs_num_env) |
High Frequency Generator (14496-3 sp04 p215) More... | |
static int | sbr_x_gen (SpectralBandReplication *sbr, INTFLOAT X[2][38][64], const INTFLOAT Y0[38][64][2], const INTFLOAT Y1[38][64][2], const INTFLOAT X_low[32][40][2], int ch) |
Generate the subband filtered lowband. More... | |
static int | sbr_mapping (AACDecContext *ac, SpectralBandReplication *sbr, SBRData *ch_data, int e_a[2]) |
High Frequency Adjustment (14496-3 sp04 p217) and Mapping (14496-3 sp04 p217) More... | |
static void | sbr_env_estimate (AAC_FLOAT(*e_curr)[48], INTFLOAT X_high[64][40][2], SpectralBandReplication *sbr, SBRData *ch_data) |
Estimation of current envelope (14496-3 sp04 p218) More... | |
void AAC_RENAME() | ff_aac_sbr_apply (AACDecContext *ac, ChannelElement *che, int id_aac, void *L_, void *R_) |
Apply one SBR element to one AAC element. More... | |
static void | aacsbr_func_ptr_init (AACSBRContext *c) |
Variables | |
static const int8_t | ceil_log2 [] |
ceil(log2(index+1)) More... | |
AAC Spectral Band Replication decoding functions
Definition in file aacsbr_template.c.
|
inlinestatic |
Definition at line 47 of file aacsbr_template.c.
Referenced by ff_aac_sbr_apply(), ff_aac_sbr_config_usac(), ff_aac_sbr_ctx_close(), ff_aac_sbr_decode_extension(), and ff_aac_sbr_decode_usac_data().
av_cold void AAC_RENAME() ff_aac_sbr_init | ( | void | ) |
Initialize SBR.
Definition at line 52 of file aacsbr_template.c.
Referenced by init_tables_float_fn().
|
static |
Places SBR in pure upsampling mode.
Definition at line 58 of file aacsbr_template.c.
Referenced by ff_aac_sbr_apply(), ff_aac_sbr_config_usac(), ff_aac_sbr_ctx_alloc_init(), ff_aac_sbr_decode_extension(), read_sbr_data(), sbr_mapping(), and sbr_reset().
av_cold int AAC_RENAME() ff_aac_sbr_ctx_alloc_init | ( | AACDecContext * | ac, |
ChannelElement ** | che, | ||
int | id_aac | ||
) |
Allocate an ExtChannelElement (if necessary) and initialize the SBR context contained in it.
Definition at line 70 of file aacsbr_template.c.
av_cold void AAC_RENAME() ff_aac_sbr_ctx_close | ( | ChannelElement * | che | ) |
Close the SBR context implicitly contained in a ChannelElement.
Definition at line 115 of file aacsbr_template.c.
|
static |
Definition at line 122 of file aacsbr_template.c.
Referenced by sbr_make_f_master(), and sbr_make_f_tablelim().
|
inlinestatic |
Definition at line 127 of file aacsbr_template.c.
Referenced by sbr_make_f_tablelim().
|
static |
Limiter Frequency Band Table (14496-3 sp04 p198)
Definition at line 137 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), read_sbr_header(), and sbr_make_f_derived().
|
static |
Definition at line 188 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_extension(), and ff_aac_sbr_decode_usac_data().
|
static |
Definition at line 249 of file aacsbr_template.c.
Referenced by sbr_make_f_master().
|
static |
Definition at line 257 of file aacsbr_template.c.
Referenced by sbr_make_f_master().
|
static |
Master Frequency Band Table (14496-3 sp04 p194)
Definition at line 274 of file aacsbr_template.c.
Referenced by sbr_reset().
|
static |
High Frequency Generation - Patch Construction (14496-3 sp04 p216 fig. 4.46)
Definition at line 494 of file aacsbr_template.c.
Referenced by sbr_make_f_derived().
|
static |
Derived Frequency Band Tables (14496-3 sp04 p197)
Definition at line 552 of file aacsbr_template.c.
Referenced by sbr_reset().
|
static |
Definition at line 623 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), read_sbr_channel_pair_element(), read_sbr_dtdf(), read_sbr_grid(), and read_sbr_single_channel_element().
|
static |
Definition at line 637 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), read_sbr_channel_pair_element(), and read_sbr_single_channel_element().
Definition at line 784 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), and read_sbr_channel_pair_element().
|
static |
Read how the envelope and noise floor data is delta coded.
Definition at line 802 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), read_sbr_channel_pair_element(), and read_sbr_single_channel_element().
|
static |
Read inverse filtering data.
Definition at line 826 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), read_sbr_channel_pair_element(), and read_sbr_single_channel_element().
|
static |
Definition at line 836 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), read_sbr_channel_pair_element(), and read_sbr_single_channel_element().
|
static |
Definition at line 923 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data(), read_sbr_channel_pair_element(), and read_sbr_single_channel_element().
|
static |
Definition at line 965 of file aacsbr_template.c.
Referenced by read_sbr_data().
|
static |
Definition at line 992 of file aacsbr_template.c.
Referenced by read_sbr_data().
|
static |
Definition at line 1016 of file aacsbr_template.c.
Referenced by read_sbr_data().
|
static |
Definition at line 1068 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_extension().
|
static |
Definition at line 1112 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_extension(), and ff_aac_sbr_decode_usac_data().
int AAC_RENAME() ff_aac_sbr_decode_extension | ( | AACDecContext * | ac, |
ChannelElement * | che, | ||
GetBitContext * | gb_host, | ||
int | crc, | ||
int | cnt, | ||
int | id_aac | ||
) |
Decode Spectral Band Replication extension data; reference: table 4.55.
Decode one SBR element.
crc | flag indicating the presence of CRC checksum |
cnt | length of TYPE_FIL syntactic element in bytes |
Definition at line 1133 of file aacsbr_template.c.
|
static |
Definition at line 1182 of file aacsbr_template.c.
Referenced by ff_aac_sbr_decode_usac_data().
int ff_aac_sbr_config_usac | ( | AACDecContext * | ac, |
ChannelElement * | che, | ||
AACUsacElemConfig * | ue | ||
) |
Due to channel allocation not being known upon SBR parameter transmission, supply the parameters separately.
Functionally identical to ff_aac_sbr_decode_extension()
Definition at line 1200 of file aacsbr_template.c.
Referenced by ff_aac_usac_reset_state().
int ff_aac_sbr_decode_usac_data | ( | AACDecContext * | ac, |
ChannelElement * | che, | ||
AACUsacElemConfig * | ue, | ||
GetBitContext * | gb, | ||
int | sbr_ch, | ||
int | indep_flag | ||
) |
Decode frame SBR data, USAC.
Definition at line 1208 of file aacsbr_template.c.
Referenced by decode_usac_core_coder().
|
static |
Analysis QMF Bank (14496-3 sp04 p206)
x | pointer to the beginning of the first sample window |
W | array of complex-valued samples split into subbands |
Definition at line 1362 of file aacsbr_template.c.
Referenced by ff_aac_sbr_apply().
|
static |
Synthesis QMF Bank (14496-3 sp04 p206) and Downsampled Synthesis QMF Bank (14496-3 sp04 p206)
Definition at line 1406 of file aacsbr_template.c.
Referenced by ff_aac_sbr_apply().
|
static |
Generate the subband filtered lowband.
Definition at line 1458 of file aacsbr_template.c.
Referenced by aacsbr_func_ptr_init().
|
static |
High Frequency Generator (14496-3 sp04 p215)
Definition at line 1483 of file aacsbr_template.c.
Referenced by ff_aac_sbr_apply().
|
static |
Generate the subband filtered lowband.
Definition at line 1518 of file aacsbr_template.c.
Referenced by aacsbr_func_ptr_init().
|
static |
High Frequency Adjustment (14496-3 sp04 p217) and Mapping (14496-3 sp04 p217)
Definition at line 1557 of file aacsbr_template.c.
Referenced by ff_aac_sbr_apply().
|
static |
Estimation of current envelope (14496-3 sp04 p218)
Definition at line 1612 of file aacsbr_template.c.
Referenced by ff_aac_sbr_apply().
void AAC_RENAME() ff_aac_sbr_apply | ( | AACDecContext * | ac, |
ChannelElement * | che, | ||
int | id_aac, | ||
void * | L_, | ||
void * | R_ | ||
) |
Apply one SBR element to one AAC element.
Definition at line 1671 of file aacsbr_template.c.
|
static |
Definition at line 1767 of file aacsbr_template.c.
Referenced by ff_aac_sbr_ctx_alloc_init().
|
static |
ceil(log2(index+1))
Definition at line 633 of file aacsbr_template.c.
Referenced by read_sbr_grid().