IVTC: fallback deinterlace for leftover combing - #99
Open
StuartCameronCode wants to merge 1 commit into
Open
StuartCameronCode wants to merge 1 commit into
StuartCameronCode wants to merge 1 commit into
Conversation
Implements the feature scoped for Rob's bug report (broken 3:2 cadence at scene changes, field-blended dissolves): a new opt-in ivtcFallbackDeinterlace toggle patches frames VFM couldn't cleanly field-match with a QTGMC deinterlace of that frame, instead of leaving them combed. Off by default (roughly doubles the pass's cost). Mechanism, probed against the actual bundled vivtc plugin before wiring up (not assumed from memory, per house rule): - VFM already stamps a _Combed frame property on every frame; this reads it, doesn't add it. - VDecimate accepts a clip2 kwarg — its drop decisions come from `clip`, its output frames come from `clip2`. VFM itself already uses this exact idiom for its own 8-bit-metrics/full-depth-output split. - A parallel QTGMC pass + FrameEval builds the hybrid clip that VDecimate's clip2 then draws from. The preview template has no VDecimate call (single frame), so the hybrid replaces `clip` there directly instead. ivtcFallbackPreset defaults to Fast rather than QTGMCPreset's general Slower default, since this pass runs on top of an already-slow IVTC pass. Touches: Rust model + script generator + both templates (encode and preview, so the preview shows what the real encode will produce), Dart model + converter, the deinterlace filter schema, a Rust integration test, and a Flutter script-generation test. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014GLXdGLfPwgYjW1AkonGqN
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements the feature scoped earlier for a user bug report: an IVTC source with a broken 3:2 cadence at scene changes (and some field-blended dissolves) leaves residual combing after
VFM/VDecimatealone, because those frames simply couldn't be cleanly field-matched.ivtcFallbackDeinterlacetoggle (IVTC method only, default off): patches any frameVFMflagged as still combed with a QTGMC deinterlace of that same frame, instead of leaving it combed.ivtcFallbackPreset(defaultFast, not the generalSlowerQTGMC default — this runs a full second QTGMC pass on top of an already-slow IVTC pass).Mechanism
Before wiring anything up, I probed the actual bundled
vivtcplugin (not assumed from memory or docs) to confirm the two behaviors this depends on:VFMstamps a_Combedframe property on every frame — already true today, just unused elsewhere.VDecimateaccepts aclip2kwarg: decimation decisions come fromclip, output frames come fromclip2.VFMitself already uses this exact idiom (its own 8-bit-metrics / full-depth-output split), so this isn't a new pattern for this codebase.Script shape:
VFMruns unchanged → a parallelQTGMCpass deinterlaces the full source at single rate →FrameEvalbuilds a hybrid clip that swaps in the QTGMC frame wherever_Combedis set →VDecimate(clip, clip2=hybrid, ...)keeps its drop timing from the plain VFM clip but takes output frames from the hybrid. The preview template has noVDecimatecall (single-frame), so the hybrid clip replacesclipdirectly there instead.With the toggle off (default), the generated script is byte-for-byte what it was before this feature existed.
Test plan
vivtc.dylibdirectly viavspipe(not just documentation) to confirmVDecimate'sclip2parameter andVFM's_Combedproperty both exist as expectedcargo test— full suite green (161/161 infilter_integration_test.rs; the one pre-existing failure elsewhere,test_subtitle_generation_srt_file, is a local missing-whisper-addon environment gap, unrelated)integration_filter_parameters_test.dartflutter analyzeclean on every touched fileflutter test --exclude-tags heavy— 942 passed, 0 failedBase branch is
update-tracking(this branches off it, per the parent conversation) rather thanmain— rebase ontomainonce that one merges.🤖 Generated with Claude Code
https://claude.ai/code/session_014GLXdGLfPwgYjW1AkonGqN