Mercurial > libavcodec.hg
comparison ra144.c @ 6828:0969192d5f8b libavcodec
Simplify ra144_decode_frame()
author | vitor |
---|---|
date | Sat, 17 May 2008 14:38:12 +0000 |
parents | 8e0c8ff0c781 |
children | 97e57c7986fd |
comparison
equal
deleted
inserted
replaced
6827:51c80db5905c | 6828:0969192d5f8b |
---|---|
385 { | 385 { |
386 static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; | 386 static const uint8_t sizes[10] = {6, 5, 5, 4, 4, 3, 3, 3, 3, 2}; |
387 unsigned int a, b, c; | 387 unsigned int a, b, c; |
388 int i; | 388 int i; |
389 signed short *shptr; | 389 signed short *shptr; |
390 int16_t *datao; | |
391 int16_t *data = vdata; | 390 int16_t *data = vdata; |
392 unsigned int val; | 391 unsigned int val; |
393 | 392 |
394 Real144_internal *glob = avctx->priv_data; | 393 Real144_internal *glob = avctx->priv_data; |
395 GetBitContext gb; | 394 GetBitContext gb; |
396 | 395 |
397 if(buf_size == 0) | 396 if(buf_size == 0) |
398 return 0; | 397 return 0; |
399 | |
400 datao = data; | |
401 | 398 |
402 init_get_bits(&gb, buf, 20 * 8); | 399 init_get_bits(&gb, buf, 20 * 8); |
403 | 400 |
404 for (i=0; i<10; i++) | 401 for (i=0; i<10; i++) |
405 // "<< 1"? Doesn't this make one value out of two of the table useless? | 402 // "<< 1"? Doesn't this make one value out of two of the table useless? |
447 glob->oldval = val; | 444 glob->oldval = val; |
448 | 445 |
449 FFSWAP(unsigned int *, glob->swapbuf1alt, glob->swapbuf1); | 446 FFSWAP(unsigned int *, glob->swapbuf1alt, glob->swapbuf1); |
450 FFSWAP(unsigned int *, glob->swapbuf2alt, glob->swapbuf2); | 447 FFSWAP(unsigned int *, glob->swapbuf2alt, glob->swapbuf2); |
451 | 448 |
452 *data_size = (data-datao)*sizeof(*data); | 449 *data_size = 2*160; |
453 return 20; | 450 return 20; |
454 } | 451 } |
455 | 452 |
456 | 453 |
457 AVCodec ra_144_decoder = | 454 AVCodec ra_144_decoder = |