From 5c95fd921e0d6204f132021e8d86bde8596f107d Mon Sep 17 00:00:00 2001 From: James Zern Date: Fri, 8 Sep 2017 18:52:01 -0700 Subject: [PATCH] intrapred: sync highbd_d45_predictor w/d45_ 8/16/32:: ~19%/~54%/~75.5% faster previously: acc481eaa vp9_reconintra: simplify d45_predictor BUG=webm:1411 Change-Id: Ie8340b0c5070ae640f124733f025e4e749b660d8 --- vpx_dsp/intrapred.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/vpx_dsp/intrapred.c b/vpx_dsp/intrapred.c index 9e2048ebf..4c640e5d2 100644 --- a/vpx_dsp/intrapred.c +++ b/vpx_dsp/intrapred.c @@ -504,15 +504,20 @@ static INLINE void highbd_d63_predictor(uint16_t *dst, ptrdiff_t stride, int bs, static INLINE void highbd_d45_predictor(uint16_t *dst, ptrdiff_t stride, int bs, const uint16_t *above, const uint16_t *left, int bd) { - int r, c; + const uint16_t above_right = above[bs - 1]; + const uint16_t *const dst_row0 = dst; + int x, size; (void)left; (void)bd; - for (r = 0; r < bs; ++r) { - for (c = 0; c < bs; ++c) { - dst[c] = r + c + 2 < bs * 2 - ? AVG3(above[r + c], above[r + c + 1], above[r + c + 2]) - : above[bs * 2 - 1]; - } + + for (x = 0; x < bs - 1; ++x) { + dst[x] = AVG3(above[x], above[x + 1], above[x + 2]); + } + dst[bs - 1] = above_right; + dst += stride; + for (x = 1, size = bs - 2; x < bs; ++x, --size) { + memcpy(dst, dst_row0 + x, size * sizeof(*dst)); + vpx_memset16(dst + size, above_right, x + 1); dst += stride; } } -- 2.40.0