Commit 4c3d1e88 authored by Christophe Massiot's avatar Christophe Massiot

* R�paration du VDEC_SMP. Ca marche sans planter avec la nouvelle

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.
parent 072f4a52
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
necessary. necessary.
* Fixed the DEBUG mode in the Makefile. * Fixed the DEBUG mode in the Makefile.
* Fixed a bug in mwait() which made us wait too long. * 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 Mon, 28 Aug 2000 02:34:18 +0200
0.1.99i : 0.1.99i :
......
...@@ -65,7 +65,7 @@ ...@@ -65,7 +65,7 @@
/* Define for profiling and statistics support - such informations, like FPS /* Define for profiling and statistics support - such informations, like FPS
* or pictures count won't be available if it not set */ * or pictures count won't be available if it not set */
//#define STATS #define STATS
/* Define for unthreaded version of the program FIXME: not yet implemented ??*/ /* Define for unthreaded version of the program FIXME: not yet implemented ??*/
//#define NO_THREAD //#define NO_THREAD
......
...@@ -56,11 +56,11 @@ typedef struct vdec_thread_s ...@@ -56,11 +56,11 @@ typedef struct vdec_thread_s
/* Input properties */ /* Input properties */
struct vpar_thread_s * p_vpar; /* video_parser thread */ struct vpar_thread_s * p_vpar; /* video_parser thread */
#ifndef HAVE_MMX
/* Lookup tables */ /* Lookup tables */
//#ifdef MPEG2_COMPLIANT
u8 pi_crop_buf[VDEC_CROPRANGE]; u8 pi_crop_buf[VDEC_CROPRANGE];
u8 * pi_crop; u8 * pi_crop;
//#endif #endif
#ifdef STATS #ifdef STATS
/* Statistics */ /* Statistics */
...@@ -70,9 +70,6 @@ typedef struct vdec_thread_s ...@@ -70,9 +70,6 @@ typedef struct vdec_thread_s
count_t c_decoded_i_pictures; /* number of I 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_p_pictures; /* number of P pictures decoded */
count_t c_decoded_b_pictures; /* number of B 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 );*/
#endif #endif
} vdec_thread_t; } vdec_thread_t;
...@@ -85,13 +82,13 @@ struct macroblock_s; ...@@ -85,13 +82,13 @@ struct macroblock_s;
/* Thread management functions */ /* Thread management functions */
#ifndef VDEC_SMP #ifndef VDEC_SMP
int vdec_InitThread ( struct vdec_thread_s *p_vdec ); int vdec_InitThread ( struct vdec_thread_s *p_vdec );
#endif
void vdec_DecodeMacroblock ( struct vdec_thread_s *p_vdec, void vdec_DecodeMacroblock ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb ); struct macroblock_s *p_mb );
void vdec_DecodeMacroblockC ( struct vdec_thread_s *p_vdec, void vdec_DecodeMacroblockC ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb ); struct macroblock_s *p_mb );
void vdec_DecodeMacroblockBW ( struct vdec_thread_s *p_vdec, void vdec_DecodeMacroblockBW ( struct vdec_thread_s *p_vdec,
struct macroblock_s *p_mb ); struct macroblock_s *p_mb );
#endif
vdec_thread_t * vdec_CreateThread ( struct vpar_thread_s *p_vpar /*, vdec_thread_t * vdec_CreateThread ( struct vpar_thread_s *p_vpar /*,
int *pi_status */ ); int *pi_status */ );
void vdec_DestroyThread ( vdec_thread_t *p_vdec /*, void vdec_DestroyThread ( vdec_thread_t *p_vdec /*,
......
...@@ -125,8 +125,10 @@ static __inline__ void vpar_DecodeMacroblock( video_fifo_t * p_fifo, ...@@ -125,8 +125,10 @@ static __inline__ void vpar_DecodeMacroblock( video_fifo_t * p_fifo,
VIDEO_FIFO_INCEND( *p_fifo ); VIDEO_FIFO_INCEND( *p_fifo );
vlc_mutex_unlock( &p_fifo->lock ); vlc_mutex_unlock( &p_fifo->lock );
#else
p_fifo->p_vpar->p_vout->vdec_DecodeMacroblock(
p_fifo->p_vpar->pp_vdec[0], p_mb );
#endif #endif
/* Shouldn't normally be used without SMP. */
} }
/***************************************************************************** /*****************************************************************************
......
...@@ -59,10 +59,6 @@ ...@@ -59,10 +59,6 @@
*/ */
#ifdef VDEC_SMP #ifdef VDEC_SMP
static int vdec_InitThread ( vdec_thread_t *p_vdec ); 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 #endif
static void RunThread ( vdec_thread_t *p_vdec ); static void RunThread ( vdec_thread_t *p_vdec );
static void ErrorThread ( vdec_thread_t *p_vdec ); static void ErrorThread ( vdec_thread_t *p_vdec );
...@@ -154,7 +150,9 @@ static int vdec_InitThread( vdec_thread_t *p_vdec ) ...@@ -154,7 +150,9 @@ static int vdec_InitThread( vdec_thread_t *p_vdec )
int vdec_InitThread( vdec_thread_t *p_vdec ) int vdec_InitThread( vdec_thread_t *p_vdec )
#endif #endif
{ {
#ifndef HAVE_MMX
int i_dummy; int i_dummy;
#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);
...@@ -168,6 +166,7 @@ int vdec_InitThread( vdec_thread_t *p_vdec ) ...@@ -168,6 +166,7 @@ int vdec_InitThread( vdec_thread_t *p_vdec )
p_vdec->c_decoded_b_pictures = 0; p_vdec->c_decoded_b_pictures = 0;
#endif #endif
#ifndef HAVE_MMX
/* Init crop table */ /* Init crop table */
p_vdec->pi_crop = p_vdec->pi_crop_buf + (VDEC_CROPRANGE >> 1); p_vdec->pi_crop = p_vdec->pi_crop_buf + (VDEC_CROPRANGE >> 1);
for( i_dummy = -(VDEC_CROPRANGE >> 1); i_dummy < 0; i_dummy++ ) for( i_dummy = -(VDEC_CROPRANGE >> 1); i_dummy < 0; i_dummy++ )
...@@ -182,6 +181,7 @@ int vdec_InitThread( vdec_thread_t *p_vdec ) ...@@ -182,6 +181,7 @@ int vdec_InitThread( vdec_thread_t *p_vdec )
{ {
p_vdec->pi_crop[i_dummy] = 255; p_vdec->pi_crop[i_dummy] = 255;
} }
#endif
/* Mark thread as running and return */ /* Mark thread as running and return */
intf_DbgMsg("vdec debug: InitThread(%p) succeeded\n", p_vdec); intf_DbgMsg("vdec debug: InitThread(%p) succeeded\n", p_vdec);
...@@ -474,11 +474,7 @@ static __inline__ void CopyBlock( vdec_thread_t * p_vdec, dctelem_t * p_block, ...@@ -474,11 +474,7 @@ static __inline__ void CopyBlock( vdec_thread_t * p_vdec, dctelem_t * p_block,
} \ } \
} }
#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 )
#endif
{ {
if( !(p_mb->i_mb_type & MB_INTRA) ) if( !(p_mb->i_mb_type & MB_INTRA) )
{ {
...@@ -508,11 +504,7 @@ void vdec_DecodeMacroblockC ( vdec_thread_t *p_vdec, macroblock_t * p_mb ) ...@@ -508,11 +504,7 @@ void vdec_DecodeMacroblockC ( vdec_thread_t *p_vdec, macroblock_t * p_mb )
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 )
#endif
{ {
if( !(p_mb->i_mb_type & MB_INTRA) ) if( !(p_mb->i_mb_type & MB_INTRA) )
{ {
......
...@@ -1631,7 +1631,7 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb, ...@@ -1631,7 +1631,7 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
#ifndef VDEC_SMP #ifndef VDEC_SMP
/* Decode the macroblock NOW ! */ /* Decode the macroblock NOW ! */
p_vpar->p_vout->vdec_DecodeMacroblock ( p_vpar->pp_vdec[0], p_mb ); vpar_DecodeMacroblock ( &p_vpar->vfifo, p_mb );
#endif #endif
} }
...@@ -2005,7 +2005,7 @@ static __inline__ void ParseMacroblock( ...@@ -2005,7 +2005,7 @@ static __inline__ void ParseMacroblock(
UpdateContext( p_vpar, i_structure ); UpdateContext( p_vpar, i_structure );
#ifndef VDEC_SMP #ifndef VDEC_SMP
/* Decode the macroblock NOW ! */ /* Decode the macroblock NOW ! */
p_vpar->p_vout->vdec_DecodeMacroblock ( p_vpar->pp_vdec[0], p_mb ); vpar_DecodeMacroblock ( &p_vpar->vfifo, p_mb );
#endif #endif
} }
else else
......
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