[Mplayer-cvslog] CVS: main/postproc postprocess.c,1.65,1.66 postprocess.h,1.25,1.26
Michael Niedermayer
michael at mplayerhq.hu
Wed Oct 30 02:51:16 CET 2002
Update of /cvsroot/mplayer/main/postproc
In directory mail:/var/tmp.root/cvs-serv25778/postproc
Modified Files:
postprocess.c postprocess.h
Log Message:
cleanly passing the cpuCaps
Index: postprocess.c
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/postprocess.c,v
retrieving revision 1.65
retrieving revision 1.66
diff -u -r1.65 -r1.66
--- postprocess.c 29 Oct 2002 23:36:37 -0000 1.65
+++ postprocess.c 30 Oct 2002 01:50:58 -0000 1.66
@@ -77,7 +77,6 @@
//#define DEBUG_BRIGHTNESS
#include "../libvo/fastmemcpy.h"
#include "postprocess.h"
-#include "../cpudetect.h"
#include "../mangle.h"
#define MIN(a,b) ((a) > (b) ? (b) : (a))
@@ -105,6 +104,8 @@
static const int deringThreshold= 20;
+static int cpuCaps=0;
+
struct PPFilter{
char *shortName;
char *longName;
@@ -189,15 +190,6 @@
}
#endif
-static inline long long rdtsc()
-{
- long long l;
- asm volatile( "rdtsc\n\t"
- : "=A" (l)
- );
-// printf("%d\n", int(l/1000));
- return l;
-}
#ifdef ARCH_X86
static inline void prefetchnta(void *p)
@@ -229,6 +221,12 @@
}
#endif
+int pp_init(int caps){
+ cpuCaps= caps;
+
+ return 0;
+}
+
// The horizontal Functions exist only in C cuz the MMX code is faster with vertical filters and transposing
/**
@@ -508,11 +506,11 @@
#ifdef RUNTIME_CPUDETECT
#ifdef ARCH_X86
// ordered per speed fasterst first
- if(gCpuCaps.hasMMX2)
+ if(cpuCaps & PP_CPU_CAPS_MMX2)
postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
- else if(gCpuCaps.has3DNow)
+ else if(cpuCaps & PP_CPU_CAPS_3DNOW)
postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
- else if(gCpuCaps.hasMMX)
+ else if(cpuCaps & PP_CPU_CAPS_MMX)
postProcess_MMX(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
else
postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
Index: postprocess.h
===================================================================
RCS file: /cvsroot/mplayer/main/postproc/postprocess.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -r1.25 -r1.26
--- postprocess.h 29 Oct 2002 20:12:24 -0000 1.25
+++ postprocess.h 30 Oct 2002 01:50:58 -0000 1.26
@@ -96,4 +96,9 @@
void *pp_get_context(int width, int height);
void pp_free_context(void *ppContext);
+int pp_init(int cpuCaps);
+#define PP_CPU_CAPS_MMX 1
+#define PP_CPU_CAPS_MMX2 2
+#define PP_CPU_CAPS_3DNOW 4
+
#endif
More information about the MPlayer-cvslog
mailing list