]> git.sesse.net Git - vlc/blobdiff - src/video_parser/vpar_synchro.c
. ultimisation des calculs de pr�diction dans la synchro
[vlc] / src / video_parser / vpar_synchro.c
index e14e4707f8ee91fbddb9e7cf3c9cfadd12d37862..83e80ab85f4167984a11fc153354373c36dc4372 100644 (file)
  *****************************************************************************/
 double vpar_SynchroUpdateTab( video_synchro_tab_t * tab, int count )
 {
-    if( tab->count < MAX_COUNT)
-        tab->count++;
-
-    tab->mean = ( (tab->count-1) * tab->mean + count )
-                    / tab->count;
-
-    tab->deviation = ( (tab->count-1) * tab->deviation
-                    + abs (tab->mean - count) ) / tab->count;
+       
+    tab->mean = ( tab->mean + 3 * count ) / 4;
+    tab->deviation = ( tab->deviation + 3 * abs (tab->mean - count) ) / 4;
 
     return tab->deviation;
 }
@@ -107,6 +102,7 @@ void vpar_SynchroUpdateStructures( vpar_thread_t * p_vpar,
             }
 
            p_vpar->synchro.p_count_predict = predict;
+            p_vpar->synchro.current_p_count = 0;
 
 
             /* update all the structures for B images */
@@ -134,6 +130,7 @@ void vpar_SynchroUpdateStructures( vpar_thread_t * p_vpar,
             }
 
            p_vpar->synchro.b_count_predict = predict;
+            p_vpar->synchro.current_b_count = 0;
 
 
             break;
@@ -150,6 +147,10 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
 {
 //    return( 1 );
 //    return( i_coding_type == I_CODING_TYPE || i_coding_type == P_CODING_TYPE );
+    intf_DbgMsg("vpar debug: synchro image %i - modulo is %i\n", i_coding_type, p_vpar->synchro.modulo);
+    intf_DbgMsg("vpar debug: synchro predict P %e - predict B %e\n", p_vpar->synchro.p_count_predict, p_vpar->synchro.b_count_predict);
+
+    return(0);
     return( i_coding_type == I_CODING_TYPE );
 }