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

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

Change-Id: I0cf40b500f9b3eed55a3211213db180c7c0dd43b
This commit is contained in:
James Zern 2015-03-19 20:43:10 -07:00
parent 66de69c1fe
commit fbdcef2401
5 changed files with 29 additions and 17 deletions

View File

@ -20,5 +20,5 @@
extern void VP8EncDspInitAVX2(void);
void VP8EncDspInitAVX2(void) {
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitAVX2(void) {
}

View File

@ -645,15 +645,12 @@ static int SSE4x4(const uint8_t* a, const uint8_t* b) {
#endif // !WORK_AROUND_GCC
#endif // WEBP_USE_MIPS32
//------------------------------------------------------------------------------
// Entry point
extern void VP8EncDspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPS32(void) {
#if defined(WEBP_USE_MIPS32)
VP8ITransform = ITransform;
VP8FTransform = FTransform;
VP8EncQuantizeBlock = QuantizeBlock;
@ -666,5 +663,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPS32(void) {
VP8SSE16x8 = SSE16x8;
VP8SSE4x4 = SSE4x4;
#endif
#endif // WEBP_USE_MIPS32
}
#else // !WEBP_USE_MIPS32
extern void VP8EncDspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPS32(void) {}
#endif // WEBP_USE_MIPS32

View File

@ -1480,15 +1480,12 @@ static void CollectHistogram(const uint8_t* ref, const uint8_t* pred,
#undef CONVERT_COEFFS_TO_BIN
#endif // WEBP_USE_MIPS_DSP_R2
//------------------------------------------------------------------------------
// Entry point
extern void VP8EncDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPSdspR2(void) {
#if defined(WEBP_USE_MIPS_DSP_R2)
VP8FTransform = FTransform;
VP8ITransform = ITransform;
VP8TDisto4x4 = Disto4x4;
@ -1506,5 +1503,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPSdspR2(void) {
VP8EncQuantize2Blocks = Quantize2Blocks;
VP8FTransformWHT = FTransformWHT;
VP8CollectHistogram = CollectHistogram;
#endif // WEBP_USE_MIPS_DSP_R2
}
#else // !WEBP_USE_MIPS_DSP_R2
extern void VP8EncDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitMIPSdspR2(void) {}
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -903,15 +903,12 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32],
#endif // !WORK_AROUND_GCC
#endif // WEBP_USE_NEON
//------------------------------------------------------------------------------
// Entry point
extern void VP8EncDspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitNEON(void) {
#if defined(WEBP_USE_NEON)
VP8ITransform = ITransform;
VP8FTransform = FTransform;
@ -928,5 +925,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitNEON(void) {
VP8EncQuantizeBlock = QuantizeBlock;
VP8EncQuantize2Blocks = Quantize2Blocks;
#endif
#endif // WEBP_USE_NEON
}
#else // !WEBP_USE_NEON
extern void VP8EncDspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitNEON(void) {}
#endif // WEBP_USE_NEON

View File

@ -914,15 +914,12 @@ static int Quantize2Blocks(int16_t in[32], int16_t out[32],
return nz;
}
#endif // WEBP_USE_SSE2
//------------------------------------------------------------------------------
// Entry point
extern void VP8EncDspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE2(void) {
#if defined(WEBP_USE_SSE2)
VP8CollectHistogram = CollectHistogram;
VP8EncQuantizeBlock = QuantizeBlock;
VP8EncQuantize2Blocks = Quantize2Blocks;
@ -936,5 +933,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE2(void) {
VP8SSE4x4 = SSE4x4;
VP8TDisto4x4 = Disto4x4;
VP8TDisto16x16 = Disto16x16;
#endif // WEBP_USE_SSE2
}
#else // !WEBP_USE_SSE2
extern void VP8EncDspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8EncDspInitSSE2(void) {}
#endif // WEBP_USE_SSE2