aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2007-08-01 19:37:28 +0000
committerMichael Niedermayer <michaelni@gmx.at>2007-08-01 19:37:28 +0000
commit09d1bee89e27ee2991f3aee5db38ba251f2fac95 (patch)
tree4821f7e2b68391ebabe7f447eeca1e7f8ea72f40 /libavcodec/mpeg12.c
parent0ac6b5a301004dd7b4b344d24d58126b733167ba (diff)
downloadffmpeg-09d1bee89e27ee2991f3aee5db38ba251f2fac95.tar.gz
reorder if() so that the condition can be simplified
saves another 4 cpu cycles Originally committed as revision 9857 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/mpeg12.c')
-rw-r--r--libavcodec/mpeg12.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index 09c90e81df..24e1228882 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -502,14 +502,14 @@ static int mpeg_decode_mb(MpegEncContext *s,
}
cbp = get_vlc2(&s->gb, mb_pat_vlc.table, MB_PAT_VLC_BITS, 1);
- if (cbp < 0 || ((cbp == 0) && (s->chroma_format < 2)) ){
- av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y);
- return -1;
- }
if(mb_block_count > 6){
cbp<<= mb_block_count-6;
cbp |= get_bits(&s->gb, mb_block_count-6);
}
+ if (cbp <= 0){
+ av_log(s->avctx, AV_LOG_ERROR, "invalid cbp at %d %d\n", s->mb_x, s->mb_y);
+ return -1;
+ }
#ifdef HAVE_XVMC
//on 1 we memcpy blocks in xvmcvideo