Commits
2026-08-14
chore: relock the workspaceAhmet Kaan Gümüş · 22fb460
chore: relock the workspace The committed lock predates several workspace members, so every cargo invocation rewrote it; this is that rewrite, with no dependency added by hand and none removed.
feat(opus): CELT encoder — mono/stereo/multistream, all rates, CBR+CVBRAhmet Kaan Gümüş · 52ead44
feat(opus): CELT encoder — mono/stereo/multistream, all rates, CBR+CVBR
Throughput-first CELT-only Opus encoder (RFC 6716 Section 5, coding path
mirrored symbol-for-symbol from the normative Appendix A; analysis replaced
by fast deterministic heuristics: no pitch prefilter, tf_res fixed, spread
fixed NORMAL, single-pass coarse energy):
- range.rs: full RFC 5.1 range encoder (fixed-size frames, shrink, raw-bit
tail), tell()/tell_frac()/range-state exact against the decoder per symbol
- celt_enc.rs: forward MDCT as the exact adjoint of the decoder's inverse,
transient/trim/dynalloc/stereo analyses, encode-side allocation, PVQ
search (wide f32x8 lanes) + V(N,K) enumeration, Laplace coarse energy
- encoder.rs: TOC framing (configs 28..31), CBR and constrained-VBR, plain
and self-delimited (App B) packets
- multistream_enc.rs: RFC 7845 family-1 surround (5.1 helper), per-stream
self-delimited framing, coupled streams weighed 2:1 in the rate split
- shims/opus-rs: the opus-rs 0.1.26 surface edith consumes, mono fixed and
no rate ceiling; root-cause doc for the incumbent's ~165 kbps cliff in
lib.rs
Proof in tests/conformance.rs (same binary): per-packet range-state parity
encoder vs vector-verified decoder at 32..510 kbps x {mono,stereo} x all
frame sizes x CVBR; libopus (ffmpeg) decodes the whole rate table at worst
corr 0.9565 (32k stereo) to 1.0000; 5.1 order-preserved >=0.9978; reference
opus_demo 0.9995 at 256k stereo; Ogg-Opus duration exact; zero-alloc steady
state; speed floors (measured ~150-580x realtime per config).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.
feat(riff): WAV reader/writer and the hound shim over itAhmet Kaan Gümüş · 5dd56cf
feat(riff): WAV reader/writer and the hound shim over it ec-riff writes and reads RIFF/WAVE: 8/16/24/32-bit integer PCM and 32-bit float, mono through 7.1, any sample rate. The writer streams and patches the RIFF, data and fact sizes in finalize (best-effort on drop), and emits WAVE_FORMAT_EXTENSIBLE with a channel mask whenever a file has more than two channels or more than 16 bits. The reader walks the chunk list rather than assuming fmt-then-data, so LIST/INFO, fact and odd-sized chunks with their pad byte are skipped, and a truncated or unpatched data size yields what is actually there. RF64, ADPCM and 64-bit float are refused by name. shims/hound carries package name hound 3.5.1 over ec-riff, covering exactly what edith consumes: WavWriter::create/write_sample/finalize, WavSpec, SampleFormat and an Error with the incumbent's variants. Checks: cargo test -p ec-riff -p hound (10 tests), and the emitted oracle artifacts compared against ffmpeg's own decode - 5 written formats and the 6 wav fixtures all PASS at corr 1.000000, RMS delta 0.
feat(dsp): FFT/DCT/MDCT/window primitivesAhmet Kaan Gümüş · 09790f6
feat(dsp): FFT/DCT/MDCT/window primitives Radix-4/radix-2 Stockham FFT (power-of-two, 1..65536, f32 and f64), real-input wrapper on the N/2 complex trick, DCT-II/III via Makhoul and DCT-IV via an N/2 FFT, MDCT/IMDCT folded onto DCT-IV (AAC 2048/256 and Vorbis/CELT sizes go through an N/4-point FFT), and sine/KBD/Vorbis windows with fused application. No feature gates: the fast transform is the only transform, and the only O(n^2) code in the crate is the reference DFT/DCT/MDCT behind cfg(test). Hot loops vectorise through wide on chunks_exact, so the bounds checks fold; the scalar remainder is the same expression. Accuracy vs the f64 reference, sizes 8..8192: 3.1e-15 f64, 1.3e-7 f32; f32 forward+inverse round trip 1.6e-7 to n=32768; MDCT TDAC 2.2e-15 f64 / 4.8e-7 f32 with every window shipped.
feat(oracle): fixture scripts + comparison harnessAhmet Kaan Gümüş · d207f1d
feat(oracle): fixture scripts + comparison harness gen-fixtures.sh: 87 deterministic ffmpeg fixtures (10 audio codecs x mono/stereo/5.1 x 44.1/48k, 4 video codecs x mp4/mkv x 23.976/60 x 8/10-bit, 4K sample per codec). fetch-vectors.sh: JVT H.264, JCT-VC HEVC, RFC6716 Opus, cellar FLAC, Xiph Vorbis; checksum-pinned in scripts/vectors.sha256, resumable, per-set graceful failure. scan-real-library.sh: read-only ffprobe sweep of the local media dirs into fixtures/real-library-manifest.tsv (T3 gate input). tools/oracle: std-only bin driving ffmpeg/ffprobe through process pipes (bit-exact, audio-compare, video-compare); ffmpeg stays test tooling, never a crate dep.
feat(core): workspace + ec-core IR foundationAhmet Kaan Gümüş · a3c0049
feat(core): workspace + ec-core IR foundation
Cargo workspace (crates/*, shims/*, tools/*) and ec-core, the IR every
crate in the family builds on:
- timebase: reduced rational TimeBase + Timestamp, all i128-exact integer
math, four rounding modes. 24000/1001 is representable and stays exact;
cross-base ordering compares instants without rounding first.
- packet: Buf (refcounted byte range, cheap clone and slice) + Packet with
optional pts/dts/duration, flags and side data.
- frame: VideoFrame over validated planes (I420/I422/I444, 10-bit I010/
I210/I410, NV12/NV21, P010/P016, gray, packed RGB/BGRA) with CICP colour
code points, AudioFrame with named channel positions (5.1 = FL FR FC LFE
BL BR) interleaved or planar.
- bitio: MSB and LSB bit readers/writers, exp-Golomb ue/se both ways,
truncation reported as NeedMore instead of panicking, exp-Golomb prefix
bounded so a fuzzer cannot spin.
- error: NeedMore/Eof/Unsupported{what,why}/Corrupt{context}/Io; a refusal
always names what was refused and why.
- registry: CodecId for every codec edith touches (video, audio, subtitle),
CodecParameters/StreamInfo, and the Demuxer/Muxer/Decoder/Encoder
contracts. Codecs are push/pull (send_packet/receive_frame) because
packets and frames do not correspond one to one and end of stream has to
be drainable.
forbid(unsafe_code), warn(missing_docs), no dependencies, no async.