Hi Ticker, OK, I've committed your patch as is. The (my) code in makeShortestBitStream() was already hard to read, maybe you find a better way to handle the backup/restore tricks of xSameSign and ySameSign?
Gerd ________________________________________ Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag von Ticker Berkin <rwb-mkg...@jagit.co.uk> Gesendet: Donnerstag, 8. April 2021 18:03 An: Development list for mkgmap Betreff: Re: [mkgmap-dev] Polyline base optimisation Hi Gerd It needs to know if there are deltas < 0, deltas > 0, and number of bits to represent the largest delta, regardless of sign. If all the deltas were, say between 10..20, max=20 is significant, but min=10 is of no relevance; only if it was < 0 would it have an effect. Ticker On Thu, 2021-04-08 at 15:45 +0000, Gerd Petermann wrote: > Hi Ticker, > > my understanding is that it is looking for the largest and the > smallest delta value. It is possible to have a smallest value > 0. > It probably doesn't matter because of the way how xBtits and yBits is > calculated but I still think that your version is even more > confusing. > > Gerd > > ________________________________________ > Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag > von Ticker Berkin <rwb-mkg...@jagit.co.uk> > Gesendet: Donnerstag, 8. April 2021 17:34 > An: Development list for mkgmap > Betreff: Re: [mkgmap-dev] Polyline base optimisation > > Hi Gerd > > I could have changed it to this, but it is looking for lowest val <= > 0 > and highest val >= 0 so 0 seemed the better choice. > > The slight improvement is because it gives up after 2 tries that > don't > show improvement, and before, for unsigned, one of these tries was > wasted. > > Ticker > > On Thu, 2021-04-08 at 15:11 +0000, Gerd Petermann wrote: > > Hi Ticker, > > > > Funny, I would have used Integer.MinValue for maxDx/maxDy to make > > it > > less confusing. > > Do you have an explanation for the change in size? My understanding > > is that your patch just skips a test which will never find a better > > encoding? > > > > Gerd > > > > ________________________________________ > > Von: mkgmap-dev <mkgmap-dev-boun...@lists.mkgmap.org.uk> im Auftrag > > von Ticker Berkin <rwb-mkg...@jagit.co.uk> > > Gesendet: Donnerstag, 8. April 2021 13:58 > > An: mkgmap development > > Betreff: [mkgmap-dev] Polyline base optimisation > > > > Hi Gerd > > > > If starting with unsigned deltas in polyline encoding, and > > attempting > > to reduce the length by testing reduced x/yBase values, there isn't > > any > > point in testing Base-1, as the normal number of bits will be the > > same > > (added sign bit) and there will be some overflows. > > > > Patch attached to change this - it gives me a very slight reduction > > in > > RGN size and might give a performance improvement (I didn't detect > > any). > > > > I've also fixed a couple of log. logic errors and changed minDx/y > > initial to 0, which is much less confusing because they are > > symmetric > > with maxDx/y which do use 0. > > > > Ticker > > _______________________________________________ > > mkgmap-dev mailing list > > mkgmap-dev@lists.mkgmap.org.uk > > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@lists.mkgmap.org.uk > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev > _______________________________________________ > mkgmap-dev mailing list > mkgmap-dev@lists.mkgmap.org.uk > http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev _______________________________________________ mkgmap-dev mailing list mkgmap-dev@lists.mkgmap.org.uk http://www.mkgmap.org.uk/mailman/listinfo/mkgmap-dev