diff options
| author | 2026-11-07 02:33:00 +0000 | |
|---|---|---|
| committer | 2026-11-07 02:38:20 +0000 | |
| commit | 795a8ecaf5656d299139e2c41fab19573bdac0c6 (patch) | |
| tree | 9d0529ad1abd7959256b139b2c9c6b7fa3e72e07 /README.org | |
| download | lab-00-795a8ecaf5656d299139e2c41fab19573bdac0c6.tar.gz | |
Diffstat (limited to 'README.org')
| -rw-r--r-- | README.org | 80 |
1 files changed, 80 insertions, 0 deletions
diff --git a/README.org b/README.org new file mode 100644 index 0000000..8d3b9a7 --- /dev/null +++ b/README.org | |||
| @@ -0,0 +1,80 @@ | |||
| 1 | #+title: LZW and RLE Text Compression | ||
| 2 | #+subtitle: with Two-Step Pipeline Analysis | ||
| 3 | |||
| 4 | * Task[fn:1] | ||
| 5 | 1. Randomly generate a file of 10,000 characters using the specified | ||
| 6 | alphabet (uppercase and lowercase letters). Encode the text | ||
| 7 | information using the algorithm specified in the task. Determine | ||
| 8 | the encoding cost. Decode the information, determine the | ||
| 9 | compression ratio. Programmatically verify that the decoding was | ||
| 10 | performed correctly. | ||
| 11 | 2. Encode the information using the RLE algorithm. Decode the | ||
| 12 | information, determine the compression ratio. Programmatically | ||
| 13 | verify that the decoding occurred correctly. | ||
| 14 | 3. Similarly to point 2, encode the information using two-step | ||
| 15 | encoding (RLE + variant algorithm and algorithm option + RLE). | ||
| 16 | Show which method is more effective. | ||
| 17 | |||
| 18 | Alphabet: *{ й, ё, п, в, о, д, space, 0-9, &, . }* | ||
| 19 | |||
| 20 | Algorithm: *LZW* | ||
| 21 | |||
| 22 | * Documentation | ||
| 23 | Sadly, there is no report for this lab. | ||
| 24 | |||
| 25 | * Showcase | ||
| 26 | |||
| 27 | #+begin_src text | ||
| 28 | Generating data... | ||
| 29 | Generated: 1480044 bytes | ||
| 30 | |||
| 31 | LZW encode/decode... | ||
| 32 | Coding cost: 3.05 | ||
| 33 | Encoded into: 588393 bytes | ||
| 34 | Compression coefficent (out/in): 0.39 | ||
| 35 | Files ./out/data.txt and ./out/data-enc-lzw-dec-lzw.txt are identical | ||
| 36 | |||
| 37 | RLE encode/decode... | ||
| 38 | Encoded into: 1087997 bytes | ||
| 39 | Compression coefficent (out/in): 0.73 | ||
| 40 | Files ./out/data.txt and ./out/data-enc-rle-dec-rle.txt are identical | ||
| 41 | |||
| 42 | LZW-RLE encode/decode... | ||
| 43 | Encoded into: 1001594 bytes | ||
| 44 | Compression coefficent (out/in): 0.67 | ||
| 45 | Files ./out/data-enc-lzw.bin and ./out/data-enc-lzw-brle-dec-brle.bin are identical | ||
| 46 | |||
| 47 | RLE-LZW encode/decode... | ||
| 48 | Encoded into: 609561 bytes | ||
| 49 | Compression coefficent (out/in): 0.41 | ||
| 50 | Files ./out/data-enc-rle.txt and ./out/data-enc-rle-lzw-dec-lzw.txt are identical | ||
| 51 | |||
| 52 | LZW encoding is the most efficient | ||
| 53 | #+end_src | ||
| 54 | |||
| 55 | * Unlicense | ||
| 56 | #+include: UNLICENSE verse | ||
| 57 | |||
| 58 | * Footnotes | ||
| 59 | |||
| 60 | [fn:1] Original text: | ||
| 61 | #+HTML: <i> | ||
| 62 | #+begin_quote | ||
| 63 | 1. Случайно сгенерировать файл в 10 тысяч символов, используя | ||
| 64 | указанный алфавит (заглавные и строчные буквы). Закодировать | ||
| 65 | текстовую информацию, используя указанный в задании | ||
| 66 | алгоритм. Определить цену кодирования. Декодировать информацию, | ||
| 67 | определить коэффициент сжатия. Программно проверить, что | ||
| 68 | декодирование произошло верно. | ||
| 69 | 2. Закодировать информацию алгоритмом RLE. Декодировать информацию, | ||
| 70 | определить коэффициент сжатия. Программно проверить, что | ||
| 71 | декодирование произошло верно. | ||
| 72 | 3. Аналогично пункту 2 закодировать информацию, применив | ||
| 73 | двухступенчатое кодирование (RLE + алгоритм варианта и алгоритм | ||
| 74 | варианта + RLE). Показать, какой из способов более эффективный. | ||
| 75 | |||
| 76 | Алфавит: *{ й, ё, п, в, о, д, пробел, 0-9, &, . }* | ||
| 77 | |||
| 78 | Алгоритм: *LZW* | ||
| 79 | #+end_quote | ||
| 80 | #+HTML: </i> | ||
