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

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

Change-Id: I42e621481be7305bb7c426b4d0b279619195611e
This commit is contained in:
James Zern 2015-03-19 22:52:26 -07:00
parent 6584d398eb
commit cecf509662
3 changed files with 23 additions and 12 deletions

View File

@ -84,17 +84,21 @@ ROW_FUNC(YuvToBgraRow, 4, 2, 1, 0, 3)
#undef ROW_FUNC
#endif // WEBP_USE_MIPS32
//------------------------------------------------------------------------------
// Entry point
extern void WebPInitSamplersMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPS32(void) {
#if defined(WEBP_USE_MIPS32)
WebPSamplers[MODE_RGB] = YuvToRgbRow;
WebPSamplers[MODE_RGBA] = YuvToRgbaRow;
WebPSamplers[MODE_BGR] = YuvToBgrRow;
WebPSamplers[MODE_BGRA] = YuvToBgraRow;
#endif // WEBP_USE_MIPS32
}
#else // !WEBP_USE_MIPS32
extern void WebPInitSamplersMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPS32(void) {}
#endif // WEBP_USE_MIPS32

View File

@ -115,17 +115,21 @@ ROW_FUNC(YuvToBgraRow, 4, 2, 1, 0, 3)
#undef ROW_FUNC_PART_2
#undef ROW_FUNC_PART_1
#endif // WEBP_USE_MIPS_DSP_R2
//------------------------------------------------------------------------------
// Entry point
extern void WebPInitSamplersMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPSdspR2(void) {
#if defined(WEBP_USE_MIPS_DSP_R2)
WebPSamplers[MODE_RGB] = YuvToRgbRow;
WebPSamplers[MODE_RGBA] = YuvToRgbaRow;
WebPSamplers[MODE_BGR] = YuvToBgrRow;
WebPSamplers[MODE_BGRA] = YuvToBgraRow;
#endif // WEBP_USE_MIPS_DSP_R2
}
#else // !WEBP_USE_MIPS_DSP_R2
extern void WebPInitSamplersMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersMIPSdspR2(void) {}
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -304,19 +304,22 @@ static void YuvToBgrRowSSE2(const uint8_t* y,
}
}
#endif // WEBP_USE_SSE2
//------------------------------------------------------------------------------
// Entry point
extern void WebPInitSamplersSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersSSE2(void) {
#if defined(WEBP_USE_SSE2)
WebPSamplers[MODE_RGB] = YuvToRgbRowSSE2;
WebPSamplers[MODE_RGBA] = YuvToRgbaRowSSE2;
WebPSamplers[MODE_BGR] = YuvToBgrRowSSE2;
WebPSamplers[MODE_BGRA] = YuvToBgraRowSSE2;
WebPSamplers[MODE_ARGB] = YuvToArgbRowSSE2;
#endif // WEBP_USE_SSE2
}
#else // !WEBP_USE_SSE2
extern void WebPInitSamplersSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void WebPInitSamplersSSE2(void) {}
#endif // WEBP_USE_SSE2