From af87c11c9a21bb02e6670768b8cda6567001d08c Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Fri, 7 Oct 2016 18:35:42 -0700 Subject: [PATCH] YUY2ToI422 coalesce rows for small images TBR=wangcheng@google.com BUG=libyuv:647 TESTED=LibYUVConvertTest.YUY2ToI422_Opt Review URL: https://codereview.chromium.org/2393393006 . --- source/planar_functions.cc | 6 ++++-- source/row_any.cc | 4 ++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/source/planar_functions.cc b/source/planar_functions.cc index d24393f68..45bae1ffd 100644 --- a/source/planar_functions.cc +++ b/source/planar_functions.cc @@ -447,7 +447,8 @@ int YUY2ToI422(const uint8* src_yuy2, int src_stride_yuy2, if (src_stride_yuy2 == width * 2 && dst_stride_y == width && dst_stride_u * 2 == width && - dst_stride_v * 2 == width) { + dst_stride_v * 2 == width && + width * height <= 32768) { width *= height; height = 1; src_stride_yuy2 = dst_stride_y = dst_stride_u = dst_stride_v = 0; @@ -531,7 +532,8 @@ int UYVYToI422(const uint8* src_uyvy, int src_stride_uyvy, if (src_stride_uyvy == width * 2 && dst_stride_y == width && dst_stride_u * 2 == width && - dst_stride_v * 2 == width) { + dst_stride_v * 2 == width && + width * height <= 32768) { width *= height; height = 1; src_stride_uyvy = dst_stride_y = dst_stride_u = dst_stride_v = 0; diff --git a/source/row_any.cc b/source/row_any.cc index af9ecc511..ae84a82f8 100644 --- a/source/row_any.cc +++ b/source/row_any.cc @@ -440,13 +440,13 @@ ANY11(ARGB4444ToYRow_Any_NEON, ARGB4444ToYRow_NEON, 0, 2, 1, 7) ANY11(YUY2ToYRow_Any_NEON, YUY2ToYRow_NEON, 1, 4, 1, 15) #endif #ifdef HAS_UYVYTOYROW_NEON -ANY11(UYVYToYRow_Any_NEON, UYVYToYRow_NEON, 0, 2, 1, 15) +ANY11(UYVYToYRow_Any_NEON, UYVYToYRow_NEON, 1, 4, 1, 15) #endif #ifdef HAS_YUY2TOYROW_MSA ANY11(YUY2ToYRow_Any_MSA, YUY2ToYRow_MSA, 1, 4, 1, 31) #endif #ifdef HAS_UYVYTOYROW_MSA -ANY11(UYVYToYRow_Any_MSA, UYVYToYRow_MSA, 0, 2, 1, 31) +ANY11(UYVYToYRow_Any_MSA, UYVYToYRow_MSA, 1, 4, 1, 31) #endif #ifdef HAS_RGB24TOARGBROW_NEON ANY11(RGB24ToARGBRow_Any_NEON, RGB24ToARGBRow_NEON, 0, 3, 4, 7)