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

Originally committed as revision 25542 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2010-10-21 22:44:31 +00:00
parent 76c80ef569
commit 614252863d
1 changed files with 2 additions and 2 deletions

View File

@ -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)
/* Progressive JPEG use AC coeffs from zero and this decoder sets offset 16 by default */
code -= 16;
run = ((unsigned) code) >> 4;
if(code & 0xF) {
i += ((unsigned) code) >> 4;
i += run;
code &= 0xf;
if(code > MIN_CACHE_BITS - 16){
UPDATE_CACHE(re, &s->gb)
@ -502,7 +503,6 @@ static int decode_block_progressive(MJpegDecodeContext *s, DCTELEM *block, uint8
j = s->scantable.permutated[i];
block[j] = level * quant_matrix[j] << Al;
}else{
run = ((unsigned) code) >> 4;
if(run == 0xF){// ZRL - skip 15 coefficients
i += 15;
}else{