#Can someone explain how to use the LZ77 grid and encode?

9 messages · Page 1 of 1 (latest)

thorny thicket
#

I’m trying to understand how to do LZ77 compression using the 16×16 grid. I’ve read through my notes and looked at examples but I’m still confused about how to actually fill in the table. I have tried following examples but I dont understand how to apply them to my own grid

Could someone please walk me through the first couple of steps or explain what I should be doing for when filling the table?

I’m not asking for anyone to do it for me, I just want to understand the process properly

Thanks!

drowsy stirrupBOT
kind hare
#

You might be using a different notation for the triple, but normally you have some offset, length, and object.

#

I found an example online,
a b a b c b a b a b a
(0,0,a), (0,0,b), (2,2,c)
The (0,0,a) and (0,0,b) are clearly just that object, a and b respectfully without anything else

#

(offset, length, next object)

#

Offset is 2 (2,2,c) ( meaning 2 backwards from the position you are in, which is a), then the length is 2 (2,2,c) which means that there should be two objects ( starting from the offset and going forward ), then the ending object is c (2,2,c)

#

If you have a set with a lot of repeats ( like in your chart )
A A A A A A B B B A A A A A A A ( line 1 )

You can see this as 6 A's, then 3 B's, then another 6 A's, pretty easily you can encode
(0,0,A)
(A)
Then do (1,5,B) -> ( A A A A A B )
(A A A A A A B )
Then you can do (1,2,A) -> (B B A )
( If the length is longer than the sequence your offset is at then it just repeats )
(A A A A A A B B B A)
then (1,4,A) -> ( A A A A A )
(A A A A A A B B B A A A A A A )

#

If you need anything else make sure to ask!!

thorny thicket