logo separator

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

From Ticker Berkin rwb-mkgmap at jagit.co.uk on Thu Dec 23 14:56:21 GMT 2021

Hi Gerd

Maybe the "is always 8" is the character width.

I think I understand parts of it.

Read 5 bits and look up, giving 2 bytes.
if first 3/5/6/9/b the final char in the second byte and return (b-
first)/2 to the bit stream. Otherwise the combination somehow indicate
a minimum number of more bits to read and where to start searching.
maybe the 'struct for level' 1 or 2 bytes is a bit flag of which levels
to look in. I notice (in topo_fr) it is normally a single or adjacent
bits except for 0xa, but there are no chars at level 19

prefix 0 doesn't quite follow the rules

Ticker


On Thu, 2021-12-23 at 09:40 +0000, Gerd Petermann wrote:
> Hi Ticker,
> 
> ouch, didn't even read that one :(  Would have saved me a lot
> of time as my first idea was a "jump table".
> Attached is the new patch and the corrected mdr16 outputs produced
> with this patch.
> 
> So, besides the fields with ??? the only open question is the meaning
> of the struct bytes in the first table.
> I guess it will become clear when I try to use the lookup table in
> the decoder.
> 
> Gerd
> 
> 
> ________________________________________
> Von: mkgmap-dev <mkgmap-dev-bounces at lists.mkgmap.org.uk> im Auftrag
> von Ticker Berkin <rwb-mkgmap at jagit.co.uk>
> Gesendet: Donnerstag, 23. Dezember 2021 09:31
> An: Development list for mkgmap
> Betreff: Re: [mkgmap-dev]       [mkgmap-svn]    Commit  r572:  
> MDR16   is      some    kind    of      codebook.
> 
> Hi Gerd
> 
> I guessed that it was the \0 that cut the file off.
> 
> You mean something like answer 5 here:
> 
> https://stackoverflow.com/questions/759707/efficient-way-of-storing-huffman-tree
> 
> 
> I looked at this earlier trying to work out if it was relevant but
> didn't make it fit - I should have tried harder.
> 
> I still haven't spotted anything to determine the length of the 2 /3
> byte in before and in the struct for {length}
> 
> Ticker
> 
> On Thu, 2021-12-23 at 01:17 +0000, Gerd Petermann wrote:
> > Hi Ticker,
> > 
> > sorry, just noticed that something went wrong with copy&paste
> > because
> > of the \0 character.
> > Anyway, I think I understand the meaning of the part with the
> > prefixes.
> > I assume that Garmin reads the first 5 bits and uses this value as
> > an
> > index into a table
> > which directly follows the first array. This 2nd table is a 32x2
> > lookup
> > table, where the 2nd byte gives the value
> > and the first byte some kind of status info which is used to
> > position
> > the bit reader.
> > This would explain the repeating characters. Something like this:
> > 
> > --------- MDR 16 (decompression codebook Huffman tree) ------------
> > ----
> > ---------
> > 000002b6 | 000000 | 4a                      | ???
> 
> 
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev
> _______________________________________________
> mkgmap-dev mailing list
> mkgmap-dev at lists.mkgmap.org.uk
> https://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev




More information about the mkgmap-dev mailing list