Fix for ScaleDownBy4_Linear_16

The unittest compares the results of 8 and 16 bit scaling
and expects them to be the same.  This CL makes the 16 bit
scaling filter logic match.

Bug: libyuv:749
Test: LibYUVScaleTest.DISABLED_ScaleDownBy4_Linear_16
Change-Id: Ifb3ca4d770ef38f9f16abe9b9aeb843b779bf371
Reviewed-on: https://chromium-review.googlesource.com/772370
Reviewed-by: Weiyong Yao <braveyao@chromium.org>
Commit-Queue: Frank Barchard <fbarchard@google.com>
This commit is contained in:
Frank Barchard 2017-11-15 10:48:42 -08:00 committed by Commit Bot
parent 3cf056f8c3
commit 630c8ed1e0

View File

@ -1700,7 +1700,7 @@ void ScalePlane_16(const uint16* src,
CopyPlane_16(src, src_stride, dst, dst_stride, dst_width, dst_height);
return;
}
if (dst_width == src_width) {
if (dst_width == src_width && filtering != kFilterBox) {
int dy = FixedDiv(src_height, dst_height);
// Arbitrary scale vertically, but unscaled vertically.
ScalePlaneVertical_16(src_height, dst_width, dst_height, src_stride,
@ -1729,7 +1729,7 @@ void ScalePlane_16(const uint16* src,
return;
}
if (4 * dst_width == src_width && 4 * dst_height == src_height &&
filtering != kFilterBilinear) {
(filtering == kFilterBox || filtering == kFilterNone)) {
// optimized, 1/4
ScalePlaneDown4_16(src_width, src_height, dst_width, dst_height,
src_stride, dst_stride, src, dst, filtering);