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
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
PLUGINS=${PLUGINS}"yuv ";
+OPTIMS=1;
ARCH=${host_cpu}
# Check whether --enable-ppro or --disable-ppro was given.
# 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
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*
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
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
* 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
+ * I 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.
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
#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 );
{
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 )
{
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++;
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;
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
{
int i_structure )
{
SynchroNewPicture( p_vpar, i_coding_type );
+#ifdef STATS
+ p_vpar->synchro.i_trashed_pic++;
+#endif
}
/*****************************************************************************
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:
{
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;
{
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;