LZS无损压缩encoder
发布时间:
1>>>>Encode
Algorithm1Encode>>>>algorithm1:procedureEncode2:whileinputdataexistsdo3:>>>>Readbyte4:ifthereisnomatchingpatterninthe>>>>historybuffertheextractlymatchesthesourcepaterninthe>>>>holdingbuffer,thatalsosatisfilesthecon-ditionthatoffsetless2047then5:>>>>Outputtoken6:endif7:endwhile8:Flush
9:end>>>>procedure
1
2>>>>Read>>>>byte
Algorithm2>>>>Readbyte>>>>algorithm1:procedure>>>>Readbyte2:Get8-bitfromtheinputstream3:Insertbyteinto>>>>historybuffer4:Insertbyteinto>>>>holdingbuffer5:end>>>>procedure
2
3>>>>Output>>>>>token
Algorithm3>>>>Outputtoken>>>>algorithm1:procedure>>>>Outputtoken2:ifnumberofbytesin>>>>hodlingbuffer≤2then3:Putsingle0bittooutputbitstream4:Putoldestbytein>>>>holdingbufferto