From f4dc56fd7719d7f95284ee67504ab605ddee59b7 Mon Sep 17 00:00:00 2001 From: Pascal Massimino Date: Wed, 25 Jan 2017 16:33:26 -0800 Subject: [PATCH] disable GradientUnfilter_NEON Compile with XCode, it appears quite slower than the C-version, especially for arm64. Change-Id: Ic46dba184a36be454fef674129d2f909003788fc (cherry picked from commit 4f3e3bbd44ad2989916910ce4ef4e6f10d8f2145) --- src/dsp/filters_neon.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/dsp/filters_neon.c b/src/dsp/filters_neon.c index 7e1338fc..4d6e50cc 100644 --- a/src/dsp/filters_neon.c +++ b/src/dsp/filters_neon.c @@ -248,6 +248,12 @@ static void VerticalUnfilter_NEON(const uint8_t* prev, const uint8_t* in, } } +// GradientUnfilter_NEON is correct but slower than the C-version, +// at least on ARM64. For armv7, it's a wash. +// So best is to disable it for now, but keep the idea around... +// #define USE_GRADIENT_UNFILTER + +#if defined(USE_GRADIENT_UNFILTER) #define GRAD_PROCESS_LANE(L) do { \ const uint8x8_t tmp1 = ROTATE_RIGHT_N(pred, 1); /* rotate predictor in */ \ const int16x8_t tmp2 = vaddq_s16(BC, U8_TO_S16(tmp1)); \ @@ -295,6 +301,8 @@ static void GradientUnfilter_NEON(const uint8_t* prev, const uint8_t* in, } } +#endif // USE_GRADIENT_UNFILTER + //------------------------------------------------------------------------------ // Entry point @@ -303,7 +311,9 @@ extern void VP8FiltersInitNEON(void); WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitNEON(void) { WebPUnfilters[WEBP_FILTER_HORIZONTAL] = HorizontalUnfilter_NEON; WebPUnfilters[WEBP_FILTER_VERTICAL] = VerticalUnfilter_NEON; +#if defined(USE_GRADIENT_UNFILTER) WebPUnfilters[WEBP_FILTER_GRADIENT] = GradientUnfilter_NEON; +#endif WebPFilters[WEBP_FILTER_HORIZONTAL] = HorizontalFilter_NEON; WebPFilters[WEBP_FILTER_VERTICAL] = VerticalFilter_NEON;