From d26b4514726a9a7476f6dfb6730cda2b422bf550 Mon Sep 17 00:00:00 2001 From: "fbarchard@google.com" Date: Thu, 25 Oct 2012 19:24:59 +0000 Subject: [PATCH] I420ToNV12_Neon bug fix BUG=135 TEST=/libyuv_unittest --gtest_filter=*NV* Review URL: https://webrtc-codereview.appspot.com/939005 git-svn-id: http://libyuv.googlecode.com/svn/trunk@444 16f28f9a-4ce2-e073-06de-1de4eb20be90 --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/convert_from.cc | 2 +- source/row_mips.cc | 1 - source/row_neon.cc | 6 +++--- source/scale.cc | 4 ++-- source/scale_mips.cc | 5 +---- unit_test/unit_test.h | 4 ++-- 8 files changed, 11 insertions(+), 15 deletions(-) diff --git a/README.chromium b/README.chromium index 72734456d..52eb9aab7 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 443 +Version: 444 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index df9a3e297..6b90f4795 100644 --- a/include/libyuv/version.h +++ b/include/libyuv/version.h @@ -11,6 +11,6 @@ #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #define INCLUDE_LIBYUV_VERSION_H_ -#define LIBYUV_VERSION 443 +#define LIBYUV_VERSION 444 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/convert_from.cc b/source/convert_from.cc index 05ab3cc09..8e5f9ad8b 100644 --- a/source/convert_from.cc +++ b/source/convert_from.cc @@ -530,7 +530,7 @@ int I420ToNV12(const uint8* src_y, int src_stride_y, int halfheight = (height + 1) >> 1; for (int y = 0; y < halfheight; ++y) { // Copy a row of UV. - MergeUV_C(src_u, src_v, dst_uv, halfwidth); + MergeUV(src_u, src_v, dst_uv, halfwidth); src_u += src_stride_u; src_v += src_stride_v; dst_uv += dst_stride_uv; diff --git a/source/row_mips.cc b/source/row_mips.cc index 7e4125d21..20f5a4fa5 100644 --- a/source/row_mips.cc +++ b/source/row_mips.cc @@ -19,7 +19,6 @@ extern "C" { #ifdef HAS_SPLITUV_MIPS_DSPR2 void SplitUV_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width) { - __asm__ __volatile__ ( ".set push \n" ".set noreorder \n" diff --git a/source/row_neon.cc b/source/row_neon.cc index 9b1933d45..bebf7c35c 100644 --- a/source/row_neon.cc +++ b/source/row_neon.cc @@ -385,10 +385,10 @@ void MergeUV_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, asm volatile ( ".p2align 2 \n" "1: \n" - "vld1.u8 {q0}, [%1]! \n" // load U - "vld1.u8 {q1}, [%2]! \n" // load V + "vld1.u8 {q0}, [%0]! \n" // load U + "vld1.u8 {q1}, [%1]! \n" // load V "subs %3, %3, #16 \n" // 16 processed per loop - "vst2.u8 {q0, q1}, [%0]! \n" // store 16 pairs of UV + "vst2.u8 {q0, q1}, [%2]! \n" // store 16 pairs of UV "bgt 1b \n" : "+r"(src_u), // %0 diff --git a/source/scale.cc b/source/scale.cc index 63bf89c7a..a7732c4bc 100644 --- a/source/scale.cc +++ b/source/scale.cc @@ -1957,7 +1957,7 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr, const unsigned char* src_ptr, ptrdiff_t src_stride, int dst_width, int source_y_fraction); -#endif // if defined(__mips_dsp) && (__mips_dsp_rev >= 2) +#endif // defined(__mips_dsp) && (__mips_dsp_rev >= 2) // CPU agnostic row functions static void ScaleRowDown2_C(const uint8* src_ptr, ptrdiff_t /* src_stride */, @@ -2326,7 +2326,7 @@ static void ScalePlaneDown2(int /* src_width */, int /* src_height */, ScaleRowDown2 = filtering ? ScaleRowDown2Int_SSE2 : ScaleRowDown2_SSE2; } } -#elif defined (HAS_SCALEROWDOWN2_MIPS_DSPR2) +#elif defined(HAS_SCALEROWDOWN2_MIPS_DSPR2) if (TestCpuFlag(kCpuHasMIPS_DSPR2) && IS_ALIGNED(src_ptr, 4) && IS_ALIGNED(src_stride, 4) && IS_ALIGNED(dst_ptr, 4) && IS_ALIGNED(dst_stride, 4)) { diff --git a/source/scale_mips.cc b/source/scale_mips.cc index 5e4a7e96c..ce7241662 100644 --- a/source/scale_mips.cc +++ b/source/scale_mips.cc @@ -76,7 +76,6 @@ void ScaleRowDown2_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t /* src_stride */, void ScaleRowDown2Int_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride, uint8* dst, int dst_width) { - const uint8* t = src_ptr + src_stride; __asm__ __volatile__ ( @@ -178,7 +177,6 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr, const unsigned char* src_ptr, ptrdiff_t src_stride, int dst_width, int source_y_fraction) { - int y0_fraction = 256 - source_y_fraction; const unsigned char* src_ptr1 = src_ptr + src_stride; @@ -233,8 +231,7 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr, "t6", "t7", "t8", "t9" ); } - -#endif // if defined(__mips_dsp) && (__mips_dsp_rev >= 2) +#endif // defined(__mips_dsp) && (__mips_dsp_rev >= 2) #ifdef __cplusplus } // extern "C" diff --git a/unit_test/unit_test.h b/unit_test/unit_test.h index fdcb0d273..2e5d1b09e 100644 --- a/unit_test/unit_test.h +++ b/unit_test/unit_test.h @@ -8,7 +8,7 @@ * be found in the AUTHORS file in the root of the source tree. */ -#ifndef UNIT_TEST_UNIT_TEST_H_ +#ifndef UNIT_TEST_UNIT_TEST_H_ // NOLINT #define UNIT_TEST_UNIT_TEST_H_ #include @@ -72,4 +72,4 @@ class libyuvTest : public ::testing::Test { int benchmark_pixels_div256_; // Total pixels to benchmark / 256. }; -#endif // UNIT_TEST_UNIT_TEST_H_ +#endif // UNIT_TEST_UNIT_TEST_H_ NOLINT