synchro.
* Remettage du #define STATS parce qu'en fait sinon on n'a pas les infos
dans la fen�tre. C'est dommage d'ailleurs qu'on ait � le mettre, parce
que du coup �a va nous d�courager de faire des stats sur d'autres
parties.
* Changements cosm�tiques dans les relations video_parser/video_decoder.
necessary.
* Fixed the DEBUG mode in the Makefile.
* Fixed a bug in mwait() which made us wait too long.
necessary.
* Fixed the DEBUG mode in the Makefile.
* Fixed a bug in mwait() which made us wait too long.
+ * The video_decoder can now be split into several threads to take
+ advantage of the SMP machines.
Mon, 28 Aug 2000 02:34:18 +0200
0.1.99i :
Mon, 28 Aug 2000 02:34:18 +0200
0.1.99i :
/* Define for profiling and statistics support - such informations, like FPS
* or pictures count won't be available if it not set */
/* Define for profiling and statistics support - such informations, like FPS
* or pictures count won't be available if it not set */
/* Define for unthreaded version of the program FIXME: not yet implemented ??*/
//#define NO_THREAD
/* Define for unthreaded version of the program FIXME: not yet implemented ??*/
//#define NO_THREAD
dctelem_t p_pre_idct[64*64];
/* Input properties */
dctelem_t p_pre_idct[64*64];
/* Input properties */
- struct vpar_thread_s * p_vpar; /* video_parser thread */
+ struct vpar_thread_s * p_vpar; /* video_parser thread */
-//#ifdef MPEG2_COMPLIANT
u8 pi_crop_buf[VDEC_CROPRANGE];
u8 * pi_crop;
u8 pi_crop_buf[VDEC_CROPRANGE];
u8 * pi_crop;
#ifdef STATS
/* Statistics */
#ifdef STATS
/* Statistics */
count_t c_decoded_i_pictures; /* number of I pictures decoded */
count_t c_decoded_p_pictures; /* number of P pictures decoded */
count_t c_decoded_b_pictures; /* number of B pictures decoded */
count_t c_decoded_i_pictures; /* number of I pictures decoded */
count_t c_decoded_p_pictures; /* number of P pictures decoded */
count_t c_decoded_b_pictures; /* number of B pictures decoded */
-
-/* void (*vdec_DecodeMacroblock) ( struct vdec_thread_s *p_vdec,
- struct macroblock_s *p_mb );*/
/* Thread management functions */
#ifndef VDEC_SMP
int vdec_InitThread ( struct vdec_thread_s *p_vdec );
/* Thread management functions */
#ifndef VDEC_SMP
int vdec_InitThread ( struct vdec_thread_s *p_vdec );
void vdec_DecodeMacroblock ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb );
void vdec_DecodeMacroblockC ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb );
void vdec_DecodeMacroblockBW ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb );
void vdec_DecodeMacroblock ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb );
void vdec_DecodeMacroblockC ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb );
void vdec_DecodeMacroblockBW ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb );
vdec_thread_t * vdec_CreateThread ( struct vpar_thread_s *p_vpar /*,
int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*,
vdec_thread_t * vdec_CreateThread ( struct vpar_thread_s *p_vpar /*,
int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*,
VIDEO_FIFO_INCEND( *p_fifo );
vlc_mutex_unlock( &p_fifo->lock );
VIDEO_FIFO_INCEND( *p_fifo );
vlc_mutex_unlock( &p_fifo->lock );
+#else
+ p_fifo->p_vpar->p_vout->vdec_DecodeMacroblock(
+ p_fifo->p_vpar->pp_vdec[0], p_mb );
- /* Shouldn't normally be used without SMP. */
}
/*****************************************************************************
}
/*****************************************************************************
*/
#ifdef VDEC_SMP
static int vdec_InitThread ( vdec_thread_t *p_vdec );
*/
#ifdef VDEC_SMP
static int vdec_InitThread ( vdec_thread_t *p_vdec );
-static void vdec_DecodeMacroblockC ( vdec_thread_t *p_vdec,
- macroblock_t * p_mb );
-static void vdec_DecodeMacroblockBW ( vdec_thread_t *p_vdec,
- macroblock_t * p_mb );
#endif
static void RunThread ( vdec_thread_t *p_vdec );
static void ErrorThread ( vdec_thread_t *p_vdec );
#endif
static void RunThread ( vdec_thread_t *p_vdec );
static void ErrorThread ( vdec_thread_t *p_vdec );
int vdec_InitThread( vdec_thread_t *p_vdec )
#endif
{
int vdec_InitThread( vdec_thread_t *p_vdec )
#endif
{
intf_DbgMsg("vdec debug: initializing video decoder thread %p\n", p_vdec);
intf_DbgMsg("vdec debug: initializing video decoder thread %p\n", p_vdec);
p_vdec->c_decoded_b_pictures = 0;
#endif
p_vdec->c_decoded_b_pictures = 0;
#endif
/* Init crop table */
p_vdec->pi_crop = p_vdec->pi_crop_buf + (VDEC_CROPRANGE >> 1);
for( i_dummy = -(VDEC_CROPRANGE >> 1); i_dummy < 0; i_dummy++ )
/* Init crop table */
p_vdec->pi_crop = p_vdec->pi_crop_buf + (VDEC_CROPRANGE >> 1);
for( i_dummy = -(VDEC_CROPRANGE >> 1); i_dummy < 0; i_dummy++ )
{
p_vdec->pi_crop[i_dummy] = 255;
}
{
p_vdec->pi_crop[i_dummy] = 255;
}
/* Mark thread as running and return */
intf_DbgMsg("vdec debug: InitThread(%p) succeeded\n", p_vdec);
/* Mark thread as running and return */
intf_DbgMsg("vdec debug: InitThread(%p) succeeded\n", p_vdec);
-#ifdef VDEC_SMP
-static __inline__ void vdec_DecodeMacroblockC ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
-#else
void vdec_DecodeMacroblockC ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
void vdec_DecodeMacroblockC ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
{
if( !(p_mb->i_mb_type & MB_INTRA) )
{
{
if( !(p_mb->i_mb_type & MB_INTRA) )
{
vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
}
vpar_ReleaseMacroblock( &p_vdec->p_vpar->vfifo, p_mb );
}
-#ifdef VDEC_SMP
-static __inline__ void vdec_DecodeMacroblockBW ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
-#else
void vdec_DecodeMacroblockBW ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
void vdec_DecodeMacroblockBW ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
{
if( !(p_mb->i_mb_type & MB_INTRA) )
{
{
if( !(p_mb->i_mb_type & MB_INTRA) )
{
#ifndef VDEC_SMP
/* Decode the macroblock NOW ! */
#ifndef VDEC_SMP
/* Decode the macroblock NOW ! */
- p_vpar->p_vout->vdec_DecodeMacroblock ( p_vpar->pp_vdec[0], p_mb );
+ vpar_DecodeMacroblock ( &p_vpar->vfifo, p_mb );
UpdateContext( p_vpar, i_structure );
#ifndef VDEC_SMP
/* Decode the macroblock NOW ! */
UpdateContext( p_vpar, i_structure );
#ifndef VDEC_SMP
/* Decode the macroblock NOW ! */
- p_vpar->p_vout->vdec_DecodeMacroblock ( p_vpar->pp_vdec[0], p_mb );
+ vpar_DecodeMacroblock ( &p_vpar->vfifo, p_mb );