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

Unified Diff: source/row_neon.cc

Issue 1359443005: move constants into common (Closed) Base URL: https://chromium.googlesource.com/libyuv/libyuv@master
Patch Set: fix up jpeg comments and remove todo to move to common 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_gcc.cc ('k') | source/row_neon64.cc » ('j') | 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 b4742ef5dcc72da7171831344d6b52de26390620..f7e6ba1dc1c940cdebcd03a027752b427c3c40ba 100644
--- a/source/row_neon.cc
+++ b/source/row_neon.cc
@@ -134,122 +134,6 @@ extern "C" {
"vqshrun.s16 d22, q9, #6 \n" /* R */ \
"vqshrun.s16 d21, q0, #6 \n" /* G */
-// BT.601 YUV to RGB reference
-// R = (Y - 16) * 1.164 - V * -1.596
-// G = (Y - 16) * 1.164 - U * 0.391 - V * 0.813
-// B = (Y - 16) * 1.164 - U * -2.018
-
-// Y contribution to R,G,B. Scale and bias.
-// TODO(fbarchard): Consider moving constants into a common header.
-#define YG 18997 /* round(1.164 * 64 * 256 * 256 / 257) */
-#define YGB -1160 /* 1.164 * 64 * -16 + 64 / 2 */
-
-// U and V contributions to R,G,B.
-#define UB -128 /* max(-128, round(-2.018 * 64)) */
-#define UG 25 /* round(0.391 * 64) */
-#define VG 52 /* round(0.813 * 64) */
-#define VR -102 /* round(-1.596 * 64) */
-
-// Bias values to subtract 16 from Y and 128 from U and V.
-#define BB (UB * 128 + YGB)
-#define BG (UG * 128 + VG * 128 + YGB)
-#define BR (VR * 128 + YGB)
-
-YuvConstantsNEON SIMD_ALIGNED(kYuvConstantsNEON) = {
- { -UB, -UB, -UB, -UB, -VR, -VR, -VR, -VR, 0, 0, 0, 0, 0, 0, 0, 0 },
- { UG, UG, UG, UG, VG, VG, VG, VG, 0, 0, 0, 0, 0, 0, 0, 0 },
- { BB, BG, BR, 0, 0, 0, 0, 0 },
- { 0x0101 * YG, 0, 0, 0 }
-};
-
-#undef YG
-#undef YGB
-#undef UB
-#undef UG
-#undef VG
-#undef VR
-#undef BB
-#undef BG
-#undef BR
-
-// JPEG YUV to RGB reference
-// * R = Y - V * -1.40200
-// * G = Y - U * 0.34414 - V * 0.71414
-// * B = Y - U * -1.77200
-
-// Y contribution to R,G,B. Scale and bias.
-// TODO(fbarchard): Consider moving constants into a common header.
-#define YGJ 16320 /* round(1.000 * 64 * 256 * 256 / 257) */
-#define YGBJ 32 /* 64 / 2 */
-
-// U and V contributions to R,G,B.
-#define UBJ -113 /* round(-1.77200 * 64) */
-#define UGJ 22 /* round(0.34414 * 64) */
-#define VGJ 46 /* round(0.71414 * 64) */
-#define VRJ -90 /* round(-1.40200 * 64) */
-
-// Bias values to subtract 16 from Y and 128 from U and V.
-#define BBJ (UBJ * 128 + YGBJ)
-#define BGJ (UGJ * 128 + VGJ * 128 + YGBJ)
-#define BRJ (VRJ * 128 + YGBJ)
-
-// JPEG constants for YUV to RGB.
-YuvConstantsNEON SIMD_ALIGNED(kYuvJConstantsNEON) = {
- { -UBJ, -UBJ, -UBJ, -UBJ, -VRJ, -VRJ, -VRJ, -VRJ, 0, 0, 0, 0, 0, 0, 0, 0 },
- { UGJ, UGJ, UGJ, UGJ, VGJ, VGJ, VGJ, VGJ, 0, 0, 0, 0, 0, 0, 0, 0 },
- { BBJ, BGJ, BRJ, 0, 0, 0, 0, 0 },
- { 0x0101 * YGJ, 0, 0, 0 }
-};
-
-#undef YGJ
-#undef YGBJ
-#undef UBJ
-#undef UGJ
-#undef VGJ
-#undef VRJ
-#undef BBJ
-#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,
const uint8* src_v,
« no previous file with comments | « source/row_gcc.cc ('k') | source/row_neon64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698