changeset 5439:f1db308c277b libavcodec

reorder if() so that the condition can be simplified saves another 4 cpu cycles
author michael
date Wed, 01 Aug 2007 19:37:28 +0000
parents 8ea581ae9fa2
children cfbb6ab18f89
files mpeg12.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/mpeg12.c	Wed Aug 01 19:26:24 2007 +0000
+++ b/mpeg12.c	Wed Aug 01 19:37:28 2007 +0000
@@ -502,14 +502,14 @@
             }
 
             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