From 5b3351bd07e83f9f9a4cb6629561331ecdb7c546 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Mon, 3 May 2021 21:32:46 -0700 Subject: [PATCH] Fix ARGB1555ToI420 odd width bug in C code. Was [ RUN ] LibYUVConvertTest.ARGB1555ToI420_Any third_party/libyuv/files/unit_test/convert_test.cc:1139: Failure Expected equality of these values: dst_uv_c[i * kStrideUV + j] Which is: '\x8B' (139) dst_uv_opt[i * kStrideUV + j] Which is: '\x92' (146) third_party/libyuv/files/unit_test/convert_test.cc:1139: Failure [ FAILED ] LibYUVConvertTest.ARGB1555ToI420_Any Now [ RUN ] LibYUVConvertTest.ARGB1555ToI420_Any [ OK ] LibYUVConvertTest.ARGB1555ToI420_Any (0 ms) Bug: libyuv:894, b/155722711 Change-Id: I12dcacd0ecfff4ede5693a2554e9bb10dc8586c1 Reviewed-on: https://chromium-review.googlesource.com/c/libyuv/libyuv/+/2870484 Reviewed-by: Frank Barchard Reviewed-by: richard winterton --- source/row_common.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/row_common.cc b/source/row_common.cc index c6e412414..517b70562 100644 --- a/source/row_common.cc +++ b/source/row_common.cc @@ -965,7 +965,7 @@ void ARGB1555ToUVRow_C(const uint8_t* src_argb1555, uint8_t r0 = (src_argb1555[1] & 0x7c) >> 2; uint8_t b2 = next_argb1555[0] & 0x1f; uint8_t g2 = (next_argb1555[0] >> 5) | ((next_argb1555[1] & 0x03) << 3); - uint8_t r2 = next_argb1555[1] >> 3; + uint8_t r2 = (next_argb1555[1] & 0x7c) >> 2; b0 = (b0 << 3) | (b0 >> 2); g0 = (g0 << 3) | (g0 >> 2);