forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on mainFiltered to crates/ec-h264/src/enc/rc.rsClear filter

2026-10-23

Restore edith_codecs after local data loss (2026-10-23)Ahmet Kaan Gümüş · b7434a2
Restore edith_codecs after local data loss (2026-10-23)

On 2026-10-23 an automated agent ran `rm -rf $HOME` and deleted the local
repository with all of its history. This commit restores the working tree
from the newest surviving copy, the host-c server lane mirror. That mirror
matches local main as of the testcut Phase 2 reports, including the tool
cache, the nextest fast profile and changed-crates.sh. The history before
this commit was not recovered.

2026-08-14

feat(h264): CABAC encoding, Main profile by defaultAhmet Kaan Gümüş · 466f297
feat(h264): CABAC encoding, Main profile by default

The incumbent this encoder replaces writes High-profile CABAC; writing CAVLC
against it costs roughly 12% of the bitrate at the same reconstruction, which
no amount of mode-decision work makes back. That was the whole screen-capture
quality gap.

The encoder is the write side of the decoder's own CABAC: context
initialisation, the ctxIdx offsets, the ctxIdxInc derivations and the block
categories all come from crate::cabac, and the arithmetic encoder of 9.3.4
mirrors the decoder of 9.3.3 step for step. A single wrong context
desynchronises the coder inside a macroblock, so the reconstruction test is
what holds the two together.

Slice data changes shape with the coder -- mb_skip_flag for mb_skip_run,
end_of_slice_flag after every macroblock, cabac_alignment_one_bit before the
first -- so the macroblock coder now writes syntax elements through one
surface (enc::entropy) rather than bits, exactly as the decoder reads them
through crate::entropy.

Measured at matched bitrate, 1080p Fast: +1.1 dB on a screen capture and
+0.25 dB on camera content. CAVLC stays available (EncoderConfig::cabac) and
is covered by the same round-trip sweep.
feat(h264): software encoder, I and P pictures, CAVLC, slice-parallelAhmet Kaan Gümüş · 6d22228
feat(h264): software encoder, I and P pictures, CAVLC, slice-parallel

The encoder shares the decoder's reconstruction rather than owning one:
prediction (pred, inter), dequantisation and the inverse transforms
(transform), the deblocking filter and the per-macroblock metadata are the
decoder's own code and the decoder's own Picture. What is new here is the
forward direction — forward transforms and quantisation (quant), CAVLC
writing derived at compile time from the decoder's tables (vlc), parameter
sets and slice headers (headers), mode decision and macroblock coding (mb),
and rate control (rc).

Scope: Baseline-profile syntax (8-bit 4:2:0 progressive, CAVLC, one
reference, pic_order_cnt_type 2), intra 16x16 and 4x4 with chroma modes,
P_Skip and P_L0_16x16 with a diamond search to quarter sample, and CBR
rate control with a per-macroblock-row correction. Coding a picture as one
slice per worker gives the parallelism inside the encoder: a slice is
independent by definition, so every worker owns its picture buffer and its
bitstream, and the bands are stitched and filtered once at the end.

B pictures and CABAC are not coded yet; the bframes field is accepted and
coded as zero rather than refused.