/* Look up 4 pixels in a 1K LUT with fixed "from" value.  */
static uint8_t lookup_pixels_4bpp_1k(uint16_t in, const uint8_t *conversion_lut, uint8_t from)
/* Look up 4 pixels in a 1K LUT with fixed "from" value.  */
static uint8_t lookup_pixels_4bpp_1k(uint16_t in, const uint8_t *conversion_lut, uint8_t from)
{
  uint8_t v;
  uint8_t out;
  v = ((in << 4) | from);
  out = conversion_lut[v & 0xFF];
  v = ((in & 0xF0) | from);
  out |= (conversion_lut + 0x100)[v & 0xFF];
  in = in >> 8;
  v = ((in << 4) | from);
  out |= (conversion_lut + 0x200)[v & 0xFF];
  v = ((in & 0xF0) | from);
  out |= (conversion_lut + 0x300)[v];
  return out;
}