aboutsummaryrefslogtreecommitdiff
path: root/source/convert_argb.cc
diff options
context:
space:
mode:
authorDale Curtis <dalecurtis@chromium.org>2019-10-29 12:30:45 -0700
committerCommit Bot <commit-bot@chromium.org>2019-10-29 21:06:48 +0000
commitf15793d6af4758fe4bd4b2b1d851301fdd7e62fb (patch)
tree04274afb9e33124e9f08ecc16fb28102c4dd98a0 /source/convert_argb.cc
parent4205d7a6c9e2d2e3c6e8890c55da3b429a02b9e9 (diff)
downloadlibyuv-f15793d6af4758fe4bd4b2b1d851301fdd7e62fb.tar.gz
Add support for BT.2020.
This pulls in the changes that Firefox made to add BT.2020 support as well as expands them to the existing 10-bit support. So we now have the following input formats: U420, U422, U444, U010. BUG=960620, libyuv:845 Change-Id: If0c47853a465d0ed660f849db08e71489fe1b9c2 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/1884468 Commit-Queue: Dale Curtis <dalecurtis@chromium.org> Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/convert_argb.cc')
-rw-r--r--source/convert_argb.cc85
1 files changed, 85 insertions, 0 deletions
diff --git a/source/convert_argb.cc b/source/convert_argb.cc
index f46b4309..47fed0a3 100644
--- a/source/convert_argb.cc
+++ b/source/convert_argb.cc
@@ -234,6 +234,23 @@ int H420ToABGR(const uint8_t* src_y,
width, height);
}
+// Convert U420 to ARGB.
+LIBYUV_API
+int U420ToARGB(const uint8_t* src_y,
+ int src_stride_y,
+ const uint8_t* src_u,
+ int src_stride_u,
+ const uint8_t* src_v,
+ int src_stride_v,
+ uint8_t* dst_argb,
+ int dst_stride_argb,
+ int width,
+ int height) {
+ return I420ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
+ src_stride_v, dst_argb, dst_stride_argb,
+ &kYuv2020Constants, width, height);
+}
+
// Convert I422 to ARGB with matrix
static int I422ToARGBMatrix(const uint8_t* src_y,
int src_stride_y,
@@ -516,6 +533,23 @@ int H010ToAR30(const uint16_t* src_y,
&kYuvH709Constants, width, height);
}
+// Convert U010 to AR30.
+LIBYUV_API
+int U010ToAR30(const uint16_t* src_y,
+ int src_stride_y,
+ const uint16_t* src_u,
+ int src_stride_u,
+ const uint16_t* src_v,
+ int src_stride_v,
+ uint8_t* dst_ar30,
+ int dst_stride_ar30,
+ int width,
+ int height) {
+ return I010ToAR30Matrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
+ src_stride_v, dst_ar30, dst_stride_ar30,
+ &kYuv2020Constants, width, height);
+}
+
// Convert I010 to AB30.
LIBYUV_API
int I010ToAB30(const uint16_t* src_y,
@@ -550,6 +584,23 @@ int H010ToAB30(const uint16_t* src_y,
&kYvuH709Constants, width, height);
}
+// Convert U010 to AB30.
+LIBYUV_API
+int U010ToAB30(const uint16_t* src_y,
+ int src_stride_y,
+ const uint16_t* src_u,
+ int src_stride_u,
+ const uint16_t* src_v,
+ int src_stride_v,
+ uint8_t* dst_ab30,
+ int dst_stride_ab30,
+ int width,
+ int height) {
+ return I010ToAR30Matrix(src_y, src_stride_y, src_v, src_stride_v, src_u,
+ src_stride_u, dst_ab30, dst_stride_ab30,
+ &kYuv2020Constants, width, height);
+}
+
// Convert 10 bit YUV to ARGB with matrix
static int I010ToARGBMatrix(const uint16_t* src_y,
int src_stride_y,
@@ -684,6 +735,23 @@ int H010ToABGR(const uint16_t* src_y,
width, height);
}
+// Convert U422 to ARGB.
+LIBYUV_API
+int U422ToARGB(const uint8_t* src_y,
+ int src_stride_y,
+ const uint8_t* src_u,
+ int src_stride_u,
+ const uint8_t* src_v,
+ int src_stride_v,
+ uint8_t* dst_argb,
+ int dst_stride_argb,
+ int width,
+ int height) {
+ return I422ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
+ src_stride_v, dst_argb, dst_stride_argb,
+ &kYuv2020Constants, width, height);
+}
+
// Convert I444 to ARGB with matrix
static int I444ToARGBMatrix(const uint8_t* src_y,
int src_stride_y,
@@ -785,6 +853,23 @@ int I444ToARGB(const uint8_t* src_y,
&kYuvI601Constants, width, height);
}
+// Convert U444 to ARGB.
+LIBYUV_API
+int U444ToARGB(const uint8_t* src_y,
+ int src_stride_y,
+ const uint8_t* src_u,
+ int src_stride_u,
+ const uint8_t* src_v,
+ int src_stride_v,
+ uint8_t* dst_argb,
+ int dst_stride_argb,
+ int width,
+ int height) {
+ return I444ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
+ src_stride_v, dst_argb, dst_stride_argb,
+ &kYuv2020Constants, width, height);
+}
+
// Convert I444 to ABGR.
LIBYUV_API
int I444ToABGR(const uint8_t* src_y,