diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2010-01-21 21:01:26 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2010-01-21 21:01:26 +0000 |
commit | 1f445f5473eda9ca35dae342147afb7e2c3eb5f7 (patch) | |
tree | 9eca03b85fc165b0cc7192d4a3893bd98d54fbf2 /libavcodec/h264_cavlc.c | |
parent | e380b9182be0908ec60dd6e135ca6f498371b46f (diff) | |
download | ffmpeg-1f445f5473eda9ca35dae342147afb7e2c3eb5f7.tar.gz |
Move dquant check into qscale overflow check.
This should be faster (couldnt meassue a difference), and its less picky
on slightly out of spec dquant.
Originally committed as revision 21373 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h264_cavlc.c')
-rw-r--r-- | libavcodec/h264_cavlc.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/libavcodec/h264_cavlc.c b/libavcodec/h264_cavlc.c index b662ee821f..c0308d080b 100644 --- a/libavcodec/h264_cavlc.c +++ b/libavcodec/h264_cavlc.c @@ -936,15 +936,15 @@ decode_intra_mb: dquant= get_se_golomb(&s->gb); - if( dquant > 25 || dquant < -26 ){ - av_log(h->s.avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, s->mb_x, s->mb_y); - return -1; - } - s->qscale += dquant; + if(((unsigned)s->qscale) > 51){ if(s->qscale<0) s->qscale+= 52; else s->qscale-= 52; + if(((unsigned)s->qscale) > 51){ + av_log(h->s.avctx, AV_LOG_ERROR, "dquant out of range (%d) at %d %d\n", dquant, s->mb_x, s->mb_y); + return -1; + } } h->chroma_qp[0]= get_chroma_qp(h, 0, s->qscale); |