ws-video2-flv: codecs/video/H263 (H.263 baseline + H.263+ PLUSPTYPE custom sizes / rounding type / UMV, Sorenson Spark with disposable frames), bit-exact with ffmpeg -flags +bitexact -idct int; registry entries h263 (H263 h263 s263 U263) and flv1 (FLV1)

Outside the folder: codecs/video/Dsp gains Dsp.mcNoRound (half-sample averages rounded down, H.263 rounding type 1);
Dsp.mc and the rest are unchanged. codecs/video/Video BUILTIN: h263 / flv1 entries with a simpleDecoder over H263.
This commit is contained in:
4DBug committed 2026-10-31 14:52:56 -05:00
1 parent 3146ec0936
commit 625c1fade2
8 files changed
+1683

No files matched your search

+13
View File
@@ -253,6 +253,17 @@ local function h264Decoder(track: Types.Track, opts: any?): (Types.VideoCodecDec
return H264.newVideoDecoder(track, opts)
end
-- H.263 / Sorenson Spark (codecs/video/H263): one picture per packet, no reordering
local function h263Decoder(track: Types.Track, opts: any?): (Types.VideoCodecDecoder?, Err.Err?)
local H263 = require("@formats/codecs/video/H263")
local dec = H263.new({ flv = track.codec == "flv1", maxPixels = opts and opts.maxPixels })
return Video.simpleDecoder(function(data: buffer): (Types.Image?, Err.Err?)
return dec:image(data)
end, function()
dec:reset()
end), nil
end
-- ------------------------------------------------------------------------------------------------ registry
-- the codecs known by name (decoders where `new` is set). FourCCs compare case-sensitively first, then upper-cased.
local BUILTIN: { Entry } = {
@@ -267,6 +278,8 @@ local BUILTIN: { Entry } = {
{ id = "vp9", name = "VP9", fourcc = { "VP90", "vp09" }, matroska = { "V_VP9" } },
{ id = "av1", name = "AV1", fourcc = { "AV01", "av01" }, matroska = { "V_AV1" } },
{ id = "theora", name = "Theora", matroska = { "V_THEORA" } },
{ id = "h263", name = "H.263", fourcc = { "H263", "h263", "s263", "U263" }, new = h263Decoder },
{ id = "flv1", name = "Sorenson Spark (FLV1)", fourcc = { "FLV1" }, new = h263Decoder },
{ id = "png", name = "PNG", fourcc = { "png ", "MPNG" }, matroska = { "V_PNG" } },
}