Limit match length?

37 views
Skip to first unread message

ashra ivy

unread,
Oct 3, 2022, 6:42:12 AM10/3/22
to LZ4c
Is there a way to limit the match lenght? For example to MINMATCH+15+255?
This would allow get rid of the loop for the length.
Cheers 42Bastian

Yann Collet

unread,
Oct 3, 2022, 11:19:35 AM10/3/22
to lz...@googlegroups.com
Unfortunately, when it comes to the existing reference implementation at github.com/lz4/lz4 ,
there is no build macro available to limit match length.

I can guess how such a limitation could simplify a tiny asm decoder implementation,
but this limitation would also come at the cost of both compression ratio and decompression speed for the "general" case.


--
Vous recevez ce message, car vous êtes abonné au groupe Google Groupes "LZ4c".
Pour vous désabonner de ce groupe et ne plus recevoir d'e-mails le concernant, envoyez un e-mail à l'adresse lz4c+uns...@googlegroups.com.
Cette discussion peut être lue sur le Web à l'adresse https://groups.google.com/d/msgid/lz4c/83f1273d-fff4-4ded-bc1e-b85c962c5ca0n%40googlegroups.com.

ashra ivy

unread,
Oct 3, 2022, 12:00:23 PM10/3/22
to LZ4c
I understand, but do you see any chance/a place where I could add such. Of course, some post-processing could check the compressed files and choose a simplified decompressor.
Anyway, thanks for the reply.
42Bastian

Yann Collet

unread,
Oct 3, 2022, 4:46:07 PM10/3/22
to LZ4c
Presuming you are mostly interested in the LZ4 HC variant, for asymmetric compression scenarios,
you could have a loot at the function `LZ4HC_encodeSequence()`,

That's where a sequence (literals + match) is encoded in the LZ4 format.
You could use this one place to cut a long match into multiple smaller ones.
Only LZ4 HC variants would be impacted though.

ashra ivy

unread,
Oct 4, 2022, 9:56:16 AM10/4/22
to LZ4c
Thanks for the hint.
Though I think, this is too late to interfere.
But meanwhile I checked my decompressors and it won't save much to remove the loop.
Cheers
Reply all
Reply to author
Forward
0 new messages