coreboot-kgpe-d16/payloads/libpayload/drivers/video
Julius Werner 7f87812c30 libpayload: cbgfx: Replace bilinear resampling with Lanczos
This patch improves the image resampling (scaling) code in CBGFX to use
the Lanczos algorithm that is widely considered the "best" resampling
algorithm (e.g. also the first choice in Python's PIL library). It is of
course much more elaborate and therefore slower than bilinear
resampling, but a lot of the difference can be made up with
optimizations, and the resulting code was found to still produce
acceptable speeds for existing Chrome OS UI use cases (on an Arm
Cortex-A55 device, time to scale an image to 1101x593 went from ~88ms to
~275ms, a little over 3x slowdown). Nevertheless, if this should be too
slow for anyone there's also an option to tune it down a little, but
still much better than bilinear (same operation was ~170ms with this).

Example images (scaled up by a factor of 7):
Old (bilinear): https://i.imgur.com/ytr2n4Z.png
New (Lanczos a=3): https://i.imgur.com/f0vKluM.png

Signed-off-by: Julius Werner <jwerner@chromium.org>
Change-Id: Idde6f61865bfac2801ee4fff40ac64e4ebddff1a
Reviewed-on: https://review.coreboot.org/c/coreboot/+/42792
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Yu-Ping Wu <yupingso@google.com>
Reviewed-by: Hung-Te Lin <hungte@chromium.org>
2020-07-09 00:32:17 +00:00
..
bitmap.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
corebootfb.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
font.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
font.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
font8x16.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
font8x16.h treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
geodelx.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
graphics.c libpayload: cbgfx: Replace bilinear resampling with Lanczos 2020-07-09 00:32:17 +00:00
vga.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00
video.c treewide: Remove "this file is part of" lines 2020-05-11 17:11:40 +00:00