Commit 56bcb12f authored by michael's avatar michael

cleanup ugly code (also appearently works around a bug gcc 3.4 which fails...

cleanup ugly code (also appearently works around a bug gcc 3.4 which fails compiling it) by (mru at kth dot se (Måns Rullgård))


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@2746 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d677ca61
...@@ -424,7 +424,7 @@ static void dec2(Real144_internal *glob, int *data, int *inp, int n, int f, int ...@@ -424,7 +424,7 @@ static void dec2(Real144_internal *glob, int *data, int *inp, int n, int f, int
/* Uncompress one block (20 bytes -> 160*2 bytes) */ /* Uncompress one block (20 bytes -> 160*2 bytes) */
static int ra144_decode_frame(AVCodecContext * avctx, static int ra144_decode_frame(AVCodecContext * avctx,
void *data, int *data_size, void *vdata, int *data_size,
uint8_t * buf, int buf_size) uint8_t * buf, int buf_size)
{ {
unsigned int a,b,c; unsigned int a,b,c;
...@@ -432,7 +432,8 @@ static int ra144_decode_frame(AVCodecContext * avctx, ...@@ -432,7 +432,8 @@ static int ra144_decode_frame(AVCodecContext * avctx,
signed short *shptr; signed short *shptr;
unsigned int *lptr,*temp; unsigned int *lptr,*temp;
const short **dptr; const short **dptr;
void *datao; int16_t *datao;
int16_t *data = vdata;
Real144_internal *glob=avctx->priv_data; Real144_internal *glob=avctx->priv_data;
datao = data; datao = data;
...@@ -480,10 +481,10 @@ static int ra144_decode_frame(AVCodecContext * avctx, ...@@ -480,10 +481,10 @@ static int ra144_decode_frame(AVCodecContext * avctx,
shptr=glob->output_buffer; shptr=glob->output_buffer;
while (shptr<glob->output_buffer+BLOCKSIZE) { while (shptr<glob->output_buffer+BLOCKSIZE) {
s=*(shptr++)<<2; s=*(shptr++)<<2;
*((int16_t *)data)=s; *data=s;
if (s>32767) *((int16_t *)data)=32767; if (s>32767) *data=32767;
if (s<-32767) *((int16_t *)data)=-32768; if (s<-32767) *data=-32768;
((int16_t *)data)++; data++;
} }
b+=30; b+=30;
} }
...@@ -495,7 +496,7 @@ static int ra144_decode_frame(AVCodecContext * avctx, ...@@ -495,7 +496,7 @@ static int ra144_decode_frame(AVCodecContext * avctx,
temp=glob->swapbuf2alt; temp=glob->swapbuf2alt;
glob->swapbuf2alt=glob->swapbuf2; glob->swapbuf2alt=glob->swapbuf2;
glob->swapbuf2=temp; glob->swapbuf2=temp;
*data_size=data-datao; *data_size=(data-datao)*sizeof(*data);
return 20; return 20;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment