vp9_reconintra: simplify d45_predictor
only the immediate above right pixel is needed; this removes a conditional from the inner loop the final average calculated currently relies on above[] being extended, it could be reduced to use above[block_size - 2] + 3 * above_right Change-Id: Ica4f2b8d25eec3ca1d6fa52ef0d4adc228eeea3f
This commit is contained in:
parent
6051bcc3dc
commit
acc481eaae
@ -430,14 +430,17 @@ void vp9_d45_predictor_4x4_c(uint8_t *dst, ptrdiff_t stride,
|
|||||||
|
|
||||||
static INLINE void d45_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
|
static INLINE void d45_predictor(uint8_t *dst, ptrdiff_t stride, int bs,
|
||||||
const uint8_t *above, const uint8_t *left) {
|
const uint8_t *above, const uint8_t *left) {
|
||||||
int r, c;
|
const uint8_t above_right = above[bs - 1];
|
||||||
(void) left;
|
int x, size;
|
||||||
for (r = 0; r < bs; ++r) {
|
uint8_t avg[31]; // TODO(jzern): this could be block size specific
|
||||||
for (c = 0; c < bs; ++c)
|
(void)left;
|
||||||
dst[c] = r + c + 2 < bs * 2 ? ROUND_POWER_OF_TWO(above[r + c] +
|
|
||||||
above[r + c + 1] * 2 +
|
for (x = 0; x < bs - 1; ++x) {
|
||||||
above[r + c + 2], 2)
|
avg[x] = AVG3(above[x], above[x + 1], above[x + 2]);
|
||||||
: above[bs * 2 - 1];
|
}
|
||||||
|
for (x = 0, size = bs - 1; x < bs; ++x, --size) {
|
||||||
|
memcpy(dst, avg + x, size);
|
||||||
|
memset(dst + size, above_right, x + 1);
|
||||||
dst += stride;
|
dst += stride;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user