From 6c7b54e9622b304db4230bcd8136c7daf47b6a6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20B=C5=93sch?= Date: Tue, 27 Dec 2022 17:47:41 +0100 Subject: [PATCH] avfilter/paletteuse: use lowbias32 for color hashing Impact is more negligible than previous commit but still faster (1.02x). --- libavfilter/vf_paletteuse.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/libavfilter/vf_paletteuse.c b/libavfilter/vf_paletteuse.c index 65c89ff0bf..0179a399f2 100644 --- a/libavfilter/vf_paletteuse.c +++ b/libavfilter/vf_paletteuse.c @@ -70,8 +70,7 @@ struct color_node { int left_id, right_id; }; -#define NBITS 5 -#define CACHE_SIZE (1<<(3*NBITS)) +#define CACHE_SIZE (1<<15) struct cached_color { uint32_t color; @@ -347,10 +346,7 @@ static av_always_inline int color_get(PaletteUseContext *s, uint32_t color, { int i; struct color_info clrinfo; - const uint8_t rhash = (color>>16) & ((1<> 8) & ((1<cache[hash]; struct cached_color *e;