Commit 07f2392f authored by Gaël Hendryckx's avatar Gaël Hendryckx

* Activation des Sparses idct dans le video parser;
* Utilisation de la mmx pour la dct si l'architechture s'y pr�te
  (modif de Makefile et vdec_idct)
* idctmmx.S avec une forme d'appel identique a vdec_idct a ete ajoute a
  video_decoder.
parent bb7b9933
......@@ -14,9 +14,9 @@
#SHELL = /bin/sh
# Video output settings
#VIDEO=X11
VIDEO=X11
#VIDEO=DGA (not yet supported)
VIDEO=FB
#VIDEO=FB
#VIDEO=GGI
#VIDEO=BEOS (not yet supported)
......@@ -27,8 +27,8 @@ ARCH=MMX
#ARCH=SPARC
# Decoder choice - ?? old decoder will be removed soon
DECODER=old
#DECODER=new
#DECODER=old
DECODER=new
# !!! don't forget to run this command after changing decoder type !!!
# touch input/input.c input/input_ctrl.c include/vlc.h include/video_decoder.h
......@@ -232,8 +232,14 @@ misc_obj = misc/mtime.o \
misc/netutils.o
ifeq ($(ARCH),MMX)
ifeq ($(DECODER),old)
ASM_OBJ = video_decoder_ref/idctmmx.o \
video_output/video_yuv_mmx.o
else
ASM_OBJ = video_decoder/idctmmx.o \
video_output/video_yuv_mmx.o
endif
endif
C_OBJ = $(interface_obj) \
......
This diff is collapsed.
......@@ -44,8 +44,6 @@
* Local prototypes
*/
//extern IDCT_mmx(dctelem_t*);
/* Our current implementation is a fast DCT, we might move to a fast DFT or
* an MMX DCT in the future. */
......@@ -80,7 +78,6 @@ void vdec_InitIDCT (vdec_thread_t * p_vdec)
void vdec_SparseIDCT (vdec_thread_t * p_vdec, dctelem_t * p_block,
int i_sparse_pos)
{
/*debug*/
short int val;
int * dp;
int v;
......@@ -92,20 +89,7 @@ void vdec_SparseIDCT (vdec_thread_t * p_vdec, dctelem_t * p_block,
if ( i_sparse_pos == 0 )
{
dp=(int *)p_block;
// v=*p_block;
/* cuisine a verifier */
/* if (v < 0)
{
val=-v;
val+=4;
val/=8;
val=-val;
}
else
{*/
/* val= (v + 4) /8; */
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;
......@@ -150,9 +134,10 @@ void vdec_SparseIDCT (vdec_thread_t * p_vdec, dctelem_t * p_block,
/*****************************************************************************
* vdec_IDCT : IDCT function for normal matrices
*****************************************************************************/
#ifndef HAVE_MMX
void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block, int i_idontcare )
{
//IDCT_mmx(p_block);
#if 0
/* dct classique: pour tester la meilleure entre la classique et la */
/* no classique */
......@@ -372,7 +357,7 @@ void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block, int i_idontcare )
}
#endif
#if 1 /*dct avec no classique*/
#if 1 /*dct avec non classique*/
s32 tmp0, tmp1, tmp2, tmp3;
s32 tmp10, tmp11, tmp12, tmp13;
......@@ -389,6 +374,7 @@ void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block, int i_idontcare )
dataptr = p_block;
fprintf( stderr, "normal dct" );
for (rowctr = DCTSIZE-1; rowctr >= 0; rowctr--)
{
/* Due to quantization, we will usually find that many of the input
......@@ -1550,3 +1536,4 @@ void vdec_IDCT( vdec_thread_t * p_vdec, dctelem_t * p_block, int i_idontcare )
}
#endif
}
#endif
......@@ -51,6 +51,8 @@ sixbitu: .quad 0xc0c0c0c0c0c0c0c0
#define LocalFrameSize 156
#define RegisterStorageSize 16
//#define DOUBLE /*double le nombre de colonnes */
/* Arguments: */
#define YPlane LocalFrameSize + RegisterStorageSize + 4
#define UPlane LocalFrameSize + RegisterStorageSize + 8
......@@ -476,11 +478,29 @@ do_next_8x2_block:
por %mm1,%mm2 /* mm2: low RBG16 */
psllw GLeftShift(%esp),%mm3 /* shift high G 5 positions */
por %mm3,%mm7 /* mm7: high RBG16 */
#ifdef DOUBLE
movq %mm2,%mm1
movq %mm7,%mm5
movq %mm2,%mm0
movq %mm7,%mm3
punpckhwd %mm2,%mm1
punpckhwd %mm7,%mm5
punpcklwd %mm2,%mm0
punpcklwd %mm7,%mm3
movq %mm0,(%edi,%eax,)
movq %mm1,8(%edi,%eax,)
movq %mm3,16(%edi,%eax,)
movq %mm5,24(%edi,%eax,)
addl $32,%edi
addl $4,%ebx
#endif
#ifndef DOUBLE
movq %mm2,(%edi,%eax,)
movq %mm7,8(%edi,%eax,) /* aligned */
addl $16,%edi /* ih take 16 bytes (8 pixels-16 bit) */
addl $4,%ebx /* ? to take 4 pixels together
instead of 2 */
#endif
jl do_next_8x2_block
addl CCOSkipDistance(%esp),%edi /* go to begin of next line */
......
......@@ -1244,9 +1244,9 @@ static void vpar_DecodeMPEG2Non( vpar_thread_t * p_vpar, macroblock_t * p_mb, in
: i_level;
break;
case DCT_EOB:
if( i_nc <= 0 )
if( i_nc <= 1 )
{
p_mb->pf_idct[i_b] = vdec_IDCT;//vdec_SparseIDCT;
p_mb->pf_idct[i_b] = vdec_SparseIDCT;
p_mb->pi_sparse_pos[i_b] = i_coef;
}
else
......@@ -1479,7 +1479,7 @@ static void vpar_DecodeMPEG2Intra( vpar_thread_t * p_vpar, macroblock_t * p_mb,
case DCT_EOB:
if( i_nc <= 1 )
{
p_mb->pf_idct[i_b] = vdec_IDCT;//vdec_SparseIDCT;
p_mb->pf_idct[i_b] = vdec_SparseIDCT;
p_mb->pi_sparse_pos[i_b] = i_coef;
}
else
......
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