From 72a235af9f8fa161a04e19ef6334772a9aabc9d4 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Tue, 16 Jun 2015 16:27:15 -0700 Subject: [PATCH] repeat y for yuy2 so that unittests that check the 2nd y on odd widths will match the C and SIMD. The C code duplicates the last Y. R=harryjin@google.com BUG=libyuv:455 Review URL: https://webrtc-codereview.appspot.com/50249004. --- source/row_any.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/source/row_any.cc b/source/row_any.cc index 4ec36982c..24ef12ab5 100644 --- a/source/row_any.cc +++ b/source/row_any.cc @@ -38,6 +38,9 @@ static void fmemcpy(uint8* d, const uint8* s, int len) { I420TORGB_SIMD(y_buf, u_buf, v_buf, rgb_buf, n); \ } \ fmemcpy(temp, y_buf + n, r); \ + if (width & 1) { \ + temp[r] = temp[r - 1]; /* repeat last Y for subsampling */ \ + } \ fmemcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ fmemcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \ I420TORGB_SIMD(temp, temp + 64, temp + 128, temp + 192, MASK + 1); \