std/jpeg: remove decode_idct block-selector arg

name                                             old speed     new speed     delta

wuffs_jpeg_decode_19k_8bpp/clang11               210MB/s ± 0%  213MB/s ± 0%  +1.54%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/clang11  200MB/s ± 0%  197MB/s ± 0%  -1.31%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/clang11   362MB/s ± 0%  373MB/s ± 0%  +3.04%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/clang11              307MB/s ± 0%  318MB/s ± 0%  +3.82%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/clang11         318MB/s ± 0%  331MB/s ± 0%  +4.09%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/clang11         434MB/s ± 0%  440MB/s ± 0%  +1.34%  (p=0.016 n=4+5)
wuffs_jpeg_decode_4002k_24bpp/clang11            320MB/s ± 0%  340MB/s ± 0%  +6.29%  (p=0.008 n=5+5)

wuffs_jpeg_decode_19k_8bpp/gcc10                 165MB/s ± 0%  172MB/s ± 0%  +4.32%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_progressive/gcc10    224MB/s ± 0%  227MB/s ± 0%  +1.30%  (p=0.008 n=5+5)
wuffs_jpeg_decode_30k_24bpp_sequential/gcc10     454MB/s ± 0%  465MB/s ± 0%  +2.40%  (p=0.008 n=5+5)
wuffs_jpeg_decode_77k_24bpp/gcc10                311MB/s ± 0%  324MB/s ± 0%  +4.38%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_420/gcc10           327MB/s ± 0%  342MB/s ± 0%  +4.52%  (p=0.008 n=5+5)
wuffs_jpeg_decode_552k_24bpp_444/gcc10           384MB/s ± 0%  393MB/s ± 0%  +2.34%  (p=0.008 n=5+5)
wuffs_jpeg_decode_4002k_24bpp/gcc10              324MB/s ± 0%  345MB/s ± 1%  +6.26%  (p=0.008 n=5+5)
This commit is contained in:
Nigel Tao committed 2023-06-10 14:12:08 +10:00
1 parent d248ade0e6
commit c0d7d7d046
9 files changed
+381 -359

No files matched your search

+15 -17
View File
@@ -579,15 +579,14 @@ test_wuffs_jpeg_decode_idct() {
&dec, sizeof dec, WUFFS_VERSION,
WUFFS_INITIALIZE__DEFAULT_OPTIONS));
const uint32_t b = 0;
memcpy(&dec.private_data.f_mcu_blocks[b], mcu_block, sizeof(mcu_block));
memcpy(&dec.private_data.f_mcu_blocks[0], mcu_block, sizeof(mcu_block));
const uint32_t q = 0;
memcpy(&dec.private_impl.f_quant_tables[q], quant_table, sizeof(quant_table));
uint8_t dst_array[64] = {0};
wuffs_jpeg__decoder__decode_idct(
&dec, wuffs_base__make_slice_u8(&dst_array[0], 64), 8, b, q);
&dec, wuffs_base__make_slice_u8(&dst_array[0], 64), 8, q);
wuffs_base__io_buffer have =
wuffs_base__ptr_u8__reader(&dst_array[0], 64, true);
@@ -651,14 +650,8 @@ test_wuffs_jpeg_decode_mcu() {
}
}
// Decode and compare-to-golden the first MCU (Minimum Coded Unit).
if (wuffs_jpeg__decoder__decode_mcu(&dec)) {
RETURN_FAIL("decode_mcu failed");
}
// 4:2:0 chroma subsampling means that the MCU has 4 Y, 1 Cb and 1 Cr blocks.
uint16_t wants[10][64] = {
uint16_t wants[6][64] = {
{
0xFFC9, 0xFFD8, 0x0014, 0xFFF7, 0x0002, 0x0000, 0x0000, 0x0000, //
0x006A, 0xFFE3, 0x001C, 0xFFF9, 0x0002, 0x0000, 0x0000, 0x0000, //
@@ -719,16 +712,21 @@ test_wuffs_jpeg_decode_mcu() {
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, //
0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, 0x0000, //
},
{0}, //
{0}, //
{0}, //
{0}, //
};
for (int b = 0; b < 10; b++) {
// Decode and compare-to-golden the first MCU (Minimum Coded Unit).
dec.private_impl.f_test_only_interrupt_decode_mcu = true;
for (int b = 0; b < 6; b++) {
const uint32_t mx = 0;
const uint32_t my = 0;
if (wuffs_jpeg__decoder__decode_mcu(&dec, wuffs_base__empty_slice_u8(), mx,
my)) {
RETURN_FAIL("decode_mcu failed");
}
wuffs_base__io_buffer have = wuffs_base__ptr_u8__reader( //
(void*)(&dec.private_data.f_mcu_blocks[b]), //
sizeof(dec.private_data.f_mcu_blocks[b]), true);
(void*)(&dec.private_data.f_mcu_blocks[0]), //
sizeof(dec.private_data.f_mcu_blocks[0]), true);
wuffs_base__io_buffer want = wuffs_base__ptr_u8__reader( //
(void*)(&wants[b]), //
sizeof(wants[b]), true);