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

Unified Diff: source/row_neon.cc

Issue 1344393002: Add H422ToARGB armv7 neon version. (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: update comments. Created 5 years, 3 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 | « source/row_common.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: source/row_neon.cc
diff --git a/source/row_neon.cc b/source/row_neon.cc
index fc243d9170800d40a44ec5365f69aa585fad5cad..a384eb6551134424c34105be58b26b960d38e1b1 100644
--- a/source/row_neon.cc
+++ b/source/row_neon.cc
@@ -211,6 +211,44 @@ YuvConstantsNEON SIMD_ALIGNED(kYuvJConstantsNEON) = {
#undef BGJ
#undef BRJ
+// BT.709 YUV to RGB reference
+// * R = Y - V * -1.28033
+// * G = Y - U * 0.21482 - V * 0.38059
+// * B = Y - U * -2.12798
+
+// Y contribution to R,G,B. Scale and bias.
+// TODO(fbarchard): Consider moving constants into a common header.
+#define YGH 16320 /* round(1.000 * 64 * 256 * 256 / 257) */
+#define YGBH 32 /* 64 / 2 */
+
+// U and V contributions to R,G,B.
+#define UBH -128 /* max(-128, round(-2.12798 * 64)) */
+#define UGH 14 /* round(0.21482 * 64) */
+#define VGH 24 /* round(0.38059 * 64) */
+#define VRH -82 /* round(-1.28033 * 64) */
+
+// Bias values to round, and subtract 128 from U and V.
+#define BBH (UBH * 128 + YGBH)
+#define BGH (UGH * 128 + VGH * 128 + YGBH)
+#define BRH (VRH * 128 + YGBH)
+
+// BT.709 constants for YUV to RGB.
+YuvConstantsNEON SIMD_ALIGNED(kYuvHConstantsNEON) = {
+ { -UBH, -UBH, -UBH, -UBH, -VRH, -VRH, -VRH, -VRH, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { UGH, UGH, UGH, UGH, VGH, VGH, VGH, VGH, 0, 0, 0, 0, 0, 0, 0, 0 },
+ { BBH, BGH, BRH, 0, 0, 0, 0, 0 },
+ { 0x0101 * YGH, 0, 0, 0 }
+};
+
+#undef YGH
+#undef YGBH
+#undef UBH
+#undef UGH
+#undef VGH
+#undef VRH
+#undef BBH
+#undef BGH
+#undef BRH
void I444ToARGBRow_NEON(const uint8* src_y,
const uint8* src_u,
« no previous file with comments | « source/row_common.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698