comparison ra144.c @ 5525:bc4791868c52 libavcodec

various simplifications around recent av_clip_int16() usage
author aurel
date Sat, 11 Aug 2007 23:17:03 +0000
parents c2ab2ac31edb
children 2bd174b8d32e
comparison
equal deleted inserted replaced
5524:f47bc5359101 5525:bc4791868c52
428 static int ra144_decode_frame(AVCodecContext * avctx, 428 static int ra144_decode_frame(AVCodecContext * avctx,
429 void *vdata, int *data_size, 429 void *vdata, int *data_size,
430 uint8_t * buf, int buf_size) 430 uint8_t * buf, int buf_size)
431 { 431 {
432 unsigned int a,b,c; 432 unsigned int a,b,c;
433 long s;
434 signed short *shptr; 433 signed short *shptr;
435 unsigned int *lptr,*temp; 434 unsigned int *lptr,*temp;
436 const short **dptr; 435 const short **dptr;
437 int16_t *datao; 436 int16_t *datao;
438 int16_t *data = vdata; 437 int16_t *data = vdata;
482 glob->gsp=glob->gbuf2+b; 481 glob->gsp=glob->gbuf2+b;
483 do_output_subblock(glob,glob->resetflag); 482 do_output_subblock(glob,glob->resetflag);
484 glob->resetflag=0; 483 glob->resetflag=0;
485 484
486 shptr=glob->output_buffer; 485 shptr=glob->output_buffer;
487 while (shptr<glob->output_buffer+BLOCKSIZE) { 486 while (shptr<glob->output_buffer+BLOCKSIZE)
488 s=*(shptr++)<<2; 487 *data++=av_clip_int16(*(shptr++)<<2);
489 *data=av_clip_int16(s);
490 data++;
491 }
492 b+=30; 488 b+=30;
493 } 489 }
494 490
495 glob->oldval=glob->val; 491 glob->oldval=glob->val;
496 temp=glob->swapbuf1alt; 492 temp=glob->swapbuf1alt;