From bea667f8a1b9a4f2c8f966bf2c4754824fa0f47c Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Tue, 2 May 2023 22:55:55 +0200 Subject: [PATCH] LUT: speed up 3bpp->4bpp LUT Keep alpha (0xff) as computed rather than stripping and reapplying. --- babl/babl-fish-path.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/babl/babl-fish-path.c b/babl/babl-fish-path.c index afb3a79..712f57a 100644 --- a/babl/babl-fish-path.c +++ b/babl/babl-fish-path.c @@ -276,8 +276,7 @@ static inline int _do_lut (uint32_t *lut, uint32_t *dst = (uint32_t*)destination; while (n--) { - uint32_t col = src[0]*256*256+src[1]*256+src[2]; - *dst = lut[col] | 0xff000000; + *dst = lut[src[0]*256*256+src[1]*256+src[2]]; dst++; src+=3; } @@ -455,8 +454,6 @@ static inline int babl_fish_lut_process_maybe (const Babl *babl, temp_lut, 3, lut, 4, 256*256*256); - for (int o = 0; o < 256 * 256 * 256; o++) - lut[o] = lut[o] & 0x00ffffff; free (temp_lut); } else if (source_bpp == 2 && dest_bpp == 2) -- 2.30.2