]> git.sesse.net Git - vlc/commitdiff
. ultimisation des calculs de pr�diction dans la synchro
authorSam Hocevar <sam@videolan.org>
Wed, 19 Jan 2000 06:00:49 +0000 (06:00 +0000)
committerSam Hocevar <sam@videolan.org>
Wed, 19 Jan 2000 06:00:49 +0000 (06:00 +0000)
 . squelette du subtitle_decoder

Makefile
include/vpar_synchro.h
src/video_parser/video_parser.c
src/video_parser/vpar_synchro.c

index 1645e93a67cf18d22c20ef5e00487b74e269886b..8f780571f75757d172dbd50e0964de5d5dce1889 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -188,6 +188,8 @@ ac3_decoder_obj =           ac3_decoder/ac3_decoder.o \
 audio_decoder_obj =            audio_decoder/audio_decoder.o \
                                                audio_decoder/audio_math.o
 
+subtitle_decoder_obj =         subtitle_decoder/subtitle_decoder.o
+
 #??generic_decoder_obj =               generic_decoder/generic_decoder.o
 # remeber to add it to OBJ 
 
@@ -231,6 +233,7 @@ C_OBJ = $(interface_obj) \
                $(video_output_obj) \
                $(ac3_decoder_obj) \
                $(audio_decoder_obj) \
+               $(subtitle_decoder_obj) \
                $(generic_decoder_obj) \
                $(video_parser_obj) \
                $(video_decoder_obj) \
index 1a6bc2be918588b60ecd9aaf0ec34b9d02f2d433..baf21c0682794a8226a8f12c364dc60eaf47ddce 100644 (file)
@@ -22,7 +22,6 @@ typedef struct video_synchro_tab_s
 {
     double mean;
     double deviation;
-    int count;
     
 } video_synchro_tab_t;
 
index 2db1897c50d86c298767e0f5bc595c6585f2826a..5401404968901ec0d2d32a11922a9b7098d28fd3 100644 (file)
@@ -100,22 +100,20 @@ vpar_thread_t * vpar_CreateThread( /* video_cfg_t *p_cfg, */ input_thread_t *p_i
      * Initialize the synchro properties
      */
     p_vpar->synchro.modulo = 0;
-    /* assume there were about 3 P and 4 B images between I's */
+    /* assume there were about 3 P and 6 B images between I's */
     p_vpar->synchro.current_p_count = 1;
     p_vpar->synchro.p_count_predict = 3;
     p_vpar->synchro.current_b_count = 1;
-    p_vpar->synchro.b_count_predict = 4;
+    p_vpar->synchro.b_count_predict = 6;
     {
         int i;
         for( i=0; i<6; i++)
         {
             p_vpar->synchro.tab_p[i].mean = 3;
-            p_vpar->synchro.tab_p[i].deviation = 1;
-            p_vpar->synchro.tab_p[i].count = 0;
+            p_vpar->synchro.tab_p[i].deviation = .5;
 
-            p_vpar->synchro.tab_b[i].mean = 4;
-            p_vpar->synchro.tab_b[i].deviation = 1;
-            p_vpar->synchro.tab_b[i].count = 0;
+            p_vpar->synchro.tab_b[i].mean = 6;
+            p_vpar->synchro.tab_b[i].deviation = .5;
         }
     }
 
index c2038d1f8246ceea4217cad55feb9fb3a00a6665..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;
 }
@@ -155,6 +150,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_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 );
 }