Let iterate have multiple assigns

wuffs_png_decode_19k_8bpp/clang9          92.2MB/s ± 0%  93.4MB/s ± 0%   +1.33%  (p=0.008 n=5+5)
wuffs_png_decode_40k_24bpp/clang9          116MB/s ± 0%   115MB/s ± 0%     ~     (p=1.000 n=5+5)
wuffs_png_decode_77k_8bpp/clang9           347MB/s ± 0%   351MB/s ± 0%   +1.19%  (p=0.016 n=5+4)
wuffs_png_decode_552k_32bpp/clang9         150MB/s ± 0%   156MB/s ± 0%   +3.57%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/clang9        117MB/s ± 1%   118MB/s ± 0%   +0.62%  (p=0.008 n=5+5)

wuffs_png_decode_filter_1_sub/clang9      1.34GB/s ± 0%  1.24GB/s ± 0%   -7.30%  (p=0.008 n=5+5)
wuffs_png_decode_filter_2_up/clang9       13.3GB/s ± 0%  13.4GB/s ± 0%   +0.96%  (p=0.008 n=5+5)
wuffs_png_decode_filter_3_average/clang9   754MB/s ± 0%   948MB/s ± 0%  +25.62%  (p=0.008 n=5+5)
wuffs_png_decode_filter_4_paeth/clang9     127MB/s ± 0%   138MB/s ± 0%   +9.01%  (p=0.008 n=5+5)

wuffs_png_decode_19k_8bpp/gcc10            100MB/s ± 1%   100MB/s ± 0%     ~     (p=0.690 n=5+5)
wuffs_png_decode_40k_24bpp/gcc10           114MB/s ± 0%   118MB/s ± 0%   +3.21%  (p=0.008 n=5+5)
wuffs_png_decode_77k_8bpp/gcc10            323MB/s ± 2%   325MB/s ± 0%     ~     (p=0.841 n=5+5)
wuffs_png_decode_552k_32bpp/gcc10          159MB/s ± 0%   172MB/s ± 0%   +8.38%  (p=0.008 n=5+5)
wuffs_png_decode_4002k_24bpp/gcc10         118MB/s ± 0%   118MB/s ± 0%     ~     (p=0.056 n=5+5)

wuffs_png_decode_filter_1_sub/gcc10       1.84GB/s ± 1%  1.85GB/s ± 0%   +0.22%  (p=0.008 n=5+5)
wuffs_png_decode_filter_2_up/gcc10        10.5GB/s ± 0%  10.5GB/s ± 0%     ~     (p=0.310 n=5+5)
wuffs_png_decode_filter_3_average/gcc10    743MB/s ± 0%  1008MB/s ± 0%  +35.66%  (p=0.008 n=5+5)
wuffs_png_decode_filter_4_paeth/gcc10     83.1MB/s ± 0%  94.1MB/s ± 0%  +13.15%  (p=0.008 n=5+5)
This commit is contained in:
Nigel Tao committed 2021-01-07 23:40:50 +11:00
1 parent d842a20e43
commit dcdd7928c1
4 files changed
+445 -41

No files matched your search

+235 -15
View File
@@ -29879,6 +29879,12 @@ wuffs_png__decoder__filter_3__choosy_default(
wuffs_base__slice_u8 a_curr,
wuffs_base__slice_u8 a_prev);
static wuffs_base__empty_struct
wuffs_png__decoder__filter_3_distance_4_fallback(
wuffs_png__decoder* self,
wuffs_base__slice_u8 a_curr,
wuffs_base__slice_u8 a_prev);
static wuffs_base__empty_struct
wuffs_png__decoder__filter_4(
wuffs_png__decoder* self,
@@ -29891,6 +29897,12 @@ wuffs_png__decoder__filter_4__choosy_default(
wuffs_base__slice_u8 a_curr,
wuffs_base__slice_u8 a_prev);
static wuffs_base__empty_struct
wuffs_png__decoder__filter_4_distance_4_fallback(
wuffs_png__decoder* self,
wuffs_base__slice_u8 a_curr,
wuffs_base__slice_u8 a_prev);
static wuffs_base__empty_struct
wuffs_png__decoder__choose_filter_implementations(
wuffs_png__decoder* self);
@@ -30071,27 +30083,27 @@ static wuffs_base__empty_struct
wuffs_png__decoder__filter_1_distance_4_fallback(
wuffs_png__decoder* self,
wuffs_base__slice_u8 a_curr) {
wuffs_base__slice_u8 v_p = {0};
wuffs_base__slice_u8 v_c = {0};
uint8_t v_fa0 = 0;
uint8_t v_fa1 = 0;
uint8_t v_fa2 = 0;
uint8_t v_fa3 = 0;
{
wuffs_base__slice_u8 i_slice_p = a_curr;
v_p = i_slice_p;
v_p.len = 4;
uint8_t* i_end0_p = i_slice_p.ptr + (i_slice_p.len / 4) * 4;
while (v_p.ptr < i_end0_p) {
v_fa0 += v_p.ptr[0];
v_p.ptr[0] = v_fa0;
v_fa1 += v_p.ptr[1];
v_p.ptr[1] = v_fa1;
v_fa2 += v_p.ptr[2];
v_p.ptr[2] = v_fa2;
v_fa3 += v_p.ptr[3];
v_p.ptr[3] = v_fa3;
v_p.ptr += 4;
wuffs_base__slice_u8 i_slice_c = a_curr;
v_c = i_slice_c;
v_c.len = 4;
uint8_t* i_end0_c = i_slice_c.ptr + (i_slice_c.len / 4) * 4;
while (v_c.ptr < i_end0_c) {
v_fa0 += v_c.ptr[0];
v_c.ptr[0] = v_fa0;
v_fa1 += v_c.ptr[1];
v_c.ptr[1] = v_fa1;
v_fa2 += v_c.ptr[2];
v_c.ptr[2] = v_fa2;
v_fa3 += v_c.ptr[3];
v_c.ptr[3] = v_fa3;
v_c.ptr += 4;
}
}
return wuffs_base__make_empty_struct();
@@ -30166,6 +30178,65 @@ wuffs_png__decoder__filter_3__choosy_default(
return wuffs_base__make_empty_struct();
}
// -------- func png.decoder.filter_3_distance_4_fallback
static wuffs_base__empty_struct
wuffs_png__decoder__filter_3_distance_4_fallback(
wuffs_png__decoder* self,
wuffs_base__slice_u8 a_curr,
wuffs_base__slice_u8 a_prev) {
wuffs_base__slice_u8 v_c = {0};
wuffs_base__slice_u8 v_p = {0};
uint8_t v_fa0 = 0;
uint8_t v_fa1 = 0;
uint8_t v_fa2 = 0;
uint8_t v_fa3 = 0;
if (((uint64_t)(a_prev.len)) == 0) {
{
wuffs_base__slice_u8 i_slice_c = a_curr;
v_c = i_slice_c;
v_c.len = 4;
uint8_t* i_end0_c = i_slice_c.ptr + (i_slice_c.len / 4) * 4;
while (v_c.ptr < i_end0_c) {
v_fa0 = ((v_fa0 / 2) + v_c.ptr[0]);
v_c.ptr[0] = v_fa0;
v_fa1 = ((v_fa1 / 2) + v_c.ptr[1]);
v_c.ptr[1] = v_fa1;
v_fa2 = ((v_fa2 / 2) + v_c.ptr[2]);
v_c.ptr[2] = v_fa2;
v_fa3 = ((v_fa3 / 2) + v_c.ptr[3]);
v_c.ptr[3] = v_fa3;
v_c.ptr += 4;
}
}
} else {
{
wuffs_base__slice_u8 i_slice_c = a_curr;
v_c = i_slice_c;
wuffs_base__slice_u8 i_slice_p = a_prev;
v_p = i_slice_p;
i_slice_c.len = wuffs_base__u64__min(i_slice_c.len, i_slice_p.len);
v_c.len = 4;
v_p.len = 4;
uint8_t* i_end0_c = i_slice_c.ptr + (i_slice_c.len / 4) * 4;
while (v_c.ptr < i_end0_c) {
v_fa0 = (((uint8_t)(((((uint32_t)(v_fa0)) + ((uint32_t)(v_p.ptr[0]))) / 2))) + v_c.ptr[0]);
v_c.ptr[0] = v_fa0;
v_fa1 = (((uint8_t)(((((uint32_t)(v_fa1)) + ((uint32_t)(v_p.ptr[1]))) / 2))) + v_c.ptr[1]);
v_c.ptr[1] = v_fa1;
v_fa2 = (((uint8_t)(((((uint32_t)(v_fa2)) + ((uint32_t)(v_p.ptr[2]))) / 2))) + v_c.ptr[2]);
v_c.ptr[2] = v_fa2;
v_fa3 = (((uint8_t)(((((uint32_t)(v_fa3)) + ((uint32_t)(v_p.ptr[3]))) / 2))) + v_c.ptr[3]);
v_c.ptr[3] = v_fa3;
v_c.ptr += 4;
v_p.ptr += 4;
}
}
}
return wuffs_base__make_empty_struct();
}
// -------- func png.decoder.filter_4
static wuffs_base__empty_struct
@@ -30229,6 +30300,153 @@ wuffs_png__decoder__filter_4__choosy_default(
return wuffs_base__make_empty_struct();
}
// -------- func png.decoder.filter_4_distance_4_fallback
static wuffs_base__empty_struct
wuffs_png__decoder__filter_4_distance_4_fallback(
wuffs_png__decoder* self,
wuffs_base__slice_u8 a_curr,
wuffs_base__slice_u8 a_prev) {
wuffs_base__slice_u8 v_c = {0};
wuffs_base__slice_u8 v_p = {0};
uint32_t v_fa0 = 0;
uint32_t v_fa1 = 0;
uint32_t v_fa2 = 0;
uint32_t v_fa3 = 0;
uint32_t v_fb0 = 0;
uint32_t v_fb1 = 0;
uint32_t v_fb2 = 0;
uint32_t v_fb3 = 0;
uint32_t v_fc0 = 0;
uint32_t v_fc1 = 0;
uint32_t v_fc2 = 0;
uint32_t v_fc3 = 0;
uint32_t v_pp0 = 0;
uint32_t v_pp1 = 0;
uint32_t v_pp2 = 0;
uint32_t v_pp3 = 0;
uint32_t v_pa0 = 0;
uint32_t v_pa1 = 0;
uint32_t v_pa2 = 0;
uint32_t v_pa3 = 0;
uint32_t v_pb0 = 0;
uint32_t v_pb1 = 0;
uint32_t v_pb2 = 0;
uint32_t v_pb3 = 0;
uint32_t v_pc0 = 0;
uint32_t v_pc1 = 0;
uint32_t v_pc2 = 0;
uint32_t v_pc3 = 0;
{
wuffs_base__slice_u8 i_slice_c = a_curr;
v_c = i_slice_c;
wuffs_base__slice_u8 i_slice_p = a_prev;
v_p = i_slice_p;
i_slice_c.len = wuffs_base__u64__min(i_slice_c.len, i_slice_p.len);
v_c.len = 4;
v_p.len = 4;
uint8_t* i_end0_c = i_slice_c.ptr + (i_slice_c.len / 4) * 4;
while (v_c.ptr < i_end0_c) {
v_fb0 = ((uint32_t)(v_p.ptr[0]));
v_pp0 = ((v_fa0 + v_fb0) - v_fc0);
v_pa0 = (v_pp0 - v_fa0);
if (v_pa0 >= 2147483648) {
v_pa0 = (0 - v_pa0);
}
v_pb0 = (v_pp0 - v_fb0);
if (v_pb0 >= 2147483648) {
v_pb0 = (0 - v_pb0);
}
v_pc0 = (v_pp0 - v_fc0);
if (v_pc0 >= 2147483648) {
v_pc0 = (0 - v_pc0);
}
if ((v_pa0 <= v_pb0) && (v_pa0 <= v_pc0)) {
} else if (v_pb0 <= v_pc0) {
v_fa0 = v_fb0;
} else {
v_fa0 = v_fc0;
}
v_c.ptr[0] += ((uint8_t)((v_fa0 & 255)));
v_fa0 = ((uint32_t)(v_c.ptr[0]));
v_fc0 = v_fb0;
v_fb1 = ((uint32_t)(v_p.ptr[1]));
v_pp1 = ((v_fa1 + v_fb1) - v_fc1);
v_pa1 = (v_pp1 - v_fa1);
if (v_pa1 >= 2147483648) {
v_pa1 = (0 - v_pa1);
}
v_pb1 = (v_pp1 - v_fb1);
if (v_pb1 >= 2147483648) {
v_pb1 = (0 - v_pb1);
}
v_pc1 = (v_pp1 - v_fc1);
if (v_pc1 >= 2147483648) {
v_pc1 = (0 - v_pc1);
}
if ((v_pa1 <= v_pb1) && (v_pa1 <= v_pc1)) {
} else if (v_pb1 <= v_pc1) {
v_fa1 = v_fb1;
} else {
v_fa1 = v_fc1;
}
v_c.ptr[1] += ((uint8_t)((v_fa1 & 255)));
v_fa1 = ((uint32_t)(v_c.ptr[1]));
v_fc1 = v_fb1;
v_fb2 = ((uint32_t)(v_p.ptr[2]));
v_pp2 = ((v_fa2 + v_fb2) - v_fc2);
v_pa2 = (v_pp2 - v_fa2);
if (v_pa2 >= 2147483648) {
v_pa2 = (0 - v_pa2);
}
v_pb2 = (v_pp2 - v_fb2);
if (v_pb2 >= 2147483648) {
v_pb2 = (0 - v_pb2);
}
v_pc2 = (v_pp2 - v_fc2);
if (v_pc2 >= 2147483648) {
v_pc2 = (0 - v_pc2);
}
if ((v_pa2 <= v_pb2) && (v_pa2 <= v_pc2)) {
} else if (v_pb2 <= v_pc2) {
v_fa2 = v_fb2;
} else {
v_fa2 = v_fc2;
}
v_c.ptr[2] += ((uint8_t)((v_fa2 & 255)));
v_fa2 = ((uint32_t)(v_c.ptr[2]));
v_fc2 = v_fb2;
v_fb3 = ((uint32_t)(v_p.ptr[3]));
v_pp3 = ((v_fa3 + v_fb3) - v_fc3);
v_pa3 = (v_pp3 - v_fa3);
if (v_pa3 >= 2147483648) {
v_pa3 = (0 - v_pa3);
}
v_pb3 = (v_pp3 - v_fb3);
if (v_pb3 >= 2147483648) {
v_pb3 = (0 - v_pb3);
}
v_pc3 = (v_pp3 - v_fc3);
if (v_pc3 >= 2147483648) {
v_pc3 = (0 - v_pc3);
}
if ((v_pa3 <= v_pb3) && (v_pa3 <= v_pc3)) {
} else if (v_pb3 <= v_pc3) {
v_fa3 = v_fb3;
} else {
v_fa3 = v_fc3;
}
v_c.ptr[3] += ((uint8_t)((v_fa3 & 255)));
v_fa3 = ((uint32_t)(v_c.ptr[3]));
v_fc3 = v_fb3;
v_c.ptr += 4;
v_p.ptr += 4;
}
}
return wuffs_base__make_empty_struct();
}
// -------- func png.decoder.set_quirk_enabled
WUFFS_BASE__MAYBE_STATIC wuffs_base__empty_struct
@@ -30714,6 +30932,8 @@ wuffs_png__decoder__choose_filter_implementations(
if (self->private_impl.f_filter_distance == 3) {
} else if (self->private_impl.f_filter_distance == 4) {
self->private_impl.choosy_filter_1 = &wuffs_png__decoder__filter_1_distance_4_fallback;
self->private_impl.choosy_filter_3 = &wuffs_png__decoder__filter_3_distance_4_fallback;
self->private_impl.choosy_filter_4 = &wuffs_png__decoder__filter_4_distance_4_fallback;
}
return wuffs_base__make_empty_struct();
}