summaryrefslogtreecommitdiff
path: root/vpx_dsp/arm
diff options
context:
space:
mode:
authorSalome Thirot <salome.thirot@arm.com>2023-02-23 12:05:30 +0000
committerSalome Thirot <salome.thirot@arm.com>2023-02-24 11:10:14 +0000
commit111068923b4ca778a680330d00161d7ee93f61e1 (patch)
tree5aadf905ea0da58ff58f6c7a2e7920984f36b09b /vpx_dsp/arm
parent6ec45f933c6c4de3fcd9344852bde25d30613321 (diff)
downloadlibvpx-111068923b4ca778a680330d00161d7ee93f61e1.tar
libvpx-111068923b4ca778a680330d00161d7ee93f61e1.tar.gz
libvpx-111068923b4ca778a680330d00161d7ee93f61e1.tar.bz2
libvpx-111068923b4ca778a680330d00161d7ee93f61e1.zip
Add Neon implementation of high bitdepth 32x32 hadamard transform
Add Neon implementation of vpx_highbd_hadamard_32x32 as well as the corresponding tests. Change-Id: I65d8603896649de1996b353aa79eee54824b4708
Diffstat (limited to 'vpx_dsp/arm')
-rw-r--r--vpx_dsp/arm/highbd_hadamard_neon.c39
1 files changed, 39 insertions, 0 deletions
diff --git a/vpx_dsp/arm/highbd_hadamard_neon.c b/vpx_dsp/arm/highbd_hadamard_neon.c
index 013f7148f..499eb6546 100644
--- a/vpx_dsp/arm/highbd_hadamard_neon.c
+++ b/vpx_dsp/arm/highbd_hadamard_neon.c
@@ -174,3 +174,42 @@ void vpx_highbd_hadamard_16x16_neon(const int16_t *src_diff,
store_s32q_to_tran_low(coeff + 4 * i + 192, c3);
} while (++i < 16);
}
+
+void vpx_highbd_hadamard_32x32_neon(const int16_t *src_diff,
+ ptrdiff_t src_stride, tran_low_t *coeff) {
+ int i = 0;
+
+ // Rearrange 32x32 to 16x64 and remove stride.
+ // Top left first.
+ vpx_highbd_hadamard_16x16_neon(src_diff, src_stride, coeff);
+ // Top right.
+ vpx_highbd_hadamard_16x16_neon(src_diff + 16, src_stride, coeff + 256);
+ // Bottom left.
+ vpx_highbd_hadamard_16x16_neon(src_diff + 16 * src_stride, src_stride,
+ coeff + 512);
+ // Bottom right.
+ vpx_highbd_hadamard_16x16_neon(src_diff + 16 * src_stride + 16, src_stride,
+ coeff + 768);
+
+ do {
+ int32x4_t a0 = load_tran_low_to_s32q(coeff + 4 * i);
+ int32x4_t a1 = load_tran_low_to_s32q(coeff + 4 * i + 256);
+ int32x4_t a2 = load_tran_low_to_s32q(coeff + 4 * i + 512);
+ int32x4_t a3 = load_tran_low_to_s32q(coeff + 4 * i + 768);
+
+ int32x4_t b0 = vhaddq_s32(a0, a1);
+ int32x4_t b1 = vhsubq_s32(a0, a1);
+ int32x4_t b2 = vhaddq_s32(a2, a3);
+ int32x4_t b3 = vhsubq_s32(a2, a3);
+
+ int32x4_t c0 = vhaddq_s32(b0, b2);
+ int32x4_t c1 = vhaddq_s32(b1, b3);
+ int32x4_t c2 = vhsubq_s32(b0, b2);
+ int32x4_t c3 = vhsubq_s32(b1, b3);
+
+ store_s32q_to_tran_low(coeff + 4 * i, c0);
+ store_s32q_to_tran_low(coeff + 4 * i + 256, c1);
+ store_s32q_to_tran_low(coeff + 4 * i + 512, c2);
+ store_s32q_to_tran_low(coeff + 4 * i + 768, c3);
+ } while (++i < 64);
+}