Commit 694ea801 authored by vitor's avatar vitor

Simplify ra144_decode_frame() by unrolling a senseless

loop.

Thanks mkhdor for suggesting this patch.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13211 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent d3c963e1
...@@ -401,25 +401,14 @@ static int ra144_decode_frame(AVCodecContext * avctx, ...@@ -401,25 +401,14 @@ static int ra144_decode_frame(AVCodecContext * avctx,
val = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries? val = decodeval[get_bits(&gb, 5) << 1]; // Useless table entries?
a = t_sqrt(val*glob->oldval) >> 12; a = t_sqrt(val*glob->oldval) >> 12;
for (c=0; c < NBLOCKS; c++) { dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, glob->oldval, glob->swapbuf2, 0);
if (c == (NBLOCKS - 1)) {
dec1(glob, glob->swapbuf1, glob->swapbuf2, 3, val);
} else {
if (c * 2 == (NBLOCKS - 2)) {
if (glob->oldval < val) { if (glob->oldval < val) {
dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, a, glob->swapbuf2alt, c); dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, a, glob->swapbuf2alt, 1);
} else {
dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, a, glob->swapbuf2, c);
}
} else {
if (c * 2 < (NBLOCKS - 2)) {
dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, glob->oldval, glob->swapbuf2, c);
} else { } else {
dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, val, glob->swapbuf2alt, c); dec2(glob, glob->swapbuf1alt, glob->swapbuf2alt, 3, a, glob->swapbuf2, 1);
}
}
}
} }
dec2(glob, glob->swapbuf1, glob->swapbuf2, 3, val, glob->swapbuf2alt, 2);
dec1(glob, glob->swapbuf1, glob->swapbuf2, 3, val);
/* do output */ /* do output */
for (b=0, c=0; c<4; c++) { for (b=0, c=0; c<4; c++) {
......
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