Repository navigation
Deblock interlaced output per field; keep Deblock after Deinterlace - #146
Merged
Merged
Conversation
Measured on blocky interlaced MPEG-2: moving Deblock ahead of QTGMC gains <=0.05 dB at default strength, so the order stays. With deinterlacing off, per-field deblocking beat woven-frame deblocking in all 14 comparisons. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
With deinterlacing off and a detected field order, every Deblock method ran on the woven frame, filtering vertically across both fields. For DCTFilter that was destructive: 1.5-3.7 dB below no filtering at all, because it attenuates the field-to-field alternation on moving edges. The edge deblockers lost 0.03-0.30 dB against per-field. Now SeparateFields -> deblock -> DoubleWeave[::2] (bit-exact round trip) whenever ScriptGenerator::still_interlaced_tff says the picture is still interlaced; the border code shares that check. A 4:2:0 frame with an odd chroma field height keeps the woven path. Deinterlaced output is unchanged: moving Deblock ahead of QTGMC measured <=0.05 dB. Report updated with the DCTFilter measurements. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
A user asked whether deblocking should run before deinterlacing (advice from a Gemini chat). This measures it, and fixes the one case where the order did matter.
Report:
docs/reports/2026-11-deblock-order/index.html(screenshots, scripts, CSVs). Two 720×576 TFF fixtures, MPEG-2 at 1000/1500/3000 kbps with+ildct+ilme, scored against clean references with PSNR, SSIM, VMAF and blockdetect.Findings
Change
{{#DEBLOCK_PER_FIELD}}in both templates:SeparateFields → deblock → DoubleWeave[::2]for every method wheneverScriptGenerator::still_interlaced_tffholds (deinterlacing off and a detected field order). The border code now uses the same check. Splitting and re-weaving is bit-exact, with frame props restored.Tests
test_183: all 3 methods × both field orders × encode and preview scripts, plus the progressive cases.integration_filter_parameters_test: the filter call sits between the split and the weave, for every method.integration_new_passes_test(heavy): encodes all 3 methods. Per-field DCTFilter moves frame 45 by 0.55 levels from the source, against 2.22 woven (the woven reference is a job with no detected field order).test_subtitle_generation_srt_file, which needs the Whisper add-on and fails the same way onmain. Flutter script tests 54/54. Heavy high-bit-depth, borders and filter-pipeline suites 262/262; the high-bit-depth suite now runs the per-field path at 8/10/12/16-bit.Not tested: NTSC, DV, interlaced H.264, hardware-encoded MPEG-2, x86.
🤖 Generated with Claude Code