diff options
author | Frank Barchard <fbarchard@google.com> | 2017-09-05 14:40:27 -0700 |
---|---|---|
committer | Frank Barchard <fbarchard@google.com> | 2017-09-05 21:40:39 +0000 |
commit | 8f5e9cd9ebc76c39155c48e8420fe76ef7cac185 (patch) | |
tree | 625bf596f993b083dd9dff1fb48a361aca8b4b8b /source/scale_common.cc | |
parent | 2621c91bf1e138a88cb869b195cdbe0c9dfcdd6d (diff) | |
download | libyuv-8f5e9cd9ebc76c39155c48e8420fe76ef7cac185.tar.gz |
ScaleRowUp2_16_C port of NEON to C
Single pass upsample with bilinear filter.
NEON version optimized - Pixel Sailfish QC821
Was TestScaleRowUp2_16 (5741 ms)
Now TestScaleRowUp2_16 (4484 ms)
C TestScaleRowUp2_16 (6555 ms)
TBR=kjellander@chromium.org
BUG=libyuv:718
TEST=LibYUVScaleTest.TestScaleRowUp2_16 (709 ms)
Change-Id: Ib04ceb53e0ab644a392c39c3396e313530161d92
Reviewed-on: https://chromium-review.googlesource.com/646701
Reviewed-by: Frank Barchard <fbarchard@google.com>
Reviewed-by: Cheng Wang <wangcheng@google.com>
Diffstat (limited to 'source/scale_common.cc')
-rw-r--r-- | source/scale_common.cc | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/source/scale_common.cc b/source/scale_common.cc index 1bef39df..fefb027b 100644 --- a/source/scale_common.cc +++ b/source/scale_common.cc @@ -1306,6 +1306,35 @@ void ScaleSlope(int src_width, } #undef CENTERSTART +// Read 8x2 upsample with filtering and write 16x1. +// actually reads an extra pixel, so 9x2. +void ScaleRowUp2_16_C(const uint16* src_ptr, + ptrdiff_t src_stride, + uint16* dst, + int dst_width) { + const uint16* src2 = src_ptr + src_stride; + + int x; + for (x = 0; x < dst_width - 1; x += 2) { + uint16 p0 = src_ptr[0]; + uint16 p1 = src_ptr[1]; + uint16 p2 = src2[0]; + uint16 p3 = src2[1]; + dst[0] = (p0 * 9 + p1 * 3 + p2 * 3 + p3 + 8) >> 4; + dst[1] = (p0 * 3 + p1 * 9 + p2 + p3 * 3 + 8) >> 4; + ++src_ptr; + ++src2; + dst += 2; + } + if (dst_width & 1) { + uint16 p0 = src_ptr[0]; + uint16 p1 = src_ptr[1]; + uint16 p2 = src2[0]; + uint16 p3 = src2[1]; + dst[0] = (p0 * 9 + p1 * 3 + p2 * 3 + p3 + 8) >> 4; + } +} + #ifdef __cplusplus } // extern "C" } // namespace libyuv |