Mercurial > libavcodec.hg
comparison ra144.c @ 6834:bf3bc36715e6 libavcodec
Simplify ra144_decode_frame() by unrolling a senseless
loop.
Thanks mkhdor for suggesting this patch.
author | vitor |
---|---|
date | Wed, 21 May 2008 16:36:19 +0000 |
parents | 37464a7b3f59 |
children | 179da35eba93 |
comparison
equal
deleted
inserted
replaced
6833:37464a7b3f59 | 6834:bf3bc36715e6 |
---|---|
399 do_voice(glob->swapbuf1, glob->swapbuf2); | 399 do_voice(glob->swapbuf1, glob->swapbuf2); |
400 | 400 |
401 val = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries? | 401 val = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries? |
402 a = t_sqrt(val*glob->oldval) >> 12; | 402 a = t_sqrt(val*glob->oldval) >> 12; |
403 | 403 |
404 for (c=0; c < NBLOCKS; c++) { | 404 dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, glob->oldval, glob->swapbuf2, 0); |
405 if (c == (NBLOCKS - 1)) { | 405 if (glob->oldval < val) { |
406 dec1(glob, glob->swapbuf1, glob->swapbuf2, 3, val); | 406 dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, a, glob->swapbuf2alt, 1); |
407 } else { | 407 } else { |
408 if (c * 2 == (NBLOCKS - 2)) { | 408 dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, a, glob->swapbuf2, 1); |
409 if (glob->oldval < val) { | 409 } |
410 dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, a, glob->swapbuf2alt, c); | 410 dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, val, glob->swapbuf2alt, 2); |
411 } else { | 411 dec1(glob, glob->swapbuf1, glob->swapbuf2, 3, val); |
412 dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, a, glob->swapbuf2, c); | |
413 } | |
414 } else { | |
415 if (c * 2 < (NBLOCKS - 2)) { | |
416 dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, glob->oldval, glob->swapbuf2, c); | |
417 } else { | |
418 dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, val, glob->swapbuf2alt, c); | |
419 } | |
420 } | |
421 } | |
422 } | |
423 | 412 |
424 /* do output */ | 413 /* do output */ |
425 for (b=0, c=0; c<4; c++) { | 414 for (b=0, c=0; c<4; c++) { |
426 unsigned int gval = glob->gbuf1[c * 2]; | 415 unsigned int gval = glob->gbuf1[c * 2]; |
427 unsigned short *gsp = glob->gbuf2 + b; | 416 unsigned short *gsp = glob->gbuf2 + b; |