wai-rs: jpegai_icci — the Haar wavelet domain of the eICCI post-filter #13

Merged
dcharlot merged 1 commit from feat/jpegai-dwt into main 2026-07-15 03:26:53 -04:00

2026-07-15

Transaction Science
wai-rs: jpegai_icci — the Haar wavelet domain of the eICCI post-filter
First piece of eICCI, the last unported JPEG-AI decode stage. eICCI's CNN operates in
a wavelet domain rather than on pixels; this lands that transform.

A Haar wavelet on 2x2 blocks with 1/2 scaling, applied two levels: a plane [1,H,W]
becomes [4,H/2,W/2] then [16,H/4,W/4]. Stacking the three planes' subbands gives the
48 channels the network's first convolution consumes (cat(Y16,U16,V16)).

  LL =  a+b+c+d    (all pre-scaled by 1/2)
  HL = -a-b+c+d
  LH = -a+b-c+d
  HH =  a-b-c+d

Perfect reconstruction: LL-HL-LH+HH = 4a, so the inverse recovers each sample exactly.
Channel layout matches the reference cat order — one level emits [LL,HL,LH,HH]; two
levels emit x16[i*4..i*4+4] = the level-2 decomposition of level-1 band i.

Unit tests: hand-checked single 2x2 block, idwt.dwt = id, two-level round-trip with the
16-band shape, and the 48-channel plane stack.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
2026-07-15 03:26:35 -04:00