Fix std/png for depth-16 grayscale interlaced

This commit is contained in:
Nigel Tao committed 2021-11-20 22:54:21 +11:00
1 parent f5d6ce3797
commit f5c68a13cb
3 files changed
+16 -5

No files matched your search

+7 -2
View File
@@ -37751,8 +37751,13 @@ wuffs_png__decoder__assign_filter_distance(
self->private_impl.f_src_pixfmt = 536870920;
self->private_impl.f_filter_distance = 1;
} else if (self->private_impl.f_depth == 16) {
self->private_impl.f_dst_pixfmt = 536870923;
self->private_impl.f_src_pixfmt = 537919499;
if (self->private_impl.f_interlace_pass == 0) {
self->private_impl.f_dst_pixfmt = 536870923;
self->private_impl.f_src_pixfmt = 537919499;
} else {
self->private_impl.f_dst_pixfmt = 2164308923;
self->private_impl.f_src_pixfmt = 2164308923;
}
self->private_impl.f_filter_distance = 2;
}
} else if (self->private_impl.f_color_type == 2) {
+8 -2
View File
@@ -441,8 +441,14 @@ pri func decoder.assign_filter_distance!() {
this.src_pixfmt = base.PIXEL_FORMAT__Y
this.filter_distance = 1
} else if this.depth == 16 {
this.dst_pixfmt = base.PIXEL_FORMAT__Y_16LE
this.src_pixfmt = base.PIXEL_FORMAT__Y_16BE
if this.interlace_pass == 0 {
this.dst_pixfmt = base.PIXEL_FORMAT__Y_16LE
this.src_pixfmt = base.PIXEL_FORMAT__Y_16BE
} else {
// Interlaced means choosing filter_and_swizzle_tricky.
this.dst_pixfmt = base.PIXEL_FORMAT__BGRA_NONPREMUL_4X16LE
this.src_pixfmt = base.PIXEL_FORMAT__BGRA_NONPREMUL_4X16LE
}
this.filter_distance = 2
}
+1 -1
View File
@@ -4,7 +4,7 @@ aac44167 test/3pdata/pngsuite/PngSuite.png
8f50bdc6 test/3pdata/pngsuite/basi0g02.png
6d612626 test/3pdata/pngsuite/basi0g04.png
024cf410 test/3pdata/pngsuite/basi0g08.png
5a525ac0 test/3pdata/pngsuite/basi0g16.png
bb956205 test/3pdata/pngsuite/basi0g16.png
d1ae61d3 test/3pdata/pngsuite/basi2c08.png
84bc9be8 test/3pdata/pngsuite/basi2c16.png
49bc6b98 test/3pdata/pngsuite/basi3p01.png