hvirtual/quicktime/ffmpeg/libavcodec/wmadec.c File Reference

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

Include dependency graph for wmadec.c:

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


Detailed Description

WMA compatible decoder. This decoder handles Microsoft Windows Media Audio data, versions 1 & 2. WMA v1 is identified by audio format 0x160 in Microsoft media files (ASF/AVI/WAV). WMA v2 is identified by audio format 0x161.

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 Documentation

#define BLOCK_MAX_BITS   11

Definition at line 40 of file wmadec.c.

#define BLOCK_MAX_SIZE   (1 << BLOCK_MAX_BITS)

Definition at line 41 of file wmadec.c.

Referenced by wma_decode_block().

#define BLOCK_MIN_BITS   7

Definition at line 39 of file wmadec.c.

Referenced by wma_decode_init().

#define BLOCK_NB_SIZES   (BLOCK_MAX_BITS - BLOCK_MIN_BITS + 1)

Definition at line 43 of file wmadec.c.

#define HIGH_BAND_MAX_SIZE   16

Definition at line 46 of file wmadec.c.

Referenced by wma_decode_block().

#define LSP_POW_BITS   7

Definition at line 57 of file wmadec.c.

Referenced by pow_m1_4(), and wma_lsp_to_curve_init().

#define MAX_CHANNELS   2

Definition at line 53 of file wmadec.c.

#define MAX_CODED_SUPERFRAME_SIZE   16384

Definition at line 51 of file wmadec.c.

Referenced by wma_decode_superframe().

#define NB_LSP_COEFS   10

Definition at line 48 of file wmadec.c.

Referenced by decode_exp_lsp(), and wma_lsp_to_curve().

#define NOISE_TAB_SIZE   8192

Definition at line 55 of file wmadec.c.

Referenced by wma_decode_block(), and wma_decode_init().


Function Documentation

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().

Here is the call graph for this function:

static int decode_exp_vlc ( WMADecodeContext s,
int  ch 
) [static]

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.

Here is the call graph for this function:

static void interpolate_array ( float *  scale,
int  old_size,
int  new_size 
) [static]

Definition at line 526 of file wmadec.c.

Referenced by wma_decode_block().

static float pow_m1_4 ( WMADecodeContext s,
float  x 
) [inline, static]

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().

Here is the call graph for this function:

static int wma_decode_end ( AVCodecContext avctx  )  [static]

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().

Here is the call graph for this function:

static int wma_decode_init ( AVCodecContext avctx  )  [static]

static int wma_decode_superframe ( AVCodecContext avctx,
void *  data,
int *  data_size,
uint8_t *  buf,
int  buf_size 
) [static]

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().

Here is the call graph for this function:

static void wma_lsp_to_curve_init ( WMADecodeContext s,
int  frame_len 
) [static]


Variable Documentation

Initial value:

Definition at line 1313 of file wmadec.c.

Referenced by avcodec_register_all().

Initial value:

Definition at line 1325 of file wmadec.c.

Referenced by avcodec_register_all().


Generated on Mon Apr 28 14:06:41 2008 for Cinelerra by  doxygen 1.5.5