Commit 6cd676bc authored by Christophe Massiot's avatar Christophe Massiot

* Removed -march=pentiumpro ; should now work on pentium-class machines ;

* Removed --enable-stats configuration directive. Stats are now activated
at runtime with --stats ;
* New intf_StatMsg() call ;
* Vout picture heap is now 8 pictures instead of 5 (better synchro) ;
* Tremendous enhancements in statistics display ;
* Better capabilities handling.
parent e6a8d661
......@@ -35,7 +35,6 @@ ARCH = @ARCH@
# Compilation options
#
DEBUG = @DEBUG@
STATS = @STATS@
TRACE = @TRACE@
CPROF = @CPROF@
GPROF = @GPROF@
......@@ -132,10 +131,6 @@ ifeq ($(GPROF),1)
PROGRAM_OPTIONS += GPROF
DEFINE += -DGPROF
endif
ifeq ($(STATS),1)
PROGRAM_OPTIONS += STATS
DEFINE += -DSTATS
endif
# PROGRAM_BUILD is a complete identification of the build
# (we can't use fancy options with date since OSes like Solaris
......@@ -233,9 +228,9 @@ endif
ifneq (,$(findstring 86,$(ARCH)))
# Optional Pentium Pro optimizations
ifneq (,$(findstring ppro,$(ARCH)))
CFLAGS += -march=pentiumpro -mcpu=pentiumpro
CFLAGS += -mcpu=pentiumpro
else
CFLAGS += -march=pentium -mcpu=pentium
CFLAGS += -mcpu=pentium
endif
endif
......
This diff is collapsed.
......@@ -457,14 +457,6 @@ AC_ARG_ENABLE(debug,
[ --enable-debug Enable debug mode (default disabled)],
[ if test x$enableval = xyes; then DEBUG=1; fi ])
dnl
dnl Enable/disable statistics
dnl
STATS=0
AC_ARG_ENABLE(stats,
[ --enable-stats Enable printing of statistics (default disabled)],
[ if test x$enableval = xyes; then STATS=1; fi ])
dnl
dnl Trace mode
dnl
......@@ -994,7 +986,6 @@ AC_SUBST(ALIASES)
AC_SUBST(DEFINE)
AC_SUBST(INCLUDE)
AC_SUBST(DEBUG)
AC_SUBST(STATS)
AC_SUBST(ASM)
AC_SUBST(TRACE)
AC_SUBST(CPROF)
......@@ -1062,7 +1053,6 @@ vlc configuration
-----------------
vlc version : ${VLC_VERSION}
debug mode : ${DEBUG}
statistics : ${STATS}
trace mode : ${TRACE}
cprof/gprof support : ${CPROF}/${GPROF}
need builtin getopt : ${NEED_GETOPT}
......
......@@ -49,20 +49,6 @@
#define VERSION "@VLC_VERSION@"
/*****************************************************************************
* General compilation options
*****************************************************************************/
/* Define for DVB support - Note that some extensions or restrictions may be
* incompatible with native MPEG2 streams */
//#define DVB_EXTENSIONS
//#define DVB_RESTRICTIONS
/* Define to disable some obscure heuristics behind the video_parser and the
* video_decoder that improve performance but are not fully MPEG2 compliant
* and might cause problems with some very weird streams. */
//#define MPEG2_COMPLIANT
/*****************************************************************************
* Debugging options - define or undefine symbols
*****************************************************************************/
......@@ -93,8 +79,7 @@
#define CLOCK_FREQ 1000000
/* Automagically spawn input, audio and video threads ? */
/* XXX?? used ? */
/* Automagically spawn audio and video decoder threads */
#define AUTO_SPAWN
/* When creating or destroying threads in blocking mode, delay to poll thread
......@@ -353,10 +338,10 @@
/* Video heap size - remember that a decompressed picture is big
* (~1 Mbyte) before using huge values */
#define VOUT_MAX_PICTURES 5
#define VOUT_MAX_PICTURES 8
/* Number of simultaneous subpictures */
#define VOUT_MAX_SUBPICTURES 5
#define VOUT_MAX_SUBPICTURES 8
/* Maximum number of active areas in a rendering buffer. Active areas are areas
* of the picture which need to be cleared before re-using the buffer. If a
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.42 2001/09/05 16:07:49 massiot Exp $
* $Id: input_ext-intf.h,v 1.43 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -73,11 +73,8 @@ typedef struct es_descriptor_s
struct decoder_fifo_s * p_decoder_fifo;
vlc_thread_t thread_id; /* ID of the decoder */
#ifdef STATS
count_t c_payload_bytes;/* total of payload useful bytes */
count_t c_packets; /* total packets read */
count_t c_invalid_packets; /* invalid packets read */
#endif
} es_descriptor_t;
/* Special PID values - note that the PID is only on 13 bits, and that values
......@@ -227,30 +224,14 @@ typedef struct stream_descriptor_s
/* Stream control */
stream_ctrl_t control;
/* Statistics */
count_t c_packets_read; /* packets read */
count_t c_packets_trashed; /* trashed packets */
} stream_descriptor_t;
#define MUTE_NO_CHANGE -1
/*****************************************************************************
* i_p_config_t
*****************************************************************************
* This structure gives plugins pointers to the useful functions of input
*****************************************************************************/
struct input_thread_s;
struct data_packet_s;
struct es_descriptor_s;
typedef struct i_p_config_s
{
int (* pf_peek_stream)( struct input_thread_s *,
byte_t * buffer, size_t );
void (* pf_demux_pes)( struct input_thread_s *,
struct data_packet_s *,
struct es_descriptor_s *,
boolean_t b_unit_start,
boolean_t b_packet_lost );
} i_p_config_t;
/*****************************************************************************
* input_thread_t
*****************************************************************************
......@@ -311,7 +292,6 @@ typedef struct input_thread_s
void (* pf_network_close ) ( struct input_thread_s * );
#endif
i_p_config_t i_p_config; /* plugin configuration */
char * p_source;
int i_handle; /* socket or file descriptor */
......@@ -323,13 +303,7 @@ typedef struct input_thread_s
/* General stream description */
stream_descriptor_t stream; /* PAT tables */
#ifdef STATS
count_t c_loops;
count_t c_bytes; /* bytes read */
count_t c_payload_bytes; /* payload useful bytes */
count_t c_packets_read; /* packets read */
count_t c_packets_trashed; /* trashed packets */
#endif
} input_thread_t;
/* Input methods */
......
......@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: intf_msg.h,v 1.15 2001/05/31 03:12:49 sam Exp $
* $Id: intf_msg.h,v 1.16 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -86,6 +86,7 @@ void intf_MsgDestroy ( void );
void intf_Msg ( char *psz_format, ... );
void intf_ErrMsg ( char *psz_format, ... );
void intf_WarnMsg ( int i_level, char *psz_format, ... );
void intf_StatMsg ( char *psz_format, ... );
void intf_MsgImm ( char *psz_format, ... );
void intf_ErrMsgImm ( char *psz_format, ... );
......
......@@ -3,7 +3,7 @@
* Declaration and extern access to global program object.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: main.h,v 1.21 2001/06/12 18:16:49 stef Exp $
* $Id: main.h,v 1.22 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -43,6 +43,7 @@ typedef struct main_s
int i_cpu_capabilities; /* CPU extensions */
int i_warning_level; /* warning messages level */
boolean_t b_stats; /* display statistics ? */
/* Generic settings */
boolean_t b_audio; /* is audio output allowed ? */
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppenned video output thread.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_output.h,v 1.62 2001/09/26 12:32:25 massiot Exp $
* $Id: video_output.h,v 1.63 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -99,7 +99,6 @@ typedef struct vout_yuv_s
yuv_init_t * pf_init; /* initialize YUV tables */
yuv_reset_t * pf_reset; /* reset YUV tables */
yuv_end_t * pf_end; /* free YUV tables */
} vout_yuv_t;
/*****************************************************************************
......@@ -240,9 +239,12 @@ typedef struct vout_thread_s
p_vout_font_t p_default_font; /* default font */
p_vout_font_t p_large_font; /* large font */
#ifdef STATS
/* Statistics */
count_t c_loops;
#endif
count_t c_pictures, c_late_pictures;
mtime_t display_jitter; /* average deviation from the PTS */
count_t c_jitter_samples; /* number of samples used for the *
* calculation of the jitter */
} vout_thread_t;
/* Flags for changes - these flags are set in the i_changes field when another
......@@ -261,6 +263,8 @@ typedef struct vout_thread_s
/* Disabled for thread deadlocks issues --Meuuh */
//#define VOUT_NODISPLAY_CHANGE 0xff00 /* changes which forbidden display */
#define MAX_JITTER_SAMPLES 20
/*****************************************************************************
* Macros
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* input_ps.c: PS demux and packet management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ps.c,v 1.34 2001/08/14 04:52:39 sam Exp $
* $Id: input_ps.c,v 1.35 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Cyril Deguet <asmax@via.ecp.fr>
......@@ -381,9 +381,10 @@ static void PSInit( input_thread_t * p_input )
}
#endif
#ifdef STATS
input_DumpStream( p_input );
#endif
if( p_main->b_stats )
{
input_DumpStream( p_input );
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
else
......
......@@ -4,7 +4,7 @@
* decoders.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input.c,v 1.131 2001/09/24 11:17:49 massiot Exp $
* $Id: input.c,v 1.132 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -57,9 +57,7 @@
# include <sys/socket.h>
#endif
#ifdef STATS
# include <sys/times.h>
#endif
#include <sys/times.h>
#include "config.h"
#include "common.h"
......@@ -264,9 +262,7 @@ static void RunThread( input_thread_t *p_input )
while( !p_input->b_die && !p_input->b_error && !p_input->b_eof )
{
#ifdef STATS
p_input->c_loops++;
#endif
vlc_mutex_lock( &p_input->stream.stream_lock );
......@@ -347,6 +343,7 @@ static void RunThread( input_thread_t *p_input )
/* Demultiplex read packets. */
for( i = 0; i < p_input->i_read_once && pp_packets[i] != NULL; i++ )
{
p_input->stream.c_packets_read++;
p_input->pf_demux( p_input, pp_packets[i] );
}
......@@ -386,14 +383,10 @@ static void RunThread( input_thread_t *p_input )
static int InitThread( input_thread_t * p_input )
{
#ifdef STATS
/* Initialize statistics */
p_input->c_loops = 0;
p_input->c_bytes = 0;
p_input->c_payload_bytes = 0;
p_input->c_packets_read = 0;
p_input->c_packets_trashed = 0;
#endif
p_input->stream.c_packets_read = 0;
p_input->stream.c_packets_trashed = 0;
/* Set locks. */
vlc_mutex_init( &p_input->stream.stream_lock );
......@@ -418,11 +411,11 @@ static int InitThread( input_thread_t * p_input )
p_input->pf_init = f.pf_init;
if( f.pf_open != NULL )
{
p_input->pf_open = f.pf_open;
p_input->pf_open = f.pf_open;
}
if( f.pf_close != NULL )
{
p_input->pf_close = f.pf_close;
p_input->pf_close = f.pf_close;
}
p_input->pf_end = f.pf_end;
p_input->pf_init_bit_stream= f.pf_init_bit_stream;
......@@ -487,15 +480,18 @@ static void EndThread( input_thread_t * p_input )
pi_status = p_input->pi_status;
*pi_status = THREAD_END;
#ifdef STATS
if( p_main->b_stats )
{
struct tms cpu_usage;
/* Display statistics */
struct tms cpu_usage;
times( &cpu_usage );
intf_Msg( "input stats: cpu usage (user: %d, system: %d)",
cpu_usage.tms_utime, cpu_usage.tms_stime );
intf_StatMsg( "input stats: %d loops consuming user: %d, system: %d",
p_input->c_loops,
cpu_usage.tms_utime, cpu_usage.tms_stime );
input_DumpStream( p_input );
}
#endif
/* Free all ES and destroy all decoder threads */
input_EndStream( p_input );
......
......@@ -2,7 +2,7 @@
* input_ext-intf.c: services to the interface
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: input_ext-intf.c,v 1.27 2001/07/18 14:21:00 massiot Exp $
* $Id: input_ext-intf.c,v 1.28 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -191,7 +191,8 @@ void input_DumpStream( input_thread_t * p_input )
char psz_time2[OFFSETTOTIME_MAX_SIZE];
#define S p_input->stream
intf_Msg( "input info: Dumping stream ID 0x%x", S.i_stream_id );
intf_Msg( "input info: Dumping stream ID 0x%x [OK:%d/D:%d]", S.i_stream_id,
S.c_packets_read, S.c_packets_trashed );
if( S.b_seekable )
intf_Msg( "input info: seekable stream, position: %lld/%lld (%s/%s)",
S.p_selected_area->i_tell, S.p_selected_area->i_size,
......@@ -213,9 +214,10 @@ void input_DumpStream( input_thread_t * p_input )
for( j = 0; j < p_input->stream.pp_programs[i]->i_es_number; j++ )
{
#define ES p_input->stream.pp_programs[i]->pp_es[j]
intf_Msg( "input info: ES 0x%x, stream 0x%x, type 0x%x, %s",
intf_Msg( "input info: ES 0x%x, stream 0x%x, type 0x%x, %s [OK:%d/ERR:%d]",
ES->i_id, ES->i_stream_id, ES->i_type,
ES->p_decoder_fifo != NULL ? "selected" : "not selected");
ES->p_decoder_fifo != NULL ? "selected" : "not selected",
ES->c_packets, ES->c_invalid_packets );
#undef ES
}
}
......
......@@ -2,7 +2,7 @@
* mpeg_system.c: TS, PS and PES management
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: mpeg_system.c,v 1.58 2001/09/24 11:17:49 massiot Exp $
* $Id: mpeg_system.c,v 1.59 2001/10/01 16:18:48 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Michel Lespinasse <walken@via.ecp.fr>
......@@ -46,7 +46,7 @@
#include "input_ext-dec.h"
#include "input_ext-plugins.h"
#include "main.h" /* AC3/MPEG channel, SPU channel */
#include "main.h" /* AC3/MPEG channel, SPU channel, b_stat */
/*****************************************************************************
* Local prototypes
......@@ -643,10 +643,11 @@ static void DecodePSM( input_thread_t * p_input, data_packet_t * p_data )
p_input->stream.pp_programs[0]->pp_es[i_new_es_number] );
}
#ifdef STATS
intf_Msg( "input info: The stream map after the PSM is now :" );
input_DumpStream( p_input );
#endif
if( p_main->b_stats )
{
intf_StatMsg( "input info: The stream map after the PSM is now :" );
input_DumpStream( p_input );
}
vlc_mutex_unlock( &p_input->stream.stream_lock );
}
......@@ -905,9 +906,7 @@ void input_DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
&& (!p_es->b_audio || !p_input->stream.control.b_mute) )
{
vlc_mutex_unlock( &p_input->stream.control.control_lock );
#ifdef STATS
p_es->c_packets++;
#endif
input_GatherPES( p_input, p_data, p_es, 1, 0 );
}
else
......@@ -921,9 +920,7 @@ void input_DemuxPS( input_thread_t * p_input, data_packet_t * p_data )
if( b_trash )
{
p_input->pf_delete_packet( p_input->p_method_data, p_data );
#ifdef STATS
p_input->c_packets_trashed++;
#endif
p_input->stream.c_packets_trashed++;
}
}
......@@ -997,9 +994,7 @@ void input_DemuxTS( input_thread_t * p_input, data_packet_t * p_data )
((p_es->p_decoder_fifo != NULL) || b_psi
|| (p_pgrm_demux->i_pcr_pid == i_pid) ) )
{
#ifdef STATS
p_es->c_packets++;
#endif
/* Extract adaptation field information if any */
......@@ -1029,9 +1024,7 @@ void input_DemuxTS( input_thread_t * p_input, data_packet_t * p_data )
"Invalid TS adaptation field (%p)",
p_data );
p_data->b_discard_payload = 1;
#ifdef STATS
p_es->c_invalid_packets++;
#endif
}
/* Now we are sure that the byte containing flags is present:
......@@ -1139,9 +1132,7 @@ void input_DemuxTS( input_thread_t * p_input, data_packet_t * p_data )
if( b_trash )
{
p_input->pf_delete_packet( p_input->p_method_data, p_data );
#ifdef STATS
p_input->c_packets_trashed++;
#endif
p_input->stream.c_packets_trashed++;
}
else
{
......
......@@ -4,7 +4,7 @@
* interface, such as message output. See config.h for output configuration.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: intf_msg.c,v 1.37 2001/07/08 17:45:52 gbazin Exp $
* $Id: intf_msg.c,v 1.38 2001/10/01 16:18:49 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -63,7 +63,7 @@ typedef struct
#ifdef TRACE
/* Debugging informations - in TRACE mode, debug messages have calling
* location informations printed */
* location information printed */
mtime_t date; /* date of the message */
char * psz_file; /* file in which the function was called */
char * psz_function; /* function from which the function was called */
......@@ -75,7 +75,8 @@ typedef struct
#define INTF_MSG_STD 0 /* standard message */
#define INTF_MSG_ERR 1 /* error message */
#define INTF_MSG_DBG 3 /* debug message */
#define INTF_MSG_WARN 4 /* warning message*/
#define INTF_MSG_WARN 4 /* warning message */
#define INTF_MSG_STAT 5 /* statistic message */
/*****************************************************************************
......@@ -237,6 +238,23 @@ void intf_WarnMsg( int i_level, char *psz_format, ... )
}
}
/*****************************************************************************
* intf_StatMsg : print a statistic message
*****************************************************************************
* This function is the same as intf_Msg, except that it concerns statistic
* messages for testing purpose.
*****************************************************************************/
void intf_StatMsg( char *psz_format, ... )
{
va_list ap;
if( p_main->b_stats )
{
va_start( ap, psz_format );
QueueMsg( p_main->p_msg, INTF_MSG_STAT, psz_format, ap );
va_end( ap );
}
}
/*****************************************************************************
* _intf_DbgMsg: print a debugging message (ok ?)
......@@ -597,6 +615,7 @@ static void PrintMsg( intf_msg_item_t *p_msg )
switch( p_msg->i_type )
{
case INTF_MSG_STD: /* regular messages */
case INTF_MSG_STAT:
case INTF_MSG_ERR:
snprintf( psz_msg, i_msg_len, "%s", p_msg->psz_msg );
break;
......@@ -622,6 +641,7 @@ static void PrintMsg( intf_msg_item_t *p_msg )
switch( p_msg->i_type )
{
case INTF_MSG_STD: /* standard messages */
case INTF_MSG_STAT:
fprintf( stdout, "%s\n", psz_msg );
break;
case INTF_MSG_ERR: /* error messages */
......@@ -656,6 +676,7 @@ static void PrintMsg( intf_msg_item_t *p_msg )
switch( p_msg->i_type )
{
case INTF_MSG_STD: /* standard messages */
case INTF_MSG_STAT:
case INTF_MSG_DBG: /* debug messages */
fprintf( stdout, "%s\n", p_msg->psz_msg );
break;
......
......@@ -4,7 +4,7 @@
* and spawn threads.
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: main.c,v 1.115 2001/10/01 12:48:01 massiot Exp $
* $Id: main.c,v 1.116 2001/10/01 16:18:49 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
* Samuel Hocevar <sam@zoy.org>
......@@ -134,6 +134,7 @@
#define OPT_WARNING 191
#define OPT_VERSION 192
#define OPT_STDOUT 193
#define OPT_STATS 194
/* Usage fashion */
#define USAGE 0
......@@ -164,6 +165,7 @@ static const struct option longopts[] =
{ "intf", 1, 0, 'I' },
{ "warning", 1, 0, OPT_WARNING },
{ "stdout", 1, 0, OPT_STDOUT },
{ "stats", 0, 0, OPT_STATS },
/* Audio options */
{ "noaudio", 0, 0, OPT_NOAUDIO },
......@@ -275,15 +277,6 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
*/
p_main->i_cpu_capabilities = CPUCapabilities();
#if defined( __pentium__ ) || defined( __pentiumpro__ )
if( ! TestCPU( CPU_CAPABILITY_586 ) )
{
fprintf( stderr, "error: this program needs a Pentium CPU,\n"
"please try a version without Pentium support\n" );
return( 1 );
}
#endif
/*
* System specific initialization code
*/
......@@ -328,6 +321,30 @@ int main( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
*/
RedirectSTDOUT();
if( p_main->b_stats )
{
char p_capabilities[200];
p_capabilities[0] = '\0';
#define PRINT_CAPABILITY( capability, string ) \
if( p_main->i_cpu_capabilities & capability ) \
{ \
strncat( p_capabilities, string " ", \
sizeof(p_capabilities) - strlen(p_capabilities) ); \
p_capabilities[sizeof(p_capabilities) - 1] = '\0'; \
}
PRINT_CAPABILITY( CPU_CAPABILITY_486, "486" );
PRINT_CAPABILITY( CPU_CAPABILITY_586, "586" );
PRINT_CAPABILITY( CPU_CAPABILITY_PPRO, "Pentium Pro" );
PRINT_CAPABILITY( CPU_CAPABILITY_MMX, "MMX" );
PRINT_CAPABILITY( CPU_CAPABILITY_3DNOW, "3DNow!" );
PRINT_CAPABILITY( CPU_CAPABILITY_MMXEXT, "MMXEXT" );
PRINT_CAPABILITY( CPU_CAPABILITY_SSE, "SSE" );
PRINT_CAPABILITY( CPU_CAPABILITY_ALTIVEC, "Altivec" );
intf_StatMsg("info: CPU has capabilities %s", p_capabilities );
}
/*
* Initialize playlist and get commandline files
*/
......@@ -541,6 +558,7 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
p_main->b_video = 1;
p_main->i_warning_level = 0;
p_main->b_stats = 0;
p_main->p_channel = NULL;
......@@ -648,6 +666,10 @@ static int GetConfiguration( int *pi_argc, char *ppsz_argv[], char *ppsz_env[] )
main_PutPszVariable( INTF_STDOUT_VAR, optarg );
break;
case OPT_STATS:
p_main->b_stats = 1;
break;
/* Audio options */
case OPT_NOAUDIO: /* --noaudio */
p_main->b_audio = 0;
......@@ -1022,12 +1044,6 @@ static void InstructionSignalHandler( int i_signal )
* to an interface having been destroyed */
/* Acknowledge the signal received */
fprintf( stderr, "warning: extended instructions unsupported, "
"some optimizations will be disabled\n" );
#ifdef SYS_LINUX
fprintf( stderr, "upgrade to kernel 2.4.x to get rid of this warning\n" );
#endif
i_illegal = 1;
#ifdef HAVE_SIGRELSE
......@@ -1153,6 +1169,15 @@ static int CPUCapabilities( void )
{
i_capabilities |= CPU_CAPABILITY_SSE;
}
else
{
fprintf( stderr, "warning: your OS doesn't have support for "
"SSE instructions, "
"some optimizations\nwill be disabled\n" );
#ifdef SYS_LINUX
fprintf( stderr, "(you will need Linux kernel 2.4.x or later)\n" );
#endif
}
}
/* test for additional capabilities */
......
......@@ -2,7 +2,7 @@
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.5 2001/09/05 16:07:50 massiot Exp $
* $Id: video_parser.c,v 1.6 2001/10/01 16:18:49 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -36,9 +36,7 @@
#include <errno.h>
#include <string.h>
#ifdef STATS
# include <sys/times.h>
#endif
#include <sys/times.h>
#include "config.h"
#include "common.h"
......@@ -58,6 +56,8 @@
#include "vpar_pool.h"
#include "video_parser.h"
#include "main.h"
/*
* Local prototypes
*/
......@@ -186,14 +186,12 @@ static int InitThread( vpar_thread_t *p_vpar )
p_vpar->picture.i_current_structure = 0;
/* Initialize other properties */
#ifdef STATS
p_vpar->c_loops = 0;
p_vpar->c_sequences = 0;
memset(p_vpar->pc_pictures, 0, sizeof(p_vpar->pc_pictures));
memset(p_vpar->pc_decoded_pictures, 0, sizeof(p_vpar->pc_decoded_pictures));
memset(p_vpar->pc_malformed_pictures, 0,
sizeof(p_vpar->pc_malformed_pictures));
#endif
vpar_InitScanTable( p_vpar );
/*
......@@ -235,9 +233,8 @@ static void RunThread( vpar_thread_t *p_vpar )
while( (!p_vpar->p_fifo->b_die) && (!p_vpar->p_fifo->b_error) )
{
#ifdef STATS
p_vpar->c_loops++;
#endif
/* Parse the next sequence, group or picture header */
if( vpar_ParseHeader( p_vpar ) )
{
......@@ -317,48 +314,49 @@ static void EndThread( vpar_thread_t *p_vpar )
vout_DestroyPicture( p_vpar->p_vout, p_vpar->picture.p_picture );
}
#ifdef STATS
intf_Msg("vpar stats: %d loops among %d sequence(s)",
p_vpar->c_loops, p_vpar->c_sequences);
if( p_main->b_stats )
{
struct tms cpu_usage;
times( &cpu_usage );
intf_Msg("vpar stats: cpu usage (user: %d, system: %d)",
cpu_usage.tms_utime, cpu_usage.tms_stime);
}
intf_Msg("vpar stats: Read %d frames/fields (I %d/P %d/B %d)",
p_vpar->pc_pictures[I_CODING_TYPE]
+ p_vpar->pc_pictures[P_CODING_TYPE]
+ p_vpar->pc_pictures[B_CODING_TYPE],
p_vpar->pc_pictures[I_CODING_TYPE],
p_vpar->pc_pictures[P_CODING_TYPE],
p_vpar->pc_pictures[B_CODING_TYPE]);
intf_Msg("vpar stats: Decoded %d frames/fields (I %d/P %d/B %d)",
p_vpar->pc_decoded_pictures[I_CODING_TYPE]
+ p_vpar->pc_decoded_pictures[P_CODING_TYPE]
+ p_vpar->pc_decoded_pictures[B_CODING_TYPE],
p_vpar->pc_decoded_pictures[I_CODING_TYPE],
p_vpar->pc_decoded_pictures[P_CODING_TYPE],
p_vpar->pc_decoded_pictures[B_CODING_TYPE]);
intf_Msg("vpar stats: Read %d malformed frames/fields (I %d/P %d/B %d)",
p_vpar->pc_malformed_pictures[I_CODING_TYPE]
+ p_vpar->pc_malformed_pictures[P_CODING_TYPE]
+ p_vpar->pc_malformed_pictures[B_CODING_TYPE],
p_vpar->pc_malformed_pictures[I_CODING_TYPE],
p_vpar->pc_malformed_pictures[P_CODING_TYPE],
p_vpar->pc_malformed_pictures[B_CODING_TYPE]);
intf_StatMsg( "vpar stats: %d loops among %d sequence(s)",
p_vpar->c_loops, p_vpar->c_sequences );
intf_StatMsg( "vpar stats: cpu usage (user: %d, system: %d)",
cpu_usage.tms_utime, cpu_usage.tms_stime );
intf_StatMsg( "vpar stats: Read %d frames/fields (I %d/P %d/B %d)",
p_vpar->pc_pictures[I_CODING_TYPE]
+ p_vpar->pc_pictures[P_CODING_TYPE]
+ p_vpar->pc_pictures[B_CODING_TYPE],
p_vpar->pc_pictures[I_CODING_TYPE],
p_vpar->pc_pictures[P_CODING_TYPE],
p_vpar->pc_pictures[B_CODING_TYPE] );
intf_StatMsg( "vpar stats: Decoded %d frames/fields (I %d/P %d/B %d)",
p_vpar->pc_decoded_pictures[I_CODING_TYPE]
+ p_vpar->pc_decoded_pictures[P_CODING_TYPE]
+ p_vpar->pc_decoded_pictures[B_CODING_TYPE],
p_vpar->pc_decoded_pictures[I_CODING_TYPE],
p_vpar->pc_decoded_pictures[P_CODING_TYPE],
p_vpar->pc_decoded_pictures[B_CODING_TYPE] );
intf_StatMsg( "vpar stats: Read %d malformed frames/fields (I %d/P %d/B %d)",
p_vpar->pc_malformed_pictures[I_CODING_TYPE]
+ p_vpar->pc_malformed_pictures[P_CODING_TYPE]
+ p_vpar->pc_malformed_pictures[B_CODING_TYPE],
p_vpar->pc_malformed_pictures[I_CODING_TYPE],
p_vpar->pc_malformed_pictures[P_CODING_TYPE],
p_vpar->pc_malformed_pictures[B_CODING_TYPE] );
#define S p_vpar->sequence
intf_Msg("vpar info: %s stream (%dx%d), %d.%d pi/s",
S.b_mpeg2 ? "MPEG-2" : "MPEG-1",
S.i_width, S.i_height, S.i_frame_rate/1001, S.i_frame_rate % 1001);
intf_Msg("vpar info: %s, %s, matrix_coeff: %d",
S.b_progressive ? "Progressive" : "Non-progressive",
S.i_scalable_mode ? "scalable" : "non-scalable",
S.i_matrix_coefficients);
#endif
intf_StatMsg( "vpar info: %s stream (%dx%d), %d.%d pi/s",
S.b_mpeg2 ? "MPEG-2" : "MPEG-1",
S.i_width, S.i_height, S.i_frame_rate/1001,
S.i_frame_rate % 1001 );
intf_StatMsg( "vpar info: %s, %s, matrix_coeff: %d",
S.b_progressive ? "Progressive" : "Non-progressive",
S.i_scalable_mode ? "scalable" : "non-scalable",
S.i_matrix_coefficients );
#undef S
}
/* Dispose of matrices if they have been allocated. */
if( p_vpar->sequence.intra_quant.b_allocated )
......
......@@ -2,7 +2,7 @@
* video_parser.h : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.h,v 1.13 2001/09/05 16:07:50 massiot Exp $
* $Id: video_parser.h,v 1.14 2001/10/01 16:18:49 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
......@@ -260,9 +260,8 @@ typedef struct video_synchro_s
* reference picture
* (backward_period * period / 2) */
#ifdef STATS
/* statistics */
unsigned int i_trashed_pic, i_not_chosen_pic, i_pic;
#endif
} video_synchro_t;
/* Synchro algorithms */
......@@ -343,7 +342,6 @@ typedef struct vpar_thread_s
void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] );
#ifdef STATS
/* Statistics */
count_t c_loops; /* number of loops */
count_t c_sequences; /* number of sequences */
......@@ -352,7 +350,6 @@ typedef struct vpar_thread_s
* pictures decoded */
count_t pc_malformed_pictures[4]; /* number of pictures trashed
* during parsing */
#endif
} vpar_thread_t;
/*****************************************************************************
......
......@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.c,v 1.9 2001/09/26 12:32:25 massiot Exp $
* $Id: vpar_headers.c,v 1.10 2001/10/01 16:18:49 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -248,9 +248,8 @@ int vpar_ParseHeader( vpar_thread_t * p_vpar )
switch( GetBits32( &p_vpar->bit_stream ) )
{
case SEQUENCE_HEADER_CODE:
#ifdef STATS
p_vpar->c_sequences++;
#endif
SequenceHeader( p_vpar );
return 0;
break;
......@@ -560,9 +559,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
/* Extension and User data. */
ExtensionAndUserData( p_vpar );
#ifdef STATS
p_vpar->pc_pictures[p_vpar->picture.i_coding_type]++;
#endif
if( p_vpar->picture.i_current_structure )
{
......@@ -708,9 +705,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
}
/* OK, now we are sure we will decode the picture. */
#ifdef STATS
p_vpar->pc_decoded_pictures[p_vpar->picture.i_coding_type]++;
#endif
#define P_picture p_vpar->picture.p_picture
p_vpar->picture.b_error = 0;
......@@ -832,9 +827,7 @@ static void PictureHeader( vpar_thread_t * p_vpar )
if( p_vpar->picture.b_error )
{
/* Trash picture. */
#ifdef STATS
p_vpar->pc_malformed_pictures[p_vpar->picture.i_coding_type]++;
#endif
vpar_SynchroEnd( p_vpar, p_vpar->picture.i_coding_type,
p_vpar->picture.i_structure, 1 );
......
......@@ -2,7 +2,7 @@
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_synchro.c,v 1.4 2001/07/24 12:03:00 massiot Exp $
* $Id: vpar_synchro.c,v 1.5 2001/10/01 16:18:49 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -144,10 +144,8 @@ void vpar_SynchroInit( vpar_thread_t * p_vpar )
p_vpar->synchro.current_pts = mdate() + DEFAULT_PTS_DELAY;
p_vpar->synchro.backward_pts = 0;
p_vpar->synchro.i_current_period = p_vpar->synchro.i_backward_period = 0;
#ifdef STATS
p_vpar->synchro.i_trashed_pic = p_vpar->synchro.i_not_chosen_pic =
p_vpar->synchro.i_pic = 0;
#endif
}
/*****************************************************************************
......@@ -315,12 +313,10 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
mstrtime(p_date, pts), b_decode ? "decoding" : "trashed",
S.p_tau[i_coding_type]);
#endif
#ifdef STATS
if( !b_decode )
{
S.i_not_chosen_pic++;
}
#endif
return( b_decode );
#undef S
#undef TAU_PRIME
......@@ -333,9 +329,7 @@ boolean_t vpar_SynchroChoose( vpar_thread_t * p_vpar, int i_coding_type,
void vpar_SynchroTrash( vpar_thread_t * p_vpar, int i_coding_type,
int i_structure )
{
#ifdef STATS
p_vpar->synchro.i_trashed_pic++;
#endif
}
/*****************************************************************************
......@@ -422,8 +416,8 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
p_vpar->synchro.i_n_p = p_vpar->synchro.i_eta_p;
}
p_vpar->synchro.i_eta_p = p_vpar->synchro.i_eta_b = 0;
#ifdef STATS
if( p_vpar->synchro.i_type == VPAR_SYNCHRO_DEFAULT )
if( p_main->b_stats && p_vpar->synchro.i_type == VPAR_SYNCHRO_DEFAULT )
{
intf_Msg( "vpar synchro stats: I(%lld) P(%lld)[%d] B(%lld)[%d] YUV(%lld) : trashed %d:%d/%d",
p_vpar->synchro.p_tau[I_CODING_TYPE],
......@@ -439,8 +433,8 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
p_vpar->synchro.i_trashed_pic = p_vpar->synchro.i_not_chosen_pic
= p_vpar->synchro.i_pic = 0;
}
#endif
break;
case P_CODING_TYPE:
p_vpar->synchro.i_eta_p++;
if( p_vpar->synchro.i_eta_b
......@@ -559,9 +553,7 @@ void vpar_SynchroNewPicture( vpar_thread_t * p_vpar, int i_coding_type,
}
#endif
#ifdef STATS
p_vpar->synchro.i_pic++;
#endif
}
/*****************************************************************************
......
......@@ -5,7 +5,7 @@
* thread, and destroy a previously oppened video output thread.
*****************************************************************************
* Copyright (C) 2000 VideoLAN
* $Id: video_output.c,v 1.140 2001/09/26 12:32:25 massiot Exp $
* $Id: video_output.c,v 1.141 2001/10/01 16:18:49 massiot Exp $
*
* Authors: Vincent Seguin <seguin@via.ecp.fr>
*
......@@ -34,9 +34,7 @@
#include <stdio.h> /* sprintf() */
#include <string.h> /* strerror() */
#ifdef STATS
# include <sys/times.h>
#endif
#include <sys/times.h>
#include "config.h"
#include "common.h"
......@@ -214,13 +212,18 @@ vout_thread_t * vout_CreateThread ( int *pi_status, int i_width, int i_height
/* Initialize statistics fields */
p_vout->c_fps_samples = 0;
p_vout->c_pictures = 0;
p_vout->c_late_pictures = 0;
p_vout->c_jitter_samples = 0;
p_vout->display_jitter = 0;
p_vout->c_loops = 0;
/* Initialize buffer index */
p_vout->i_buffer_index = 0;
/* Initialize fonts */
p_vout->p_default_font = NULL;
p_vout->p_large_font = NULL;
p_vout->p_default_font = NULL;
p_vout->p_large_font = NULL;
/* Initialize pictures and subpictures - translation tables and functions
* will be initialized later in InitThread */
......@@ -294,8 +297,8 @@ void vout_DestroyThread( vout_thread_t *p_vout, int *pi_status )
do
{
msleep( THREAD_SLEEP );
}while( (i_status != THREAD_OVER) && (i_status != THREAD_ERROR)
&& (i_status != THREAD_FATAL) );
} while( (i_status != THREAD_OVER) && (i_status != THREAD_ERROR)
&& (i_status != THREAD_FATAL) );
}
}
......@@ -873,10 +876,6 @@ static int InitThread( vout_thread_t *p_vout )
vlc_mutex_lock( &p_vout->change_lock );
#ifdef STATS
p_vout->c_loops = 0;
#endif
/* Create and initialize system-dependant method - this function issues its
* own error messages */
if( p_vout->pf_create( p_vout ) )
......@@ -999,14 +998,13 @@ static void RunThread( vout_thread_t *p_vout)
ephemer_date = 0;
display_date = 0;
current_date = mdate();
#ifdef STATS
p_vout->c_loops++;
if( !(p_vout->c_loops % VOUT_STATS_NB_LOOPS) )
{
intf_Msg("vout stats: picture heap: %d/%d",
p_vout->i_pictures, VOUT_MAX_PICTURES);
intf_StatMsg( "vout info: picture heap: %d/%d",
p_vout->i_pictures, VOUT_MAX_PICTURES );
}
#endif
/*
* Find the picture to display - this operation does not need lock,
......@@ -1025,6 +1023,8 @@ static void RunThread( vout_thread_t *p_vout)
if( p_pic )
{
p_vout->c_pictures++;
/* Computes FPS rate */
p_vout->p_fps_sample[ p_vout->c_fps_samples++ % VOUT_FPS_SAMPLES ] = display_date;
......@@ -1043,9 +1043,11 @@ static void RunThread( vout_thread_t *p_vout)
p_pic->i_status = DESTROYED_PICTURE;
p_vout->i_pictures--;
}
vlc_mutex_unlock( &p_vout->picture_lock );
intf_WarnMsg( 1,
"vout warning: late picture skipped (%p)", p_pic );
vlc_mutex_unlock( &p_vout->picture_lock );
p_vout->c_late_pictures++;
continue;
}
......@@ -1262,10 +1264,23 @@ static void RunThread( vout_thread_t *p_vout)
#endif
if( b_display /* && !(p_vout->i_changes & VOUT_NODISPLAY_CHANGE) */ )
{
mtime_t jitter;
p_vout->pf_display( p_vout );
#ifndef SYS_BEOS
p_vout->i_buffer_index = ++p_vout->i_buffer_index & 1;
#endif
/* Update statistics */
jitter = display_date - mdate();
if( jitter < 0 ) jitter = -jitter;
p_vout->display_jitter = ((p_vout->display_jitter
* p_vout->c_jitter_samples) + jitter)
/ (p_vout->c_jitter_samples + 1);
if( p_vout->c_jitter_samples < MAX_JITTER_SAMPLES )
{
p_vout->c_jitter_samples++;
}
}
if( p_pic )
......@@ -1341,15 +1356,18 @@ static void EndThread( vout_thread_t *p_vout )
/* Store status */
*p_vout->pi_status = THREAD_END;
#ifdef STATS
if( p_main->b_stats )
{
struct tms cpu_usage;
times( &cpu_usage );
intf_Msg( "vout stats: cpu usage (user: %d, system: %d)",
cpu_usage.tms_utime, cpu_usage.tms_stime );
intf_StatMsg( "vout info: %d loops consuming user: %d, system: %d",
p_vout->c_loops, cpu_usage.tms_utime, cpu_usage.tms_stime );
intf_StatMsg( "vout info: %d pictures received, discarded %d",
p_vout->c_pictures, p_vout->c_late_pictures );
intf_StatMsg( "vout info: average display jitter of %lld s",
p_vout->display_jitter );
}
#endif
/* Destroy all remaining pictures and subpictures */
for( i_index = 0; i_index < VOUT_MAX_PICTURES; i_index++ )
......@@ -1870,11 +1888,12 @@ static void RenderPictureInfo( vout_thread_t *p_vout, picture_t *p_pic )
(long) p_vout->c_fps_samples, (long) p_vout->render_time );
Print( p_vout, 0, 0, LEFT_RALIGN, TOP_RALIGN, psz_buffer );
#ifdef STATS
/*
* Print picture information in lower right corner
*/
sprintf( psz_buffer, "%s picture %dx%d (%dx%d%+d%+d %s) -> %dx%d+%d+%d",
if( p_main->b_stats )
{
/*
* Print picture information in lower right corner
*/
sprintf( psz_buffer, "%s picture %dx%d (%dx%d%+d%+d %s) -> %dx%d+%d+%d",
(p_pic->i_type == YUV_420_PICTURE) ? "4:2:0" :
((p_pic->i_type == YUV_422_PICTURE) ? "4:2:2" :
((p_pic->i_type == YUV_444_PICTURE) ? "4:4:4" : "ukn-type")),
......@@ -1889,8 +1908,8 @@ static void RenderPictureInfo( vout_thread_t *p_vout, picture_t *p_pic )
p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_height,
p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_x,
p_vout->p_buffer[ p_vout->i_buffer_index ].i_pic_y );
Print( p_vout, 0, 0, RIGHT_RALIGN, BOTTOM_RALIGN, psz_buffer );
#endif
Print( p_vout, 0, 0, RIGHT_RALIGN, BOTTOM_RALIGN, psz_buffer );
}
}
/*****************************************************************************
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment