Skip to content

Fix pinned logo mask matching (stride corruption at load) - #8

Merged
eric merged 2 commits into
fancybitsfrom
fix-logo-mask-stride
Aug 30, 2026
Merged

eric merged 2 commits into
fancybitsfrom
fix-logo-mask-stride

Conversation

@eric

@eric eric commented Aug 30, 2026

Copy link
Copy Markdown
Member

Supersedes #5 (commit kept, credit to @v8eta) with review fixes on top: one stride for every mask read and write (matcher, overlay, dump, save), the frame indexed by width in rejection mode 4 where the mask index was reading past the frame, a range check on the logo file's area, and a bounds guard when the logo area does not fit the current frame.

Verified on a recording with a logo: a pinned mask reproduces the learned run's logo fraction exactly, the re-saved logo file is byte-identical, and the cut list matches the current fancybits build on the same pinned run.

touki and others added 2 commits August 30, 2026 11:23
LoadLogoMaskData can run when the width global is 0 (before the first
decoded frame) or transiently wrong (it is rewritten by both decode and
analysis contexts within one run), scattering mask cells so that
CheckStationLogoEdge finds testEdges==0 and pinned-mask matching
silently never works. Store cells at a fixed MAXWIDTH stride, record it,
and index the mask through the recorded stride while frame pixels keep
the live width.
Store a loaded mask at the file's picWidth stride (MAXWIDTH only when the
file has none), record it in logo_mask_stride, and use it for every mask
read and write: the matcher, the overlay, the dump and the save. The
frame is still indexed by width, which the rejection-mode-4 branch had
mixed up with the mask index. Reject a logo file whose area does not fit,
and skip matching when the logo area does not fit the current frame.
@eric
eric merged commit a7f6145 into fancybits Aug 30, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant