Commit Graph
21 Commits
Author SHA1 Message Date
aiongg c4e9bb691b Merge integration track codec2 2026-10-31 02:17:03 +00:00
aiongg f473741026 Merge PR #3296: vp9: token loop monomorphised on counting, cheaper sign read 2026-10-31 02:10:06 +00:00
aiongg 533c8bc88f Merge PR #2842: codecs: prevent 32-bit length overflows (#2801) 2026-10-31 02:10:05 +00:00
aiongg 9a4611e9d3 Merge PR #3295: vp9: inter prediction across a band boundary without the window copy 2026-10-31 02:10:05 +00:00
vangel76 00c2f33dc5 Merge upstream/main into perf/vp9-token-loop 2026-10-29 21:34:26 +01:00
Dylan M. Taylor f0ea988d8f Refactor vp9 for strict Clippy checks 2026-10-28 04:36:48 +00:00
vangel76andClaude Sonnet 5.5 806ba12e3d vp9: token loop monomorphised on counting, sign read without the multiply
tokens() is split on the symbol counting flag (const generic), the
count tables are indexed once per call instead of per symbol, the scan,
neighbour and band tables are re-sliced to the block's end of block
limit so the loop needs no bounds checks, and the sign bit uses
BoolDecoder::read_bool_half (read_bool(128) with the split computed as
(range + 1) >> 1, same result).

Output is unchanged (framemd5 equal to ffmpeg).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 14:15:55 +01:00
vangel76andClaude Sonnet 5.5 0c9c9901dc vp9: inter prediction across a band boundary reads both bands directly
A block whose (h + 7)-row source window crossed a band boundary went
through fetch_window, which copies the window row by row (a division,
an atomic and a memcpy per row). Every 64-high block and about 60 % of
the 32-high ones cross a boundary. predict_two_bands now filters straight
from the two band slices; filter_v takes an array of eight row slices
(filter_v_rows) so the arithmetic is the same. Windows that need edge
clamping or span three bands still use the window copy.

Output is unchanged (framemd5 equal to ffmpeg).

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-10-25 14:10:06 +01:00
Michael Butler e4671da3fd #2801: merge main and preserve parser overflow regressions
Resolve the bitstream migration conflicts by retaining the craft-media
re-export and running the NAL regression tests against it. Drop the
obsolete proptest dependency and update the WASI testing documentation.

AI assistance: OpenAI Codex.
2026-10-24 20:26:01 -04:00
Dylan M. Taylor b4901c5bce security(codecs): validate VP9 empty tiles and AV1 film grain scaling points (#3081) 2026-10-24 05:25:27 -04:00
Michael ButlerandCodex 8dc619b76f codecs: prevent 32-bit length overflows (#2801)
Check NAL, VP9 superframe, AV1 tile and OBU lengths before slicing or converting. Add hostile-input regression tests and document running the parser tests on 32-bit WASI.

Targeted native and WASI tests pass. Full workspace CI is currently blocked by pre-existing UI Clippy diagnostics; this checkpoint is committed at the contributor’s explicit request before investigating the baseline separately.

Co-authored-by: Codex <noreply@openai.com>
2026-10-23 15:45:11 -04:00
99ec34de30 security(vp9): bound frame allocation (#2930)
* security(vp9): bound frame allocation

* vp9: raise the frame-size cap to 2^26 luma samples so level 6.x 8K frames decode

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* vp9: keep the frame-size cap below the imports

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Brandon Thomas <brandon@storyteller.ai>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-23 10:54:40 -04:00
vangel76andClaude Opus 5.5 ce63803934 #980: VP9 decode loop-filters a frame as a superblock-row wavefront
Problem: the post stage of a VP9 frame (band assembly, loop filter,
publication) ran on one thread. Later frames wait per band for their
references, so the serial loop filter (~30 % of the profile) set the
pace of every inter frame; 16 threads were only ~1.8x one thread.

Fix: rows of a frame's loop filter run as a wavefront, row r two
superblocks behind row r - 1 (what the raster order of 8.8.1 allows),
taken by the post thread and helper jobs on the decoder's pool. No lock
is held while a superblock is filtered: each row filters its own band
and rows exchange copies of the 8 rows the filter reaches across a band
boundary. Output stays bit-identical; one thread / wasm run the rows in
order as before. A row is only taken by a running thread, so waits
always make progress, and helpers run under catch_unwind (a failure
publishes placeholder bands as before). New conformance fixture
narrow_tall (2 superblock columns) and a repeated multi-thread 1080p
decode test. 1.2-1.5x faster with 16 threads on a shared machine.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-11 10:18:44 +02:00
Brandon ThomasandClaude Opus 5.5 d499b0c20e vp9: never crash — no unwrap/expect/panic in the decoder, deny them
- Transforms, 8-tap filters, probability tables: fixed-size views through `first_chunk(_mut)`
  instead of slice + `try_into().unwrap()/expect()` (same code on the happy path).
- Tile sizes read with `get()`; a short tile header is `Error::Invalid`.
- Buffer pool tolerates a poisoned lock.
- A failed post-processing thread spawn no longer panics: the job reaches the thread over a
  channel, so it is still in hand and runs inline.
- Without the `threads` feature an unpublished reference band reads as empty instead of panicking.
- `#![deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented,
  clippy::todo, clippy::unreachable)]` outside tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-04 11:15:05 -04:00
Brandon ThomasandClaude Opus 5.5 1827b71891 M4.10: VP9 vectorised loop filter, column-parallel transforms, 16-bit 8-bit MC
The loop filter's lane masks are 0 / -1 integers with bitwise selects and min / max clipping
(bool masks and clamp kept it scalar); the 2D inverse transform's column pass runs the generated
butterflies on 4 / 8 columns at once; 8-bit sub-pixel filters accumulate in 16-bit lanes (every
sum of the VP9 filters fits modulo 2^16). Branch-free bool decoder update. Bit-exact; tested
against the per-column transform on random blocks.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 07:12:57 -04:00
Brandon ThomasandClaude Opus 5.5 842801de41 M4.10: VP9 frame threading (band-published references, per-frame post stage) and draft mode
Frames are published one superblock row at a time once loop filtered; a post stage per frame
(own thread) assembles bands from the tile strips, filters them in raster order and builds the
output picture, while the next frame's tile columns decode and wait per band for the reference
rows they read. Bit-exact with 1, 3 and all threads. Draft mode skips the loop filter of frames
that refresh no reference slot. av1dec / hevcdec bench knobs and VP9 / AV1 4K playback scenarios
in the bench.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-03 05:34:39 -04:00
Brandon ThomasandClaude Opus 5.5 9db963e0e6 M9.8: VP9 wired into codecs — WebM/MKV V_VP9 and MP4 vp09 (+vpcC) import, 8/10/12-bit 4:2:0/4:2:2/4:4:4 (4:4:0 expanded, RGB to RGBA) output, key-frame-checked GOP random access, Decoder::reset / is_keyframe, oracle seek tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 00:42:11 -04:00
Brandon ThomasandClaude Opus 5.5 0d1f21d393 M9.8: VP9 decode speedup — lane-parallel loop filter (i16/i32 lanes), banded parallel loop filter, vectorizable MC filters, per-size transform buffers, buffer pools, parallel strip assembly and picture output
1080p 8-bit bench: 55 -> 98 fps single-thread CPU time; 45 -> 115 fps wall with 14 threads
(best of 4 on a heavily loaded machine). Still bit-exact against the ffmpeg oracle on the
whole fixture matrix (1 thread and thread pool). Fixture generation uses per-call unique
temporary names (concurrent tests generating the same fixture raced on rename).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-01 00:21:03 -04:00
Brandon ThomasandClaude Opus 5.5 5e9d7d904e M9.8: VP9 loop filter speedup (gathered samples, sliding wide filter), perf test, vp9dec example, README
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 22:46:13 -04:00
Brandon ThomasandClaude Opus 5.5 804eb14fa9 M9.8: VP9 fixture matrix with backward adaptation / alt-ref / tile rows, synthetic scaled-reference, intra-only and show_existing streams, robustness tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 22:37:46 -04:00
Brandon ThomasandClaude Opus 5.5 916de99fda M9.8: filmcraft-vp9 clean-room VP9 decoder (profiles 0-3, tiles, superframes, scaling) with ffmpeg oracle tests
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-09-30 22:22:12 -04:00