summaryrefslogtreecommitdiffstats
path: root/libvo
diff options
context:
space:
mode:
authornick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-11 14:42:10 +0000
committernick <nick@b3059339-0415-0410-9bf9-f77b7e298cf2>2001-11-11 14:42:10 +0000
commit7035adb0bdf3b83031576418aed3584c9c39abb1 (patch)
tree8f8266e42b2c2ef99686313d234c156a67d44a57 /libvo
parent6fde34dde88c6d840718600485a696eaa97a1d4b (diff)
downloadmpv-7035adb0bdf3b83031576418aed3584c9c39abb1.tar.bz2
mpv-7035adb0bdf3b83031576418aed3584c9c39abb1.tar.xz
Enable MMX stuff
I don't know why Michael Niedermayer disabled it but: my benchmarks of 25 frames for TIMER+SUBTITLE (measured by RDTSC): Non-MMX stuff: total=306142159 MMX stuff: total=159534150 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@2834 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libvo')
-rw-r--r--libvo/osd.c28
-rw-r--r--libvo/osd_template.c28
2 files changed, 14 insertions, 42 deletions
diff --git a/libvo/osd.c b/libvo/osd.c
index fb01444f3e..e32fc6bc03 100644
--- a/libvo/osd.c
+++ b/libvo/osd.c
@@ -7,6 +7,8 @@
#include "config.h"
#include "osd.h"
#include "../mmx_defs.h"
+//#define ENABLE_PROFILE
+#include "../my_profile.h"
void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
@@ -76,25 +78,13 @@ void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, i
return;
}
-#ifdef PROFILE_ME
-static inline unsigned long long int read_tsc( void )
-{
- unsigned long long int retval;
- __asm __volatile ("rdtsc":"=A"(retval)::"memory");
- return retval;
-}
-#endif
-
void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
-#ifdef PROFILE_ME
-unsigned long long v1,v2;
-v1 = read_tsc();
-#endif
+PROFILE_START();
for(y=0;y<h;y++){
register int x;
#ifdef ARCH_X86
-#ifdef HAVE_MMX2
+#ifdef HAVE_MMX
asm volatile(
"pxor %%mm7, %%mm7 \n\t"
"xorl %%eax, %%eax \n\t"
@@ -121,7 +111,7 @@ v1 = read_tsc();
"punpcklbw %%mm2, %%mm2 \n\t" // src AABBCCDD
"punpcklbw %%mm2, %%mm2 \n\t" // src AAAABBBB
"paddb %%mm2, %%mm0 \n\t"
- MOVNTQ" %%mm0, (%0, %%eax, 4) \n\t"
+ "movq %%mm0, (%0, %%eax, 4) \n\t"
"addl $2, %%eax \n\t"
"cmpl %3, %%eax \n\t"
" jb 1b \n\t"
@@ -175,14 +165,10 @@ v1 = read_tsc();
srca+=srcstride;
dstbase+=dststride;
}
-#ifdef HAVE_MMX2
- asm volatile(SFENCE:::"memory");
+#ifdef HAVE_MMX
asm volatile(EMMS:::"memory");
#endif
-#ifdef PROFILE_ME
-v2 = read_tsc();
-printf("rd_tsc: %llu\n\t",v2-v1);
-#endif
+PROFILE_END("vo_draw_alpha_rgb32");
return;
}
diff --git a/libvo/osd_template.c b/libvo/osd_template.c
index fb01444f3e..e32fc6bc03 100644
--- a/libvo/osd_template.c
+++ b/libvo/osd_template.c
@@ -7,6 +7,8 @@
#include "config.h"
#include "osd.h"
#include "../mmx_defs.h"
+//#define ENABLE_PROFILE
+#include "../my_profile.h"
void vo_draw_alpha_yv12(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
@@ -76,25 +78,13 @@ void vo_draw_alpha_rgb24(int w,int h, unsigned char* src, unsigned char *srca, i
return;
}
-#ifdef PROFILE_ME
-static inline unsigned long long int read_tsc( void )
-{
- unsigned long long int retval;
- __asm __volatile ("rdtsc":"=A"(retval)::"memory");
- return retval;
-}
-#endif
-
void vo_draw_alpha_rgb32(int w,int h, unsigned char* src, unsigned char *srca, int srcstride, unsigned char* dstbase,int dststride){
int y;
-#ifdef PROFILE_ME
-unsigned long long v1,v2;
-v1 = read_tsc();
-#endif
+PROFILE_START();
for(y=0;y<h;y++){
register int x;
#ifdef ARCH_X86
-#ifdef HAVE_MMX2
+#ifdef HAVE_MMX
asm volatile(
"pxor %%mm7, %%mm7 \n\t"
"xorl %%eax, %%eax \n\t"
@@ -121,7 +111,7 @@ v1 = read_tsc();
"punpcklbw %%mm2, %%mm2 \n\t" // src AABBCCDD
"punpcklbw %%mm2, %%mm2 \n\t" // src AAAABBBB
"paddb %%mm2, %%mm0 \n\t"
- MOVNTQ" %%mm0, (%0, %%eax, 4) \n\t"
+ "movq %%mm0, (%0, %%eax, 4) \n\t"
"addl $2, %%eax \n\t"
"cmpl %3, %%eax \n\t"
" jb 1b \n\t"
@@ -175,14 +165,10 @@ v1 = read_tsc();
srca+=srcstride;
dstbase+=dststride;
}
-#ifdef HAVE_MMX2
- asm volatile(SFENCE:::"memory");
+#ifdef HAVE_MMX
asm volatile(EMMS:::"memory");
#endif
-#ifdef PROFILE_ME
-v2 = read_tsc();
-printf("rd_tsc: %llu\n\t",v2-v1);
-#endif
+PROFILE_END("vo_draw_alpha_rgb32");
return;
}