Go to the documentation of this file.
34 #define BLOCK_MIN_BITS 7
35 #define BLOCK_MAX_BITS 11
36 #define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS)
38 #define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1)
41 #define HIGH_BAND_MAX_SIZE 16
43 #define NB_LSP_COEFS 10
46 #define MAX_CODED_SUPERFRAME_SIZE 32768
48 #define MAX_CHANNELS 2
50 #define NOISE_TAB_SIZE 8192
52 #define LSP_POW_BITS 7
56 #define VLCMAX ((22 + VLCBITS - 1) / VLCBITS)
158 VLC *vlc,
const float *level_table,
159 const uint16_t *run_table,
int version,
161 int block_len,
int frame_len_bits,
int block_len_bits
log2 of current block length
float lsp_pow_m_table2[(1<< LSP_POW_BITS)]
const uint32_t ff_aac_scalefactor_code[121]
int exponent_sizes[BLOCK_NB_SIZES]
unsigned int ff_wma_get_large_val(GetBitContext *gb)
Decode an uncompressed coefficient.
float exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]
const uint8_t ff_aac_scalefactor_bits[121]
float lsp_cos_table[BLOCK_MAX_SIZE]
int n
total number of codes
float noise_table[NOISE_TAB_SIZE]
int high_band_start[BLOCK_NB_SIZES]
index of first coef in high band
const uint8_t * huffbits
VLC bit size.
const uint8_t ff_wma_hgain_hufftab[37][2]
int block_pos
current position in frame
int exponents_initialized[MAX_CHANNELS]
#define HIGH_BAND_MAX_SIZE
float WMACoef
type for decoded coefficients, int16_t would be enough for wma 1/2
int ff_wma_end(AVCodecContext *avctx)
int high_band_values[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]
void(* av_tx_fn)(AVTXContext *s, void *out, void *in, ptrdiff_t stride)
Function pointer to a function to perform the transform.
AVTXContext * mdct_ctx[BLOCK_NB_SIZES]
uint8_t channel_coded[MAX_CHANNELS]
true if channel is coded
int frame_len
frame length in samples
const uint32_t * huffcodes
VLC bit values.
int ff_wma_total_gain_to_bits(int total_gain)
av_tx_fn mdct_fn[BLOCK_NB_SIZES]
uint16_t exponent_bands[BLOCK_NB_SIZES][25]
float lsp_pow_m_table1[(1<< LSP_POW_BITS)]
int nb_block_sizes
number of block sizes
float output[BLOCK_MAX_SIZE *2]
#define MAX_CODED_SUPERFRAME_SIZE
int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE]
#define DECLARE_ALIGNED(n, t, v)
uint8_t ms_stereo
true if mid/side stereo mode
uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE+AV_INPUT_BUFFER_PADDING_SIZE]
int exponent_high_sizes[BLOCK_NB_SIZES]
it s the only field you need to keep assuming you have a context There is some magic you don t need to care about around this just let it vf offset
int block_num
block number in current frame
float lsp_pow_e_table[256]
#define av_warn_unused_result
int frame_len_bits
frame_len = 1 << frame_len_bits
float coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]
int version
1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2)
int use_exp_vlc
exponent coding: 0 = lsp, 1 = vlc + delta
int prev_block_len_bits
log2 of prev block length
WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]
int coefs_start
first coded coef
int use_variable_block_len
#define AV_INPUT_BUFFER_PADDING_SIZE
main external API structure.
int high_band_coded[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]
const float * windows[BLOCK_NB_SIZES]
float frame_out[MAX_CHANNELS][BLOCK_MAX_SIZE *2]
int coefs_end[BLOCK_NB_SIZES]
max number of coded coefficients
av_warn_unused_result int ff_wma_init(AVCodecContext *avctx, int flags2)
int use_noise_coding
true if perceptual noise is added
const float ff_wma_lsp_codebook[NB_LSP_COEFS][16]
int exponents_bsize[MAX_CHANNELS]
log2 ratio frame/exp. length
const CoefVLCTable * coef_vlcs[2]
int next_block_len_bits
log2 of next block length
int ff_wma_run_level_decode(AVCodecContext *avctx, GetBitContext *gb, VLC *vlc, const float *level_table, const uint16_t *run_table, int version, WMACoef *ptr, int offset, int num_coefs, int block_len, int frame_len_bits, int coef_nb_bits)
Decode run level compressed coefficients.
const uint16_t * levels
table to build run/level tables
int block_len
block length in samples
float max_exponent[MAX_CHANNELS]