ref: 3c18acf45234ea801b5f966467c6837e442ef4c0
parent: 9b253f9f0a91ea4d00c40a70c274c746186302f6
author: Johann <johannkoenig@google.com>
date: Thu Jul 6 04:03:45 EDT 2017
sad neon: macroize 16xN definitions Change-Id: I5aea6ffbfa48eb1970afe3be54f0bba275d7fa58
--- a/vpx_dsp/arm/sad_neon.c
+++ b/vpx_dsp/arm/sad_neon.c
@@ -151,23 +151,16 @@
return abs;
}
-uint32_t vpx_sad16x8_neon(const uint8_t *src, int src_stride,
- const uint8_t *ref, int ref_stride) {
- const uint16x8_t abs = sad16x(src, src_stride, ref, ref_stride, 8);
- return horizontal_add_16x8(abs);
-}
+#define sad16xN(n) \
+ uint32_t vpx_sad16x##n##_neon(const uint8_t *src, int src_stride, \
+ const uint8_t *ref, int ref_stride) { \
+ const uint16x8_t abs = sad16x(src, src_stride, ref, ref_stride, n); \
+ return horizontal_add_16x8(abs); \
+ }
-uint32_t vpx_sad16x16_neon(const uint8_t *src, int src_stride,
- const uint8_t *ref, int ref_stride) {
- const uint16x8_t abs = sad16x(src, src_stride, ref, ref_stride, 16);
- return horizontal_add_16x8(abs);
-}
-
-uint32_t vpx_sad16x32_neon(const uint8_t *src, int src_stride,
- const uint8_t *ref, int ref_stride) {
- const uint16x8_t abs = sad16x(src, src_stride, ref, ref_stride, 32);
- return horizontal_add_16x8(abs);
-}
+sad16xN(8);
+sad16xN(16);
+sad16xN(32);
static INLINE uint16x8_t sad32x(const uint8_t *a, int a_stride,
const uint8_t *b, int b_stride,