From 5bf4de0806ceadfd3bfe19c3956c2ca43c092582 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Wed, 21 Oct 2015 12:45:08 -0700 Subject: [PATCH] width and 3 bug fix in odd width support of ARGBToI411 TBR=harryjin@google.com BUG=none Review URL: https://codereview.chromium.org/1415213002 . --- source/row_any.cc | 6 +++--- unit_test/unit_test.cc | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/source/row_any.cc b/source/row_any.cc index 69562d7d8..630ebb72e 100644 --- a/source/row_any.cc +++ b/source/row_any.cc @@ -678,17 +678,17 @@ ANY1(ARGBSetRow_Any_NEON, ARGBSetRow_NEON, uint32, 4, 3) temp + SS(r, UVSHIFT) * BPP - BPP, 4); \ } \ /* repeat last 4 - 12 bytes for 411 subsampler */ \ - if (((width & 1) == 1) && BPP == 4 && DUVSHIFT == 2) { \ + if (((width & 3) == 1) && BPP == 4 && DUVSHIFT == 2) { \ memcpy(temp + SS(r, UVSHIFT) * BPP, \ temp + SS(r, UVSHIFT) * BPP - BPP, 4); \ memcpy(temp + SS(r, UVSHIFT) * BPP + 4, \ temp + SS(r, UVSHIFT) * BPP - BPP, 8); \ } \ - if (((width & 1) == 2) && BPP == 4 && DUVSHIFT == 2) { \ + if (((width & 3) == 2) && BPP == 4 && DUVSHIFT == 2) { \ memcpy(temp + SS(r, UVSHIFT) * BPP, \ temp + SS(r, UVSHIFT) * BPP - BPP * 2, 8); \ } \ - if (((width & 1) == 3) && BPP == 4 && DUVSHIFT == 2) { \ + if (((width & 3) == 3) && BPP == 4 && DUVSHIFT == 2) { \ memcpy(temp + SS(r, UVSHIFT) * BPP, \ temp + SS(r, UVSHIFT) * BPP - BPP, 4); \ } \ diff --git a/unit_test/unit_test.cc b/unit_test/unit_test.cc index 594dd334a..fb29c2574 100644 --- a/unit_test/unit_test.cc +++ b/unit_test/unit_test.cc @@ -33,7 +33,7 @@ DEFINE_int32(libyuv_flags, 0, "cpu flags for reference code. 0 = C -1 = asm"); // Set flags to -1 for benchmarking to avoid slower C code. LibYUVConvertTest::LibYUVConvertTest() : - benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(128), + benchmark_iterations_(BENCHMARK_ITERATIONS), benchmark_width_(130), benchmark_height_(72), disable_cpu_flags_(0) { const char* repeat = getenv("LIBYUV_REPEAT"); if (repeat) {