]> git.sesse.net Git - vlc/commitdiff
* vlc is now compiled without the STATS mode by default.
authorChristophe Massiot <massiot@videolan.org>
Mon, 27 Nov 2000 10:35:57 +0000 (10:35 +0000)
committerChristophe Massiot <massiot@videolan.org>
Mon, 27 Nov 2000 10:35:57 +0000 (10:35 +0000)
 * Fixed a bug which made frames go backwards with some displays (the
   video_decoder thread is now niced).
 * Made use of intf_WarnMsg() in the most needed places.
Also simplified the synchro algorithm and fixed a bug with non-(5/1) streams.
Fixed the optimizations in the configure stuff.
Warning : this release needs a full rebuild (make clean; make).
Warning : I might have broken the BeOS port, could somebody check ?

12 files changed:
ChangeLog
TODO
configure
configure.in
include/config.h.in
include/video_output.h
include/vpar_synchro.h
src/input/input.c
src/video_decoder/video_decoder.c
src/video_output/video_output.c
src/video_parser/video_parser.c
src/video_parser/vpar_synchro.c

index 06a6b0c595a5a720b62c99ce1c55100f97b011ae..7a015d0f8176ca29022d549a65d0c39c33b8abd8 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -2,7 +2,8 @@
 
   * Minor changes in the Debian files.
   * Fixed fps display.
-  * Fixed MPEG1 video decoding.
+  * Fixed MPEG1 video decoding. We don't read MPEG 1 PS files for the
+    moment.
   * Fixed a 100% cpu usage bug, in the dummy aout.
   * Added a 'f' shortcut to switch between Windowed and Fullscreen
     mode.
   * Added --enable-debug, --enable-stats, and --disable-optims in the
     GNU configure stuff.
   * Added alsa audio support (plugin)  
+  * vlc is now compiled without the STATS mode by default.
+  * Fixed a bug which made frames go backwards with some displays (the
+    video_decoder thread is now niced).
+  * Added intf_WarnMsg(), and made use of it in the most needed places.
 
 Mon, 28 Aug 2000 02:34:18 +0200
 0.1.99i :
diff --git a/TODO b/TODO
index 761290e77dcd856b68484ed88ad83054a1b884de..8fa951df20162a526b229ef5055454e906a6b3db 100644 (file)
--- a/TODO
+++ b/TODO
@@ -14,7 +14,7 @@ Description: Fix backwards moves
  Sometimes the frames seem to go backwards for a short period of
  time. This is due to the output methods and is known to happen
  with the x11 and SDL plugins.
-Status: Todo
+Status: Done 27 Nov 2000 (Meuuh)
 
 Task: 0x3d
 Difficulty: Easy
@@ -151,6 +151,25 @@ Description: SPU error recovery
  friendly.
 Status: Todo
 
+Task: 0x2b
+Difficulty: Hard
+Urgency: Wishlist
+Description: Shoot the TODO list on the web site
+ The TODO list on the web site hasn't been updated for months. We may
+ wonder then why the hell to we put a TODO list on the web site ? Maybe
+ we'd better shoot it in the head, that would make its suffering end.
+Status: Todo
+
+Task: 0x2a
+Difficulty: Guru
+Urgency: Critical
+Description: Buy a new brain for Sam
+ Sam likes to show that he is a good developer, and for a good developer
+ hexadecimal notation really rules, though nobody really needs it. In this
+ TODO list, Sam has forgotten that 0x29 + 1 != 0x30, but 0x2a ! So, please
+ do something, and send your donations to sam@via.ecp.fr. Thanks for him.
+Status: Todo
+
 Task: 0x29
 Difficulty: Medium
 Urgency: Normal
index b486068b0c88c6525787e28626a3e7bd99bb45c6..061b9ed7ee3337fc8de64649c9baff44b47663d2 100755 (executable)
--- a/configure
+++ b/configure
@@ -18,7 +18,7 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-debug          Enable debug mode (default is no)"
 ac_help="$ac_help
-  --enable-stats          Enable printing of statistics (default is yes)"
+  --enable-stats          Enable printing of statistics (default is no)"
 ac_help="$ac_help
   --enable-optimizations  Enable compiler optimizations (default enabled)"
 ac_help="$ac_help
@@ -40,7 +40,7 @@ ac_help="$ac_help
 ac_help="$ac_help
   --enable-x11            X11 support (default enabled)"
 ac_help="$ac_help
-  --enable-alsa             Alsa sound drivers supprt (default disabled)"
+  --enable-alsa   Alsa sound drivers supprt (Only for linux) (default disabled)"
 
 # Initialize some variables set by options.
 # The variables have the same names as the options, with
@@ -3056,6 +3056,7 @@ fi
 
 
 PLUGINS=${PLUGINS}"yuv ";
+OPTIMS=1;
 
 ARCH=${host_cpu}
 # Check whether --enable-ppro or --disable-ppro was given.
@@ -3079,13 +3080,13 @@ fi
 # Check whether --enable-stats or --disable-stats was given.
 if test "${enable_stats+set}" = set; then
   enableval="$enable_stats"
-   if test x$enableval != xno; then STATS=1; fi 
+   if test x$enableval = xyes; then STATS=1; fi 
 fi
 
 # Check whether --enable-optimizations or --disable-optimizations was given.
 if test "${enable_optimizations+set}" = set; then
   enableval="$enable_optimizations"
-   if test x$enableval != xno; then OPTIMS=1; fi 
+   if test x$enableval = xno; then OPTIMS=0; fi 
 fi
 
 
@@ -3158,17 +3159,17 @@ if test "${enable_alsa+set}" = set; then
   enableval="$enable_alsa"
   if test x$enable_alsa = xyes; then ac_safe=`echo "sys/asoundlib.h" | sed 'y%./+-%__p_%'`
 echo $ac_n "checking for sys/asoundlib.h""... $ac_c" 1>&6
-echo "configure:3162: checking for sys/asoundlib.h" >&5
+echo "configure:3163: checking for sys/asoundlib.h" >&5
 if eval "test \"`echo '$''{'ac_cv_header_$ac_safe'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
 else
   cat > conftest.$ac_ext <<EOF
-#line 3167 "configure"
+#line 3168 "configure"
 #include "confdefs.h"
 #include <sys/asoundlib.h>
 EOF
 ac_try="$ac_cpp conftest.$ac_ext >/dev/null 2>conftest.out"
-{ (eval echo configure:3172: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
+{ (eval echo configure:3173: \"$ac_try\") 1>&5; (eval $ac_try) 2>&5; }
 ac_err=`grep -v '^ *+' conftest.out | grep -v "^conftest.${ac_ext}\$"`
 if test -z "$ac_err"; then
   rm -rf conftest*
@@ -3185,7 +3186,7 @@ fi
 if eval "test \"`echo '$ac_cv_header_'$ac_safe`\" = yes"; then
   echo "$ac_t""yes" 1>&6
   echo $ac_n "checking for main in -lasound""... $ac_c" 1>&6
-echo "configure:3189: checking for main in -lasound" >&5
+echo "configure:3190: checking for main in -lasound" >&5
 ac_lib_var=`echo asound'_'main | sed 'y%./+-%__p_%'`
 if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
   echo $ac_n "(cached) $ac_c" 1>&6
@@ -3193,14 +3194,14 @@ else
   ac_save_LIBS="$LIBS"
 LIBS="-lasound  $LIBS"
 cat > conftest.$ac_ext <<EOF
-#line 3197 "configure"
+#line 3198 "configure"
 #include "confdefs.h"
 
 int main() {
 main()
 ; return 0; }
 EOF
-if { (eval echo configure:3204: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
+if { (eval echo configure:3205: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then
   rm -rf conftest*
   eval "ac_cv_lib_$ac_lib_var=yes"
 else
index 5e53242e15c13cbe293953a38b7f3e629b0ed51e..b0ca5b0a9eea9f6d4e3c950a974c71107bacda07 100644 (file)
@@ -64,6 +64,7 @@ AC_HEADER_TIME
 
 dnl default plugins 
 PLUGINS=${PLUGINS}"yuv ";
+OPTIMS=1;
 
 ARCH=${host_cpu}
 AC_ARG_ENABLE(ppro,
@@ -76,11 +77,11 @@ AC_ARG_ENABLE(debug,
 [  --enable-debug          Enable debug mode (default is no)],
 [ if test x$enableval = xyes; then DEBUG=1; fi ])
 AC_ARG_ENABLE(stats,
-[  --enable-stats          Enable printing of statistics (default is yes)],
-[ if test x$enableval != xno; then STATS=1; fi ])
+[  --enable-stats          Enable printing of statistics (default is no)],
+[ if test x$enableval = xyes; then STATS=1; fi ])
 AC_ARG_ENABLE(optimizations,
 [  --enable-optimizations  Enable compiler optimizations (default enabled)],
-[ if test x$enableval != xno; then OPTIMS=1; fi ])
+[ if test x$enableval = xno; then OPTIMS=0; fi ])
 
 SYS=${host_os}
 
index 94b7e6d61e5b4e37875d84b0d6c9741b8f62ca71..80015c2a1ab4675d8f11c6e2f529ee542a63bdda 100644 (file)
 /* Maximum range of values out of the IDCT + motion compensation. */
 #define VDEC_CROPRANGE                  2048
 
+/* Nice increments for decoders -- necessary for x11 scheduling */
+#define VDEC_NICE                                              3
+
 /*****************************************************************************
  * Generic decoder configuration
  *****************************************************************************/
index 2949df222fc044ffa3ba704109dcad306426464b..b4bf70cfc304f517708fc24572197232d05c6cf2 100644 (file)
@@ -188,12 +188,10 @@ typedef struct vout_thread_s
     mtime_t             last_idle_date;            /* last idle display date */
     mtime_t             init_display_date;
 
-#ifdef STATS
     /* Statistics - these numbers are not supposed to be accurate, but are a
      * good indication of the thread status */
     count_t             c_fps_samples;                     /* picture counts */
     mtime_t             p_fps_sample[VOUT_FPS_SAMPLES]; /* FPS samples dates */
-#endif
 
     /* Rendering buffers */
     int                 i_buffer_index;                      /* buffer index */
index d7bec72afd7087ef6afc382b68b34e884b094da9..fba5d02f242333bf579b91c01be070815c234113 100644 (file)
@@ -65,7 +65,7 @@ typedef struct video_synchro_s
     mtime_t         backward_pts, current_pts;
 
 #ifdef STATS
-    unsigned int    i_B_self, i_B_next, i_B_last, i_B_I;
+    unsigned int    i_trashed_pic;
 #endif
 } video_synchro_t;
 
index 1c9d40ffa40e48a4daedd64e3d9c4cb9a0fd2d6b..bfcf8341be0c918423757456840269058de5e32e 100644 (file)
@@ -771,7 +771,7 @@ static __inline__ void input_DemuxPES( input_thread_t *p_input,
 
         if(i_ts_payload_size < PES_HEADER_SIZE)
         {
-            intf_DbgMsg("Code never tested encountered, WARNING ! (benny)\n");
+            intf_WarnMsg(3, "Code never tested encountered, WARNING ! (benny)\n");
             if( !p_pes->p_pes_header_save )
             {
                 p_pes->p_pes_header_save = malloc(PES_HEADER_SIZE);
index 023f19750a1047741fb7fe33e7d1c28c957f1f7a..91aaf1e99426f7500c4106f1b2cba5baf1d60670 100644 (file)
@@ -183,6 +183,15 @@ int vdec_InitThread( vdec_thread_t *p_vdec )
     }
 #endif
 
+#ifdef VDEC_SMP
+    /* Re-nice ourself */
+    if( nice(VDEC_NICE) == -1 )
+    {
+        intf_WarnMsg( 2, "vdec warning : couldn't nice() (%s)\n",
+                      strerror(errno) );
+    }
+#endif
+
     /* Mark thread as running and return */
     intf_DbgMsg("vdec debug: InitThread(%p) succeeded\n", p_vdec);
     return( 0 );
index f8139b7c98b7b347ce465df067939a006dc034a2..dca917387afcbe333be440f968598f653135f1f9 100644 (file)
@@ -176,10 +176,8 @@ vout_thread_t * vout_CreateThread   ( char *psz_display, int i_root_window,
     p_vout->init_display_date   = mdate();
     p_vout->render_time         = 10000;
 
-#ifdef STATS
     /* Initialize statistics fields */
     p_vout->c_fps_samples       = 0;
-#endif
 
     /* Initialize buffer index */
     p_vout->i_buffer_index      = 0;
@@ -993,10 +991,9 @@ static void RunThread( vout_thread_t *p_vout)
 
         if( p_pic )
         {
-#ifdef STATS
             /* Computes FPS rate */
             p_vout->p_fps_sample[ p_vout->c_fps_samples++ % VOUT_FPS_SAMPLES ] = display_date;
-#endif
+
             if( display_date < current_date )
             {
                 /* Picture is late: it will be destroyed and the thread
@@ -1012,7 +1009,8 @@ static void RunThread( vout_thread_t *p_vout)
                     p_pic->i_status = DESTROYED_PICTURE;
                     p_vout->i_pictures--;
                 }
-                intf_DbgMsg( "warning: late picture skipped (%p)\n", p_pic );
+                intf_WarnMsg( 3,
+                        "warning: late picture skipped (%p)\n", p_pic );
                 vlc_mutex_unlock( &p_vout->picture_lock );
 
                continue;
@@ -1687,11 +1685,8 @@ static void RenderPicture( vout_thread_t *p_vout, picture_t *p_pic )
  *****************************************************************************/
 static void RenderPictureInfo( vout_thread_t *p_vout, picture_t *p_pic )
 {
-#if defined(STATS) || defined(DEBUG)
     char        psz_buffer[256];                            /* string buffer */
-#endif
 
-#ifdef STATS
     /*
      * Print FPS rate in upper right corner
      */
@@ -1712,7 +1707,6 @@ static void RenderPictureInfo( vout_thread_t *p_vout, picture_t *p_pic )
     sprintf( psz_buffer, "%ld frames, render: %ldus",
              (long) p_vout->c_fps_samples, (long) p_vout->render_time );
     Print( p_vout, 0, 0, LEFT_RALIGN, TOP_RALIGN, psz_buffer );
-#endif
 
 #ifdef DEBUG
     /*
index 9b58880730025173d696767b045589654eb2ad03..13e706630a2d4a19920dcff705d2acce4b35ed85 100644 (file)
@@ -32,6 +32,8 @@
 #include <unistd.h>                                              /* getpid() */
 #include <sys/types.h>                        /* on BSD, uio.h needs types.h */
 #include <sys/uio.h>                                            /* "input.h" */
+#include <errno.h>
+#include <string.h>
 
 #include "config.h"
 #include "common.h"
@@ -262,6 +264,13 @@ static int InitThread( vpar_thread_t *p_vpar )
     p_vpar->pp_vdec[0]->b_die = 0;
     p_vpar->pp_vdec[0]->b_error = 0;
     p_vpar->pp_vdec[0]->p_vpar = p_vpar;
+
+    /* Re-nice ourself */
+    if( nice(VDEC_NICE) == -1 )
+    {
+        intf_WarnMsg( 2, "vpar warning : couldn't nice() (%s)\n",
+                      strerror(errno) );
+    }
 #endif
 
     /* Initialize lookup tables */
index daf0cd5256c3c546c7b599134d40f47610140370..18612978e15b114918a13039acf0e2a4bb0e616e 100644 (file)
  * tau[I,P,B]   : Mean time to decode an [I,P,B] picture.
  * tauYUV       : Mean time to render a picture (given by the video_output).
  * tau´[I,P,B] = 2 * tau[I,P,B] + tauYUV
- *              : Mean time + typical difference (estimated to tau, that
+ *              : Mean time + typical difference (estimated to tau/2, that
  *                needs to be confirmed) + render time.
  * DELTA        : A given error margin.
  *
- * 3. Decoding of an I picture
+ * 3. General considerations
+ *    ======================
+ * We define to types of machines :
+ *      2T > tauP  : machines capable of decoding all P pictures
+ *      14T > tauI : machines capable of decoding all I pictures
+ *
+ * 4. Decoding of an I picture
  *    ========================
- * On fast machines (ie. those who can decode all Is), we decode all I.
+ * On fast machines, we decode all I's.
  * Otherwise :
  * We can decode an I picture if we simply have enough time to decode it 
  * before displaying :
  *
  * 4. Decoding of a P picture
  *    =======================
- * On fast machines (ie. those who can decode all Ps), we decode all P.
+ * On fast machines, we decode all P's.
  * Otherwise :
  * First criterion : have time to decode it.
  *      t2 - t > tau´P + DELTA
  *
- * Second criterion : it shouldn't prevent us from decoding the forthcoming I
- * picture, which is more important.
+ * Second criterion : it shouldn't prevent us from displaying the forthcoming
+ * picture, which is more important.
  *      t12 - t > tau´P + tau´I + DELTA
  *
  * 5. Decoding of a B picture
  * First criterion : have time to decode it.
  *      t1 - t > tau´B + DELTA
  *
- * Second criterion : it shouldn't prevent us from decoding all P pictures
- * until the next I, which are more important.
+ * Second criterion : it shouldn't prevent us from displaying the forthcoming
+ * P picture, which is more important.
  *      t4 - t > tau´B + tau´P + DELTA
- *      [...]
- *      t10 - t > tau´B + 4 * tau´P + DELTA
- * It is possible to demonstrate that if the first and the last inequations
- * are verified, the inequations in between will be verified too.
- *
- * Third criterion : it shouldn't prevent us from decoding the forthcoming I
- * picture, which is more important.
- *      t12 - t > tau´B + 4 * tau´P + tau´I + DELTA
- *
- * If STATS is defined, the counters in p_vpar->synchro will refer to the
- * number of failures of these inequations.
  *
  * I hope you will have a pleasant flight and do not forget your life
  * jacket.
@@ -136,9 +131,7 @@ static int  SynchroType( void );
 static void SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type );
 
 /* Error margins */
-#define DELTA_I                 (int)(0.010*CLOCK_FREQ)
-#define DELTA_P                 (int)(0.010*CLOCK_FREQ)
-#define DELTA_B                 (int)(0.060*CLOCK_FREQ)
+#define DELTA                   (int)(0.060*CLOCK_FREQ)
 
 #define DEFAULT_NB_P            5
 #define DEFAULT_NB_B            1
@@ -227,14 +220,14 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
 #define S                           p_vpar->synchro
         /* VPAR_SYNCHRO_DEFAULT */
         mtime_t         now, pts, period, tau_yuv;
-        boolean_t       b_decode = 0, b_decode2;
+        boolean_t       b_decode = 0;
 
         now = mdate();
         period = 1000000 / (p_vpar->sequence.i_frame_rate) * 1001;
 
-        //vlc_mutex_lock( &p_vpar->p_vout->change_lock );
+        vlc_mutex_lock( &p_vpar->p_vout->change_lock );
         tau_yuv = p_vpar->p_vout->render_time;
-        //vlc_mutex_unlock( &p_vpar->p_vout->change_lock );
+        vlc_mutex_unlock( &p_vpar->p_vout->change_lock );
 
         vlc_mutex_lock( &p_vpar->synchro.fifo_lock );
 
@@ -242,7 +235,8 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
         {
         case I_CODING_TYPE:
             /* Stream structure changes */
-            S.i_n_p = S.i_eta_p || DEFAULT_NB_P;
+            if( S.i_n_p )
+                S.i_n_p = S.i_eta_p;
 
             if( S.backward_pts )
             {
@@ -255,14 +249,15 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
 
             b_decode = ( (1 + S.i_n_p * (S.i_n_b + 1)) * period > 
                            S.p_tau[I_CODING_TYPE] ) ||
-                       ( (pts - now) > (TAU_PRIME(I_CODING_TYPE) + DELTA_I) );
+                       ( (pts - now) > (TAU_PRIME(I_CODING_TYPE) + DELTA) );
             if( !b_decode )
-                intf_Msg("vpar synchro: trashing I\n");
+                intf_WarnMsg( 3, "vpar synchro warning: trashing I\n" );
             break;
 
         case P_CODING_TYPE:
             /* Stream structure changes */
-            S.i_n_b = S.i_eta_b || DEFAULT_NB_B;
+            if( S.i_n_b )
+                S.i_n_b = S.i_eta_b;
             if( S.i_eta_p + 1 > S.i_n_p )
                 S.i_n_p++;
 
@@ -277,17 +272,18 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
 
             if( (S.i_n_b + 1) * period > S.p_tau[P_CODING_TYPE] )
             {
+                /* Security in case we're _really_ late */
                 b_decode = (pts - now > 0);
             }
             else
             {
-                b_decode = (pts - now) > (TAU_PRIME(P_CODING_TYPE) + DELTA_P);
+                b_decode = (pts - now) > (TAU_PRIME(P_CODING_TYPE) + DELTA);
                 /* next I */
                 b_decode &= (pts - now
                               + period
                           * ( (S.i_n_p - S.i_eta_p - 1) * (1 + S.i_n_b) - 1 ))
                             > (TAU_PRIME(P_CODING_TYPE)
-                                + TAU_PRIME(I_CODING_TYPE) + DELTA_P);
+                                + TAU_PRIME(I_CODING_TYPE) + DELTA);
             }
             break;
 
@@ -300,51 +296,25 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
 
             if( (S.i_n_b + 1) * period > S.p_tau[P_CODING_TYPE] )
             {
-                b_decode = (pts - now) > (TAU_PRIME(B_CODING_TYPE) + DELTA_B);
-#ifdef STATS
-                S.i_B_self += !b_decode;
-#endif
+                b_decode = (pts - now) > (TAU_PRIME(B_CODING_TYPE) + DELTA);
+
                 /* Remember that S.i_eta_b is for the moment only eta_b - 1. */
                 if( S.i_eta_p != S.i_n_p ) /* next P */
                 {
-                    b_decode2 = (pts - now
-                                  + period
-                                  * ( 2 * S.i_n_b - S.i_eta_b - 1))
-                                    > (TAU_PRIME(B_CODING_TYPE)
-                                        + TAU_PRIME(P_CODING_TYPE) + DELTA_B);
-                    b_decode &= b_decode2;
-#ifdef STATS
-                    S.i_B_next += !b_decode2;
-#endif
+                    b_decode &= (pts - now
+                                 + period
+                                 * ( 2 * S.i_n_b - S.i_eta_b - 1))
+                                   > (TAU_PRIME(B_CODING_TYPE)
+                                       + TAU_PRIME(P_CODING_TYPE) + DELTA);
                 }
-                if( S.i_eta_p < S.i_n_p - 1 ) /* last P */
+                else /* next I */
                 {
-                    b_decode2 = (pts - now
-                                  + period
-                                  * ( (S.i_n_p - S.i_eta_p) * (1 + S.i_n_b)
-                                        + S.i_n_b - (S.i_eta_b + 1) + 1))
-                                    > (TAU_PRIME(B_CODING_TYPE)
-                                        + (S.i_n_p - S.i_eta_p)
-                                        * TAU_PRIME(P_CODING_TYPE)
-                                        + DELTA_B);
-                    b_decode &= b_decode2;
-#ifdef STATS
-                    S.i_B_last += !b_decode2;
-#endif
+                    b_decode &= (pts - now
+                                 + period
+                                 * ( 2 * S.i_n_b - S.i_eta_b - 1))
+                                   > (TAU_PRIME(B_CODING_TYPE)
+                                       + TAU_PRIME(I_CODING_TYPE) + DELTA);
                 }
-                b_decode2 = (pts - now
-                              + period
-                              * ( (S.i_n_p - S.i_eta_p + 1) * (1 + S.i_n_b)
-                                        + S.i_n_b - (S.i_eta_b + 1) + 1 ))
-                                    > (TAU_PRIME(B_CODING_TYPE)
-                                        + (S.i_n_p - S.i_eta_p)
-                                        * TAU_PRIME(P_CODING_TYPE)
-                                        + TAU_PRIME(I_CODING_TYPE)
-                                        + DELTA_B);
-                b_decode &= b_decode2;
-#ifdef STATS
-                S.i_B_I += !b_decode2;
-#endif
             }
             else
             {
@@ -366,6 +336,9 @@ void vpar_SynchroTrash( vpar_thread_t * p_vpar, int i_coding_type,
                         int i_structure )
 {
     SynchroNewPicture( p_vpar, i_coding_type );
+#ifdef STATS
+    p_vpar->synchro.i_trashed_pic++;
+#endif
 }
 
 /*****************************************************************************
@@ -499,15 +472,17 @@ static void SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type )
     case I_CODING_TYPE:
         p_vpar->synchro.i_eta_p = p_vpar->synchro.i_eta_b = 0;
 #ifdef STATS
-        intf_Msg( "vpar synchro stats: I(%lld) P(%lld) B(%lld)[%d:%d:%d:%d] YUV(%lld)\n",
+        intf_Msg( "vpar synchro stats: I(%lld) P(%lld)[%d] B(%lld)[%d] YUV(%lld) : %d/%d\n",
                   p_vpar->synchro.p_tau[I_CODING_TYPE],
                   p_vpar->synchro.p_tau[P_CODING_TYPE],
+                  p_vpar->synchro.i_n_p,
                   p_vpar->synchro.p_tau[B_CODING_TYPE],
-                  p_vpar->synchro.i_B_self, p_vpar->synchro.i_B_next,
-                  p_vpar->synchro.i_B_last, p_vpar->synchro.i_B_I,
-                  p_vpar->p_vout->render_time );
-        p_vpar->synchro.i_B_self = p_vpar->synchro.i_B_next =
-            p_vpar->synchro.i_B_last = p_vpar->synchro.i_B_I = 0;
+                  p_vpar->synchro.i_n_b,
+                  p_vpar->p_vout->render_time,
+                  1 + p_vpar->synchro.i_n_p * (1 + p_vpar->synchro.i_n_b) -
+                  p_vpar->synchro.i_trashed_pic,
+                  1 + p_vpar->synchro.i_n_p * (1 + p_vpar->synchro.i_n_b) );
+        p_vpar->synchro.i_trashed_pic = 0;
 #endif
         break;
     case P_CODING_TYPE:
@@ -527,7 +502,8 @@ static void SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type )
         {
             if( p_pes->i_pts < p_vpar->synchro.current_pts )
             {
-                intf_ErrMsg("vpar warning: pts_date < current_date\n");
+                intf_WarnMsg( 2,
+                        "vpar synchro warning: pts_date < current_date\n" );
             }
             p_vpar->synchro.current_pts = p_pes->i_pts;
             p_pes->b_has_pts = 0;
@@ -547,7 +523,8 @@ static void SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type )
         {
             if( p_vpar->synchro.backward_pts < p_vpar->synchro.current_pts )
             {
-                intf_ErrMsg("vpar warning: backward_date < current_date\n");
+                intf_WarnMsg( 2,
+                        "vpar warning: backward_date < current_date\n" );
             }
             p_vpar->synchro.current_pts = p_vpar->synchro.backward_pts;
             p_vpar->synchro.backward_pts = 0;