aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--vpx_dsp/intrapred.c19
1 files 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;
}
}