Skip to content

Replace MCTemporalDenoise's inert Sigma with Post-denoise; fix MCTD preview reach (task #141) - #292

Merged
StuartCameronCode merged 2 commits into
mainfrom
stuart/141-mctemporaldenoise-s-sigma-control-does-n
Nov 28, 2026
Merged

StuartCameronCode merged 2 commits into
mainfrom
stuart/141-mctemporaldenoise-s-sigma-control-does-n

Conversation

@StuartCameronCode

Copy link
Copy Markdown
Owner

What

MCTemporalDenoise's Sigma slider (mcTemporalSigma) changed nothing. havsfunc r31 reads sigma only for its pfMode=0 FFT3D prefilter, and VapourBox never passes pfMode, so havsfunc's default of 3 (DFTTest) applies. Every sigma gave the same picture: a spread of 0.0000 dB over 45 measured cells. Found by task #140 (issue #177).

  • Sigma is removed from the schema, the Rust and Dart models, the converter, copyWith, the template and the legacy worker/filters copy. Old JSON that still carries mcTemporalSigma loads, and the key is ignored. A default job's script only loses sigma=4.0,, so its output is unchanged.
  • Post-denoise is new (mcTemporalPost → havsfunc's post): an FFT3DFilter pass after the temporal denoise. It is advanced-only, ranges 0–16 and defaults to 0, which leaves it out of the script. It has a 1.8.0 NEW badge. At noise sigma 6, medium goes from 34.5 to 43.1 dB at post 8. Because it is spatial, it costs 1.3–10.7 dB on a clean picture and takes 1.3–1.8x the time. The Strength steps don't set it.
  • Fix: MCTD's high and very high previews didn't match their encodes. These profiles run MDegrain twice and then TTempSmooth, so they read 6 frames each side (7–8 with post, 10 at radius 4). The preview decoded only 3, so high's preview was up to 2 levels off its encode. NoiseReductionParameters::mctd_reach now declares the reach from havsfunc's per-profile defaults, and previews match their encodes sample for sample.
  • Issue Feedback & Feature Requests: Noise Reduction, Sharpening, RIFE Interpolation, Apple Silicon Optimization & Watermark Removal #177's idea about heavy noise doesn't hold for MCTD. It suggested a low thSCD1 was why the low and medium profiles do nothing on heavy noise. Raising thSCD1 to 800–2000 gains at most 0.7 dB, thSAD 0.15 dB, and limit=0 about 3 dB at sigma 6 and nothing at sigma 9. Low and medium are profiles for light noise, so nothing is wired for this.
  • The plugin format probe's MCTD call now passes post=4.0, and the committed table is unchanged.

Report: docs/reports/task-141-mctd-sigma, with entries in ENGINEERING_NOTES, CLAUDE.md and the reports index. It uses synthetic noise on three clips, measured on Apple Silicon only.

Tests

  • Rust: test_273 (script generation), plus unit tests for old JSON and mctd_reach. cargo test passes.
  • Flutter: script-generation coverage in integration_filter_parameters_test.dart, and the push gate (--exclude-tags heavy,gpu) has 2070 passed and 8 skipped.
  • Heavy, run locally on macOS arm64 with deps 1.18.0-rc5:
    • integration_fft3dfilter_determinism_test.dart has new cases for MCTD high and very high with post. Previews and the lossless encode match exactly, which also confirms post relies on FFT3DFilter's patched measure=0 default.
    • integration_strength_test.dart: post 6 takes medium from 34.5 to 42.5 dB.
    • The template-parity, plugin-format-contract and high-bit-depth MCTD tests pass.
    • The other platforms will get their first run in nightly.
  • Review: I merged main in to resolve a docs-only conflict with Take a source's subtitles from their own input (fixes #266) #291 (both changes added an ENGINEERING_NOTES entry and a reports-index row) and re-ran cargo test and the Flutter push gate.

🤖 Generated with Claude Code

StuartCameronCode and others added 2 commits November 28, 2026 22:43
…st-denoise (task #141)

havsfunc r31 reads MCTemporalDenoise's `sigma` only with pfMode=0, which the
template never passes, so the Sigma slider changed nothing (every sigma gave
the same picture). It is removed (mcTemporalSigma; old JSON still loads), and
Post-denoise (mcTemporalPost, advanced only, default 0 = left out) passes
havsfunc's `post`, an FFT3DFilter pass after the temporal denoise.

Also: MCTD's high and very high profiles read 6-10 frames each side (two
MDegrain passes, TTempSmooth, post's FFT3D window), but the preview decoded
3, so high's preview was up to 2 levels off its encode. The reach is now
declared (NoiseReductionParameters::mctd_reach).

Issue #177's guess that thSCD1 holds back the low/medium profiles on heavy
noise is refuted for MCTD (thSCD1, thSAD and limit=0 don't rescue them);
nothing is wired for it. Report: docs/reports/task-141-mctd-sigma.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…-does-n

# Conflicts:
#	docs/ENGINEERING_NOTES.md
#	docs/reports/README.md
@StuartCameronCode
StuartCameronCode merged commit b6cf5ae into main Nov 28, 2026
8 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