Skip to content

fix(deinterlace): Soft Telecine left Bwdif's template block in the script (#108) - #111

Merged
StuartCameronCode merged 2 commits into
mainfrom
fix-108-soft-telecine-bwdif-placeholder
Oct 5, 2026
Merged

StuartCameronCode merged 2 commits into
mainfrom
fix-108-soft-telecine-bwdif-placeholder

Conversation

@StuartCameronCode

Copy link
Copy Markdown
Owner

Fixes #108.

Cause

Each deinterlace method's arm in script_generator.rs removed the other methods' template blocks by hand. When Bwdif was added (1d77af1), the QTGMC and IVTC arms gained the new remove_block line and the Soft Telecine arm did not. Its script therefore kept the whole Bwdif block with {{BWDIF_FIELD}} unsubstituted, which vspipe reports as a Python SyntaxError. Preview and encode both failed for every source with Soft Telecine selected, in v1.0.0 and v1.1.0.

Fix

Block selection now happens once, before the per-method match, from a DEINT_METHOD_BLOCKS table: the selected method's block is kept and every other is dropped. The arms no longer remove each other's blocks, so a new method can't repeat this.

Tests

  • Rust test_161: generates the encode and preview scripts for every method and asserts each emits only its own call with no placeholder left. Fails without the generator change.
  • Rust unit test: keeps the table complete; a new DeinterlaceMethod variant won't compile until listed.
  • Dart (push gate): Soft Telecine script-generation case in integration_filter_parameters_test.dart.
  • Dart (heavy): preview + encode of soft_telecine_test.mkv in integration_new_passes_test.dart.

No test previously generated a script with DeinterlaceMethod::SoftTelecine, which is why this shipped.

🤖 Generated with Claude Code

https://claude.ai/code/session_014GLXdGLfPwgYjW1AkonGqN

StuartCameronCode and others added 2 commits October 5, 2026 19:05
…ript (#108)

Each deinterlace method's arm removed the other methods' template blocks
by hand. When Bwdif was added, the QTGMC and IVTC arms gained the new
remove_block line and the Soft Telecine arm did not, so its script kept
the whole Bwdif block with {{BWDIF_FIELD}} unsubstituted. vspipe reported
that as a Python SyntaxError, failing both preview and encode for every
source with Soft Telecine selected.

Block selection now happens once, from a DEINT_METHOD_BLOCKS table, before
the per-method match: the selected method's block is kept and every other
is dropped. A unit test with a catch-all-free match keeps the table
complete when a method is added.

Tests: test_161 generates the encode and preview scripts for every method
and asserts each emits only its own call with no placeholder left; a
script-generation case in integration_filter_parameters_test; and a heavy
preview + encode of soft_telecine_test.mkv.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GLXdGLfPwgYjW1AkonGqN
The FFV1 losslessness control built its source reference with
`-s 720x576`, mirroring the worker's old decoder. #106 changed the worker
to decode the full stored frame with `-apply_cropping codec` and never
rescale, so the reference became a 702->720 rescale of the clean-aperture
fixture while the worker's output was the true stored frame. The nightly
has failed on this one test on every platform since both landed on main.

Decode the reference with PreviewGenerator.sourceDecodeOptions, the same
option the worker uses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014GLXdGLfPwgYjW1AkonGqN
@StuartCameronCode
StuartCameronCode merged commit 740e4d9 into main Oct 5, 2026
11 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.

[ERROR] Preview script syntax error on Soft Telecine

1 participant