comparison wma.h @ 9868:5cc32c474caf libavcodec

Introduce WMACoef typedef for decoded coefficients and change default type to float so that the run level decoding functionality can be shared with wmapro
author faust3
date Sat, 20 Jun 2009 09:05:28 +0000
parents eb5916527064
children 1f6b569bf958
comparison
equal deleted inserted replaced
9867:4ccec8d051fa 9868:5cc32c474caf
48 #define LSP_POW_BITS 7 48 #define LSP_POW_BITS 7
49 49
50 //FIXME should be in wmadec 50 //FIXME should be in wmadec
51 #define VLCBITS 9 51 #define VLCBITS 9
52 #define VLCMAX ((22+VLCBITS-1)/VLCBITS) 52 #define VLCMAX ((22+VLCBITS-1)/VLCBITS)
53
54 typedef float WMACoef; ///< type for decoded coefficients, int16_t would be enough for wma 1/2
53 55
54 typedef struct CoefVLCTable { 56 typedef struct CoefVLCTable {
55 int n; ///< total number of codes 57 int n; ///< total number of codes
56 int max_level; 58 int max_level;
57 const uint32_t *huffcodes; ///< VLC bit values 59 const uint32_t *huffcodes; ///< VLC bit values
109 uint8_t ms_stereo; ///< true if mid/side stereo mode 111 uint8_t ms_stereo; ///< true if mid/side stereo mode
110 uint8_t channel_coded[MAX_CHANNELS]; ///< true if channel is coded 112 uint8_t channel_coded[MAX_CHANNELS]; ///< true if channel is coded
111 int exponents_bsize[MAX_CHANNELS]; ///< log2 ratio frame/exp. length 113 int exponents_bsize[MAX_CHANNELS]; ///< log2 ratio frame/exp. length
112 DECLARE_ALIGNED_16(float, exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]); 114 DECLARE_ALIGNED_16(float, exponents[MAX_CHANNELS][BLOCK_MAX_SIZE]);
113 float max_exponent[MAX_CHANNELS]; 115 float max_exponent[MAX_CHANNELS];
114 int16_t coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE]; 116 WMACoef coefs1[MAX_CHANNELS][BLOCK_MAX_SIZE];
115 DECLARE_ALIGNED_16(float, coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]); 117 DECLARE_ALIGNED_16(float, coefs[MAX_CHANNELS][BLOCK_MAX_SIZE]);
116 DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]); 118 DECLARE_ALIGNED_16(FFTSample, output[BLOCK_MAX_SIZE * 2]);
117 MDCTContext mdct_ctx[BLOCK_NB_SIZES]; 119 MDCTContext mdct_ctx[BLOCK_NB_SIZES];
118 float *windows[BLOCK_NB_SIZES]; 120 float *windows[BLOCK_NB_SIZES];
119 /* output buffer for one frame and the last for IMDCT windowing */ 121 /* output buffer for one frame and the last for IMDCT windowing */
149 int ff_wma_total_gain_to_bits(int total_gain); 151 int ff_wma_total_gain_to_bits(int total_gain);
150 int ff_wma_end(AVCodecContext *avctx); 152 int ff_wma_end(AVCodecContext *avctx);
151 int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb, 153 int ff_wma_run_level_decode(AVCodecContext* avctx, GetBitContext* gb,
152 VLC *vlc, 154 VLC *vlc,
153 const uint16_t *level_table, const uint16_t *run_table, 155 const uint16_t *level_table, const uint16_t *run_table,
154 int version, int16_t *ptr, int offset, 156 int version, WMACoef *ptr, int offset,
155 int num_coefs, int block_len, int frame_len_bits, 157 int num_coefs, int block_len, int frame_len_bits,
156 int coef_nb_bits); 158 int coef_nb_bits);
157 159
158 #endif /* AVCODEC_WMA_H */ 160 #endif /* AVCODEC_WMA_H */