Commit Graph
16 Commits
Author SHA1 Message Date
BFlat 6664e26e60 Merge pull request #2449 from vangel76/vp9enc-tables-carry-dimensions
vp9enc: probability delta table, linear bool-encoder carry, clamp oversized frames
2026-10-30 01:13:58 +07:00
BFlat e9ff2754b2 Merge pull request #2445 from vangel76/vp9enc-phase-planes-fast-path
vp9enc: vectorised phase-plane filters and a predict fast path
2026-10-30 01:12:48 +07:00
BFlat 46dbb58d94 Merge pull request #2447 from vangel76/vp9enc-motion-search-sad
vp9enc: fixed-size SAD kernels and a revisit cache in the motion search
2026-10-30 00:10:32 +07:00
BFlat 1e5008cf29 Merge pull request #2446 from vangel76/vp9enc-forward-transform
vp9enc: forward transform accumulates all outputs together
2026-10-30 00:08:29 +07:00
vangel76andClaude Sonnet 5.5 153e907afa Merge upstream/main into vp9enc-loop-filter-lanes
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>
2026-10-28 15:41:16 +01:00
Dylan M. Taylor 3bc15c7c17 Refactor vp9enc for strict Clippy checks 2026-10-28 06:09:21 +00:00
vangel76andClaude Sonnet 5.5 068cf04038 vp9enc: probability delta table, linear bool-encoder carry, clamp oversized frames (part of #2416)
- 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>
2026-10-26 00:35:21 +01:00
vangel76andClaude Sonnet 5.5 3ae34e6b2e vp9enc: fixed-size SAD kernels and a revisit cache in the motion search (#2413)
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>
2026-10-26 00:33:55 +01:00
vangel76andClaude Sonnet 5.5 f3fcea8297 vp9enc: forward transform accumulates all outputs together (#2412)
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>
2026-10-26 00:33:55 +01:00
vangel76andClaude Sonnet 5.5 ec3df905b5 vp9enc: loop filter in 8-lane groups (#2414)
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>
2026-10-26 00:33:55 +01:00
vangel76andClaude Sonnet 5.5 3e6d40e5bf vp9enc: vectorised phase-plane filters and a predict fast path (part of #2411)
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>
2026-10-26 00:32:49 +01:00
bflatasticandClaude Opus 5.5 e90f81850c VP9: frames never end in a byte that reads as a superframe marker (#161)
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>
2026-10-07 14:15:33 +07:00
Dexter 39e6907b5f G2: improve editing reliability and Windows rendering fidelity 2026-10-06 00:00:31 -05:00
Brandon ThomasandClaude Opus 5.5 5cc376a818 Never crash: Opus and VP9 encoders without expect()
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>
2026-10-04 13:23:06 -04:00
Brandon ThomasandClaude Opus 5.5 b26fbb6247 M10.2: VP9 inter frames (motion search, MV prediction, loop filter, forward probability updates, rate control)
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>
2026-10-03 03:44:03 -04:00
Brandon ThomasandClaude Opus 5.5 406706e3d5 OUT-2: WebM export (VP9 intra encoder + alpha, Opus), WAV/AIFF audio-only outputs
- effectcraft-vp9enc (L0): VP9 profile 0 key-frame encoder from the VP9 bitstream spec
  (8x8 intra blocks, DC/V/H/TM, 4x4 DCT/ADST, lossless WHT at quality 100, tile columns);
  round-trips exactly through FilmCraft's VP9 decoder and ffmpeg.
- export: WebM muxer (EBML/Matroska spec) with VP9, VP9 alpha in BlockAdditional
  (AlphaMode 1), Opus (CodecDelay = pre-skip); WAV and AIFF outputs.
- OutputFormat WebM/Wav/Aiff in the Render Queue, renderQueue.add formats, CLI --format.
- Tests: FilmCraft decode-back (frames, size, pixels, audio RMS), ffprobe/ffmpeg oracles.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-02 22:28:15 -04:00