Mercurial > libavcodec.hg
comparison mjpeg.c @ 3241:61d9f1418c02 libavcodec
do UPDATE_CACHE only when needed (which should be VERY rare)
author | michael |
---|---|
date | Fri, 31 Mar 2006 17:43:28 +0000 |
parents | 5fab2409bf8d |
children | e22fc2d702b7 |
comparison
equal
deleted
inserted
replaced
3240:5fab2409bf8d | 3241:61d9f1418c02 |
---|---|
1284 if (code == 0x100) { | 1284 if (code == 0x100) { |
1285 i += 16; | 1285 i += 16; |
1286 } else { | 1286 } else { |
1287 i += ((unsigned)code) >> 4; | 1287 i += ((unsigned)code) >> 4; |
1288 code &= 0xf; | 1288 code &= 0xf; |
1289 | 1289 if(code > MIN_CACHE_BITS - 16){ |
1290 UPDATE_CACHE(re, &s->gb) | 1290 UPDATE_CACHE(re, &s->gb) |
1291 } | |
1291 { | 1292 { |
1292 int cache=GET_CACHE(re,gb); | 1293 int cache=GET_CACHE(re,gb); |
1293 int sign=(~cache)>>31; | 1294 int sign=(~cache)>>31; |
1294 level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign; | 1295 level = (NEG_USR32(sign ^ cache,code) ^ sign) - sign; |
1295 } | 1296 } |