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

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

Change-Id: If8b4459556e6bfaa36ef046f66520558b9444fc2
This commit is contained in:
James Zern 2015-03-19 20:47:57 -07:00
parent 73805ff270
commit 1d93ddec19
4 changed files with 29 additions and 22 deletions

View File

@ -396,15 +396,12 @@ static void HistogramAdd(const VP8LHistogram* const a,
#undef ADD_TO_OUT #undef ADD_TO_OUT
#undef ASM_START #undef ASM_START
#endif // WEBP_USE_MIPS32
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Entry point // Entry point
extern void VP8LDspInitMIPS32(void); extern void VP8LDspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPS32(void) { WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPS32(void) {
#if defined(WEBP_USE_MIPS32)
VP8LFastSLog2Slow = FastSLog2Slow; VP8LFastSLog2Slow = FastSLog2Slow;
VP8LFastLog2Slow = FastLog2Slow; VP8LFastLog2Slow = FastLog2Slow;
VP8LExtraCost = ExtraCost; VP8LExtraCost = ExtraCost;
@ -412,5 +409,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPS32(void) {
VP8LHuffmanCostCount = HuffmanCostCount; VP8LHuffmanCostCount = HuffmanCostCount;
VP8LHuffmanCostCombinedCount = HuffmanCostCombinedCount; VP8LHuffmanCostCombinedCount = HuffmanCostCombinedCount;
VP8LHistogramAdd = HistogramAdd; VP8LHistogramAdd = HistogramAdd;
#endif // WEBP_USE_MIPS32
} }
#else // !WEBP_USE_MIPS32
extern void VP8LDspInitMIPS32(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPS32(void) {}
#endif // WEBP_USE_MIPS32

View File

@ -885,14 +885,12 @@ static void ConvertBGRAToBGR(const uint32_t* src,
); );
} }
#endif // WEBP_USE_MIPS_DSP_R2
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Entry point
extern void VP8LDspInitMIPSdspR2(void); extern void VP8LDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPSdspR2(void) { WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPSdspR2(void) {
#if defined(WEBP_USE_MIPS_DSP_R2)
VP8LMapColor32b = MapARGB; VP8LMapColor32b = MapARGB;
VP8LMapColor8b = MapAlpha; VP8LMapColor8b = MapAlpha;
VP8LPredictors[5] = Predictor5; VP8LPredictors[5] = Predictor5;
@ -915,7 +913,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPSdspR2(void) {
VP8LConvertBGRAToRGBA4444 = ConvertBGRAToRGBA4444; VP8LConvertBGRAToRGBA4444 = ConvertBGRAToRGBA4444;
VP8LConvertBGRAToRGB565 = ConvertBGRAToRGB565; VP8LConvertBGRAToRGB565 = ConvertBGRAToRGB565;
VP8LConvertBGRAToBGR = ConvertBGRAToBGR; VP8LConvertBGRAToBGR = ConvertBGRAToBGR;
#endif // WEBP_USE_MIPS_DSP_R2
} }
//------------------------------------------------------------------------------ #else // !WEBP_USE_MIPS_DSP_R2
extern void VP8LDspInitMIPSdspR2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitMIPSdspR2(void) {}
#endif // WEBP_USE_MIPS_DSP_R2

View File

@ -324,14 +324,12 @@ static void AddGreenToBlueAndRed(uint32_t* argb_data, int num_pixels) {
#endif // WEBP_USE_INTRINSICS #endif // WEBP_USE_INTRINSICS
#endif // WEBP_USE_NEON
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Entry point
extern void VP8LDspInitNEON(void); extern void VP8LDspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) { WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) {
#if defined(WEBP_USE_NEON)
VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA; VP8LConvertBGRAToRGBA = ConvertBGRAToRGBA;
VP8LConvertBGRAToBGR = ConvertBGRAToBGR; VP8LConvertBGRAToBGR = ConvertBGRAToBGR;
VP8LConvertBGRAToRGB = ConvertBGRAToRGB; VP8LConvertBGRAToRGB = ConvertBGRAToRGB;
@ -350,8 +348,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) {
VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed; VP8LSubtractGreenFromBlueAndRed = SubtractGreenFromBlueAndRed;
VP8LAddGreenToBlueAndRed = AddGreenToBlueAndRed; VP8LAddGreenToBlueAndRed = AddGreenToBlueAndRed;
#endif #endif
#endif // WEBP_USE_NEON
} }
//------------------------------------------------------------------------------ #else // !WEBP_USE_NEON
extern void VP8LDspInitNEON(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitNEON(void) {}
#endif // WEBP_USE_NEON

View File

@ -13,9 +13,8 @@
#include "./dsp.h" #include "./dsp.h"
#include <assert.h>
#if defined(WEBP_USE_SSE2) #if defined(WEBP_USE_SSE2)
#include <assert.h>
#include <emmintrin.h> #include <emmintrin.h>
#include "./lossless.h" #include "./lossless.h"
@ -499,14 +498,12 @@ static void HistogramAdd(const VP8LHistogram* const a,
} }
} }
#endif // WEBP_USE_SSE2
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------
// Entry point
extern void VP8LDspInitSSE2(void); extern void VP8LDspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitSSE2(void) { WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitSSE2(void) {
#if defined(WEBP_USE_SSE2)
VP8LPredictors[5] = Predictor5; VP8LPredictors[5] = Predictor5;
VP8LPredictors[6] = Predictor6; VP8LPredictors[6] = Predictor6;
VP8LPredictors[7] = Predictor7; VP8LPredictors[7] = Predictor7;
@ -529,7 +526,11 @@ WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitSSE2(void) {
VP8LConvertBGRAToBGR = ConvertBGRAToBGR; VP8LConvertBGRAToBGR = ConvertBGRAToBGR;
VP8LHistogramAdd = HistogramAdd; VP8LHistogramAdd = HistogramAdd;
#endif // WEBP_USE_SSE2
} }
//------------------------------------------------------------------------------ #else // !WEBP_USE_SSE2
extern void VP8LDspInitSSE2(void);
WEBP_TSAN_IGNORE_FUNCTION void VP8LDspInitSSE2(void) {}
#endif // WEBP_USE_SSE2