#include "avcodec.h"#include "bitstream.h"#include "dsputil.h"#include "wmadata.h"

Go to the source code of this file.
Data Structures | |
| struct | WMADecodeContext |
| struct | CoefVLCTable |
Defines | |
| #define | BLOCK_MIN_BITS 7 |
| #define | BLOCK_MAX_BITS 11 |
| #define | BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS) |
| #define | BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1) |
| #define | HIGH_BAND_MAX_SIZE 16 |
| #define | NB_LSP_COEFS 10 |
| #define | MAX_CODED_SUPERFRAME_SIZE 16384 |
| #define | MAX_CHANNELS 2 |
| #define | NOISE_TAB_SIZE 8192 |
| #define | LSP_POW_BITS 7 |
Functions | |
| static void | wma_lsp_to_curve_init (WMADecodeContext *s, int frame_len) |
| static void | init_coef_vlc (VLC *vlc, uint16_t **prun_table, uint16_t **plevel_table, const CoefVLCTable *vlc_table) |
| static int | wma_decode_init (AVCodecContext *avctx) |
| static void | interpolate_array (float *scale, int old_size, int new_size) |
| static float | pow_m1_4 (WMADecodeContext *s, float x) |
| static void | wma_lsp_to_curve (WMADecodeContext *s, float *out, float *val_max_ptr, int n, float *lsp) |
| static void | decode_exp_lsp (WMADecodeContext *s, int ch) |
| static int | decode_exp_vlc (WMADecodeContext *s, int ch) |
| static int | wma_decode_block (WMADecodeContext *s) |
| static int | wma_decode_frame (WMADecodeContext *s, int16_t *samples) |
| static int | wma_decode_superframe (AVCodecContext *avctx, void *data, int *data_size, uint8_t *buf, int buf_size) |
| static int | wma_decode_end (AVCodecContext *avctx) |
Variables | |
| AVCodec | wmav1_decoder |
| AVCodec | wmav2_decoder |
To use this decoder, a calling application must supply the extra data bytes provided with the WMA data. These are the extra, codec-specific bytes at the end of a WAVEFORMATEX data structure. Transmit these bytes to the decoder using the extradata[_size] fields in AVCodecContext. There should be 4 extra bytes for v1 data and 6 extra bytes for v2 data.
Definition in file wmadec.c.
| #define BLOCK_MAX_SIZE (1 << BLOCK_MAX_BITS) |
| #define BLOCK_MIN_BITS 7 |
| #define BLOCK_NB_SIZES (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1) |
| #define HIGH_BAND_MAX_SIZE 16 |
| #define LSP_POW_BITS 7 |
| #define MAX_CODED_SUPERFRAME_SIZE 16384 |
| #define NB_LSP_COEFS 10 |
| #define NOISE_TAB_SIZE 8192 |
| static void decode_exp_lsp | ( | WMADecodeContext * | s, | |
| int | ch | |||
| ) | [static] |
Definition at line 641 of file wmadec.c.
References WMADecodeContext::block_len, WMADecodeContext::gb, get_bits(), lsp_codebook, WMADecodeContext::max_exponent, NB_LSP_COEFS, and wma_lsp_to_curve().
Referenced by wma_decode_block().

| static int decode_exp_vlc | ( | WMADecodeContext * | s, | |
| int | ch | |||
| ) | [static] |
Definition at line 659 of file wmadec.c.
References WMADecodeContext::block_len, WMADecodeContext::block_len_bits, WMADecodeContext::exp_vlc, WMADecodeContext::exponent_bands, WMADecodeContext::frame_len_bits, WMADecodeContext::gb, get_bits(), get_vlc(), WMADecodeContext::max_exponent, and WMADecodeContext::version.
Referenced by wma_decode_block().

| static void init_coef_vlc | ( | VLC * | vlc, | |
| uint16_t ** | prun_table, | |||
| uint16_t ** | plevel_table, | |||
| const CoefVLCTable * | vlc_table | |||
| ) | [static] |
Definition at line 174 of file wmadec.c.
References av_malloc(), CoefVLCTable::huffbits, CoefVLCTable::huffcodes, init_vlc(), level, CoefVLCTable::levels, and CoefVLCTable::n.

| static void interpolate_array | ( | float * | scale, | |
| int | old_size, | |||
| int | new_size | |||
| ) | [static] |
| static float pow_m1_4 | ( | WMADecodeContext * | s, | |
| float | x | |||
| ) | [inline, static] |
Definition at line 555 of file wmadec.c.
References a, b, e, LSP_POW_BITS, WMADecodeContext::lsp_pow_e_table, WMADecodeContext::lsp_pow_m_table1, WMADecodeContext::lsp_pow_m_table2, and t.
Referenced by wma_lsp_to_curve(), and wma_lsp_to_curve_init().
| static int wma_decode_block | ( | WMADecodeContext * | s | ) | [static] |
Definition at line 702 of file wmadec.c.
References __attribute__(), a, align_get_bits(), b, WMADecodeContext::block_len, WMADecodeContext::block_len_bits, BLOCK_MAX_SIZE, WMADecodeContext::block_num, WMADecodeContext::block_pos, WMADecodeContext::channel_coded, WMADecodeContext::coef_vlc, WMADecodeContext::coefs1, WMADecodeContext::coefs_end, WMADecodeContext::coefs_start, decode_exp_lsp(), decode_exp_vlc(), WMADecodeContext::exponent_high_bands, WMADecodeContext::exponent_high_sizes, ff_imdct_calc(), WMADecodeContext::frame_len, WMADecodeContext::frame_len_bits, WMADecodeContext::gb, get_bits(), get_vlc(), WMADecodeContext::hgain_vlc, WMADecodeContext::high_band_coded, HIGH_BAND_MAX_SIZE, WMADecodeContext::high_band_start, WMADecodeContext::high_band_values, interpolate_array(), level, WMADecodeContext::level_table, MAX_CHANNELS, WMADecodeContext::max_exponent, WMADecodeContext::mdct_ctx, WMADecodeContext::ms_stereo, mult(), WMADecodeContext::nb_block_sizes, WMADecodeContext::nb_channels, WMADecodeContext::next_block_len_bits, WMADecodeContext::noise_index, WMADecodeContext::noise_mult, NOISE_TAB_SIZE, WMADecodeContext::noise_table, output, parse_exponents(), WMADecodeContext::prev_block_len_bits, WMADecodeContext::reset_block_lengths, run, WMADecodeContext::run_table, tprintf, WMADecodeContext::use_exp_vlc, WMADecodeContext::use_noise_coding, WMADecodeContext::use_variable_block_len, WMADecodeContext::version, window, and WMADecodeContext::windows.
Referenced by wma_decode_frame().

| static int wma_decode_end | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 1288 of file wmadec.c.
References av_free(), WMADecodeContext::coef_vlc, WMADecodeContext::exp_vlc, ff_mdct_end(), free_vlc(), WMADecodeContext::hgain_vlc, WMADecodeContext::level_table, WMADecodeContext::mdct_ctx, WMADecodeContext::nb_block_sizes, AVCodecContext::priv_data, WMADecodeContext::run_table, s, WMADecodeContext::use_exp_vlc, WMADecodeContext::use_noise_coding, and WMADecodeContext::windows.

| static int wma_decode_frame | ( | WMADecodeContext * | s, | |
| int16_t * | samples | |||
| ) | [static] |
Definition at line 1144 of file wmadec.c.
References a, WMADecodeContext::block_num, WMADecodeContext::block_pos, WMADecodeContext::frame_len, lrintf(), WMADecodeContext::nb_channels, tprintf, and wma_decode_block().
Referenced by wma_decode_superframe().

| static int wma_decode_init | ( | AVCodecContext * | avctx | ) | [static] |
Definition at line 206 of file wmadec.c.
References a, av_malloc(), b, AVCodecContext::bit_rate, WMADecodeContext::bit_rate, AVCodecContext::block_align, WMADecodeContext::block_align, BLOCK_MIN_BITS, bps, WMADecodeContext::byte_offset_bits, AVCodecContext::channels, AVCodecContext::codec, CODEC_ID_WMAV1, WMADecodeContext::coefs_end, WMADecodeContext::coefs_start, exponent_band_22050, exponent_band_32000, exponent_band_44100, WMADecodeContext::exponent_bands, WMADecodeContext::exponent_high_bands, WMADecodeContext::exponent_high_sizes, WMADecodeContext::exponent_sizes, AVCodecContext::extradata, AVCodecContext::extradata_size, ff_mdct_init(), WMADecodeContext::frame_len, WMADecodeContext::frame_len_bits, hgain_huffbits, hgain_huffcodes, WMADecodeContext::hgain_vlc, WMADecodeContext::high_band_start, AVCodec::id, init_vlc(), LL, M_PI, WMADecodeContext::mdct_ctx, nb, WMADecodeContext::nb_block_sizes, WMADecodeContext::nb_channels, WMADecodeContext::noise_mult, NOISE_TAB_SIZE, WMADecodeContext::noise_table, NULL, AVCodecContext::priv_data, WMADecodeContext::reset_block_lengths, s, AVCodecContext::sample_rate, WMADecodeContext::sample_rate, tprintf, WMADecodeContext::use_bit_reservoir, WMADecodeContext::use_exp_vlc, WMADecodeContext::use_noise_coding, WMADecodeContext::use_variable_block_len, WMADecodeContext::version, window, WMADecodeContext::windows, and wma_critical_freqs.

| static int wma_decode_superframe | ( | AVCodecContext * | avctx, | |
| void * | data, | |||
| int * | data_size, | |||
| uint8_t * | buf, | |||
| int | buf_size | |||
| ) | [static] |
Definition at line 1195 of file wmadec.c.
References WMADecodeContext::block_align, WMADecodeContext::byte_offset_bits, WMADecodeContext::frame_len, WMADecodeContext::gb, get_bits(), get_bits_count(), init_get_bits(), WMADecodeContext::last_bitoffset, WMADecodeContext::last_superframe, WMADecodeContext::last_superframe_len, MAX_CODED_SUPERFRAME_SIZE, memcpy, WMADecodeContext::nb_channels, AVCodecContext::priv_data, WMADecodeContext::reset_block_lengths, s, samples, skip_bits(), tprintf, WMADecodeContext::use_bit_reservoir, and wma_decode_frame().

| static void wma_lsp_to_curve | ( | WMADecodeContext * | s, | |
| float * | out, | |||
| float * | val_max_ptr, | |||
| int | n, | |||
| float * | lsp | |||
| ) | [static] |
Definition at line 613 of file wmadec.c.
References WMADecodeContext::lsp_cos_table, NB_LSP_COEFS, and pow_m1_4().
Referenced by decode_exp_lsp().

| static void wma_lsp_to_curve_init | ( | WMADecodeContext * | s, | |
| int | frame_len | |||
| ) | [static] |
Definition at line 574 of file wmadec.c.
References a, b, e, WMADecodeContext::lsp_cos_table, LSP_POW_BITS, WMADecodeContext::lsp_pow_e_table, WMADecodeContext::lsp_pow_m_table1, WMADecodeContext::lsp_pow_m_table2, M_PI, pow_m1_4(), r1, and r2.

Initial value:
{
"wmav1",
CODEC_TYPE_AUDIO,
CODEC_ID_WMAV1,
sizeof(WMADecodeContext),
wma_decode_init,
NULL,
wma_decode_end,
wma_decode_superframe,
}
Definition at line 1313 of file wmadec.c.
Referenced by avcodec_register_all().
Initial value:
{
"wmav2",
CODEC_TYPE_AUDIO,
CODEC_ID_WMAV2,
sizeof(WMADecodeContext),
wma_decode_init,
NULL,
wma_decode_end,
wma_decode_superframe,
}
Definition at line 1325 of file wmadec.c.
Referenced by avcodec_register_all().
1.5.5