From 73805ff270d50ee8497b820843a6a89b5cbf18fa Mon Sep 17 00:00:00 2001 From: James Zern Date: Thu, 19 Mar 2015 20:44:53 -0700 Subject: [PATCH] dsp/filters*.c: rework WEBP_USE_ ifdef add a dummy init rather than repeating the '#ifdef WEBP_USE_...' pattern. Change-Id: Idf08ffeb2aef1392a6d69596d897a59deebb64cf --- src/dsp/filters_mips_dsp_r2.c | 12 +++++++----- src/dsp/filters_sse2.c | 12 ++++++++---- 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/src/dsp/filters_mips_dsp_r2.c b/src/dsp/filters_mips_dsp_r2.c index 56fd951a..ba8121ce 100644 --- a/src/dsp/filters_mips_dsp_r2.c +++ b/src/dsp/filters_mips_dsp_r2.c @@ -383,14 +383,12 @@ static void GradientUnfilter(int width, int height, int stride, int row, #undef DO_PREDICT_LINE #undef SANITY_CHECK -#endif // WEBP_USE_MIPS_DSP_R2 - //------------------------------------------------------------------------------ +// Entry point extern void VP8FiltersInitMIPSdspR2(void); WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitMIPSdspR2(void) { -#if defined(WEBP_USE_MIPS_DSP_R2) WebPFilters[WEBP_FILTER_HORIZONTAL] = HorizontalFilter; WebPFilters[WEBP_FILTER_VERTICAL] = VerticalFilter; WebPFilters[WEBP_FILTER_GRADIENT] = GradientFilter; @@ -398,7 +396,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitMIPSdspR2(void) { WebPUnfilters[WEBP_FILTER_HORIZONTAL] = HorizontalUnfilter; WebPUnfilters[WEBP_FILTER_VERTICAL] = VerticalUnfilter; WebPUnfilters[WEBP_FILTER_GRADIENT] = GradientUnfilter; -#endif // WEBP_USE_MIPS_DSP_R2 } -//------------------------------------------------------------------------------ +#else // !WEBP_USE_MIPS_DSP_R2 + +extern void VP8FiltersInitMIPSdspR2(void); +WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitMIPSdspR2(void) {} + +#endif // WEBP_USE_MIPS_DSP_R2 diff --git a/src/dsp/filters_sse2.c b/src/dsp/filters_sse2.c index 12b6d07f..97dfb10a 100644 --- a/src/dsp/filters_sse2.c +++ b/src/dsp/filters_sse2.c @@ -331,13 +331,11 @@ static void GradientUnfilter(int width, int height, int stride, int row, } //------------------------------------------------------------------------------ - -#endif // WEBP_USE_SSE2 +// Entry point extern void VP8FiltersInitSSE2(void); WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitSSE2(void) { -#if defined(WEBP_USE_SSE2) WebPUnfilters[WEBP_FILTER_HORIZONTAL] = HorizontalUnfilter; WebPUnfilters[WEBP_FILTER_VERTICAL] = VerticalUnfilter; WebPUnfilters[WEBP_FILTER_GRADIENT] = GradientUnfilter; @@ -345,5 +343,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitSSE2(void) { WebPFilters[WEBP_FILTER_HORIZONTAL] = HorizontalFilter; WebPFilters[WEBP_FILTER_VERTICAL] = VerticalFilter; WebPFilters[WEBP_FILTER_GRADIENT] = GradientFilter; -#endif } + +#else // !WEBP_USE_SSE2 + +extern void VP8FiltersInitSSE2(void); +WEBP_TSAN_IGNORE_FUNCTION void VP8FiltersInitSSE2(void) {} + +#endif // WEBP_USE_SSE2