tests/codecs (a-m): comments: specs only
This commit is contained in:
1 parent
a80299dce0
commit
5f7f6005f6
24 files changed
+46
-181
No files matched your search
+2
-10
@@ -1,8 +1,5 @@
|
||||
-- codecs/video/H264 tests: libx264 streams at many settings (Baseline / Main / High, CAVLC / CABAC, B frames, references,
|
||||
-- weighted prediction, 8x8 transforms, scaling matrices, slices, odd sizes with cropping, ...) decoded and compared
|
||||
-- per frame with ffmpeg's decoder (CRC-32 of the yuv420p planes, bit-exact); the AVCC (avcC + length-prefixed
|
||||
-- samples) and NAL-at-a-time paths; pts propagation; UNSUPPORTED streams (interlaced, 4:2:2, 4:4:4, 10-bit); error
|
||||
-- codes; and the fuzz no-throw pass. Fixtures: tools/fixtures/h264.py.
|
||||
-- codecs/video/H264 tests: libx264 streams at many settings, per frame against ffmpeg (CRC-32 of yuv420p planes).
|
||||
-- Fixtures: tools/fixtures/h264.py.
|
||||
local T = require("@tests/T")
|
||||
require("@rosetta/host") -- LuaJIT: the trace limits the api sets (host/init.luau)
|
||||
local H264 = require("@rosetta/codecs/video/H264")
|
||||
@@ -13,7 +10,6 @@ local Bad = require("@tests/gen/h264_bad")
|
||||
|
||||
local t = T.suite("h264")
|
||||
|
||||
-- 1. every stream, whole, against ffmpeg
|
||||
local nframes = 0
|
||||
for _, c in Cases do
|
||||
local frames, err = H264.decodeAll(c.data)
|
||||
@@ -33,7 +29,6 @@ for _, c in Cases do
|
||||
end
|
||||
t:note("%d streams, %d frames bit-exact with ffmpeg", #Cases, nframes)
|
||||
|
||||
-- 2. AVCC samples, NAL-at-a-time input, pts
|
||||
local function splitAnnexB(s: string): { string }
|
||||
local out = {}
|
||||
local i = 1
|
||||
@@ -107,13 +102,11 @@ for _, c in Cases do
|
||||
end
|
||||
end
|
||||
|
||||
-- 3. unsupported streams
|
||||
for _, c in Bad do
|
||||
local frames, err = H264.decodeAll(c.data)
|
||||
t:check(frames == nil and err and err.code == c.code, c.name .. ": " .. tostring(err))
|
||||
end
|
||||
|
||||
-- 4. error codes
|
||||
do
|
||||
local _, e1 = H264.decodeAll(123 :: any)
|
||||
t:check(e1 and e1.code == Err.ARG, "decode of a number: ARG")
|
||||
@@ -134,7 +127,6 @@ do
|
||||
t:check(ld and #ld == #c.frames and Crc32.of(ld[#ld].image.pixels) == c.frames[#c.frames], "lowDelay on a P-only stream")
|
||||
end
|
||||
|
||||
-- 5. fuzz: streams with damaged bytes / truncations must never throw
|
||||
local samples = {}
|
||||
for _, c in Cases do
|
||||
if #c.data < 20000 and #samples < 14 then
|
||||
|
||||
Reference in new issue
Block a user