Example #1
0
func BenchmarkDecode_yellow_rose_lossy_with_alpha_chai2010_webp_cbuf(b *testing.B) {
	cbuf := tbLoadCData(b, "yellow_rose.lossy-with-alpha.webp")
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		m, pix, err := chai2010_webp.DecodeRGBAEx(cbuf.CData(), cbuf)
		if err != nil {
			b.Fatal(err)
		}
		_ = m
		pix.Close()
	}
	b.StopTimer()
	cbuf.Close()
}
Example #2
0
func BenchmarkDecode_gopher_doc_8bpp_lossless_chai2010_webp_cbuf(b *testing.B) {
	cbuf := tbLoadCData(b, "gopher-doc.8bpp.lossless.webp")
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		m, pix, err := chai2010_webp.DecodeRGBAEx(cbuf.CData(), cbuf)
		if err != nil {
			b.Fatal(err)
		}
		_ = m
		pix.Close()
	}
	b.StopTimer()
	cbuf.Close()
}
Example #3
0
func BenchmarkDecode_video_001_chai2010_webp_cbuf(b *testing.B) {
	cbuf := tbLoadCData(b, "video-001.webp")
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		m, pix, err := chai2010_webp.DecodeRGBAEx(cbuf.CData(), cbuf)
		if err != nil {
			b.Fatal(err)
		}
		_ = m
		pix.Close()
	}
	b.StopTimer()
	cbuf.Close()
}
Example #4
0
func BenchmarkDecode_blue_purple_pink_lossy_chai2010_webp_cbuf(b *testing.B) {
	cbuf := tbLoadCData(b, "blue-purple-pink.lossy.webp")
	b.ResetTimer()
	for i := 0; i < b.N; i++ {
		m, pix, err := chai2010_webp.DecodeRGBAEx(cbuf.CData(), cbuf)
		if err != nil {
			b.Fatal(err)
		}
		_ = m
		pix.Close()
	}
	b.StopTimer()
	cbuf.Close()
}