33 #define BLOCK_MIN_BITS 7
34 #define BLOCK_MAX_BITS 11
35 #define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS)
37 #define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1)
40 #define HIGH_BAND_MAX_SIZE 16
42 #define NB_LSP_COEFS 10
45 #define MAX_CODED_SUPERFRAME_SIZE 32768
47 #define MAX_CHANNELS 2
49 #define NOISE_TAB_SIZE 8192
51 #define LSP_POW_BITS 7
55 #define VLCMAX ((22 + VLCBITS - 1) / VLCBITS)
152 VLC *vlc,
const float *level_table,
153 const uint16_t *run_table,
int version,
155 int block_len,
int frame_len_bits,
int next_block_len_bits
log2 of next block length
unsigned int ff_wma_get_large_val(GetBitContext *gb)
Decode an uncompressed coefficient.
#define DECLARE_ALIGNED(n, t, v)
int block_len
block length in samples
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 uint8_t * huffbits
VLC bit size.
float exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]
int n
total number of codes
float lsp_pow_m_table2[(1<< LSP_POW_BITS)]
float lsp_cos_table[BLOCK_MAX_SIZE]
int high_band_start[BLOCK_NB_SIZES]
index of first coef in high band
int exponent_sizes[BLOCK_NB_SIZES]
float WMACoef
type for decoded coefficients, int16_t would be enough for wma 1/2
int block_pos
current position in frame
const uint32_t * huffcodes
VLC bit values.
bitstream reader API header.
float lsp_pow_m_table1[(1<< LSP_POW_BITS)]
int nb_block_sizes
number of block sizes
uint16_t exponent_bands[BLOCK_NB_SIZES][25]
uint8_t channel_coded[MAX_CHANNELS]
true if channel is coded
uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE+AV_INPUT_BUFFER_PADDING_SIZE]
int ff_wma_total_gain_to_bits(int total_gain)
FFTSample output[BLOCK_MAX_SIZE *2]
const uint8_t ff_wma_hgain_huffbits[37]
static const uint8_t offset[127][2]
Libavcodec external API header.
int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE]
int high_band_values[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]
#define MAX_CODED_SUPERFRAME_SIZE
const uint16_t ff_wma_hgain_huffcodes[37]
int version
1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2)
int frame_len
frame length in samples
int frame_len_bits
frame_len = 1 << frame_len_bits
#define HIGH_BAND_MAX_SIZE
int use_exp_vlc
exponent coding: 0 = lsp, 1 = vlc + delta
main external API structure.
float frame_out[MAX_CHANNELS][BLOCK_MAX_SIZE *2]
int exponent_high_sizes[BLOCK_NB_SIZES]
int block_num
block number in current frame
int use_noise_coding
true if perceptual noise is added
int use_variable_block_len
uint8_t ms_stereo
true if mid/side stereo mode
FFTContext mdct_ctx[BLOCK_NB_SIZES]
int exponents_bsize[MAX_CHANNELS]
log2 ratio frame/exp. length
float coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]
int prev_block_len_bits
log2 of prev block length
int coefs_end[BLOCK_NB_SIZES]
max number of coded coefficients
float lsp_pow_e_table[256]
const float ff_wma_lsp_codebook[NB_LSP_COEFS][16]
#define AV_INPUT_BUFFER_PADDING_SIZE
Required number of additionally allocated bytes at the end of the input bitstream for decoding...
WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]
int ff_wma_init(AVCodecContext *avctx, int flags2)
const uint8_t ff_aac_scalefactor_bits[121]
float max_exponent[MAX_CHANNELS]
const uint32_t ff_aac_scalefactor_code[121]
int ff_wma_end(AVCodecContext *avctx)
int coefs_start
first coded coef
int block_len_bits
log2 of current block length
int high_band_coded[MAX_CHANNELS][HIGH_BAND_MAX_SIZE]
const CoefVLCTable * coef_vlcs[2]
float noise_table[NOISE_TAB_SIZE]
const uint16_t * levels
table to build run/level tables
const float * windows[BLOCK_NB_SIZES]