forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 5a2f5efe3a0771ac7ca43d57bdf63c19a7b75ff6Filtered to crates/ec-av1/src/encoder.rsClear filter

2026-09-01

fix(av1): have_ffmpeg() SKIPped green under EC_AV1_REQUIRE_AOMENC=1Ahmet Kaan Gümüş · 91c1335
fix(av1): have_ffmpeg() SKIPped green under EC_AV1_REQUIRE_AOMENC=1

Every real-aomenc gate opens `if !have_ffmpeg() || !have_aomenc()`, and
only have_aomenc() asserted under the require flag -- have_ffmpeg() is
evaluated first and short-circuits, so a machine without ffmpeg printed
SKIP and the whole 20-gate batch reported green with the require flag
set (class gate-skips-on-its-own-failure).

have_ffmpeg() now mirrors have_aomenc(): absence panics when
EC_AV1_REQUIRE_FFMPEG=1 or EC_AV1_REQUIRE_AOMENC=1 is set (an aomenc
gate decodes its stream through ffmpeg, so requiring the oracle implies
requiring ffmpeg). Applied to all five copies of the helper
(stream/tile/decode/encode/encoder test modules), which had the same
silent-false shape.

2026-08-30

2026-08-27

feat(av1): a quality/size targeting surface over base_q_idxAhmet Kaan Gümüş · a55d2ef
feat(av1): a quality/size targeting surface over base_q_idx

RateTarget::{QIndex,Quality,BytesPerFrame} on Av1Encoder::with_rate_target,
additive alongside the existing EncoderConfig::base_q_idx path. Quality
maps to base_q_idx via the calibration sweep's linear fit; BytesPerFrame
steers it with a clamped proportional controller (no accumulated debt, so
no windup class to bound). Calibration sweep test records the curve.

2026-08-26

wip(av1): write the true display size as frame_width/height, not the padded oneAhmet Kaan Gümüş · 6b1cdcc
wip(av1): write the true display size as frame_width/height, not the padded one

Frame headers now carry the picture's true (unpadded) size as
frame_width/frame_height, with mi_cols/mi_rows derived from that true size
via spec compute_image_size (2*((w+7)>>3)) instead of the padded picture's
width/4 -- mirroring rav1e/libaom, so a decoder crops to the true size
instead of the coded (padded-to-32/64) one. render_width/render_height come
out equal to frame_width/frame_height, so render_and_frame_size_different is
false and no render_size bits are written.

tile.rs: check_blocks no longer requires mi_cols/mi_rows to be an exact
multiple of the 32x32 block grid (a true size need not be); a new
block_grid() ceiling-divides mi_cols/mi_rows into the block-column/row count
actually coded, shared by sb_coeff_key_frame_tile, split_coeff_key_frame_tile
and (now) encode_key_frame_inner's own block/superblock generation loop,
which used to derive its cols/rows straight from the padded picture's width
-- it must agree with the tile writer's own count exactly.

KNOWN REGRESSION, not yet root-caused: three existing round-trip tests that
used a size not a whole 32x32 (or, for the facade, 64x64) block now fail
ffmpeg/dav1d decode with "Invalid data found" (an_854x480_picture_round_
trips_through_its_padding, a_frame_round_trips_at_its_own_size at 1920x1080/
640x352/1280x720, sequence_round_trips_at_a_non_multiple_size at 160x96).
Reasoned through the cols/rows/has_cols/has_rows arithmetic by hand for the
BLOCK(32)-alignment case and it should be invariant (true mi_cols/mi_rows
land in the same (padded-8, padded] window that keeps every BLOCK_MI(8)-
aligned threshold's comparison unchanged) -- confirmed by an EC_RNG-gated
rng-per-symbol trace (temporary, reverted) diverging from aomdec's own trace
from the very first symbol, which does not match that reasoning and was not
resolved before the turn budget ran out. The three tests' own assertions
were updated to expect the new true-size ffprobe/decode behaviour (that part
is not in question); the decode failure itself is the open defect.

Not attempted: sb_coeff_inter_frame_tile has no has_cols/has_rows-style
partial-superblock handling at all (always PARTITION_SPLIT, always 4
quadrants) -- a true size that isn't a 64x64 (SUPERBLOCK) multiple needs that
ported from the key-frame writer before an inter/multi-frame stream can use
a true, non-superblock-aligned size. The facade's key-frame path already
regresses today for the same underlying reason before inter frames are even
reached.
feat(av1): streaming encoder facade with configurable colour (I11)Ahmet Kaan Gümüş · f421d98
feat(av1): streaming encoder facade with configurable colour (I11)

Av1Encoder is the one-in-one-out surface edith_replica's engine will call
in place of rav1e: EncoderConfig{width,height,base_q_idx,gop,colour} in,
encode(&Picture) -> Packet{data,key,order} out, gop-cadenced key frames
predicting inter frames from the previous reconstruction like
encode_sequence already did. encode_key_frame_inner/encode_inter_frame
are now shared (pub(crate)) between encode_sequence and the facade
instead of being duplicated. The sequence header's colour_config is wired
to Colour::{Bt709Limited,Bt601Limited,Unspecified} (spec 5.5.2's CICP
triple + range), replacing the hardcoded "unspecified" -- verified against
ffprobe.