wai-rs: jpegai_pipeline::efn_filter — EFE luma-aided nonlinear chroma post-filter #9
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/jpegai-efn"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
First pixel-domain post-filter. Refines a chroma plane using co-located luma:
The reference builds a per-tile 2-layer conv/ReLU net with a fixed weight structure; it collapses to this closed form (one luma-gated channel carrying c_in + seven luma-only histogram-breakpoint channels). Constants: wP=16 → deinteger=(q-32767)/2^11, hist_split=8, 4:4:4.
Validated vs the reference fixture: max|Δ| = 4.6e-5 (f32-vs-f64), SNR 149.9 dB. Plus a unit test for the deinteger scale, min/gap breakpoints, and the two ReLU gates.
First pixel-domain post-filter. Refines a chroma plane using the co-located luma: w[i] = (weights_q15[i] - 32767) / 2^11 // deinteger, wP=16 min = luma_min_q/100 ; gap = (luma_max_q/100 - min)/8 c_out = relu( w[0]·(y - min) + c_in ) + Σ_{j=1..7} w[j]·relu( y - min - j·gap ) The reference builds a tiny 2-layer conv/ReLU net per tile (conv1 2→8 1×1 + bias, conv2 8→1 1×1) with a fixed weight structure; that collapses to the closed form above — one luma-gated channel carrying c_in plus seven luma-only histogram-breakpoint channels summed with weights [1, w[1..7]]. Validated against the reference fixture (luma + input chroma + 8 Q15 tile weights + luma min/max → filtered chroma): max|Δ| = 4.6e-5 (f32-vs-f64 rounding), SNR 149.9 dB. Plus a unit test pinning the deinteger scale, the min/gap breakpoints, and the two ReLU gates. Single-tile / 4:4:4; caller downsamples luma for subsampled formats. Co-Authored-By: Claude Opus 4.8 <[email protected]>dcharlot referenced this pull request2026-11-06 13:54:17 -05:00