Skip to content
Snippets Groups Projects
Commit 61425286 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

Factorize ((unsigned) code) >> 4 out of decode_block_progressive() in jpeg.

Originally committed as revision 25542 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent 76c80ef5
No related branches found
No related tags found
No related merge requests found
...@@ -476,8 +476,9 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8 ...@@ -476,8 +476,9 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8
GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2) GET_VLC(code, re, &s->gb, s->vlcs[1][ac_index].table, 9, 2)
/* Progressive JPEG use AC coeffs from zero and this decoder sets offset 16 by default */ /* Progressive JPEG use AC coeffs from zero and this decoder sets offset 16 by default */
code -= 16; code -= 16;
run = ((unsigned) code) >> 4;
if(code & 0xF) { if(code & 0xF) {
i += ((unsigned) code) >> 4; i += run;
code &= 0xf; code &= 0xf;
if(code > MIN_CACHE_BITS - 16){ if(code > MIN_CACHE_BITS - 16){
UPDATE_CACHE(re, &s->gb) UPDATE_CACHE(re, &s->gb)
...@@ -502,7 +503,6 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8 ...@@ -502,7 +503,6 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8
j = s->scantable.permutated[i]; j = s->scantable.permutated[i];
block[j] = level * quant_matrix[j] << Al; block[j] = level * quant_matrix[j] << Al;
}else{ }else{
run = ((unsigned) code) >> 4;
if(run == 0xF){// ZRL - skip 15 coefficients if(run == 0xF){// ZRL - skip 15 coefficients
i += 15; i += 15;
}else{ }else{
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment