summaryrefslogtreecommitdiffstats
path: root/postproc/rgb2rgb.c
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-10 00:30:24 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2002-02-10 00:30:24 +0000
commitf023f5a3364ce55ee16582f4effe8d458bff659e (patch)
tree485e30cd0768db5e97465258fac833ff813d3615 /postproc/rgb2rgb.c
parent2ccf7d2a4566b75a961b816fe468adc277d42161 (diff)
downloadmpv-f023f5a3364ce55ee16582f4effe8d458bff659e.tar.bz2
mpv-f023f5a3364ce55ee16582f4effe8d458bff659e.tar.xz
rgb24toyv12 in MMX (untested)
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@4623 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'postproc/rgb2rgb.c')
-rw-r--r--postproc/rgb2rgb.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/postproc/rgb2rgb.c b/postproc/rgb2rgb.c
index 52ddcf5749..7668a395c8 100644
--- a/postproc/rgb2rgb.c
+++ b/postproc/rgb2rgb.c
@@ -16,6 +16,8 @@
#define CAN_COMPILE_X86_ASM
#endif
+#define FAST_BGR2YV12 // use 7 bit coeffs instead of 15bit
+
#ifdef CAN_COMPILE_X86_ASM
static const uint64_t mask32b __attribute__((aligned(8))) = 0x000000FF000000FFULL;
static const uint64_t mask32g __attribute__((aligned(8))) = 0x0000FF000000FF00ULL;
@@ -35,6 +37,20 @@ static const uint64_t blue_16mask __attribute__((aligned(8))) = 0x0000001f000000
static const uint64_t red_15mask __attribute__((aligned(8))) = 0x00007c000000f800ULL;
static const uint64_t green_15mask __attribute__((aligned(8)))= 0x000003e0000007e0ULL;
static const uint64_t blue_15mask __attribute__((aligned(8))) = 0x0000001f0000001fULL;
+
+#ifdef FAST_BGR2YV12
+static const uint64_t bgr2YCoeff __attribute__((aligned(8))) = 0x000000210041000DULL;
+static const uint64_t bgr2UCoeff __attribute__((aligned(8))) = 0x0000FFEEFFDC0038ULL;
+static const uint64_t bgr2VCoeff __attribute__((aligned(8))) = 0x00000038FFD2FFF8ULL;
+#else
+static const uint64_t bgr2YCoeff __attribute__((aligned(8))) = 0x000020E540830C8BULL;
+static const uint64_t bgr2UCoeff __attribute__((aligned(8))) = 0x0000ED0FDAC23831ULL;
+static const uint64_t bgr2VCoeff __attribute__((aligned(8))) = 0x00003831D0E6F6EAULL;
+#endif
+static const uint64_t bgr2YOffset __attribute__((aligned(8))) = 0x1010101010101010ULL;
+static const uint64_t bgr2UVOffset __attribute__((aligned(8)))= 0x8080808080808080ULL;
+static const uint64_t w1111 __attribute__((aligned(8))) = 0x0001000100010001ULL;
+
#if 0
static volatile uint64_t __attribute__((aligned(8))) b5Dither;
static volatile uint64_t __attribute__((aligned(8))) g5Dither;