summaryrefslogtreecommitdiffstats
path: root/postproc
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-30 01:51:14 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-10-30 01:51:14 +0000
commitf8456285fb72e3456fc0f605df4c3c361e09837f (patch)
treef335b34a789ffe828df7b0342049d78d14c14d54 /postproc
parent3b76b153773b542aa8780a547ee4b8e9db6803a5 (diff)
downloadmpv-f8456285fb72e3456fc0f605df4c3c361e09837f.tar.bz2
mpv-f8456285fb72e3456fc0f605df4c3c361e09837f.tar.xz
cleanly passing the cpuCaps
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@7973 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc')
-rw-r--r--postproc/postprocess.c24
-rw-r--r--postproc/postprocess.h5
2 files changed, 16 insertions, 13 deletions
diff --git a/postproc/postprocess.c b/postproc/postprocess.c
index fc633612d9..c804e1d568 100644
--- a/postproc/postprocess.c
+++ b/postproc/postprocess.c
@@ -77,7 +77,6 @@ try to unroll inner for(x=0 ... loop to avoid these damn if(x ... checks
//#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 int verbose= 0;
static const int deringThreshold= 20;
+static int cpuCaps=0;
+
struct PPFilter{
char *shortName;
char *longName;
@@ -189,15 +190,6 @@ static inline void unusedVariableWarningFixer()
}
#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 @@ static inline void prefetcht2(void *p)
}
#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 @@ static inline void postProcess(uint8_t src[], int srcStride, uint8_t dst[], int
#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);
diff --git a/postproc/postprocess.h b/postproc/postprocess.h
index 79eb9387c8..c51044eeaf 100644
--- a/postproc/postprocess.h
+++ b/postproc/postprocess.h
@@ -96,4 +96,9 @@ PPMode pp_get_mode_by_name_and_quality(char *name, int quality);
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