diff options
author | Frank Barchard <fbarchard@google.com> | 2022-09-22 07:56:10 -0700 |
---|---|---|
committer | libyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-09-23 12:51:37 +0000 |
commit | b9adaef1133ee835efc8970d1dcdcf23a5b68eba (patch) | |
tree | 38b8d6f356b7cd4b1890bc1c356aeb6138756db7 /source | |
parent | 344bd4dd68a7c23f65dfe19f5a5912c8930a63cd (diff) | |
download | libyuv-b9adaef1133ee835efc8970d1dcdcf23a5b68eba.tar.gz |
Enable unlimited data for YUV to RGB
- Provide LIBYUV_LIMITED_DATA macro for backwards compatiblity
Bug: b/474156256
Change-Id: I5d5d7fb640d51ae3c5ad363f2a28c8bfbd3048a5
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3912081
Reviewed-by: Wan-Teh Chang <wtc@google.com>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source')
-rw-r--r-- | source/row_common.cc | 16 |
1 files changed, 6 insertions, 10 deletions
diff --git a/source/row_common.cc b/source/row_common.cc index 50be6287..a177d8bb 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -22,13 +22,9 @@ extern "C" { #endif // This macro controls YUV to RGB using unsigned math to extend range of -// YUV to RGB coefficients to 0 to 4 instead of 0 to 2 for more accuracy on B: -// LIBYUV_UNLIMITED_DATA - -// Macros to enable unlimited data for each colorspace -// LIBYUV_UNLIMITED_BT601 -// LIBYUV_UNLIMITED_BT709 -// LIBYUV_UNLIMITED_BT2020 +// YUV to RGB coefficients to 0 to 4 instead of 0 to 2 for more accuracy on B. +// Enable this macro for backwards compatiability with limited range 0 to 2. +// LIBYUV_LIMITED_DATA // The following macro from row_win makes the C code match the row_win code, // which is 7 bit fixed point for ARGBToI420: @@ -1484,7 +1480,7 @@ void J400ToARGBRow_C(const uint8_t* src_y, uint8_t* dst_argb, int width) { // KR = 0.299; KB = 0.114 // U and V contributions to R,G,B. -#if defined(LIBYUV_UNLIMITED_DATA) || defined(LIBYUV_UNLIMITED_BT601) +#if !defined(LIBYUV_LIMITED_DATA) #define UB 129 /* round(2.018 * 64) */ #else #define UB 128 /* max(128, round(2.018 * 64)) */ @@ -1538,7 +1534,7 @@ MAKEYUVCONSTANTS(JPEG, YG, YB, UB, UG, VG, VR) // KR = 0.2126, KB = 0.0722 // U and V contributions to R,G,B. -#if defined(LIBYUV_UNLIMITED_DATA) || defined(LIBYUV_UNLIMITED_BT709) +#if !defined(LIBYUV_LIMITED_DATA) #define UB 135 /* round(2.112 * 64) */ #else #define UB 128 /* max(128, round(2.112 * 64)) */ @@ -1592,7 +1588,7 @@ MAKEYUVCONSTANTS(F709, YG, YB, UB, UG, VG, VR) // KR = 0.2627; KB = 0.0593 // U and V contributions to R,G,B. -#if defined(LIBYUV_UNLIMITED_DATA) || defined(LIBYUV_UNLIMITED_BT2020) +#if !defined(LIBYUV_LIMITED_DATA) #define UB 137 /* round(2.142 * 64) */ #else #define UB 128 /* max(128, round(2.142 * 64)) */ |