Hi Ticker,
looks good.
With your hints I was able to write a patch for MdrDisplay
that seems able to decode compressed mdr15 for my
maps which have mdr 16 section.
Maybe you have another map...
It also changes some details for mdr 30/31 and 32/33.
Open problem is the length of the gap between the end of data for the 6th level
and the first bytes for level 5 (prefix 0b).
I see either 7 or 12 or 5 bytes. Check the code that calculdates value for
variable skip.
The values might not at all depend on the depth of the tree.
Code is not at all optimized, it just started to work for me.
Lots of bytes in MDR 16 are ignored.
Gerd
Von: mkgmap-dev im Auftrag von Gerd
Petermann
Gesendet: Montag, 20. Dezember 2021 11:29
An: Development list for mkgmap
Betreff: Re: [mkgmap-dev] [mkgmap-svn]Commit r572: MDR16 is
somekindof codebook.
Hi Ticker,
yes, with your theory I found errors in my code. Here's the corrected version
// depth 3, prefix 0x07
addHuffmanNode("111", 'A');
// depth 4, prefix 0x09
addHuffmanNode("0111", '\0'); // 0x00
addHuffmanNode("1000", ' '); //0x20
addHuffmanNode("1001", 'E');
addHuffmanNode("1010", 'N');
addHuffmanNode("1011", 'O');
addHuffmanNode("1100", 'I');
addHuffmanNode("1101", 'R');
// depth 5, prefix 0x0b
addHuffmanNode("00101", 'C');
addHuffmanNode("00110", 'S');
addHuffmanNode("00111", 'D');
addHuffmanNode("01000", 'T');
addHuffmanNode("01001", 'M');
addHuffmanNode("01010", 'V');
addHuffmanNode("01011", 'J');
addHuffmanNode("01100", 'K');
addHuffmanNode("01101", 'L');
// depth 6
addHuffmanNode("000101", 'G');
addHuffmanNode("000110", 'Z');
addHuffmanNode("000111", 'U');
addHuffmanNode("001000", 'P');
addHuffmanNode("001001", 'B');
// depth 7
addHuffmanNode("110", 'H');
addHuffmanNode("111", '1');
addHuffmanNode("0001000", '2');
addHuffmanNode("0001001", '.');
// depth 8
addHuffmanNode("0011", '5');
addHuffmanNode("0100", '6');
addHuffmanNode("0101", '-');
addHuffmanNode("0110", '7');
addHuffmanNode("0111", '3');
addHuffmanNode("1000", '8');
addHuffmanNode("1001", '9');
addHuffmanNode("1010", '0');
addHuffmanNode("1011", '4');
// depth 9
addHuffmanNode("00010", 'F');
addHuffmanNode("00011",',');
addHuffmanNode("00100", '(');
addHuffmanNode("00101", ')');
// depth 10
addHuffmanNode("11", '*');
// depth 11
addHuffmanNode("011", 'Y');
addHuffmanNode("100", '"');
addHuffmanNode("101", (char) 0x06); //
non-print4
// depth 12
addHuffmanNode("0011", 'W');
addHuffmanNode("0100", 'X');
addHuffmanNode("0101", (char) 0x05);
//non-print some shield code
// depth 13
addHuffmanNode("00100", '&');
addHuffmanNode("00101", (char) 0x1f);
//non-print2
// depth 14
addHuffmanNode("11", 'Q');
addHuffmanNode("000100", 'Š');
addHuffmanNode("000101", '\''); //
mdr16 says 0x8a