author | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
---|---|---|
committer | kergoth <kergoth> | 2002-01-25 22:14:26 (UTC) |
commit | 15318cad33835e4e2dc620d033e43cd930676cdd (patch) (unidiff) | |
tree | c2fa0399a2c47fda8e2cd0092c73a809d17f68eb /core/multimedia/opieplayer/libmpeg3/video/worksheet.c | |
download | opie-15318cad33835e4e2dc620d033e43cd930676cdd.zip opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.gz opie-15318cad33835e4e2dc620d033e43cd930676cdd.tar.bz2 |
Initial revision
Diffstat (limited to 'core/multimedia/opieplayer/libmpeg3/video/worksheet.c') (more/less context) (show whitespace changes)
-rw-r--r-- | core/multimedia/opieplayer/libmpeg3/video/worksheet.c | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/core/multimedia/opieplayer/libmpeg3/video/worksheet.c b/core/multimedia/opieplayer/libmpeg3/video/worksheet.c new file mode 100644 index 0000000..c5a0553 --- a/dev/null +++ b/core/multimedia/opieplayer/libmpeg3/video/worksheet.c | |||
@@ -0,0 +1,30 @@ | |||
1 | #include <stdio.h> | ||
2 | #include <stdlib.h> | ||
3 | #include <time.h> | ||
4 | |||
5 | |||
6 | static LONGLONG mpeg3_MMX_601_Y_COEF = 0x0000004000400040; | ||
7 | |||
8 | inline void mpeg3_601_mmx(unsigned long y, | ||
9 | unsigned long *output) | ||
10 | { | ||
11 | asm(" | ||
12 | /* Output will be 0x00rrggbb */ | ||
13 | movd (%0), %%mm0; /* Load y 0x00000000000000yy */ | ||
14 | /*pmullw mpeg3_MMX_601_Y_COEF, %%mm0; // Scale y 0x00000000000000yy */ | ||
15 | psllw $6, %%mm0; /* Shift y coeffs 0x0000yyy0yyy0yyy0 */ | ||
16 | movd %%mm0, (%1); /* Store output */ | ||
17 | " | ||
18 | : | ||
19 | : "r" (&y), "r" (output)); | ||
20 | } | ||
21 | |||
22 | |||
23 | int main(int argc, char *argv[]) | ||
24 | { | ||
25 | unsigned char output[1024]; | ||
26 | |||
27 | memset(output, 0, 1024); | ||
28 | mpeg3_601_mmx(1, (unsigned long*)output); | ||
29 | printf("%02x%02x\n", *(unsigned char*)&output[1], *(unsigned char*)&output[0]); | ||
30 | } | ||