From: Øyvind Kolås Date: Tue, 2 May 2023 20:55:55 +0000 (+0200) Subject: LUT: speed up 3bpp->4bpp LUT X-Git-Tag: archive/raspbian/1%0.1.106-3+rpi1^2~15^2^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bea667f8a1b9a4f2c8f966bf2c4754824fa0f47c;p=babl.git LUT: speed up 3bpp->4bpp LUT Keep alpha (0xff) as computed rather than stripping and reapplying. --- 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)