Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ VapourBox/
| `worker/src/pixel_format.rs` | Source `pix_fmt` → pipe format (see "Source Pixel Formats"); a format's chroma grid and a size's pad onto it (`chroma_grid`, `grid_pad`, task #97) |
| `worker/templates/stabilize.py` | Stabilize pass: the weave (`Stab` measured at 16-bit) and the vertical pitch correction (see "Stabilize") |
| `worker/templates/srestore.py` | The Unblend pass: VapourBox's windowed port of srestore (see "Unblend (SRestore)") |
| `worker/templates/plugin_formats.py` | Each limited plugin's format `Contract` and `run_within()`, the one way a pass runs a plugin outside its formats; `pad_around()` / `read_padded()` for a frame size it refuses (see "High Bit Depth Sources"); `mvtools_blocks()` and `mvtools_flow_opt()` for MVTools' small-picture faults |
| `worker/templates/plugin_formats.py` | Each limited plugin's format `Contract` and `run_within()`, the one way a pass runs a plugin outside its formats; `pad_around()` / `read_padded()` for a frame size it refuses (see "High Bit Depth Sources"); `mvtools_blocks()` and `mvtools_flow_opt()` for MVTools' small-picture faults; `havsfunc_mask_any_depth()` for QTGMC's 8-bit-only Mask (task #89) |
| `Scripts/probe-plugin-formats.py` | Runs every plugin call the template makes at every format and size a pass can be handed; writes / checks `Tests/TestResources/plugin_format_table.json` (task #48) |
| `worker/src/models/unblend_parameters.rs` | Unblend's parameters, srestore's ratio arithmetic (`srestore_ratio`) and the refusal wording |
| `worker/src/cpu.rs` | The x86 deps CPU tier (`v3`/`v2`) — the single decision; see "CPU tiers" |
Expand Down Expand Up @@ -458,7 +458,15 @@ Adding a filter touches many files. Missing any step causes silent failures (fil
CPU), so `_deinterlace_qtgmc_rows` pads with
`mvtools_blocks(min_cols=_pf.mvtools_mask_cols(w, h, b, o))`, b/o from
`QTGMCParameters::prog_sad_mask_blocks` (havsfunc's effective values),
for those jobs only (task #79, test_263). Check on a fixture with real low
for those jobs only (task #79, test_263). That Mask also refuses a clip
above 8 bits, so the same jobs rebind `_deinterlace_qtgmc` through
`_pf.havsfunc_mask_any_depth(haf, fn)`, which runs every Mask havsfunc
makes on an 8-bit stand-in of the clip's size, `ml × 2^(bits − 8)` for
kind 1, the mask put on the clip's scale (task #89, test_269; a
`{{#QTGMC_MASK_ANY_DEPTH}}` block, so other jobs' scripts are unchanged).
It works because kind 0–4 never read the clip's pixels and MVTools takes
the SAD shift from the clip but the scene-change thresholds from the
vectors. Check on a fixture with real low
bits that the plugin leaves the samples it doesn't change exact — see
"High Bit Depth Sources"
- If any parameter is a **level, threshold or offset expressed in 8-bit units**
Expand Down
20 changes: 20 additions & 0 deletions Scripts/probe-plugin-formats.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,18 @@ def descratch_pass(c):
y = descratch(core.std.ShufflePlanes([c, blank, blank], [0, 0, 0], vs.YUV))
return core.std.ShufflePlanes([y, c], [0, 1, 2], vs.YUV)

def qtgmc_input_type_2_pass(c):
# The Deinterlace pass's call for InputType 2 at Medium (BlockSize
# 16, Overlap 8): _deinterlace_qtgmc_rows under the stand-in, inside
# the QTGMC contract's run_within().
import plugin_formats as pf

def rows(x):
fn = pf.havsfunc_mask_any_depth(
haf, lambda y: haf.QTGMC(y, Preset='Medium', InputType=2, TFF=True))
return pf.mvtools_blocks(x, fn, min_cols=pf.mvtools_mask_cols(x.width, x.height, 16, 8))
return pf.run_within(c, 'havsfunc.QTGMC', rows, delta_only=False)

def sangnom(c):
aa = core.resize.Spline36(c, c.width * 2, c.height * 2)
aa = core.sangnom.SangNom(aa, order=1, aa=48)
Expand Down Expand Up @@ -207,6 +219,14 @@ def call(key, covers, run):
# Fast doesn't: the only presets that refuse a 4:2:x width 2 mod 4 (task
# #56 F2). The template picks this contract for SrchClipPP 1.
call('havsfunc.QTGMC[SrchClipPP=1]', ['havsfunc.QTGMC'], lambda c: haf.QTGMC(c, Preset='Super Fast', TFF=True))
# InputType 2/3 at Placebo..Medium run MVTools' Mask (ProgSADMask), which
# refuses a clip above 8 bits (task #89); Medium is the cheapest preset
# that runs it. The bare call records the refusal; the pass runs every
# Mask havsfunc makes on an 8-bit stand-in (havsfunc_mask_any_depth), with
# the template's padding (#79) and its run_within() for the frame size.
call('havsfunc.QTGMC[InputType=2]', ['havsfunc.QTGMC'],
lambda c: haf.QTGMC(c, Preset='Medium', InputType=2, TFF=True))
call('pass.QTGMC[InputType=2]', [], qtgmc_input_type_2_pass)
call('bwdif.Bwdif', ['bwdif.Bwdif'], lambda c: core.bwdif.Bwdif(c, field=3, edeint=nnedi3(c, field=3)))
# The plugin itself (its refusal), and through run_within() its contract.
call('nnedi3.nnedi3', ['nnedi3.nnedi3', 'znedi3.nnedi3'], lambda c: nnedi3_plugin(c, field=1))
Expand Down
Loading
Loading