neon: add INIT_VECTOR4

used to initialize NxMx4 vector types
replaces initialization via '{{ }}' gnu-ism.

Change-Id: I0da7b3d321f3d48579b7863fb2e4d3f449ae7f5e
This commit is contained in:
James Zern
2014-06-29 13:40:45 -07:00
parent 6c1c632b03
commit bc03670f01
5 changed files with 53 additions and 29 deletions

View File

@ -49,7 +49,9 @@
// (register alloc, probably). The variants somewhat mitigate the problem, but
// not quite. HFilter16i() remains problematic.
static WEBP_INLINE uint8x8x4_t Load4x8(const uint8_t* const src, int stride) {
uint8x8x4_t out = {{{0}, {0}, {0}, {0}}};
const uint8x8_t zero = vdup_n_u8(0);
uint8x8x4_t out;
INIT_VECTOR4(out, zero, zero, zero, zero);
out = vld4_lane_u8(src + 0 * stride, out, 0);
out = vld4_lane_u8(src + 1 * stride, out, 1);
out = vld4_lane_u8(src + 2 * stride, out, 2);
@ -84,7 +86,9 @@ static WEBP_INLINE void Load4x16(const uint8_t* const src, int stride,
static WEBP_INLINE void Load4x16(const uint8_t* src, int stride,
uint8x16_t* const p1, uint8x16_t* const p0,
uint8x16_t* const q0, uint8x16_t* const q1) {
uint32x4x4_t in = {{{0}, {0}, {0}, {0}}};
const uint32x4_t zero = vdupq_n_u32(0);
uint32x4x4_t in;
INIT_VECTOR4(in, zero, zero, zero, zero);
src -= 2;
LOADQ_LANE_32b(in.val[0], 0);
LOADQ_LANE_32b(in.val[1], 0);
@ -273,10 +277,13 @@ static WEBP_INLINE void Store4x8(const uint8x8x4_t v,
static WEBP_INLINE void Store4x16(const uint8x16_t p1, const uint8x16_t p0,
const uint8x16_t q0, const uint8x16_t q1,
uint8_t* const dst, int stride) {
const uint8x8x4_t lo = {{ vget_low_u8(p1), vget_low_u8(p0),
vget_low_u8(q0), vget_low_u8(q1) }};
const uint8x8x4_t hi = {{ vget_high_u8(p1), vget_high_u8(p0),
vget_high_u8(q0), vget_high_u8(q1) }};
uint8x8x4_t lo, hi;
INIT_VECTOR4(lo,
vget_low_u8(p1), vget_low_u8(p0),
vget_low_u8(q0), vget_low_u8(q1));
INIT_VECTOR4(hi,
vget_high_u8(p1), vget_high_u8(p0),
vget_high_u8(q0), vget_high_u8(q1));
Store4x8(lo, dst - 2 + 0 * stride, stride);
Store4x8(hi, dst - 2 + 8 * stride, stride);
}
@ -355,10 +362,13 @@ static WEBP_INLINE void Store4x8x2(const uint8x16_t p1, const uint8x16_t p0,
const uint8x16_t q0, const uint8x16_t q1,
uint8_t* const u, uint8_t* const v,
int stride) {
const uint8x8x4_t u0 = {{ vget_low_u8(p1), vget_low_u8(p0),
vget_low_u8(q0), vget_low_u8(q1) }};
const uint8x8x4_t v0 = {{ vget_high_u8(p1), vget_high_u8(p0),
vget_high_u8(q0), vget_high_u8(q1) }};
uint8x8x4_t u0, v0;
INIT_VECTOR4(u0,
vget_low_u8(p1), vget_low_u8(p0),
vget_low_u8(q0), vget_low_u8(q1));
INIT_VECTOR4(v0,
vget_high_u8(p1), vget_high_u8(p0),
vget_high_u8(q0), vget_high_u8(q1));
vst4_lane_u8(u - 2 + 0 * stride, u0, 0);
vst4_lane_u8(u - 2 + 1 * stride, u0, 1);
vst4_lane_u8(u - 2 + 2 * stride, u0, 2);