Done more testings. Well, with optimal parsing this LZ77 should surely outperform current LZPM. Currently I've made an additional experiments with LZ77.
Check out this simple LZSS decoder:
Code:
procedure decompress;
asm
pushad
cld
lea esi,src
lea edi,dst
mov ecx,size
mov ebx,2
@@1:
shr ebx,1
cmp ebx,1
jne @@2
movzx ebx,byte ptr[esi]
add esi,1
add ebx,256
@@2:
test ebx,1
je @@3
lea eax,[esi+2]
movzx esi,word ptr[esi]
mov edx,ecx
mov ecx,esi
and esi,4095
add esi,1
neg esi
add esi,edi
shr ecx,12
add ecx,3
sub edx,ecx
rep movsb
mov esi,eax
mov ecx,edx
jmp @@4
@@3:
movsb
add ecx,-1
@@4:
test ecx,ecx
jne @@1
popad
end;
The decoder needs no extra memory, no variables used - all fits in register set. It is a standard LZSS with 4KB window, match/literal flags are coded using tags (one byte represents eight flags).
I believe that many things in this ASM source done cleverly. I think this one is mostly better than others in this category.
This scheme has nice compression and can compete with LZOP and similar stuff. The decompression speed should be crazy... 