ws-webp: codec tests (vp8, vp8l), bench lines, type fixes
This commit is contained in:
1 parent
7c3d4b75ec
commit
5977b60df6
7 files changed
+226
-5
No files matched your search
+21
-1
@@ -1,5 +1,6 @@
|
||||
-- Throughput (bash tools/bench.sh): codec MB/s under both runtimes. MB/s are of decompressed output, best of n runs.
|
||||
-- Fixtures: tools/fixtures/deflate.py (a 6 MB corpus) and tools/fixtures/png.py (1024 x 768 images).
|
||||
-- Fixtures: tools/fixtures/deflate.py (a 6 MB corpus), tools/fixtures/png.py (1024 x 768 images) and
|
||||
-- tools/fixtures/webp.py (512 x 512 lossy and lossless files).
|
||||
local Deflate = require("@formats/codecs/Deflate")
|
||||
local Crc32 = require("@formats/core/Crc32")
|
||||
local Bytes = require("@formats/core/Bytes")
|
||||
@@ -56,3 +57,22 @@ do
|
||||
Png.encode(img)
|
||||
end)
|
||||
end
|
||||
do
|
||||
local Webp = require("@formats/image/webp")
|
||||
local WB = require("@tests/gen/webp_bench")
|
||||
local n = WB.width * WB.height * 4
|
||||
local lossy, lossless = buffer.fromstring(WB.lossy), buffer.fromstring(WB.lossless)
|
||||
bench("webp lossy decode 512x512", 3, n, function()
|
||||
Webp.decode(Bytes.reader(lossy))
|
||||
end)
|
||||
bench("webp lossless decode 512x512", 3, n, function()
|
||||
Webp.decode(Bytes.reader(lossless))
|
||||
end)
|
||||
local img = assert(Webp.decode(Bytes.reader(lossless)))
|
||||
bench("webp lossless encode (effort 5)", 1, n, function()
|
||||
Webp.encode(img)
|
||||
end)
|
||||
bench("webp lossless encode (effort 1)", 1, n, function()
|
||||
Webp.encode(img, { effort = 1 })
|
||||
end)
|
||||
end
|
||||
Reference in new issue
Block a user