From 430bb0a0f0d5d714a2f635a9e220ff8a4b591cc4 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Wed, 21 Oct 2015 20:03:19 -0700 Subject: [PATCH] odd width 444 fix TBR=harryjin@google.com BUG=libyuv:510 Review URL: https://codereview.chromium.org/1415583003 . --- README.chromium | 2 +- include/libyuv/version.h | 2 +- source/row_any.cc | 6 ++++++ source/row_common.cc | 2 ++ 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/README.chromium b/README.chromium index bc655854b..55dcc1b4b 100644 --- a/README.chromium +++ b/README.chromium @@ -1,6 +1,6 @@ Name: libyuv URL: http://code.google.com/p/libyuv/ -Version: 1518 +Version: 1519 License: BSD License File: LICENSE diff --git a/include/libyuv/version.h b/include/libyuv/version.h index 643e9bd6f..192609d2f 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 1518 +#define LIBYUV_VERSION 1519 #endif // INCLUDE_LIBYUV_VERSION_H_ NOLINT diff --git a/source/row_any.cc b/source/row_any.cc index a4652eb50..04f7c0d32 100644 --- a/source/row_any.cc +++ b/source/row_any.cc @@ -84,6 +84,8 @@ ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVYRow_NEON, 1, 1, 4, 15) #endif #undef ANY31 +// Note that odd width replication includes 444 due to implementation +// on arm that subsamples 444 to 422 internally. // Any 3 planes to 1 with yuvconstants #define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \ void NAMEANY(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, \ @@ -99,6 +101,10 @@ ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVYRow_NEON, 1, 1, 4, 15) memcpy(temp, y_buf + n, r); \ memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ + if (width & 1) { \ + temp[64 + SS(r, UVSHIFT)] = temp[64 + SS(r, UVSHIFT) - 1]; \ + temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1]; \ + } \ ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, \ yuvconstants, MASK + 1); \ memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192, \ diff --git a/source/row_common.cc b/source/row_common.cc index b818fb8bc..8f8b69505 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -1276,6 +1276,7 @@ void I444ToARGBRow_C(const uint8* src_y, if (width & 1) { YuvPixel(src_y[0], src_u[0], src_v[0], rgb_buf + 0, rgb_buf + 1, rgb_buf + 2, yuvconstants); + rgb_buf[3] = 255; } } @@ -1303,6 +1304,7 @@ void I444ToABGRRow_C(const uint8* src_y, if (width & 1) { YuvPixel(src_y[0], src_u[0], src_v[0], rgb_buf + 2, rgb_buf + 1, rgb_buf + 0, yuvconstants); + rgb_buf[3] = 255; } } #else