aboutsummaryrefslogtreecommitdiff
path: root/README.org
diff options
context:
space:
mode:
authorLibravatar Martin Michalec <martin@michalec.dev>2026-11-07 02:33:00 +0000
committerLibravatar Martin Michalec <martin@michalec.dev>2026-11-07 02:38:20 +0000
commit795a8ecaf5656d299139e2c41fab19573bdac0c6 (patch)
tree9d0529ad1abd7959256b139b2c9c6b7fa3e72e07 /README.org
downloadlab-00-795a8ecaf5656d299139e2c41fab19573bdac0c6.tar.gz
publishHEADmaster
Diffstat (limited to 'README.org')
-rw-r--r--README.org80
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]
51. 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.
112. Encode the information using the RLE algorithm. Decode the
12 information, determine the compression ratio. Programmatically
13 verify that the decoding occurred correctly.
143. 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
18Alphabet: *{ й, ё, п, в, о, д, space, 0-9, &, . }*
19
20Algorithm: *LZW*
21
22* Documentation
23Sadly, there is no report for this lab.
24
25* Showcase
26
27#+begin_src text
28Generating data...
29Generated: 1480044 bytes
30
31LZW encode/decode...
32Coding cost: 3.05
33Encoded into: 588393 bytes
34Compression coefficent (out/in): 0.39
35Files ./out/data.txt and ./out/data-enc-lzw-dec-lzw.txt are identical
36
37RLE encode/decode...
38Encoded into: 1087997 bytes
39Compression coefficent (out/in): 0.73
40Files ./out/data.txt and ./out/data-enc-rle-dec-rle.txt are identical
41
42LZW-RLE encode/decode...
43Encoded into: 1001594 bytes
44Compression coefficent (out/in): 0.67
45Files ./out/data-enc-lzw.bin and ./out/data-enc-lzw-brle-dec-brle.bin are identical
46
47RLE-LZW encode/decode...
48Encoded into: 609561 bytes
49Compression coefficent (out/in): 0.41
50Files ./out/data-enc-rle.txt and ./out/data-enc-rle-lzw-dec-lzw.txt are identical
51
52LZW 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
631. Случайно сгенерировать файл в 10 тысяч символов, используя
64 указанный алфавит (заглавные и строчные буквы). Закодировать
65 текстовую информацию, используя указанный в задании
66 алгоритм. Определить цену кодирования. Декодировать информацию,
67 определить коэффициент сжатия. Программно проверить, что
68 декодирование произошло верно.
692. Закодировать информацию алгоритмом RLE. Декодировать информацию,
70 определить коэффициент сжатия. Программно проверить, что
71 декодирование произошло верно.
723. Аналогично пункту 2 закодировать информацию, применив
73 двухступенчатое кодирование (RLE + алгоритм варианта и алгоритм
74 варианта + RLE). Показать, какой из способов более эффективный.
75
76Алфавит: *{ й, ё, п, в, о, д, пробел, 0-9, &, . }*
77
78Алгоритм: *LZW*
79#+end_quote
80#+HTML: </i>