]> git.sesse.net Git - vlc/commitdiff
The motion compensation routines are now modules as well ; choose your
authorSam Hocevar <sam@videolan.org>
Thu, 18 Jan 2001 05:13:23 +0000 (05:13 +0000)
committerSam Hocevar <sam@videolan.org>
Thu, 18 Jan 2001 05:13:23 +0000 (05:13 +0000)
  implementation with `--motion motion', `--motion motionmmx' or
  `--motion motionmmxext'. Of course, the best implementation is chosen
  if you don't ask for any. There doesn't seem to be any performance hit
  due to the move to shared libs, which is a good thing. Please test
  actively if you have time, though.

    Updated --help result, manpage, INSTALL document, and a few files.

    I moved vdec_motion.h and vpar_blocks.h back to /include because they
  will be needed to build motion compensation modules, but perhaps we don't
  need to export everything which is in these files.

    /src/video_decoder/ now has only one .c file, perhaps it could now be
  merged with video_parser ?

33 files changed:
INSTALL
Makefile.in
configure
configure.in
debian/vlc.1
include/common.h
include/config.h.in
include/modules.h
include/vdec_motion.h [moved from src/video_decoder/vdec_motion.h with 56% similarity]
include/vpar_blocks.h [moved from src/video_decoder/vpar_blocks.h with 97% similarity]
plugins/idct/idct.c
plugins/idct/idctclassic.c
plugins/idct/idctmmx.c
plugins/motion/motion.c [new file with mode: 0644]
plugins/motion/motionmmx.c [new file with mode: 0644]
plugins/motion/motionmmxext.c [new file with mode: 0644]
plugins/motion/vdec_motion_common.c [moved from src/video_decoder/vdec_motion.c with 90% similarity]
plugins/motion/vdec_motion_inner.c [moved from src/video_decoder/vdec_motion_inner.c with 97% similarity]
plugins/motion/vdec_motion_inner_mmx.c [moved from src/video_decoder/vdec_motion_inner_mmx.c with 98% similarity]
plugins/motion/vdec_motion_inner_mmxext.c [moved from src/video_decoder/vdec_motion_inner_mmxext.c with 98% similarity]
plugins/yuv/video_yuv.c
plugins/yuv/yuv.c
plugins/yuv/yuvmmx.c
src/input/input_programs.c
src/interface/main.c
src/misc/modules.c
src/video_decoder/video_decoder.c
src/video_decoder/video_parser.h
src/video_parser/video_fifo.c
src/video_parser/video_parser.c
src/video_parser/vpar_blocks.c
src/video_parser/vpar_headers.c
src/video_parser/vpar_synchro.c

diff --git a/INSTALL b/INSTALL
index 0b4232896ef24e74594ecb1131035c733f1eb632..accc3d1bfcf9f33abba5f1cb3f737c484b32078b 100644 (file)
--- a/INSTALL
+++ b/INSTALL
@@ -28,6 +28,13 @@ To build RedHat packages, use :
    rpm -ba vlc.spec
 
 
+Here's a shortcut to copy-paste to do a clean build :
+
+   make distclean 2>/dev/null ; ./configure --prefix=/usr --enable-gnome \
+      --enable-fb --with-glide --with-ggi --with-sdl --enable-esd \
+      --enable-alsa && make
+
+
 Installing and running VideoLAN
 ===============================
 
index dc20060c6cb1986ba63d2db7691ec1cc4db3723f..6925139d08b87e09ad1198c56642c48870bec34e 100644 (file)
@@ -225,22 +225,13 @@ SPU_DECODER =     src/spu_decoder/spu_decoder.o
 
 #GEN_DECODER = src/generic_decoder/generic_decoder.o
 
-
 VIDEO_PARSER =         src/video_parser/video_parser.o \
                src/video_parser/vpar_headers.o \
                src/video_parser/vpar_blocks.o \
                src/video_parser/vpar_synchro.o \
                src/video_parser/video_fifo.o
 
-ifneq (,$(findstring mmx,$(ARCH)))
-       vdec_motion_inner = src/video_decoder/vdec_motion_inner_mmx.o
-else
-       vdec_motion_inner = src/video_decoder/vdec_motion_inner.o
-endif
-
-VIDEO_DECODER =        src/video_decoder/video_decoder.o \
-               src/video_decoder/vdec_motion.o \
-               $(vdec_motion_inner)
+VIDEO_DECODER =        src/video_decoder/video_decoder.o
 
 MISC =         src/misc/mtime.o \
                src/misc/tests.o \
@@ -344,6 +335,18 @@ PLUGIN_YUVMMX =    plugins/yuv/yuvmmx.o \
                plugins/yuv/video_yuvmmx.o \
                plugins/yuv/transforms_yuvmmx.o
 
+PLUGIN_MOTION =        plugins/motion/motion.o \
+               plugins/motion/vdec_motion_common.o \
+               plugins/motion/vdec_motion_inner.o
+
+PLUGIN_MOTIONMMX =     plugins/motion/motionmmx.o \
+                       plugins/motion/vdec_motion_common.o \
+                       plugins/motion/vdec_motion_inner_mmx.o
+
+PLUGIN_MOTIONMMXEXT =  plugins/motion/motionmmxext.o \
+                       plugins/motion/vdec_motion_common.o \
+                       plugins/motion/vdec_motion_inner_mmxext.o
+
 PLUGIN_IDCT =  plugins/idct/idct.o \
                plugins/idct/idct_common.o
 
@@ -369,6 +372,9 @@ STD_PLUGIN_OBJ =$(PLUGIN_BEOS) \
                $(PLUGIN_X11) \
                $(PLUGIN_YUV) \
                $(PLUGIN_YUVMMX) \
+               $(PLUGIN_MOTION) \
+               $(PLUGIN_MOTIONMMX) \
+               $(PLUGIN_MOTIONMMXEXT) \
                $(PLUGIN_IDCT) \
                $(PLUGIN_IDCTCLASSIC) \
                $(PLUGIN_IDCTMMX) \
@@ -378,7 +384,8 @@ STD_PLUGIN_OBJ =$(PLUGIN_BEOS) \
                $(PLUGIN_NULL)
 
 # list duplicates
-STD_PLUGIN_COMMON =    plugins/idct/idct_common.o
+STD_PLUGIN_COMMON =    plugins/idct/idct_common.o \
+                       plugins/motion/vdec_motion_common.o
 
 # filter out duplicates from the plugin object lists
 STD_PLUGIN_OBJ :=      $(filter-out $(STD_PLUGIN_COMMON) $(STD_PLUGIN_ASM), \
@@ -404,8 +411,8 @@ all: vlc @ALIASES@ plugins
 
 clean:
        rm -f $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
-       rm -f plugins/*/*.o src/*/*.o
-       rm -f vlc @ALIASES@ lib/*.so
+       rm -f plugins/*/*.o src/*/*.o lib/*.so
+       rm -f vlc @ALIASES@
 
 distclean: clean
        rm -f src/*/*.o plugins/*/*.o **/*~ *.log
@@ -558,15 +565,24 @@ lib/null.so: $(PLUGIN_NULL)
 lib/dummy.so: $(PLUGIN_DUMMY)
        $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
 
-lib/idct.so: $(PLUGIN_IDCT)
-       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
-
 lib/yuv.so: $(PLUGIN_YUV)
        $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
 
 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
        $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
 
+lib/motion.so: $(PLUGIN_MOTION)
+       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+
+lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
+       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+
+lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
+       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+
+lib/idct.so: $(PLUGIN_IDCT)
+       $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
+
 lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
        $(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
 
@@ -588,6 +604,15 @@ lib/yuv.so: $(PLUGIN_YUV)
 lib/yuvmmx.so: $(PLUGIN_YUVMMX)
        $(CC) $(PCFLAGS) -shared -o $@ $^
 
+lib/motion.so: $(PLUGIN_MOTION)
+       $(CC) $(PCFLAGS) -shared -o $@ $^
+
+lib/motionmmx.so: $(PLUGIN_MOTIONMMX)
+       $(CC) $(PCFLAGS) -shared -o $@ $^
+
+lib/motionmmxext.so: $(PLUGIN_MOTIONMMXEXT)
+       $(CC) $(PCFLAGS) -shared -o $@ $^
+
 lib/idct.so: $(PLUGIN_IDCT)
        $(CC) $(PCFLAGS) -shared -o $@ $^
 
index 776c2450d4358a87f839f1b8816b0dd4bd167bc5..42db13a40082731ba502a6e1b7eda4908c0bb5aa 100755 (executable)
--- a/configure
+++ b/configure
@@ -3296,7 +3296,7 @@ EOF
 fi
 
 
-PLUGINS=${PLUGINS}"yuv idct idctclassic ";
+PLUGINS=${PLUGINS}"yuv idct idctclassic motion ";
 
 ARCH=${host_cpu}
 # Check whether --enable-ppro or --disable-ppro was given.
@@ -3310,9 +3310,9 @@ fi
 # Check whether --enable-mmx or --disable-mmx was given.
 if test "${enable_mmx+set}" = set; then
   enableval="$enable_mmx"
-   if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx idctmmxext "; fi 
+   if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx motionmmx motionmmxext idctmmx idctmmxext "; fi 
 else
-   if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx idctmmxext "; fi 
+   if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx motionmmx motionmmxext idctmmx idctmmxext "; fi 
 fi
 
 # Check whether --enable-debug or --disable-debug was given.
index 88931fa3996f16e3a16854465dc776789fe7412f..96d71114cf71321105a54820170641535e52c873 100644 (file)
@@ -108,7 +108,7 @@ AC_TYPE_SIZE_T
 AC_HEADER_TIME
 
 dnl default plugins 
-PLUGINS=${PLUGINS}"yuv idct idctclassic ";
+PLUGINS=${PLUGINS}"yuv idct idctclassic motion ";
 
 ARCH=${host_cpu}
 AC_ARG_ENABLE(ppro,
@@ -117,8 +117,8 @@ AC_ARG_ENABLE(ppro,
 [ if test x${host_cpu} = xi686; then ARCH=${ARCH}" ppro"; fi ])
 AC_ARG_ENABLE(mmx,
 [  --disable-mmx           Disable MMX optimizations (default enabled for x86)],
-[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx idctmmxext "; fi ],
-[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx idctmmxext "; fi ])
+[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx motionmmx motionmmxext idctmmx idctmmxext "; fi ],
+[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx motionmmx motionmmxext idctmmx idctmmxext "; fi ])
 AC_ARG_ENABLE(debug,
 [  --enable-debug          Enable debug mode (default disabled)],
 [ if test x$enableval = xyes; then DEBUG=1; fi ])
index b1aa9120413da727145b7b5fabb76cbfc9ce4476..f3207d63d479f3d08870ddb51f4c6e12fbebb362 100644 (file)
@@ -47,6 +47,9 @@ Disable video output.
 .B \-\-vout <module>
 Specify a video output module: "gnome", "fb", "glide", for instance.
 .TP
+.B \-\-motion <module>
+Specify a module for motion compensation: "motion", "motionmmx", for instance.
+.TP
 .B \-\-idct <module>
 Specify a module for IDCT: "idct", "idctmmx", for instance.
 .TP
index 8f5446a2e7d6902ef990a1ee2dc7512934e4c5fb..92f6b8aa726846a0855da74c16dc088934b6eb97 100644 (file)
@@ -3,7 +3,7 @@
  * Collection of useful common types and macros definitions
  *****************************************************************************
  * Copyright (C) 1998, 1999, 2000 VideoLAN
- * $Id: common.h,v 1.24 2001/01/13 12:57:19 sam Exp $
+ * $Id: common.h,v 1.25 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Samuel Hocevar <sam@via.ecp.fr>
  *          Vincent Seguin <seguin@via.ecp.fr>
@@ -128,6 +128,9 @@ typedef struct vdec_thread_s *          p_vdec_thread_t;
 typedef struct vpar_thread_s *          p_vpar_thread_t;
 typedef struct video_parser_s *         p_video_parser_t;
 
+/* Misc */
+struct macroblock_s;
+
 /*****************************************************************************
  * Macros and inline functions
  *****************************************************************************/
index 07e2c5bec017d3644312ada14716d769cf501be1..34dd6c02cf52cfd390f124f5be56119683a0dbdb 100644 (file)
 /* Environment variable containing the display method */
 #define VOUT_METHOD_VAR                 "vlc_vout"
 
+/* Environment variable containing the motion compensation method */
+#define MOTION_METHOD_VAR               "vlc_motion"
+
 /* Environment variable containing the IDCT method */
 #define IDCT_METHOD_VAR                 "vlc_idct"
 
index 57cf042ad9cc57a36f6e32a269b574b9d1f5d893..09b4b783200819a7857b47b7d11dce2cdf43db4d 100644 (file)
@@ -40,12 +40,13 @@ typedef void *  module_handle_t;
 #define MODULE_CAPABILITY_DECAPS   1 <<  2  /* Decaps */
 #define MODULE_CAPABILITY_ADEC     1 <<  3  /* Audio decoder */
 #define MODULE_CAPABILITY_VDEC     1 <<  4  /* Video decoder */
-#define MODULE_CAPABILITY_IDCT     1 <<  5  /* IDCT transformation */
-#define MODULE_CAPABILITY_AOUT     1 <<  6  /* Audio output */
-#define MODULE_CAPABILITY_VOUT     1 <<  7  /* Video output */
-#define MODULE_CAPABILITY_YUV      1 <<  8  /* YUV colorspace conversion */
-#define MODULE_CAPABILITY_AFX      1 <<  9  /* Audio effects */
-#define MODULE_CAPABILITY_VFX      1 << 10  /* Video effects */
+#define MODULE_CAPABILITY_MOTION   1 <<  5  /* Video decoder */
+#define MODULE_CAPABILITY_IDCT     1 <<  6  /* IDCT transformation */
+#define MODULE_CAPABILITY_AOUT     1 <<  7  /* Audio output */
+#define MODULE_CAPABILITY_VOUT     1 <<  8  /* Video output */
+#define MODULE_CAPABILITY_YUV      1 <<  9  /* YUV colorspace conversion */
+#define MODULE_CAPABILITY_AFX      1 << 10  /* Audio effects */
+#define MODULE_CAPABILITY_VFX      1 << 11  /* Video effects */
 
 /* FIXME: not yet used */
 typedef struct probedata_s
@@ -74,6 +75,21 @@ typedef struct function_list_s
             void ( * pf_close )      ( struct aout_thread_s * p_aout );
         } aout;
 
+        struct
+        {
+#define motion_functions( yuv ) \
+            void ( * pf_field_field_##yuv ) ( struct macroblock_s * ); \
+            void ( * pf_field_16x8_##yuv )  ( struct macroblock_s * ); \
+            void ( * pf_field_dmv_##yuv )   ( struct macroblock_s * ); \
+            void ( * pf_frame_field_##yuv ) ( struct macroblock_s * ); \
+            void ( * pf_frame_frame_##yuv ) ( struct macroblock_s * ); \
+            void ( * pf_frame_dmv_##yuv )   ( struct macroblock_s * );
+           motion_functions( 420 )
+           motion_functions( 422 )
+           motion_functions( 444 )
+#undef motion_functions
+        } motion;
+
         struct
         {
             void ( * pf_init )         ( struct vdec_thread_s * p_vdec );
@@ -105,6 +121,7 @@ typedef struct module_functions_s
     function_list_t decaps;
     function_list_t adec;
     function_list_t vdec;
+    function_list_t motion;
     function_list_t idct;
     function_list_t aout;
     function_list_t vout;
similarity index 56%
rename from src/video_decoder/vdec_motion.h
rename to include/vdec_motion.h
index e2934511c744a02b36a7107bdf6ab53101065457..1bbf3a936843d84201674cdccc5705d5cfc499a7 100644 (file)
@@ -2,7 +2,7 @@
  * vdec_motion.h : types for the motion compensation algorithm
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_motion.h,v 1.1 2000/12/21 17:19:52 massiot Exp $
+ * $Id: vdec_motion.h,v 1.14 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
@@ -40,24 +40,3 @@ struct motion_arg_s;
 
 typedef void (*f_motion_t)( struct macroblock_s* );
 
-/*****************************************************************************
- * Prototypes
- *****************************************************************************/
-void vdec_MotionFieldField420( struct macroblock_s * p_mb );
-void vdec_MotionField16x8420( struct macroblock_s * p_mb );
-void vdec_MotionFieldDMV420( struct macroblock_s * p_mb );
-void vdec_MotionFrameFrame420( struct macroblock_s * p_mb );
-void vdec_MotionFrameField420( struct macroblock_s * p_mb );
-void vdec_MotionFrameDMV420( struct macroblock_s * p_mb );
-void vdec_MotionFieldField422( struct macroblock_s * p_mb );
-void vdec_MotionField16x8422( struct macroblock_s * p_mb );
-void vdec_MotionFieldDMV422( struct macroblock_s * p_mb );
-void vdec_MotionFrameFrame422( struct macroblock_s * p_mb );
-void vdec_MotionFrameField422( struct macroblock_s * p_mb );
-void vdec_MotionFrameDMV422( struct macroblock_s * p_mb );
-void vdec_MotionFieldField444( struct macroblock_s * p_mb );
-void vdec_MotionField16x8444( struct macroblock_s * p_mb );
-void vdec_MotionFieldDMV444( struct macroblock_s * p_mb );
-void vdec_MotionFrameFrame444( struct macroblock_s * p_mb );
-void vdec_MotionFrameField444( struct macroblock_s * p_mb );
-void vdec_MotionFrameDMV444( struct macroblock_s * p_mb );
similarity index 97%
rename from src/video_decoder/vpar_blocks.h
rename to include/vpar_blocks.h
index 907e8eb46ae5bf9d9232924c9bbd89525d416bce..a3efa11d898d359a7a64f0ef1f724f60188c3140 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_blocks.h : video parser blocks management
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_blocks.h,v 1.2 2001/01/17 18:17:30 massiot Exp $
+ * $Id: vpar_blocks.h,v 1.32 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
@@ -52,7 +52,8 @@ typedef struct macroblock_s
 
     /* IDCT information */
     dctelem_t               ppi_blocks[12][64];                    /* blocks */
-    f_idct_t                pf_idct[12];             /* sparse IDCT or not ? */
+    void ( * pf_idct[12] )  ( struct vdec_thread_s *,
+                              dctelem_t*, int );     /* sparse IDCT or not ? */
     int                     pi_sparse_pos[12];             /* position of the
                                                             * non-NULL coeff */
 
index 7b9738df4f6995cd8392762d2cfb5e39f3f17cf5..6cda95f83b3845ffbeaa5fb1b67e6bc9d86b155d 100644 (file)
@@ -2,7 +2,7 @@
  * idct.c : IDCT module
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: idct.c,v 1.5 2001/01/17 18:17:30 massiot Exp $
+ * $Id: idct.c,v 1.6 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
  *
@@ -73,7 +73,7 @@ MODULE_CONFIG_END
 int InitModule( module_t * p_module )
 {
     p_module->psz_name = MODULE_STRING;
-    p_module->psz_longname = "IDCT module";
+    p_module->psz_longname = "IDCT module";
     p_module->psz_version = VERSION;
 
     p_module->i_capabilities = MODULE_CAPABILITY_NULL
index d823d378299752e3014c8608e335984599ea588c..4d09620077f83e2f4f75f9af25f95444eb442355 100644 (file)
@@ -2,7 +2,7 @@
  * idctclassic.c : Classic IDCT module
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: idctclassic.c,v 1.5 2001/01/17 18:17:30 massiot Exp $
+ * $Id: idctclassic.c,v 1.6 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
  *
@@ -73,7 +73,7 @@ MODULE_CONFIG_END
 int InitModule( module_t * p_module )
 {
     p_module->psz_name = MODULE_STRING;
-    p_module->psz_longname = "classic IDCT module";
+    p_module->psz_longname = "classic IDCT module";
     p_module->psz_version = VERSION;
 
     p_module->i_capabilities = MODULE_CAPABILITY_NULL
index 39416be8bdb245257468034ef76858def7450d3d..5606819d89f8a2388a0e5b741d57d3fb5e6b474f 100644 (file)
@@ -2,7 +2,7 @@
  * idctmmx.c : MMX IDCT module
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: idctmmx.c,v 1.6 2001/01/17 18:17:30 massiot Exp $
+ * $Id: idctmmx.c,v 1.7 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
  *          Michel Lespinasse <walken@zoy.org>
@@ -153,7 +153,7 @@ static int idct_Probe( probedata_t *p_data )
         }
         else
         {
-            return( 100 );
+            return( 150 );
         }
     }
     else
diff --git a/plugins/motion/motion.c b/plugins/motion/motion.c
new file mode 100644 (file)
index 0000000..c922bb7
--- /dev/null
@@ -0,0 +1,126 @@
+/*****************************************************************************
+ * motion.c : C motion compensation module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME motion
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include "config.h"
+#include "common.h"                                     /* boolean_t, byte_t */
+#include "threads.h"
+#include "mtime.h"
+#include "tests.h"
+
+#include "video.h"
+
+#include "modules.h"
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Local and extern prototypes.
+ *****************************************************************************/
+extern void motion_getfunctions( function_list_t * p_function_list );
+
+/*****************************************************************************
+ * Build configuration tree.
+ *****************************************************************************/
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for motion compensation module" )
+    ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
+MODULE_CONFIG_END
+
+/*****************************************************************************
+ * InitModule: get the module structure and configuration.
+ *****************************************************************************
+ * We have to fill psz_name, psz_longname and psz_version. These variables
+ * will be strdup()ed later by the main application because the module can
+ * be unloaded later to save memory, and we want to be able to access this
+ * data even after the module has been unloaded.
+ *****************************************************************************/
+int InitModule( module_t * p_module )
+{
+    p_module->psz_name = MODULE_STRING;
+    p_module->psz_longname = "motion compensation module";
+    p_module->psz_version = VERSION;
+
+    p_module->i_capabilities = MODULE_CAPABILITY_NULL
+                                | MODULE_CAPABILITY_MOTION;
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * ActivateModule: set the module to an usable state.
+ *****************************************************************************
+ * This function fills the capability functions and the configuration
+ * structure. Once ActivateModule() has been called, the i_usage can
+ * be set to 0 and calls to NeedModule() be made to increment it. To unload
+ * the module, one has to wait until i_usage == 0 and call DeactivateModule().
+ *****************************************************************************/
+int ActivateModule( module_t * p_module )
+{
+    p_module->p_functions = malloc( sizeof( module_functions_t ) );
+    if( p_module->p_functions == NULL )
+    {
+        return( -1 );
+    }
+
+    motion_getfunctions( &p_module->p_functions->motion );
+
+    p_module->p_config = p_config;
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * DeactivateModule: make sure the module can be unloaded.
+ *****************************************************************************
+ * This function must only be called when i_usage == 0. If it successfully
+ * returns, i_usage can be set to -1 and the module unloaded. Be careful to
+ * lock usage_lock during the whole process.
+ *****************************************************************************/
+int DeactivateModule( module_t * p_module )
+{
+    free( p_module->p_functions );
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * motion_Probe: tests probe the CPU and return a score
+ *****************************************************************************/
+int motion_Probe( probedata_t *p_data )
+{
+    if( TestMethod( MOTION_METHOD_VAR, "motion" ) )
+    {
+        return( 999 );
+    }
+
+    /* This module always works */
+    return( 50 );
+}
+
diff --git a/plugins/motion/motionmmx.c b/plugins/motion/motionmmx.c
new file mode 100644 (file)
index 0000000..f50151f
--- /dev/null
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * motionmmx.c : MMX motion compensation module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME motionmmx
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include "config.h"
+#include "common.h"                                     /* boolean_t, byte_t */
+#include "threads.h"
+#include "mtime.h"
+#include "tests.h"
+
+#include "video.h"
+
+#include "modules.h"
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Local and extern prototypes.
+ *****************************************************************************/
+extern void motion_getfunctions( function_list_t * p_function_list );
+
+/*****************************************************************************
+ * Build configuration tree.
+ *****************************************************************************/
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for MMX motion compensation module" )
+    ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
+MODULE_CONFIG_END
+
+/*****************************************************************************
+ * InitModule: get the module structure and configuration.
+ *****************************************************************************
+ * We have to fill psz_name, psz_longname and psz_version. These variables
+ * will be strdup()ed later by the main application because the module can
+ * be unloaded later to save memory, and we want to be able to access this
+ * data even after the module has been unloaded.
+ *****************************************************************************/
+int InitModule( module_t * p_module )
+{
+    p_module->psz_name = MODULE_STRING;
+    p_module->psz_longname = "MMX motion compensation module";
+    p_module->psz_version = VERSION;
+
+    p_module->i_capabilities = MODULE_CAPABILITY_NULL
+                                | MODULE_CAPABILITY_MOTION;
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * ActivateModule: set the module to an usable state.
+ *****************************************************************************
+ * This function fills the capability functions and the configuration
+ * structure. Once ActivateModule() has been called, the i_usage can
+ * be set to 0 and calls to NeedModule() be made to increment it. To unload
+ * the module, one has to wait until i_usage == 0 and call DeactivateModule().
+ *****************************************************************************/
+int ActivateModule( module_t * p_module )
+{
+    p_module->p_functions = malloc( sizeof( module_functions_t ) );
+    if( p_module->p_functions == NULL )
+    {
+        return( -1 );
+    }
+
+    motion_getfunctions( &p_module->p_functions->motion );
+
+    p_module->p_config = p_config;
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * DeactivateModule: make sure the module can be unloaded.
+ *****************************************************************************
+ * This function must only be called when i_usage == 0. If it successfully
+ * returns, i_usage can be set to -1 and the module unloaded. Be careful to
+ * lock usage_lock during the whole process.
+ *****************************************************************************/
+int DeactivateModule( module_t * p_module )
+{
+    free( p_module->p_functions );
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * motion_Probe: tests probe the CPU and return a score
+ *****************************************************************************/
+int motion_Probe( probedata_t *p_data )
+{
+    if( TestCPU( CPU_CAPABILITY_MMX ) )
+    {
+        if( TestMethod( MOTION_METHOD_VAR, "motionmmx" ) )
+        {
+            return( 999 );
+        }
+        else
+        {
+            return( 150 );
+        }
+    }
+    else
+    {
+        return( 0 );
+    }
+}
+
diff --git a/plugins/motion/motionmmxext.c b/plugins/motion/motionmmxext.c
new file mode 100644 (file)
index 0000000..583b7aa
--- /dev/null
@@ -0,0 +1,134 @@
+/*****************************************************************************
+ * motionmmxext.c : MMX EXT motion compensation module for vlc
+ *****************************************************************************
+ * Copyright (C) 2000 VideoLAN
+ *
+ * Authors:
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ * 
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
+ *****************************************************************************/
+
+#define MODULE_NAME motionmmxext
+
+/*****************************************************************************
+ * Preamble
+ *****************************************************************************/
+#include "defs.h"
+
+#include <stdlib.h>                                      /* malloc(), free() */
+
+#include "config.h"
+#include "common.h"                                     /* boolean_t, byte_t */
+#include "threads.h"
+#include "mtime.h"
+#include "tests.h"
+
+#include "video.h"
+
+#include "modules.h"
+#include "modules_inner.h"
+
+/*****************************************************************************
+ * Local and extern prototypes.
+ *****************************************************************************/
+extern void motion_getfunctions( function_list_t * p_function_list );
+
+/*****************************************************************************
+ * Build configuration tree.
+ *****************************************************************************/
+MODULE_CONFIG_START
+ADD_WINDOW( "Configuration for motion compensation module" )
+    ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
+MODULE_CONFIG_END
+
+/*****************************************************************************
+ * InitModule: get the module structure and configuration.
+ *****************************************************************************
+ * We have to fill psz_name, psz_longname and psz_version. These variables
+ * will be strdup()ed later by the main application because the module can
+ * be unloaded later to save memory, and we want to be able to access this
+ * data even after the module has been unloaded.
+ *****************************************************************************/
+int InitModule( module_t * p_module )
+{
+    p_module->psz_name = MODULE_STRING;
+    p_module->psz_longname = "MMX EXT motion compensation module";
+    p_module->psz_version = VERSION;
+
+    p_module->i_capabilities = MODULE_CAPABILITY_NULL
+                                | MODULE_CAPABILITY_MOTION;
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * ActivateModule: set the module to an usable state.
+ *****************************************************************************
+ * This function fills the capability functions and the configuration
+ * structure. Once ActivateModule() has been called, the i_usage can
+ * be set to 0 and calls to NeedModule() be made to increment it. To unload
+ * the module, one has to wait until i_usage == 0 and call DeactivateModule().
+ *****************************************************************************/
+int ActivateModule( module_t * p_module )
+{
+    p_module->p_functions = malloc( sizeof( module_functions_t ) );
+    if( p_module->p_functions == NULL )
+    {
+        return( -1 );
+    }
+
+    motion_getfunctions( &p_module->p_functions->motion );
+
+    p_module->p_config = p_config;
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * DeactivateModule: make sure the module can be unloaded.
+ *****************************************************************************
+ * This function must only be called when i_usage == 0. If it successfully
+ * returns, i_usage can be set to -1 and the module unloaded. Be careful to
+ * lock usage_lock during the whole process.
+ *****************************************************************************/
+int DeactivateModule( module_t * p_module )
+{
+    free( p_module->p_functions );
+
+    return( 0 );
+}
+
+/*****************************************************************************
+ * motion_Probe: tests probe the CPU and return a score
+ *****************************************************************************/
+int motion_Probe( probedata_t *p_data )
+{
+    if( TestCPU( CPU_CAPABILITY_MMXEXT ) )
+    {
+        if( TestMethod( MOTION_METHOD_VAR, "motionmmxext" ) )
+        {
+            return( 999 );
+        }
+        else
+        {
+            return( 200 );
+        }
+    }
+    else
+    {
+        return( 0 );
+    }
+}
+
similarity index 90%
rename from src/video_decoder/vdec_motion.c
rename to plugins/motion/vdec_motion_common.c
index 686381d2a5414f6fd83101000d1c1231245f8937..c622eaca8cddf7ac0629efdfa4519b403b135341 100644 (file)
@@ -1,8 +1,8 @@
 /*****************************************************************************
- * vdec_motion.c : motion compensation routines
+ * vdec_motion_common.c : common motion compensation routines common
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_motion.c,v 1.35 2001/01/05 18:46:44 massiot Exp $
+ * $Id: vdec_motion_common.c,v 1.1 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
-#include "plugins.h"
+#include "modules.h"
 
 #include "intf_msg.h"
 
-#include "stream_control.h"
-#include "input_ext-dec.h"
-
 #include "video.h"
-#include "video_output.h"
 
-#include "vdec_idct.h"
-#include "video_decoder.h"
 #include "vdec_motion.h"
-
 #include "vpar_blocks.h"
-#include "vpar_headers.h"
-#include "vpar_synchro.h"
-#include "video_parser.h"
-#include "video_fifo.h"
+
+extern int motion_Probe( probedata_t *p_data );
+
+static void vdec_MotionFieldField420  ( macroblock_t * p_mb );
+static void vdec_MotionFieldField422  ( macroblock_t * p_mb );
+static void vdec_MotionFieldField444  ( macroblock_t * p_mb );
+static void vdec_MotionField16x8420   ( macroblock_t * p_mb );
+static void vdec_MotionField16x8422   ( macroblock_t * p_mb );
+static void vdec_MotionField16x8444   ( macroblock_t * p_mb );
+static void vdec_MotionFieldDMV420    ( macroblock_t * p_mb );
+static void vdec_MotionFieldDMV422    ( macroblock_t * p_mb );
+static void vdec_MotionFieldDMV444    ( macroblock_t * p_mb );
+static void vdec_MotionFrameFrame420  ( macroblock_t * p_mb );
+static void vdec_MotionFrameFrame422  ( macroblock_t * p_mb );
+static void vdec_MotionFrameFrame444  ( macroblock_t * p_mb );
+static void vdec_MotionFrameField420  ( macroblock_t * p_mb );
+static void vdec_MotionFrameField422  ( macroblock_t * p_mb );
+static void vdec_MotionFrameField444  ( macroblock_t * p_mb );
+static void vdec_MotionFrameDMV420    ( macroblock_t * p_mb );
+static void vdec_MotionFrameDMV422    ( macroblock_t * p_mb );
+static void vdec_MotionFrameDMV444    ( macroblock_t * p_mb );
+
+/*****************************************************************************
+ * Functions exported as capabilities. They are declared as static so that
+ * we don't pollute the namespace too much.
+ *****************************************************************************/
+void motion_getfunctions( function_list_t * p_function_list )
+{
+    p_function_list->pf_probe = motion_Probe;
+
+#define list p_function_list->functions.motion
+#define motion_functions( yuv ) \
+    list.pf_field_field_##yuv = vdec_MotionFieldField##yuv; \
+    list.pf_field_16x8_##yuv  = vdec_MotionField16x8##yuv;  \
+    list.pf_field_dmv_##yuv   = vdec_MotionFieldDMV##yuv;   \
+    list.pf_frame_field_##yuv = vdec_MotionFrameField##yuv; \
+    list.pf_frame_frame_##yuv = vdec_MotionFrameFrame##yuv; \
+    list.pf_frame_dmv_##yuv   = vdec_MotionFrameDMV##yuv;
+    motion_functions( 420 )
+    motion_functions( 422 )
+    motion_functions( 444 )
+#undef motion_functions
+#undef list
+
+    return;
+}
 
 #define __MotionComponents(width,height)                \
 void MotionComponent_x_y_copy_##width##_##height ();    \
@@ -62,10 +97,10 @@ void MotionComponent_X_y_avg_##width##_##height ();     \
 void MotionComponent_x_Y_avg_##width##_##height ();     \
 void MotionComponent_X_Y_avg_##width##_##height ();
 
-__MotionComponents (16,16)        /* 444, 422, 420 */
+__MotionComponents (16,16)       /* 444, 422, 420 */
 __MotionComponents (16,8)        /* 444, 422, 420 */
-__MotionComponents (8,8)        /* 422, 420 */
-__MotionComponents (8,4)        /* 420 */
+__MotionComponents (8,8)         /* 422, 420 */
+__MotionComponents (8,4)         /* 420 */
 #if 0
 __MotionComponents (8,16)        /* 422 */
 #endif
@@ -407,17 +442,17 @@ static __inline__ void Motion444(
     }                                                                   \
 }
 
-void vdec_MotionFieldField420( macroblock_t * p_mb )
+static void vdec_MotionFieldField420( macroblock_t * p_mb )
 {
     FIELDFIELD( Motion420 )
 }
 
-void vdec_MotionFieldField422( macroblock_t * p_mb )
+static void vdec_MotionFieldField422( macroblock_t * p_mb )
 {
     //FIELDFIELD( Motion422 )
 }
 
-void vdec_MotionFieldField444( macroblock_t * p_mb )
+static void vdec_MotionFieldField444( macroblock_t * p_mb )
 {
     //FIELDFIELD( Motion444 )
 }
@@ -489,17 +524,17 @@ void vdec_MotionFieldField444( macroblock_t * p_mb )
     }                                                                   \
 }
 
-void vdec_MotionField16x8420( macroblock_t * p_mb )
+static void vdec_MotionField16x8420( macroblock_t * p_mb )
 {
     FIELD16X8( Motion420 )
 }
 
-void vdec_MotionField16x8422( macroblock_t * p_mb )
+static void vdec_MotionField16x8422( macroblock_t * p_mb )
 {
     //FIELD16X8( Motion422 )
 }
 
-void vdec_MotionField16x8444( macroblock_t * p_mb )
+static void vdec_MotionField16x8444( macroblock_t * p_mb )
 {
     //FIELD16X8( Motion444 )
 }
@@ -531,17 +566,17 @@ void vdec_MotionField16x8444( macroblock_t * p_mb )
             p_mb->i_l_stride, p_mb->i_c_stride, 16, 0, 1 );             \
 } /* FIELDDMV */
 
-void vdec_MotionFieldDMV420( macroblock_t * p_mb )
+static void vdec_MotionFieldDMV420( macroblock_t * p_mb )
 {
     FIELDDMV( Motion420 )
 }
 
-void vdec_MotionFieldDMV422( macroblock_t * p_mb )
+static void vdec_MotionFieldDMV422( macroblock_t * p_mb )
 {
     //FIELDDMV( Motion422 )
 }
 
-void vdec_MotionFieldDMV444( macroblock_t * p_mb )
+static void vdec_MotionFieldDMV444( macroblock_t * p_mb )
 {
     //FIELDDMV( Motion444 )
 }
@@ -576,17 +611,17 @@ void vdec_MotionFieldDMV444( macroblock_t * p_mb )
     }                                                                   \
 } /* FRAMEFRAME */
 
-void vdec_MotionFrameFrame420( macroblock_t * p_mb )
+static void vdec_MotionFrameFrame420( macroblock_t * p_mb )
 {
     FRAMEFRAME( Motion420 )
 }
 
-void vdec_MotionFrameFrame422( macroblock_t * p_mb )
+static void vdec_MotionFrameFrame422( macroblock_t * p_mb )
 {
     //FRAMEFRAME( Motion422 )
 }
 
-void vdec_MotionFrameFrame444( macroblock_t * p_mb )
+static void vdec_MotionFrameFrame444( macroblock_t * p_mb )
 {
     //FRAMEFRAME( Motion444 )
 }
@@ -641,17 +676,17 @@ void vdec_MotionFrameFrame444( macroblock_t * p_mb )
     }                                                                   \
 } /* FRAMEFIELD */
 
-void vdec_MotionFrameField420( macroblock_t * p_mb )
+static void vdec_MotionFrameField420( macroblock_t * p_mb )
 {
     FRAMEFIELD( Motion420 )
 }
 
-void vdec_MotionFrameField422( macroblock_t * p_mb )
+static void vdec_MotionFrameField422( macroblock_t * p_mb )
 {
     //FRAMEFIELD( Motion422 )
 }
 
-void vdec_MotionFrameField444( macroblock_t * p_mb )
+static void vdec_MotionFrameField444( macroblock_t * p_mb )
 {
     //FRAMEFIELD( Motion444 )
 }
@@ -689,17 +724,18 @@ void vdec_MotionFrameField444( macroblock_t * p_mb )
             p_mb->i_l_stride << 1, p_mb->i_c_stride << 1, 8, 0, 1 );    \
 } /* FRAMEDMV */
 
-void vdec_MotionFrameDMV420( macroblock_t * p_mb )
+static void vdec_MotionFrameDMV420( macroblock_t * p_mb )
 {
     FRAMEDMV( Motion420 )
 }
 
-void vdec_MotionFrameDMV422( macroblock_t * p_mb )
+static void vdec_MotionFrameDMV422( macroblock_t * p_mb )
 {
     //FRAMEDMV( Motion422 )
 }
 
-void vdec_MotionFrameDMV444( macroblock_t * p_mb )
+static void vdec_MotionFrameDMV444( macroblock_t * p_mb )
 {
     //FRAMEDMV( Motion444 )
 }
+
similarity index 97%
rename from src/video_decoder/vdec_motion_inner.c
rename to plugins/motion/vdec_motion_inner.c
index 34105c7ce01e98681b4106d3872fc6c1360455ed..33021eb0a7be183dd72f8825d6100bbf7cc43167 100644 (file)
@@ -2,7 +2,7 @@
  * vdec_motion_inner.c : motion compensation inner routines
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_motion_inner.c,v 1.12 2001/01/05 18:46:44 massiot Exp $
+ * $Id: vdec_motion_inner.c,v 1.1 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
-#include "plugins.h"
-
-#include "intf_msg.h"
-
-#include "stream_control.h"
-#include "input_ext-dec.h"
 
 #include "video.h"
-#include "video_output.h"
-
-#include "vdec_idct.h"
-#include "video_decoder.h"
-#include "vdec_motion.h"
-
-#include "vpar_blocks.h"
-#include "vpar_headers.h"
-#include "vpar_synchro.h"
-#include "video_parser.h"
-#include "video_fifo.h"
 
 #define __MotionComponent_x_y_copy(width,height)                        \
 void MotionComponent_x_y_copy_##width##_##height(yuv_data_t * p_src,    \
similarity index 98%
rename from src/video_decoder/vdec_motion_inner_mmx.c
rename to plugins/motion/vdec_motion_inner_mmx.c
index 4d2f735ed5cfdea20e6c0305203f4f59cb54b016..a6bb13b9ecde30e8988f2b482e62850dfc3e6665 100644 (file)
@@ -3,7 +3,7 @@
  *                           MMX
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_motion_inner_mmx.c,v 1.8 2001/01/16 17:59:23 massiot Exp $
+ * $Id: vdec_motion_inner_mmx.c,v 1.1 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>, largerly inspired by the
  *          work done by the livid project <http://www.linuxvideo.org/>
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
-#include "plugins.h"
-
-#include "intf_msg.h"
-
-#include "stream_control.h"
-#include "input_ext-dec.h"
 
 #include "video.h"
-#include "video_output.h"
-
-#include "vdec_idct.h"
-#include "video_decoder.h"
-#include "vdec_motion.h"
-
-#include "vpar_blocks.h"
-#include "vpar_headers.h"
-#include "vpar_synchro.h"
-#include "video_parser.h"
-#include "video_fifo.h"
 
 #include "attributes.h"
 #include "mmx.h"
similarity index 98%
rename from src/video_decoder/vdec_motion_inner_mmxext.c
rename to plugins/motion/vdec_motion_inner_mmxext.c
index d54e39e9cc8c443db25316c926555d4ae2e5dd7b..6165f3f469fcbe23f5b6214bb44f239d7432dbef 100644 (file)
@@ -1,9 +1,9 @@
 /*****************************************************************************
- * vdec_motion_inner_mmx.c : motion compensation inner routines optimized in
- *                           MMX
+ * vdec_motion_inner_mmxext.c : motion compensation inner routines optimized
+ *                              in MMX EXT
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vdec_motion_inner_mmxext.c,v 1.1 2001/01/16 17:59:23 massiot Exp $
+ * $Id: vdec_motion_inner_mmxext.c,v 1.1 2001/01/18 05:13:22 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>, largerly inspired by the
  *          work done by the livid project <http://www.linuxvideo.org/>
 #include "common.h"
 #include "threads.h"
 #include "mtime.h"
-#include "plugins.h"
-
-#include "intf_msg.h"
-
-#include "stream_control.h"
-#include "input_ext-dec.h"
 
 #include "video.h"
-#include "video_output.h"
-
-#include "vdec_idct.h"
-#include "video_decoder.h"
-#include "vdec_motion.h"
-
-#include "vpar_blocks.h"
-#include "vpar_headers.h"
-#include "vpar_synchro.h"
-#include "video_parser.h"
-#include "video_fifo.h"
 
 #include "attributes.h"
 #include "mmx.h"
index 64e2f3718ee94a46ef6d5132f6a3887bff2537c1..37e7d12072f0b30b5d96075da675ccb0a738c118 100644 (file)
@@ -82,7 +82,7 @@ static int yuv_Probe( probedata_t *p_data )
     }
 
     /* This module always works */
-    return( 100 );
+    return( 50 );
 }
 
 /*****************************************************************************
index a90d23e70f81c1f073caf0a3b54b81d146de9de3..772665ea44cc2bd779844d1e0db9ba9020d22ab6 100644 (file)
@@ -64,7 +64,7 @@ MODULE_CONFIG_END
 int InitModule( module_t * p_module )
 {
     p_module->psz_name = MODULE_STRING;
-    p_module->psz_longname = "C YUV module";
+    p_module->psz_longname = "YUV transformations module";
     p_module->psz_version = VERSION;
 
     p_module->i_capabilities = MODULE_CAPABILITY_NULL
index 6a8bc3daa37242115d5d366139292f3255b668ab..b042e1987ff0c9ee004df533f36b849def2b5d55 100644 (file)
@@ -64,7 +64,7 @@ MODULE_CONFIG_END
 int InitModule( module_t * p_module )
 {
     p_module->psz_name = MODULE_STRING;
-    p_module->psz_longname = "MMX YUV module";
+    p_module->psz_longname = "MMX YUV transformations module";
     p_module->psz_version = VERSION;
 
     p_module->i_capabilities = MODULE_CAPABILITY_NULL
index 50f8c6bbf88c1cbf9e765ce3a25a873a06115ab3..ddff45529212f1da49f3388715d566a54c82c4db 100644 (file)
@@ -2,7 +2,7 @@
  * input_programs.c: es_descriptor_t, pgrm_descriptor_t management
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: input_programs.c,v 1.25 2001/01/12 17:33:18 massiot Exp $
+ * $Id: input_programs.c,v 1.26 2001/01/18 05:13:22 sam Exp $
  *
  * Authors:
  *
@@ -579,6 +579,11 @@ int input_SelectES( input_thread_t * p_input, es_descriptor_t * p_es )
         break;
     }
 
+    if( p_es->thread_id == 0 )
+    {
+        return( -1 );
+    }
+
     if( p_es->p_decoder_fifo != NULL )
     {
         p_input->stream.i_selected_es_number++;
index 1e4df4711d6363e3c68f36eef7c6f20fcb98bedd..7449f1561dbdbdbcc6542a5cdaf0b68d2dc4b7e1 100644 (file)
@@ -79,8 +79,9 @@
 #define OPT_WIDTH               163
 #define OPT_HEIGHT              164
 #define OPT_COLOR               165
-#define OPT_IDCT                166
-#define OPT_YUV                 167
+#define OPT_MOTION              167
+#define OPT_IDCT                168
+#define OPT_YUV                 169
 
 #define OPT_VLANS               170
 #define OPT_SERVER              171
@@ -122,6 +123,7 @@ static const struct option longopts[] =
     {   "height",           1,          0,      OPT_HEIGHT },
     {   "grayscale",        0,          0,      'g' },
     {   "color",            0,          0,      OPT_COLOR },
+    {   "motion",           1,          0,      OPT_MOTION },
     {   "idct",             1,          0,      OPT_IDCT },
     {   "yuv",              1,          0,      OPT_YUV },
 
@@ -569,6 +571,9 @@ static int GetConfiguration( int i_argc, char *ppsz_argv[], char *ppsz_env[] )
         case OPT_COLOR:                                           /* --color */
             main_PutIntVariable( VOUT_GRAYSCALE_VAR, 0 );
             break;
+       case OPT_MOTION:                                         /* --motion */
+            main_PutPszVariable( MOTION_METHOD_VAR, optarg );
+            break;
        case OPT_IDCT:                                             /* --idct */
             main_PutPszVariable( IDCT_METHOD_VAR, optarg );
             break;
@@ -670,6 +675,7 @@ static void Usage( int i_fashion )
               "\n      --width <w>, --height <h>  \tdisplay dimensions"
               "\n  -g, --grayscale                \tgrayscale output"
               "\n      --color                    \tcolor output"
+              "\n      --motion <module>          \tmotion compensation method"
               "\n      --idct <module>            \tIDCT method"
               "\n      --yuv <module>             \tYUV method"
               "\n      --synchro <type>           \tforce synchro algorithm"
@@ -714,6 +720,7 @@ static void Usage( int i_fashion )
               "\n  " VOUT_HEIGHT_VAR "=<height>             \tdislay height"
               "\n  " VOUT_FB_DEV_VAR "=<filename>           \tframebuffer device path"
               "\n  " VOUT_GRAYSCALE_VAR "={1|0}             \tgrayscale or color output"
+              "\n  " MOTION_METHOD_VAR "=<method name>      \tmotion compensation method"
               "\n  " IDCT_METHOD_VAR "=<method name>        \tIDCT method"
               "\n  " YUV_METHOD_VAR "=<method name>         \tYUV method"
               "\n  " VPAR_SYNCHRO_VAR "={I|I+|IP|IP+|IPB}   \tsynchro algorithm" );
index 2bf9b94fcfb3636b30d0f24fb82d7c289d7de9f1..0b15ff8414d95431c2d0682f3c164bc55a1a4530 100644 (file)
@@ -451,8 +451,9 @@ static int AllocateDynModule( module_bank_t * p_bank, char * psz_filename )
     p_module->prev = NULL;
     p_bank->first = p_module;
 
-    intf_Msg( "module: dynamic module `%s', %s",
-              p_module->psz_name, p_module->psz_longname );
+    /* Immediate message so that a slow module doesn't make the user wait */
+    intf_MsgImm( "module: dynamic module `%s', %s",
+                 p_module->psz_name, p_module->psz_longname );
 
     return( 0 );
 }
index 2813d2aaeb8689f61a81adde48bcb07dc1c83bb3..e14c23f2c685dc33ef5b9ac14e7f73ce59ce1860 100644 (file)
@@ -2,7 +2,7 @@
  * video_decoder.c : video decoder thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_decoder.c,v 1.44 2001/01/05 18:46:44 massiot Exp $
+ * $Id: video_decoder.c,v 1.45 2001/01/18 05:13:23 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Gaël Hendryckx <jimmy@via.ecp.fr>
@@ -45,9 +45,9 @@
 #include "video.h"
 #include "video_output.h"
 
+#include "vdec_motion.h"
 #include "vdec_idct.h"
 #include "video_decoder.h"
-#include "vdec_motion.h"
 
 #include "vpar_blocks.h"
 #include "vpar_headers.h"
index 4dd14b261eff095fb8b45c02cdbb9c7087be7990..5650f644293c22bcc00e2d72f1a116951996d41a 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.h : video parser thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.h,v 1.5 2001/01/17 18:17:30 massiot Exp $
+ * $Id: video_parser.h,v 1.6 2001/01/18 05:13:23 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
@@ -133,8 +133,13 @@ typedef struct vpar_thread_s
     u8                      pi_default_intra_quant[64];
     u8                      pi_default_nonintra_quant[64];
 
+    /* Motion compensation plugin used and shortcuts */
+    struct module_s *       p_motion_module;
+    void ( * pppf_motion[4][2][4] )     ( struct macroblock_s * );
+    void ( * ppf_motion_skipped[4][4] ) ( struct macroblock_s * );
+
     /* IDCT plugin used and shortcuts to access its capabilities */
-    struct module_s *       p_module;
+    struct module_s *       p_idct_module;
     idct_init_t             pf_init;
     f_idct_t                pf_sparse_idct;
     f_idct_t                pf_idct;
index 0b5fc72a0b38ee995032b7efd1ac1fecb53916eb..c42aa1647b0ce9fa947aaded43768efa328393f0 100644 (file)
@@ -2,7 +2,7 @@
  * video_fifo.c : video FIFO management
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_fifo.c,v 1.27 2001/01/13 12:57:21 sam Exp $
+ * $Id: video_fifo.c,v 1.28 2001/01/18 05:13:23 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *
 #include "video_output.h"
 
 #include "video_decoder.h"
+#include "vdec_motion.h"
 #include "../video_decoder/vdec_idct.h"
-#include "../video_decoder/vdec_motion.h"
 
-#include "../video_decoder/vpar_blocks.h"
+#include "vpar_blocks.h"
 #include "../video_decoder/vpar_headers.h"
 #include "../video_decoder/vpar_synchro.h"
 #include "../video_decoder/video_parser.h"
index 7add0ba9fa9b6a2ff69339ed7fbe2b0234314489..ccc0c28685a3e759409e44d1f7d5433fac99c795 100644 (file)
@@ -2,7 +2,7 @@
  * video_parser.c : video parser thread
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: video_parser.c,v 1.68 2001/01/17 18:17:31 massiot Exp $
+ * $Id: video_parser.c,v 1.69 2001/01/18 05:13:23 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
 #include "video_output.h"
 
 #include "video_decoder.h"
-#include "../video_decoder/vdec_motion.h"
+#include "vdec_motion.h"
 #include "../video_decoder/vdec_idct.h"
 
-#include "../video_decoder/vpar_blocks.h"
+#include "vpar_blocks.h"
 #include "../video_decoder/vpar_headers.h"
 #include "../video_decoder/vpar_synchro.h"
 #include "../video_decoder/video_parser.h"
@@ -101,30 +101,100 @@ vlc_thread_t vpar_CreateThread( vdec_config_t * p_config )
 
     p_vpar->p_vout = p_config->p_vout;
 
-    /* Choose the best IDCT module */
-    p_vpar->p_module = module_Need( p_main->p_module_bank,
-                                    MODULE_CAPABILITY_IDCT, NULL );
+    /*
+     * Choose the best motion compensation module
+     */
+    p_vpar->p_motion_module = module_Need( p_main->p_module_bank,
+                                           MODULE_CAPABILITY_MOTION, NULL );
+
+    if( p_vpar->p_motion_module == NULL )
+    {
+        intf_ErrMsg( "vpar error: no suitable motion compensation module" );
+        free( p_vpar );
+        return( 0 );
+    }
 
-    if( p_vpar->p_module == NULL )
+#define m ( p_vpar->pppf_motion )
+#define s ( p_vpar->ppf_motion_skipped )
+#define f ( p_vpar->p_motion_module->p_functions->motion.functions.motion )
+    m[0][0][0] = m[0][0][1] = m[0][0][2] = m[0][0][3] = NULL;
+    m[0][1][0] = m[0][1][1] = m[0][1][2] = m[0][1][3] = NULL;
+    m[1][0][0] = NULL;
+    m[1][1][0] = NULL;
+    m[2][0][0] = NULL;
+    m[2][1][0] = NULL;
+    m[3][0][0] = NULL;
+    m[3][1][0] = NULL;
+
+    m[1][0][1] = f.pf_field_field_420;
+    m[1][1][1] = f.pf_frame_field_420;
+    m[2][0][1] = f.pf_field_field_422;
+    m[2][1][1] = f.pf_frame_field_422;
+    m[3][0][1] = f.pf_field_field_444;
+    m[3][1][1] = f.pf_frame_field_444;
+
+    m[1][0][2] = f.pf_field_16x8_420;
+    m[1][1][2] = f.pf_frame_frame_420;
+    m[2][0][2] = f.pf_field_16x8_422;
+    m[2][1][2] = f.pf_frame_frame_422;
+    m[3][0][2] = f.pf_field_16x8_444;
+    m[3][1][2] = f.pf_frame_frame_444;
+
+    m[1][0][3] = f.pf_field_dmv_420;
+    m[1][1][3] = f.pf_frame_dmv_420;
+    m[2][0][3] = f.pf_field_dmv_422;
+    m[2][1][3] = f.pf_frame_dmv_422;
+    m[3][0][3] = f.pf_field_dmv_444;
+    m[3][1][3] = f.pf_frame_dmv_444;
+
+    s[0][0] = s[0][1] = s[0][2] = s[0][3] = NULL;
+    s[1][0] = NULL;
+    s[2][0] = NULL;
+    s[3][0] = NULL;
+
+    s[1][1] = f.pf_field_field_420;
+    s[2][1] = f.pf_field_field_422;
+    s[3][1] = f.pf_field_field_444;
+
+    s[1][2] = f.pf_field_field_420;
+    s[2][2] = f.pf_field_field_422;
+    s[3][2] = f.pf_field_field_444;
+
+    s[1][3] = f.pf_frame_frame_420;
+    s[2][3] = f.pf_frame_frame_422;
+    s[3][3] = f.pf_frame_frame_444;
+#undef f
+#undef s
+#undef m
+
+     /*
+      * Choose the best IDCT module
+      */
+    p_vpar->p_idct_module = module_Need( p_main->p_module_bank,
+                                         MODULE_CAPABILITY_IDCT, NULL );
+
+    if( p_vpar->p_idct_module == NULL )
     {
         intf_ErrMsg( "vpar error: no suitable IDCT module" );
+        module_Unneed( p_main->p_module_bank, p_vpar->p_motion_module );
         free( p_vpar );
         return( 0 );
     }
 
-#define idct_functions p_vpar->p_module->p_functions->idct.functions.idct
-    p_vpar->pf_init         = idct_functions.pf_init;
-    p_vpar->pf_sparse_idct  = idct_functions.pf_sparse_idct;
-    p_vpar->pf_idct         = idct_functions.pf_idct;
-    p_vpar->pf_norm_scan    = idct_functions.pf_norm_scan;
-#undef idct_functions
+#define f p_vpar->p_idct_module->p_functions->idct.functions.idct
+    p_vpar->pf_init         = f.pf_init;
+    p_vpar->pf_sparse_idct  = f.pf_sparse_idct;
+    p_vpar->pf_idct         = f.pf_idct;
+    p_vpar->pf_norm_scan    = f.pf_norm_scan;
+#undef f
 
     /* Spawn the video parser thread */
     if ( vlc_thread_create( &p_vpar->thread_id, "video parser",
                             (vlc_thread_func_t)RunThread, (void *)p_vpar ) )
     {
         intf_ErrMsg("vpar error: can't spawn video parser thread");
-        module_Unneed( p_main->p_module_bank, p_vpar->p_module );
+        module_Unneed( p_main->p_module_bank, p_vpar->p_idct_module );
+        module_Unneed( p_main->p_module_bank, p_vpar->p_motion_module );
         free( p_vpar );
         return( 0 );
     }
@@ -434,7 +504,8 @@ static void EndThread( vpar_thread_t *p_vpar )
     
     vlc_mutex_destroy( &(p_vpar->synchro.fifo_lock) );
     
-    module_Unneed( p_main->p_module_bank, p_vpar->p_module );
+    module_Unneed( p_main->p_module_bank, p_vpar->p_idct_module );
+    module_Unneed( p_main->p_module_bank, p_vpar->p_motion_module );
 
     free( p_vpar );
 
index 132f9a500744096a0fc9771cf9d5df587fd7c9e0..12d0bbf9565ef3710d2748563f56bdaf80dfcce3 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_blocks.c : blocks parsing
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_blocks.c,v 1.71 2001/01/17 18:17:31 massiot Exp $
+ * $Id: vpar_blocks.c,v 1.72 2001/01/18 05:13:23 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Jean-Marc Dressler <polux@via.ecp.fr>
 #include "video_output.h"
 
 #include "video_decoder.h"
+#include "vdec_motion.h"
 #include "../video_decoder/vdec_idct.h"
-#include "../video_decoder/vdec_motion.h"
 
-#include "../video_decoder/vpar_blocks.h"
+#include "vpar_blocks.h"
 #include "../video_decoder/vpar_headers.h"
 #include "../video_decoder/vpar_synchro.h"
 #include "../video_decoder/video_parser.h"
@@ -1585,17 +1585,6 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
 {
     macroblock_t *  p_mb;
 
-    static f_motion_t   pf_motion_skipped[4][4] =
-    {
-        {NULL, NULL, NULL, NULL},
-        {NULL, vdec_MotionFieldField420, vdec_MotionFieldField420,
-            vdec_MotionFrameFrame420},
-        {NULL, vdec_MotionFieldField422, vdec_MotionFieldField422,
-            vdec_MotionFrameFrame422},
-        {NULL, vdec_MotionFieldField444, vdec_MotionFieldField444,
-            vdec_MotionFrameFrame444},
-    };
-
     if( i_coding_type == I_CODING_TYPE )
     {
         intf_DbgMsg("vpar error: skipped macroblock in I-picture");
@@ -1616,8 +1605,8 @@ static __inline__ void SkippedMacroblock( vpar_thread_t * p_vpar, int i_mb,
                     i_structure, b_second_field );
 
     /* Motion type is picture structure. */
-    p_mb->pf_motion = pf_motion_skipped[i_chroma_format]
-                                       [i_structure];
+    p_mb->pf_motion = p_vpar->ppf_motion_skipped[i_chroma_format]
+                                                [i_structure];
     p_mb->i_coded_block_pattern = 0;
 
     /* Motion direction and motion vectors depend on the coding type. */
@@ -1820,27 +1809,6 @@ static __inline__ void ParseMacroblock(
                            boolean_t b_second_field )     /* second field of a
                                                            * field picture   */
 {
-    static f_motion_t   pppf_motion[4][2][4] =
-      {
-        { {NULL, NULL, NULL, NULL},
-          {NULL, NULL, NULL, NULL}
-        },
-        { {NULL, vdec_MotionFieldField420, vdec_MotionField16x8420,
-            vdec_MotionFieldDMV420},
-          {NULL, vdec_MotionFrameField420, vdec_MotionFrameFrame420,
-            vdec_MotionFrameDMV420}
-        },
-        { {NULL, vdec_MotionFieldField422, vdec_MotionField16x8422,
-            vdec_MotionFieldDMV422},
-          {NULL, vdec_MotionFrameField422, vdec_MotionFrameFrame422,
-            vdec_MotionFrameDMV422}
-        },
-        { {NULL, vdec_MotionFieldField444, vdec_MotionField16x8444,
-            vdec_MotionFieldDMV444},
-          {NULL, vdec_MotionFrameField444, vdec_MotionFrameFrame444,
-            vdec_MotionFrameDMV444}
-        }
-      };
     static int      pi_x[12] = {0,8,0,8,0,0,0,0,8,8,8,8};
     static int      pi_y[2][12] = { {0,0,8,8,0,0,8,8,0,0,8,8},
                                     {0,0,1,1,0,0,1,1,0,0,1,1} };
@@ -1943,9 +1911,9 @@ static __inline__ void ParseMacroblock(
             = 1 << (7 + p_vpar->picture.i_intra_dc_precision);
 
         /* Motion function pointer. */
-        p_mb->pf_motion = pppf_motion[i_chroma_format]
-                                     [i_structure == FRAME_STRUCTURE]
-                                     [p_vpar->mb.i_motion_type];
+        p_mb->pf_motion = p_vpar->pppf_motion[i_chroma_format]
+                                             [i_structure == FRAME_STRUCTURE]
+                                             [p_vpar->mb.i_motion_type];
 
         if( p_mb->i_mb_type & MB_PATTERN )
         {
index 47e03ed58e9d1dabca8bf5bf257cfb4302337ffb..c2589f5f96951b1fd37019345b5a619f64cc19f9 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_headers.c : headers parsing
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_headers.c,v 1.73 2001/01/17 18:17:31 massiot Exp $
+ * $Id: vpar_headers.c,v 1.74 2001/01/18 05:13:23 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Stéphane Borel <stef@via.ecp.fr>
 #include "video_output.h"
 
 #include "video_decoder.h"
+#include "vdec_motion.h"
 #include "../video_decoder/vdec_idct.h"
-#include "../video_decoder/vdec_motion.h"
 
-#include "../video_decoder/vpar_blocks.h"
+#include "vpar_blocks.h"
 #include "../video_decoder/vpar_headers.h"
 #include "../video_decoder/vpar_synchro.h"
 #include "../video_decoder/video_parser.h"
index 0e9cd3cf8a944d536f0ea5b24c26b007dd6c9a6a..d96433e64db3f6e492a8dd620d2268df07da40db 100644 (file)
@@ -2,7 +2,7 @@
  * vpar_synchro.c : frame dropping routines
  *****************************************************************************
  * Copyright (C) 1999, 2000 VideoLAN
- * $Id: vpar_synchro.c,v 1.77 2001/01/16 18:06:01 massiot Exp $
+ * $Id: vpar_synchro.c,v 1.78 2001/01/18 05:13:23 sam Exp $
  *
  * Authors: Christophe Massiot <massiot@via.ecp.fr>
  *          Samuel Hocevar <sam@via.ecp.fr>
 #include "video_output.h"
 
 #include "video_decoder.h"
+#include "vdec_motion.h"
 #include "../video_decoder/vdec_idct.h"
-#include "../video_decoder/vdec_motion.h"
 
-#include "../video_decoder/vpar_blocks.h"
+#include "vpar_blocks.h"
 #include "../video_decoder/vpar_headers.h"
 #include "../video_decoder/vpar_synchro.h"
 #include "../video_decoder/video_parser.h"