diff options
author | Sergio Garcia Murillo <sergio.garcia.murillo@gmail.com> | 2023-01-03 22:09:09 +0100 |
---|---|---|
committer | libyuv LUCI CQ <libyuv-scoped@luci-project-accounts.iam.gserviceaccount.com> | 2023-01-03 21:41:21 +0000 |
commit | 22a579c438410710f627e67b38b3df9968efafb9 (patch) | |
tree | 6ebcb28dc9e25236ec27eefe15557867740d646c /source/convert.cc | |
parent | f583b1b4b82ef71eba776c3591c82227db615c75 (diff) | |
download | libyuv-22a579c438410710f627e67b38b3df9968efafb9.tar.gz |
Use ScalePlaneDown2_16To8 for avoiding the 2 step process
Bug: libyuv:950
Change-Id: I5a77bca9a0230fe00abd810939e217833a14683f
Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/4134524
Reviewed-by: Frank Barchard <fbarchard@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@chromium.org>
Diffstat (limited to 'source/convert.cc')
-rw-r--r-- | source/convert.cc | 17 |
1 files changed, 4 insertions, 13 deletions
diff --git a/source/convert.cc b/source/convert.cc index 8b2373ec..5ee3dab5 100644 --- a/source/convert.cc +++ b/source/convert.cc @@ -325,23 +325,14 @@ int I410ToI420(const uint16_t* src_y, { const int uv_width = SUBSAMPLE(width, 1, 1); - const int uv_stride = uv_width; const int uv_height = SUBSAMPLE(height, 1, 1); - // Scale uv planes using Y plane as temp buffer and then convert to 8 bits. - ScalePlane_12(src_u, src_stride_u, width, height, (uint16_t*)dst_y, - uv_stride, uv_width, uv_height, kFilterBilinear); - Convert16To8Plane((uint16_t*)dst_y, uv_stride, dst_u, dst_stride_u, scale, - uv_width, uv_height); - - ScalePlane_12(src_v, src_stride_v, width, height, (uint16_t*)dst_y, - uv_stride, uv_width, uv_height, kFilterBilinear); - Convert16To8Plane((uint16_t*)dst_y, uv_stride, dst_v, dst_stride_v, scale, - uv_width, uv_height); - - // Convert Y plane last. Convert16To8Plane(src_y, src_stride_y, dst_y, dst_stride_y, scale, width, height); + ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_u, + dst_stride_u, src_u, dst_u, scale, kFilterBilinear); + ScalePlaneDown2_16To8(width, height, uv_width, uv_height, src_stride_v, + dst_stride_v, src_v, dst_v, scale, kFilterBilinear); } return 0; } |