comparison ra144.c @ 6894:eb3c16b99f27 libavcodec

Rename context struct to be more consistent with the rest of ffmpeg
author vitor
date Mon, 26 May 2008 16:55:22 +0000
parents b2f2c09af893
children c63e9357e2a8
comparison
equal deleted inserted replaced
6893:72dafc993490 6894:eb3c16b99f27
40 unsigned int *swapbuf1alt; 40 unsigned int *swapbuf1alt;
41 unsigned int *swapbuf2alt; 41 unsigned int *swapbuf2alt;
42 42
43 unsigned int buffer[5]; 43 unsigned int buffer[5];
44 uint16_t buffer_2[148]; 44 uint16_t buffer_2[148];
45 } Real144_internal; 45 } RA144Context;
46 46
47 static int ra144_decode_init(AVCodecContext * avctx) 47 static int ra144_decode_init(AVCodecContext * avctx)
48 { 48 {
49 Real144_internal *glob = avctx->priv_data; 49 RA144Context *glob = avctx->priv_data;
50 50
51 glob->swapbuf1 = glob->swapbuffers[0]; 51 glob->swapbuf1 = glob->swapbuffers[0];
52 glob->swapbuf2 = glob->swapbuffers[1]; 52 glob->swapbuf2 = glob->swapbuffers[1];
53 glob->swapbuf1alt = glob->swapbuffers[2]; 53 glob->swapbuf1alt = glob->swapbuffers[2];
54 glob->swapbuf2alt = glob->swapbuffers[3]; 54 glob->swapbuf2alt = glob->swapbuffers[3];
197 res = (res * f) >> 10; 197 res = (res * f) >> 10;
198 return res; 198 return res;
199 } 199 }
200 200
201 /* do quarter-block output */ 201 /* do quarter-block output */
202 static void do_output_subblock(Real144_internal *glob, 202 static void do_output_subblock(RA144Context *glob,
203 const uint16_t *gsp, unsigned int gval, 203 const uint16_t *gsp, unsigned int gval,
204 int16_t *output_buffer, GetBitContext *gb) 204 int16_t *output_buffer, GetBitContext *gb)
205 { 205 {
206 uint16_t buffer_a[40]; 206 uint16_t buffer_a[40];
207 uint16_t *block; 207 uint16_t *block;
312 unsigned int a, c; 312 unsigned int a, c;
313 int i; 313 int i;
314 int16_t *data = vdata; 314 int16_t *data = vdata;
315 unsigned int val; 315 unsigned int val;
316 316
317 Real144_internal *glob = avctx->priv_data; 317 RA144Context *glob = avctx->priv_data;
318 GetBitContext gb; 318 GetBitContext gb;
319 319
320 if(buf_size < 20) { 320 if(buf_size < 20) {
321 av_log(avctx, AV_LOG_ERROR, 321 av_log(avctx, AV_LOG_ERROR,
322 "Frame too small (%d bytes). Truncated file?\n", buf_size); 322 "Frame too small (%d bytes). Truncated file?\n", buf_size);
365 AVCodec ra_144_decoder = 365 AVCodec ra_144_decoder =
366 { 366 {
367 "real_144", 367 "real_144",
368 CODEC_TYPE_AUDIO, 368 CODEC_TYPE_AUDIO,
369 CODEC_ID_RA_144, 369 CODEC_ID_RA_144,
370 sizeof(Real144_internal), 370 sizeof(RA144Context),
371 ra144_decode_init, 371 ra144_decode_init,
372 NULL, 372 NULL,
373 NULL, 373 NULL,
374 ra144_decode_frame, 374 ra144_decode_frame,
375 .long_name = "RealAudio 1.0 (14.4K)", 375 .long_name = "RealAudio 1.0 (14.4K)",