From 002feab4c5d07828ab1c7982351ce08e833a0990 Mon Sep 17 00:00:00 2001 From: "yang.zhang@arm.com" Date: Fri, 19 Dec 2014 08:09:04 +0000 Subject: [PATCH] Fix the bug in ARGBColorMatrixRow_NEON BUG=371 TESTED=libyuv_unittest and test case written by myself R=fbarchard@google.com Change-Id: I652dc23e4be75bd51d15a8a7f9d023594c9cd032 git-svn-id: http://libyuv.googlecode.com/svn/trunk@1211 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- include/libyuv/row.h | 3 +-- source/row_neon.cc | 12 ++++++------ 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/include/libyuv/row.h b/include/libyuv/row.h index 7beee3063..5b17cf426 100644 --- a/include/libyuv/row.h +++ b/include/libyuv/row.h @@ -329,8 +329,7 @@ extern "C" { #define HAS_SOBELXROW_NEON #define HAS_SOBELXYROW_NEON #define HAS_SOBELYROW_NEON -// TODO(fbarchard): Fix ARGBColorMatrix Neon version and reenable. -// #define HAS_ARGBCOLORMATRIXROW_NEON +#define HAS_ARGBCOLORMATRIXROW_NEON // TODO(fbarchard): Test the following 3 work on 32 bit arm. #define HAS_ARGBSETROWS_NEON #define HAS_ARGBSHUFFLEROW_NEON diff --git a/source/row_neon.cc b/source/row_neon.cc index ac1c5e5d6..5e5ffac3d 100644 --- a/source/row_neon.cc +++ b/source/row_neon.cc @@ -2809,7 +2809,7 @@ void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb, "vmovl.u8 q8, d16 \n" // b (0 .. 255) 16 bit "vmovl.u8 q9, d18 \n" // g "vmovl.u8 q10, d20 \n" // r - "vmovl.u8 q15, d22 \n" // a + "vmovl.u8 q11, d22 \n" // a "vmul.s16 q12, q8, d0[0] \n" // B = B * Matrix B "vmul.s16 q13, q8, d1[0] \n" // G = B * Matrix G "vmul.s16 q14, q8, d2[0] \n" // R = B * Matrix R @@ -2830,10 +2830,10 @@ void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb, "vqadd.s16 q13, q13, q5 \n" // Accumulate G "vqadd.s16 q14, q14, q6 \n" // Accumulate R "vqadd.s16 q15, q15, q7 \n" // Accumulate A - "vmul.s16 q4, q15, d0[3] \n" // B += A * Matrix B - "vmul.s16 q5, q15, d1[3] \n" // G += A * Matrix G - "vmul.s16 q6, q15, d2[3] \n" // R += A * Matrix R - "vmul.s16 q7, q15, d3[3] \n" // A += A * Matrix A + "vmul.s16 q4, q11, d0[3] \n" // B += A * Matrix B + "vmul.s16 q5, q11, d1[3] \n" // G += A * Matrix G + "vmul.s16 q6, q11, d2[3] \n" // R += A * Matrix R + "vmul.s16 q7, q11, d3[3] \n" // A += A * Matrix A "vqadd.s16 q12, q12, q4 \n" // Accumulate B "vqadd.s16 q13, q13, q5 \n" // Accumulate G "vqadd.s16 q14, q14, q6 \n" // Accumulate R @@ -2849,7 +2849,7 @@ void ARGBColorMatrixRow_NEON(const uint8* src_argb, uint8* dst_argb, "+r"(dst_argb), // %1 "+r"(width) // %2 : "r"(matrix_argb) // %3 - : "cc", "memory", "q0", "q1", "q2", "q3", "q4", "q5", "q6", "q7", "q8", "q9", + : "cc", "memory", "q0", "q1", "q2", "q4", "q5", "q6", "q7", "q8", "q9", "q10", "q11", "q12", "q13", "q14", "q15" ); }