dsp/alpha*.c: rework WEBP_USE_<arch> ifdef

add a dummy init rather than repeating the '#ifdef WEBP_USE_...'
pattern.

Change-Id: I9e7f187daffe1a3b1bc92953dce980c38d1a6269
This commit is contained in:
James Zern 2015-03-18 22:52:39 -07:00
parent e9570dd987
commit 80ff38130e
2 changed files with 16 additions and 10 deletions

View File

@ -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); extern void WebPInitAlphaProcessingMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) { WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingMIPSdspR2(void) {
#if defined(WEBP_USE_MIPS_DSP_R2)
WebPDispatchAlpha = DispatchAlpha; WebPDispatchAlpha = DispatchAlpha;
WebPMultARGBRow = MultARGBRow; 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

View File

@ -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); if (width > 0) WebPMultRowC(ptr + x, alpha + x, width, inverse);
} }
#endif // WEBP_USE_SSE2
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Init function // Entry point
extern void WebPInitAlphaProcessingSSE2(void); extern void WebPInitAlphaProcessingSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) { WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) {
#if defined(WEBP_USE_SSE2)
WebPMultARGBRow = MultARGBRow; WebPMultARGBRow = MultARGBRow;
WebPMultRow = MultRow; WebPMultRow = MultRow;
WebPApplyAlphaMultiply = ApplyAlphaMultiply; WebPApplyAlphaMultiply = ApplyAlphaMultiply;
WebPDispatchAlpha = DispatchAlpha; WebPDispatchAlpha = DispatchAlpha;
WebPDispatchAlphaToGreen = DispatchAlphaToGreen; WebPDispatchAlphaToGreen = DispatchAlphaToGreen;
WebPExtractAlpha = ExtractAlpha; WebPExtractAlpha = ExtractAlpha;
#endif
} }
#else // !WEBP_USE_SSE2
extern void WebPInitAlphaProcessingSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitAlphaProcessingSSE2(void) {}
#endif // WEBP_USE_SSE2