Browse code

Optimize state initialization in ffv1 clear_state().

Originally committed as revision 25580 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2010/10/27 08:01:04
Showing 1 changed files
... ...
@@ -964,15 +964,15 @@ static void clear_state(FFV1Context *f){
964 964
             p->interlace_bit_state[0]= 128;
965 965
             p->interlace_bit_state[1]= 128;
966 966
 
967
+            if(fs->ac){
968
+                memset(p->state, 128, CONTEXT_SIZE*p->context_count);
969
+            }else{
967 970
             for(j=0; j<p->context_count; j++){
968
-                if(fs->ac){
969
-                    memset(p->state[j], 128, sizeof(uint8_t)*CONTEXT_SIZE);
970
-                }else{
971 971
                     p->vlc_state[j].drift= 0;
972 972
                     p->vlc_state[j].error_sum= 4; //FFMAX((RANGE + 32)/64, 2);
973 973
                     p->vlc_state[j].bias= 0;
974 974
                     p->vlc_state[j].count= 1;
975
-                }
975
+            }
976 976
             }
977 977
         }
978 978
     }