Commit 3eeccf67 authored by michael's avatar michael

xvids mmx&mmx2 idcts

needed to decode xvid without some minor artefacts
under #ifdef CONFIG_GPL of course


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@4572 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 09a23c91
...@@ -311,6 +311,9 @@ OBJS += i386/fdct_mmx.o i386/cputest.o \ ...@@ -311,6 +311,9 @@ OBJS += i386/fdct_mmx.o i386/cputest.o \
i386/idct_mmx.o i386/motion_est_mmx.o \ i386/idct_mmx.o i386/motion_est_mmx.o \
i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \ i386/simple_idct_mmx.o i386/fft_sse.o i386/vp3dsp_mmx.o \
i386/vp3dsp_sse2.o i386/vp3dsp_sse2.o
ifeq ($(CONFIG_GPL),yes)
OBJS += i386/idct_mmx_xvid.o
endif
ifdef TARGET_BUILTIN_VECTOR ifdef TARGET_BUILTIN_VECTOR
i386/fft_sse.o: CFLAGS+= -msse i386/fft_sse.o: CFLAGS+= -msse
depend: CFLAGS+= -msse depend: CFLAGS+= -msse
......
...@@ -1246,6 +1246,7 @@ typedef struct AVCodecContext { ...@@ -1246,6 +1246,7 @@ typedef struct AVCodecContext {
#define FF_IDCT_H264 11 #define FF_IDCT_H264 11
#define FF_IDCT_VP3 12 #define FF_IDCT_VP3 12
#define FF_IDCT_IPP 13 #define FF_IDCT_IPP 13
#define FF_IDCT_XVIDMMX 14
/** /**
* slice count. * slice count.
......
...@@ -29,6 +29,8 @@ ...@@ -29,6 +29,8 @@
//#include <assert.h> //#include <assert.h>
extern const uint8_t ff_h263_loop_filter_strength[32]; extern const uint8_t ff_h263_loop_filter_strength[32];
extern void ff_idct_xvid_mmx(short *block);
extern void ff_idct_xvid_mmx2(short *block);
int mm_flags; /* multimedia extension flags */ int mm_flags; /* multimedia extension flags */
...@@ -2457,6 +2459,28 @@ static void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block) ...@@ -2457,6 +2459,28 @@ static void ff_vp3_idct_add_mmx(uint8_t *dest, int line_size, DCTELEM *block)
ff_vp3_idct_mmx(block); ff_vp3_idct_mmx(block);
add_pixels_clamped_mmx(block, dest, line_size); add_pixels_clamped_mmx(block, dest, line_size);
} }
#ifdef CONFIG_GPL
static void ff_idct_xvid_mmx_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_idct_xvid_mmx (block);
put_pixels_clamped_mmx(block, dest, line_size);
}
static void ff_idct_xvid_mmx_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_idct_xvid_mmx (block);
add_pixels_clamped_mmx(block, dest, line_size);
}
static void ff_idct_xvid_mmx2_put(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_idct_xvid_mmx2 (block);
put_pixels_clamped_mmx(block, dest, line_size);
}
static void ff_idct_xvid_mmx2_add(uint8_t *dest, int line_size, DCTELEM *block)
{
ff_idct_xvid_mmx2 (block);
add_pixels_clamped_mmx(block, dest, line_size);
}
#endif
void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
{ {
...@@ -2529,8 +2553,20 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx) ...@@ -2529,8 +2553,20 @@ void dsputil_init_mmx(DSPContext* c, AVCodecContext *avctx)
c->idct = ff_vp3_idct_mmx; c->idct = ff_vp3_idct_mmx;
c->idct_permutation_type= FF_PARTTRANS_IDCT_PERM; c->idct_permutation_type= FF_PARTTRANS_IDCT_PERM;
} }
#ifdef CONFIG_GPL
}else if(idct_algo==FF_IDCT_XVIDMMX){
if(mm_flags & MM_MMXEXT){
c->idct_put= ff_idct_xvid_mmx2_put;
c->idct_add= ff_idct_xvid_mmx2_add;
c->idct = ff_idct_xvid_mmx2;
}else{
c->idct_put= ff_idct_xvid_mmx_put;
c->idct_add= ff_idct_xvid_mmx_add;
c->idct = ff_idct_xvid_mmx;
} }
} }
#endif
}
#ifdef CONFIG_ENCODERS #ifdef CONFIG_ENCODERS
c->get_pixels = get_pixels_mmx; c->get_pixels = get_pixels_mmx;
......
This diff is collapsed.
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