Commit 87adfaa6 authored by fbarchard@google.com's avatar fbarchard@google.com

Enable Sepia and improve unittest

BUG=214
TESTED=Sepia test improved
Review URL: https://webrtc-codereview.appspot.com/1201006

git-svn-id: http://libyuv.googlecode.com/svn/trunk@631 16f28f9a-4ce2-e073-06de-1de4eb20be90
parent 48f18ba9
Name: libyuv
URL: http://code.google.com/p/libyuv/
Version: 630
Version: 631
License: BSD
License File: LICENSE
......
......@@ -259,14 +259,13 @@ extern "C" {
#define HAS_ARGBADDROW_NEON
#define HAS_ARGBATTENUATEROW_NEON
#define HAS_ARGBBLENDROW_NEON
// TODO(fbarchard): fix neon matrix function.
// TODO(fbarchard): fix and enable
// #define HAS_ARGBCOLORMATRIXROW_NEON
#define HAS_ARGBGRAYROW_NEON
#define HAS_ARGBINTERPOLATEROW_NEON
#define HAS_ARGBMULTIPLYROW_NEON
#define HAS_ARGBQUANTIZEROW_NEON
// TODO(fbarchard): fix neon sepia function.
// #define HAS_ARGBSEPIAROW_NEON
#define HAS_ARGBSEPIAROW_NEON
#define HAS_ARGBSHADEROW_NEON
#define HAS_ARGBSUBTRACTROW_NEON
#endif
......
......@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 630
#define LIBYUV_VERSION 631
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
......@@ -2459,9 +2459,9 @@ void ARGBSepiaRow_NEON(uint8* dst_argb, int width) {
"vmull.u8 q8, d0, d28 \n" // B to Sepia R
"vmlal.u8 q8, d1, d29 \n" // G
"vmlal.u8 q8, d2, d30 \n" // R
"vqshrun.s16 d0, q2, #7 \n" // 16 bit to 8 bit B
"vqshrun.s16 d1, q3, #7 \n" // 16 bit to 8 bit G
"vqshrun.s16 d2, q8, #7 \n" // 16 bit to 8 bit R
"vqshrn.u16 d0, q2, #7 \n" // 16 bit to 8 bit B
"vqshrn.u16 d1, q3, #7 \n" // 16 bit to 8 bit G
"vqshrn.u16 d2, q8, #7 \n" // 16 bit to 8 bit R
"vst4.8 {d0, d1, d2, d3}, [%0]! \n" // store 8 ARGB pixels.
"bgt 1b \n"
: "+r"(dst_argb), // %0
......
......@@ -424,11 +424,21 @@ TEST_F(libyuvTest, TestARGBSepia) {
orig_pixels[2][1] = 0u;
orig_pixels[2][2] = 255u;
orig_pixels[2][3] = 255u;
// Test black
orig_pixels[3][0] = 0u;
orig_pixels[3][1] = 0u;
orig_pixels[3][2] = 0u;
orig_pixels[3][3] = 255u;
// Test white
orig_pixels[4][0] = 255u;
orig_pixels[4][1] = 255u;
orig_pixels[4][2] = 255u;
orig_pixels[4][3] = 255u;
// Test color
orig_pixels[3][0] = 16u;
orig_pixels[3][1] = 64u;
orig_pixels[3][2] = 192u;
orig_pixels[3][3] = 224u;
orig_pixels[5][0] = 16u;
orig_pixels[5][1] = 64u;
orig_pixels[5][2] = 192u;
orig_pixels[5][3] = 224u;
// Do 16 to test asm version.
ARGBSepia(&orig_pixels[0][0], 0, 0, 0, 16, 1);
EXPECT_EQ(33u, orig_pixels[0][0]);
......@@ -443,10 +453,18 @@ TEST_F(libyuvTest, TestARGBSepia) {
EXPECT_EQ(89u, orig_pixels[2][1]);
EXPECT_EQ(99u, orig_pixels[2][2]);
EXPECT_EQ(255u, orig_pixels[2][3]);
EXPECT_EQ(88u, orig_pixels[3][0]);
EXPECT_EQ(114u, orig_pixels[3][1]);
EXPECT_EQ(127u, orig_pixels[3][2]);
EXPECT_EQ(224u, orig_pixels[3][3]);
EXPECT_EQ(0u, orig_pixels[3][0]);
EXPECT_EQ(0u, orig_pixels[3][1]);
EXPECT_EQ(0u, orig_pixels[3][2]);
EXPECT_EQ(255u, orig_pixels[3][3]);
EXPECT_EQ(239u, orig_pixels[4][0]);
EXPECT_EQ(255u, orig_pixels[4][1]);
EXPECT_EQ(255u, orig_pixels[4][2]);
EXPECT_EQ(255u, orig_pixels[4][3]);
EXPECT_EQ(88u, orig_pixels[5][0]);
EXPECT_EQ(114u, orig_pixels[5][1]);
EXPECT_EQ(127u, orig_pixels[5][2]);
EXPECT_EQ(224u, orig_pixels[5][3]);
for (int i = 0; i < 256; ++i) {
orig_pixels[i][0] = i;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment