comparison wma.h @ 4497:3975e734e07e libavcodec

doxygenize
author michael
date Wed, 07 Feb 2007 14:53:25 +0000
parents 0efc832d9102
children 6ac364a4ce2b
comparison
equal deleted inserted replaced
4496:a02a0d06e99b 4497:3975e734e07e
49 //FIXME should be in wmadec 49 //FIXME should be in wmadec
50 #define VLCBITS 9 50 #define VLCBITS 9
51 #define VLCMAX ((22+VLCBITS-1)/VLCBITS) 51 #define VLCMAX ((22+VLCBITS-1)/VLCBITS)
52 52
53 typedef struct CoefVLCTable { 53 typedef struct CoefVLCTable {
54 int n; /* total number of codes */ 54 int n; ///< total number of codes
55 int max_level; 55 int max_level;
56 const uint32_t *huffcodes; /* VLC bit values */ 56 const uint32_t *huffcodes; ///< VLC bit values
57 const uint8_t *huffbits; /* VLC bit size */ 57 const uint8_t *huffbits; ///< VLC bit size
58 const uint16_t *levels; /* table to build run/level tables */ 58 const uint16_t *levels; ///< table to build run/level tables
59 } CoefVLCTable; 59 } CoefVLCTable;
60 60
61 typedef struct WMADecodeContext { 61 typedef struct WMADecodeContext {
62 GetBitContext gb; 62 GetBitContext gb;
63 PutBitContext pb; 63 PutBitContext pb;
64 int sample_rate; 64 int sample_rate;
65 int nb_channels; 65 int nb_channels;
66 int bit_rate; 66 int bit_rate;
67 int version; /* 1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2) */ 67 int version; ///< 1 = 0x160 (WMAV1), 2 = 0x161 (WMAV2)
68 int block_align; 68 int block_align;
69 int use_bit_reservoir; 69 int use_bit_reservoir;
70 int use_variable_block_len; 70 int use_variable_block_len;
71 int use_exp_vlc; /* exponent coding: 0 = lsp, 1 = vlc + delta */ 71 int use_exp_vlc; ///< exponent coding: 0 = lsp, 1 = vlc + delta
72 int use_noise_coding; /* true if perceptual noise is added */ 72 int use_noise_coding; ///< true if perceptual noise is added
73 int byte_offset_bits; 73 int byte_offset_bits;
74 VLC exp_vlc; 74 VLC exp_vlc;
75 int exponent_sizes[BLOCK_NB_SIZES]; 75 int exponent_sizes[BLOCK_NB_SIZES];
76 uint16_t exponent_bands[BLOCK_NB_SIZES][25]; 76 uint16_t exponent_bands[BLOCK_NB_SIZES][25];
77 int high_band_start[BLOCK_NB_SIZES]; /* index of first coef in high band */ 77 int high_band_start[BLOCK_NB_SIZES]; ///< index of first coef in high band
78 int coefs_start; /* first coded coef */ 78 int coefs_start; ///< first coded coef
79 int coefs_end[BLOCK_NB_SIZES]; /* max number of coded coefficients */ 79 int coefs_end[BLOCK_NB_SIZES]; ///< max number of coded coefficients
80 int exponent_high_sizes[BLOCK_NB_SIZES]; 80 int exponent_high_sizes[BLOCK_NB_SIZES];
81 int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE]; 81 int exponent_high_bands[BLOCK_NB_SIZES][HIGH_BAND_MAX_SIZE];
82 VLC hgain_vlc; 82 VLC hgain_vlc;
83 83
84 /* coded values in high bands */ 84 /* coded values in high bands */
91 uint16_t *run_table[2]; 91 uint16_t *run_table[2];
92 uint16_t *level_table[2]; 92 uint16_t *level_table[2];
93 uint16_t *int_table[2]; 93 uint16_t *int_table[2];
94 CoefVLCTable *coef_vlcs[2]; 94 CoefVLCTable *coef_vlcs[2];
95 /* frame info */ 95 /* frame info */
96 int frame_len; /* frame length in samples */ 96 int frame_len; ///< frame length in samples
97 int frame_len_bits; /* frame_len = 1 << frame_len_bits */ 97 int frame_len_bits; ///< frame_len = 1 << frame_len_bits
98 int nb_block_sizes; /* number of block sizes */ 98 int nb_block_sizes; ///< number of block sizes
99 /* block info */ 99 /* block info */
100 int reset_block_lengths; 100 int reset_block_lengths;
101 int block_len_bits; /* log2 of current block length */ 101 int block_len_bits; ///< log2 of current block length
102 int next_block_len_bits; /* log2 of next block length */ 102 int next_block_len_bits; ///< log2 of next block length
103 int prev_block_len_bits; /* log2 of prev block length */ 103 int prev_block_len_bits; ///< log2 of prev block length
104 int block_len; /* block length in samples */ 104 int block_len; ///< block length in samples
105 int block_num; /* block number in current frame */ 105 int block_num; ///< block number in current frame
106 int block_pos; /* current position in frame */ 106 int block_pos; ///< current position in frame
107 uint8_t ms_stereo; /* true if mid/side stereo mode */ 107 uint8_t ms_stereo; ///< true if mid/side stereo mode
108 uint8_t channel_coded[MAX_CHANNELS]; /* true if channel is coded */ 108 uint8_t channel_coded[MAX_CHANNELS]; ///< true if channel is coded
109 DECLARE_ALIGNED_16(float, exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]); 109 DECLARE_ALIGNED_16(float, exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]);
110 float max_exponent[MAX_CHANNELS]; 110 float max_exponent[MAX_CHANNELS];
111 int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]; 111 int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
112 DECLARE_ALIGNED_16(float, coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]); 112 DECLARE_ALIGNED_16(float, coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]);
113 DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]); 113 DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]);
114 DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]); 114 DECLARE_ALIGNED_16(float, window[BLOCK_MAX_SIZE * 2]);
115 MDCTContext mdct_ctx[BLOCK_NB_SIZES]; 115 MDCTContext mdct_ctx[BLOCK_NB_SIZES];
116 float *windows[BLOCK_NB_SIZES]; 116 float *windows[BLOCK_NB_SIZES];
117 DECLARE_ALIGNED_16(FFTSample, mdct_tmp[BLOCK_MAX_SIZE]); /* temporary storage for imdct */ 117 DECLARE_ALIGNED_16(FFTSample, mdct_tmp[BLOCK_MAX_SIZE]); ///< temporary storage for imdct
118 /* output buffer for one frame and the last for IMDCT windowing */ 118 /* output buffer for one frame and the last for IMDCT windowing */
119 DECLARE_ALIGNED_16(float, frame_out[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]); 119 DECLARE_ALIGNED_16(float, frame_out[MAX_CHANNELS][BLOCK_MAX_SIZE * 2]);
120 /* last frame info */ 120 /* last frame info */
121 uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4]; /* padding added */ 121 uint8_t last_superframe[MAX_CODED_SUPERFRAME_SIZE + 4]; /* padding added */
122 int last_bitoffset; 122 int last_bitoffset;