summaryrefslogtreecommitdiff
path: root/libavcodec
diff options
context:
space:
mode:
authorVitor Sessak <vitor1001@gmail.com>2008-05-21 19:24:17 +0000
committerVitor Sessak <vitor1001@gmail.com>2008-05-21 19:24:17 +0000
commitafe359c11052b918f3127dc8e4fa918e7fb815a5 (patch)
tree7be780a2f013a6ea89c6a84f6115f98bccd47385 /libavcodec
parent53da3f5f92f1623da01f3f39f49e6c1250387d1c (diff)
Make gbuf2 a table instead of an array
Originally committed as revision 13221 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec')
-rw-r--r--libavcodec/ra144.c13
1 files changed, 6 insertions, 7 deletions
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;