/* Calculate EPD input for a 4bpp buffer, but with a difference image LUT. This is used for small-LUT mode.  */
static void IRAM_ATTR calc_epd_input_4bpp_1k_lut(const uint32_t *ld, uint8_t *epd_input, const uint8_t *conversion_lut, uint8_t from)
/* Calculate EPD input for a 4bpp buffer, but with a difference image LUT. This is used for small-LUT mode.  */
static void IRAM_ATTR calc_epd_input_4bpp_1k_lut(const uint32_t *ld, uint8_t *epd_input, const uint8_t *conversion_lut, uint8_t from)
{
  uint16_t *ptr = (uint16_t *)ld;
  for (uint32_t j = 0; j < EPD_WIDTH / 4; j += 4) {
    epd_input[j + 2] = lookup_pixels_4bpp_1k(*(ptr++), conversion_lut, from);
    epd_input[j + 3] = lookup_pixels_4bpp_1k(*(ptr++), conversion_lut, from);
    epd_input[j + 0] = lookup_pixels_4bpp_1k(*(ptr++), conversion_lut, from);
    epd_input[j + 1] = lookup_pixels_4bpp_1k(*(ptr++), conversion_lut, from);
  }
}