]> git.sesse.net Git - vlc/commitdiff
* R�paration du VDEC_SMP. Ca marche sans planter avec la nouvelle
authorChristophe Massiot <massiot@videolan.org>
Tue, 14 Nov 2000 22:58:44 +0000 (22:58 +0000)
committerChristophe Massiot <massiot@videolan.org>
Tue, 14 Nov 2000 22:58:44 +0000 (22:58 +0000)
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.

ChangeLog
include/config.h.in
include/video_decoder.h
include/video_fifo.h
src/video_decoder/video_decoder.c
src/video_parser/vpar_blocks.c

index 6855676ff0e44ca5d4826fde9cc5b4488a7474b4..94ff0037ac071ad069bb8309ad1f5b6b8a35c2ab 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,8 @@
     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 :
index 0cc2c8ee26d0217018001f7feb63693894c257ee..3400baa5424d5389206b8268179331b46aabc6d8 100644 (file)
@@ -65,7 +65,7 @@
 
 /* Define for profiling and statistics support - such informations, like FPS
  * 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 NO_THREAD
index ebe4a21f2e53937ded0f8150625b7c081cc820e2..56c0b5527028b137b3ed7ab7eefd0febdbeb372c 100644 (file)
@@ -54,13 +54,13 @@ typedef struct vdec_thread_s
     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 */
 
+#ifndef HAVE_MMX
     /* Lookup tables */
-//#ifdef MPEG2_COMPLIANT
     u8              pi_crop_buf[VDEC_CROPRANGE];
     u8 *            pi_crop;
-//#endif
+#endif
 
 #ifdef STATS
     /* Statistics */
@@ -70,9 +70,6 @@ typedef struct vdec_thread_s
     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 );*/
 #endif
 } vdec_thread_t;
 
@@ -85,13 +82,13 @@ struct macroblock_s;
 /* Thread management functions */
 #ifndef VDEC_SMP
 int             vdec_InitThread         ( struct vdec_thread_s *p_vdec );
+#endif
 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 );
-#endif
 vdec_thread_t * vdec_CreateThread       ( struct vpar_thread_s *p_vpar /*,
                                           int *pi_status */ );
 void            vdec_DestroyThread      ( vdec_thread_t *p_vdec /*,
index 6fa97b17836cb2b1fa32aeb764660de1ffb49b1a..43dd80a3ef644adcfd6b4149440ba7c937db5545 100644 (file)
@@ -125,8 +125,10 @@ static __inline__ void vpar_DecodeMacroblock( video_fifo_t * p_fifo,
     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 );
 #endif
-    /* Shouldn't normally be used without SMP. */
 }
 
 /*****************************************************************************
index a94dd6e287518bec08c9a269915cbd83d8246559..023f19750a1047741fb7fe33e7d1c28c957f1f7a 100644 (file)
  */
 #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 );
@@ -154,7 +150,9 @@ static int vdec_InitThread( vdec_thread_t *p_vdec )
 int vdec_InitThread( vdec_thread_t *p_vdec )
 #endif
 {
+#ifndef HAVE_MMX
     int i_dummy;
+#endif
 
     intf_DbgMsg("vdec debug: initializing video decoder thread %p\n", p_vdec);
 
@@ -168,6 +166,7 @@ int vdec_InitThread( vdec_thread_t *p_vdec )
     p_vdec->c_decoded_b_pictures = 0;
 #endif
 
+#ifndef HAVE_MMX
     /* 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++ )
@@ -182,6 +181,7 @@ int vdec_InitThread( vdec_thread_t *p_vdec )
     {
         p_vdec->pi_crop[i_dummy] = 255;
     }
+#endif
 
     /* Mark thread as running and return */
     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,
     }                                                                   \
 }
 
-#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 )
-#endif
 {
     if( !(p_mb->i_mb_type & MB_INTRA) )
     {
@@ -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 );
 }
 
-#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 )
-#endif
 {
     if( !(p_mb->i_mb_type & MB_INTRA) )
     {
index 99d3438a68e52704fd82432f405bfe2103c07175..75926fdb15a90f7730d172b79efc2ae06bc90af9 100644 (file)
@@ -1631,7 +1631,7 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
 
 #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 );
 #endif
 }
 
@@ -2005,7 +2005,7 @@ static __inline__ void ParseMacroblock(
         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 );
 #endif
     }
     else