mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-16 05:49:51 +02:00
multi-thread fix: lock each entry points with a static var
we compare the current VP8GetCPUInfo pointer to the last used.
This is less code overall and each implementation is still
testable separately (by just changing VP8GetCPUInfo, but not
a separate threads!)
(cherry picked from commit a437694a17
)
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: Ia13fa8ffc4561a884508f6ab71ed0d1b9f1ce59b
This commit is contained in:
committed by
James Zern
parent
5c1eeda922
commit
3ae78eb757
@ -189,7 +189,11 @@ const WebPYUV444Converter WebPYUV444Converters[MODE_LAST] = {
|
||||
extern void WebPInitUpsamplersSSE2(void);
|
||||
extern void WebPInitUpsamplersNEON(void);
|
||||
|
||||
static volatile VP8CPUInfo last_cpuinfo_used2 = (VP8CPUInfo)&last_cpuinfo_used2;
|
||||
|
||||
void WebPInitUpsamplers(void) {
|
||||
if (last_cpuinfo_used2 == VP8GetCPUInfo) return;
|
||||
|
||||
#ifdef FANCY_UPSAMPLING
|
||||
WebPUpsamplers[MODE_RGB] = UpsampleRgbLinePair;
|
||||
WebPUpsamplers[MODE_RGBA] = UpsampleRgbaLinePair;
|
||||
@ -217,6 +221,7 @@ void WebPInitUpsamplers(void) {
|
||||
#endif
|
||||
}
|
||||
#endif // FANCY_UPSAMPLING
|
||||
last_cpuinfo_used2 = VP8GetCPUInfo;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
Reference in New Issue
Block a user