Commit d26b4514 authored by fbarchard@google.com's avatar fbarchard@google.com

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
parent d3728d92
Name: libyuv Name: libyuv
URL: http://code.google.com/p/libyuv/ URL: http://code.google.com/p/libyuv/
Version: 443 Version: 444
License: BSD License: BSD
License File: LICENSE License File: LICENSE
......
...@@ -11,6 +11,6 @@ ...@@ -11,6 +11,6 @@
#ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT #ifndef INCLUDE_LIBYUV_VERSION_H_ // NOLINT
#define INCLUDE_LIBYUV_VERSION_H_ #define INCLUDE_LIBYUV_VERSION_H_
#define LIBYUV_VERSION 443 #define LIBYUV_VERSION 444
#endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT
...@@ -530,7 +530,7 @@ int I420ToNV12(const uint8* src_y, int src_stride_y, ...@@ -530,7 +530,7 @@ int I420ToNV12(const uint8* src_y, int src_stride_y,
int halfheight = (height + 1) >> 1; int halfheight = (height + 1) >> 1;
for (int y = 0; y < halfheight; ++y) { for (int y = 0; y < halfheight; ++y) {
// Copy a row of UV. // 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_u += src_stride_u;
src_v += src_stride_v; src_v += src_stride_v;
dst_uv += dst_stride_uv; dst_uv += dst_stride_uv;
......
...@@ -19,7 +19,6 @@ extern "C" { ...@@ -19,7 +19,6 @@ extern "C" {
#ifdef HAS_SPLITUV_MIPS_DSPR2 #ifdef HAS_SPLITUV_MIPS_DSPR2
void SplitUV_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v, void SplitUV_MIPS_DSPR2(const uint8* src_uv, uint8* dst_u, uint8* dst_v,
int width) { int width) {
__asm__ __volatile__ ( __asm__ __volatile__ (
".set push \n" ".set push \n"
".set noreorder \n" ".set noreorder \n"
......
...@@ -385,10 +385,10 @@ void MergeUV_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv, ...@@ -385,10 +385,10 @@ void MergeUV_NEON(const uint8* src_u, const uint8* src_v, uint8* dst_uv,
asm volatile ( asm volatile (
".p2align 2 \n" ".p2align 2 \n"
"1: \n" "1: \n"
"vld1.u8 {q0}, [%1]! \n" // load U "vld1.u8 {q0}, [%0]! \n" // load U
"vld1.u8 {q1}, [%2]! \n" // load V "vld1.u8 {q1}, [%1]! \n" // load V
"subs %3, %3, #16 \n" // 16 processed per loop "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" "bgt 1b \n"
: :
"+r"(src_u), // %0 "+r"(src_u), // %0
......
...@@ -1957,7 +1957,7 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr, ...@@ -1957,7 +1957,7 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr,
const unsigned char* src_ptr, const unsigned char* src_ptr,
ptrdiff_t src_stride, ptrdiff_t src_stride,
int dst_width, int source_y_fraction); 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 // CPU agnostic row functions
static void ScaleRowDown2_C(const uint8* src_ptr, ptrdiff_t /* src_stride */, 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 */, ...@@ -2326,7 +2326,7 @@ static void ScalePlaneDown2(int /* src_width */, int /* src_height */,
ScaleRowDown2 = filtering ? ScaleRowDown2Int_SSE2 : ScaleRowDown2_SSE2; ScaleRowDown2 = filtering ? ScaleRowDown2Int_SSE2 : ScaleRowDown2_SSE2;
} }
} }
#elif defined (HAS_SCALEROWDOWN2_MIPS_DSPR2) #elif defined(HAS_SCALEROWDOWN2_MIPS_DSPR2)
if (TestCpuFlag(kCpuHasMIPS_DSPR2) && if (TestCpuFlag(kCpuHasMIPS_DSPR2) &&
IS_ALIGNED(src_ptr, 4) && IS_ALIGNED(src_stride, 4) && IS_ALIGNED(src_ptr, 4) && IS_ALIGNED(src_stride, 4) &&
IS_ALIGNED(dst_ptr, 4) && IS_ALIGNED(dst_stride, 4)) { IS_ALIGNED(dst_ptr, 4) && IS_ALIGNED(dst_stride, 4)) {
......
...@@ -76,7 +76,6 @@ void ScaleRowDown2_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t /* src_stride */, ...@@ -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, void ScaleRowDown2Int_MIPS_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
uint8* dst, int dst_width) { uint8* dst, int dst_width) {
const uint8* t = src_ptr + src_stride; const uint8* t = src_ptr + src_stride;
__asm__ __volatile__ ( __asm__ __volatile__ (
...@@ -178,7 +177,6 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr, ...@@ -178,7 +177,6 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr,
const unsigned char* src_ptr, const unsigned char* src_ptr,
ptrdiff_t src_stride, ptrdiff_t src_stride,
int dst_width, int source_y_fraction) { int dst_width, int source_y_fraction) {
int y0_fraction = 256 - source_y_fraction; int y0_fraction = 256 - source_y_fraction;
const unsigned char* src_ptr1 = src_ptr + src_stride; const unsigned char* src_ptr1 = src_ptr + src_stride;
...@@ -233,8 +231,7 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr, ...@@ -233,8 +231,7 @@ void ScaleFilterRows_MIPS_DSPR2(unsigned char *dst_ptr,
"t6", "t7", "t8", "t9" "t6", "t7", "t8", "t9"
); );
} }
#endif // defined(__mips_dsp) && (__mips_dsp_rev >= 2)
#endif // if defined(__mips_dsp) && (__mips_dsp_rev >= 2)
#ifdef __cplusplus #ifdef __cplusplus
} // extern "C" } // extern "C"
......
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
* be found in the AUTHORS file in the root of the source tree. * 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_ #define UNIT_TEST_UNIT_TEST_H_
#include <gtest/gtest.h> #include <gtest/gtest.h>
...@@ -72,4 +72,4 @@ class libyuvTest : public ::testing::Test { ...@@ -72,4 +72,4 @@ class libyuvTest : public ::testing::Test {
int benchmark_pixels_div256_; // Total pixels to benchmark / 256. int benchmark_pixels_div256_; // Total pixels to benchmark / 256.
}; };
#endif // UNIT_TEST_UNIT_TEST_H_ #endif // UNIT_TEST_UNIT_TEST_H_ NOLINT
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