Commits
Commits on
cdccbc2f662cc4e4dda0e2d99d7faf0ca5577064Filtered to crates/ec-av1/src/encoder/mod.rsClear filterToday
ec-av1 RateLoop::update: do not lower q on a tiny frame (actual < target/4). Root cause: the 48-frame 384 kbps gate's fade (n=36..44, actual 818,799,41,452,193,76,278,125,50 vs targets 1.7k-4.5k) stepped q down by STEP_CLAMP each frame to q=1 (census base_q 61.6->1.6->0.0); the scene cut at n=45..47 then coded at raw_q 1 for 9619,9338,6085 bytes, the whole +7.4% overshoot (103132 vs 96000). Fix: a frame under target/TINY_FRAME_DIVISOR (4) carries no slope information, so a negative step is held at 0; q may still rise. Census reasoning: n=38..44 held at eff_q 50, n=45 coded near q 50 instead of 1. Not run; orchestrator to verify with the 48-frame gate.Ahmet Kaan Gümüş · a5f823fBrowse files
ec-av1 rate loop: geometric-mean smoothing only when not repaying. Root cause of Bitrate 384k flat leaf 1720 -> 2002 (+7.4% -> +21.3%): c-round3-full.log (11:25) predates d6f79ca2 (11:28), c-round4.log (12:06) includes it, so the smoothing is the only Bitrate change between them; with replan moving the target every frame the lagged ratio (taken against an older target) fights the repay. BytesPerFrame (fixed target) keeps smoothing. cargo check -p ec-av1 --all-targets clean; remaining +7.4% not addressed, tests left to orchestratorAhmet Kaan Gümüş · b8d3de0Browse files
ec-av1 rate loop: steer on the geometric mean of the last two size ratios per slot. Evidence (c-round3-full.log sizes 4176,2073,4776,2183,3861,...): a 0.77 q step cannot move a frame 4176->2073, so the swing is inter-frame coupling (a big frame leaves a good reference, the next is small), not q slope; per-frame steering chases it as a decaying period-2 cycle that biases the mean low. Averaging log-ratios over two frames cancels the alternating component. BytesPerFrame repay=false kept; Bitrate +7.4% not separately root-caused (no census run permitted); replan still repays. cargo check -p ec-av1 --all-targets clean; tests left to orchestratorAhmet Kaan Gümüş · d6f79caBrowse files
ec-av1 rate: BytesPerFrame no longer replans. Root cause of settled mean 3102 vs 4000: RateLoop::replan re-solves target = left_bytes/left_weight after every frame, so the key overshoot (22289-4000) was repaid over the remaining 23 frames, target ~3200 (observed 2950-3100). BytesPerFrame now keeps its fixed per-frame target (repay=false); Bitrate keeps the budget-remaining replan. cargo check -p ec-av1 --all-targets clean; tests left to orchestratorAhmet Kaan Gümüş · 5c168bfBrowse files
ec-av1 rate loop: GAIN = 1/WEIGHT_LEVEL_GAIN (was 1/0.0154). Measured slope is 0.0557, so the old gain was ~3.6x loop gain, a period-2 limit cycle (sizes alternating ~4800/~1800, settled mean 3094 vs 4000) that also biased the mean low. Matched gain gives ~1x, one source of truth for the slope.Ahmet Kaan Gümüş · 96338e5Browse files
ec-av1 rate loop: restore main's comment text in level model (no prose added)Ahmet Kaan Gümüş · a8e773b
ec-av1 rate loop: restore main's comment text in level model (no prose added) Root cause (unverified by ffmpeg here): flat path slot() returned 0 for every level, so the key frame's unclamped seed step drove the shared q to the rail. Fix maps flat onto the pyramid's run plan (key slot 0, leaf slot 2, gop budget). Comment-only follow-up: restores main's wording, removes added prose.
ec-av1 rate loop: flat path key frame no longer slams shared qAhmet Kaan Gümüş · f61cd97
ec-av1 rate loop: flat path key frame no longer slams shared q Root cause: RateLoop::slot() returned 0 for every level on the flat path, so the key frame's unclamped seed step drove the single q to 255 and inter frames ramped back at STEP_CLAMP (12/frame). Fix: flat path runs the same per-level plan as the pyramid (key slot 0, leaf slot 2, gop budget, replan). gop=1 and pyramid output unchanged. Comments removed, struct doc updated. Tests not run here; orchestrator to verify against ffmpeg 9.0.2.
ec-av1 rate loop: key frame no longer slams the flat path's shared qAhmet Kaan Gümüş · 4b94175
ec-av1 rate loop: key frame no longer slams the flat path's shared q Root cause (encoder/mod.rs RateLoop): the flat path (no pyramid) had one shared q slot for key and leaves (slot() returned 0 for all levels) and no key budget. The key frame's first update takes the unclamped seed step (q += ln(22289/4000)/0.0154 ~ +111), so q hit 255 right after the key; the following inter frames then ramped down at STEP_CLAMP=12/frame, which matches the reported sizes ramp 45,109,219,272,428,550,... on Sintel 640x384 (derived from the code path, not yet checked with ffprobe). Fix: the flat path builds the same run plan as the pyramid (key plan + leaf plan, gop budget, replan over the GOP), each level steers its own q, and per_level is gone. The key overshoot is spread over the GOP instead of the leaves' quantizer. gop=1 output is unchanged.
2026-11-08
Encoder fixes from round-trip sweep follow-upAhmet Kaan Gümüş · f849ee9
Encoder fixes from round-trip sweep follow-up - ec-opus: 40/60 ms CELT/Hybrid as code-3 packets of 20 ms frames; self-delimited framing for code-3 packets (multistream 40/60 ms); multistream buffer sized for 60 ms - ec-image GIF: pixels turning transparent re-emit the previous frame with disposal 2 over the cleared area - ec-mp3: padding bit at 44.1/22.05/11.025 kHz - ec-aac: refuse bitrate 0 - ec-vorbis: refuse non-finite quality - ec-h264: refuse non-positive frame rate instead of clamping to 1 - ec-av1: with_pyramid doc matches behaviour (mini_gop > gop is clamped)
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.