From: Johann Date: Thu, 6 Jul 2017 15:03:45 +0000 (-0700) Subject: sad neon: macroize 16xN definitions X-Git-Tag: v1.7.0~322^2~5 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3c18acf45234ea801b5f966467c6837e442ef4c0;p=libvpx sad neon: macroize 16xN definitions Change-Id: I5aea6ffbfa48eb1970afe3be54f0bba275d7fa58 --- diff --git a/vpx_dsp/arm/sad_neon.c b/vpx_dsp/arm/sad_neon.c index baaaf6378..170cd9f96 100644 --- a/vpx_dsp/arm/sad_neon.c +++ b/vpx_dsp/arm/sad_neon.c @@ -151,23 +151,16 @@ static INLINE uint16x8_t sad16x(const uint8_t *a, int a_stride, 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); -} - -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); -} +#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_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,