forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 84fa44cfe66f76e22181d4ff8bc06ef6ea78db07Filtered to crates/ec-core/src/registry.rsClear filter

2026-09-19

ec-core: read a display matrix at i32::MIN as Other, not a panicAhmet Kaan Gümüş · dcf9b20
ec-core: read a display matrix at i32::MIN as Other, not a panic

Rotation::from_matrix decided its b == -c test with a plain negation, so a
crafted tkhd carrying i32::MIN in the c term panicked in a debug build and
wrapped onto a false quarter turn (Cw270) in a release one. Use checked_neg
so the term falls through to Other, which is the right reading for a value
whose negation is not representable. Add a unit test feeding i32::MIN cases
including the load-bearing (0, MIN, MIN, 0).
mp4: read the tkhd display matrix and surface it as a typed RotationAhmet Kaan Gümüş · ead0050
mp4: read the tkhd display matrix and surface it as a typed Rotation

ec-core gains a public Rotation (None/Cw90/Cw180/Cw270/Other{a,b,c,d}) and
StreamInfo.rotation, defaulting to None; the only StreamInfo struct literal
in the workspace (the mp4 demuxer) is migrated.

The mp4 demuxer's read_trak now reads the 36-byte tkhd display matrix that
sits before the width/height at the far end of the box, for both box
versions, and maps its 2x2 linear part to a quarter turn clockwise -- the
same reading edith's engine takes, so a consumer no longer needs its own
matrix parser. A matrix that is not a pure quarter turn is carried verbatim
as Other rather than rounded onto a turn it would then apply for real.

Fixtures under crates/ec-mp4/tests/data (rot0/90/180/270/45) are committed
with gen.sh, and the generator reproduces them byte-for-byte. Parse and
surface only: no pixel rotation, and the muxer still writes a unity matrix.

2026-08-21

2026-08-14

fix(probe): the head of a file is exact, and a default track is the flagged oneAhmet Kaan Gümüş · c665d19
fix(probe): the head of a file is exact, and a default track is the flagged one

Three gaps the symphonia swap (edith W7) found, all at the start of a file or
at the pick of a track:

- **An MP3 is gapless.** The LAME tag's encoder delay and padding went unread,
  so a `.mp3` claimed the silence around its sound as part of it and its
  samples arrived 25 ms behind the `.flac` of the same tone.
  `StreamInfo::initial_padding` now states the delay (the tag's, plus Layer
  III's own 529 samples of synthesis delay) and the duration ends at the last
  audible sample. Measured against ffmpeg on eight fixtures and three files of
  a real library: lag 0, correlation 1.0000, where the mp3 was 1105 samples
  late before.
- **A seek to the beginning goes there.** `candidate` started at the nearest
  *cue*, and a cue naming another track can sit past our own first block: this
  muxer opens a cluster at every video keyframe and cues the video alone, so a
  file whose first cluster holds only sound lost that cluster on every seek to
  zero. Another track's cue now backs off one entry, and a target before
  everything indexed starts at the first cluster.
- **`FlagDefault` picks the track.** `default_stream` answered with the first
  stream of a kind, so a dual-audio remux that marked its second track default
  opened in the other language. `StreamInfo::default` carries the flag where a
  file really wrote it (the element's absent value is 1, which is why
  "flagged" and "eligible" have to be different questions), and the symphonia
  shim's `default_track` reads it.

The shim gains the surface that carries these: `Track::delay`, the umbrella's
feature names (no-ops -- ec-probe serves every format unconditionally -- but a
`[patch.crates-io]` consumer naming `features = ["mkv"]` must still resolve).

Checks: `ec_probe` `the_head_of_a_file_is_exact` (gapless arithmetic exact
against ffmpeg, and no seek lands past a first packet) and `ec_matroska`
`the_first_cluster_is_reachable_when_no_cue_names_it` (fails without the cue
back-off: the audio restarts at 21 ms instead of 0).
feat(core): TrueHD and DTS codec ids, and a Matroska track's own numberAhmet Kaan Gümüş · 254c09a
feat(core): TrueHD and DTS codec ids, and a Matroska track's own number

A track nothing here decodes is named rather than dropped: a player that
lists a TrueHD track as unsupported tells the user something, and one
that shows no audio at all does not. The Matroska reader maps A_TRUEHD,
A_MLP and the A_DTS family onto them.

MatroskaDemuxer::track_number answers what TrackNumber a stream index
came from, which is how a caller names one language of a dual-audio
remux (edith matches its audio streams by that number).
feat(core): H.273 color model + dsp remap, ported from edith engineAhmet Kaan Gümüş · 81a11c6
feat(core): H.273 color model + dsp remap, ported from edith engine

Ports the engine's first-party colorspace model into the family IR: the
three-tier resolve (container tags over bitstream tags over the 720-line
heuristic), the H.273 code tables, the HEVC/H.264/AV1 parameter-set walks
that read a VUI colour_description, and the HDR SEI/mdcv/clli readers.

ColorInfo keeps its raw CICP triplet and gains the meaning behind it
(tags/describe/primaries and a From<ColorDescription> back out);
VideoParameters gains the ContentLight the mastering-display and
content-light metadata needs, which costs those four structs their Eq.

remap lands in ec-dsp beside the transforms: same 8.8 fixed-point
coefficients, same rounding, same no-op on a matching pair.
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.