본문 바로가기

LZ77 알고리즘 LZ77 알고리즘 (LZ77 Encoding): LZ77알고리즘은 사전 방식 ( Dictionary methods )을 채택한다. 즉, 반복적으로 나오는 문자열을 압축한다. zip, gzip, pkzip 등에서 사용되는 압축 알고리즘이다.다른 알고리즘과 결합되어 deflate 방식 등으로 사용된다. Pseudo-Code 는 다음과 같다.1 begin2 fill view from input3 while (view not empty) do4 begin5 find longest prefix p of view starting in coded part6 i = position of p in window7 j = length of p8 x = first char after p in view9 output( i , ..
Deflate 알고리즘 Deflate 알고리즘: zip, gzip 등의 프로그램에서 압축방식으로 사용하는 알고리즘. Deflate 알고리즘은 LZ77 알고리즘과 허프만 부호화 알고리즘이 결합된 압축방식이다. 그림으로 설명하면 다음과 같다. 1. Data가 있다. 2. 먼저 LZ77알고리즘을 통해 압축하여 LLD블럭들이 나온다. 3. 이 LLD들을 가지고 허프만 부호화 알고리즘을 거친다. 4. deflate 압축 완료.
ZIP Archive file format [ ZIP Archive file format ]: https://en.wikipedia.org/wiki/Zip_(file_format): https://users.cs.jmu.edu/buchhofp/forensics/formats/pkzip.html [ 구성도 ] ZIP Archive 포맷 구조는 위 그림과 같다. [ Local file header + Data + Data descriptor ] 가 한 세트를 이루어 파일별로 쭉 쓰인다.Data descriptor는 Optional한 헤더로 Flag의 3번째 비트(0x08자리)가 set 된 경우에만 추가되고, 보통은 header+data가 한 세트이다. Central directory file header는 Local file header의 확장으로,..