~20% speedup for sRGB to scRGB pixel conversion
by checking GOnce status with branch expectation
This commit is contained in:
parent
72a493d2e6
commit
cef897ece8
@ -171,6 +171,7 @@ vips_col_make_tables_RGB_8( void )
|
|||||||
{
|
{
|
||||||
static GOnce once = G_ONCE_INIT;
|
static GOnce once = G_ONCE_INIT;
|
||||||
|
|
||||||
|
if( G_UNLIKELY( once.status != G_ONCE_STATUS_READY ) )
|
||||||
(void) g_once( &once, calcul_tables_8, NULL );
|
(void) g_once( &once, calcul_tables_8, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -195,6 +196,7 @@ vips_col_make_tables_RGB_16( void )
|
|||||||
{
|
{
|
||||||
static GOnce once = G_ONCE_INIT;
|
static GOnce once = G_ONCE_INIT;
|
||||||
|
|
||||||
|
if( G_UNLIKELY( once.status != G_ONCE_STATUS_READY ) )
|
||||||
(void) g_once( &once, calcul_tables_16, NULL );
|
(void) g_once( &once, calcul_tables_16, NULL );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user