Skip to content

Commit

Permalink
The motion compensation routines are now modules as well ; choose your
Browse files Browse the repository at this point in the history
  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 ?
  • Loading branch information
Sam Hocevar committed Jan 18, 2001
1 parent cf0b7cf commit 647cca0
Show file tree
Hide file tree
Showing 33 changed files with 700 additions and 226 deletions.
7 changes: 7 additions & 0 deletions INSTALL
Original file line number Diff line number Diff line change
Expand Up @@ -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
===============================

Expand Down
57 changes: 41 additions & 16 deletions Makefile.in
Original file line number Diff line number Diff line change
Expand Up @@ -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 \
Expand Down Expand Up @@ -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

Expand All @@ -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) \
Expand All @@ -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), \
Expand All @@ -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
Expand Down Expand Up @@ -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_

Expand All @@ -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 $@ $^

Expand Down
6 changes: 3 additions & 3 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.
Expand Down
6 changes: 3 additions & 3 deletions configure.in
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -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 ])
Expand Down
3 changes: 3 additions & 0 deletions debian/vlc.1
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
5 changes: 4 additions & 1 deletion include/common.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* Vincent Seguin <[email protected]>
Expand Down Expand Up @@ -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
*****************************************************************************/
Expand Down
3 changes: 3 additions & 0 deletions include/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -278,6 +278,9 @@
/* 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"

Expand Down
29 changes: 23 additions & 6 deletions include/modules.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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 );
Expand Down Expand Up @@ -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;
Expand Down
23 changes: 1 addition & 22 deletions src/video_decoder/vdec_motion.h → include/vdec_motion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* Jean-Marc Dressler <[email protected]>
Expand Down Expand Up @@ -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 );
5 changes: 3 additions & 2 deletions src/video_decoder/vpar_blocks.h → include/vpar_blocks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* Jean-Marc Dressler <[email protected]>
Expand Down Expand Up @@ -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 */

Expand Down
4 changes: 2 additions & 2 deletions plugins/idct/idct.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*
Expand Down Expand Up @@ -73,7 +73,7 @@ MODULE_CONFIG_END
int InitModule( module_t * p_module )
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "C IDCT module";
p_module->psz_longname = "IDCT module";
p_module->psz_version = VERSION;

p_module->i_capabilities = MODULE_CAPABILITY_NULL
Expand Down
4 changes: 2 additions & 2 deletions plugins/idct/idctclassic.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
*
Expand Down Expand Up @@ -73,7 +73,7 @@ MODULE_CONFIG_END
int InitModule( module_t * p_module )
{
p_module->psz_name = MODULE_STRING;
p_module->psz_longname = "classic C IDCT module";
p_module->psz_longname = "classic IDCT module";
p_module->psz_version = VERSION;

p_module->i_capabilities = MODULE_CAPABILITY_NULL
Expand Down
4 changes: 2 additions & 2 deletions plugins/idct/idctmmx.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]>
* Michel Lespinasse <[email protected]>
Expand Down Expand Up @@ -153,7 +153,7 @@ static int idct_Probe( probedata_t *p_data )
}
else
{
return( 100 );
return( 150 );
}
}
else
Expand Down
Loading

0 comments on commit 647cca0

Please sign in to comment.