1. Trang chủ
  2. » Công Nghệ Thông Tin

Mã nén Lecture_4 DictionaryMethods

44 314 2
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Mã nén

1Data CompressionLecture 4Dictionary MethodsAlexander Kolesnikov 2Dictionary based methods• Statistical compression methods use a statistical model of the data, and the quality of compression they achieve depends on how good that model is. • Dictionary-based method do not use statistical model of data. Instead they select strings of symbols and encode each string as a token using a dictionary.• The dictionary holds strings of symbols and it may be static or dynamic (adaptive). • To encode text one can use a (static) dictionary of the English (Finnish, etc.) language.• What about images? 3Dictionary-based methods: Main idea• Encoder: As the input is processed, develop a dictionary and transmit the index of strings found in the dictionary• Decoder: As the code is processed, reconstruct the dictionary to invert the process of encoding 4Dictionary-based methods: History• 1977: LZ77 [Lempel, Ziv] * 1982: LZSS [Storer, Szymanski] * LZR, LZH, etc. * Gzip, PKZip, LHarc, Zoo for files * PNG image format• 1978: LZ78 [Lempel, Ziv] * 1984: LZW [Welch] algorithm * GIF image format * V.42bis data compression standard for modems 5LZ77 – Giới thiệuLZ77 được Jacov Ziv và Abraham Lempel đưa ra vào năm 1977. LZ77 là một thuật toán nén dựa trên từ điển. Thuật toán:Sử dụng một con trỏ dịch chuyển trên xâu kí tự đầu vào. Ban đầu con trỏ trỏ vào vị trí 1. Qui ước: từ con trỏ trở về trước được gọi là quá khứ, còn từ con trỏ trở về sau được gọi là tương lai. Tránh trường hợp quá khứ dài vô tận người ta đặt kích thước của cửa sổ quá khứ là w bằng số kí tự dài nhất có thể trùng khớp với các kí tự trong tương lai. 6LZ77 – thuật toán nénPos - là vị trí đang xét. Ban đầu Pos bằng 1. Match – xâu dài nhất được tìm thấy trong cửa sổ. Char – kí tự vừa đọc. Output - thể hiện trong dạng (i, j) C: (i,j) thể hiện vị trí so khớp và độ dài xâu tương ứngC kí tự rõ trong buffer. 7LZ77: Example 1 sir_sid_eastman_easily_teases_sea_sick_seals . search bufferlook-ahead buffersir_sid_eastman_ ⇒ (0,0,’s’) sir_sid_eastman_e ⇒ (0,0,’i’) sir_sid_eastman_ea ⇒ (0,0,’r’) sir_sid_eastman_eas ⇒ (0,0,’_’) sir_sid_eastman_easi ⇒ (4,2,’d’) 8LZ77: DecodingCodes: (0, 0,’s’) (0,0,’i’) (0,0,’r’) (0,0,’_’) (4,2,’d’) Message:1. (0, 0,’s’): s2. (0,0,’i’): s+i=si3. (0,0,’r’): si+r=sir4. (0,0,’_’): sir+_=sir_5. (4,2,’d’): sir_+si+d=sir_sidGet 2 symbols ’si’ starting from position -4 and add symbol ’d’ 9LZ77: Example 2 10LZ77: Example 3 [...]... encoder add new entries to the Dictionary during the message encoding • The decoder decode codes using Dictionary and add new entries to the Dictionary during decoding 14 LZ78- Thuật toán nén 15 LZ78-Thuật toán giải nén 16 LZ78-Example 1 17 LZW: Encoding algorithm Initialize Dictionary with alphabet STRING = get input character WHILE there are still input characters DO CHAR = get input character IF STRING+CHAR...LZ77: Example 4 11 LZSS – Thuật toán nén Pos - vị trí đang xét Ban đầu Pos trỏ đến kí tự đầu tiên và bằng 1 Match - xâu dài nhất tìm thấy trong cửa sổ quá khứ Output - hiển thị kết quả ở một trong 2 tình huống sau:   Cặp (i,j) vị trí so . s+i=si3. (0,0,’r’): si+r=sir4. (0,0,’_’): sir+_=sir_5. (4, 2,’d’): sir_+si+d=sir_sidGet 2 symbols ’si’ starting from position -4 and add symbol ’d’ . PNG image format• 1978: LZ78 [Lempel, Ziv] * 19 84: LZW [Welch] algorithm * GIF image format * V .42 bis data compression standard for modems 5LZ77

Ngày đăng: 13/11/2012, 17:09

Xem thêm: Mã nén Lecture_4 DictionaryMethods

TỪ KHÓA LIÊN QUAN

TÀI LIỆU CÙNG NGƯỜI DÙNG

TÀI LIỆU LIÊN QUAN