video: yield points in H.264 picture setup and VP8 rows, rgba / scale conversion; disposable packets and skipDisposable

- H264: picture and grid allocations split between yield calls (a 1080p picture's tables are 1.6 M slots)
- Vp8: Decode.decodeFrame hook three times per macroblock row and once per loop filter row; Options.yield
- Yuv.toRgba / Yuv.scale: optional hook every 16 rows; imageToRgba / imageScale take an out Image and the hook
- Video.open passes opts.yield to the conversions, the VP8 and MPEG-1/2 decoders
- codecs/video/Video/Disposable: H.264 nal_ref_idc 0 (avcC length-prefixed / Annex B), VP8 frames refreshing no
  reference; containers/Demux sets packet.disposable for h264 / vp8 tracks; Video.isDisposable(track, packet)
- skipDisposable: H.264 keeps skipped pictures in output order (pts pool / POC bookkeeping), VP8 applies the header
  state then skips; receive() returns false for a skipped picture, VideoFrame.index counts it
- Types: Packet.disposable, VideoCodecDecoder.receive may return false
- tools/fixtures/videoctl.py: VP8 two temporal layers (IVF + WebM)
This commit is contained in:
4DBug committed 2026-11-02 21:35:33 -06:00
1 parent dde6be117c
commit 15e0dfcc86
12 files changed
+469 -74

No files matched your search

+11
View File
@@ -2,6 +2,7 @@
-- containers/Demux: the indexed Types.Demuxer every video container builds (Matroska, AVI, MPEG-TS / PS, Y4M, MP4).
-- New in rosetta. Packets are offset + length into the source buffer (or own bytes); per-track cursors are independent.
local Types = require("@rosetta/Types")
local Disposable = require("@rosetta/codecs/video/Video/Disposable")
local Demux = {}
local D = {}
@@ -171,6 +172,16 @@ function D._packet(self: Demux, i: number): Types.Packet
p[k] = v
end
end
local tid = p.track
for _, t in self.tracks do
if t.id == tid then
local c = t.codec
if (c == "h264" or c == "vp8") and Disposable.check(c, data :: buffer, t.config) then
p.disposable = true
end
break
end
end
return p
end