Информатика 1 курс / Раздаточный материал
.docАлгоритм RLE (Run-Length Encoding)
1 – белый; 2 – черный.
Каждый цвет кодируется одним байтом
До сжатия – 100 байт.
После сжатия: 52 байта:
1;10; 1;3;2;4;1;3; 1;2;2;6;1;2; 1;1;2;8;1;1; 1;1;2;8;1;1; 1;1;2;8;1;1; 1;1;2;8;1;1; 1;2;2;6;1;2; 1;3;2;4;1;3; 1;10
Степень сжатия – 52/100 (52%)
Алгоритм KWE (KeyWord Encoding)
… License Option. The specific rights, restrictions, and obligations under which Licensee may use a Program pursuant to this Agreement, including the applicable Addendum. By accepting a Program during the Acceptance Period, Licensee also accepts the applicable rights and agrees to be bound by the applicable obligations and restrictions of the License Option purchased …
До сжатия ≈ 374 байта.
После сжатия ≈ 106 байт
Степень сжатия ≈ 106/374 (28%) (для приведенного фрагмента)
Алгоритм Хаффмана
Пример кодирования русского алфавита
Например:
слово СОР:
до сжатия – 3 байта (24 бита);
после сжатия: 00010001000111 (14 бит)
С O P
степень сжатия ≈ 14/24 (58%)