mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-24 13:56:33 +02:00
avfilter/palette: add lowbias32 hashing
This commit is contained in:
parent
051926868c
commit
3cafbdc083
@ -207,3 +207,13 @@ uint32_t ff_oklab_int_to_srgb_u8(struct Lab c)
|
||||
|
||||
return r<<16 | g<<8 | b;
|
||||
}
|
||||
|
||||
uint32_t ff_lowbias32(uint32_t x)
|
||||
{
|
||||
x ^= x >> 16;
|
||||
x *= 0x7feb352d;
|
||||
x ^= x >> 15;
|
||||
x *= 0x846ca68b;
|
||||
x ^= x >> 16;
|
||||
return x;
|
||||
}
|
||||
|
@ -55,4 +55,9 @@ struct Lab ff_srgb_u8_to_oklab_int(uint32_t srgb);
|
||||
*/
|
||||
uint32_t ff_oklab_int_to_srgb_u8(struct Lab c);
|
||||
|
||||
/*
|
||||
* lowbias32 hashing from https://nullprogram.com/blog/2018/07/31/
|
||||
*/
|
||||
uint32_t ff_lowbias32(uint32_t x);
|
||||
|
||||
#endif /* AVFILTER_PALETTE_H */
|
||||
|
Loading…
x
Reference in New Issue
Block a user