Skip to content

rf stacking + new tbc code + noise canceling

Choose a tag to compare

@vrunk11 vrunk11 released this 02 Nov 10:46
· 7 commits to vrunk11_main since this release

Full Changelog: ldx-version...v1.0.0

Multi-source stacking and read-time TBC

This release adds two features to ld-decode-rust:

  • Stacking of several RF captures of the same disc.
  • Time base correction (TBC) applied as the RF is read, before demodulation.

It also cleans the RF (clock lines, chroma leak, audio crosstalk) and makes decoding much faster on both CPU and GPU.

What's new

Multi-source stacking

  • -i a.s16 -i b.s16 -i c.s16 -o output aligns several captures of the same disc sample by sample. It combines them into one RF stream, which is then decoded as usual.
  • --stack-weight adaptive (the default) weighs each input by its carrier amplitude, sample by sample, so a dropout on one copy is covered by the others.
  • Inputs can be at any sample rate; they are resampled to a common one.
  • --rf-out FILE writes the combined, corrected RF: exactly what the decoder reads.

Read-time TBC

  • --tbc read is now the default, with one input as well as several.
  • Pass 0 locates the lines straight from the RF (--pass0 rf, the default). It holds the field structure through dropouts and runs alongside the decode.
  • PAL is supported (--PAL), with ld-decode 7.4's processing. PAL is outside the byte-parity target.

RF cleaning

Each cleaning step is on by default; the option in brackets turns it off.

  • Clock lines (--keep-crystal-lines): the lines from the player's EFM decoder crystal and every other steady line in the capture are tracked and subtracted. The others include the video clock and the capture board's clocks.
  • Chroma leak (--keep-chroma-leak, NTSC only): the chroma that leaks into the RF is cancelled with a least-squares FIR. The filter is applied only when it really explains the signal.
  • Audio crosstalk (--keep-audio-crosstalk): crosstalk from the analog audio carriers is removed from the video.

GPU (OpenCL)

  • --device opencl runs the FM demodulation and the stacking on the GPU, in double precision by default.
  • --preset slow (the default) makes the GPU output byte-identical to the CPU's. --preset fast trades a little precision for speed.

Measured gains (NTSC, weighted video SNR)

Setup SNR Gain
1 copy, classic decode (baseline) 37.49 dB —
1 copy, read-time TBC + cleaning 38.40 dB +0.91 dB
3 copies stacked, everything on 39.81 dB +2.32 dB

These figures come from captures of a single disc on a single player, so stacking mostly removes noise from the capture chain. Copies from different pressings or players should gain more.

Performance

  • Full test capture (158 fields): 28 s → 13 s.
  • 3 copies, 60 frames: 24 s → 11 s.
  • The next chunk's GPU plan is prepared while the current chunk is computed, and the previous chunk's CPU cleaning runs at the same time.

Documentation

  • README.md documents every new option.
  • docs/stacking-handoff.md covers the architecture, the methods kept and rejected, and the measurements.