Data Structures | Macros | Typedefs | Functions | Variables
wma.h File Reference
#include "libavutil/float_dsp.h"
#include "libavutil/mem_internal.h"
#include "avcodec.h"
#include "fft.h"
#include "get_bits.h"
#include "put_bits.h"

Go to the source code of this file.

Data Structures

struct  CoefVLCTable
struct  WMACodecContext


#define BLOCK_MIN_BITS   7
#define BLOCK_MAX_BITS   11
#define HIGH_BAND_MAX_SIZE   16
#define NB_LSP_COEFS   10
#define MAX_CHANNELS   2
#define NOISE_TAB_SIZE   8192
#define LSP_POW_BITS   7
#define VLCBITS   9
#define VLCMAX   ((22 + VLCBITS - 1) / VLCBITS)


typedef float WMACoef
 type for decoded coefficients, int16_t would be enough for wma 1/2 More...


av_warn_unused_result int ff_wma_init (AVCodecContext *avctx, int flags2)
int ff_wma_total_gain_to_bits (int total_gain)
int ff_wma_end (AVCodecContext *avctx)
unsigned int ff_wma_get_large_val (GetBitContext *gb)
 Decode an uncompressed coefficient. More...
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. More...


const uint8_t ff_wma_hgain_hufftab [37][2]
const float ff_wma_lsp_codebook [NB_LSP_COEFS][16]
const uint32_t ff_aac_scalefactor_code [121]
const uint8_t ff_aac_scalefactor_bits [121]

Macro Definition Documentation


#define BLOCK_MIN_BITS   7

Definition at line 34 of file wma.h.


#define BLOCK_MAX_BITS   11

Definition at line 35 of file wma.h.



Definition at line 36 of file wma.h.



Definition at line 38 of file wma.h.


#define HIGH_BAND_MAX_SIZE   16

Definition at line 41 of file wma.h.


#define NB_LSP_COEFS   10

Definition at line 43 of file wma.h.



Definition at line 46 of file wma.h.


#define MAX_CHANNELS   2

Definition at line 48 of file wma.h.


#define NOISE_TAB_SIZE   8192

Definition at line 50 of file wma.h.


#define LSP_POW_BITS   7

Definition at line 52 of file wma.h.


#define VLCBITS   9

Definition at line 55 of file wma.h.


#define VLCMAX   ((22 + VLCBITS - 1) / VLCBITS)

Definition at line 56 of file wma.h.

Typedef Documentation

◆ WMACoef

typedef float WMACoef

type for decoded coefficients, int16_t would be enough for wma 1/2

Definition at line 58 of file wma.h.

Function Documentation

◆ ff_wma_init()

av_warn_unused_result int ff_wma_init ( AVCodecContext avctx,
int  flags2 

Definition at line 77 of file wma.c.

Referenced by encode_init(), and wma_decode_init().

◆ ff_wma_total_gain_to_bits()

int ff_wma_total_gain_to_bits ( int  total_gain)

Definition at line 350 of file wma.c.

Referenced by encode_block(), and wma_decode_block().

◆ ff_wma_end()

int ff_wma_end ( AVCodecContext avctx)

Definition at line 364 of file wma.c.

◆ ff_wma_get_large_val()

unsigned int ff_wma_get_large_val ( GetBitContext gb)

Decode an uncompressed coefficient.

the decoded coefficient

consumes up to 34 bits

decode length

Definition at line 392 of file wma.c.

Referenced by decode_coeffs(), and ff_wma_run_level_decode().

◆ ff_wma_run_level_decode()

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.

avctxcodec context
gbbitstream reader context
vlcvlc table for get_vlc2
level_tablelevel codes
run_tablerun codes
version0 for wma1,2 1 for wmapro
ptroutput buffer
offsetoffset in the output buffer
num_coefsnumber of input coefficients
block_leninput buffer length (2^n)
frame_len_bitsnumber of bits for escaped run codes
coef_nb_bitsnumber of bits for escaped level codes
0 on success, -1 otherwise

normal code



NOTE: this is rather suboptimal. reading block_len_bits would be better

escape decode

NOTE: EOB can be omitted

Definition at line 424 of file wma.c.

Referenced by decode_coeffs(), and wma_decode_block().

Variable Documentation

◆ ff_wma_hgain_hufftab

const uint8_t ff_wma_hgain_hufftab[37][2]

Definition at line 54 of file wmadata.h.

Referenced by wma_decode_init().

◆ ff_wma_lsp_codebook

const float ff_wma_lsp_codebook[NB_LSP_COEFS][16]

Definition at line 64 of file wmadata.h.

Referenced by decode_exp_lsp().

◆ ff_aac_scalefactor_code

const uint32_t ff_aac_scalefactor_code[121]

◆ ff_aac_scalefactor_bits

const uint8_t ff_aac_scalefactor_bits[121]