Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(245)

Unified Diff: source/row_any.cc

Issue 1411733004: Fix ARGBToI411 odd width bug. (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « include/libyuv/version.h ('k') | source/row_common.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/row_any.cc
diff --git a/source/row_any.cc b/source/row_any.cc
index c5a24d1ad5da6db7a35f641fc2b979c8e403588f..69562d7d851a6965b2b2925ef8f31d48eeb3dc24 100644
--- a/source/row_any.cc
+++ b/source/row_any.cc
@@ -672,7 +672,23 @@ ANY1(ARGBSetRow_Any_NEON, ARGBSetRow_NEON, uint32, 4, 3)
ANY_SIMD(src_ptr, dst_u, dst_v, n); \
} \
memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \
- if ((width & 1) && BPP == 4) { /* repeat last 4 bytes for subsampler */ \
+ /* repeat last 4 bytes for 422 subsampler */ \
+ if ((width & 1) && BPP == 4 && DUVSHIFT == 1) { \
+ memcpy(temp + SS(r, UVSHIFT) * BPP, \
+ temp + SS(r, UVSHIFT) * BPP - BPP, 4); \
+ } \
+ /* repeat last 4 - 12 bytes for 411 subsampler */ \
+ if (((width & 1) == 1) && BPP == 4 && DUVSHIFT == 2) { \
+ memcpy(temp + SS(r, UVSHIFT) * BPP, \
+ temp + SS(r, UVSHIFT) * BPP - BPP, 4); \
+ memcpy(temp + SS(r, UVSHIFT) * BPP + 4, \
+ temp + SS(r, UVSHIFT) * BPP - BPP, 8); \
+ } \
+ if (((width & 1) == 2) && BPP == 4 && DUVSHIFT == 2) { \
+ memcpy(temp + SS(r, UVSHIFT) * BPP, \
+ temp + SS(r, UVSHIFT) * BPP - BPP * 2, 8); \
+ } \
+ if (((width & 1) == 3) && BPP == 4 && DUVSHIFT == 2) { \
memcpy(temp + SS(r, UVSHIFT) * BPP, \
temp + SS(r, UVSHIFT) * BPP - BPP, 4); \
} \
« no previous file with comments | « include/libyuv/version.h ('k') | source/row_common.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698