forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 70849e07ad7e30da44cd8a7f390dc93bfb49542eFiltered to crates/ec-h264/src/bits.rsClear filter

2026-09-12

perf(h264): bulk-read CABAC renorm and zero-fill bit supplyAhmet Kaan Gümüş · f3d387e
perf(h264): bulk-read CABAC renorm and zero-fill bit supply

RenormD doubles codIRange by leading_zeros-23 positions in one shift and
supplies the matching bits with one bulk read, replacing the per-bit
loop; BitCursor::bits_zero_fill is the engine's supply contract made
explicit (zero-filled past the RBSP, position accounting unchanged), so
bit() drops its Result plumbing. The coeff_abs_level prefix loop hoists
the inc0/inc1 context spelling out of the per-bin branch.

Byte-exact A/B vs d27a904d on the five fixture classes: all
display-order frame hashes identical. ec-h264 lib suite green.

2026-08-14

feat(h264): CAVLC intra decoder, bit-exact on 18 JVT streamsAhmet Kaan Gümüş · f985e44
feat(h264): CAVLC intra decoder, bit-exact on 18 JVT streams

I-slice scope: I_4x4 / I_16x16 / I_PCM, full CAVLC residual decode,
all intra prediction modes, 4x4 inverse transform + DC Hadamard,
dequant with scaling-list support, and the complete in-loop deblocking
filter. Everything outside scope (CABAC, FMO, interlace, non-I slices,
8x8 transform, 4:2:2/4:4:4, >8-bit) refuses with a named Unsupported
error backed by tests on real conformance streams - never wrong pixels.

Perf-first layout: padded planes sized for future inter overreach;
per-MB state in flat struct-of-arrays (nz counts, intra modes, QP,
slice ids) with no per-MB heap objects; a register-cached BitCursor for
slice data; residual parse fused with reconstruction so empty blocks
cost one coeff_token read; wide i16x16 SIMD for horizontal deblock
edges (a gather/scatter vertical variant measured slower and stayed
scalar). Steady-state decode loop is zero-alloc, proven by a counting
allocator in the conformance harness.

Conformance: first IDR bit-exact vs the JVT reference YUV and ffmpeg on
18 CAVLC streams incl. multi-slice and I_PCM; 6 CABAC/FMO/interlaced
streams verified to refuse by name; deterministic corrupt-input sweep
(truncations + 2000 single-byte mutations) never panics.

Measured on this machine, single thread, deblock included: 1324 ns/MB
(193 Mpx/s) on BA1_Sony_D at idle; 1007 ns/MB (254 Mpx/s) on the
no-deblock NL1_Sony_D even under background load.