Commit b3b88076 authored by Christophe Massiot's avatar Christophe Massiot

* Altivec IDCT and motion compensation, based on Paul Mackerras's mpeg2dec

(untested !) ;
* Local minor optimizations in IDCT ;
* Removed a hopeless kludge in input_clock.c
parent 76c5e75c
......@@ -175,6 +175,10 @@ D: AC3 decoder
D: MPEG audio decoder
D: MPEG video decoder
N: Paul Mackerras
E: paulus@linuxcare.com.au
D: Altivec IDCT and motion
N: Wade Majors
E: guru@startrek.com
D: BeOS testing, icon integration, debugging and fixes
......
......@@ -74,7 +74,7 @@ LIB_GGI = @LIB_GGI@
LIB_GLIDE = @LIB_GLIDE@
LIB_GNOME = @LIB_GNOME@
LIB_GTK = @LIB_GTK@
LIB_IDCTALTIVEC = @LIB_IDCTALTIVEC@
LIB_ALTIVEC = @LIB_ALTIVEC@
LIB_LIBDVDCSS = @LIB_LIBDVDCSS@
LIB_KDE = @LIB_KDE@
LIB_MACOSX = @LIB_MACOSX@
......
This diff is collapsed.
......@@ -239,6 +239,11 @@ AC_TRY_COMPILE([void quux(){void *p;asm("xorps %%xmm1,%%xmm2"::"r"(p));}],,
ACCEL_MODULES="${ACCEL_MODULES} ${SSE_MODULES}"
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
AC_MSG_CHECKING([if \$CC groks Altivec inline assembly])
AC_TRY_COMPILE([void quux(){void *p;asm("mtspr 256,%0"::"r"(-1));}],,
ACCEL_MODULES="${ACCEL_MODULES} ${ALTIVEC_MODULES}"
AC_MSG_RESULT(yes), AC_MSG_RESULT(no))
dnl
dnl libdvdcss: check for DVD ioctls
dnl
......@@ -354,20 +359,19 @@ dnl
AC_ARG_ENABLE(mmx,
[ --disable-mmx Disable MMX optimizations (default enabled for x86)],
[ if test x$enableval = xyes; then ARCH="${ARCH} mmx";
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
[ if test x${host_cpu} = xi686 -o x${host_cpu} = xi586 -o x${host_cpu} = xx86 -o x${host_cpu} = xi386; then ARCH="${ARCH} mmx";
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
dnl
dnl AltiVec acceleration
dnl
AC_ARG_ENABLE(altivec,
[ --enable-altivec Enable altivec optimizations (default disabled since it is broken)],
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec"
BUILTINS="${BUILTINS} idctaltivec"
LIB_IDCTALTIVEC="-framework vecLib"
fi ])
#[ if test -d /System/Library/Frameworks/vecLib.framework; then ARCH="${ARCH} altivec"; PLUGINS="${PLUGINS} idctaltivec"; fi ])
[ --disable-altivec Disable altivec optimizations (default enabled on PPC)],
[ if test x$enableval = xyes; then ARCH="${ARCH} altivec";
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ],
[ if test x${host_cpu} = xpowerpc; then ARCH="${ARCH} altivec";
BUILTINS="${BUILTINS} ${ACCEL_MODULES}"; fi ])
dnl
dnl Debugging mode
......@@ -394,7 +398,7 @@ AC_ARG_ENABLE(trace,
[ if test x$enableval = xyes; then TRACE=1; fi ])
dnl
dnl Trace mode
dnl Profiling
dnl
GPROF=0
AC_ARG_ENABLE(gprof,
......@@ -601,12 +605,14 @@ AC_ARG_ENABLE(macosx,
LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
LIB_ALTIVEC="-framework vecLib"
fi],
[AC_CHECK_HEADERS(Carbon/Carbon.h,
BUILTINS="${BUILTINS} macosx"
LIB_MACOSX="-framework CoreAudio -framework Carbon -framework AGL"
LIB_TS="${LIB_TS} -framework AGL -framework Carbon"
LIB_SDL="${LIB_SDL} -framework AGL -framework Carbon"
LIB_ALTIVEC="-framework vecLib"
)])
dnl
......@@ -921,7 +927,7 @@ AC_SUBST(LIB_GGI)
AC_SUBST(LIB_GLIDE)
AC_SUBST(LIB_GNOME)
AC_SUBST(LIB_GTK)
AC_SUBST(LIB_IDCTALTIVEC)
AC_SUBST(LIB_ALTIVEC)
AC_SUBST(LIB_LIBDVDCSS)
AC_SUBST(LIB_KDE)
AC_SUBST(LIB_MACOSX)
......
......@@ -4,7 +4,7 @@
* control the pace of reading.
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: input_ext-intf.h,v 1.41 2001/07/18 14:21:00 massiot Exp $
* $Id: input_ext-intf.h,v 1.42 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -125,7 +125,6 @@ typedef struct pgrm_descriptor_s
mtime_t cr_ref, sysdate_ref;
mtime_t last_cr; /* reference to detect unexpected stream
* discontinuities */
mtime_t last_syscr;
count_t c_average_count;
/* counter used to compute dynamic average values */
int i_synchro_state;
......
......@@ -2,7 +2,7 @@
* modules.h : Module management functions.
*****************************************************************************
* Copyright (C) 2001 VideoLAN
* $Id: modules.h,v 1.28 2001/08/22 17:21:45 massiot Exp $
* $Id: modules.h,v 1.29 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Samuel Hocevar <sam@zoy.org>
*
......@@ -170,13 +170,15 @@ typedef struct function_list_s
struct
{
void ( * pf_idct_init ) ( void ** );
void ( * pf_sparse_idct ) ( void *, dctelem_t *, int );
void ( * pf_idct ) ( void *, dctelem_t *, int );
void ( * pf_sparse_idct_add )( dctelem_t *, yuv_data_t *, int,
void *, int );
void ( * pf_idct_add ) ( dctelem_t *, yuv_data_t *, int,
void *, int );
void ( * pf_sparse_idct_copy )( dctelem_t *, yuv_data_t *, int,
void *, int );
void ( * pf_idct_copy ) ( dctelem_t *, yuv_data_t *, int,
void *, int );
void ( * pf_norm_scan ) ( u8 ppi_scan[2][64] );
void ( * pf_decode_init ) ( );
void ( * pf_addblock ) ( dctelem_t *, yuv_data_t *, int );
void ( * pf_copyblock ) ( dctelem_t *, yuv_data_t *, int );
} idct;
/* YUV transformation plugin */
......
......@@ -2,7 +2,7 @@
* vdec_ext-plugins.h : structures from the video decoder exported to plug-ins
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_ext-plugins.h,v 1.3 2001/08/22 17:21:45 massiot Exp $
* $Id: vdec_ext-plugins.h,v 1.4 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -28,8 +28,9 @@
typedef struct idct_inner_s
{
dctelem_t pi_block[64]; /* block */
void ( * pf_idct ) ( void *, dctelem_t*, int );
/* sparse IDCT or not ? */
void ( * pf_idct ) ( dctelem_t *, yuv_data_t *, int,
void *, int );
/* sparse IDCT or not, add or copy ? */
int i_sparse_pos; /* position of the
* non-NULL coeff */
yuv_data_t * p_dct_data; /* pointer to the position
......
......@@ -12,27 +12,14 @@ PLUGIN_IDCTCLASSIC = idctclassic.o
PLUGIN_IDCTMMX = idctmmx.o
PLUGIN_IDCTMMXEXT = idctmmxext.o
PLUGIN_IDCTALTIVEC = idctaltivec.o
PLUGIN_IDCTCOMMON = vdec_idct.o
PLUGIN_VDECBLOCK_C = vdec_block_c.o
PLUGIN_VDECBLOCK_MMX = vdec_block_mmx.o
BUILTIN_IDCT = $(PLUGIN_IDCT:%.o=BUILTIN_IDCT_%.o) \
$(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCT_%.o) \
$(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCT_%.o)
BUILTIN_IDCTCLASSIC = $(PLUGIN_IDCTCLASSIC:%.o=BUILTIN_IDCTCLASSIC_%.o) \
$(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTCLASSIC_%.o) \
$(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCTCLASSIC_%.o)
BUILTIN_IDCTMMX = $(PLUGIN_IDCTMMX:%.o=BUILTIN_IDCTMMX_%.o) \
$(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMX_%.o) \
$(PLUGIN_VDECBLOCK_MMX:%.o=BUILTIN_IDCTMMX_%.o)
BUILTIN_IDCTMMXEXT = $(PLUGIN_IDCTMMXEXT:%.o=BUILTIN_IDCTMMXEXT_%.o) \
$(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTMMXEXT_%.o) \
$(PLUGIN_VDECBLOCK_MMX:%.o=BUILTIN_IDCTMMXEXT_%.o)
BUILTIN_IDCTALTIVEC = $(PLUGIN_IDCTALTIVEC:%.o=BUILTIN_IDCTALTIVEC_%.o) \
$(PLUGIN_IDCTCOMMON:%.o=BUILTIN_IDCTALTIVEC_%.o) \
$(PLUGIN_VDECBLOCK_C:%.o=BUILTIN_IDCTALTIVEC_%.o)
PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C) $(PLUGIN_VDECBLOCK_MMX)
BUILTIN_IDCT = $(PLUGIN_IDCT:%.o=BUILTIN_IDCT_%.o)
BUILTIN_IDCTCLASSIC = $(PLUGIN_IDCTCLASSIC:%.o=BUILTIN_IDCTCLASSIC_%.o)
BUILTIN_IDCTMMX = $(PLUGIN_IDCTMMX:%.o=BUILTIN_IDCTMMX_%.o)
BUILTIN_IDCTMMXEXT = $(PLUGIN_IDCTMMXEXT:%.o=BUILTIN_IDCTMMXEXT_%.o)
BUILTIN_IDCTALTIVEC = $(PLUGIN_IDCTALTIVEC:%.o=BUILTIN_IDCTALTIVEC_%.o)
PLUGIN_C = $(PLUGIN_IDCT) $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTMMXEXT)
ALL_OBJ = $(PLUGIN_C) $(PLUGIN_IDCTALTIVEC) $(BUILTIN_IDCT) $(BUILTIN_IDCTCLASSIC) $(BUILTIN_IDCTMMX) $(BUILTIN_IDCTMMXEXT) $(BUILTIN_IDCTALTIVEC)
#
......@@ -69,36 +56,36 @@ $(BUILTIN_IDCTALTIVEC): BUILTIN_IDCTALTIVEC_%.o: %.c
# Real targets
#
../idct.so: $(PLUGIN_IDCT) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C)
../idct.so: $(PLUGIN_IDCT)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../idct.a: $(BUILTIN_IDCT)
ar r $@ $^
$(RANLIB) $@
../idctclassic.so: $(PLUGIN_IDCTCLASSIC) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C)
../idctclassic.so: $(PLUGIN_IDCTCLASSIC)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../idctclassic.a: $(BUILTIN_IDCTCLASSIC)
ar r $@ $^
$(RANLIB) $@
../idctmmx.so: $(PLUGIN_IDCTMMX) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_MMX)
../idctmmx.so: $(PLUGIN_IDCTMMX)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../idctmmx.a: $(BUILTIN_IDCTMMX)
ar r $@ $^
$(RANLIB) $@
../idctmmxext.so: $(PLUGIN_IDCTMMXEXT) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_MMX)
../idctmmxext.so: $(PLUGIN_IDCTMMXEXT)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS)
../idctmmxext.a: $(BUILTIN_IDCTMMXEXT)
ar r $@ $^
$(RANLIB) $@
../idctaltivec.so: $(PLUGIN_IDCTALTIVEC) $(PLUGIN_IDCTCOMMON) $(PLUGIN_VDECBLOCK_C)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_IDCTALTIVEC)
../idctaltivec.so: $(PLUGIN_IDCTALTIVEC)
$(CC) $(PCFLAGS) -o $@ $^ $(PLCFLAGS) $(LIB_ALTIVEC)
../idctaltivec.a: $(BUILTIN_IDCTALTIVEC)
ar r $@ $^
......
/*****************************************************************************
* vdec_block_c.c: Macroblock copy functions in C
* block_c.h: Macroblock copy functions in C
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: vdec_block_c.c,v 1.6 2001/08/22 17:21:45 massiot Exp $
* $Id: block_c.h,v 1.1 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Christophe Massiot <massiot@via.ecp.fr>
*
......@@ -21,32 +21,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/* MODULE_NAME defined in Makefile together with -DBUILTIN */
#ifdef BUILTIN
# include "modules_inner.h"
#else
# define _M( foo ) foo
#endif
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "intf_msg.h"
#include "vdec_idct.h"
#include "modules.h"
#include "modules_export.h"
/*****************************************************************************
* Static variables
*****************************************************************************
......@@ -56,9 +30,9 @@ static u8 pi_crop_buf[VDEC_CROPRANGE];
static u8 *pi_crop;
/*****************************************************************************
* vdec_InitDecode: initialize video decoder thread
* InitBlock: initialize the crop table
*****************************************************************************/
void _M( vdec_InitDecode ) ( )
static void InitBlock ( )
{
int i_dummy;
......@@ -82,10 +56,10 @@ void _M( vdec_InitDecode ) ( )
}
/*****************************************************************************
* vdec_AddBlock : add a block
* AddBlock: add a block
*****************************************************************************/
void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
static __inline__ void AddBlock( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
{
int i = 8;
......@@ -105,10 +79,10 @@ void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
}
/*****************************************************************************
* vdec_CopyBlock : copy a block
* CopyBlock: copy a block
*****************************************************************************/
void _M( vdec_CopyBlock )( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
static __inline__ void CopyBlock( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
{
int i = 8;
......
/*****************************************************************************
* vdec_block_mmx.c: Macroblock copy functions in MMX assembly
* block_mmx.h: Macroblock copy functions in MMX assembly
*****************************************************************************
* Copyright (C) 1999, 2000, 2001 VideoLAN
* $Id: vdec_block_mmx.c,v 1.6 2001/08/22 17:21:45 massiot Exp $
* $Id: block_mmx.h,v 1.1 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Michel Lespinasse <walken@zoy.org>
* Aaron Holtzman <aholtzma@ess.engr.uvic.ca>
......@@ -22,49 +22,16 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/* MODULE_NAME defined in Makefile together with -DBUILTIN */
#ifdef BUILTIN
# include "modules_inner.h"
#else
# define _M( foo ) foo
#endif
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <string.h>
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "intf_msg.h"
#include "input_ext-dec.h"
#include "video.h"
#include "video_output.h"
#include "vdec_idct.h"
#include "modules.h"
#include "modules_export.h"
#include "mmx.h"
/*****************************************************************************
* vdec_InitDecode: initialize video decoder thread
* InitBlock: placeholder because we don't need a crop table, MMX does it for us
*****************************************************************************/
void _M( vdec_InitDecode ) ( )
static __inline__ void InitBlock( )
{
;
}
/*****************************************************************************
* vdec_AddBlock : add a block
* AddBlock: add a block
*****************************************************************************/
#define ADD_MMX(offset,r1,r2,r3,r4) \
movq_m2r (*(p_data+2*i_incr), r1); \
......@@ -77,8 +44,8 @@ void _M( vdec_InitDecode ) ( )
punpckhbw_r2r (mm0, r2); \
paddsw_m2r (*(p_block+offset+4), r2);
void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
static __inline__ void AddBlock( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
{
movq_m2r (*p_data, mm1);
pxor_r2r (mm0, mm0);
......@@ -106,7 +73,7 @@ void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
}
/*****************************************************************************
* vdec_CopyBlock : copy a block
* CopyBlock: copy a block
*****************************************************************************/
#define COPY_MMX(offset,r0,r1,r2) \
movq_m2r (*(p_block+offset), r0); \
......@@ -115,8 +82,8 @@ void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
movq_r2m (r2, *p_data); \
packuswb_r2r (r1, r0);
void _M( vdec_CopyBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
static __inline__ void CopyBlock( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr )
{
movq_m2r (*(p_block+0*8), mm0);
movq_m2r (*(p_block+0*8+4), mm1);
......
/*****************************************************************************
* idct.c : IDCT module
* idct.c : C IDCT module
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idct.c,v 1.14 2001/08/22 17:21:45 massiot Exp $
* $Id: idct.c,v 1.15 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Gal Hendryckx <jimmy@via.ecp.fr>
* Author: 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
......@@ -37,7 +37,8 @@
#include "mtime.h"
#include "tests.h"
#include "vdec_idct.h"
#include "idct.h"
#include "block_c.h"
#include "modules.h"
#include "modules_export.h"
......@@ -46,8 +47,6 @@
* Local and extern prototypes.
*****************************************************************************/
static void idct_getfunctions( function_list_t * p_function_list );
static int idct_Probe ( probedata_t *p_data );
static void vdec_NormScan ( u8 ppi_scan[2][64] );
/*****************************************************************************
* Build configuration tree.
......@@ -72,24 +71,6 @@ MODULE_DEACTIVATE_STOP
/* 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;
#define F p_function_list->functions.idct
F.pf_idct_init = _M( vdec_InitIDCT );
F.pf_sparse_idct = _M( vdec_SparseIDCT );
F.pf_idct = _M( vdec_IDCT );
F.pf_norm_scan = vdec_NormScan;
F.pf_decode_init = _M( vdec_InitDecode );
F.pf_addblock = _M( vdec_AddBlock );
F.pf_copyblock = _M( vdec_CopyBlock );
#undef F
}
/*****************************************************************************
* idct_Probe: returns a preference score
*****************************************************************************/
......@@ -106,17 +87,16 @@ static int idct_Probe( probedata_t *p_data )
}
/*****************************************************************************
* vdec_NormScan : Unused in this IDCT
* NormScan : Unused in this IDCT
*****************************************************************************/
static void vdec_NormScan( u8 ppi_scan[2][64] )
static void NormScan( u8 ppi_scan[2][64] )
{
}
/*****************************************************************************
* vdec_IDCT : IDCT function for normal matrices
* IDCT : IDCT function for normal matrices
*****************************************************************************/
void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block,
int i_idontcare )
static __inline__ void IDCT( dctelem_t * p_block )
{
s32 tmp0, tmp1, tmp2, tmp3;
s32 tmp10, tmp11, tmp12, tmp13;
......@@ -1294,3 +1274,5 @@ void _M( vdec_IDCT )( void * p_unused_data, dctelem_t * p_block,
}
}
#include "idct_sparse.h"
#include "idct_decl.h"
/*****************************************************************************
* vdec_idct.h : macros 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.3 2001/08/22 17:21:45 massiot Exp $
* $Id: idct.h,v 1.5 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Gaël Hendryckx <jimmy@via.ecp.fr>
* Christophe Massiot <massiot@via.ecp.fr>
......@@ -140,14 +140,3 @@
#define MULTIPLY(var,const) ((var) * (const))
#endif
/*****************************************************************************
* Protoypes
*****************************************************************************/
void _M( vdec_SparseIDCT ) ( void *, dctelem_t * p_block, int i_sparse_pos );
void _M( vdec_InitIDCT ) ( void ** );
void _M( vdec_IDCT ) ( void *, dctelem_t * p_block, int i_idontcare );
void _M( vdec_InitDecode ) ( );
void _M( vdec_AddBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr );
void _M( vdec_CopyBlock ) ( dctelem_t * p_block, yuv_data_t * p_data,
int i_incr );
/*****************************************************************************
* idct_decl.h : common declarations, must be included at the very end
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: idct_decl.h,v 1.1 2001/09/05 16:07:49 massiot Exp $
*
* Author: Christophe Massiot <massiot@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.
*****************************************************************************/
/*****************************************************************************
* Final declarations
*****************************************************************************/
static void IDCTCopy( dctelem_t * p_block, yuv_data_t * p_dest,
int i_stride, void * p_unused, int i_unused )
{
IDCT( p_block );
CopyBlock( p_block, p_dest, i_stride );
}
static void IDCTAdd( dctelem_t * p_block, yuv_data_t * p_dest,
int i_stride, void * p_unused, int i_unused )
{
IDCT( p_block );
AddBlock( p_block, p_dest, i_stride );
}
/*****************************************************************************
* 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;
#define F p_function_list->functions.idct
F.pf_idct_init = InitIDCT;
F.pf_norm_scan = NormScan;
F.pf_sparse_idct_add = SparseIDCTAdd;
F.pf_sparse_idct_copy = SparseIDCTCopy;
F.pf_idct_add = IDCTAdd;
F.pf_idct_copy = IDCTCopy;
#undef F
}
/*****************************************************************************
* vdec_idct.c : common IDCT functions
* idct_sparse.h : Sparse IDCT functions (must be include at the end)
*****************************************************************************
* Copyright (C) 1999, 2000 VideoLAN
* $Id: vdec_idct.c,v 1.4 2001/08/22 17:21:45 massiot Exp $
* $Id: idct_sparse.h,v 1.1 2001/09/05 16:07:49 massiot Exp $
*
* Authors: Gal Hendryckx <jimmy@via.ecp.fr>
* Author: 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
......@@ -21,37 +21,10 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
*****************************************************************************/
/* MODULE_NAME defined in Makefile together with -DBUILTIN */
#ifdef BUILTIN
# include "modules_inner.h"
#else
# define _M( foo ) foo
#endif
/*****************************************************************************
* Preamble
*****************************************************************************/
#include "defs.h"
#include <stdlib.h> /* malloc() */
#include <string.h> /* memcpy(), memset() */
#include "config.h"
#include "common.h"
#include "threads.h"
#include "mtime.h"
#include "video.h"
#include "video_output.h"
#include "modules.h"
#include "vdec_idct.h"
/*****************************************************************************
* vdec_InitIDCT : initialize datas for vdec_SparseIDCT
* InitIDCT : initialize data for SparseIDCT
*****************************************************************************/
void _M( vdec_InitIDCT ) ( void ** pp_idct_data )
static void InitIDCT ( void ** pp_idct_data )
{
int i;
dctelem_t * p_pre;
......@@ -63,16 +36,17 @@ void _M( vdec_InitIDCT ) ( void ** pp_idct_data )
for( i = 0 ; i < 64 ; i++ )
{
p_pre[i*64+i] = 1 << SPARSE_SCALE_FACTOR;
_M( vdec_IDCT )( NULL, &p_pre[i*64], 0) ;
IDCT( &p_pre[i*64] ) ;
}
return;
InitBlock();
}
/*****************************************************************************
* vdec_SparseIDCT : IDCT function for sparse matrices
* SparseIDCT : IDCT function for sparse matrices
*****************************************************************************/
void _M( vdec_SparseIDCT ) ( void * p_idct_data,
dctelem_t * p_block, int i_sparse_pos )
static __inline__ void SparseIDCT( dctelem_t * p_block, void * p_idct_data,
int i_sparse_pos )
{
short int val;
int * dp;
......@@ -124,6 +98,21 @@ void _M( vdec_SparseIDCT ) ( void * p_idct_data,
p_dest += 16;
p_source += 16;
}
return;
}
/*****************************************************************************
* Final declarations
*****************************************************************************/
static void SparseIDCTCopy( dctelem_t * p_block, yuv_data_t * p_dest,
int i_stride, void * p_idct_data, int i_sparse_pos )
{
SparseIDCT( p_block, p_idct_data, i_sparse_pos );
CopyBlock( p_block, p_dest, i_stride );
}
static void SparseIDCTAdd( dctelem_t * p_block, yuv_data_t * p_dest,
int i_stride, void * p_idct_data, int i_sparse_pos )
{
SparseIDCT( p_block, p_idct_data, i_sparse_pos );
AddBlock( p_block, p_dest, i_stride );
}
#*****************************************************************************
# idctaltivec.S : Altivec IDCT code
#*****************************************************************************
# Copyright (C) 1999, 2001 VideoLAN
# $Id: idctaltivec.S,v 1.1 2001/09/05 16:07:49 massiot Exp $
#
# Author: Paul Mackerras <paulus@linuxcare.com>
#
# 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