. support pour --synchro I+ (images I et la premiļæ½re P)
authorSam Hocevar <sam@videolan.org>
Thu, 24 Aug 2000 00:16:25 +0000 (00:16 +0000)
committerSam Hocevar <sam@videolan.org>
Thu, 24 Aug 2000 00:16:25 +0000 (00:16 +0000)
ChangeLog
include/vpar_synchro.h
src/interface/main.c
src/video_parser/video_parser.c
src/video_parser/vpar_synchro.c

index 0c66166..036fd12 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,12 +1,13 @@
 O.1.99i :
 
-  * fixed the support for the field pictures, which involved a few dozens
+  * fixed the support for field pictures, which involved a few dozens
     bugs in the video parser and video decoder.
   * put names of authors under a lot of source files, for historical
     purposes.
   * fixed another input_file exit bug for the beos version.
   * fixed the aliases install.
   * renamed an inconsistent varaible in src/input/input_file.c.
+  * added support for I+ synchro (all Is and the first P).
 
 Tue, 22 Aug 2000 01:31:58 +0200
 0.1.99h :
index 14304d7..b2e6e7b 100644 (file)
@@ -75,7 +75,7 @@ typedef struct video_synchro_s
     int           displayable_p;
     boolean_t     b_all_B;
     int           displayable_b;
-    boolean_t     b_dropped_last_B;
+    boolean_t     b_dropped_last;
 
 } video_synchro_t;
 
@@ -84,9 +84,10 @@ typedef struct video_synchro_s
 
 #define VPAR_SYNCHRO_DEFAULT   0
 #define VPAR_SYNCHRO_I         1
-#define VPAR_SYNCHRO_IP        2
-#define VPAR_SYNCHRO_IPplus    3
-#define VPAR_SYNCHRO_IPB       4
+#define VPAR_SYNCHRO_Iplus     2
+#define VPAR_SYNCHRO_IP        3
+#define VPAR_SYNCHRO_IPplus    4
+#define VPAR_SYNCHRO_IPB       5
 
 #endif
 
index dd95007..639a46b 100644 (file)
@@ -657,7 +657,7 @@ static void Usage( int i_fashion )
     /* Synchro parameters */
     intf_Msg( "\n"
               "Synchro parameters:\n"
-              "  " VPAR_SYNCHRO_VAR "={I|IP|IP+|IPB}      \tsynchro algorithm\n");
+              "  " VPAR_SYNCHRO_VAR "={I|I+|IP|IP+|IPB}   \tsynchro algorithm\n");
 }
 
 /*****************************************************************************
index e960d73..0af739c 100644 (file)
@@ -301,7 +301,7 @@ static int InitThread( vpar_thread_t *p_vpar )
     p_vpar->synchro.displayable_p = 2 << 10;
     p_vpar->synchro.b_all_B = 0;
     p_vpar->synchro.displayable_b = 0;
-    p_vpar->synchro.b_dropped_last_B = 0;
+    p_vpar->synchro.b_dropped_last = 0;
     /* assume there were about 3 P and 6 B images between I's */
     p_vpar->synchro.i_P_seen = p_vpar->synchro.i_P_kept = 1 << 10;
     p_vpar->synchro.i_B_seen = p_vpar->synchro.i_B_kept = 1 << 10;
@@ -500,6 +500,10 @@ static int SynchroType( )
           case '\0':
             return VPAR_SYNCHRO_I;
 
+          case '+':
+            if( *psz_synchro ) return 0;
+            return VPAR_SYNCHRO_Iplus;
+
           case 'p':
           case 'P':
             switch( *psz_synchro++ )
index 7d61fa7..dd75986 100644 (file)
@@ -215,6 +215,10 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
             if( p_vpar->synchro.i_type != VPAR_SYNCHRO_DEFAULT )
             {
                 /* I, IP, IP+, IPB */
+                if( p_vpar->synchro.i_type == VPAR_SYNCHRO_Iplus )
+                {
+                    p_vpar->synchro.b_dropped_last = 1;
+                }
                 return( 1 );
             }
 
@@ -227,6 +231,19 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
                 return( 0 );
             }
 
+            if( p_vpar->synchro.i_type == VPAR_SYNCHRO_Iplus ) /* I+ */
+            {
+                if( p_vpar->synchro.b_dropped_last )
+                {
+                    p_vpar->synchro.b_dropped_last = 0;
+                    return( 1 );
+                }
+                else
+                {
+                    return( 0 );
+                }
+            }
+
             if( p_vpar->synchro.i_type >= VPAR_SYNCHRO_IP ) /* IP, IP+, IPB */
             {
                 return( 1 );
@@ -260,13 +277,13 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
                     return( 1 );
                 }
 
-                if( p_vpar->synchro.b_dropped_last_B ) /* IP+ */
+                if( p_vpar->synchro.b_dropped_last ) /* IP+ */
                 {
-                    p_vpar->synchro.b_dropped_last_B = 0;
+                    p_vpar->synchro.b_dropped_last = 0;
                     return( 1 );
                 }
 
-                p_vpar->synchro.b_dropped_last_B = 1;
+                p_vpar->synchro.b_dropped_last = 1;
                 return( 0 );
             }