mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-26 13:48:21 +01:00
use WEBP_DSP_INIT_FUNC for Init{GammaTables*,GetCoeffs}
this provides stronger synchronization when pthreads are available as was done in 'd77bf512 add WEBP_DSP_INIT / WEBP_DSP_INIT_FUNC' for the other init functions. Change-Id: I2ffe4e24454d276c2411ece34dca38d23d4756d5
This commit is contained in:
parent
55a080e50a
commit
cf847cba58
@ -494,13 +494,11 @@ static int GetCoeffsAlt(VP8BitReader* const br,
|
|||||||
return 16;
|
return 16;
|
||||||
}
|
}
|
||||||
|
|
||||||
static WEBP_TSAN_IGNORE_FUNCTION void InitGetCoeffs(void) {
|
WEBP_DSP_INIT_FUNC(InitGetCoeffs) {
|
||||||
if (GetCoeffs == NULL) {
|
if (VP8GetCPUInfo != NULL && VP8GetCPUInfo(kSlowSSSE3)) {
|
||||||
if (VP8GetCPUInfo != NULL && VP8GetCPUInfo(kSlowSSSE3)) {
|
GetCoeffs = GetCoeffsAlt;
|
||||||
GetCoeffs = GetCoeffsAlt;
|
} else {
|
||||||
} else {
|
GetCoeffs = GetCoeffsFast;
|
||||||
GetCoeffs = GetCoeffsFast;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -90,8 +90,9 @@ int WebPPictureHasTransparency(const WebPPicture* picture) {
|
|||||||
static int kLinearToGammaTab[kGammaTabSize + 1];
|
static int kLinearToGammaTab[kGammaTabSize + 1];
|
||||||
static uint16_t kGammaToLinearTab[256];
|
static uint16_t kGammaToLinearTab[256];
|
||||||
static volatile int kGammaTablesOk = 0;
|
static volatile int kGammaTablesOk = 0;
|
||||||
|
static void InitGammaTables(void);
|
||||||
|
|
||||||
static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTables(void) {
|
WEBP_DSP_INIT_FUNC(InitGammaTables) {
|
||||||
if (!kGammaTablesOk) {
|
if (!kGammaTablesOk) {
|
||||||
int v;
|
int v;
|
||||||
const double scale = (double)(1 << kGammaTabFix) / kGammaScale;
|
const double scale = (double)(1 << kGammaTabFix) / kGammaScale;
|
||||||
@ -181,8 +182,9 @@ static uint32_t kLinearToGammaTabS[kGammaTabSize + 2];
|
|||||||
#define GAMMA_TO_LINEAR_BITS 14
|
#define GAMMA_TO_LINEAR_BITS 14
|
||||||
static uint32_t kGammaToLinearTabS[MAX_Y_T + 1]; // size scales with Y_FIX
|
static uint32_t kGammaToLinearTabS[MAX_Y_T + 1]; // size scales with Y_FIX
|
||||||
static volatile int kGammaTablesSOk = 0;
|
static volatile int kGammaTablesSOk = 0;
|
||||||
|
static void InitGammaTablesS(void);
|
||||||
|
|
||||||
static WEBP_TSAN_IGNORE_FUNCTION void InitGammaTablesS(void) {
|
WEBP_DSP_INIT_FUNC(InitGammaTablesS) {
|
||||||
assert(2 * GAMMA_TO_LINEAR_BITS < 32); // we use uint32_t intermediate values
|
assert(2 * GAMMA_TO_LINEAR_BITS < 32); // we use uint32_t intermediate values
|
||||||
if (!kGammaTablesSOk) {
|
if (!kGammaTablesSOk) {
|
||||||
int v;
|
int v;
|
||||||
|
Loading…
Reference in New Issue
Block a user