forge
Explore
Log in

Don't you dare go Hollow

Commits

Commits on 0563cbfec08046b75ca933b5b9909fd656d3ea9fFiltered to vendor/cros-codecs/src/decoder/stateless/av1/vaapi.rsClear filter

2026-08-12

🐛 fix(decode): a film's grain is synthesized into a surface of its ownAhmet Kaan Gümüş · c52b667
🐛 fix(decode): a film's grain is synthesized into a surface of its own

An AV1 frame with `apply_grain` set is *displayed* from a second surface:
the driver writes the reconstructed picture into the render target, which
later frames reference, and the grain-synthesized one into a target the
decoder has to hand it. The vendored backend handed it none -- it passed
`VA_INVALID_SURFACE` as `current_display_picture` while still asking, in
the very same buffer, for the grain -- and radeonsi refuses that picture
outright: `vaEndPicture` answers VA_STATUS_ERROR_INVALID_SURFACE.

That is what killed the only AV1 film in the library at frame 49, its
first picture with grain; 1337 of the first 1504 have it, so AV1 playback
on real media had never worked. Every fixture that said otherwise was
grainless, which is why `test_av1_grain.mkv` is now beside them and why
its test decodes all ninety frames and then asks whether the grain
actually reached the picture -- turning `apply_grain` off would make the
decode succeed too, and would silently strip the film of its texture.

A grainy picture costs two pool frames rather than one, so a sequence
whose header admits grain gets a pool of twice the size; one that does
not is left exactly as it was, as are H.264, HEVC and VP9, which have no
such surface and read back the reconstructed one as always.

2026-08-09

🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui previewAhmet Kaan Gümüş · 0acbf8d
🎉 feat: MVP decode pipeline — mp4 → H.264 → gpui preview

- engine: mp4 demux → Annex-B, rusty_h264 software decode, BT.601
  I420→BGRA; decode on worker thread behind a bounded channel
- engine-hw: optional VA-API decode plugin (cros-codecs) behind a
  C ABI, dlopen'd at runtime with silent software fallback; the app
  binary keeps zero libva/gbm/drm linkage so it runs on any distro
- app: gpui window, per-frame RenderImage swap + drop_image
- vendor/: cros-libva + cros-codecs with 3 LOCAL PATCH fixes (libva
  1.23 struct init, radeonsi 64x64 min context, pub surface()) —
  upstream is dormant, so vendor/ is adopted code, not a temp fork
- fixtures are gitignored; scripts/gen_fixtures.sh regenerates them