summaryrefslogtreecommitdiff
path: root/libswscale/x86/swscale_template.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2011-09-05 18:42:44 +0200
committerMichael Niedermayer <michaelni@gmx.at>2011-09-05 18:42:44 +0200
commit27bf599350a869877a1c9304abf9c95991692dd2 (patch)
tree3eada95c6f5c79abf8dc0878b15e265550cd0c3b /libswscale/x86/swscale_template.c
parent038a465efc737b331e39869b3f31a4997b6ee12d (diff)
swscale: Fix unused asm and enable it
Author of the fix is ronald, the enabling & commit message are mine. This fixes commit 4e3e333a79272944b40695166438359b376d7864 Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Tue Jul 5 12:49:11 2011 -0700 swscale: error dithering for 16/9/10-bit to 8-bit. Based on a somewhat similar idea in FFmpeg's swscale copy. The Fix was originally commited in: (and i missed it due to the commit message) commit 5c391a161a1f71dcdafd3f59b45d80220845f501 Author: Ronald S. Bultje <rsbultje@gmail.com> Date: Fri Jul 8 14:39:04 2011 -0700 swscale: rename uv_off/uv_off2 to uv_off_px/byte.
Diffstat (limited to 'libswscale/x86/swscale_template.c')
-rw-r--r--libswscale/x86/swscale_template.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c
index 6196e98561..cfaf847f93 100644
--- a/libswscale/x86/swscale_template.c
+++ b/libswscale/x86/swscale_template.c
@@ -192,11 +192,6 @@ static void RENAME(yuv2yuvX)(SwsContext *c, const int16_t *lumFilter,
static av_always_inline void
dither_8to32(SwsContext *c, const uint8_t *srcDither, int rot)
{
-int i;
-if(rot) for(i=0; i<8; i++) c->dither32[i] = srcDither[(i+3)&7]<<12;
-else for(i=0; i<8; i++) c->dither32[i] = srcDither[i&7]<<12;
-return;
-
if (rot) {
__asm__ volatile("pxor %%mm0, %%mm0\n\t"
"movq (%0), %%mm4\n\t"
@@ -213,10 +208,10 @@ return;
"punpckhwd %%mm0, %%mm5\n\t"
"punpcklwd %%mm0, %%mm6\n\t"
"punpckhwd %%mm0, %%mm7\n\t"
- "psllw $12, %%mm4\n\t"
- "psllw $12, %%mm5\n\t"
- "psllw $12, %%mm6\n\t"
- "psllw $12, %%mm7\n\t"
+ "pslld $12, %%mm4\n\t"
+ "pslld $12, %%mm5\n\t"
+ "pslld $12, %%mm6\n\t"
+ "pslld $12, %%mm7\n\t"
"movq %%mm4, "DITHER32"+0(%1)\n\t"
"movq %%mm5, "DITHER32"+8(%1)\n\t"
"movq %%mm6, "DITHER32"+16(%1)\n\t"
@@ -235,10 +230,10 @@ return;
"punpckhwd %%mm0, %%mm5\n\t"
"punpcklwd %%mm0, %%mm6\n\t"
"punpckhwd %%mm0, %%mm7\n\t"
- "psllw $12, %%mm4\n\t"
- "psllw $12, %%mm5\n\t"
- "psllw $12, %%mm6\n\t"
- "psllw $12, %%mm7\n\t"
+ "pslld $12, %%mm4\n\t"
+ "pslld $12, %%mm5\n\t"
+ "pslld $12, %%mm6\n\t"
+ "pslld $12, %%mm7\n\t"
"movq %%mm4, "DITHER32"+0(%1)\n\t"
"movq %%mm5, "DITHER32"+8(%1)\n\t"
"movq %%mm6, "DITHER32"+16(%1)\n\t"