aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorSergio Garcia Murillo <sergio.garcia.murillo@gmail.com>2022-03-30 11:20:30 +0200
committerlibyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com>2022-03-31 15:30:53 +0000
commit4589081cea3dc5364dc433f9a20e67706fd3e29c (patch)
tree80b8051d34052257fc9bf760a0cd1c48ad6f22ef /include
parentf4d25308467cbd50c2706a46fa0ddcef939e715a (diff)
downloadlibyuv-4589081cea3dc5364dc433f9a20e67706fd3e29c.tar.gz
Add I422 and I210 functions
Bug: webrtc:13826 Change-Id: I68235a668abecf76133f7b89472b192b1442bed4 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3557217 Reviewed-by: Frank Barchard <fbarchard@chromium.org> Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'include')
-rw-r--r--include/libyuv/convert.h17
-rw-r--r--include/libyuv/planar_functions.h18
-rw-r--r--include/libyuv/scale.h66
3 files changed, 101 insertions, 0 deletions
diff --git a/include/libyuv/convert.h b/include/libyuv/convert.h
index bcdefb5d..5c2954f4 100644
--- a/include/libyuv/convert.h
+++ b/include/libyuv/convert.h
@@ -106,6 +106,23 @@ int I422ToI444(const uint8_t* src_y,
int width,
int height);
+// Convert I422 to I210.
+LIBYUV_API
+int I422ToI210(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,
+ uint16_t* dst_y,
+ int dst_stride_y,
+ uint16_t* dst_u,
+ int dst_stride_u,
+ uint16_t* dst_v,
+ int dst_stride_v,
+ int width,
+ int height);
+
// Convert MM21 to NV12.
LIBYUV_API
int MM21ToNV12(const uint8_t* src_y,
diff --git a/include/libyuv/planar_functions.h b/include/libyuv/planar_functions.h
index 1037d732..f2007c7d 100644
--- a/include/libyuv/planar_functions.h
+++ b/include/libyuv/planar_functions.h
@@ -352,6 +352,24 @@ int I444Copy(const uint8_t* src_y,
int width,
int height);
+// Copy I210 to I210.
+#define I210ToI210 I210opy
+LIBYUV_API
+int I210Copy(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,
+ uint16_t* dst_y,
+ int dst_stride_y,
+ uint16_t* dst_u,
+ int dst_stride_u,
+ uint16_t* dst_v,
+ int dst_stride_v,
+ int width,
+ int height);
+
// Copy NV12. Supports inverting.
int NV12Copy(const uint8_t* src_y,
int src_stride_y,
diff --git a/include/libyuv/scale.h b/include/libyuv/scale.h
index 3d4b6005..f7fb530a 100644
--- a/include/libyuv/scale.h
+++ b/include/libyuv/scale.h
@@ -195,6 +195,72 @@ int I444Scale_12(const uint16_t* src_y,
int dst_height,
enum FilterMode filtering);
+// Scales a YUV 4:2:2 image from the src width and height to the
+// dst width and height.
+// If filtering is kFilterNone, a simple nearest-neighbor algorithm is
+// used. This produces basic (blocky) quality at the fastest speed.
+// If filtering is kFilterBilinear, interpolation is used to produce a better
+// quality image, at the expense of speed.
+// If filtering is kFilterBox, averaging is used to produce ever better
+// quality image, at further expense of speed.
+// Returns 0 if successful.
+LIBYUV_API
+int I422Scale(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,
+ int src_width,
+ int src_height,
+ uint8_t* dst_y,
+ int dst_stride_y,
+ uint8_t* dst_u,
+ int dst_stride_u,
+ uint8_t* dst_v,
+ int dst_stride_v,
+ int dst_width,
+ int dst_height,
+ enum libyuv::FilterMode filtering);
+
+LIBYUV_API
+int I422Scale_16(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,
+ int src_width,
+ int src_height,
+ uint16_t* dst_y,
+ int dst_stride_y,
+ uint16_t* dst_u,
+ int dst_stride_u,
+ uint16_t* dst_v,
+ int dst_stride_v,
+ int dst_width,
+ int dst_height,
+ enum libyuv::FilterMode filtering);
+
+LIBYUV_API
+int I422Scale_12(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,
+ int src_width,
+ int src_height,
+ uint16_t* dst_y,
+ int dst_stride_y,
+ uint16_t* dst_u,
+ int dst_stride_u,
+ uint16_t* dst_v,
+ int dst_stride_v,
+ int dst_width,
+ int dst_height,
+ enum libyuv::FilterMode filtering);
+
// Scales an NV12 image from the src width and height to the
// dst width and height.
// If filtering is kFilterNone, a simple nearest-neighbor algorithm is