1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2025-01-13 21:28:01 +02:00

Rename WMADecodeContext to WMACodecContext

Originally committed as revision 8143 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michel Bardiaux 2007-02-27 09:54:48 +00:00
parent a9c9a2400b
commit 911b9faf31
4 changed files with 25 additions and 25 deletions

View File

@ -64,7 +64,7 @@ static void init_coef_vlc(VLC *vlc,
int ff_wma_init(AVCodecContext * avctx, int flags2) int ff_wma_init(AVCodecContext * avctx, int flags2)
{ {
WMADecodeContext *s = avctx->priv_data; WMACodecContext *s = avctx->priv_data;
int i; int i;
float *window; float *window;
float bps1, high_freq; float bps1, high_freq;
@ -362,7 +362,7 @@ int ff_wma_total_gain_to_bits(int total_gain){
int ff_wma_end(AVCodecContext *avctx) int ff_wma_end(AVCodecContext *avctx)
{ {
WMADecodeContext *s = avctx->priv_data; WMACodecContext *s = avctx->priv_data;
int i; int i;
for(i = 0; i < s->nb_block_sizes; i++) for(i = 0; i < s->nb_block_sizes; i++)

View File

@ -58,7 +58,7 @@ typedef struct CoefVLCTable {
const uint16_t *levels; ///< table to build run/level tables const uint16_t *levels; ///< table to build run/level tables
} CoefVLCTable; } CoefVLCTable;
typedef struct WMADecodeContext { typedef struct WMACodecContext {
AVCodecContext* avctx; AVCodecContext* avctx;
GetBitContext gb; GetBitContext gb;
PutBitContext pb; PutBitContext pb;
@ -135,7 +135,7 @@ typedef struct WMADecodeContext {
#ifdef TRACE #ifdef TRACE
int frame_count; int frame_count;
#endif #endif
} WMADecodeContext; } WMACodecContext;
extern const uint16_t ff_wma_hgain_huffcodes[37]; extern const uint16_t ff_wma_hgain_huffcodes[37];
extern const uint8_t ff_wma_hgain_huffbits[37]; extern const uint8_t ff_wma_hgain_huffbits[37];

View File

@ -45,7 +45,7 @@
#define HGAINVLCBITS 9 #define HGAINVLCBITS 9
#define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS) #define HGAINMAX ((13+HGAINVLCBITS-1)/HGAINVLCBITS)
static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len); static void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len);
#ifdef TRACE #ifdef TRACE
static void dump_shorts(WMADecodeContext *s, const char *name, const short *tab, int n) static void dump_shorts(WMADecodeContext *s, const char *name, const short *tab, int n)
@ -81,7 +81,7 @@ static void dump_floats(WMADecodeContext *s, const char *name, int prec, const f
static int wma_decode_init(AVCodecContext * avctx) static int wma_decode_init(AVCodecContext * avctx)
{ {
WMADecodeContext *s = avctx->priv_data; WMACodecContext *s = avctx->priv_data;
int i, flags1, flags2; int i, flags1, flags2;
uint8_t *extradata; uint8_t *extradata;
@ -164,7 +164,7 @@ static void interpolate_array(float *scale, int old_size, int new_size)
* expense (linear interpolation approximately doubles the number of * expense (linear interpolation approximately doubles the number of
* bits of precision). * bits of precision).
*/ */
static inline float pow_m1_4(WMADecodeContext *s, float x) static inline float pow_m1_4(WMACodecContext *s, float x)
{ {
union { union {
float f; float f;
@ -183,7 +183,7 @@ static inline float pow_m1_4(WMADecodeContext *s, float x)
return s->lsp_pow_e_table[e] * (a + b * t.f); return s->lsp_pow_e_table[e] * (a + b * t.f);
} }
static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len) static void wma_lsp_to_curve_init(WMACodecContext *s, int frame_len)
{ {
float wdel, a, b; float wdel, a, b;
int i, e, m; int i, e, m;
@ -224,7 +224,7 @@ static void wma_lsp_to_curve_init(WMADecodeContext *s, int frame_len)
* NOTE: We use the same code as Vorbis here * NOTE: We use the same code as Vorbis here
* @todo optimize it further with SSE/3Dnow * @todo optimize it further with SSE/3Dnow
*/ */
static void wma_lsp_to_curve(WMADecodeContext *s, static void wma_lsp_to_curve(WMACodecContext *s,
float *out, float *val_max_ptr, float *out, float *val_max_ptr,
int n, float *lsp) int n, float *lsp)
{ {
@ -254,7 +254,7 @@ static void wma_lsp_to_curve(WMADecodeContext *s,
/** /**
* decode exponents coded with LSP coefficients (same idea as Vorbis) * decode exponents coded with LSP coefficients (same idea as Vorbis)
*/ */
static void decode_exp_lsp(WMADecodeContext *s, int ch) static void decode_exp_lsp(WMACodecContext *s, int ch)
{ {
float lsp_coefs[NB_LSP_COEFS]; float lsp_coefs[NB_LSP_COEFS];
int val, i; int val, i;
@ -274,7 +274,7 @@ static void decode_exp_lsp(WMADecodeContext *s, int ch)
/** /**
* decode exponents coded with VLC codes * decode exponents coded with VLC codes
*/ */
static int decode_exp_vlc(WMADecodeContext *s, int ch) static int decode_exp_vlc(WMACodecContext *s, int ch)
{ {
int last_exp, n, code; int last_exp, n, code;
const uint16_t *ptr, *band_ptr; const uint16_t *ptr, *band_ptr;
@ -320,7 +320,7 @@ static int decode_exp_vlc(WMADecodeContext *s, int ch)
* @return 0 if OK. 1 if last block of frame. return -1 if * @return 0 if OK. 1 if last block of frame. return -1 if
* unrecorrable error. * unrecorrable error.
*/ */
static int wma_decode_block(WMADecodeContext *s) static int wma_decode_block(WMACodecContext *s)
{ {
int n, v, a, ch, code, bsize; int n, v, a, ch, code, bsize;
int coef_nb_bits, total_gain, parse_exponents; int coef_nb_bits, total_gain, parse_exponents;
@ -739,7 +739,7 @@ static int wma_decode_block(WMADecodeContext *s)
} }
/* decode a frame of frame_len samples */ /* decode a frame of frame_len samples */
static int wma_decode_frame(WMADecodeContext *s, int16_t *samples) static int wma_decode_frame(WMACodecContext *s, int16_t *samples)
{ {
int ret, i, n, a, ch, incr; int ret, i, n, a, ch, incr;
int16_t *ptr; int16_t *ptr;
@ -794,7 +794,7 @@ static int wma_decode_superframe(AVCodecContext *avctx,
void *data, int *data_size, void *data, int *data_size,
uint8_t *buf, int buf_size) uint8_t *buf, int buf_size)
{ {
WMADecodeContext *s = avctx->priv_data; WMACodecContext *s = avctx->priv_data;
int nb_frames, bit_offset, i, pos, len; int nb_frames, bit_offset, i, pos, len;
uint8_t *q; uint8_t *q;
int16_t *samples; int16_t *samples;
@ -891,7 +891,7 @@ AVCodec wmav1_decoder =
"wmav1", "wmav1",
CODEC_TYPE_AUDIO, CODEC_TYPE_AUDIO,
CODEC_ID_WMAV1, CODEC_ID_WMAV1,
sizeof(WMADecodeContext), sizeof(WMACodecContext),
wma_decode_init, wma_decode_init,
NULL, NULL,
ff_wma_end, ff_wma_end,
@ -903,7 +903,7 @@ AVCodec wmav2_decoder =
"wmav2", "wmav2",
CODEC_TYPE_AUDIO, CODEC_TYPE_AUDIO,
CODEC_ID_WMAV2, CODEC_ID_WMAV2,
sizeof(WMADecodeContext), sizeof(WMACodecContext),
wma_decode_init, wma_decode_init,
NULL, NULL,
ff_wma_end, ff_wma_end,

View File

@ -27,7 +27,7 @@
static int encode_init(AVCodecContext * avctx){ static int encode_init(AVCodecContext * avctx){
WMADecodeContext *s = avctx->priv_data; WMACodecContext *s = avctx->priv_data;
int i, flags1, flags2; int i, flags1, flags2;
uint8_t *extradata; uint8_t *extradata;
@ -78,7 +78,7 @@ static int encode_init(AVCodecContext * avctx){
static void apply_window_and_mdct(AVCodecContext * avctx, signed short * audio, int len) { static void apply_window_and_mdct(AVCodecContext * avctx, signed short * audio, int len) {
WMADecodeContext *s = avctx->priv_data; WMACodecContext *s = avctx->priv_data;
int window_index= s->frame_len_bits - s->block_len_bits; int window_index= s->frame_len_bits - s->block_len_bits;
int i, j, channel; int i, j, channel;
const float * win = s->windows[window_index]; const float * win = s->windows[window_index];
@ -97,7 +97,7 @@ static void apply_window_and_mdct(AVCodecContext * avctx, signed short * audio,
} }
//FIXME use for decoding too //FIXME use for decoding too
static void init_exp(WMADecodeContext *s, int ch, int *exp_param){ static void init_exp(WMACodecContext *s, int ch, int *exp_param){
int n; int n;
const uint16_t *ptr; const uint16_t *ptr;
float v, *q, max_scale, *q_end; float v, *q, max_scale, *q_end;
@ -118,7 +118,7 @@ static void init_exp(WMADecodeContext *s, int ch, int *exp_param){
s->max_exponent[ch] = max_scale; s->max_exponent[ch] = max_scale;
} }
static void encode_exp_vlc(WMADecodeContext *s, int ch, const int *exp_param){ static void encode_exp_vlc(WMACodecContext *s, int ch, const int *exp_param){
int last_exp; int last_exp;
const uint16_t *ptr; const uint16_t *ptr;
float *q, *q_end; float *q, *q_end;
@ -144,7 +144,7 @@ static void encode_exp_vlc(WMADecodeContext *s, int ch, const int *exp_param){
} }
} }
static int encode_block(WMADecodeContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], int total_gain){ static int encode_block(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], int total_gain){
int v, bsize, ch, coef_nb_bits, parse_exponents; int v, bsize, ch, coef_nb_bits, parse_exponents;
float mdct_norm; float mdct_norm;
int nb_coefs[MAX_CHANNELS]; int nb_coefs[MAX_CHANNELS];
@ -308,7 +308,7 @@ static int encode_block(WMADecodeContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
return 0; return 0;
} }
static int encode_frame(WMADecodeContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], uint8_t *buf, int buf_size, int total_gain){ static int encode_frame(WMACodecContext *s, float (*src_coefs)[BLOCK_MAX_SIZE], uint8_t *buf, int buf_size, int total_gain){
init_put_bits(&s->pb, buf, buf_size); init_put_bits(&s->pb, buf, buf_size);
if (s->use_bit_reservoir) { if (s->use_bit_reservoir) {
@ -325,7 +325,7 @@ static int encode_frame(WMADecodeContext *s, float (*src_coefs)[BLOCK_MAX_SIZE],
static int encode_superframe(AVCodecContext *avctx, static int encode_superframe(AVCodecContext *avctx,
unsigned char *buf, int buf_size, void *data){ unsigned char *buf, int buf_size, void *data){
WMADecodeContext *s = avctx->priv_data; WMACodecContext *s = avctx->priv_data;
short *samples = data; short *samples = data;
int i, total_gain, best; int i, total_gain, best;
@ -386,7 +386,7 @@ AVCodec wmav1_encoder =
"wmav1", "wmav1",
CODEC_TYPE_AUDIO, CODEC_TYPE_AUDIO,
CODEC_ID_WMAV1, CODEC_ID_WMAV1,
sizeof(WMADecodeContext), sizeof(WMACodecContext),
encode_init, encode_init,
encode_superframe, encode_superframe,
ff_wma_end, ff_wma_end,
@ -397,7 +397,7 @@ AVCodec wmav2_encoder =
"wmav2", "wmav2",
CODEC_TYPE_AUDIO, CODEC_TYPE_AUDIO,
CODEC_ID_WMAV2, CODEC_ID_WMAV2,
sizeof(WMADecodeContext), sizeof(WMACodecContext),
encode_init, encode_init,
encode_superframe, encode_superframe,
ff_wma_end, ff_wma_end,