std/jpeg: tweak UNZIG comments

This commit is contained in:
Nigel Tao committed 2023-06-19 13:19:24 +10:00
1 parent 36323abf87
commit 48fa7182f4
1 file changed
+12 -6
+12 -6
View File
@@ -12,9 +12,14 @@
// See the License for the specific language governing permissions and // See the License for the specific language governing permissions and
// limitations under the License. // limitations under the License.
// UNZIG maps from the zig-zag ordering to the natural ordering. For example, // --------
// UNZIG[3] is the column and row of the fourth element in zig-zag order. The
// value is 16, which means first column (16%8 == 0) and third row (16/8 == 2). // UNZIG maps from the zig-zag ordering to the natural ordering. Its indices
// start at 1, simplifying while.ac_components loops in decode_mcu_*.wuffs
//
// For example, UNZIG[4] is the column and row of the fourth element in zig-zag
// order. The value is 16, which means first column (16%8 == 0) and third row
// (16/8 == 2).
pri const UNZIG : roarray[80] base.u8[..= 63] = [ pri const UNZIG : roarray[80] base.u8[..= 63] = [
0x00, 0x00,
// The 8x8 indexes are below. // The 8x8 indexes are below.
@@ -27,8 +32,9 @@ pri const UNZIG : roarray[80] base.u8[..= 63] = [
0x3A, 0x3B, 0x34, 0x2D, 0x26, 0x1F, 0x27, 0x2E, 0x3A, 0x3B, 0x34, 0x2D, 0x26, 0x1F, 0x27, 0x2E,
0x35, 0x3C, 0x3D, 0x36, 0x2F, 0x37, 0x3E, 0x3F, 0x35, 0x3C, 0x3D, 0x36, 0x2F, 0x37, 0x3E, 0x3F,
// The 15 extra elements are for invalid JPEGs where "the z in UNZIG[z] // The 15 extra elements are for invalid JPEGs where "the z in UNZIG[z]
// overflows 63, when saving the AC value". This isn't in the spec but // overflows 64, when saving the AC value". This isn't in the spec but
// matches how libjpeg-turbo treats "above 63". // matches how libjpeg-turbo treats "above 64" ("above 63" in the
// equivalent libjpeg-turbo code, since our UNZIG indices start at 1).
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F, 0x3F,
] ]
@@ -114,7 +120,7 @@ pri const BIAS_AND_CLAMP : roarray[1024] base.u8 = [
// //
// It was generated by this Go code (and then wuffsfmt'ed). // It was generated by this Go code (and then wuffsfmt'ed).
// //
// ---- // --------
// //
// package main // package main
// //