Commit 26ee312a authored by Sam Hocevar's avatar Sam Hocevar

 . the IDCT functions are now located in modules : the classic IDCT,
   our optimized IDCT, and MMX IDCT.
 . cosmetic changes for modules (pf_* instead of p_*)
 . fixes to the BeOS and dummy modules

   WARNING: a new directory has been added, which means you have to
   use `cvs update -dP' to update ; files have been removed , which means
   you either have to run `make distclean' or remove the .deps directory,
   and the configure script has changed, which means you have to run it
   again. Don't complain before having checked this :)

   Note about the IDCT modules: there is no way to choose the one we
   use, but you may remove the module in lib/ to prevent it from being
   loaded. The preference order is : MMX, Optimized, Classic.
parent a558a9bb
......@@ -238,7 +238,6 @@ endif
VIDEO_DECODER = src/video_decoder/video_decoder.o \
src/video_decoder/vdec_motion.o \
src/video_decoder/vdec_idct.o \
$(vdec_motion_inner)
MISC = src/misc/mtime.o \
......@@ -276,8 +275,8 @@ endif
#
ifneq (,$(findstring 86,$(ARCH)))
ifneq (,$(findstring mmx,$(ARCH)))
ASM_OBJ = src/video_decoder/vdec_idctmmx.o \
src/video_output/video_yuv_mmx.o
ASM_OBJ = src/video_output/video_yuv_mmx.o
PLUGIN_IDCTMMX_ASM = plugins/idct/idctmmx_asm.o
endif
endif
......@@ -351,6 +350,15 @@ PLUGIN_YUVMMX = plugins/yuvmmx/yuvmmx.o \
plugins/yuvmmx/video_yuv24.o \
plugins/yuvmmx/video_yuv32.o
PLUGIN_IDCT = plugins/idct/idct.o \
plugins/idct/idct_common.o
PLUGIN_IDCTCLASSIC = plugins/idct/idctclassic.o \
plugins/idct/idct_common.o
PLUGIN_IDCTMMX = plugins/idct/idctmmx.o \
plugins/idct/idct_common.o
PLUGIN_ALSA = plugins/alsa/alsa.o \
plugins/alsa/aout_alsa.o
......@@ -364,14 +372,23 @@ STD_PLUGIN_OBJ =$(PLUGIN_BEOS) \
$(PLUGIN_X11) \
$(PLUGIN_YUV) \
$(PLUGIN_YUVMMX) \
$(PLUGIN_IDCT) \
$(PLUGIN_IDCTMMX) \
$(PLUGIN_SDL) \
$(PLUGIN_ALSA) \
$(PLUGIN_NULL)
STD_PLUGIN_ASM =$(PLUGIN_IDCTMMX_ASM)
STD_PLUGIN_COMMON = plugins/idct/idct_common.o
# filter out duplicates from the plugin object lists
STD_PLUGIN_OBJ := $(filter-out $(STD_PLUGIN_COMMON), $(STD_PLUGIN_OBJ)) \
$(STD_PLUGIN_COMMON)
#
# Other lists of files
#
objects := $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ)
objects := $(C_OBJ) $(CPP_OBJ) $(ASM_OBJ) $(STD_PLUGIN_OBJ) $(STD_PLUGIN_ASM)
dependancies := $(objects:%.o=.dep/%.d)
# All symbols must be exported
......@@ -467,6 +484,10 @@ $(STD_PLUGIN_OBJ): %.o: .dep/%.d
$(STD_PLUGIN_OBJ): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(STD_PLUGIN_ASM): %.o: Makefile.dep
$(STD_PLUGIN_ASM): %.o: %.S
$(CC) $(CFLAGS) $(PCFLAGS) -c -o $@ $<
$(PLUGIN_GNOME): %.o: Makefile.dep
$(PLUGIN_GNOME): %.o: %.c
$(CC) $(CFLAGS) $(PCFLAGS) `gnome-config --cflags gnomeui` -c -o $@ $<
......@@ -535,17 +556,35 @@ lib/ggi.so: $(PLUGIN_GGI)
lib/sdl.so: $(PLUGIN_SDL)
$(CC) $(PCFLAGS) -shared -o $@ $^ $(LIB_SDL)
lib/yuv.so: $(PLUGIN_YUV)
ifeq ($(SYS),beos)
lib/idct.so: $(PLUGIN_IDCT)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
lib/yuv.so: $(PLUGIN_YUV)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
$(CC) $(PCFLAGS) -shared -o $@ $^
endif
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
ifeq ($(SYS),beos)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMX_ASM)
$(CC) -nostart -Xlinker -soname=$@ -o $@ $^ plugins/_APP_
else
lib/yuv.so: $(PLUGIN_YUV)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/yuvmmx.so: $(PLUGIN_YUVMMX)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/idct.so: $(PLUGIN_IDCT)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/idctclassic.so: $(PLUGIN_IDCTCLASSIC)
$(CC) $(PCFLAGS) -shared -o $@ $^
lib/idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMX_ASM)
$(CC) $(PCFLAGS) -shared -o $@ $^
endif
......
......@@ -3296,7 +3296,7 @@ EOF
fi
PLUGINS=${PLUGINS}"yuv ";
PLUGINS=${PLUGINS}"yuv idct idctclassic ";
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 "; fi
if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi
else
if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi
if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi
fi
# Check whether --enable-debug or --disable-debug was given.
......
......@@ -108,7 +108,7 @@ AC_TYPE_SIZE_T
AC_HEADER_TIME
dnl default plugins
PLUGINS=${PLUGINS}"yuv ";
PLUGINS=${PLUGINS}"yuv idct idctclassic ";
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 "; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx "; fi ])
[ if test x$enableval = xyes; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586; then ARCH=${ARCH}" mmx"; PLUGINS=${PLUGINS}"yuvmmx idctmmx "; fi ])
AC_ARG_ENABLE(debug,
[ --enable-debug Enable debug mode (default disabled)],
[ if test x$enableval = xyes; then DEBUG=1; fi ])
......
......@@ -139,11 +139,11 @@ typedef struct aout_thread_s
/* Plugin used and shortcuts to access its capabilities */
struct module_s * p_module;
aout_open_t * p_open;
aout_setformat_t * p_setformat;
aout_getbufinfo_t * p_getbufinfo;
aout_play_t * p_play;
aout_close_t * p_close;
aout_open_t * pf_open;
aout_setformat_t * pf_setformat;
aout_getbufinfo_t * pf_getbufinfo;
aout_play_t * pf_play;
aout_close_t * pf_close;
void * buffer;
/* The s32 buffer is used to mix all the audio fifos together before
......
......@@ -3,7 +3,7 @@
* Collection of useful common types and macros definitions
*****************************************************************************
* Copyright (C) 1998, 1999, 2000 VideoLAN
* $Id: common.h,v 1.23 2001/01/11 15:35:35 sam Exp $
* $Id: common.h,v 1.24 2001/01/13 12:57:19 sam Exp $
*
* Authors: Samuel Hocevar <sam@via.ecp.fr>
* Vincent Seguin <seguin@via.ecp.fr>
......@@ -61,6 +61,13 @@ typedef int ptrdiff_t;
/* Counter for statistics and profiling */
typedef unsigned long count_t;
/* DCT elements types */
#ifndef VDEC_DFT
typedef short dctelem_t;
#else
typedef int dctelem_t;
#endif
/*****************************************************************************
* Classes declaration
*****************************************************************************/
......
......@@ -2,7 +2,7 @@
* input_ext-dec.h: structures exported to the VideoLAN decoders
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-dec.h,v 1.13 2001/01/12 17:33:18 massiot Exp $
* $Id: input_ext-dec.h,v 1.14 2001/01/13 12:57:19 sam Exp $
*
* Authors:
*
......@@ -66,7 +66,7 @@ typedef struct pes_packet_s
/* Pointers to packets (packets are then linked by the p_prev and
p_next fields of the data_packet_t struct) */
data_packet_t * p_first; /* The first packet containing this
data_packet_t * p_first; /* The first packet contained by this
* PES (used by decoders). */
} pes_packet_t;
......
......@@ -34,17 +34,18 @@ typedef void * module_handle_t;
* Module capabilities.
*****************************************************************************/
#define MODULE_CAPABILITY_NULL 0 /* The Module can't do anything */
#define MODULE_CAPABILITY_INTF 1<<0 /* Interface */
#define MODULE_CAPABILITY_INPUT 1<<1 /* Input */
#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_AOUT 1<<5 /* Audio output */
#define MODULE_CAPABILITY_VOUT 1<<6 /* Video output */
#define MODULE_CAPABILITY_YUV 1<<7 /* YUV colorspace conversion */
#define MODULE_CAPABILITY_AFX 1<<8 /* Audio effects */
#define MODULE_CAPABILITY_VFX 1<<9 /* Video effects */
#define MODULE_CAPABILITY_NULL 0 /* The Module can't do anything */
#define MODULE_CAPABILITY_INTF 1 << 0 /* Interface */
#define MODULE_CAPABILITY_INPUT 1 << 1 /* Input */
#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 */
/* FIXME: not yet used */
typedef struct probedata_s
......@@ -58,20 +59,31 @@ typedef struct probedata_s
/* FIXME: find a nicer way to do this. */
typedef struct function_list_s
{
int ( * p_probe ) ( probedata_t * p_data );
int ( * pf_probe ) ( probedata_t * p_data );
union
{
struct
{
int ( * p_open ) ( struct aout_thread_s * p_aout );
int ( * p_setformat ) ( struct aout_thread_s * p_aout );
long ( * p_getbufinfo ) ( struct aout_thread_s * p_aout,
long l_buffer_info );
void ( * p_play ) ( struct aout_thread_s * p_aout,
byte_t *buffer, int i_size );
void ( * p_close ) ( struct aout_thread_s * p_aout );
} aout;
int ( * pf_open ) ( struct aout_thread_s * p_aout );
int ( * pf_setformat ) ( struct aout_thread_s * p_aout );
long ( * pf_getbufinfo ) ( struct aout_thread_s * p_aout,
long l_buffer_info );
void ( * pf_play ) ( struct aout_thread_s * p_aout,
byte_t *buffer, int i_size );
void ( * pf_close ) ( struct aout_thread_s * p_aout );
} aout;
struct
{
void ( * pf_init ) ( struct vdec_thread_s * p_vdec );
void ( * pf_sparse_idct ) ( struct vdec_thread_s * p_vdec,
dctelem_t * p_block,
int i_sparse_pos );
void ( * pf_idct ) ( struct vdec_thread_s * p_vdec,
dctelem_t * p_block,
int i_idontcare );
} idct;
} functions;
......@@ -79,12 +91,13 @@ typedef struct function_list_s
typedef struct module_functions_s
{
/* The order here has to be the same as above for the #defines */
/* XXX: The order here has to be the same as above for the #defines */
function_list_t intf;
function_list_t input;
function_list_t decaps;
function_list_t adec;
function_list_t vdec;
function_list_t idct;
function_list_t aout;
function_list_t vout;
function_list_t yuv;
......
......@@ -2,7 +2,7 @@
* video_decoder.h : video decoder thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_decoder.h,v 1.1 2000/12/21 17:19:52 massiot Exp $
* $Id: video_decoder.h,v 1.22 2001/01/13 12:57:19 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......
......@@ -91,12 +91,12 @@ static void aout_Close ( aout_thread_t *p_aout );
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
p_function_list->functions.aout.p_setformat = aout_SetFormat;
p_function_list->functions.aout.p_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.p_play = aout_Play;
p_function_list->functions.aout.p_close = aout_Close;
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
......@@ -148,7 +148,6 @@ static int aout_Probe( probedata_t *p_data )
*****************************************************************************
* This function opens an alsa device, through the alsa API
*****************************************************************************/
static int aout_Open( aout_thread_t *p_aout )
{
......@@ -195,8 +194,7 @@ static int aout_Open( aout_thread_t *p_aout )
* This function prepares the device, sets the rate, format, the mode
* ("play as soon as you have data"), and buffer information.
*****************************************************************************/
int aout_SetFormat( aout_thread_t *p_aout )
static int aout_SetFormat( aout_thread_t *p_aout )
{
int i_set_param_returns;
......@@ -288,7 +286,7 @@ int aout_SetFormat( aout_thread_t *p_aout )
* of data to play, it switches to the "underrun" status. It has to
* be flushed and re-prepared
*****************************************************************************/
long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
snd_pcm_channel_status_t alsa_channel_status;
int i_alsa_get_status_returns;
......@@ -333,7 +331,7 @@ long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
*****************************************************************************
* Plays a sample using the snd_pcm_write function from the alsa API
*****************************************************************************/
void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int i_write_returns;
......@@ -350,7 +348,7 @@ void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
/*****************************************************************************
* aout_Close : close the Alsa device
*****************************************************************************/
void aout_Close( aout_thread_t *p_aout )
static void aout_Close( aout_thread_t *p_aout )
{
int i_close_returns;
......@@ -365,3 +363,4 @@ void aout_Close( aout_thread_t *p_aout )
intf_DbgMsg( "Alsa plugin : Alsa device closed");
}
......@@ -2,7 +2,7 @@
* aout_beos.cpp: BeOS audio output
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: aout_beos.cpp,v 1.9 2001/01/12 13:15:42 sam Exp $
* $Id: aout_beos.cpp,v 1.10 2001/01/13 12:57:19 sam Exp $
*
* Authors:
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -91,18 +91,18 @@ static void aout_Close ( aout_thread_t *p_aout );
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
p_function_list->functions.aout.p_setformat = aout_SetFormat;
p_function_list->functions.aout.p_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.p_play = aout_Play;
p_function_list->functions.aout.p_close = aout_Close;
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Probe: probe the audio device and return a score
*****************************************************************************/
int aout_Probe( aout_thread_t *p_aout )
static int aout_Probe( probedata_t *p_data )
{
/* We don't test anything since I don't know what to test. However
* if the module could be loaded it is quite likely to work. */
......@@ -112,7 +112,7 @@ int aout_Probe( aout_thread_t *p_aout )
/*****************************************************************************
* aout_Open: opens a BPushGameSound
*****************************************************************************/
int aout_Open( aout_thread_t *p_aout )
static int aout_Open( aout_thread_t *p_aout )
{
/* Allocate structure */
p_aout->p_sys = (aout_sys_t*) malloc( sizeof( aout_sys_t ) );
......@@ -175,7 +175,7 @@ int aout_Open( aout_thread_t *p_aout )
/*****************************************************************************
* aout_SetFormat: sets the dsp output format
*****************************************************************************/
int aout_SetFormat( aout_thread_t *p_aout )
static int aout_SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
......@@ -183,7 +183,7 @@ int aout_SetFormat( aout_thread_t *p_aout )
/*****************************************************************************
* aout_GetBufInfo: buffer status query
*****************************************************************************/
long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
/* Each value is 4 bytes long (stereo signed 16 bits) */
long i_hard_pos = 4 * p_aout->p_sys->p_sound->CurrentPosition();
......@@ -202,7 +202,7 @@ long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
*****************************************************************************
* This function writes a buffer of i_length bytes in the dsp
*****************************************************************************/
void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
long i_newbuf_pos;
......@@ -234,7 +234,7 @@ void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
/*****************************************************************************
* aout_Close: closes the dsp audio device
*****************************************************************************/
void aout_Close( aout_thread_t *p_aout )
static void aout_Close( aout_thread_t *p_aout )
{
p_aout->p_sys->p_sound->UnlockCyclic();
p_aout->p_sys->p_sound->StopPlaying( );
......
......@@ -92,12 +92,12 @@ static void aout_Close ( aout_thread_t *p_aout );
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
p_function_list->functions.aout.p_setformat = aout_SetFormat;
p_function_list->functions.aout.p_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.p_play = aout_Play;
p_function_list->functions.aout.p_close = aout_Close;
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
......
......@@ -35,6 +35,8 @@
#include "main.h"
#include "modules.h"
/*****************************************************************************
* vout_dummy_t: dummy video output method descriptor
*****************************************************************************
......@@ -44,13 +46,46 @@
typedef struct aout_sys_s
{
} aout_sys_t;
/*****************************************************************************
* aout_DummyOpen: opens a dummy audio device
* Local prototypes.
*****************************************************************************/
static int aout_Probe ( probedata_t *p_data );
static int aout_Open ( aout_thread_t *p_aout );
static int aout_SetFormat ( aout_thread_t *p_aout );
static long aout_GetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
static void aout_Play ( aout_thread_t *p_aout,
byte_t *buffer, int i_size );
static void aout_Close ( aout_thread_t *p_aout );
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
* aout_Probe: probe the audio device and return a score
*****************************************************************************/
static int aout_Probe( probedata_t *p_data )
{
/* The dummy plugin always works but give it the lower possible score */
return( 1 );
}
/*****************************************************************************
* aout_Open: opens a dummy audio device
*****************************************************************************/
int aout_DummyOpen( aout_thread_t *p_aout )
static int aout_Open( aout_thread_t *p_aout )
{
/* Initialize some variables */
p_aout->i_format = AOUT_FORMAT_DEFAULT;
......@@ -61,33 +96,33 @@ int aout_DummyOpen( aout_thread_t *p_aout )
}
/*****************************************************************************
* aout_DummySetFormat: pretends to set the dsp output format
* aout_SetFormat: pretends to set the dsp output format
*****************************************************************************/
int aout_DummySetFormat( aout_thread_t *p_aout )
static int aout_SetFormat( aout_thread_t *p_aout )
{
return( 0 );
}
/*****************************************************************************
* aout_DummyGetBufInfo: returns available bytes in buffer
* aout_GetBufInfo: returns available bytes in buffer
*****************************************************************************/
long aout_DummyGetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
return( sizeof(s16) * l_buffer_limit + 1 ); /* value big enough to sleep */
}
/*****************************************************************************
* aout_DummyPlay: pretends to play a sound
* aout_Play: pretends to play a sound
*****************************************************************************/
void aout_DummyPlay( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
;
}
/*****************************************************************************
* aout_DummyClose: closes the dummy audio device
* aout_Close: closes the dummy audio device
*****************************************************************************/
void aout_DummyClose( aout_thread_t *p_aout )
static void aout_Close( aout_thread_t *p_aout )
{
;
}
......
......@@ -20,6 +20,8 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
#define MODULE_NAME dummy
/*****************************************************************************
* Preamble
*****************************************************************************/
......@@ -39,21 +41,87 @@
#include "video.h"
#include "video_output.h"
#include "modules.h"
#include "modules_inner.h"
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for dummy module" )
ADD_COMMENT( "Ha, ha -- nothing to configure yet" )
MODULE_CONFIG_END
/*****************************************************************************
* Capabilities defined in the other files.
*****************************************************************************/
extern void aout_getfunctions( function_list_t * p_function_list );
/*****************************************************************************
* 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 = "dummy functions module";
p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_AOUT;
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 );
}
aout_getfunctions( &p_module->p_functions->aout );
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 );
}
/* OLD MODULE STRUCTURE -- soon to be removed */
/*****************************************************************************
* Exported prototypes
*****************************************************************************/
static void aout_GetPlugin( p_aout_thread_t p_aout );
static void vout_GetPlugin( p_vout_thread_t p_vout );
static void intf_GetPlugin( p_intf_thread_t p_intf );
/* Audio output */
int aout_DummyOpen ( aout_thread_t *p_aout );
int aout_DummySetFormat ( aout_thread_t *p_aout );
long aout_DummyGetBufInfo ( aout_thread_t *p_aout, long l_buffer_info );
void aout_DummyPlay ( aout_thread_t *p_aout, byte_t *buffer,
int i_size );
void aout_DummyClose ( aout_thread_t *p_aout );
/* Video output */
int vout_DummyCreate ( vout_thread_t *p_vout, char *psz_display,
int i_root_window, void *p_data );
......@@ -81,7 +149,7 @@ plugin_info_t * GetConfig( void )
p_info->psz_version = VERSION;
p_info->psz_author = "the VideoLAN team <vlc@videolan.org>";
p_info->aout_GetPlugin = aout_GetPlugin;
p_info->aout_GetPlugin = NULL;
p_info->vout_GetPlugin = vout_GetPlugin;
p_info->intf_GetPlugin = intf_GetPlugin;
p_info->yuv_GetPlugin = NULL;
......@@ -95,13 +163,6 @@ plugin_info_t * GetConfig( void )
p_info->i_score += 0x200;
}
/* If this plugin was requested, score it higher */
if( TestMethod( AOUT_METHOD_VAR, "dummy" ) )
{
p_info->i_score += 0x200;
}
return( p_info );
}
......@@ -109,15 +170,6 @@ plugin_info_t * GetConfig( void )
* Following functions are only called through the p_info structure
*****************************************************************************/
static void aout_GetPlugin( p_aout_thread_t p_aout )
{
p_aout->p_open = aout_DummyOpen;
p_aout->p_setformat = aout_DummySetFormat;
p_aout->p_getbufinfo = aout_DummyGetBufInfo;
p_aout->p_play = aout_DummyPlay;
p_aout->p_close = aout_DummyClose;
}
static void vout_GetPlugin( p_vout_thread_t p_vout )
{
p_vout->p_sys_create = vout_DummyCreate;
......
......@@ -82,12 +82,12 @@ static void aout_Close ( aout_thread_t *p_aout );
*****************************************************************************/
void aout_getfunctions( function_list_t * p_function_list )
{
p_function_list->p_probe = aout_Probe;
p_function_list->functions.aout.p_open = aout_Open;
p_function_list->functions.aout.p_setformat = aout_SetFormat;
p_function_list->functions.aout.p_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.p_play = aout_Play;
p_function_list->functions.aout.p_close = aout_Close;
p_function_list->pf_probe = aout_Probe;
p_function_list->functions.aout.pf_open = aout_Open;
p_function_list->functions.aout.pf_setformat = aout_SetFormat;
p_function_list->functions.aout.pf_getbufinfo = aout_GetBufInfo;
p_function_list->functions.aout.pf_play = aout_Play;
p_function_list->functions.aout.pf_close = aout_Close;
}
/*****************************************************************************
......@@ -162,7 +162,7 @@ static int aout_SetFormat( aout_thread_t *p_aout )
/*****************************************************************************
* aout_GetBufInfo: buffer status query
*****************************************************************************/
long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
static long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
{
/* arbitrary value that should be changed */
return( l_buffer_limit );
......@@ -173,7 +173,7 @@ long aout_GetBufInfo( aout_thread_t *p_aout, long l_buffer_limit )
*****************************************************************************
* This function writes a buffer of i_length bytes in the socket
*****************************************************************************/
void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
static void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
{
int amount;
......@@ -200,7 +200,7 @@ void aout_Play( aout_thread_t *p_aout, byte_t *buffer, int i_size )
/*****************************************************************************
* aout_Close: close the Esound socket
*****************************************************************************/
void aout_Close( aout_thread_t *p_aout )
static void aout_Close( aout_thread_t *p_aout )
{
close( p_aout->i_fd );
}
......
/*****************************************************************************
* vdec_idct.h : types for the inverse discrete cosine transform
* idct.h : macros for the inverse discrete cosine transform
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_idct.h,v 1.1 2000/12/21 17:19:52 massiot Exp $
* $Id: idct.h,v 1.1 2001/01/13 12:57:20 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -22,26 +22,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/*****************************************************************************
* Requires:
* "config.h"
* "common.h"
* "threads.h"
* "video_parser.h"
*****************************************************************************/
/*****************************************************************************
* Common declarations
*****************************************************************************/
#ifndef VDEC_DFT
typedef short dctelem_t;
#else
typedef int dctelem_t;
#endif
struct vdec_thread_s;
#define SPARSE_SCALE_FACTOR 8
#define DCTSIZE 8 /* 8*8 DCT */
......@@ -160,14 +140,3 @@ struct vdec_thread_s;
#define MULTIPLY(var,const) ((var) * (const))
#endif
/*****************************************************************************
* Function pointers
*****************************************************************************/
typedef void (*f_idct_t)( struct vdec_thread_s *, dctelem_t*, int );
/*****************************************************************************
* Prototypes
*****************************************************************************/
void vdec_InitIDCT (struct vdec_thread_s * p_vdec);
void vdec_SparseIDCT( struct vdec_thread_s *, dctelem_t*, int );
void vdec_IDCT( struct vdec_thread_s *, dctelem_t*, int );
/*****************************************************************************
* idct_common.c : common IDCT functions
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idct_common.c,v 1.1 2001/01/13 12:57:20 sam Exp $
*
* Authors: Gal Hendryckx <jimmy@via.ecp.fr>
*
* 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.
*****************************************************************************/
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <stdlib.h>
#include "config.h"
#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 "video_decoder.h"
#include "modules.h"
#include "idct.h"
void vdec_SparseIDCT ( vdec_thread_t * p_vdec, dctelem_t * p_block,
int i_sparse_pos);
/*****************************************************************************
* vdec_SparseIDCT : IDCT function for sparse matrices
*****************************************************************************/
void vdec_SparseIDCT (vdec_thread_t * p_vdec, dctelem_t * p_block,
int i_sparse_pos)
{
short int val;
int * dp;
int v;
short int * p_dest;
short int * p_source;
int coeff, rr;
/* If DC Coefficient. */
if ( i_sparse_pos == 0 )
{
dp=(int *)p_block;
val=RIGHT_SHIFT((*p_block + 4), 3);
/* Compute int to assign. This speeds things up a bit */
v = ((val & 0xffff) | (val << 16));
dp[0] = v; dp[1] = v; dp[2] = v; dp[3] = v;
dp[4] = v; dp[5] = v; dp[6] = v; dp[7] = v;
dp[8] = v; dp[9] = v; dp[10] = v; dp[11] = v;
dp[12] = v; dp[13] = v; dp[14] = v; dp[15] = v;
dp[16] = v; dp[17] = v; dp[18] = v; dp[19] = v;
dp[20] = v; dp[21] = v; dp[22] = v; dp[23] = v;
dp[24] = v; dp[25] = v; dp[26] = v; dp[27] = v;
dp[28] = v; dp[29] = v; dp[30] = v; dp[31] = v;
return;
}
/* Some other coefficient. */
p_dest = (s16*)p_block;
p_source = (s16*)&p_vdec->p_pre_idct[i_sparse_pos];
coeff = (int)p_dest[i_sparse_pos];
for( rr=0 ; rr < 4 ; rr++ )
{
p_dest[0] = (p_source[0] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[1] = (p_source[1] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[2] = (p_source[2] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[3] = (p_source[3] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[4] = (p_source[4] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[5] = (p_source[5] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[6] = (p_source[6] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[7] = (p_source[7] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[8] = (p_source[8] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[9] = (p_source[9] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[10] = (p_source[10] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[11] = (p_source[11] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[12] = (p_source[12] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[13] = (p_source[13] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[14] = (p_source[14] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest[15] = (p_source[15] * coeff) >> SPARSE_SCALE_FACTOR;
p_dest += 16;
p_source += 16;
}
return;
}
This diff is collapsed.
/*****************************************************************************
* idctmmx.c : MMX IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idctmmx.c,v 1.1 2001/01/13 12:57:20 sam Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
*
* 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 idctmmx
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <stdlib.h>
#include "config.h"
#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 "video_decoder.h"
#include "modules.h"
#include "modules_inner.h"
#include "idct.h"
/*****************************************************************************
* Local prototypes.
*****************************************************************************/
static void idct_getfunctions( function_list_t * p_function_list );
static int idct_Probe ( probedata_t *p_data );
static void vdec_InitIDCT ( vdec_thread_t * p_vdec);
void vdec_SparseIDCT ( vdec_thread_t * p_vdec, dctelem_t * p_block,
int i_sparse_pos);
void vdec_IDCT ( vdec_thread_t * p_vdec, dctelem_t * p_block,
int i_idontcare );
/*****************************************************************************
* Build configuration tree.
*****************************************************************************/
MODULE_CONFIG_START
ADD_WINDOW( "Configuration for MMX IDCT 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 IDCT module";
p_module->psz_version = VERSION;
p_module->i_capabilities = MODULE_CAPABILITY_NULL
| MODULE_CAPABILITY_IDCT;
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 );
}
idct_getfunctions( &p_module->p_functions->idct );
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 );
}
/* Following functions are local */
/*****************************************************************************
* Functions exported as capabilities. They are declared as static so that
* we don't pollute the namespace too much.
*****************************************************************************/
static void idct_getfunctions( function_list_t * p_function_list )
{
p_function_list->pf_probe = idct_Probe;
p_function_list->functions.idct.pf_init = vdec_InitIDCT;
p_function_list->functions.idct.pf_sparse_idct = vdec_SparseIDCT;
p_function_list->functions.idct.pf_idct = vdec_IDCT;
}
/*****************************************************************************
* idct_Probe: return a preference score
*****************************************************************************/
static int idct_Probe( probedata_t *p_data )
{
/* This plugin always works */
return( 100 );
}
/*****************************************************************************
* vdec_InitIDCT : initialize datas for vdec_SparceIDCT
*****************************************************************************/
static void vdec_InitIDCT (vdec_thread_t * p_vdec)
{
int i;
dctelem_t * p_pre = p_vdec->p_pre_idct;
memset( p_pre, 0, 64*64*sizeof(dctelem_t) );
for( i=0 ; i < 64 ; i++ )
{
p_pre[i*64+i] = 1 << SPARSE_SCALE_FACTOR;
vdec_IDCT( p_vdec, &p_pre[i*64], 0) ;
}
return;
}
......@@ -2,7 +2,7 @@
* vdec_idctmmx.S : MMX IDCT implementation
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_idctmmx.S,v 1.6 2001/01/05 14:46:37 sam Exp $
* $Id: idctmmx_asm.S,v 1.1 2001/01/13 12:57:20 sam Exp $
*
* Authors:
*
......
......@@ -123,17 +123,17 @@ aout_thread_t *aout_CreateThread( int *pi_status )
}
#define aout_functions p_aout->p_module->p_functions->aout.functions.aout
p_aout->p_open = aout_functions.p_open;
p_aout->p_setformat = aout_functions.p_setformat;
p_aout->p_getbufinfo = aout_functions.p_getbufinfo;
p_aout->p_play = aout_functions.p_play;
p_aout->p_close = aout_functions.p_close;
p_aout->pf_open = aout_functions.pf_open;
p_aout->pf_setformat = aout_functions.pf_setformat;
p_aout->pf_getbufinfo = aout_functions.pf_getbufinfo;
p_aout->pf_play = aout_functions.pf_play;
p_aout->pf_close = aout_functions.pf_close;
#undef aout_functions
/*
* Initialize audio device
*/
if ( p_aout->p_open( p_aout ) )
if ( p_aout->pf_open( p_aout ) )
{
module_Unneed( p_main->p_module_bank, p_aout->p_module );
free( p_aout );
......@@ -143,9 +143,9 @@ aout_thread_t *aout_CreateThread( int *pi_status )
p_aout->b_stereo = ( p_aout->i_channels == 2 ) ? 1 : 0; /* FIXME: only works
for i_channels == 1 or 2 ??*/
if ( p_aout->p_setformat( p_aout ) )
if ( p_aout->pf_setformat( p_aout ) )
{
p_aout->p_close( p_aout );
p_aout->pf_close( p_aout );
module_Unneed( p_main->p_module_bank, p_aout->p_module );
free( p_aout );
return( NULL );
......@@ -159,7 +159,7 @@ aout_thread_t *aout_CreateThread( int *pi_status )
* this thread is only called in main and all calls are blocking */
if( aout_SpawnThread( p_aout ) )
{
p_aout->p_close( p_aout );
p_aout->pf_close( p_aout );
module_Unneed( p_main->p_module_bank, p_aout->p_module );
free( p_aout );
return( NULL );
......@@ -334,13 +334,12 @@ void aout_DestroyThread( aout_thread_t * p_aout, int *pi_status )
}
vlc_mutex_destroy( &p_aout->fifos_lock );
/* Free the plugin */
p_aout->pf_close( p_aout );
/* Release the aout module */
module_Unneed( p_main->p_module_bank, p_aout->p_module );
/* Free the structure */
p_aout->p_close( p_aout );
intf_DbgMsg("aout debug: audio device (%s) closed", p_aout->psz_device);
/* Free structure */
free( p_aout );
}
......@@ -797,9 +796,9 @@ void aout_Thread_U8_Mono( aout_thread_t * p_aout )
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256 ) + 128 ) * p_aout->vol / 256 );
p_aout->s32_buffer[l_buffer] = 0;
}
l_bytes = p_aout->p_getbufinfo( p_aout, l_buffer_limit );
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
p_aout->date = mdate() + ((((mtime_t)(l_bytes / 1 )) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(u8) << (p_aout->b_stereo) == 1 */
p_aout->p_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(u8) );
p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(u8) );
if ( l_bytes > (l_buffer_limit * sizeof(u8) * 2) ) /* There are 2 channels (left & right) */
{
msleep( p_aout->l_msleep );
......@@ -1088,9 +1087,9 @@ void aout_Thread_U8_Stereo( aout_thread_t * p_aout )
((u8 *)p_aout->buffer)[l_buffer] = (u8)( ( (p_aout->s32_buffer[l_buffer] / AOUT_MAX_FIFOS / 256) + 128 ) * p_aout->vol / 256 );
p_aout->s32_buffer[l_buffer] = 0;
}
l_bytes = p_aout->p_getbufinfo( p_aout, l_buffer_limit );
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
p_aout->date = mdate() + ((((mtime_t)(l_bytes / 2 )) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(u8) << (p_aout->b_stereo) == 2 */
p_aout->p_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(u8) );
p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(u8) );
if ( l_bytes > (l_buffer_limit * sizeof(u8)) )
{
msleep( p_aout->l_msleep );
......@@ -1383,9 +1382,9 @@ void aout_Thread_S16_Stereo( aout_thread_t * p_aout )
p_aout->s32_buffer[l_buffer] = 0;
}
l_bytes = p_aout->p_getbufinfo( p_aout, l_buffer_limit );
l_bytes = p_aout->pf_getbufinfo( p_aout, l_buffer_limit );
p_aout->date = mdate() + ((((mtime_t)(l_bytes / 4)) * 1000000) / ((mtime_t)p_aout->l_rate)); /* sizeof(s16) << (p_aout->b_stereo) == 4 */
p_aout->p_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(s16) );
p_aout->pf_play( p_aout, (byte_t *)p_aout->buffer, l_buffer_limit * sizeof(s16) );
if ( l_bytes > (l_buffer_limit * sizeof(s16)) )
{
msleep( p_aout->l_msleep );
......
......@@ -271,7 +271,7 @@ module_t * module_Need( module_bank_t *p_bank,
if( ( (1 << i_index) & i_capabilities ) )
{
i_score = ( (function_list_t *)p_module->p_functions)
[i_index].p_probe( p_data );
[i_index].pf_probe( p_data );
if( i_score )
{
......
......@@ -2,7 +2,7 @@
* video_parser.h : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.h,v 1.2 2001/01/10 19:22:11 massiot Exp $
* $Id: video_parser.h,v 1.3 2001/01/13 12:57:20 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -128,9 +128,13 @@ typedef struct vpar_thread_s
/* variable length codes for the structure dct_dc_size for intra blocks */
lookup_t * pppl_dct_dc_size[2][2];
/* Structure to store the tables B14 & B15 (ISO/CEI 13818-2 B.4) */
dct_lookup_t ppl_dct_coef[2][16384];
dct_lookup_t ppl_dct_coef[2][16384];
/* IDCT plugin used and shortcuts to access its capabilities */
struct module_s * p_module;
idct_init_t pf_init;
f_idct_t pf_sparse_idct;
f_idct_t pf_idct;
#ifdef STATS
/* Statistics */
......
......@@ -2,7 +2,7 @@
* video_fifo.c : video FIFO management
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_fifo.c,v 1.26 2001/01/07 03:56:40 henri Exp $
* $Id: video_fifo.c,v 1.27 2001/01/13 12:57:21 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -40,8 +40,8 @@
#include "video.h"
#include "video_output.h"
#include "video_decoder.h"
#include "../video_decoder/vdec_idct.h"
#include "../video_decoder/video_decoder.h"
#include "../video_decoder/vdec_motion.h"
#include "../video_decoder/vpar_blocks.h"
......
......@@ -2,7 +2,7 @@
* video_parser.c : video parser thread
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: video_parser.c,v 1.65 2001/01/12 17:33:18 massiot Exp $
* $Id: video_parser.c,v 1.66 2001/01/13 12:57:21 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -41,6 +41,7 @@
#include "threads.h"
#include "mtime.h"
#include "plugins.h"
#include "modules.h"
#include "intf_msg.h"
......@@ -50,9 +51,9 @@
#include "video.h"
#include "video_output.h"
#include "../video_decoder/vdec_idct.h"
#include "../video_decoder/video_decoder.h"
#include "video_decoder.h"
#include "../video_decoder/vdec_motion.h"
#include "../video_decoder/vdec_idct.h"
#include "../video_decoder/vpar_blocks.h"
#include "../video_decoder/vpar_headers.h"
......@@ -60,6 +61,8 @@
#include "../video_decoder/video_parser.h"
#include "../video_decoder/video_fifo.h"
#include "main.h"
/*
* Local prototypes
*/
......@@ -97,11 +100,29 @@ 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 );
if( p_vpar->p_module == NULL )
{
intf_ErrMsg( "vpar error: no suitable IDCT 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;
#undef idct_functions
/* 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 );
free( p_vpar );
return( 0 );
}
......@@ -405,6 +426,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 );
free( p_vpar );
intf_DbgMsg("vpar debug: EndThread(%p)", p_vpar);
......
......@@ -2,7 +2,7 @@
* vpar_blocks.c : blocks parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_blocks.c,v 1.69 2001/01/05 18:46:45 massiot Exp $
* $Id: vpar_blocks.c,v 1.70 2001/01/13 12:57:21 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Jean-Marc Dressler <polux@via.ecp.fr>
......@@ -44,8 +44,8 @@
#include "video.h"
#include "video_output.h"
#include "video_decoder.h"
#include "../video_decoder/vdec_idct.h"
#include "../video_decoder/video_decoder.h"
#include "../video_decoder/vdec_motion.h"
#include "../video_decoder/vpar_blocks.h"
......@@ -693,12 +693,12 @@ static __inline__ void DecodeMPEG1NonIntra( vpar_thread_t * p_vpar,
#endif
if( i_nc <= 1 )
{
p_mb->pf_idct[i_b] = vdec_SparseIDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_sparse_idct;
p_mb->pi_sparse_pos[i_b] = i_coef;
}
else
{
p_mb->pf_idct[i_b] = vdec_IDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_idct;
}
return;
......@@ -844,12 +844,12 @@ static __inline__ void DecodeMPEG1Intra( vpar_thread_t * p_vpar,
case DCT_EOB:
if( i_nc <= 1 )
{
p_mb->pf_idct[i_b] = vdec_SparseIDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_sparse_idct;
p_mb->pi_sparse_pos[i_b] = i_coef;
}
else
{
p_mb->pf_idct[i_b] = vdec_IDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_idct;
}
return;
......@@ -966,12 +966,12 @@ static __inline__ void DecodeMPEG2NonIntra( vpar_thread_t * p_vpar,
#endif
if( i_nc <= 1 )
{
p_mb->pf_idct[i_b] = vdec_SparseIDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_sparse_idct;
p_mb->pi_sparse_pos[i_b] = i_coef;
}
else
{
p_mb->pf_idct[i_b] = vdec_IDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_idct;
}
return;
......@@ -1106,12 +1106,12 @@ static __inline__ void DecodeMPEG2Intra( vpar_thread_t * p_vpar,
case DCT_EOB:
if( i_nc <= 1 )
{
p_mb->pf_idct[i_b] = vdec_SparseIDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_sparse_idct;
p_mb->pi_sparse_pos[i_b] = i_coef;
}
else
{
p_mb->pf_idct[i_b] = vdec_IDCT;
p_mb->pf_idct[i_b] = p_vpar->pf_idct;
}
return;
......
......@@ -2,7 +2,7 @@
* vpar_headers.c : headers parsing
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_headers.c,v 1.67 2001/01/07 03:56:40 henri Exp $
* $Id: vpar_headers.c,v 1.68 2001/01/13 12:57:21 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Stphane Borel <stef@via.ecp.fr>
......@@ -43,8 +43,8 @@
#include "video.h"
#include "video_output.h"
#include "video_decoder.h"
#include "../video_decoder/vdec_idct.h"
#include "../video_decoder/video_decoder.h"
#include "../video_decoder/vdec_motion.h"
#include "../video_decoder/vpar_blocks.h"
......
......@@ -2,7 +2,7 @@
* vpar_synchro.c : frame dropping routines
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vpar_synchro.c,v 1.70 2001/01/10 19:48:26 sam Exp $
* $Id: vpar_synchro.c,v 1.71 2001/01/13 12:57:21 sam Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
* Samuel Hocevar <sam@via.ecp.fr>
......@@ -112,8 +112,8 @@
#include "video.h"
#include "video_output.h"
#include "video_decoder.h"
#include "../video_decoder/vdec_idct.h"
#include "../video_decoder/video_decoder.h"
#include "../video_decoder/vdec_motion.h"
#include "../video_decoder/vpar_blocks.h"
......
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