Reduce zoom levels at 1x only, to cut worst-case payload further

Reports of an overrun at "moderate" zoom on a busy "NOW"-style
compilation cover (lots of artist names/logos -- high-detail, not
smooth/flat art). Confirmed with a real compilation cover (downloaded
via iTunes' search API, close enough in style to the reported one):
raw zoom_scale correlates with payload for busy art, and the original
"moderate" (1.4) measured ~329-336KB across repeated runs.

ZOOM_LEVELS split into ZOOM_LEVELS_1X (reduced: subtle 1.15->1.1,
moderate 1.4->1.25, strong 1.7->1.45) and ZOOM_LEVELS_2X (unchanged) --
1x only, per explicit request, since 2x has more buffer headroom on
that hardware (established in the earlier 2x-support work). main()
picks the right dict from the same `scale` value already threaded
everywhere else.

Verified: the reduced "moderate" (1.25) against the same busy cover
measured ~297-316KB across repeated runs, a real, repeatable margin
gain (not just run-to-run noise from the glitch segment's own
randomness). 0 black-corner hits at the new 1x "strong" (1.45) +
random zoom position, the established worst-case combination.
This commit is contained in:
poprhythm committed 2026-10-11 13:36:03 -04:00
1 parent 91ecc8a75c
commit 764369d72e
1 file changed
+19 -2
+19 -2
View File
@@ -112,7 +112,23 @@ DEFAULT_STATIC_OVERLAY = "on"
# How far in the album art zoom goes, relative to its fully-zoomed-out rest # How far in the album art zoom goes, relative to its fully-zoomed-out rest
# state (see _art_widget below for why scale never goes below 1.0). # state (see _art_widget below for why scale never goes below 1.0).
ZOOM_LEVELS = { # 1x-only reduction: a busy/high-detail album cover (a "NOW" compilation,
# reports of an overrun with moderate zoom on one) pushed worst-case
# payload up -- the breathing zoom cycling through a wider scale range
# means more genuinely distinct crops to encode over the animation. 2x
# keeps the original values -- confirmed it has more buffer headroom on
# that hardware, per earlier discussion, so this is deliberately not a
# blanket reduction. Verified against a real "NOW"-style compilation
# cover: the reduced "moderate" (1.25) measured ~297-316KB across
# several runs, vs ~329-336KB at the original 1.4 -- a real, repeatable
# margin gain, not just noise from the glitch segment's own randomness.
ZOOM_LEVELS_1X = {
"off": 1.0,
"subtle": 1.1,
"moderate": 1.25,
"strong": 1.45,
}
ZOOM_LEVELS_2X = {
"off": 1.0, "off": 1.0,
"subtle": 1.15, "subtle": 1.15,
"moderate": 1.4, "moderate": 1.4,
@@ -183,7 +199,8 @@ def main(config):
station_url = station_url.rstrip("/") station_url = station_url.rstrip("/")
colors = COLOR_SCHEMES.get(config.get("color_scheme", DEFAULT_COLOR_SCHEME), COLOR_SCHEMES[DEFAULT_COLOR_SCHEME]) colors = COLOR_SCHEMES.get(config.get("color_scheme", DEFAULT_COLOR_SCHEME), COLOR_SCHEMES[DEFAULT_COLOR_SCHEME])
zoom_scale = ZOOM_LEVELS.get(config.get("zoom_level", DEFAULT_ZOOM_LEVEL), ZOOM_LEVELS[DEFAULT_ZOOM_LEVEL]) zoom_levels = ZOOM_LEVELS_2X if scale == 2 else ZOOM_LEVELS_1X
zoom_scale = zoom_levels.get(config.get("zoom_level", DEFAULT_ZOOM_LEVEL), zoom_levels[DEFAULT_ZOOM_LEVEL])
zoom_position = config.get("zoom_position", DEFAULT_ZOOM_POSITION) zoom_position = config.get("zoom_position", DEFAULT_ZOOM_POSITION)
static_overlay_enabled = config.get("static_overlay", DEFAULT_STATIC_OVERLAY) == "on" static_overlay_enabled = config.get("static_overlay", DEFAULT_STATIC_OVERLAY) == "on"
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.