diff options
author | Frank Barchard <fbarchard@google.com> | 2022-04-07 11:53:03 -0700 |
---|---|---|
committer | libyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2022-04-07 21:06:44 +0000 |
commit | 2ad73733d93e0fc8932178e4211b3b4c36443ad1 (patch) | |
tree | e8ecd7b4bedb6cdd627a85f4dc52a53858814260 /source/convert.cc | |
parent | a77d615e1067fe5bb48444a073f7ee08fd273b8a (diff) | |
download | libyuv-2ad73733d93e0fc8932178e4211b3b4c36443ad1.tar.gz |
I422Rotate update to remove name space for ios build warning
- Remove libyuv:: from within libyuv to resolve a build warning on IOS.
- Check src_y parameter is not NULL if there is a dst_y parameter
- Apply clang-format
- Bump version
Performance on Intel Skylake Xeon
ARGBRotate90_Opt (795 ms)
I420Rotate90_Opt (283 ms)
I422Rotate90_Opt (867 ms) <-- scales and rotates
I444Rotate90_Opt (565 ms)
NV12Rotate90_Opt (289 ms)
Performance on Pixel 4 (Cortex A76)
ARGBRotate90_Opt (4208 ms)
I420Rotate90_Opt (273 ms)
I422Rotate90_Opt (1207 ms)
I444Rotate90_Opt (718 ms)
NV12Rotate90_Opt (282 ms)
Bug: libyuv:926
Change-Id: I42e1b93a9595f6ed075918e91bed977dd3d23f6f
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/3576778
Reviewed-by: Mirko Bonadei <mbonadei@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/convert.cc')
-rw-r--r-- | source/convert.cc | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/source/convert.cc b/source/convert.cc index 5ce7826c..38f0a0a5 100644 --- a/source/convert.cc +++ b/source/convert.cc @@ -83,7 +83,7 @@ int I420Copy(const uint8_t* src_y, int height) { int halfwidth = (width + 1) >> 1; int halfheight = (height + 1) >> 1; - if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { + if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. @@ -125,7 +125,7 @@ int I010Copy(const uint16_t* src_y, int height) { int halfwidth = (width + 1) >> 1; int halfheight = (height + 1) >> 1; - if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { + if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. @@ -169,7 +169,7 @@ static int Planar16bitTo8bit(const uint16_t* src_y, int uv_width = SUBSAMPLE(width, subsample_x, subsample_x); int uv_height = SUBSAMPLE(height, subsample_y, subsample_y); int scale = 1 << (24 - depth); - if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { + if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. @@ -539,7 +539,7 @@ int I422ToI210(const uint8_t* src_y, int width, int height) { int halfwidth = (width + 1) >> 1; - if (!src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { + if ((!src_y && dst_y) || !src_u || !src_v || !dst_u || !dst_v || width <= 0 || height == 0) { return -1; } // Negative height means invert the image. @@ -554,13 +554,13 @@ int I422ToI210(const uint8_t* src_y, } // Convert Y plane. - libyuv::Convert8To16Plane(src_y, src_stride_y, dst_y, dst_stride_y, 1024, - width, height); + Convert8To16Plane(src_y, src_stride_y, dst_y, dst_stride_y, 1024, width, + height); // Convert UV planes. - libyuv::Convert8To16Plane(src_u, src_stride_u, dst_u, dst_stride_u, 1024, - halfwidth, height); - libyuv::Convert8To16Plane(src_v, src_stride_v, dst_v, dst_stride_v, 1024, - halfwidth, height); + Convert8To16Plane(src_u, src_stride_u, dst_u, dst_stride_u, 1024, halfwidth, + height); + Convert8To16Plane(src_v, src_stride_v, dst_v, dst_stride_v, 1024, halfwidth, + height); return 0; } |