From 80ff38130e131286c85f1115e11e77ee1d3c0200 Mon Sep 17 00:00:00 2001 From: James Zern Date: Wed, 18 Mar 2015 22:52:39 -0700 Subject: [PATCH] dsp/alpha*.c: rework WEBP_USE_ ifdef add a dummy init rather than repeating the '#ifdef WEBP_USE_...' pattern. Change-Id: I9e7f187daffe1a3b1bc92953dce980c38d1a6269 --- src/dsp/alpha_processing_mips_dsp_r2.c | 13 ++++++++----- src/dsp/alpha_processing_sse2.c | 13 ++++++++----- 2 files changed, 16 insertions(+), 10 deletions(-) diff --git a/src/dsp/alpha_processing_mips_dsp_r2.c b/src/dsp/alpha_processing_mips_dsp_r2.c index 186e9e03..e5644998 100644 --- a/src/dsp/alpha_processing_mips_dsp_r2.c +++ b/src/dsp/alpha_processing_mips_dsp_r2.c @@ -124,16 +124,19 @@ static void MultARGBRow(uint32_t* const ptr, int width, int inverse) { } } -#endif // WEBP_USE_MIPS_DSP_R2 - //------------------------------------------------------------------------------ -// Init function +// Entry point extern void WebPInitAlphaProcessingMIPSdspR2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) { -#if defined(WEBP_USE_MIPS_DSP_R2) WebPDispatchAlpha = DispatchAlpha; WebPMultARGBRow = MultARGBRow; -#endif } + +#else // !WEBP_USE_MIPS_DSP_R2 + +extern void WebPInitAlphaProcessingMIPSdspR2(void); +WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) {} + +#endif // WEBP_USE_MIPS_DSP_R2 diff --git a/src/dsp/alpha_processing_sse2.c b/src/dsp/alpha_processing_sse2.c index 9233246c..40501303 100644 --- a/src/dsp/alpha_processing_sse2.c +++ b/src/dsp/alpha_processing_sse2.c @@ -277,20 +277,23 @@ static void MultRow(uint8_t* const ptr, const uint8_t* const alpha, if (width > 0) WebPMultRowC(ptr + x, alpha + x, width, inverse); } -#endif // WEBP_USE_SSE2 - //------------------------------------------------------------------------------ -// Init function +// Entry point extern void WebPInitAlphaProcessingSSE2(void); WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) { -#if defined(WEBP_USE_SSE2) WebPMultARGBRow = MultARGBRow; WebPMultRow = MultRow; WebPApplyAlphaMultiply = ApplyAlphaMultiply; WebPDispatchAlpha = DispatchAlpha; WebPDispatchAlphaToGreen = DispatchAlphaToGreen; WebPExtractAlpha = ExtractAlpha; -#endif } + +#else // !WEBP_USE_SSE2 + +extern void WebPInitAlphaProcessingSSE2(void); +WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) {} + +#endif // WEBP_USE_SSE2