mirror of
https://github.com/webmproject/libwebp.git
synced 2024-11-20 04:18:26 +01:00
dec_neon: DC4: use pair-wise adds for top row
reduces load count, slightly faster Change-Id: I880340ef8ef75ce4ce321c330f56f86b758bda08
This commit is contained in:
parent
f7ada560ce
commit
b5bc15305b
@ -1262,21 +1262,17 @@ static void TransformAC3(const int16_t* in, uint8_t* dst) {
|
||||
// 4x4
|
||||
|
||||
static void DC4(uint8_t* dst) { // DC
|
||||
const uint16x8_t A0 = vmovl_u8(vld1_u8(dst - BPS + 0));
|
||||
const uint16x8_t A1 = vmovl_u8(vld1_u8(dst - BPS + 1));
|
||||
const uint16x8_t A2 = vmovl_u8(vld1_u8(dst - BPS + 2));
|
||||
const uint16x8_t A3 = vmovl_u8(vld1_u8(dst - BPS + 3));
|
||||
const uint8x8_t A = vld1_u8(dst - BPS); // top row
|
||||
const uint16x4_t p0 = vpaddl_u8(A); // cascading summation of the top
|
||||
const uint16x4_t p1 = vpadd_u16(p0, p0);
|
||||
const uint16x8_t L0 = vmovl_u8(vld1_u8(dst + 0 * BPS - 1));
|
||||
const uint16x8_t L1 = vmovl_u8(vld1_u8(dst + 1 * BPS - 1));
|
||||
const uint16x8_t L2 = vmovl_u8(vld1_u8(dst + 2 * BPS - 1));
|
||||
const uint16x8_t L3 = vmovl_u8(vld1_u8(dst + 3 * BPS - 1));
|
||||
const uint16x8_t s0 = vaddq_u16(A0, L0);
|
||||
const uint16x8_t s1 = vaddq_u16(A1, L1);
|
||||
const uint16x8_t s2 = vaddq_u16(A2, L2);
|
||||
const uint16x8_t s3 = vaddq_u16(A3, L3);
|
||||
const uint16x8_t s0 = vaddq_u16(L0, L1);
|
||||
const uint16x8_t s1 = vaddq_u16(L2, L3);
|
||||
const uint16x8_t s01 = vaddq_u16(s0, s1);
|
||||
const uint16x8_t s23 = vaddq_u16(s2, s3);
|
||||
const uint16x8_t sum = vaddq_u16(s01, s23);
|
||||
const uint16x8_t sum = vaddq_u16(s01, vcombine_u16(p1, p1));
|
||||
const uint8x8_t dc0 = vrshrn_n_u16(sum, 3); // (sum + 4) >> 3
|
||||
const uint8x8_t dc = vdup_lane_u8(dc0, 0);
|
||||
int i;
|
||||
|
Loading…
Reference in New Issue
Block a user