From 44ff3c333d62ef5101ada0a3f8937b79d9964783 Mon Sep 17 00:00:00 2001 From: Frank Barchard Date: Tue, 16 Jun 2015 12:44:15 -0700 Subject: [PATCH] split share macro R=harryjin@google.com BUG=libyuv:448 Review URL: https://webrtc-codereview.appspot.com/55609004. --- source/row_any.cc | 42 +++++++++++++----------------------------- 1 file changed, 13 insertions(+), 29 deletions(-) diff --git a/source/row_any.cc b/source/row_any.cc index ebc1bf986..4ec36982c 100644 --- a/source/row_any.cc +++ b/source/row_any.cc @@ -491,6 +491,19 @@ ANY11P(ARGBShuffleRow_Any_NEON, ARGBShuffleRow_NEON, ARGBShuffleRow_C, 4, 4, 3) r); \ } +#ifdef HAS_SPLITUVROW_SSE2 +ANY12(SplitUVRow_Any_SSE2, SplitUVRow_SSE2, SplitUVRow_C, 2, 0, 15) +#endif +#ifdef HAS_SPLITUVROW_AVX2 +ANY12(SplitUVRow_Any_AVX2, SplitUVRow_AVX2, SplitUVRow_C, 2, 0, 31) +#endif +#ifdef HAS_SPLITUVROW_NEON +ANY12(SplitUVRow_Any_NEON, SplitUVRow_NEON, SplitUVRow_C, 2, 0, 15) +#endif +#ifdef HAS_SPLITUVROW_MIPS_DSPR2 +ANY12(SplitUVRow_Any_MIPS_DSPR2, SplitUVRow_MIPS_DSPR2, SplitUVRow_C, 2, 0, 15) +#endif + #ifdef HAS_ARGBTOUV444ROW_SSSE3 ANY12(ARGBToUV444Row_Any_SSSE3, ARGBToUV444Row_SSSE3, ARGBToUV444Row_C, 4, 0, 15) @@ -596,35 +609,6 @@ ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow_NEON, UYVYToUVRow_C, 2, 15) #endif #undef ANY12S -// todo(fbarchard): share with any12 -#define SPLITUVROWANY(NAMEANY, ANYTOUV_SIMD, ANYTOUV_C, MASK) \ - void NAMEANY(const uint8* src_uv, uint8* dst_u, uint8* dst_v, int width) { \ - int r = width & MASK; \ - int n = width & ~MASK; \ - if (n > 0) { \ - ANYTOUV_SIMD(src_uv, dst_u, dst_v, n); \ - } \ - ANYTOUV_C(src_uv + n * 2, \ - dst_u + n, \ - dst_v + n, \ - r); \ - } - -#ifdef HAS_SPLITUVROW_SSE2 -SPLITUVROWANY(SplitUVRow_Any_SSE2, SplitUVRow_SSE2, SplitUVRow_C, 15) -#endif -#ifdef HAS_SPLITUVROW_AVX2 -SPLITUVROWANY(SplitUVRow_Any_AVX2, SplitUVRow_AVX2, SplitUVRow_C, 31) -#endif -#ifdef HAS_SPLITUVROW_NEON -SPLITUVROWANY(SplitUVRow_Any_NEON, SplitUVRow_NEON, SplitUVRow_C, 15) -#endif -#ifdef HAS_SPLITUVROW_MIPS_DSPR2 -SPLITUVROWANY(SplitUVRow_Any_MIPS_DSPR2, SplitUVRow_MIPS_DSPR2, - SplitUVRow_C, 15) -#endif -#undef SPLITUVROWANY - // Interpolate may want to work in place, so last16 method can not be used. #define ANY11T(NAMEANY, TERP_SIMD, TERP_C, SBPP, BPP, MASK) \ void NAMEANY(uint8* dst_ptr, const uint8* src_ptr, \