forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 86fb0f3d0c47e6aff7ce60ab0d4653cbde35f00aFiltered to crates/ec-ac3/src/encode.rsClear filter

2026-11-17

2026-11-08

Encoder parameter-path fixes found by ffmpeg round-trip sweepsAhmet Kaan Gümüş · c561bfe
Encoder parameter-path fixes found by ffmpeg round-trip sweeps

- ec-truehd: set nonrestart_substr on access units without major sync;
  ffmpeg rejected every AU after the first
- ec-mp3: write the Xing/Info frame at a bitrate that holds the whole tag;
  at low bitrates the truncated tag made ffmpeg read gapless fields from
  audio frames (16 kHz/8 kbps decoded as noise, others shifted)
- ec-aac: cap a frame at 6144 bits per channel; high bitrate per channel
  overflowed the decoder buffer and the 13-bit ADTS length
- ec-av1: validate tiles against the superblock size actually coded (128),
  no shift overflow on huge log2, refuse base_q_idx 0 (lossless) up front
- ec-ac3: 0 Hz no longer panics
- ec-alac: refuse frame_length outside 1..=2^20 (0 hung) and 0 Hz

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-20

docs(ac3-enc): correct three stale claims about the encoderAhmet Kaan Gümüş · f8b6839
docs(ac3-enc): correct three stale claims about the encoder

Module doc still called the encoder a "fixed-allocation skeleton" with a
"constant exponent strategy" -- it now runs transient-driven block
switching, a D15/D25/D45/reuse exponent planner and a binary-searched
rate loop. plan()'s docstring said block-switched blocks send D15; the
code sends D25 there (D15 is LFE-only) because the short transform's
interleaved halves make D15 too expensive per block. Replaced both with
what the code does and the fill ratios actually measured (roughly
93-99.6%, not a flat >97%).
feat(ac3-enc): block switching, D15/D25/D45/reuse exponent planning and a binary-search rate loopAhmet Kaan Gümüş · 18654e6
feat(ac3-enc): block switching, D15/D25/D45/reuse exponent planning and a binary-search rate loop

Transient detector picks the short transform per block (forward = transpose
of the decoder's short inverse, TDAC-probed at 1/128); exponents are planned
per run of blocks with the decoded set driving allocation; csnroffst then
fsnroffst are binary-searched so frames fill >97% of their size; chbwcod
from the per-channel bit rate; encoder_delay() = 256 and finish() flushes
the overlap tail. Full wav16 fixture matrix round-trips at corr 1.000
through our decoder and the oracle.
feat(ac3-enc): fixed-allocation AC-3 encoder skeleton that round-trips at corr 0.998Ahmet Kaan Gümüş · f663ba5
feat(ac3-enc): fixed-allocation AC-3 encoder skeleton that round-trips at corr 0.998

Adds Ac3Encoder: syncinfo/bsi/6 audblk writer mirroring the parser, D15
exponents on block 0 then reuse, constant bit allocation parameters, a
csnroffst step-down to fit the frame, CRC1/CRC2 patched post-write, MDCT
via ec_dsp::Mdct. Three defects found on the way to a clean round trip:

- forward MDCT gain: ec_dsp's raw sum needs A/52's -2/N (was 0.5, i.e.
  -256x too large, so every loud bin hit exponent 0 and clipped) — pinned
  by a TDAC unit test against transform.rs's IMDCT, both for ec_dsp and an
  O(N^2) direct form of the §7.9.4 formula (worst error < 1e-4)
- grouped mantissas (bap 1/2/4): the decoder reads the group code at the
  group's FIRST member, so the writer must emit it there via lookahead,
  not when the group fills
- exponent envelope: the ±2/bin group coding is fit by a backward+forward
  min-pass that only ever lowers exponents, instead of a one-directional
  walk that raised them on the rising edge of a peak and clipped it

encode_matrix: 1/2/6 ch at 48 kHz and 2 ch at 44.1 kHz decode via
Ac3Decoder at corr >= 0.95; the external oracle accepts the frames with no
error/invalid/crc lines, both stereo channels at corr >= 0.95.