mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-14 21:09:55 +02:00
add WEBP_DSP_INIT / WEBP_DSP_INIT_FUNC
this internalizes the init checks and provides stronger synchronization
with pthreads when available while still allowing VP8GetCPUInfo to be
modified (mostly for testing purposes). windows is left as is since a
critical section or mutex would cause a leak.
Change-Id: Ieb997e014f2805c0ae39c16f13337663521356f4
(cherry picked from commit d77bf512bd
)
This commit is contained in:
@ -146,6 +146,6 @@ int VP8ApplyNearLossless(const WebPPicture* const picture, int quality,
|
||||
|
||||
// Define a stub to suppress compiler warnings.
|
||||
extern void VP8LNearLosslessStub(void);
|
||||
WEBP_TSAN_IGNORE_FUNCTION void VP8LNearLosslessStub(void) {}
|
||||
void VP8LNearLosslessStub(void) {}
|
||||
|
||||
#endif // (WEBP_NEAR_LOSSLESS == 1)
|
||||
|
@ -126,7 +126,7 @@ static WEBP_INLINE int LinearToGamma(uint32_t base_value, int shift) {
|
||||
|
||||
#else
|
||||
|
||||
static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTables(void) {}
|
||||
static void InitGammaTables(void) {}
|
||||
static WEBP_INLINE uint32_t GammaToLinear(uint8_t v) { return v; }
|
||||
static WEBP_INLINE int LinearToGamma(uint32_t base_value, int shift) {
|
||||
return (int)(base_value << shift);
|
||||
@ -238,7 +238,7 @@ static WEBP_INLINE uint32_t LinearToGammaS(uint32_t value) {
|
||||
|
||||
#else
|
||||
|
||||
static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTablesS(void) {}
|
||||
static void InitGammaTablesS(void) {}
|
||||
static WEBP_INLINE uint32_t GammaToLinearS(int v) {
|
||||
return (v << GAMMA_TO_LINEAR_BITS) / MAX_Y_T;
|
||||
}
|
||||
|
Reference in New Issue
Block a user