aboutsummaryrefslogtreecommitdiff
path: root/source/convert_argb.cc
diff options
context:
space:
mode:
authorFrank Barchard <fbarchard@google.com>2019-11-05 11:55:59 -0800
committerFrank Barchard <fbarchard@chromium.org>2019-11-05 20:01:59 +0000
commit53e014c99d6f59647c57b70b3fa65ad3dd59ce08 (patch)
tree5cb27e350c525a60f9389ef01415968e97b286a3 /source/convert_argb.cc
parentf15793d6af4758fe4bd4b2b1d851301fdd7e62fb (diff)
downloadlibyuv-53e014c99d6f59647c57b70b3fa65ad3dd59ce08.tar.gz
BT.2020 pull in tests and upstream fixes; expose a few more methods.
This adds some missing prototypes from the BT.2020 CL as well as expands the H444 and J444 results. BUG=960620, libyuv:845, b/129864744 Change-Id: I8ea3959379f1bb2edb857d4eb90fb9a1f6aa4e03 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/1899093 Reviewed-by: Dale Curtis <dalecurtis@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/convert_argb.cc')
-rw-r--r--source/convert_argb.cc73
1 files changed, 64 insertions, 9 deletions
diff --git a/source/convert_argb.cc b/source/convert_argb.cc
index 47fed0a3..32c5ae0e 100644
--- a/source/convert_argb.cc
+++ b/source/convert_argb.cc
@@ -251,6 +251,25 @@ int U420ToARGB(const uint8_t* src_y,
&kYuv2020Constants, width, height);
}
+// Convert U420 to ABGR.
+LIBYUV_API
+int U420ToABGR(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_abgr,
+ int dst_stride_abgr,
+ int width,
+ int height) {
+ return I420ToARGBMatrix(src_y, src_stride_y, src_v,
+ src_stride_v, // Swap U and V
+ src_u, src_stride_u, dst_abgr, dst_stride_abgr,
+ &kYvu2020Constants, // Use Yvu matrix
+ width, height);
+}
+
// Convert I422 to ARGB with matrix
static int I422ToARGBMatrix(const uint8_t* src_y,
int src_stride_y,
@@ -424,6 +443,23 @@ int H422ToARGB(const uint8_t* src_y,
&kYuvH709Constants, 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 H422 to ABGR.
LIBYUV_API
int H422ToABGR(const uint8_t* src_y,
@@ -716,6 +752,23 @@ int H010ToARGB(const uint16_t* src_y,
&kYuvH709Constants, width, height);
}
+// Convert U010 to ARGB.
+LIBYUV_API
+int U010ToARGB(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_argb,
+ int dst_stride_argb,
+ int width,
+ int height) {
+ return I010ToARGBMatrix(src_y, src_stride_y, src_u, src_stride_u, src_v,
+ src_stride_v, dst_argb, dst_stride_argb,
+ &kYuv2020Constants, width, height);
+}
+
// Convert H010 to ABGR.
LIBYUV_API
int H010ToABGR(const uint16_t* src_y,
@@ -735,21 +788,23 @@ int H010ToABGR(const uint16_t* src_y,
width, height);
}
-// Convert U422 to ARGB.
+// Convert U010 to ABGR.
LIBYUV_API
-int U422ToARGB(const uint8_t* src_y,
+int U010ToABGR(const uint16_t* src_y,
int src_stride_y,
- const uint8_t* src_u,
+ const uint16_t* src_u,
int src_stride_u,
- const uint8_t* src_v,
+ const uint16_t* src_v,
int src_stride_v,
- uint8_t* dst_argb,
- int dst_stride_argb,
+ uint8_t* dst_abgr,
+ int dst_stride_abgr,
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);
+ return I010ToARGBMatrix(src_y, src_stride_y, src_v,
+ src_stride_v, // Swap U and V
+ src_u, src_stride_u, dst_abgr, dst_stride_abgr,
+ &kYvu2020Constants, // Use Yvu matrix
+ width, height);
}
// Convert I444 to ARGB with matrix