]> granicus.if.org Git - libvpx/commitdiff
sad neon: macroize 32xN definitions
authorJohann <johannkoenig@google.com>
Thu, 6 Jul 2017 15:33:15 +0000 (08:33 -0700)
committerJohann <johannkoenig@google.com>
Fri, 7 Jul 2017 14:04:04 +0000 (07:04 -0700)
Change-Id: I0020a49e77d27514375a03095d5821dc0aa7d128

vpx_dsp/arm/sad_neon.c

index 9951b92dabc2ac12decc7c5348385fc4363b7774..75352ef96545ebcfa2ff46dc0d7783a4af87aa09 100644 (file)
@@ -211,23 +211,16 @@ static INLINE uint16x8_t sad32x(const uint8_t *a, int a_stride,
   return abs;
 }
 
-uint32_t vpx_sad32x16_neon(const uint8_t *src, int src_stride,
-                           const uint8_t *ref, int ref_stride) {
-  const uint16x8_t abs = sad32x(src, src_stride, ref, ref_stride, 16);
-  return horizontal_add_16x8(abs);
-}
-
-uint32_t vpx_sad32x32_neon(const uint8_t *src, int src_stride,
-                           const uint8_t *ref, int ref_stride) {
-  const uint16x8_t abs = sad32x(src, src_stride, ref, ref_stride, 32);
-  return horizontal_add_16x8(abs);
-}
+#define sad32xN(n)                                                      \
+  uint32_t vpx_sad32x##n##_neon(const uint8_t *src, int src_stride,     \
+                                const uint8_t *ref, int ref_stride) {   \
+    const uint16x8_t abs = sad32x(src, src_stride, ref, ref_stride, n); \
+    return horizontal_add_16x8(abs);                                    \
+  }
 
-uint32_t vpx_sad32x64_neon(const uint8_t *src, int src_stride,
-                           const uint8_t *ref, int ref_stride) {
-  const uint16x8_t abs = sad32x(src, src_stride, ref, ref_stride, 64);
-  return horizontal_add_16x8(abs);
-}
+sad32xN(16);
+sad32xN(32);
+sad32xN(64);
 
 static INLINE uint32_t horizontal_add_32x4(const uint32x4_t a) {
   const uint64x2_t b = vpaddlq_u32(a);