comparison tools/lib64gfx.h @ 1660:7555c8803529

More work on improving the generic RLE decoder/encoder.
author Matti Hamalainen <ccr@tnsp.org>
date Wed, 30 May 2018 17:05:19 +0300
parents 9233da9de92c
children 1741717b1ae5
comparison
equal deleted inserted replaced
1659:99b8ab61dc1b 1660:7555c8803529
212 DM_COMP_RLE_MASK = 2, // RLE that has marker bits and lower part acts as run length 212 DM_COMP_RLE_MASK = 2, // RLE that has marker bits and lower part acts as run length
213 }; 213 };
214 214
215 enum 215 enum
216 { 216 {
217 DM_RLE_8BIT_RUNS = 0x0001, // Uses one-byte runs 217 DM_RLE_BYTE_RUNS = 0x0001, // Uses one-byte run lengths
218 DM_RLE_16BIT_RUNS = 0x0002, // Uses two-byte runs 218 DM_RLE_WORD_RUNS = 0x0002, // Uses two-byte (word) run lengths
219 DM_RLE_RUNS_MASK = 0x000f, 219 DM_RLE_RUNS_MASK = 0x000f,
220 220
221 DM_RLE_ORDER_1 = 0x0000, // Order: <marker>, <count/run length>, <data> 221 DM_RLE_ORDER_1 = 0x0000, // Order: <marker>, <count/run length>, <data>
222 DM_RLE_ORDER_2 = 0x0010, // Order: <marker>, <data>, <count/run length> 222 DM_RLE_ORDER_2 = 0x0010, // Order: <marker>, <data>, <count/run length>
223 DM_RLE_ORDER_MASK = 0x00f0, 223 DM_RLE_ORDER_MASK = 0x00f0,
227 typedef struct 227 typedef struct
228 { 228 {
229 int type; 229 int type;
230 int flags; 230 int flags;
231 Uint8 231 Uint8
232 rleMarker1, rleMarker2, 232 // DM_COMP_RLE_MARKER mode
233 rleMask1, rleMask2, 233 rleMarkerB, // Marker byte for byte length runs (if DM_RLE_BYTE_RUNS used)
234 rleMinCount, rleMaxCount; 234 rleMarkerW, // Marker byte for word length runs (if DM_RLE_WORD_RUNS used)
235
236 // DM_COMP_RLE_MASK mode
237 rleMarkerBits,
238 rleMarkerMask, // Mask bits for marker: data & rleMarkerMask == rleMarkerBits
239 rleCountMask; // Mask bits for length: count = data & rleCountMask
240
241 int
242 // Minimum and maximum run lengths
243 rleMinCountB,
244 rleMinCountW,
245 rleMaxCountB,
246 rleMaxCountW;
235 } DMCompParams; 247 } DMCompParams;
236 248
237 249
238 // 250 //
239 // Global variables 251 // Global variables