Re: [mkgmap-dev] [mkgmap-svn] Commit r572: MDR16 is some kind of codebook.

2021-12-21 Thread Ticker Berkin
Hi Gerd

That's great. 

I don't have any maps with compression/Mdr16 or Mdr30-3.
http://gis.19327.n8.nabble.com no longer seems to work for me.
I found possible links to maps at:
http://www.garniak.pl/viewtopic.php?f=9&t=398
but interesting links were dead or went to generic page.

I suspect the #bytes after the delta for each level might be related to
the size of Mdr15 or some bits in byte 0/4/5/6 and related to letter
frequency count.

I didn't notice a different length sequence (6 or 5) starting at byte 4
in the mdr sections you sent (benelix, topo_d_v3 and the original)

I puzzled over the values before the level 5 data and couldn't see a
way of working out how many there were and what they might mean. The
benelux map is confusing because it is 0b 16 0b 16 0b. 

It is going to be interesting when re-generating this to find out how
much of all the unknown or redundant information is required by the
Garmin software!

Ticker


On Tue, 2021-12-21 at 16:49 +, Gerd Petermann wrote:
> 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


___
mkgmap-dev mailing list
mkgmap-dev@lists.mkgmap.org.uk
https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev


Re: [mkgmap-dev] [mkgmap-svn] Commit r572: MDR16 is some kind of codebook.

2021-12-21 Thread Gerd Petermann
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