diff --git a/tests/fate/gif.mak b/tests/fate/gif.mak
index 9bd9631..16d4286 100644
--- a/tests/fate/gif.mak
+++ b/tests/fate/gif.mak
@@ -16,7 +16,7 @@ fate-gif-deal: CMD = framecrc -i $(TARGET_SAMPLES)/gif/deal.gif -vsync cfr -pix_
 fate-gifenc%: fate-gif-color
 fate-gifenc%: PIXFMT = $(word 3, $(subst -, ,$(@)))
 fate-gifenc%: SRC = $(TARGET_SAMPLES)/gif/tc217.gif
-fate-gifenc%: CMD = framecrc -i $(SRC) -c:v gif -pix_fmt $(PIXFMT)
+fate-gifenc%: CMD = framecrc -i $(SRC) -c:v gif -pix_fmt $(PIXFMT) -sws_flags +accurate_rnd+bitexact
 
 FATE_GIF_ENC_PIXFMT = rgb8 bgr8 rgb4_byte bgr4_byte gray pal8
 FATE_GIF_ENC-$(call ENCDEC, GIF, GIF) = $(FATE_GIF_ENC_PIXFMT:%=fate-gifenc-%)
diff --git a/tests/ref/fate/gifenc-bgr4_byte b/tests/ref/fate/gifenc-bgr4_byte
index 2cf3b7f..2ec314e 100644
--- a/tests/ref/fate/gifenc-bgr4_byte
+++ b/tests/ref/fate/gifenc-bgr4_byte
@@ -4,175 +4,175 @@
 #dimensions 0: 217x217
 #sar 0: 0/1
 0,          0,          0,        1,     1297, 0x53e8b1c1
-0,          1,          1,        1,      221, 0x52d24d05, F=0x0
-0,          2,          2,        1,      139, 0xc9e32ab4, F=0x0
-0,          3,          3,        1,      392, 0x9244a858, F=0x0
-0,          4,          4,        1,      389, 0xc5bea3e0, F=0x0
-0,          5,          5,        1,      438, 0xfa2ab3d6, F=0x0
-0,          6,          6,        1,      526, 0x281ed94f, F=0x0
-0,          7,          7,        1,      543, 0xa53ee752, F=0x0
-0,          8,          8,        1,      446, 0x41d0b8ee, F=0x0
-0,          9,          9,        1,      931, 0xe8efa4aa, F=0x0
-0,         10,         10,        1,      702, 0x2d1c4ad3, F=0x0
-0,         11,         11,        1,     1202, 0xf0cc2be3, F=0x0
-0,         12,         12,        1,     1299, 0x189f54cb, F=0x0
-0,         13,         13,        1,     1253, 0xcb883414, F=0x0
-0,         14,         14,        1,     1338, 0xad6a52d2, F=0x0
-0,         15,         15,        1,     1284, 0x14993a0a, F=0x0
-0,         16,         16,        1,     1483, 0x216c991d, F=0x0
-0,         17,         17,        1,     1792, 0x58eb4c1e, F=0x0
-0,         18,         18,        1,     1683, 0x0b49fbbe, F=0x0
-0,         19,         19,        1,     1517, 0x9b57ab38, F=0x0
-0,         20,         20,        1,     1713, 0x23f21b0d, F=0x0
-0,         21,         21,        1,     1753, 0xe1e21eec, F=0x0
-0,         22,         22,        1,     1650, 0xf258037d, F=0x0
-0,         23,         23,        1,     1726, 0x73111ff6, F=0x0
-0,         24,         24,        1,     1908, 0x430b7b09, F=0x0
-0,         25,         25,        1,     1815, 0xa5af5368, F=0x0
-0,         26,         26,        1,     1923, 0x497f847c, F=0x0
-0,         27,         27,        1,     2108, 0x5e2ed19b, F=0x0
-0,         28,         28,        1,     2708, 0x6064f1c3, F=0x0
-0,         29,         29,        1,     2681, 0x7c4ea945, F=0x0
-0,         30,         30,        1,     2903, 0x7cbf4985, F=0x0
-0,         31,         31,        1,     3265, 0x81f7d05c, F=0x0
-0,         32,         32,        1,     3187, 0x6077c273, F=0x0
-0,         33,         33,        1,     3304, 0x3632e867, F=0x0
-0,         34,         34,        1,     3608, 0x7961776c, F=0x0
-0,         35,         35,        1,     3707, 0x515aa11b, F=0x0
-0,         36,         36,        1,     3822, 0x4a03d52c, F=0x0
-0,         37,         37,        1,     3635, 0x67607edf, F=0x0
-0,         38,         38,        1,     2958, 0x18e8618d, F=0x0
-0,         39,         39,        1,     3094, 0x1f1990fa, F=0x0
-0,         40,         40,        1,     3102, 0xde16868b, F=0x0
-0,         41,         41,        1,     3464, 0x7e6f2dba, F=0x0
-0,         42,         42,        1,     4116, 0x91585d9e, F=0x0
-0,         43,         43,        1,     4225, 0x9c785cdc, F=0x0
-0,         44,         44,        1,     3621, 0x0d0a4ebb, F=0x0
-0,         45,         45,        1,     3918, 0xa70ae7ca, F=0x0
-0,         46,         46,        1,     4469, 0xa318e475, F=0x0
-0,         47,         47,        1,     4601, 0x1ae12f09, F=0x0
-0,         48,         48,        1,     4830, 0x57b999bb, F=0x0
-0,         49,         49,        1,     5406, 0x744cc456, F=0x0
-0,         50,         50,        1,     5274, 0x3d6996e2, F=0x0
-0,         51,         51,        1,     5424, 0xc587e525, F=0x0
-0,         52,         52,        1,     5527, 0xd5870857, F=0x0
-0,         53,         53,        1,     5709, 0xbd715dd4, F=0x0
-0,         54,         54,        1,     6168, 0xa5c13fbb, F=0x0
-0,         55,         55,        1,     6241, 0x46485256, F=0x0
-0,         56,         56,        1,     5919, 0xc0bcc64e, F=0x0
-0,         57,         57,        1,     6005, 0x5443fb4d, F=0x0
-0,         58,         58,        1,     5954, 0xe7efef37, F=0x0
-0,         59,         59,        1,     6476, 0x1aadccc4, F=0x0
-0,         60,         60,        1,     6745, 0x6af23ae4, F=0x0
-0,         61,         61,        1,     6283, 0x07049084, F=0x0
-0,         62,         62,        1,     6649, 0x2c1f3be5, F=0x0
-0,         63,         63,        1,     6386, 0xb9848778, F=0x0
-0,         64,         64,        1,     6265, 0xce725997, F=0x0
-0,         65,         65,        1,     6916, 0xdfac7154, F=0x0
-0,         66,         66,        1,     7238, 0x2ace2606, F=0x0
-0,         67,         67,        1,     7564, 0x8cf9a84a, F=0x0
-0,         68,         68,        1,     7421, 0xaa1a71dc, F=0x0
-0,         69,         69,        1,     7484, 0xc67ba899, F=0x0
-0,         70,         70,        1,     7604, 0x2479e569, F=0x0
-0,         71,         71,        1,     7764, 0x0a1906f8, F=0x0
-0,         72,         72,        1,     8023, 0x27206bb7, F=0x0
-0,         73,         73,        1,     8136, 0x7705bf63, F=0x0
-0,         74,         74,        1,     8109, 0xe05cb4da, F=0x0
-0,         75,         75,        1,     7871, 0xce733f35, F=0x0
-0,         76,         76,        1,     7968, 0x27ef92ba, F=0x0
-0,         77,         77,        1,     8246, 0x5fe7ee2b, F=0x0
-0,         78,         78,        1,     8329, 0x809e4b94, F=0x0
-0,         79,         79,        1,     8570, 0x179fc163, F=0x0
-0,         80,         80,        1,     8754, 0xdb870edf, F=0x0
-0,         81,         81,        1,     8586, 0x280ca5f9, F=0x0
-0,         82,         82,        1,     8886, 0x445e5b51, F=0x0
-0,         83,         83,        1,     9085, 0xba37592e, F=0x0
-0,         84,         84,        1,     9318, 0xe970f8b2, F=0x0
-0,         85,         85,        1,     9402, 0x37ee4456, F=0x0
-0,         86,         86,        1,     9169, 0x171196bf, F=0x0
-0,         87,         87,        1,     9470, 0x793837fb, F=0x0
-0,         88,         88,        1,     9658, 0x489294a6, F=0x0
-0,         89,         89,        1,     9709, 0x980c9d78, F=0x0
-0,         90,         90,        1,     9531, 0xc7a83dbb, F=0x0
-0,         91,         91,        1,     9899, 0x658f0fcb, F=0x0
-0,         92,         92,        1,    10013, 0x434c4b1f, F=0x0
-0,         93,         93,        1,    10046, 0x3cdf2e5d, F=0x0
-0,         94,         94,        1,    10094, 0xfeb546c5, F=0x0
-0,         95,         95,        1,    10446, 0xf0d10017, F=0x0
-0,         96,         96,        1,    10591, 0xf90f55af, F=0x0
-0,         97,         97,        1,    10589, 0xd4948126, F=0x0
-0,         98,         98,        1,    10815, 0x5cb2d81b, F=0x0
-0,         99,         99,        1,    11119, 0x25ca4d4b, F=0x0
-0,        100,        100,        1,    11202, 0xae566cab, F=0x0
-0,        101,        101,        1,    11248, 0x5731a277, F=0x0
-0,        102,        102,        1,    11491, 0x1021f4fd, F=0x0
-0,        103,        103,        1,    11688, 0x6cb05cf9, F=0x0
-0,        104,        104,        1,    11793, 0xf036b8cb, F=0x0
-0,        105,        105,        1,    11444, 0x46d90941, F=0x0
-0,        106,        106,        1,    11936, 0x204acadf, F=0x0
-0,        107,        107,        1,    11940, 0x4bddbdf6, F=0x0
-0,        108,        108,        1,    12289, 0x902d708b, F=0x0
-0,        109,        109,        1,    12342, 0xc85680b0, F=0x0
-0,        110,        110,        1,    12460, 0xf3beb2c0, F=0x0
-0,        111,        111,        1,    12703, 0x96493c66, F=0x0
-0,        112,        112,        1,    12676, 0xdc9250b1, F=0x0
-0,        113,        113,        1,    12965, 0x08dba0c4, F=0x0
-0,        114,        114,        1,    13062, 0xac2ce092, F=0x0
-0,        115,        115,        1,    13155, 0xb6552cf5, F=0x0
-0,        116,        116,        1,    13179, 0x03d61a97, F=0x0
-0,        117,        117,        1,    13206, 0x0d8a5a0c, F=0x0
-0,        118,        118,        1,    13219, 0x039862cb, F=0x0
-0,        119,        119,        1,    13218, 0xede6623f, F=0x0
-0,        120,        120,        1,    13475, 0x7672a260, F=0x0
-0,        121,        121,        1,    13673, 0xaf0ddf16, F=0x0
-0,        122,        122,        1,    13700, 0x1ec9ed11, F=0x0
-0,        123,        123,        1,    13829, 0xc6cb2f9a, F=0x0
-0,        124,        124,        1,    13954, 0x3f89936d, F=0x0
-0,        125,        125,        1,    14071, 0x72d2d42d, F=0x0
-0,        126,        126,        1,    14132, 0x6c34cbf9, F=0x0
-0,        127,        127,        1,    14339, 0x4c695263, F=0x0
-0,        128,        128,        1,    14477, 0xfbcda593, F=0x0
-0,        129,        129,        1,    14544, 0xb3d3a37a, F=0x0
-0,        130,        130,        1,    14616, 0xb704d286, F=0x0
-0,        131,        131,        1,    14906, 0xca9226c6, F=0x0
-0,        132,        132,        1,    14986, 0x54e8a122, F=0x0
-0,        133,        133,        1,    15150, 0x40bed744, F=0x0
-0,        134,        134,        1,    15137, 0x6c4ebc1f, F=0x0
-0,        135,        135,        1,    15251, 0xca081273, F=0x0
-0,        136,        136,        1,    15345, 0x4d266373, F=0x0
-0,        137,        137,        1,    15646, 0x3f64a238, F=0x0
-0,        138,        138,        1,    15920, 0xe12020ea, F=0x0
-0,        139,        139,        1,    16049, 0x6bbb437e, F=0x0
-0,        140,        140,        1,    16236, 0x31a6016d, F=0x0
-0,        141,        141,        1,    16270, 0x40f1eb89, F=0x0
-0,        142,        142,        1,    16379, 0xe4d0092a, F=0x0
-0,        143,        143,        1,    16669, 0x6f22a6ca, F=0x0
-0,        144,        144,        1,    16925, 0x564a191d, F=0x0
-0,        145,        145,        1,    17157, 0xf1c7cb79, F=0x0
-0,        146,        146,        1,    17180, 0xc4b3b5d7, F=0x0
-0,        147,        147,        1,    17323, 0xa670a9d8, F=0x0
-0,        148,        148,        1,    17405, 0xf499125a, F=0x0
-0,        149,        149,        1,    17439, 0xd76af40b, F=0x0
-0,        150,        150,        1,    17584, 0x364d53e5, F=0x0
-0,        151,        151,        1,    17772, 0xbc218e98, F=0x0
-0,        152,        152,        1,    17834, 0xcc19808f, F=0x0
-0,        153,        153,        1,    17926, 0x12639cd7, F=0x0
-0,        154,        154,        1,    17831, 0xb0f9c051, F=0x0
-0,        155,        155,        1,    18150, 0x574022e1, F=0x0
-0,        156,        156,        1,    18265, 0x73458364, F=0x0
-0,        157,        157,        1,    18345, 0x2d31c3b1, F=0x0
-0,        158,        158,        1,    18301, 0x9028389e, F=0x0
-0,        159,        159,        1,    18426, 0xe701be30, F=0x0
-0,        160,        160,        1,    18615, 0x1bfd4868, F=0x0
-0,        161,        161,        1,    18924, 0xa269bcfe, F=0x0
-0,        162,        162,        1,    19081, 0xb2f5052e, F=0x0
-0,        163,        163,        1,    19176, 0x0676ff5f, F=0x0
-0,        164,        164,        1,    19218, 0xfbb40323, F=0x0
-0,        165,        165,        1,    19406, 0x714664fe, F=0x0
-0,        166,        166,        1,    19488, 0x1acf9f93, F=0x0
-0,        167,        167,        1,    19667, 0x50bd11c0, F=0x0
-0,        168,        168,        1,    19680, 0xe322168b, F=0x0
-0,        169,        169,        1,    19944, 0x25b763c2, F=0x0
-0,        170,        170,        1,    19983, 0xfd109bea, F=0x0
-0,        171,        171,        1,    20029, 0x565d8efd, F=0x0
-0,        172,        172,        1,    20068, 0xadee793f, F=0x0
+0,          1,          1,        1,      158, 0xe1873465, F=0x0
+0,          2,          2,        1,      143, 0x56992b17, F=0x0
+0,          3,          3,        1,      169, 0x4f0434c7, F=0x0
+0,          4,          4,        1,      254, 0xb4845bf3, F=0x0
+0,          5,          5,        1,      221, 0xa02a4ae2, F=0x0
+0,          6,          6,        1,      176, 0xdcfc3a8b, F=0x0
+0,          7,          7,        1,      189, 0xb45f3f8d, F=0x0
+0,          8,          8,        1,      139, 0xf2622fc0, F=0x0
+0,          9,          9,        1,      160, 0xf77b327d, F=0x0
+0,         10,         10,        1,      149, 0x56b62de9, F=0x0
+0,         11,         11,        1,      190, 0x1eca3f72, F=0x0
+0,         12,         12,        1,      308, 0xfc7373fc, F=0x0
+0,         13,         13,        1,      193, 0x94304232, F=0x0
+0,         14,         14,        1,      191, 0x82e84504, F=0x0
+0,         15,         15,        1,      198, 0xd31944a2, F=0x0
+0,         16,         16,        1,      417, 0x9547ac22, F=0x0
+0,         17,         17,        1,      163, 0xb55537d0, F=0x0
+0,         18,         18,        1,      383, 0x634f9f88, F=0x0
+0,         19,         19,        1,      193, 0xf6d24046, F=0x0
+0,         20,         20,        1,      337, 0x45d6916f, F=0x0
+0,         21,         21,        1,      199, 0xabb34a72, F=0x0
+0,         22,         22,        1,      308, 0x097f7e58, F=0x0
+0,         23,         23,        1,      186, 0x369b41cc, F=0x0
+0,         24,         24,        1,      199, 0xa93c4113, F=0x0
+0,         25,         25,        1,      163, 0x16823904, F=0x0
+0,         26,         26,        1,      302, 0xaf1d78da, F=0x0
+0,         27,         27,        1,      189, 0x3f7a3bde, F=0x0
+0,         28,         28,        1,      157, 0x45e23500, F=0x0
+0,         29,         29,        1,      205, 0x797b4510, F=0x0
+0,         30,         30,        1,      160, 0x20e533d1, F=0x0
+0,         31,         31,        1,      202, 0xd3b748b3, F=0x0
+0,         32,         32,        1,      160, 0x207c371f, F=0x0
+0,         33,         33,        1,      215, 0x079951b6, F=0x0
+0,         34,         34,        1,      422, 0xbb9db080, F=0x0
+0,         35,         35,        1,      184, 0x3a044098, F=0x0
+0,         36,         36,        1,      289, 0xf2757206, F=0x0
+0,         37,         37,        1,      190, 0xc3264203, F=0x0
+0,         38,         38,        1,      195, 0x28544262, F=0x0
+0,         39,         39,        1,      199, 0x32db4bba, F=0x0
+0,         40,         40,        1,      448, 0x64a8bfe8, F=0x0
+0,         41,         41,        1,      170, 0x62a536d7, F=0x0
+0,         42,         42,        1,      279, 0xe1df6ff6, F=0x0
+0,         43,         43,        1,      180, 0x762f3aac, F=0x0
+0,         44,         44,        1,      303, 0x73727c79, F=0x0
+0,         45,         45,        1,      209, 0xf4a8515c, F=0x0
+0,         46,         46,        1,      198, 0xe09f451e, F=0x0
+0,         47,         47,        1,      194, 0x301e4b04, F=0x0
+0,         48,         48,        1,      186, 0x7c66421b, F=0x0
+0,         49,         49,        1,     1200, 0xe55e34e7, F=0x0
+0,         50,         50,        1,      204, 0x25534779, F=0x0
+0,         51,         51,        1,     1066, 0x9792efa8, F=0x0
+0,         52,         52,        1,      187, 0xd82e41f0, F=0x0
+0,         53,         53,        1,      323, 0x0f9d8485, F=0x0
+0,         54,         54,        1,      205, 0x86ef4c75, F=0x0
+0,         55,         55,        1,      213, 0x6e515113, F=0x0
+0,         56,         56,        1,      208, 0x1ac84bed, F=0x0
+0,         57,         57,        1,      737, 0x68a047be, F=0x0
+0,         58,         58,        1,      181, 0x84353a71, F=0x0
+0,         59,         59,        1,      614, 0x3c9a142a, F=0x0
+0,         60,         60,        1,      215, 0xacaf535d, F=0x0
+0,         61,         61,        1,      291, 0x4dab7020, F=0x0
+0,         62,         62,        1,      208, 0x3dd84d1f, F=0x0
+0,         63,         63,        1,      208, 0x8ccb45cc, F=0x0
+0,         64,         64,        1,      203, 0xa905456b, F=0x0
+0,         65,         65,        1,      531, 0x6b32eaf4, F=0x0
+0,         66,         66,        1,      178, 0xd30b3bff, F=0x0
+0,         67,         67,        1,      446, 0x881abe2a, F=0x0
+0,         68,         68,        1,      188, 0xb5a43e6b, F=0x0
+0,         69,         69,        1,      177, 0x9255436c, F=0x0
+0,         70,         70,        1,      112, 0x2990213a, F=0x0
+0,         71,         71,        1,      296, 0x7d6e7183, F=0x0
+0,         72,         72,        1,      153, 0x35053313, F=0x0
+0,         73,         73,        1,      218, 0xcf105015, F=0x0
+0,         74,         74,        1,      202, 0xb4634837, F=0x0
+0,         75,         75,        1,      239, 0x0a4b5b7b, F=0x0
+0,         76,         76,        1,      139, 0x18d92e35, F=0x0
+0,         77,         77,        1,      467, 0x784dc79e, F=0x0
+0,         78,         78,        1,      274, 0x1e9b78ef, F=0x0
+0,         79,         79,        1,      404, 0xb5c6ab9b, F=0x0
+0,         80,         80,        1,      257, 0x7aaa66ce, F=0x0
+0,         81,         81,        1,      419, 0xcb62b6cb, F=0x0
+0,         82,         82,        1,      208, 0xcbba506d, F=0x0
+0,         83,         83,        1,      294, 0x031a76f9, F=0x0
+0,         84,         84,        1,      191, 0x5ba83f77, F=0x0
+0,         85,         85,        1,      181, 0xfc454323, F=0x0
+0,         86,         86,        1,      218, 0xcd7e540e, F=0x0
+0,         87,         87,        1,      423, 0xdcebc01f, F=0x0
+0,         88,         88,        1,      202, 0x160a4ab6, F=0x0
+0,         89,         89,        1,      317, 0xff2b8104, F=0x0
+0,         90,         90,        1,      172, 0x68753e2d, F=0x0
+0,         91,         91,        1,      275, 0x7f766cd1, F=0x0
+0,         92,         92,        1,      214, 0xf37e5043, F=0x0
+0,         93,         93,        1,      182, 0x5e5544f6, F=0x0
+0,         94,         94,        1,      151, 0xf74532b7, F=0x0
+0,         95,         95,        1,      157, 0xe99b33b0, F=0x0
+0,         96,         96,        1,      202, 0x77994327, F=0x0
+0,         97,         97,        1,      162, 0x93f235fc, F=0x0
+0,         98,         98,        1,      186, 0xc25d3f3f, F=0x0
+0,         99,         99,        1,      318, 0xdf547809, F=0x0
+0,        100,        100,        1,      225, 0xf8074f18, F=0x0
+0,        101,        101,        1,      207, 0x12204757, F=0x0
+0,        102,        102,        1,      212, 0xd2ec4c59, F=0x0
+0,        103,        103,        1,      153, 0x0e1c33cd, F=0x0
+0,        104,        104,        1,      196, 0x45d4455d, F=0x0
+0,        105,        105,        1,      146, 0x5dba32b0, F=0x0
+0,        106,        106,        1,      194, 0x13a8490b, F=0x0
+0,        107,        107,        1,      304, 0xcf73832f, F=0x0
+0,        108,        108,        1,      194, 0x68fd43c9, F=0x0
+0,        109,        109,        1,      190, 0xdbc64442, F=0x0
+0,        110,        110,        1,      204, 0x8eb94b27, F=0x0
+0,        111,        111,        1,      136, 0xd0162d03, F=0x0
+0,        112,        112,        1,      171, 0xbb8b3d15, F=0x0
+0,        113,        113,        1,      140, 0x4cb930a9, F=0x0
+0,        114,        114,        1,      158, 0xdebb32d2, F=0x0
+0,        115,        115,        1,       94, 0x16a71c65, F=0x0
+0,        116,        116,        1,      110, 0x358d20bf, F=0x0
+0,        117,        117,        1,      256, 0x49a469b7, F=0x0
+0,        118,        118,        1,      220, 0x08b95486, F=0x0
+0,        119,        119,        1,      221, 0xe0af4f92, F=0x0
+0,        120,        120,        1,      205, 0x7ac444a5, F=0x0
+0,        121,        121,        1,      169, 0x62c039d3, F=0x0
+0,        122,        122,        1,      970, 0xc8f6c8a6, F=0x0
+0,        123,        123,        1,      181, 0x0d9c42ba, F=0x0
+0,        124,        124,        1,      955, 0xdf5dba5e, F=0x0
+0,        125,        125,        1,      158, 0xa01833fd, F=0x0
+0,        126,        126,        1,      344, 0xd17989f3, F=0x0
+0,        127,        127,        1,      627, 0x8c611977, F=0x0
+0,        128,        128,        1,      172, 0x7cf83c63, F=0x0
+0,        129,        129,        1,      494, 0xadccdc2b, F=0x0
+0,        130,        130,        1,      184, 0x4e784407, F=0x0
+0,        131,        131,        1,      352, 0x852f992b, F=0x0
+0,        132,        132,        1,      351, 0x99e78bb8, F=0x0
+0,        133,        133,        1,      170, 0x9f4b3869, F=0x0
+0,        134,        134,        1,      275, 0x29b96b3c, F=0x0
+0,        135,        135,        1,      168, 0x98d0399b, F=0x0
+0,        136,        136,        1,      169, 0x015039aa, F=0x0
+0,        137,        137,        1,      521, 0x3c33db57, F=0x0
+0,        138,        138,        1,     1262, 0x9cf44321, F=0x0
+0,        139,        139,        1,      994, 0x5ea8bcd4, F=0x0
+0,        140,        140,        1,      290, 0xf24f72b0, F=0x0
+0,        141,        141,        1,      188, 0x36cb408f, F=0x0
+0,        142,        142,        1,      164, 0x6c813b02, F=0x0
+0,        143,        143,        1,      212, 0x1dfb463e, F=0x0
+0,        144,        144,        1,      870, 0xd89e94ed, F=0x0
+0,        145,        145,        1,      635, 0x87bf1ae2, F=0x0
+0,        146,        146,        1,      290, 0x34ff78fe, F=0x0
+0,        147,        147,        1,      211, 0x9f755207, F=0x0
+0,        148,        148,        1,      177, 0x3f003c44, F=0x0
+0,        149,        149,        1,      182, 0xe8c23eea, F=0x0
+0,        150,        150,        1,      588, 0xb4b9fc5d, F=0x0
+0,        151,        151,        1,      163, 0x3078356b, F=0x0
+0,        152,        152,        1,      407, 0x4161b245, F=0x0
+0,        153,        153,        1,      204, 0xe2a64478, F=0x0
+0,        154,        154,        1,      290, 0x5cc079af, F=0x0
+0,        155,        155,        1,      308, 0xf5958253, F=0x0
+0,        156,        156,        1,      196, 0xb1cb46f0, F=0x0
+0,        157,        157,        1,      181, 0x0aee4103, F=0x0
+0,        158,        158,        1,      203, 0x36784ee0, F=0x0
+0,        159,        159,        1,      227, 0x23fd5b71, F=0x0
+0,        160,        160,        1,      524, 0x18a6e404, F=0x0
+0,        161,        161,        1,      377, 0x1f5697de, F=0x0
+0,        162,        162,        1,      196, 0x72304538, F=0x0
+0,        163,        163,        1,      250, 0xb8e46580, F=0x0
+0,        164,        164,        1,      214, 0xe9df51b6, F=0x0
+0,        165,        165,        1,      323, 0xacbb9067, F=0x0
+0,        166,        166,        1,      176, 0xa12a410c, F=0x0
+0,        167,        167,        1,      305, 0x21227d7a, F=0x0
+0,        168,        168,        1,      179, 0x3dac422b, F=0x0
+0,        169,        169,        1,      245, 0x948963cd, F=0x0
+0,        170,        170,        1,      181, 0x407140fb, F=0x0
+0,        171,        171,        1,      241, 0xd2a35a7a, F=0x0
+0,        172,        172,        1,      172, 0x9fa83e96, F=0x0
diff --git a/tests/ref/fate/gifenc-bgr8 b/tests/ref/fate/gifenc-bgr8
index 58767a6..d4a42b0 100644
--- a/tests/ref/fate/gifenc-bgr8
+++ b/tests/ref/fate/gifenc-bgr8
@@ -4,175 +4,175 @@
 #dimensions 0: 217x217
 #sar 0: 0/1
 0,          0,          0,        1,     1341, 0xe4e2af18
-0,          1,          1,        1,      305, 0xefa98bbd, F=0x0
-0,          2,          2,        1,      446, 0x9499cf43, F=0x0
-0,          3,          3,        1,      458, 0x8cb7d0d5, F=0x0
-0,          4,          4,        1,      555, 0x41f2fe63, F=0x0
-0,          5,          5,        1,      622, 0x3651212e, F=0x0
-0,          6,          6,        1,      650, 0x67542087, F=0x0
-0,          7,          7,        1,      668, 0x392934ca, F=0x0
-0,          8,          8,        1,      829, 0x6cd07a33, F=0x0
-0,          9,          9,        1,     1165, 0xb64b2ec9, F=0x0
-0,         10,         10,        1,      187, 0x114a52a4, F=0x0
-0,         11,         11,        1,     1341, 0x6ca57064, F=0x0
-0,         12,         12,        1,     1646, 0xcdd90fae, F=0x0
-0,         13,         13,        1,     1539, 0xbf75e55f, F=0x0
-0,         14,         14,        1,     1728, 0x96b14714, F=0x0
-0,         15,         15,        1,     1918, 0xffd08446, F=0x0
-0,         16,         16,        1,     2132, 0x3d5ae258, F=0x0
-0,         17,         17,        1,     2256, 0x359526d9, F=0x0
-0,         18,         18,        1,     2319, 0x553c382b, F=0x0
-0,         19,         19,        1,     2416, 0x7ac37066, F=0x0
-0,         20,         20,        1,     2609, 0x552bc27f, F=0x0
-0,         21,         21,        1,     2695, 0xbb0c020e, F=0x0
-0,         22,         22,        1,     2792, 0x46670f7d, F=0x0
-0,         23,         23,        1,     2892, 0x5674481e, F=0x0
-0,         24,         24,        1,     2990, 0x015a7bfd, F=0x0
-0,         25,         25,        1,     3109, 0xc73e9d14, F=0x0
-0,         26,         26,        1,     3261, 0x8a77f522, F=0x0
-0,         27,         27,        1,     3337, 0xf6f92558, F=0x0
-0,         28,         28,        1,     3580, 0x23408bc8, F=0x0
-0,         29,         29,        1,     3815, 0x781dfb1b, F=0x0
-0,         30,         30,        1,     2758, 0xf5cd1d5b, F=0x0
-0,         31,         31,        1,     4039, 0x7909712e, F=0x0
-0,         32,         32,        1,     3033, 0x39089d44, F=0x0
-0,         33,         33,        1,     4303, 0x667b0c60, F=0x0
-0,         34,         34,        1,     2052, 0x9edfba63, F=0x0
-0,         35,         35,        1,     3220, 0x5a56f015, F=0x0
-0,         36,         36,        1,     2300, 0x1719645c, F=0x0
-0,         37,         37,        1,     3641, 0x71c49a57, F=0x0
-0,         38,         38,        1,     3560, 0x377575b8, F=0x0
-0,         39,         39,        1,     3698, 0x165adce0, F=0x0
-0,         40,         40,        1,     1567, 0x6ecbf672, F=0x0
-0,         41,         41,        1,      962, 0x21eccba1, F=0x0
-0,         42,         42,        1,      281, 0x7a5a7ac3, F=0x0
-0,         43,         43,        1,      938, 0x659bb1ec, F=0x0
-0,         44,         44,        1,      279, 0x71e181bc, F=0x0
-0,         45,         45,        1,      204, 0xe0765316, F=0x0
-0,         46,         46,        1,     4307, 0xdbdd0e7d, F=0x0
-0,         47,         47,        1,     4903, 0xd8d24194, F=0x0
-0,         48,         48,        1,     4936, 0x6e9f1aff, F=0x0
-0,         49,         49,        1,     4949, 0xb3115902, F=0x0
-0,         50,         50,        1,     4162, 0xee2cad5b, F=0x0
-0,         51,         51,        1,     4686, 0xd583c178, F=0x0
-0,         52,         52,        1,     4749, 0x8c93b6a9, F=0x0
-0,         53,         53,        1,     4990, 0x12f957fd, F=0x0
-0,         54,         54,        1,     5187, 0xf3bcc7c9, F=0x0
-0,         55,         55,        1,     5054, 0xa27684fb, F=0x0
-0,         56,         56,        1,     5148, 0xe76cbad7, F=0x0
-0,         57,         57,        1,     4309, 0x79f7f067, F=0x0
-0,         58,         58,        1,     5087, 0xa2e29f29, F=0x0
-0,         59,         59,        1,     5292, 0xd158e4db, F=0x0
-0,         60,         60,        1,     5434, 0xe0be16f5, F=0x0
-0,         61,         61,        1,     4653, 0x0a3d8a5e, F=0x0
-0,         62,         62,        1,     5271, 0x4412d0a5, F=0x0
-0,         63,         63,        1,     5229, 0x3e06c4f2, F=0x0
-0,         64,         64,        1,     5225, 0x9bc39cfa, F=0x0
-0,         65,         65,        1,     5403, 0x798b009d, F=0x0
-0,         66,         66,        1,     5228, 0x14f2dded, F=0x0
-0,         67,         67,        1,     5712, 0x8724debe, F=0x0
-0,         68,         68,        1,     5644, 0x49d3a383, F=0x0
-0,         69,         69,        1,     5826, 0xde72e0ba, F=0x0
-0,         70,         70,        1,     5771, 0x62efd718, F=0x0
-0,         71,         71,        1,     6124, 0xb2a68c70, F=0x0
-0,         72,         72,        1,     6077, 0xb48b693f, F=0x0
-0,         73,         73,        1,     5804, 0xb700db6c, F=0x0
-0,         74,         74,        1,     6007, 0x02953898, F=0x0
-0,         75,         75,        1,     6228, 0x87a7b197, F=0x0
-0,         76,         76,        1,     6382, 0x49e7e65b, F=0x0
-0,         77,         77,        1,     6473, 0x3b9b6c3d, F=0x0
-0,         78,         78,        1,     7027, 0x2a4e1c17, F=0x0
-0,         79,         79,        1,     7263, 0x2e48c2e7, F=0x0
-0,         80,         80,        1,     8205, 0x013b701a, F=0x0
-0,         81,         81,        1,     8366, 0xcca97b10, F=0x0
-0,         82,         82,        1,     7716, 0x3b088fb3, F=0x0
-0,         83,         83,        1,     7420, 0xefdd1187, F=0x0
-0,         84,         84,        1,     7549, 0x1731227c, F=0x0
-0,         85,         85,        1,     7956, 0x8186ceb3, F=0x0
-0,         86,         86,        1,     8416, 0x23add53c, F=0x0
-0,         87,         87,        1,     8064, 0x09c616c4, F=0x0
-0,         88,         88,        1,     7409, 0x9d98af03, F=0x0
-0,         89,         89,        1,     7502, 0x0b81ebf3, F=0x0
-0,         90,         90,        1,     7814, 0x2f0d75cb, F=0x0
-0,         91,         91,        1,     7776, 0x45d6800f, F=0x0
-0,         92,         92,        1,     7757, 0x777f98b6, F=0x0
-0,         93,         93,        1,     8055, 0x4eea1634, F=0x0
-0,         94,         94,        1,     7626, 0xfb3931fd, F=0x0
-0,         95,         95,        1,     7987, 0x22a1d052, F=0x0
-0,         96,         96,        1,    12070, 0x3aa2924d, F=0x0
-0,         97,         97,        1,    12325, 0xda6cd811, F=0x0
-0,         98,         98,        1,    12225, 0xd478e671, F=0x0
-0,         99,         99,        1,    11235, 0xc6c09240, F=0x0
-0,        100,        100,        1,    11116, 0x95050c25, F=0x0
-0,        101,        101,        1,    11374, 0x14a68e3d, F=0x0
-0,        102,        102,        1,    11904, 0xb14436f2, F=0x0
-0,        103,        103,        1,    11487, 0xa3358311, F=0x0
-0,        104,        104,        1,    13403, 0xccf33a00, F=0x0
-0,        105,        105,        1,    12921, 0xbf7e4759, F=0x0
-0,        106,        106,        1,    13872, 0x7dace890, F=0x0
-0,        107,        107,        1,    13559, 0xb6c868f9, F=0x0
-0,        108,        108,        1,    14049, 0xa5d569b0, F=0x0
-0,        109,        109,        1,    14152, 0x8c9c31fb, F=0x0
-0,        110,        110,        1,    14285, 0x2ffe3bc3, F=0x0
-0,        111,        111,        1,    14432, 0x27abe196, F=0x0
-0,        112,        112,        1,    14697, 0x20d1aedd, F=0x0
-0,        113,        113,        1,    14606, 0xbcbe586d, F=0x0
-0,        114,        114,        1,    15221, 0x515f8224, F=0x0
-0,        115,        115,        1,    15433, 0x68089081, F=0x0
-0,        116,        116,        1,    15603, 0x8ff4e6fd, F=0x0
-0,        117,        117,        1,    15606, 0xc8527e30, F=0x0
-0,        118,        118,        1,    15871, 0x056ddca3, F=0x0
-0,        119,        119,        1,    15725, 0xc1871caf, F=0x0
-0,        120,        120,        1,    16086, 0x063e257b, F=0x0
-0,        121,        121,        1,    16233, 0xf683823b, F=0x0
-0,        122,        122,        1,    16143, 0x576df609, F=0x0
-0,        123,        123,        1,    16669, 0x3d02346b, F=0x0
-0,        124,        124,        1,    16627, 0xe35236cc, F=0x0
-0,        125,        125,        1,    16837, 0x389c996c, F=0x0
-0,        126,        126,        1,    16952, 0xc833af9f, F=0x0
-0,        127,        127,        1,    17127, 0xbf124531, F=0x0
-0,        128,        128,        1,    17158, 0x7abbfe59, F=0x0
-0,        129,        129,        1,    17329, 0x8102cc38, F=0x0
-0,        130,        130,        1,    17403, 0xa9468cad, F=0x0
-0,        131,        131,        1,    17674, 0x46d8038c, F=0x0
-0,        132,        132,        1,    17738, 0x5ee865ce, F=0x0
-0,        133,        133,        1,    17942, 0xc2449873, F=0x0
-0,        134,        134,        1,    17952, 0x3aafedbc, F=0x0
-0,        135,        135,        1,    18246, 0xdd930054, F=0x0
-0,        136,        136,        1,    18399, 0x68a59331, F=0x0
-0,        137,        137,        1,    18551, 0x1301c157, F=0x0
-0,        138,        138,        1,    18947, 0xbed8a9b4, F=0x0
-0,        139,        139,        1,    19153, 0xe338fea2, F=0x0
-0,        140,        140,        1,    19128, 0xbf05820e, F=0x0
-0,        141,        141,        1,    19138, 0x73b5cd49, F=0x0
-0,        142,        142,        1,    19502, 0xd8d68603, F=0x0
-0,        143,        143,        1,    19542, 0x84b47563, F=0x0
-0,        144,        144,        1,    19755, 0x7194b230, F=0x0
-0,        145,        145,        1,    20122, 0x83633f5e, F=0x0
-0,        146,        146,        1,    20265, 0x7365b06b, F=0x0
-0,        147,        147,        1,    20378, 0x1aaf1a98, F=0x0
-0,        148,        148,        1,    20300, 0x1da6d336, F=0x0
-0,        149,        149,        1,    20499, 0x72d54d30, F=0x0
-0,        150,        150,        1,    20655, 0x6996b124, F=0x0
-0,        151,        151,        1,    20674, 0xa883abd2, F=0x0
-0,        152,        152,        1,    21015, 0x96cf4018, F=0x0
-0,        153,        153,        1,    21066, 0x307e4479, F=0x0
-0,        154,        154,        1,    21161, 0xd45a2c38, F=0x0
-0,        155,        155,        1,    21086, 0xcf0e597d, F=0x0
-0,        156,        156,        1,    21466, 0xcc4032fe, F=0x0
-0,        157,        157,        1,    21677, 0x755ccb7b, F=0x0
-0,        158,        158,        1,    21589, 0x5d74fb47, F=0x0
-0,        159,        159,        1,    21662, 0x0c459189, F=0x0
-0,        160,        160,        1,    21995, 0x43d46eb3, F=0x0
-0,        161,        161,        1,    22213, 0x68455c92, F=0x0
-0,        162,        162,        1,    22483, 0xdc83c15a, F=0x0
-0,        163,        163,        1,    22498, 0xfae1251e, F=0x0
-0,        164,        164,        1,    22468, 0x7944b1d4, F=0x0
-0,        165,        165,        1,    22869, 0xff8c10ac, F=0x0
-0,        166,        166,        1,    22754, 0xd8183b84, F=0x0
-0,        167,        167,        1,    23173, 0x6c3c48d5, F=0x0
-0,        168,        168,        1,    23281, 0xc32ca477, F=0x0
-0,        169,        169,        1,    23219, 0x4dc26193, F=0x0
-0,        170,        170,        1,    23656, 0xb85ee15f, F=0x0
-0,        171,        171,        1,    23683, 0x26ba4915, F=0x0
-0,        172,        172,        1,    23882, 0xf57285de, F=0x0
+0,          1,          1,        1,      236, 0x332769fd, F=0x0
+0,          2,          2,        1,      186, 0x770d5061, F=0x0
+0,          3,          3,        1,      208, 0x55784c8f, F=0x0
+0,          4,          4,        1,      282, 0x98e8825d, F=0x0
+0,          5,          5,        1,      209, 0x4cc15280, F=0x0
+0,          6,          6,        1,      225, 0xf8785d6c, F=0x0
+0,          7,          7,        1,      204, 0x322754b4, F=0x0
+0,          8,          8,        1,      181, 0x9f4f4d10, F=0x0
+0,          9,          9,        1,      200, 0x64a453a1, F=0x0
+0,         10,         10,        1,      184, 0x79c344d3, F=0x0
+0,         11,         11,        1,      191, 0x7097487b, F=0x0
+0,         12,         12,        1,      290, 0x1f998186, F=0x0
+0,         13,         13,        1,      153, 0xfe4c3a7c, F=0x0
+0,         14,         14,        1,      175, 0xfdf442e0, F=0x0
+0,         15,         15,        1,      187, 0x393845f2, F=0x0
+0,         16,         16,        1,      418, 0xe94bc757, F=0x0
+0,         17,         17,        1,      200, 0x8dab52be, F=0x0
+0,         18,         18,        1,      347, 0xae379838, F=0x0
+0,         19,         19,        1,      176, 0x868742d2, F=0x0
+0,         20,         20,        1,      294, 0xb1fb8365, F=0x0
+0,         21,         21,        1,      166, 0x06e44260, F=0x0
+0,         22,         22,        1,      306, 0x29e983b7, F=0x0
+0,         23,         23,        1,      180, 0xfa4a44eb, F=0x0
+0,         24,         24,        1,      207, 0x99de52c8, F=0x0
+0,         25,         25,        1,      204, 0x73944c35, F=0x0
+0,         26,         26,        1,      259, 0xa0637375, F=0x0
+0,         27,         27,        1,      181, 0x130f4b9a, F=0x0
+0,         28,         28,        1,      152, 0x4be93cae, F=0x0
+0,         29,         29,        1,      194, 0x81e34e1d, F=0x0
+0,         30,         30,        1,      159, 0x5913380b, F=0x0
+0,         31,         31,        1,      162, 0xf0683bb1, F=0x0
+0,         32,         32,        1,      178, 0xce32498c, F=0x0
+0,         33,         33,        1,      187, 0x5d61509f, F=0x0
+0,         34,         34,        1,      336, 0xe5569440, F=0x0
+0,         35,         35,        1,      184, 0x3fa349ea, F=0x0
+0,         36,         36,        1,      227, 0x7cad5f66, F=0x0
+0,         37,         37,        1,      182, 0xf23a4522, F=0x0
+0,         38,         38,        1,      162, 0x2a053dcc, F=0x0
+0,         39,         39,        1,      187, 0xc18a4686, F=0x0
+0,         40,         40,        1,      503, 0xa5a7e669, F=0x0
+0,         41,         41,        1,      167, 0xa28a43e8, F=0x0
+0,         42,         42,        1,      289, 0xf1968090, F=0x0
+0,         43,         43,        1,      194, 0xedbb4eb7, F=0x0
+0,         44,         44,        1,      285, 0x82e7818b, F=0x0
+0,         45,         45,        1,      199, 0x5e725190, F=0x0
+0,         46,         46,        1,      197, 0x0c6a4fb9, F=0x0
+0,         47,         47,        1,      203, 0x05684b96, F=0x0
+0,         48,         48,        1,      208, 0xd33457ad, F=0x0
+0,         49,         49,        1,     1198, 0x029f5f1b, F=0x0
+0,         50,         50,        1,      175, 0xf4e94c40, F=0x0
+0,         51,         51,        1,      740, 0x6e096787, F=0x0
+0,         52,         52,        1,      180, 0xf34f45be, F=0x0
+0,         53,         53,        1,      238, 0xfbed6adb, F=0x0
+0,         54,         54,        1,      198, 0x6f3a5344, F=0x0
+0,         55,         55,        1,      196, 0x8bbb4b02, F=0x0
+0,         56,         56,        1,      224, 0x92c55d92, F=0x0
+0,         57,         57,        1,      765, 0xd16e6d65, F=0x0
+0,         58,         58,        1,      149, 0x97aa38d2, F=0x0
+0,         59,         59,        1,      479, 0x1030d73b, F=0x0
+0,         60,         60,        1,      179, 0x441e493a, F=0x0
+0,         61,         61,        1,      217, 0x16c259b7, F=0x0
+0,         62,         62,        1,      190, 0x5b2349ca, F=0x0
+0,         63,         63,        1,      155, 0x422f39ff, F=0x0
+0,         64,         64,        1,      167, 0x28444898, F=0x0
+0,         65,         65,        1,      649, 0x57b331e2, F=0x0
+0,         66,         66,        1,      196, 0x99a1574f, F=0x0
+0,         67,         67,        1,      427, 0xfd45d548, F=0x0
+0,         68,         68,        1,      175, 0x90cc42ce, F=0x0
+0,         69,         69,        1,      284, 0x49398208, F=0x0
+0,         70,         70,        1,      131, 0x18e42fc2, F=0x0
+0,         71,         71,        1,      256, 0xac896bbe, F=0x0
+0,         72,         72,        1,      186, 0x522d4974, F=0x0
+0,         73,         73,        1,      190, 0x5e064e04, F=0x0
+0,         74,         74,        1,      216, 0x863f53fa, F=0x0
+0,         75,         75,        1,      154, 0x17f1383f, F=0x0
+0,         76,         76,        1,      113, 0x20f827ee, F=0x0
+0,         77,         77,        1,      402, 0xce2caf45, F=0x0
+0,         78,         78,        1,      198, 0x0bc851ae, F=0x0
+0,         79,         79,        1,      466, 0xb31ad387, F=0x0
+0,         80,         80,        1,      322, 0x20018e02, F=0x0
+0,         81,         81,        1,      387, 0x5038b1b8, F=0x0
+0,         82,         82,        1,      158, 0xc6ac3feb, F=0x0
+0,         83,         83,        1,      278, 0x59f17c03, F=0x0
+0,         84,         84,        1,      190, 0xd7665022, F=0x0
+0,         85,         85,        1,      175, 0x1a6e4225, F=0x0
+0,         86,         86,        1,      206, 0xc3f44e3a, F=0x0
+0,         87,         87,        1,      379, 0xb1e6b77e, F=0x0
+0,         88,         88,        1,      202, 0x17975145, F=0x0
+0,         89,         89,        1,      225, 0x96985fd2, F=0x0
+0,         90,         90,        1,      175, 0x71b1497a, F=0x0
+0,         91,         91,        1,      235, 0x2bdc5faa, F=0x0
+0,         92,         92,        1,      185, 0x68124958, F=0x0
+0,         93,         93,        1,      182, 0x120c4c63, F=0x0
+0,         94,         94,        1,      114, 0xdd9b2b02, F=0x0
+0,         95,         95,        1,      176, 0x0d5b4b46, F=0x0
+0,         96,         96,        1,      214, 0xfb5e5b47, F=0x0
+0,         97,         97,        1,      182, 0xf4c54860, F=0x0
+0,         98,         98,        1,      195, 0x6e075188, F=0x0
+0,         99,         99,        1,      303, 0x4c158465, F=0x0
+0,        100,        100,        1,      191, 0x12005055, F=0x0
+0,        101,        101,        1,      177, 0x01ed4929, F=0x0
+0,        102,        102,        1,      172, 0x86984280, F=0x0
+0,        103,        103,        1,      179, 0xb854481c, F=0x0
+0,        104,        104,        1,      188, 0xeacd47ed, F=0x0
+0,        105,        105,        1,      177, 0x36be4889, F=0x0
+0,        106,        106,        1,      215, 0x6aa65c99, F=0x0
+0,        107,        107,        1,      339, 0x1af496b2, F=0x0
+0,        108,        108,        1,      189, 0x941045fa, F=0x0
+0,        109,        109,        1,      209, 0x37445651, F=0x0
+0,        110,        110,        1,      205, 0x9cf85222, F=0x0
+0,        111,        111,        1,      185, 0x8b964cb5, F=0x0
+0,        112,        112,        1,      211, 0xd03d59ce, F=0x0
+0,        113,        113,        1,      178, 0xe40e4c08, F=0x0
+0,        114,        114,        1,      195, 0x971d4d92, F=0x0
+0,        115,        115,        1,      116, 0x5f9a2d3f, F=0x0
+0,        116,        116,        1,      116, 0x5c4e2d06, F=0x0
+0,        117,        117,        1,      427, 0x6128c7da, F=0x0
+0,        118,        118,        1,      182, 0x8a9a4a85, F=0x0
+0,        119,        119,        1,      267, 0x94e16d98, F=0x0
+0,        120,        120,        1,      191, 0x8cd6499b, F=0x0
+0,        121,        121,        1,      195, 0x2955524a, F=0x0
+0,        122,        122,        1,      755, 0x21115eef, F=0x0
+0,        123,        123,        1,      179, 0x89ff45fd, F=0x0
+0,        124,        124,        1,      522, 0x1b1cf19d, F=0x0
+0,        125,        125,        1,      171, 0x48034194, F=0x0
+0,        126,        126,        1,      379, 0x3914a793, F=0x0
+0,        127,        127,        1,      539, 0x7155fc34, F=0x0
+0,        128,        128,        1,      199, 0xb8674f8a, F=0x0
+0,        129,        129,        1,      458, 0x0a87ce97, F=0x0
+0,        130,        130,        1,      177, 0xac704b44, F=0x0
+0,        131,        131,        1,      299, 0x49318aa9, F=0x0
+0,        132,        132,        1,      333, 0xa188949d, F=0x0
+0,        133,        133,        1,      179, 0x2474436d, F=0x0
+0,        134,        134,        1,      263, 0x84e871f8, F=0x0
+0,        135,        135,        1,      177, 0xf7904597, F=0x0
+0,        136,        136,        1,      184, 0xb053486d, F=0x0
+0,        137,        137,        1,      433, 0xd3c0c5a1, F=0x0
+0,        138,        138,        1,     1138, 0xd5af3462, F=0x0
+0,        139,        139,        1,      863, 0xdce99f4f, F=0x0
+0,        140,        140,        1,      328, 0x608a949d, F=0x0
+0,        141,        141,        1,      222, 0xecb75a19, F=0x0
+0,        142,        142,        1,      171, 0x6cf94548, F=0x0
+0,        143,        143,        1,      222, 0xcf8d5778, F=0x0
+0,        144,        144,        1,      738, 0x9cf358a2, F=0x0
+0,        145,        145,        1,      444, 0x3798cdf6, F=0x0
+0,        146,        146,        1,      267, 0x8ca87717, F=0x0
+0,        147,        147,        1,      187, 0x4d734c80, F=0x0
+0,        148,        148,        1,      186, 0x9def4fb6, F=0x0
+0,        149,        149,        1,      196, 0x49214f94, F=0x0
+0,        150,        150,        1,      589, 0x02e2142f, F=0x0
+0,        151,        151,        1,      188, 0x285c4dad, F=0x0
+0,        152,        152,        1,      339, 0x8a0fa092, F=0x0
+0,        153,        153,        1,      179, 0x775543d4, F=0x0
+0,        154,        154,        1,      294, 0x0c8885eb, F=0x0
+0,        155,        155,        1,      291, 0xd78084b1, F=0x0
+0,        156,        156,        1,      144, 0xd7323963, F=0x0
+0,        157,        157,        1,      182, 0x97194ede, F=0x0
+0,        158,        158,        1,      195, 0x410f50a6, F=0x0
+0,        159,        159,        1,      268, 0xb878789a, F=0x0
+0,        160,        160,        1,      526, 0x6e13fb3e, F=0x0
+0,        161,        161,        1,      372, 0xf1fca999, F=0x0
+0,        162,        162,        1,      171, 0x86033fb7, F=0x0
+0,        163,        163,        1,      344, 0x8db8a374, F=0x0
+0,        164,        164,        1,      159, 0xa3463fb6, F=0x0
+0,        165,        165,        1,      391, 0x6ab1aa7d, F=0x0
+0,        166,        166,        1,      180, 0x55d04d01, F=0x0
+0,        167,        167,        1,      303, 0xac779365, F=0x0
+0,        168,        168,        1,      180, 0x54e94840, F=0x0
+0,        169,        169,        1,      269, 0x56e57720, F=0x0
+0,        170,        170,        1,      199, 0x510b5589, F=0x0
+0,        171,        171,        1,      287, 0xd70d8529, F=0x0
+0,        172,        172,        1,      217, 0x04a0649e, F=0x0
diff --git a/tests/ref/fate/gifenc-pal8 b/tests/ref/fate/gifenc-pal8
index 3ed3935..1a074b8 100644
--- a/tests/ref/fate/gifenc-pal8
+++ b/tests/ref/fate/gifenc-pal8
@@ -4,175 +4,175 @@
 #dimensions 0: 217x217
 #sar 0: 0/1
 0,          0,          0,        1,     2109, 0x39642b3d
-0,          1,          1,        1,      305, 0xefa98bbd, F=0x0
-0,          2,          2,        1,      446, 0x9499cf43, F=0x0
-0,          3,          3,        1,      458, 0x8cb7d0d5, F=0x0
-0,          4,          4,        1,      555, 0x41f2fe63, F=0x0
-0,          5,          5,        1,      622, 0x3651212e, F=0x0
-0,          6,          6,        1,      650, 0x67542087, F=0x0
-0,          7,          7,        1,      668, 0x392934ca, F=0x0
-0,          8,          8,        1,      829, 0x6cd07a33, F=0x0
-0,          9,          9,        1,     1165, 0xb64b2ec9, F=0x0
-0,         10,         10,        1,      187, 0x114a52a4, F=0x0
-0,         11,         11,        1,     1341, 0x6ca57064, F=0x0
-0,         12,         12,        1,     1646, 0xcdd90fae, F=0x0
-0,         13,         13,        1,     1539, 0xbf75e55f, F=0x0
-0,         14,         14,        1,     1728, 0x96b14714, F=0x0
-0,         15,         15,        1,     1918, 0xffd08446, F=0x0
-0,         16,         16,        1,     2132, 0x3d5ae258, F=0x0
-0,         17,         17,        1,     2256, 0x359526d9, F=0x0
-0,         18,         18,        1,     2319, 0x553c382b, F=0x0
-0,         19,         19,        1,     2416, 0x7ac37066, F=0x0
-0,         20,         20,        1,     2609, 0x552bc27f, F=0x0
-0,         21,         21,        1,     2695, 0xbb0c020e, F=0x0
-0,         22,         22,        1,     2792, 0x46670f7d, F=0x0
-0,         23,         23,        1,     2892, 0x5674481e, F=0x0
-0,         24,         24,        1,     2990, 0x015a7bfd, F=0x0
-0,         25,         25,        1,     3109, 0xc73e9d14, F=0x0
-0,         26,         26,        1,     3261, 0x8a77f522, F=0x0
-0,         27,         27,        1,     3337, 0xf6f92558, F=0x0
-0,         28,         28,        1,     3580, 0x23408bc8, F=0x0
-0,         29,         29,        1,     3815, 0x781dfb1b, F=0x0
-0,         30,         30,        1,     2758, 0xf5cd1d5b, F=0x0
-0,         31,         31,        1,     4039, 0x7909712e, F=0x0
-0,         32,         32,        1,     3033, 0x39089d44, F=0x0
-0,         33,         33,        1,     4303, 0x667b0c60, F=0x0
-0,         34,         34,        1,     2052, 0x9edfba63, F=0x0
-0,         35,         35,        1,     3220, 0x5a56f015, F=0x0
-0,         36,         36,        1,     2300, 0x1719645c, F=0x0
-0,         37,         37,        1,     3641, 0x71c49a57, F=0x0
-0,         38,         38,        1,     3560, 0x377575b8, F=0x0
-0,         39,         39,        1,     3698, 0x165adce0, F=0x0
-0,         40,         40,        1,     1567, 0x6ecbf672, F=0x0
-0,         41,         41,        1,      962, 0x21eccba1, F=0x0
-0,         42,         42,        1,      281, 0x7a5a7ac3, F=0x0
-0,         43,         43,        1,      938, 0x659bb1ec, F=0x0
-0,         44,         44,        1,      279, 0x71e181bc, F=0x0
-0,         45,         45,        1,      204, 0xe0765316, F=0x0
-0,         46,         46,        1,     4307, 0xdbdd0e7d, F=0x0
-0,         47,         47,        1,     4903, 0xd8d24194, F=0x0
-0,         48,         48,        1,     4936, 0x6e9f1aff, F=0x0
-0,         49,         49,        1,     4949, 0xb3115902, F=0x0
-0,         50,         50,        1,     4162, 0xee2cad5b, F=0x0
-0,         51,         51,        1,     4686, 0xd583c178, F=0x0
-0,         52,         52,        1,     4749, 0x8c93b6a9, F=0x0
-0,         53,         53,        1,     4990, 0x12f957fd, F=0x0
-0,         54,         54,        1,     5187, 0xf3bcc7c9, F=0x0
-0,         55,         55,        1,     5054, 0xa27684fb, F=0x0
-0,         56,         56,        1,     5148, 0xe76cbad7, F=0x0
-0,         57,         57,        1,     4309, 0x79f7f067, F=0x0
-0,         58,         58,        1,     5087, 0xa2e29f29, F=0x0
-0,         59,         59,        1,     5292, 0xd158e4db, F=0x0
-0,         60,         60,        1,     5434, 0xe0be16f5, F=0x0
-0,         61,         61,        1,     4653, 0x0a3d8a5e, F=0x0
-0,         62,         62,        1,     5271, 0x4412d0a5, F=0x0
-0,         63,         63,        1,     5229, 0x3e06c4f2, F=0x0
-0,         64,         64,        1,     5225, 0x9bc39cfa, F=0x0
-0,         65,         65,        1,     5403, 0x798b009d, F=0x0
-0,         66,         66,        1,     5228, 0x14f2dded, F=0x0
-0,         67,         67,        1,     5712, 0x8724debe, F=0x0
-0,         68,         68,        1,     5644, 0x49d3a383, F=0x0
-0,         69,         69,        1,     5826, 0xde72e0ba, F=0x0
-0,         70,         70,        1,     5771, 0x62efd718, F=0x0
-0,         71,         71,        1,     6124, 0xb2a68c70, F=0x0
-0,         72,         72,        1,     6077, 0xb48b693f, F=0x0
-0,         73,         73,        1,     5804, 0xb700db6c, F=0x0
-0,         74,         74,        1,     6007, 0x02953898, F=0x0
-0,         75,         75,        1,     6228, 0x87a7b197, F=0x0
-0,         76,         76,        1,     6382, 0x49e7e65b, F=0x0
-0,         77,         77,        1,     6473, 0x3b9b6c3d, F=0x0
-0,         78,         78,        1,     7027, 0x2a4e1c17, F=0x0
-0,         79,         79,        1,     7263, 0x2e48c2e7, F=0x0
-0,         80,         80,        1,     8205, 0x013b701a, F=0x0
-0,         81,         81,        1,     8366, 0xcca97b10, F=0x0
-0,         82,         82,        1,     7716, 0x3b088fb3, F=0x0
-0,         83,         83,        1,     7420, 0xefdd1187, F=0x0
-0,         84,         84,        1,     7549, 0x1731227c, F=0x0
-0,         85,         85,        1,     7956, 0x8186ceb3, F=0x0
-0,         86,         86,        1,     8416, 0x23add53c, F=0x0
-0,         87,         87,        1,     8064, 0x09c616c4, F=0x0
-0,         88,         88,        1,     7409, 0x9d98af03, F=0x0
-0,         89,         89,        1,     7502, 0x0b81ebf3, F=0x0
-0,         90,         90,        1,     7814, 0x2f0d75cb, F=0x0
-0,         91,         91,        1,     7776, 0x45d6800f, F=0x0
-0,         92,         92,        1,     7757, 0x777f98b6, F=0x0
-0,         93,         93,        1,     8055, 0x4eea1634, F=0x0
-0,         94,         94,        1,     7626, 0xfb3931fd, F=0x0
-0,         95,         95,        1,     7987, 0x22a1d052, F=0x0
-0,         96,         96,        1,    12070, 0x3aa2924d, F=0x0
-0,         97,         97,        1,    12325, 0xda6cd811, F=0x0
-0,         98,         98,        1,    12225, 0xd478e671, F=0x0
-0,         99,         99,        1,    11235, 0xc6c09240, F=0x0
-0,        100,        100,        1,    11116, 0x95050c25, F=0x0
-0,        101,        101,        1,    11374, 0x14a68e3d, F=0x0
-0,        102,        102,        1,    11904, 0xb14436f2, F=0x0
-0,        103,        103,        1,    11487, 0xa3358311, F=0x0
-0,        104,        104,        1,    13403, 0xccf33a00, F=0x0
-0,        105,        105,        1,    12921, 0xbf7e4759, F=0x0
-0,        106,        106,        1,    13872, 0x7dace890, F=0x0
-0,        107,        107,        1,    13559, 0xb6c868f9, F=0x0
-0,        108,        108,        1,    14049, 0xa5d569b0, F=0x0
-0,        109,        109,        1,    14152, 0x8c9c31fb, F=0x0
-0,        110,        110,        1,    14285, 0x2ffe3bc3, F=0x0
-0,        111,        111,        1,    14432, 0x27abe196, F=0x0
-0,        112,        112,        1,    14697, 0x20d1aedd, F=0x0
-0,        113,        113,        1,    14606, 0xbcbe586d, F=0x0
-0,        114,        114,        1,    15221, 0x515f8224, F=0x0
-0,        115,        115,        1,    15433, 0x68089081, F=0x0
-0,        116,        116,        1,    15603, 0x8ff4e6fd, F=0x0
-0,        117,        117,        1,    15606, 0xc8527e30, F=0x0
-0,        118,        118,        1,    15871, 0x056ddca3, F=0x0
-0,        119,        119,        1,    15725, 0xc1871caf, F=0x0
-0,        120,        120,        1,    16086, 0x063e257b, F=0x0
-0,        121,        121,        1,    16233, 0xf683823b, F=0x0
-0,        122,        122,        1,    16143, 0x576df609, F=0x0
-0,        123,        123,        1,    16669, 0x3d02346b, F=0x0
-0,        124,        124,        1,    16627, 0xe35236cc, F=0x0
-0,        125,        125,        1,    16837, 0x389c996c, F=0x0
-0,        126,        126,        1,    16952, 0xc833af9f, F=0x0
-0,        127,        127,        1,    17127, 0xbf124531, F=0x0
-0,        128,        128,        1,    17158, 0x7abbfe59, F=0x0
-0,        129,        129,        1,    17329, 0x8102cc38, F=0x0
-0,        130,        130,        1,    17403, 0xa9468cad, F=0x0
-0,        131,        131,        1,    17674, 0x46d8038c, F=0x0
-0,        132,        132,        1,    17738, 0x5ee865ce, F=0x0
-0,        133,        133,        1,    17942, 0xc2449873, F=0x0
-0,        134,        134,        1,    17952, 0x3aafedbc, F=0x0
-0,        135,        135,        1,    18246, 0xdd930054, F=0x0
-0,        136,        136,        1,    18399, 0x68a59331, F=0x0
-0,        137,        137,        1,    18551, 0x1301c157, F=0x0
-0,        138,        138,        1,    18947, 0xbed8a9b4, F=0x0
-0,        139,        139,        1,    19153, 0xe338fea2, F=0x0
-0,        140,        140,        1,    19128, 0xbf05820e, F=0x0
-0,        141,        141,        1,    19138, 0x73b5cd49, F=0x0
-0,        142,        142,        1,    19502, 0xd8d68603, F=0x0
-0,        143,        143,        1,    19542, 0x84b47563, F=0x0
-0,        144,        144,        1,    19755, 0x7194b230, F=0x0
-0,        145,        145,        1,    20122, 0x83633f5e, F=0x0
-0,        146,        146,        1,    20265, 0x7365b06b, F=0x0
-0,        147,        147,        1,    20378, 0x1aaf1a98, F=0x0
-0,        148,        148,        1,    20300, 0x1da6d336, F=0x0
-0,        149,        149,        1,    20499, 0x72d54d30, F=0x0
-0,        150,        150,        1,    20655, 0x6996b124, F=0x0
-0,        151,        151,        1,    20674, 0xa883abd2, F=0x0
-0,        152,        152,        1,    21015, 0x96cf4018, F=0x0
-0,        153,        153,        1,    21066, 0x307e4479, F=0x0
-0,        154,        154,        1,    21161, 0xd45a2c38, F=0x0
-0,        155,        155,        1,    21086, 0xcf0e597d, F=0x0
-0,        156,        156,        1,    21466, 0xcc4032fe, F=0x0
-0,        157,        157,        1,    21677, 0x755ccb7b, F=0x0
-0,        158,        158,        1,    21589, 0x5d74fb47, F=0x0
-0,        159,        159,        1,    21662, 0x0c459189, F=0x0
-0,        160,        160,        1,    21995, 0x43d46eb3, F=0x0
-0,        161,        161,        1,    22213, 0x68455c92, F=0x0
-0,        162,        162,        1,    22483, 0xdc83c15a, F=0x0
-0,        163,        163,        1,    22498, 0xfae1251e, F=0x0
-0,        164,        164,        1,    22468, 0x7944b1d4, F=0x0
-0,        165,        165,        1,    22869, 0xff8c10ac, F=0x0
-0,        166,        166,        1,    22754, 0xd8183b84, F=0x0
-0,        167,        167,        1,    23173, 0x6c3c48d5, F=0x0
-0,        168,        168,        1,    23281, 0xc32ca477, F=0x0
-0,        169,        169,        1,    23219, 0x4dc26193, F=0x0
-0,        170,        170,        1,    23656, 0xb85ee15f, F=0x0
-0,        171,        171,        1,    23683, 0x26ba4915, F=0x0
-0,        172,        172,        1,    23882, 0xf57285de, F=0x0
+0,          1,          1,        1,      236, 0x332769fd, F=0x0
+0,          2,          2,        1,      186, 0x770d5061, F=0x0
+0,          3,          3,        1,      208, 0x55784c8f, F=0x0
+0,          4,          4,        1,      282, 0x98e8825d, F=0x0
+0,          5,          5,        1,      209, 0x4cc15280, F=0x0
+0,          6,          6,        1,      225, 0xf8785d6c, F=0x0
+0,          7,          7,        1,      204, 0x322754b4, F=0x0
+0,          8,          8,        1,      181, 0x9f4f4d10, F=0x0
+0,          9,          9,        1,      200, 0x64a453a1, F=0x0
+0,         10,         10,        1,      184, 0x79c344d3, F=0x0
+0,         11,         11,        1,      191, 0x7097487b, F=0x0
+0,         12,         12,        1,      290, 0x1f998186, F=0x0
+0,         13,         13,        1,      153, 0xfe4c3a7c, F=0x0
+0,         14,         14,        1,      175, 0xfdf442e0, F=0x0
+0,         15,         15,        1,      187, 0x393845f2, F=0x0
+0,         16,         16,        1,      418, 0xe94bc757, F=0x0
+0,         17,         17,        1,      200, 0x8dab52be, F=0x0
+0,         18,         18,        1,      347, 0xae379838, F=0x0
+0,         19,         19,        1,      176, 0x868742d2, F=0x0
+0,         20,         20,        1,      294, 0xb1fb8365, F=0x0
+0,         21,         21,        1,      166, 0x06e44260, F=0x0
+0,         22,         22,        1,      306, 0x29e983b7, F=0x0
+0,         23,         23,        1,      180, 0xfa4a44eb, F=0x0
+0,         24,         24,        1,      207, 0x99de52c8, F=0x0
+0,         25,         25,        1,      204, 0x73944c35, F=0x0
+0,         26,         26,        1,      259, 0xa0637375, F=0x0
+0,         27,         27,        1,      181, 0x130f4b9a, F=0x0
+0,         28,         28,        1,      152, 0x4be93cae, F=0x0
+0,         29,         29,        1,      194, 0x81e34e1d, F=0x0
+0,         30,         30,        1,      159, 0x5913380b, F=0x0
+0,         31,         31,        1,      162, 0xf0683bb1, F=0x0
+0,         32,         32,        1,      178, 0xce32498c, F=0x0
+0,         33,         33,        1,      187, 0x5d61509f, F=0x0
+0,         34,         34,        1,      336, 0xe5569440, F=0x0
+0,         35,         35,        1,      184, 0x3fa349ea, F=0x0
+0,         36,         36,        1,      227, 0x7cad5f66, F=0x0
+0,         37,         37,        1,      182, 0xf23a4522, F=0x0
+0,         38,         38,        1,      162, 0x2a053dcc, F=0x0
+0,         39,         39,        1,      187, 0xc18a4686, F=0x0
+0,         40,         40,        1,      503, 0xa5a7e669, F=0x0
+0,         41,         41,        1,      167, 0xa28a43e8, F=0x0
+0,         42,         42,        1,      289, 0xf1968090, F=0x0
+0,         43,         43,        1,      194, 0xedbb4eb7, F=0x0
+0,         44,         44,        1,      285, 0x82e7818b, F=0x0
+0,         45,         45,        1,      199, 0x5e725190, F=0x0
+0,         46,         46,        1,      197, 0x0c6a4fb9, F=0x0
+0,         47,         47,        1,      203, 0x05684b96, F=0x0
+0,         48,         48,        1,      208, 0xd33457ad, F=0x0
+0,         49,         49,        1,     1198, 0x029f5f1b, F=0x0
+0,         50,         50,        1,      175, 0xf4e94c40, F=0x0
+0,         51,         51,        1,      740, 0x6e096787, F=0x0
+0,         52,         52,        1,      180, 0xf34f45be, F=0x0
+0,         53,         53,        1,      238, 0xfbed6adb, F=0x0
+0,         54,         54,        1,      198, 0x6f3a5344, F=0x0
+0,         55,         55,        1,      196, 0x8bbb4b02, F=0x0
+0,         56,         56,        1,      224, 0x92c55d92, F=0x0
+0,         57,         57,        1,      765, 0xd16e6d65, F=0x0
+0,         58,         58,        1,      149, 0x97aa38d2, F=0x0
+0,         59,         59,        1,      479, 0x1030d73b, F=0x0
+0,         60,         60,        1,      179, 0x441e493a, F=0x0
+0,         61,         61,        1,      217, 0x16c259b7, F=0x0
+0,         62,         62,        1,      190, 0x5b2349ca, F=0x0
+0,         63,         63,        1,      155, 0x422f39ff, F=0x0
+0,         64,         64,        1,      167, 0x28444898, F=0x0
+0,         65,         65,        1,      649, 0x57b331e2, F=0x0
+0,         66,         66,        1,      196, 0x99a1574f, F=0x0
+0,         67,         67,        1,      427, 0xfd45d548, F=0x0
+0,         68,         68,        1,      175, 0x90cc42ce, F=0x0
+0,         69,         69,        1,      284, 0x49398208, F=0x0
+0,         70,         70,        1,      131, 0x18e42fc2, F=0x0
+0,         71,         71,        1,      256, 0xac896bbe, F=0x0
+0,         72,         72,        1,      186, 0x522d4974, F=0x0
+0,         73,         73,        1,      190, 0x5e064e04, F=0x0
+0,         74,         74,        1,      216, 0x863f53fa, F=0x0
+0,         75,         75,        1,      154, 0x17f1383f, F=0x0
+0,         76,         76,        1,      113, 0x20f827ee, F=0x0
+0,         77,         77,        1,      402, 0xce2caf45, F=0x0
+0,         78,         78,        1,      198, 0x0bc851ae, F=0x0
+0,         79,         79,        1,      466, 0xb31ad387, F=0x0
+0,         80,         80,        1,      322, 0x20018e02, F=0x0
+0,         81,         81,        1,      387, 0x5038b1b8, F=0x0
+0,         82,         82,        1,      158, 0xc6ac3feb, F=0x0
+0,         83,         83,        1,      278, 0x59f17c03, F=0x0
+0,         84,         84,        1,      190, 0xd7665022, F=0x0
+0,         85,         85,        1,      175, 0x1a6e4225, F=0x0
+0,         86,         86,        1,      206, 0xc3f44e3a, F=0x0
+0,         87,         87,        1,      379, 0xb1e6b77e, F=0x0
+0,         88,         88,        1,      202, 0x17975145, F=0x0
+0,         89,         89,        1,      225, 0x96985fd2, F=0x0
+0,         90,         90,        1,      175, 0x71b1497a, F=0x0
+0,         91,         91,        1,      235, 0x2bdc5faa, F=0x0
+0,         92,         92,        1,      185, 0x68124958, F=0x0
+0,         93,         93,        1,      182, 0x120c4c63, F=0x0
+0,         94,         94,        1,      114, 0xdd9b2b02, F=0x0
+0,         95,         95,        1,      176, 0x0d5b4b46, F=0x0
+0,         96,         96,        1,      214, 0xfb5e5b47, F=0x0
+0,         97,         97,        1,      182, 0xf4c54860, F=0x0
+0,         98,         98,        1,      195, 0x6e075188, F=0x0
+0,         99,         99,        1,      303, 0x4c158465, F=0x0
+0,        100,        100,        1,      191, 0x12005055, F=0x0
+0,        101,        101,        1,      177, 0x01ed4929, F=0x0
+0,        102,        102,        1,      172, 0x86984280, F=0x0
+0,        103,        103,        1,      179, 0xb854481c, F=0x0
+0,        104,        104,        1,      188, 0xeacd47ed, F=0x0
+0,        105,        105,        1,      177, 0x36be4889, F=0x0
+0,        106,        106,        1,      215, 0x6aa65c99, F=0x0
+0,        107,        107,        1,      339, 0x1af496b2, F=0x0
+0,        108,        108,        1,      189, 0x941045fa, F=0x0
+0,        109,        109,        1,      209, 0x37445651, F=0x0
+0,        110,        110,        1,      205, 0x9cf85222, F=0x0
+0,        111,        111,        1,      185, 0x8b964cb5, F=0x0
+0,        112,        112,        1,      211, 0xd03d59ce, F=0x0
+0,        113,        113,        1,      178, 0xe40e4c08, F=0x0
+0,        114,        114,        1,      195, 0x971d4d92, F=0x0
+0,        115,        115,        1,      116, 0x5f9a2d3f, F=0x0
+0,        116,        116,        1,      116, 0x5c4e2d06, F=0x0
+0,        117,        117,        1,      427, 0x6128c7da, F=0x0
+0,        118,        118,        1,      182, 0x8a9a4a85, F=0x0
+0,        119,        119,        1,      267, 0x94e16d98, F=0x0
+0,        120,        120,        1,      191, 0x8cd6499b, F=0x0
+0,        121,        121,        1,      195, 0x2955524a, F=0x0
+0,        122,        122,        1,      755, 0x21115eef, F=0x0
+0,        123,        123,        1,      179, 0x89ff45fd, F=0x0
+0,        124,        124,        1,      522, 0x1b1cf19d, F=0x0
+0,        125,        125,        1,      171, 0x48034194, F=0x0
+0,        126,        126,        1,      379, 0x3914a793, F=0x0
+0,        127,        127,        1,      539, 0x7155fc34, F=0x0
+0,        128,        128,        1,      199, 0xb8674f8a, F=0x0
+0,        129,        129,        1,      458, 0x0a87ce97, F=0x0
+0,        130,        130,        1,      177, 0xac704b44, F=0x0
+0,        131,        131,        1,      299, 0x49318aa9, F=0x0
+0,        132,        132,        1,      333, 0xa188949d, F=0x0
+0,        133,        133,        1,      179, 0x2474436d, F=0x0
+0,        134,        134,        1,      263, 0x84e871f8, F=0x0
+0,        135,        135,        1,      177, 0xf7904597, F=0x0
+0,        136,        136,        1,      184, 0xb053486d, F=0x0
+0,        137,        137,        1,      433, 0xd3c0c5a1, F=0x0
+0,        138,        138,        1,     1138, 0xd5af3462, F=0x0
+0,        139,        139,        1,      863, 0xdce99f4f, F=0x0
+0,        140,        140,        1,      328, 0x608a949d, F=0x0
+0,        141,        141,        1,      222, 0xecb75a19, F=0x0
+0,        142,        142,        1,      171, 0x6cf94548, F=0x0
+0,        143,        143,        1,      222, 0xcf8d5778, F=0x0
+0,        144,        144,        1,      738, 0x9cf358a2, F=0x0
+0,        145,        145,        1,      444, 0x3798cdf6, F=0x0
+0,        146,        146,        1,      267, 0x8ca87717, F=0x0
+0,        147,        147,        1,      187, 0x4d734c80, F=0x0
+0,        148,        148,        1,      186, 0x9def4fb6, F=0x0
+0,        149,        149,        1,      196, 0x49214f94, F=0x0
+0,        150,        150,        1,      589, 0x02e2142f, F=0x0
+0,        151,        151,        1,      188, 0x285c4dad, F=0x0
+0,        152,        152,        1,      339, 0x8a0fa092, F=0x0
+0,        153,        153,        1,      179, 0x775543d4, F=0x0
+0,        154,        154,        1,      294, 0x0c8885eb, F=0x0
+0,        155,        155,        1,      291, 0xd78084b1, F=0x0
+0,        156,        156,        1,      144, 0xd7323963, F=0x0
+0,        157,        157,        1,      182, 0x97194ede, F=0x0
+0,        158,        158,        1,      195, 0x410f50a6, F=0x0
+0,        159,        159,        1,      268, 0xb878789a, F=0x0
+0,        160,        160,        1,      526, 0x6e13fb3e, F=0x0
+0,        161,        161,        1,      372, 0xf1fca999, F=0x0
+0,        162,        162,        1,      171, 0x86033fb7, F=0x0
+0,        163,        163,        1,      344, 0x8db8a374, F=0x0
+0,        164,        164,        1,      159, 0xa3463fb6, F=0x0
+0,        165,        165,        1,      391, 0x6ab1aa7d, F=0x0
+0,        166,        166,        1,      180, 0x55d04d01, F=0x0
+0,        167,        167,        1,      303, 0xac779365, F=0x0
+0,        168,        168,        1,      180, 0x54e94840, F=0x0
+0,        169,        169,        1,      269, 0x56e57720, F=0x0
+0,        170,        170,        1,      199, 0x510b5589, F=0x0
+0,        171,        171,        1,      287, 0xd70d8529, F=0x0
+0,        172,        172,        1,      217, 0x04a0649e, F=0x0
diff --git a/tests/ref/fate/gifenc-rgb4_byte b/tests/ref/fate/gifenc-rgb4_byte
index c99c983..25e9fc7 100644
--- a/tests/ref/fate/gifenc-rgb4_byte
+++ b/tests/ref/fate/gifenc-rgb4_byte
@@ -4,175 +4,175 @@
 #dimensions 0: 217x217
 #sar 0: 0/1
 0,          0,          0,        1,     1297, 0x5618fe71
-0,          1,          1,        1,      221, 0x230c4e66, F=0x0
-0,          2,          2,        1,      139, 0xf87a2b65, F=0x0
-0,          3,          3,        1,      392, 0x7794a5e6, F=0x0
-0,          4,          4,        1,      389, 0xf856a3f1, F=0x0
-0,          5,          5,        1,      438, 0x0f95b4fb, F=0x0
-0,          6,          6,        1,      526, 0x7885d860, F=0x0
-0,          7,          7,        1,      543, 0x859fe7df, F=0x0
-0,          8,          8,        1,      446, 0xb34dba74, F=0x0
-0,          9,          9,        1,      931, 0x1c2fa48d, F=0x0
-0,         10,         10,        1,      702, 0x1ce74b4d, F=0x0
-0,         11,         11,        1,     1202, 0x2f232db8, F=0x0
-0,         12,         12,        1,     1299, 0x904e56af, F=0x0
-0,         13,         13,        1,     1253, 0x20803653, F=0x0
-0,         14,         14,        1,     1338, 0x24e052f6, F=0x0
-0,         15,         15,        1,     1284, 0x590a3a42, F=0x0
-0,         16,         16,        1,     1483, 0x93e09883, F=0x0
-0,         17,         17,        1,     1792, 0x70984bdf, F=0x0
-0,         18,         18,        1,     1683, 0x23b9fc30, F=0x0
-0,         19,         19,        1,     1517, 0x0fc1acf6, F=0x0
-0,         20,         20,        1,     1713, 0x6b4c1861, F=0x0
-0,         21,         21,        1,     1753, 0x896b20c1, F=0x0
-0,         22,         22,        1,     1650, 0x2f26027f, F=0x0
-0,         23,         23,        1,     1726, 0x9f731df0, F=0x0
-0,         24,         24,        1,     1908, 0xebd67b41, F=0x0
-0,         25,         25,        1,     1815, 0xf2685278, F=0x0
-0,         26,         26,        1,     1923, 0xbe18821e, F=0x0
-0,         27,         27,        1,     2108, 0x1318d306, F=0x0
-0,         28,         28,        1,     2708, 0x5e28f23c, F=0x0
-0,         29,         29,        1,     2681, 0xb96da855, F=0x0
-0,         30,         30,        1,     2903, 0x61cf4983, F=0x0
-0,         31,         31,        1,     3265, 0x95a1d25d, F=0x0
-0,         32,         32,        1,     3187, 0x6a67c299, F=0x0
-0,         33,         33,        1,     3304, 0x1c5ce63e, F=0x0
-0,         34,         34,        1,     3608, 0x2ed2770f, F=0x0
-0,         35,         35,        1,     3707, 0xa075a17b, F=0x0
-0,         36,         36,        1,     3822, 0xc842d6b6, F=0x0
-0,         37,         37,        1,     3635, 0x814680c7, F=0x0
-0,         38,         38,        1,     2958, 0x64de62cf, F=0x0
-0,         39,         39,        1,     3094, 0x2c338e84, F=0x0
-0,         40,         40,        1,     3102, 0xec5e8757, F=0x0
-0,         41,         41,        1,     3464, 0xea4f2bce, F=0x0
-0,         42,         42,        1,     4116, 0xded05ff3, F=0x0
-0,         43,         43,        1,     4225, 0x21825a2c, F=0x0
-0,         44,         44,        1,     3621, 0xa3125130, F=0x0
-0,         45,         45,        1,     3918, 0x35e0e876, F=0x0
-0,         46,         46,        1,     4469, 0xa408e1f7, F=0x0
-0,         47,         47,        1,     4601, 0x6f7d3081, F=0x0
-0,         48,         48,        1,     4830, 0x023e9cab, F=0x0
-0,         49,         49,        1,     5406, 0xf67ac12c, F=0x0
-0,         50,         50,        1,     5274, 0xf14e9768, F=0x0
-0,         51,         51,        1,     5424, 0x2af8e2a7, F=0x0
-0,         52,         52,        1,     5527, 0x80f70710, F=0x0
-0,         53,         53,        1,     5709, 0x89975c2f, F=0x0
-0,         54,         54,        1,     6168, 0xf5a542af, F=0x0
-0,         55,         55,        1,     6241, 0x091651ad, F=0x0
-0,         56,         56,        1,     5919, 0x32a7c5a2, F=0x0
-0,         57,         57,        1,     6005, 0x88adf6be, F=0x0
-0,         58,         58,        1,     5954, 0x3f92f18d, F=0x0
-0,         59,         59,        1,     6476, 0x9d90d099, F=0x0
-0,         60,         60,        1,     6745, 0xdf4f3cb1, F=0x0
-0,         61,         61,        1,     6283, 0x6e7e8f63, F=0x0
-0,         62,         62,        1,     6649, 0x5c1f366c, F=0x0
-0,         63,         63,        1,     6386, 0xa09389c3, F=0x0
-0,         64,         64,        1,     6265, 0xe5b85888, F=0x0
-0,         65,         65,        1,     6916, 0x445e734f, F=0x0
-0,         66,         66,        1,     7238, 0x30a52626, F=0x0
-0,         67,         67,        1,     7564, 0x1ddaa7cc, F=0x0
-0,         68,         68,        1,     7421, 0x118e7850, F=0x0
-0,         69,         69,        1,     7484, 0x5459acd8, F=0x0
-0,         70,         70,        1,     7604, 0x66f9e6a5, F=0x0
-0,         71,         71,        1,     7764, 0x862c0630, F=0x0
-0,         72,         72,        1,     8023, 0x06e16db8, F=0x0
-0,         73,         73,        1,     8136, 0xce28c084, F=0x0
-0,         74,         74,        1,     8109, 0x61c4aef6, F=0x0
-0,         75,         75,        1,     7871, 0x631d4073, F=0x0
-0,         76,         76,        1,     7968, 0x3b7692f0, F=0x0
-0,         77,         77,        1,     8246, 0x531bebc2, F=0x0
-0,         78,         78,        1,     8329, 0xe1fd48c9, F=0x0
-0,         79,         79,        1,     8570, 0x996fc156, F=0x0
-0,         80,         80,        1,     8754, 0x99fb0c5a, F=0x0
-0,         81,         81,        1,     8586, 0xf3eba620, F=0x0
-0,         82,         82,        1,     8886, 0xa08258a9, F=0x0
-0,         83,         83,        1,     9085, 0x229359d3, F=0x0
-0,         84,         84,        1,     9318, 0x3baaf9b9, F=0x0
-0,         85,         85,        1,     9402, 0xe27a4804, F=0x0
-0,         86,         86,        1,     9169, 0x23fd9a49, F=0x0
-0,         87,         87,        1,     9470, 0xe389379c, F=0x0
-0,         88,         88,        1,     9658, 0x6a409434, F=0x0
-0,         89,         89,        1,     9709, 0x42969ccd, F=0x0
-0,         90,         90,        1,     9531, 0x473139f3, F=0x0
-0,         91,         91,        1,     9899, 0xb85e0cd0, F=0x0
-0,         92,         92,        1,    10013, 0xda4d4db8, F=0x0
-0,         93,         93,        1,    10046, 0x0cc12baa, F=0x0
-0,         94,         94,        1,    10094, 0x22b6451c, F=0x0
-0,         95,         95,        1,    10446, 0x03a604aa, F=0x0
-0,         96,         96,        1,    10591, 0x3c8d599a, F=0x0
-0,         97,         97,        1,    10589, 0x3936826f, F=0x0
-0,         98,         98,        1,    10815, 0xb795dc11, F=0x0
-0,         99,         99,        1,    11119, 0x506c5187, F=0x0
-0,        100,        100,        1,    11202, 0x92856baf, F=0x0
-0,        101,        101,        1,    11248, 0xdf29a1db, F=0x0
-0,        102,        102,        1,    11491, 0x656df632, F=0x0
-0,        103,        103,        1,    11688, 0xeb175aa9, F=0x0
-0,        104,        104,        1,    11793, 0x99ccb713, F=0x0
-0,        105,        105,        1,    11444, 0x602c0c0d, F=0x0
-0,        106,        106,        1,    11936, 0xe89cc9bd, F=0x0
-0,        107,        107,        1,    11940, 0xc668bf2f, F=0x0
-0,        108,        108,        1,    12289, 0x9bd5780d, F=0x0
-0,        109,        109,        1,    12342, 0xd9c680fb, F=0x0
-0,        110,        110,        1,    12460, 0xb539b50f, F=0x0
-0,        111,        111,        1,    12703, 0x07473fac, F=0x0
-0,        112,        112,        1,    12676, 0x743052ae, F=0x0
-0,        113,        113,        1,    12965, 0xf6aaa045, F=0x0
-0,        114,        114,        1,    13062, 0xea13e513, F=0x0
-0,        115,        115,        1,    13155, 0x82312fa0, F=0x0
-0,        116,        116,        1,    13179, 0xd59c1dda, F=0x0
-0,        117,        117,        1,    13206, 0xde825850, F=0x0
-0,        118,        118,        1,    13219, 0x0b375f69, F=0x0
-0,        119,        119,        1,    13218, 0x14036301, F=0x0
-0,        120,        120,        1,    13475, 0x259da599, F=0x0
-0,        121,        121,        1,    13673, 0x9b43dd2a, F=0x0
-0,        122,        122,        1,    13700, 0x190bebf1, F=0x0
-0,        123,        123,        1,    13829, 0x9f802c28, F=0x0
-0,        124,        124,        1,    13954, 0x5236926c, F=0x0
-0,        125,        125,        1,    14071, 0xf5c3d36a, F=0x0
-0,        126,        126,        1,    14132, 0xbf35cdb9, F=0x0
-0,        127,        127,        1,    14339, 0x9cf65120, F=0x0
-0,        128,        128,        1,    14477, 0x3a9eabb7, F=0x0
-0,        129,        129,        1,    14544, 0xed09a2d3, F=0x0
-0,        130,        130,        1,    14616, 0xa138d2a0, F=0x0
-0,        131,        131,        1,    14906, 0x13bd28eb, F=0x0
-0,        132,        132,        1,    14986, 0x5454a127, F=0x0
-0,        133,        133,        1,    15150, 0x585cdb9b, F=0x0
-0,        134,        134,        1,    15137, 0x191bbaae, F=0x0
-0,        135,        135,        1,    15251, 0xa8461431, F=0x0
-0,        136,        136,        1,    15345, 0x2015670e, F=0x0
-0,        137,        137,        1,    15646, 0x772da02d, F=0x0
-0,        138,        138,        1,    15920, 0xfabc27f3, F=0x0
-0,        139,        139,        1,    16049, 0x2a66498f, F=0x0
-0,        140,        140,        1,    16236, 0x29750328, F=0x0
-0,        141,        141,        1,    16270, 0x4528e71c, F=0x0
-0,        142,        142,        1,    16379, 0x9a450fab, F=0x0
-0,        143,        143,        1,    16669, 0x31ffaac8, F=0x0
-0,        144,        144,        1,    16925, 0x6c4318ac, F=0x0
-0,        145,        145,        1,    17157, 0xf4b1cf0c, F=0x0
-0,        146,        146,        1,    17180, 0xd1bab36c, F=0x0
-0,        147,        147,        1,    17323, 0x419eaee3, F=0x0
-0,        148,        148,        1,    17405, 0xdf3f16ee, F=0x0
-0,        149,        149,        1,    17439, 0x7153f9f8, F=0x0
-0,        150,        150,        1,    17584, 0x1612557d, F=0x0
-0,        151,        151,        1,    17772, 0xffa78d73, F=0x0
-0,        152,        152,        1,    17834, 0x3e33866a, F=0x0
-0,        153,        153,        1,    17926, 0xdfc39bcd, F=0x0
-0,        154,        154,        1,    17831, 0x5f8ebc12, F=0x0
-0,        155,        155,        1,    18150, 0xc25e1f7f, F=0x0
-0,        156,        156,        1,    18265, 0x9b688807, F=0x0
-0,        157,        157,        1,    18345, 0xdc6abd59, F=0x0
-0,        158,        158,        1,    18301, 0x14d43a0e, F=0x0
-0,        159,        159,        1,    18426, 0x3b2cbcde, F=0x0
-0,        160,        160,        1,    18615, 0x6fa5492e, F=0x0
-0,        161,        161,        1,    18924, 0xa370be9b, F=0x0
-0,        162,        162,        1,    19081, 0xe019041b, F=0x0
-0,        163,        163,        1,    19176, 0x1acc040f, F=0x0
-0,        164,        164,        1,    19218, 0x27080108, F=0x0
-0,        165,        165,        1,    19406, 0xae676585, F=0x0
-0,        166,        166,        1,    19488, 0x9619a232, F=0x0
-0,        167,        167,        1,    19667, 0x88e71365, F=0x0
-0,        168,        168,        1,    19680, 0xd20d1a77, F=0x0
-0,        169,        169,        1,    19944, 0xc3d0647e, F=0x0
-0,        170,        170,        1,    19983, 0xbca79c59, F=0x0
-0,        171,        171,        1,    20029, 0x2c238ced, F=0x0
-0,        172,        172,        1,    20068, 0xaad778bc, F=0x0
+0,          1,          1,        1,      158, 0xfa673468, F=0x0
+0,          2,          2,        1,      143, 0x61cf2b35, F=0x0
+0,          3,          3,        1,      169, 0x152a369a, F=0x0
+0,          4,          4,        1,      254, 0x22935c08, F=0x0
+0,          5,          5,        1,      221, 0x9972496f, F=0x0
+0,          6,          6,        1,      176, 0xf6af3ab2, F=0x0
+0,          7,          7,        1,      189, 0xcdc23f20, F=0x0
+0,          8,          8,        1,      139, 0x081e3020, F=0x0
+0,          9,          9,        1,      160, 0x9153335f, F=0x0
+0,         10,         10,        1,      149, 0x8fa12e7d, F=0x0
+0,         11,         11,        1,      190, 0x43ef3de1, F=0x0
+0,         12,         12,        1,      308, 0x95c77160, F=0x0
+0,         13,         13,        1,      193, 0xf9084196, F=0x0
+0,         14,         14,        1,      191, 0x07784447, F=0x0
+0,         15,         15,        1,      198, 0x7d72420a, F=0x0
+0,         16,         16,        1,      417, 0xbf40acdc, F=0x0
+0,         17,         17,        1,      163, 0xf7df3842, F=0x0
+0,         18,         18,        1,      383, 0xadcf9e8e, F=0x0
+0,         19,         19,        1,      193, 0xba544052, F=0x0
+0,         20,         20,        1,      337, 0x1510922f, F=0x0
+0,         21,         21,        1,      199, 0x11d64936, F=0x0
+0,         22,         22,        1,      308, 0x79597dbc, F=0x0
+0,         23,         23,        1,      186, 0x25d04175, F=0x0
+0,         24,         24,        1,      199, 0x8b65402f, F=0x0
+0,         25,         25,        1,      163, 0x128e38b6, F=0x0
+0,         26,         26,        1,      302, 0xacc979b2, F=0x0
+0,         27,         27,        1,      189, 0x491f3c5c, F=0x0
+0,         28,         28,        1,      157, 0x50783600, F=0x0
+0,         29,         29,        1,      205, 0xad9045b3, F=0x0
+0,         30,         30,        1,      160, 0xcbf332f8, F=0x0
+0,         31,         31,        1,      202, 0xc72c48bf, F=0x0
+0,         32,         32,        1,      160, 0xe6c436dd, F=0x0
+0,         33,         33,        1,      215, 0x4f705072, F=0x0
+0,         34,         34,        1,      422, 0xed27b0b0, F=0x0
+0,         35,         35,        1,      184, 0x6ba8415a, F=0x0
+0,         36,         36,        1,      289, 0x0b5f73a3, F=0x0
+0,         37,         37,        1,      190, 0xea5b4316, F=0x0
+0,         38,         38,        1,      195, 0xd9f2441d, F=0x0
+0,         39,         39,        1,      199, 0x47e34e05, F=0x0
+0,         40,         40,        1,      448, 0xec8bbf56, F=0x0
+0,         41,         41,        1,      170, 0x42fb3755, F=0x0
+0,         42,         42,        1,      279, 0x87cc6f54, F=0x0
+0,         43,         43,        1,      180, 0x085f398a, F=0x0
+0,         44,         44,        1,      303, 0x46fe7c55, F=0x0
+0,         45,         45,        1,      209, 0xc60b5116, F=0x0
+0,         46,         46,        1,      198, 0x795f4655, F=0x0
+0,         47,         47,        1,      194, 0xeb1b4abe, F=0x0
+0,         48,         48,        1,      186, 0x97b44251, F=0x0
+0,         49,         49,        1,     1200, 0xeb5a36ba, F=0x0
+0,         50,         50,        1,      204, 0x00bc4594, F=0x0
+0,         51,         51,        1,     1066, 0xdc39eee0, F=0x0
+0,         52,         52,        1,      187, 0x344b4304, F=0x0
+0,         53,         53,        1,      323, 0x899f8522, F=0x0
+0,         54,         54,        1,      205, 0x48af49da, F=0x0
+0,         55,         55,        1,      213, 0xf2534ff5, F=0x0
+0,         56,         56,        1,      208, 0x8fba4b25, F=0x0
+0,         57,         57,        1,      737, 0x1612477c, F=0x0
+0,         58,         58,        1,      181, 0x903b38ad, F=0x0
+0,         59,         59,        1,      614, 0xb154157d, F=0x0
+0,         60,         60,        1,      215, 0x4e82532e, F=0x0
+0,         61,         61,        1,      291, 0x69476efd, F=0x0
+0,         62,         62,        1,      208, 0x471d4ea1, F=0x0
+0,         63,         63,        1,      208, 0xa2b04628, F=0x0
+0,         64,         64,        1,      203, 0x96d646b2, F=0x0
+0,         65,         65,        1,      531, 0xd085ea85, F=0x0
+0,         66,         66,        1,      178, 0x51663ad1, F=0x0
+0,         67,         67,        1,      446, 0x00adbe2d, F=0x0
+0,         68,         68,        1,      188, 0x7ccb3dda, F=0x0
+0,         69,         69,        1,      177, 0xd881441a, F=0x0
+0,         70,         70,        1,      112, 0x44cc2135, F=0x0
+0,         71,         71,        1,      296, 0x717d7172, F=0x0
+0,         72,         72,        1,      153, 0xbd403424, F=0x0
+0,         73,         73,        1,      218, 0x1d9a4f26, F=0x0
+0,         74,         74,        1,      202, 0x6ee647eb, F=0x0
+0,         75,         75,        1,      239, 0x71245ad2, F=0x0
+0,         76,         76,        1,      139, 0xbbdd2d23, F=0x0
+0,         77,         77,        1,      467, 0x6e1cc838, F=0x0
+0,         78,         78,        1,      274, 0xea1079c5, F=0x0
+0,         79,         79,        1,      404, 0xbf5caaa0, F=0x0
+0,         80,         80,        1,      257, 0xac4865e5, F=0x0
+0,         81,         81,        1,      419, 0xa45ab5fc, F=0x0
+0,         82,         82,        1,      208, 0xb5dd4fc3, F=0x0
+0,         83,         83,        1,      294, 0xcf5176ee, F=0x0
+0,         84,         84,        1,      191, 0xed7e3e98, F=0x0
+0,         85,         85,        1,      181, 0x9105450e, F=0x0
+0,         86,         86,        1,      218, 0x445c54ae, F=0x0
+0,         87,         87,        1,      423, 0x5dc9bec5, F=0x0
+0,         88,         88,        1,      202, 0xdfde4a35, F=0x0
+0,         89,         89,        1,      317, 0x9a918033, F=0x0
+0,         90,         90,        1,      172, 0x081e3d8c, F=0x0
+0,         91,         91,        1,      275, 0x37536b50, F=0x0
+0,         92,         92,        1,      214, 0xecfc4e8f, F=0x0
+0,         93,         93,        1,      182, 0x85bf44e5, F=0x0
+0,         94,         94,        1,      151, 0x4c8230ae, F=0x0
+0,         95,         95,        1,      157, 0xa02a32eb, F=0x0
+0,         96,         96,        1,      202, 0xb24a4355, F=0x0
+0,         97,         97,        1,      162, 0x632d3576, F=0x0
+0,         98,         98,        1,      186, 0x6f9c407c, F=0x0
+0,         99,         99,        1,      318, 0xade078ca, F=0x0
+0,        100,        100,        1,      225, 0xd2754eee, F=0x0
+0,        101,        101,        1,      207, 0xdedb4552, F=0x0
+0,        102,        102,        1,      212, 0x25384cd1, F=0x0
+0,        103,        103,        1,      153, 0x489434d3, F=0x0
+0,        104,        104,        1,      196, 0x659145f9, F=0x0
+0,        105,        105,        1,      146, 0x8b223366, F=0x0
+0,        106,        106,        1,      194, 0x0bc14890, F=0x0
+0,        107,        107,        1,      304, 0xdece8235, F=0x0
+0,        108,        108,        1,      194, 0x7737464d, F=0x0
+0,        109,        109,        1,      190, 0x945e43a4, F=0x0
+0,        110,        110,        1,      204, 0x8de14af3, F=0x0
+0,        111,        111,        1,      136, 0xd0862cb1, F=0x0
+0,        112,        112,        1,      171, 0xff6f3da8, F=0x0
+0,        113,        113,        1,      140, 0x3475307b, F=0x0
+0,        114,        114,        1,      158, 0x8f31321e, F=0x0
+0,        115,        115,        1,       94, 0xf6691c01, F=0x0
+0,        116,        116,        1,      110, 0x66e52218, F=0x0
+0,        117,        117,        1,      256, 0x4b086864, F=0x0
+0,        118,        118,        1,      220, 0x6fb75337, F=0x0
+0,        119,        119,        1,      221, 0x69a94e72, F=0x0
+0,        120,        120,        1,      205, 0xbae94509, F=0x0
+0,        121,        121,        1,      169, 0xdd3c388b, F=0x0
+0,        122,        122,        1,      970, 0x9771c82f, F=0x0
+0,        123,        123,        1,      181, 0xec794298, F=0x0
+0,        124,        124,        1,      955, 0x23edba10, F=0x0
+0,        125,        125,        1,      158, 0x3ad83314, F=0x0
+0,        126,        126,        1,      344, 0x29aa8843, F=0x0
+0,        127,        127,        1,      627, 0x6d3f18dc, F=0x0
+0,        128,        128,        1,      172, 0x985d3cc5, F=0x0
+0,        129,        129,        1,      494, 0x591cdcc3, F=0x0
+0,        130,        130,        1,      184, 0x83ca42c1, F=0x0
+0,        131,        131,        1,      352, 0x68169925, F=0x0
+0,        132,        132,        1,      351, 0x06998cfa, F=0x0
+0,        133,        133,        1,      170, 0xaec83809, F=0x0
+0,        134,        134,        1,      275, 0xd1ea6a74, F=0x0
+0,        135,        135,        1,      168, 0xe9b93a2e, F=0x0
+0,        136,        136,        1,      169, 0xa27f3870, F=0x0
+0,        137,        137,        1,      521, 0xf195dc2e, F=0x0
+0,        138,        138,        1,     1262, 0x52b34497, F=0x0
+0,        139,        139,        1,      994, 0x9d72bc25, F=0x0
+0,        140,        140,        1,      290, 0xb2c17360, F=0x0
+0,        141,        141,        1,      188, 0x2c30402b, F=0x0
+0,        142,        142,        1,      164, 0x8bb13b7a, F=0x0
+0,        143,        143,        1,      212, 0x69af44ca, F=0x0
+0,        144,        144,        1,      870, 0xebc09472, F=0x0
+0,        145,        145,        1,      635, 0x1f781aee, F=0x0
+0,        146,        146,        1,      290, 0x01a5786c, F=0x0
+0,        147,        147,        1,      211, 0xec4d5052, F=0x0
+0,        148,        148,        1,      177, 0x56db3c7b, F=0x0
+0,        149,        149,        1,      182, 0x312c3f58, F=0x0
+0,        150,        150,        1,      588, 0x9924fcca, F=0x0
+0,        151,        151,        1,      163, 0xe23a370e, F=0x0
+0,        152,        152,        1,      407, 0x525ab1a8, F=0x0
+0,        153,        153,        1,      204, 0x0b84449d, F=0x0
+0,        154,        154,        1,      290, 0xa97e7886, F=0x0
+0,        155,        155,        1,      308, 0xac988116, F=0x0
+0,        156,        156,        1,      196, 0x6d6c47fa, F=0x0
+0,        157,        157,        1,      181, 0x7a413f71, F=0x0
+0,        158,        158,        1,      203, 0xb03b4fa8, F=0x0
+0,        159,        159,        1,      227, 0xb3d55aeb, F=0x0
+0,        160,        160,        1,      524, 0xa731e285, F=0x0
+0,        161,        161,        1,      377, 0x4ac097de, F=0x0
+0,        162,        162,        1,      196, 0x78264511, F=0x0
+0,        163,        163,        1,      250, 0x6d4f65a1, F=0x0
+0,        164,        164,        1,      214, 0x31534ffe, F=0x0
+0,        165,        165,        1,      323, 0xd4d78fa2, F=0x0
+0,        166,        166,        1,      176, 0x642e40ab, F=0x0
+0,        167,        167,        1,      305, 0x63db7e18, F=0x0
+0,        168,        168,        1,      179, 0x4c4042da, F=0x0
+0,        169,        169,        1,      245, 0x645264fb, F=0x0
+0,        170,        170,        1,      181, 0x0a3e403e, F=0x0
+0,        171,        171,        1,      241, 0x592e57b1, F=0x0
+0,        172,        172,        1,      172, 0xf5cb3f7f, F=0x0
diff --git a/tests/ref/fate/gifenc-rgb8 b/tests/ref/fate/gifenc-rgb8
index c5ff394..dd1648e 100644
--- a/tests/ref/fate/gifenc-rgb8
+++ b/tests/ref/fate/gifenc-rgb8
@@ -4,175 +4,175 @@
 #dimensions 0: 217x217
 #sar 0: 0/1
 0,          0,          0,        1,     1341, 0xaa85adb1
-0,          1,          1,        1,      305, 0xa970896f, F=0x0
-0,          2,          2,        1,      446, 0x4a20d47a, F=0x0
-0,          3,          3,        1,      458, 0x32ded2af, F=0x0
-0,          4,          4,        1,      555, 0x622205e4, F=0x0
-0,          5,          5,        1,      622, 0xde06214f, F=0x0
-0,          6,          6,        1,      650, 0x8f482007, F=0x0
-0,          7,          7,        1,      668, 0xd3df3a59, F=0x0
-0,          8,          8,        1,      829, 0x812f80d4, F=0x0
-0,          9,          9,        1,     1165, 0x8e402ff5, F=0x0
-0,         10,         10,        1,      187, 0xdda45544, F=0x0
-0,         11,         11,        1,     1341, 0x2f2d71cf, F=0x0
-0,         12,         12,        1,     1646, 0xfe910a65, F=0x0
-0,         13,         13,        1,     1539, 0xbc77e727, F=0x0
-0,         14,         14,        1,     1728, 0x9bd9486b, F=0x0
-0,         15,         15,        1,     1918, 0xcf948795, F=0x0
-0,         16,         16,        1,     2132, 0x4618dbf8, F=0x0
-0,         17,         17,        1,     2256, 0xcdce2bb0, F=0x0
-0,         18,         18,        1,     2319, 0x4f1b36d7, F=0x0
-0,         19,         19,        1,     2416, 0xcba76df1, F=0x0
-0,         20,         20,        1,     2609, 0xb2eec38f, F=0x0
-0,         21,         21,        1,     2695, 0x29d40439, F=0x0
-0,         22,         22,        1,     2792, 0x663f0f16, F=0x0
-0,         23,         23,        1,     2892, 0xd6924cc1, F=0x0
-0,         24,         24,        1,     2990, 0x8bed794d, F=0x0
-0,         25,         25,        1,     3109, 0x48789f36, F=0x0
-0,         26,         26,        1,     3261, 0x3eaff7a0, F=0x0
-0,         27,         27,        1,     3337, 0x3bcd1c99, F=0x0
-0,         28,         28,        1,     3580, 0xcf0c8b7a, F=0x0
-0,         29,         29,        1,     3815, 0x53d40009, F=0x0
-0,         30,         30,        1,     2758, 0x73fd20c6, F=0x0
-0,         31,         31,        1,     4039, 0xab517451, F=0x0
-0,         32,         32,        1,     3033, 0x66d29fbc, F=0x0
-0,         33,         33,        1,     4303, 0x30e50ba8, F=0x0
-0,         34,         34,        1,     2052, 0x4843c19a, F=0x0
-0,         35,         35,        1,     3220, 0x73f7f1b7, F=0x0
-0,         36,         36,        1,     2300, 0xca376466, F=0x0
-0,         37,         37,        1,     3641, 0x1e3a9bcb, F=0x0
-0,         38,         38,        1,     3560, 0x014776da, F=0x0
-0,         39,         39,        1,     3698, 0xd3bcde35, F=0x0
-0,         40,         40,        1,     1567, 0x6c8bf458, F=0x0
-0,         41,         41,        1,      962, 0x0389caed, F=0x0
-0,         42,         42,        1,      281, 0x575f7959, F=0x0
-0,         43,         43,        1,      938, 0x2d7aaf67, F=0x0
-0,         44,         44,        1,      279, 0xd39d81d7, F=0x0
-0,         45,         45,        1,      204, 0x90a9544a, F=0x0
-0,         46,         46,        1,     4307, 0xcf9d0eae, F=0x0
-0,         47,         47,        1,     4903, 0xe9743ace, F=0x0
-0,         48,         48,        1,     4936, 0x3cf21510, F=0x0
-0,         49,         49,        1,     4949, 0xcbff5648, F=0x0
-0,         50,         50,        1,     4162, 0x94a9b9ce, F=0x0
-0,         51,         51,        1,     4686, 0x5098c461, F=0x0
-0,         52,         52,        1,     4749, 0x7304bc6d, F=0x0
-0,         53,         53,        1,     4990, 0x9d025a9f, F=0x0
-0,         54,         54,        1,     5187, 0x0566c4c9, F=0x0
-0,         55,         55,        1,     5054, 0x574f81f5, F=0x0
-0,         56,         56,        1,     5148, 0xe7bac30f, F=0x0
-0,         57,         57,        1,     4309, 0x7844f361, F=0x0
-0,         58,         58,        1,     5087, 0xacf4a406, F=0x0
-0,         59,         59,        1,     5292, 0x9e7be109, F=0x0
-0,         60,         60,        1,     5434, 0x85541f7f, F=0x0
-0,         61,         61,        1,     4653, 0xf5118b09, F=0x0
-0,         62,         62,        1,     5271, 0x54f3d911, F=0x0
-0,         63,         63,        1,     5229, 0xc520cb6b, F=0x0
-0,         64,         64,        1,     5225, 0x2a449e23, F=0x0
-0,         65,         65,        1,     5403, 0x4a2502f3, F=0x0
-0,         66,         66,        1,     5228, 0x8002e47d, F=0x0
-0,         67,         67,        1,     5712, 0x9c9ed686, F=0x0
-0,         68,         68,        1,     5644, 0xfdf5a30d, F=0x0
-0,         69,         69,        1,     5826, 0xb142ece5, F=0x0
-0,         70,         70,        1,     5771, 0xd22ac8b9, F=0x0
-0,         71,         71,        1,     6124, 0x5e4e8f58, F=0x0
-0,         72,         72,        1,     6077, 0x94ab6503, F=0x0
-0,         73,         73,        1,     5804, 0x5c56e07a, F=0x0
-0,         74,         74,        1,     6007, 0x3e453829, F=0x0
-0,         75,         75,        1,     6228, 0xa4e0b278, F=0x0
-0,         76,         76,        1,     6382, 0xd488ebcd, F=0x0
-0,         77,         77,        1,     6473, 0xb1bb78b2, F=0x0
-0,         78,         78,        1,     7027, 0x98ce29cb, F=0x0
-0,         79,         79,        1,     7263, 0xecadb896, F=0x0
-0,         80,         80,        1,     8205, 0x36cb6ba1, F=0x0
-0,         81,         81,        1,     8366, 0xdbbe8308, F=0x0
-0,         82,         82,        1,     7716, 0xd6959765, F=0x0
-0,         83,         83,        1,     7420, 0x60fd1316, F=0x0
-0,         84,         84,        1,     7549, 0x668a1ae9, F=0x0
-0,         85,         85,        1,     7956, 0xe146cb65, F=0x0
-0,         86,         86,        1,     8416, 0x47c3d590, F=0x0
-0,         87,         87,        1,     8064, 0x9a0e249f, F=0x0
-0,         88,         88,        1,     7409, 0x9e5eb771, F=0x0
-0,         89,         89,        1,     7502, 0x1906fad6, F=0x0
-0,         90,         90,        1,     7814, 0x8e117365, F=0x0
-0,         91,         91,        1,     7776, 0xd0077a82, F=0x0
-0,         92,         92,        1,     7757, 0x74a49d3a, F=0x0
-0,         93,         93,        1,     8055, 0x70ef25d2, F=0x0
-0,         94,         94,        1,     7626, 0x4a003537, F=0x0
-0,         95,         95,        1,     7987, 0x1c14c607, F=0x0
-0,         96,         96,        1,    12070, 0x4a729eba, F=0x0
-0,         97,         97,        1,    12325, 0xbff1dd34, F=0x0
-0,         98,         98,        1,    12225, 0xb1ffee58, F=0x0
-0,         99,         99,        1,    11235, 0xea998fe1, F=0x0
-0,        100,        100,        1,    11116, 0x855407b4, F=0x0
-0,        101,        101,        1,    11374, 0xaa019a67, F=0x0
-0,        102,        102,        1,    11904, 0xf8384969, F=0x0
-0,        103,        103,        1,    11487, 0xce63834d, F=0x0
-0,        104,        104,        1,    13403, 0x36444d9a, F=0x0
-0,        105,        105,        1,    12921, 0x86af447b, F=0x0
-0,        106,        106,        1,    13872, 0x104af758, F=0x0
-0,        107,        107,        1,    13559, 0x37d07d0f, F=0x0
-0,        108,        108,        1,    14049, 0xa47572e1, F=0x0
-0,        109,        109,        1,    14152, 0x217c3e45, F=0x0
-0,        110,        110,        1,    14285, 0xf37e5a5d, F=0x0
-0,        111,        111,        1,    14432, 0xd841f100, F=0x0
-0,        112,        112,        1,    14697, 0xf25cd254, F=0x0
-0,        113,        113,        1,    14606, 0x4f3069dc, F=0x0
-0,        114,        114,        1,    15221, 0x222f9680, F=0x0
-0,        115,        115,        1,    15433, 0x3e43af1c, F=0x0
-0,        116,        116,        1,    15603, 0x038a0ae1, F=0x0
-0,        117,        117,        1,    15606, 0x9040acec, F=0x0
-0,        118,        118,        1,    15871, 0xd63f0294, F=0x0
-0,        119,        119,        1,    15725, 0xe95d42ec, F=0x0
-0,        120,        120,        1,    16086, 0x27223bb4, F=0x0
-0,        121,        121,        1,    16233, 0xebfca656, F=0x0
-0,        122,        122,        1,    16143, 0x1a7717ba, F=0x0
-0,        123,        123,        1,    16669, 0x56926ea6, F=0x0
-0,        124,        124,        1,    16627, 0xe0ac5c7e, F=0x0
-0,        125,        125,        1,    16837, 0x67b5c267, F=0x0
-0,        126,        126,        1,    16952, 0x2d9bd2b7, F=0x0
-0,        127,        127,        1,    17127, 0xcab06c88, F=0x0
-0,        128,        128,        1,    17158, 0x10be3e59, F=0x0
-0,        129,        129,        1,    17329, 0x53d2ef82, F=0x0
-0,        130,        130,        1,    17403, 0x37a5ca9c, F=0x0
-0,        131,        131,        1,    17674, 0x0e34434b, F=0x0
-0,        132,        132,        1,    17738, 0xc1ef86db, F=0x0
-0,        133,        133,        1,    17942, 0xbf37caa5, F=0x0
-0,        134,        134,        1,    17952, 0x256e0aee, F=0x0
-0,        135,        135,        1,    18246, 0xd818335f, F=0x0
-0,        136,        136,        1,    18399, 0x6b84c5b2, F=0x0
-0,        137,        137,        1,    18551, 0x5e02f360, F=0x0
-0,        138,        138,        1,    18947, 0x5cdbdb83, F=0x0
-0,        139,        139,        1,    19153, 0x97f52a72, F=0x0
-0,        140,        140,        1,    19128, 0x537baaeb, F=0x0
-0,        141,        141,        1,    19138, 0xa629eee4, F=0x0
-0,        142,        142,        1,    19502, 0x4b8da41b, F=0x0
-0,        143,        143,        1,    19542, 0x21a5a87a, F=0x0
-0,        144,        144,        1,    19755, 0xc5d0c4a1, F=0x0
-0,        145,        145,        1,    20122, 0x913a698c, F=0x0
-0,        146,        146,        1,    20265, 0xfdbcdb4e, F=0x0
-0,        147,        147,        1,    20378, 0x173f3952, F=0x0
-0,        148,        148,        1,    20300, 0xff58f32f, F=0x0
-0,        149,        149,        1,    20499, 0x89246e44, F=0x0
-0,        150,        150,        1,    20655, 0xff78de6d, F=0x0
-0,        151,        151,        1,    20674, 0x9ccbc9cc, F=0x0
-0,        152,        152,        1,    21015, 0x289450a5, F=0x0
-0,        153,        153,        1,    21066, 0x006d6bc5, F=0x0
-0,        154,        154,        1,    21161, 0x306b4b03, F=0x0
-0,        155,        155,        1,    21086, 0x5c4f8181, F=0x0
-0,        156,        156,        1,    21466, 0x5be353c4, F=0x0
-0,        157,        157,        1,    21677, 0xbc05e406, F=0x0
-0,        158,        158,        1,    21589, 0xa69322d7, F=0x0
-0,        159,        159,        1,    21662, 0x64e7ac40, F=0x0
-0,        160,        160,        1,    21995, 0xbfa18826, F=0x0
-0,        161,        161,        1,    22213, 0xb9fa745d, F=0x0
-0,        162,        162,        1,    22483, 0x3070e144, F=0x0
-0,        163,        163,        1,    22498, 0x1feb3894, F=0x0
-0,        164,        164,        1,    22468, 0xb34dbd26, F=0x0
-0,        165,        165,        1,    22869, 0x67c63638, F=0x0
-0,        166,        166,        1,    22754, 0xaa2d573d, F=0x0
-0,        167,        167,        1,    23173, 0x9f7767cb, F=0x0
-0,        168,        168,        1,    23281, 0x3f319c01, F=0x0
-0,        169,        169,        1,    23219, 0xb706632d, F=0x0
-0,        170,        170,        1,    23656, 0x7e2ff143, F=0x0
-0,        171,        171,        1,    23683, 0x729d61e1, F=0x0
-0,        172,        172,        1,    23882, 0x8fb999ed, F=0x0
+0,          1,          1,        1,      236, 0xa46f676e, F=0x0
+0,          2,          2,        1,      186, 0xd99b4ec2, F=0x0
+0,          3,          3,        1,      208, 0xb9be5007, F=0x0
+0,          4,          4,        1,      282, 0xe43d8422, F=0x0
+0,          5,          5,        1,      209, 0xda215145, F=0x0
+0,          6,          6,        1,      225, 0xc6375b19, F=0x0
+0,          7,          7,        1,      204, 0x467a54c1, F=0x0
+0,          8,          8,        1,      181, 0x1c0e4dae, F=0x0
+0,          9,          9,        1,      200, 0xc55e53c1, F=0x0
+0,         10,         10,        1,      184, 0x87644454, F=0x0
+0,         11,         11,        1,      191, 0x3847484a, F=0x0
+0,         12,         12,        1,      290, 0x9ce37f1f, F=0x0
+0,         13,         13,        1,      153, 0x7ab03afc, F=0x0
+0,         14,         14,        1,      175, 0x64bc4621, F=0x0
+0,         15,         15,        1,      187, 0x9284451d, F=0x0
+0,         16,         16,        1,      418, 0x7b18c8a5, F=0x0
+0,         17,         17,        1,      200, 0xf8e5527f, F=0x0
+0,         18,         18,        1,      347, 0xbc6494eb, F=0x0
+0,         19,         19,        1,      176, 0x8d1842e5, F=0x0
+0,         20,         20,        1,      294, 0x52fe8678, F=0x0
+0,         21,         21,        1,      166, 0x614142a1, F=0x0
+0,         22,         22,        1,      306, 0xafe8850d, F=0x0
+0,         23,         23,        1,      180, 0xa2cc44a0, F=0x0
+0,         24,         24,        1,      207, 0x91e25233, F=0x0
+0,         25,         25,        1,      204, 0x0f174cb7, F=0x0
+0,         26,         26,        1,      259, 0x629071c3, F=0x0
+0,         27,         27,        1,      181, 0x950e4a15, F=0x0
+0,         28,         28,        1,      152, 0x77023d8a, F=0x0
+0,         29,         29,        1,      194, 0x890b4d08, F=0x0
+0,         30,         30,        1,      159, 0xaa5a397d, F=0x0
+0,         31,         31,        1,      162, 0x8ae73c95, F=0x0
+0,         32,         32,        1,      178, 0x7fba4974, F=0x0
+0,         33,         33,        1,      187, 0x41fd52cc, F=0x0
+0,         34,         34,        1,      336, 0xd8139332, F=0x0
+0,         35,         35,        1,      184, 0x61b3484a, F=0x0
+0,         36,         36,        1,      227, 0x8be2607e, F=0x0
+0,         37,         37,        1,      182, 0x9bc84478, F=0x0
+0,         38,         38,        1,      162, 0x33423e3c, F=0x0
+0,         39,         39,        1,      187, 0x62fd4805, F=0x0
+0,         40,         40,        1,      503, 0xfc0ce5c8, F=0x0
+0,         41,         41,        1,      167, 0x40bd40d7, F=0x0
+0,         42,         42,        1,      289, 0xe5ad805c, F=0x0
+0,         43,         43,        1,      194, 0xc0174c24, F=0x0
+0,         44,         44,        1,      285, 0x48f38060, F=0x0
+0,         45,         45,        1,      199, 0x62bd52dc, F=0x0
+0,         46,         46,        1,      197, 0xcc1f4d1d, F=0x0
+0,         47,         47,        1,      203, 0xa0cb4c90, F=0x0
+0,         48,         48,        1,      208, 0x460155cd, F=0x0
+0,         49,         49,        1,     1198, 0x0b795bb1, F=0x0
+0,         50,         50,        1,      175, 0x36cc4a76, F=0x0
+0,         51,         51,        1,      740, 0xeb6f68b9, F=0x0
+0,         52,         52,        1,      180, 0xa22544ba, F=0x0
+0,         53,         53,        1,      238, 0x08ff6b12, F=0x0
+0,         54,         54,        1,      198, 0x3d4d50dd, F=0x0
+0,         55,         55,        1,      196, 0xbef74ccd, F=0x0
+0,         56,         56,        1,      224, 0x47c05ea9, F=0x0
+0,         57,         57,        1,      765, 0xb89e6f01, F=0x0
+0,         58,         58,        1,      149, 0x26bb3969, F=0x0
+0,         59,         59,        1,      479, 0xcdd6d6bf, F=0x0
+0,         60,         60,        1,      179, 0x537948eb, F=0x0
+0,         61,         61,        1,      217, 0x6b9b5b06, F=0x0
+0,         62,         62,        1,      190, 0x56b54a3a, F=0x0
+0,         63,         63,        1,      155, 0x487439ef, F=0x0
+0,         64,         64,        1,      167, 0x1bb947ba, F=0x0
+0,         65,         65,        1,      649, 0xb44a3058, F=0x0
+0,         66,         66,        1,      196, 0x66ae5688, F=0x0
+0,         67,         67,        1,      427, 0x8b0bd38d, F=0x0
+0,         68,         68,        1,      175, 0xbb9d4294, F=0x0
+0,         69,         69,        1,      284, 0x9f768221, F=0x0
+0,         70,         70,        1,      131, 0x612d2e14, F=0x0
+0,         71,         71,        1,      256, 0x701a69b4, F=0x0
+0,         72,         72,        1,      186, 0xf7114a80, F=0x0
+0,         73,         73,        1,      190, 0x53144c4d, F=0x0
+0,         74,         74,        1,      216, 0xc67b53e5, F=0x0
+0,         75,         75,        1,      154, 0xc04e39ba, F=0x0
+0,         76,         76,        1,      113, 0x4800284b, F=0x0
+0,         77,         77,        1,      402, 0xee43b0dd, F=0x0
+0,         78,         78,        1,      198, 0x55e451cc, F=0x0
+0,         79,         79,        1,      466, 0xb3c8cff3, F=0x0
+0,         80,         80,        1,      322, 0x5ade8d02, F=0x0
+0,         81,         81,        1,      387, 0x72edb2f7, F=0x0
+0,         82,         82,        1,      158, 0x12a5402c, F=0x0
+0,         83,         83,        1,      278, 0xd6727a4a, F=0x0
+0,         84,         84,        1,      190, 0x58205087, F=0x0
+0,         85,         85,        1,      175, 0x9a58432a, F=0x0
+0,         86,         86,        1,      206, 0x85954c9e, F=0x0
+0,         87,         87,        1,      379, 0x4f1db56a, F=0x0
+0,         88,         88,        1,      202, 0x19b05154, F=0x0
+0,         89,         89,        1,      225, 0xf4166005, F=0x0
+0,         90,         90,        1,      175, 0x44414761, F=0x0
+0,         91,         91,        1,      235, 0xe01c603f, F=0x0
+0,         92,         92,        1,      185, 0xfab74905, F=0x0
+0,         93,         93,        1,      182, 0x9c5f4ae7, F=0x0
+0,         94,         94,        1,      114, 0xe0542abd, F=0x0
+0,         95,         95,        1,      176, 0x6e274c2e, F=0x0
+0,         96,         96,        1,      214, 0x44725ac3, F=0x0
+0,         97,         97,        1,      182, 0x54e9482e, F=0x0
+0,         98,         98,        1,      195, 0x6231525e, F=0x0
+0,         99,         99,        1,      303, 0xf63c84a1, F=0x0
+0,        100,        100,        1,      191, 0x4aa84e6f, F=0x0
+0,        101,        101,        1,      177, 0xfd82496d, F=0x0
+0,        102,        102,        1,      172, 0x13d041cb, F=0x0
+0,        103,        103,        1,      179, 0x89f54866, F=0x0
+0,        104,        104,        1,      188, 0xf39d4d8d, F=0x0
+0,        105,        105,        1,      177, 0x4d0e4882, F=0x0
+0,        106,        106,        1,      215, 0xca7b5a6f, F=0x0
+0,        107,        107,        1,      339, 0x1dd598fe, F=0x0
+0,        108,        108,        1,      189, 0xe2d94497, F=0x0
+0,        109,        109,        1,      209, 0x682356be, F=0x0
+0,        110,        110,        1,      205, 0xa5af51b7, F=0x0
+0,        111,        111,        1,      185, 0xa1224e22, F=0x0
+0,        112,        112,        1,      211, 0x09a95a00, F=0x0
+0,        113,        113,        1,      178, 0x31ab47cc, F=0x0
+0,        114,        114,        1,      195, 0x960f4c9c, F=0x0
+0,        115,        115,        1,      116, 0x8f8b2da3, F=0x0
+0,        116,        116,        1,      116, 0xf30c2b3d, F=0x0
+0,        117,        117,        1,      427, 0xa3dcc81b, F=0x0
+0,        118,        118,        1,      182, 0xce37489b, F=0x0
+0,        119,        119,        1,      267, 0x516c6f3e, F=0x0
+0,        120,        120,        1,      191, 0xff5c4af7, F=0x0
+0,        121,        121,        1,      195, 0x49cd5178, F=0x0
+0,        122,        122,        1,      755, 0xb9b4608d, F=0x0
+0,        123,        123,        1,      179, 0x6d0c4600, F=0x0
+0,        124,        124,        1,      522, 0xffe5f236, F=0x0
+0,        125,        125,        1,      171, 0xea4c40b8, F=0x0
+0,        126,        126,        1,      379, 0xbf2fa98b, F=0x0
+0,        127,        127,        1,      539, 0xace2f7b5, F=0x0
+0,        128,        128,        1,      199, 0xe0534e3d, F=0x0
+0,        129,        129,        1,      458, 0x2b54d13e, F=0x0
+0,        130,        130,        1,      177, 0x6ff04b91, F=0x0
+0,        131,        131,        1,      299, 0x51d1893e, F=0x0
+0,        132,        132,        1,      333, 0x5cba941f, F=0x0
+0,        133,        133,        1,      179, 0x2381453b, F=0x0
+0,        134,        134,        1,      263, 0xac907176, F=0x0
+0,        135,        135,        1,      177, 0xb87546d9, F=0x0
+0,        136,        136,        1,      184, 0x761c4765, F=0x0
+0,        137,        137,        1,      433, 0x55f0c2d6, F=0x0
+0,        138,        138,        1,     1138, 0x3b7137a0, F=0x0
+0,        139,        139,        1,      863, 0x5afd9dae, F=0x0
+0,        140,        140,        1,      328, 0x4537973f, F=0x0
+0,        141,        141,        1,      222, 0xadb859e4, F=0x0
+0,        142,        142,        1,      171, 0x7ce844b6, F=0x0
+0,        143,        143,        1,      222, 0xa5815a1f, F=0x0
+0,        144,        144,        1,      738, 0x3fe75c6a, F=0x0
+0,        145,        145,        1,      444, 0x320fd03e, F=0x0
+0,        146,        146,        1,      267, 0x288273f3, F=0x0
+0,        147,        147,        1,      187, 0x07594c67, F=0x0
+0,        148,        148,        1,      186, 0xbd1c50de, F=0x0
+0,        149,        149,        1,      196, 0xf3e14fdb, F=0x0
+0,        150,        150,        1,      589, 0x127314a0, F=0x0
+0,        151,        151,        1,      188, 0x22d74d85, F=0x0
+0,        152,        152,        1,      339, 0xcadaa1b6, F=0x0
+0,        153,        153,        1,      179, 0x6a1843a7, F=0x0
+0,        154,        154,        1,      294, 0xe04184fa, F=0x0
+0,        155,        155,        1,      291, 0x4b018587, F=0x0
+0,        156,        156,        1,      144, 0x470f3737, F=0x0
+0,        157,        157,        1,      182, 0x3b994dcd, F=0x0
+0,        158,        158,        1,      195, 0x7f884fd3, F=0x0
+0,        159,        159,        1,      268, 0xb6097b3b, F=0x0
+0,        160,        160,        1,      526, 0x40e0fd27, F=0x0
+0,        161,        161,        1,      372, 0x9dffaa6d, F=0x0
+0,        162,        162,        1,      171, 0xc06841eb, F=0x0
+0,        163,        163,        1,      344, 0xc47da473, F=0x0
+0,        164,        164,        1,      159, 0xacf64002, F=0x0
+0,        165,        165,        1,      391, 0x520cad43, F=0x0
+0,        166,        166,        1,      180, 0x05c04cac, F=0x0
+0,        167,        167,        1,      303, 0x748493c3, F=0x0
+0,        168,        168,        1,      180, 0x3fc54928, F=0x0
+0,        169,        169,        1,      269, 0xcd227967, F=0x0
+0,        170,        170,        1,      199, 0x3a3053e8, F=0x0
+0,        171,        171,        1,      287, 0x3c37840b, F=0x0
+0,        172,        172,        1,      217, 0xabd063fc, F=0x0
