From afe359c11052b918f3127dc8e4fa918e7fb815a5 Mon Sep 17 00:00:00 2001 From: Vitor Sessak Date: Wed, 21 May 2008 19:24:17 +0000 Subject: Make gbuf2 a table instead of an array Originally committed as revision 13221 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavcodec/ra144.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'libavcodec') diff --git a/libavcodec/ra144.c b/libavcodec/ra144.c index 4ac86783c7..f38a3bc4a8 100644 --- a/libavcodec/ra144.c +++ b/libavcodec/ra144.c @@ -33,7 +33,7 @@ typedef struct { unsigned int oldval; unsigned int gbuf1[4]; - unsigned short gbuf2[120]; + unsigned short gbuf2[4][30]; unsigned int *decptr; /* decoder ptr */ /* the swapped buffers */ @@ -252,7 +252,7 @@ static void dec1(Real144_internal *glob, const int *data, const int *inp, int n, int f, int block_idx) { short *ptr,*end; - signed short *decsp = glob->gbuf2 + 30*block_idx; + signed short *decsp = glob->gbuf2[block_idx]; *(glob->decptr++) = rms(data, f); end = (ptr = decsp) + (n * 10); @@ -329,7 +329,7 @@ static void dec2(Real144_internal *glob, const int *data, const int *inp, int a,b; int x; int result; - signed short *decsp = glob->gbuf2 + 30*l; + signed short *decsp = glob->gbuf2[l]; unsigned short *sptr = decsp; if(l + 1 < NBLOCKS / 2) @@ -363,7 +363,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, const uint8_t * buf, int buf_size) { static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; - unsigned int a, b, c; + unsigned int a, c; int i; signed short *shptr; int16_t *data = vdata; @@ -396,9 +396,9 @@ static int ra144_decode_frame(AVCodecContext * avctx, dec1(glob, glob->swapbuf1, glob->swapbuf2, 3, val, 3); /* do output */ - for (b=0, c=0; c<4; c++) { + for (c=0; c<4; c++) { unsigned int gval = glob->gbuf1[c]; - unsigned short *gsp = glob->gbuf2 + b; + unsigned short *gsp = glob->gbuf2[c]; signed short output_buffer[40]; do_output_subblock(glob, gsp, gval, output_buffer, &gb); @@ -406,7 +406,6 @@ static int ra144_decode_frame(AVCodecContext * avctx, shptr = output_buffer; while (shptr < output_buffer + BLOCKSIZE) *data++ = av_clip_int16(*(shptr++) << 2); - b += 30; } glob->oldval = val; -- cgit v1.2.3