make the 'last_cpuinfo_used' variable names unique

allows the sources to be #include'd in some hackish builds (don't do
that!)

(cherry picked from commit 67f601cd46)

Conflicts:
	src/dsp/alpha_processing.c
	src/dsp/argb.c
	src/dsp/dec.c
	src/dsp/enc.c
	src/dsp/lossless.c
	src/dsp/upsampling.c
	src/dsp/yuv.c

Change-Id: I0c7a43acbebd0e2d5068845e6daa8ce47361cd91
This commit is contained in:
James Zern 2015-01-07 15:18:14 -08:00
parent 1273e84517
commit b2e71a9080
6 changed files with 24 additions and 18 deletions

View File

@ -311,10 +311,11 @@ int (*WebPExtractAlpha)(const uint8_t*, int, int, int, uint8_t*, int);
extern void WebPInitAlphaProcessingSSE2(void); extern void WebPInitAlphaProcessingSSE2(void);
static volatile VP8CPUInfo last_cpuinfo_used = (VP8CPUInfo)&last_cpuinfo_used; static volatile VP8CPUInfo alpha_processing_last_cpuinfo_used =
(VP8CPUInfo)&alpha_processing_last_cpuinfo_used;
void WebPInitAlphaProcessing(void) { void WebPInitAlphaProcessing(void) {
if (last_cpuinfo_used == VP8GetCPUInfo) return; if (alpha_processing_last_cpuinfo_used == VP8GetCPUInfo) return;
WebPMultARGBRow = MultARGBRow; WebPMultARGBRow = MultARGBRow;
WebPMultRow = MultRow; WebPMultRow = MultRow;
@ -330,5 +331,5 @@ void WebPInitAlphaProcessing(void) {
} }
#endif #endif
} }
last_cpuinfo_used = VP8GetCPUInfo; alpha_processing_last_cpuinfo_used = VP8GetCPUInfo;
} }

View File

@ -688,10 +688,11 @@ extern void VP8DspInitSSE2(void);
extern void VP8DspInitNEON(void); extern void VP8DspInitNEON(void);
extern void VP8DspInitMIPS32(void); extern void VP8DspInitMIPS32(void);
static volatile VP8CPUInfo last_cpuinfo_used = (VP8CPUInfo)&last_cpuinfo_used; static volatile VP8CPUInfo dec_last_cpuinfo_used =
(VP8CPUInfo)&dec_last_cpuinfo_used;
void VP8DspInit(void) { void VP8DspInit(void) {
if (last_cpuinfo_used == VP8GetCPUInfo) return; if (dec_last_cpuinfo_used == VP8GetCPUInfo) return;
VP8InitClipTables(); VP8InitClipTables();
@ -731,5 +732,5 @@ void VP8DspInit(void) {
} }
#endif #endif
} }
last_cpuinfo_used = VP8GetCPUInfo; dec_last_cpuinfo_used = VP8GetCPUInfo;
} }

View File

@ -692,10 +692,11 @@ extern void VP8EncDspInitAVX2(void);
extern void VP8EncDspInitNEON(void); extern void VP8EncDspInitNEON(void);
extern void VP8EncDspInitMIPS32(void); extern void VP8EncDspInitMIPS32(void);
static volatile VP8CPUInfo last_cpuinfo_used = (VP8CPUInfo)&last_cpuinfo_used; static volatile VP8CPUInfo enc_last_cpuinfo_used =
(VP8CPUInfo)&enc_last_cpuinfo_used;
void VP8EncDspInit(void) { void VP8EncDspInit(void) {
if (last_cpuinfo_used == VP8GetCPUInfo) return; if (enc_last_cpuinfo_used == VP8GetCPUInfo) return;
VP8DspInit(); // common inverse transforms VP8DspInit(); // common inverse transforms
InitTables(); InitTables();
@ -741,6 +742,6 @@ void VP8EncDspInit(void) {
} }
#endif #endif
} }
last_cpuinfo_used = VP8GetCPUInfo; enc_last_cpuinfo_used = VP8GetCPUInfo;
} }

View File

@ -1590,10 +1590,11 @@ extern void VP8LDspInitSSE2(void);
extern void VP8LDspInitNEON(void); extern void VP8LDspInitNEON(void);
extern void VP8LDspInitMIPS32(void); extern void VP8LDspInitMIPS32(void);
static volatile VP8CPUInfo last_cpuinfo_used = (VP8CPUInfo)&last_cpuinfo_used; static volatile VP8CPUInfo lossless_last_cpuinfo_used =
(VP8CPUInfo)&lossless_last_cpuinfo_used;
void VP8LDspInit(void) { void VP8LDspInit(void) {
if (last_cpuinfo_used == VP8GetCPUInfo) return; if (lossless_last_cpuinfo_used == VP8GetCPUInfo) return;
memcpy(VP8LPredictors, kPredictorsC, sizeof(VP8LPredictors)); memcpy(VP8LPredictors, kPredictorsC, sizeof(VP8LPredictors));
@ -1638,7 +1639,7 @@ void VP8LDspInit(void) {
} }
#endif #endif
} }
last_cpuinfo_used = VP8GetCPUInfo; lossless_last_cpuinfo_used = VP8GetCPUInfo;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -189,10 +189,11 @@ const WebPYUV444Converter WebPYUV444Converters[MODE_LAST] = {
extern void WebPInitUpsamplersSSE2(void); extern void WebPInitUpsamplersSSE2(void);
extern void WebPInitUpsamplersNEON(void); extern void WebPInitUpsamplersNEON(void);
static volatile VP8CPUInfo last_cpuinfo_used2 = (VP8CPUInfo)&last_cpuinfo_used2; static volatile VP8CPUInfo upsampling_last_cpuinfo_used2 =
(VP8CPUInfo)&upsampling_last_cpuinfo_used2;
void WebPInitUpsamplers(void) { void WebPInitUpsamplers(void) {
if (last_cpuinfo_used2 == VP8GetCPUInfo) return; if (upsampling_last_cpuinfo_used2 == VP8GetCPUInfo) return;
#ifdef FANCY_UPSAMPLING #ifdef FANCY_UPSAMPLING
WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair; WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair;
@ -221,7 +222,7 @@ void WebPInitUpsamplers(void) {
#endif #endif
} }
#endif // FANCY_UPSAMPLING #endif // FANCY_UPSAMPLING
last_cpuinfo_used2 = VP8GetCPUInfo; upsampling_last_cpuinfo_used2 = VP8GetCPUInfo;
} }
//------------------------------------------------------------------------------ //------------------------------------------------------------------------------

View File

@ -123,10 +123,11 @@ WebPSamplerRowFunc WebPSamplers[MODE_LAST];
extern void WebPInitSamplersSSE2(void); extern void WebPInitSamplersSSE2(void);
extern void WebPInitSamplersMIPS32(void); extern void WebPInitSamplersMIPS32(void);
static volatile VP8CPUInfo last_cpuinfo_used = (VP8CPUInfo)&last_cpuinfo_used; static volatile VP8CPUInfo yuv_last_cpuinfo_used =
(VP8CPUInfo)&yuv_last_cpuinfo_used;
void WebPInitSamplers(void) { void WebPInitSamplers(void) {
if (last_cpuinfo_used == VP8GetCPUInfo) return; if (yuv_last_cpuinfo_used == VP8GetCPUInfo) return;
WebPSamplers[MODE_RGB] = YuvToRgbRow; WebPSamplers[MODE_RGB] = YuvToRgbRow;
WebPSamplers[MODE_RGBA] = YuvToRgbaRow; WebPSamplers[MODE_RGBA] = YuvToRgbaRow;
@ -153,7 +154,7 @@ void WebPInitSamplers(void) {
} }
#endif // WEBP_USE_MIPS32 #endif // WEBP_USE_MIPS32
} }
last_cpuinfo_used = VP8GetCPUInfo; yuv_last_cpuinfo_used = VP8GetCPUInfo;
} }
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------