aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2006-03-31 17:43:28 +0000
committerMichael Niedermayer <michaelni@gmx.at>2006-03-31 17:43:28 +0000
commit78d2d4e1111f1284e12da9ae4daa0b7c14733055 (patch)
tree269a4a107b66a92a08d48584b21f017bc7caa7f7
parente7e2025a535c61c9dc6f7e3226458b65f4b559d2 (diff)
downloadffmpeg-78d2d4e1111f1284e12da9ae4daa0b7c14733055.tar.gz
do UPDATE_CACHE only when needed (which should be VERY rare)
Originally committed as revision 5254 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavcodec/mjpeg.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavcodec/mjpeg.c b/libavcodec/mjpeg.c
index 8c90022bc5..2fc870a61a 100644
--- a/libavcodec/mjpeg.c
+++ b/libavcodec/mjpeg.c
@@ -1286,8 +1286,9 @@ static int decode_block(MJpegDecodeContext *s, DCTELEM *block,
} else {
i += ((unsigned)code) >> 4;
code &= 0xf;
-
- UPDATE_CACHE(re, &s->gb)
+ if(code > MIN_CACHE_BITS - 16){
+ UPDATE_CACHE(re, &s->gb)
+ }
{
int cache=GET_CACHE(re,gb);
int sign=(~cache)>>31;