aboutsummaryrefslogtreecommitdiff
path: root/payloads/libpayload/Kconfig
diff options
context:
space:
mode:
authorJulius Werner <jwerner@chromium.org>2020-06-24 19:43:36 -0700
committerJulius Werner <jwerner@chromium.org>2020-07-09 00:32:17 +0000
commit7f87812c30ac5e4c3329911aec2ce52050a9abbb (patch)
tree256289352ddd35494ef1ebae7fd4660d8567bbf6 /payloads/libpayload/Kconfig
parent96b00a50f14e3e41eaf69171945ceeb587b4fe0b (diff)
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>
Diffstat (limited to 'payloads/libpayload/Kconfig')
-rw-r--r--payloads/libpayload/Kconfig13
1 files changed, 13 insertions, 0 deletions
diff --git a/payloads/libpayload/Kconfig b/payloads/libpayload/Kconfig
index 7e506d9100..b5dc9a3c8b 100644
--- a/payloads/libpayload/Kconfig
+++ b/payloads/libpayload/Kconfig
@@ -334,6 +334,19 @@ config FONT_SCALE_FACTOR
By default (value of 0), the scale factor is automatically
calculated to ensure at least 130 columns (when possible).
+config CBGFX_FAST_RESAMPLE
+ bool "CBGFX: use faster (less pretty) image scaling"
+ default n
+ help
+ When payloads use the CBGFX library to draw .BMPs on the screen,
+ they will be resampled with an anti-aliasing filter to scale to the
+ requested output size. The default implementation should normally be
+ fast enough, but if desired this option can make it about 50-100%
+ faster at the cost of quality. (It changes the 'a' parameter in the
+ Lanczos resampling algorithm from 3 to 2.)
+
+ Only affects .BMPs that aren't already provided at the right size.
+
config PC_I8042
bool "A common PC i8042 driver"
default y if PC_KEYBOARD || PC_MOUSE