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
-13
@@ -1,9 +1,5 @@
|
||||
-- codecs/video/H263 tests. Against `ffmpeg -idct int` (tools/fixtures/h263.py): H.263 streams (sub-QCIF .. 4CIF, GOB
|
||||
-- headers, DQUANT, q 1 .. high quantisers), H.263+ PLUSPTYPE streams (custom sizes, sizes that are not a multiple of
|
||||
-- 16, the rounding type, unrestricted vectors with reversible codes, slice structure) and Sorenson Spark streams (standard, 8-bit and
|
||||
-- 16-bit custom sizes, 11-bit escapes, high motion, disposable inter pictures) decode one picture at a time to exactly
|
||||
-- ffmpeg's planes, every frame; header info; frameImage; the registry's decoders (h263, flv1); unsupported options are
|
||||
-- UNSUPPORTED; truncated and corrupted pictures never throw; the fuzz no-throw pass.
|
||||
-- codecs/video/H263 tests: H.263, H.263+ and Sorenson Spark streams bit-exact against `ffmpeg -idct int`.
|
||||
-- Fixtures: tools/fixtures/h263.py.
|
||||
local T = require("@tests/T")
|
||||
local H263 = require("@rosetta/codecs/video/H263")
|
||||
local Video = require("@rosetta/codecs/video/Video")
|
||||
@@ -55,7 +51,6 @@ local function crcs(f: any): (number, number, number)
|
||||
return planeCrc(f.y, f.stride, w, h), planeCrc(f.cb, f.stride // 2, cw, ch), planeCrc(f.cr, f.stride // 2, cw, ch)
|
||||
end
|
||||
|
||||
-- differing luma samples against a reference frame (detail on a mismatch)
|
||||
local function lumaDiff(f: any, ref: buffer): (number, number)
|
||||
local n, first = 0, -1
|
||||
for y = 0, f.height - 1 do
|
||||
@@ -71,7 +66,6 @@ local function lumaDiff(f: any, ref: buffer): (number, number)
|
||||
return n, first
|
||||
end
|
||||
|
||||
-- 1. every stream against ffmpeg, bit-exact
|
||||
local total = 0
|
||||
local disposables = 0
|
||||
for _, fx in STREAMS do
|
||||
@@ -117,7 +111,6 @@ for _, fx in STREAMS do
|
||||
end
|
||||
t:check(disposables > 0, "disposable Sorenson pictures decoded (" .. disposables .. ")")
|
||||
|
||||
-- 2. header info
|
||||
do
|
||||
local fx = STREAMS[8] -- plus_custom
|
||||
local file = b64(fx.file)
|
||||
@@ -136,14 +129,12 @@ do
|
||||
t:check(e ~= nil and e.code == Err.CORRUPT, "no start code: CORRUPT")
|
||||
end
|
||||
|
||||
-- 3. unsupported H.263+ options
|
||||
for name, data in BAD do
|
||||
local dec = H263.new()
|
||||
local f, e = dec:decode(b64(data))
|
||||
t:check(f == nil and e ~= nil and e.code == Err.UNSUPPORTED, name .. ": UNSUPPORTED (" .. tostring(e) .. ")")
|
||||
end
|
||||
|
||||
-- 4. frameImage
|
||||
do
|
||||
local fx = STREAMS[14]
|
||||
local dec = H263.new({ flv = true })
|
||||
@@ -159,7 +150,6 @@ do
|
||||
t:check(dec:decode(42 :: any) == nil, "decode of a non-buffer is nil")
|
||||
end
|
||||
|
||||
-- 5. the registry's decoders
|
||||
do
|
||||
t:check(Video.fromFourcc("H263") == "h263" and Video.fromFourcc("s263") == "h263" and Video.fromFourcc("FLV1") == "flv1", "registry names")
|
||||
t:check(Video.canDecode("h263") and Video.canDecode("flv1"), "registry decoders")
|
||||
@@ -191,7 +181,6 @@ do
|
||||
end
|
||||
end
|
||||
|
||||
-- 6. robustness: truncated and corrupted pictures, garbage (never throws), the fuzz pass
|
||||
do
|
||||
local samples = {}
|
||||
for _, idx in { 1, 6, 8, 10, 11, 13, 16 } do
|
||||
|
||||
Reference in new issue
Block a user