Resolve crates/vp9enc/src/lf.rs: main moved sb_plane into FrameFilter::sb_plane
(mi grid and limits as struct fields, no allow(too_many_arguments)). The
branch's 8-lane group filtering (apply mask per lane, filter_group) is
re-applied inside that method; the now-unneeded too_many_arguments allow on
filter_group is dropped (7 arguments).
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
- delta_for no longer searches 0..255 for every probability: a 256x256 table is
built once.
- BoolEncoder remembers where the trailing run of 0xFF bytes starts, so a carry
no longer rescans the output (the cost was quadratic over long runs).
- Vp9Encoder::new clamps width and height to 65536; larger sizes used to wrap
in the 16-bit frame size fields and write a corrupt stream.
The output is byte-identical for all sizes up to 65536.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The 8x8 and 16x16 SAD uses per-column 16-bit sums, and the cost of a motion
vector (a pure function of the vector) is remembered for the vectors the
search tests again. The output is byte-identical.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The 16 outputs of the 4x4 forward transform are accumulated together in the
same order as before (no serial add chain per output) and the quantiser
truncates instead of calling floor on a non-negative value. The output is
byte-identical.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The encoder's loop filter runs three trial passes per frame with a scalar
filter. Filter the eight positions along an edge together with 16-bit lanes
(ported from the decoder's loop filter); the scalar filter stays as the test
oracle and a new test compares both on 20000 random cases. The output is
byte-identical.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
The 16 quarter-sample phase planes are built with 16-bit lane filters (the same
narrowing trick as the decoder), edge replication copies rows instead of
clamping every sample, and mc::predict reads straight from the reference for
blocks away from the edges. The output is byte-identical.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
A frame whose last byte happened to match the superframe marker pattern
(0b110xxxxx, Annex B) was taken by decoders for a superframe with an
index at its end: ffmpeg rejected it ("Invalid le value at
frame_sizes[i]"), libvpx reported a corrupt frame, and later frames lost
their reference. In the reported WebM, 3 of 60 frames (10, 22, 24) ended
in 0xc8, 0xc0 and 0xca. The render still reported success.
Such frames now get a zero byte after the last tile; the last tile's
bool-coded data may end in zero padding (9.2.3).
Test: frames_never_end_in_a_superframe_marker encodes sequences until a
frame needs the padding, checks no frame ends in a marker byte, and that
the padded frames decode exactly with FilmCraft's decoder and with
ffmpeg (clean error log). It failed before ("96x64 q40 frame 22 ends in
0xde"). The ffmpeg IVF oracle is shared with the existing inter test.
Checked with the reporter's steps: 60/60 frames, no errors from ffmpeg's
vp9 or libvpx, RGB and RGB + Alpha.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
opusenc: the SILK state is used through if-let / let-else instead of expect("SILK state").
vp9enc: the motion-search SAD and inter prediction return early without a reference frame
instead of expect("reference"). Denies the panic lints in both crates.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
effectcraft-vp9enc gains inter frames: single LAST reference, 16x16/8x8 blocks,
candidate + diamond search refined to quarter samples with the regular 8-tap
filters, NEARESTMV/NEARMV/ZEROMV/NEWMV with spec MV prediction, skip blocks,
the in-loop deblocking filter, per-frame forward probability updates, a key
frame interval and target-bitrate rate control. Decoded output matches the
encoder's reconstruction exactly through FilmCraft's decoder and ffmpeg.
WebM export now encodes sequentially with a key frame every two seconds.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>