Commit e2f11afe authored by lorenm's avatar lorenm

sse2 & ssse3 versions of dct_quantize.

core2: mmx2=154 sse2=73 ssse3=66 (cycles)
k8: mmx2=179 sse2=149
p4: mmx2=284 sse2=194


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@9003 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 60a070a3
...@@ -673,6 +673,12 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ ...@@ -673,6 +673,12 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){
); );
} }
#ifdef HAVE_SSSE3
#define HAVE_SSSE3_BAK
#endif
#undef HAVE_SSSE3
#undef HAVE_SSE2
#undef HAVE_MMX2 #undef HAVE_MMX2
#define RENAME(a) a ## _MMX #define RENAME(a) a ## _MMX
#define RENAMEl(a) a ## _mmx #define RENAMEl(a) a ## _mmx
...@@ -685,12 +691,22 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){ ...@@ -685,12 +691,22 @@ static void denoise_dct_sse2(MpegEncContext *s, DCTELEM *block){
#define RENAMEl(a) a ## _mmx2 #define RENAMEl(a) a ## _mmx2
#include "mpegvideo_mmx_template.c" #include "mpegvideo_mmx_template.c"
#define HAVE_SSE2
#undef RENAME #undef RENAME
#undef RENAMEl #undef RENAMEl
#define RENAME(a) a ## _SSE2 #define RENAME(a) a ## _SSE2
#define RENAMEl(a) a ## _sse2 #define RENAMEl(a) a ## _sse2
#include "mpegvideo_mmx_template.c" #include "mpegvideo_mmx_template.c"
#ifdef HAVE_SSSE3_BAK
#define HAVE_SSSE3
#undef RENAME
#undef RENAMEl
#define RENAME(a) a ## _SSSE3
#define RENAMEl(a) a ## _sse2
#include "mpegvideo_mmx_template.c"
#endif
void MPV_common_init_mmx(MpegEncContext *s) void MPV_common_init_mmx(MpegEncContext *s)
{ {
if (mm_flags & MM_MMX) { if (mm_flags & MM_MMX) {
...@@ -713,6 +729,11 @@ void MPV_common_init_mmx(MpegEncContext *s) ...@@ -713,6 +729,11 @@ void MPV_common_init_mmx(MpegEncContext *s)
} }
if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){ if(dct_algo==FF_DCT_AUTO || dct_algo==FF_DCT_MMX){
#ifdef HAVE_SSSE3
if(mm_flags & MM_SSSE3){
s->dct_quantize= dct_quantize_SSSE3;
} else
#endif
if(mm_flags & MM_SSE2){ if(mm_flags & MM_SSE2){
s->dct_quantize= dct_quantize_SSE2; s->dct_quantize= dct_quantize_SSE2;
} else if(mm_flags & MM_MMXEXT){ } else if(mm_flags & MM_MMXEXT){
......
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