ref: f9e8167ba98e6152935db090158f464a81ec4ccb
parent: 746154d905e021bb6a6b2c16cc37ad2cc08fd67d
author: Yunqing Wang <yunqingwang@google.com>
date: Mon Jul 22 11:42:23 EDT 2013
libyuv: fix SSSE3 code in scale.c This patch was provided by Frank. Change-Id: Icebcbd96016a51a85dbe5e8a351ab7624ace962b
--- a/third_party/libyuv/source/scale.c
+++ b/third_party/libyuv/source/scale.c
@@ -1370,12 +1370,12 @@
mov edx, [esp + 8 + 12] // src_stride
mov ecx, [esp + 8 + 16] // dst_width
mov eax, [esp + 8 + 20] // source_y_fraction (0..255)
+ shr eax, 1
cmp eax, 0
je xloop1
- cmp eax, 128
+ cmp eax, 64
je xloop2
- shr eax, 1
mov ah,al
neg al
add al, 128
@@ -2132,11 +2132,11 @@
"mov 0x14(%esp),%edx \n"
"mov 0x18(%esp),%ecx \n"
"mov 0x1c(%esp),%eax \n"
+ "shr %eax \n"
"cmp $0x0,%eax \n"
"je 2f \n"
- "cmp $0x80,%eax \n"
+ "cmp $0x40,%eax \n"
"je 3f \n"
- "shr %eax \n"
"mov %al,%ah \n"
"neg %al \n"
"add $0x80,%al \n"
@@ -2662,6 +2662,7 @@
static void ScaleFilterRows_SSSE3(uint8* dst_ptr,
const uint8* src_ptr, int src_stride,
int dst_width, int source_y_fraction) {
+ source_y_fraction >>= 1;
if (source_y_fraction == 0) {
asm volatile (
"1:"
@@ -2680,7 +2681,7 @@
: "memory", "cc", "rax"
);
return;
- } else if (source_y_fraction == 128) {
+ } else if (source_y_fraction == 64) {
asm volatile (
"1:"
"movdqa (%1),%%xmm0 \n"
@@ -2703,7 +2704,6 @@
} else {
asm volatile (
"mov %3,%%eax \n"
- "shr %%eax \n"
"mov %%al,%%ah \n"
"neg %%al \n"
"add $0x80,%%al \n"
--
⑨