Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱦ. ȼɚɬɨɥɢɧ, Ⱥ. Ɋɚɬɭɲɧɹɤ, Ɇ. ɋɦɢɪɧɨɜ, ȼ. ɘɤɢɧ
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ Ɋɚɡɞɟɥ 1 ɋɨɞɟɪɠɚɧɢɟ ɤɧɢɝɢ: ȼɜɟɞɟɧɢɟ Ɋɚɡɞɟɥ 1. ɍɧɢɜɟɪɫɚɥɶɧɵɟ ɦɟɬɨɞɵ ɫɠɚɬɢɹ Ɋɚɡɞɟɥ 2. Ⱥɥɝɨɪɢɬɦɵ ɫɠɚɬɢɹ ɢɡɨɛɪɚɠɟɧɢɣ Ɋɚɡɞɟɥ 3. Ⱥɥɝɨɪɢɬɦɵ ɫɠɚɬɢɹ ɜɢɞɟɨ ɉɪɢɥɨɠɟɧɢɟ 1 ɉɪɢɥɨɠɟɧɢɟ 2
Ⱦɚɬɚ ɫɨɡɞɚɧɢɹ ɮɚɣɥɚ: 05.01.2003 22
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɊȺɁȾȿɅ 1. ɆȿɌɈȾɕ ɋɀȺɌɂə ȻȿɁ ɉɈɌȿɊɖ....................................................... 25 Ƚɥɚɜɚ 1. Ʉɨɞɢɪɨɜɚɧɢɟ ɢɫɬɨɱɧɢɤɨɜ ɞɚɧɧɵɯ ɛɟɡ ɩɚɦɹɬɢ ............................................. 27 Ƚɥɚɜɚ 2. Ʉɨɞɢɪɨɜɚɧɢɟ ɢɫɬɨɱɧɢɤɨɜ ɞɚɧɧɵɯ ɬɢɩɚ «ɚɧɚɥɨɝɨɜɵɣ ɫɢɝɧɚɥ» ................... 28 Ʌɢɧɟɣɧɨ-ɩɪɟɞɫɤɚɡɵɜɚɸɳɟɟ ɤɨɞɢɪɨɜɚɧɢɟ ............................................................... 28 ɋɭɛɩɨɥɨɫɧɨɟ ɤɨɞɢɪɨɜɚɧɢɟ ........................................................................................ 44 Ƚɥɚɜɚ 3. ɋɥɨɜɚɪɧɵɟ ɦɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ .............................................................. 57 ɂɞɟɹ ɫɥɨɜɚɪɧɵɯ ɦɟɬɨɞɨɜ ......................................................................................... 57 Ʉɥɚɫɫɢɱɟɫɤɢɟ ɚɥɝɨɪɢɬɦɵ Ɂɢɜɚ-Ʌɟɦɩɟɥɚ ................................................................ 60 Ⱦɪɭɝɢɟ ɚɥɝɨɪɢɬɦɵ LZ............................................................................................... 76 Ɏɨɪɦɚɬ Deflate......................................................................................................... 82 ɉɭɬɢ ɭɥɭɱɲɟɧɢɹ ɫɠɚɬɢɹ ɞɥɹ ɦɟɬɨɞɨɜ LZ............................................................. 97 Ⱥɪɯɢɜɚɬɨɪɵ ɢ ɤɨɦɩɪɟɫɫɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɚɥɝɨɪɢɬɦɵ LZ .............................. 110 ȼɨɩɪɨɫɵ ɞɥɹ ɫɚɦɨɤɨɧɬɪɨɥɹ ................................................................................... 111 Ʌɢɬɟɪɚɬɭɪɚ ............................................................................................................ 113 ɋɩɢɫɨɤ ɚɪɯɢɜɚɬɨɪɨɜ ɢ ɤɨɦɩɪɟɫɫɨɪɨɜ ................................................................... 114 Ƚɥɚɜɚ 4. Ɇɟɬɨɞɵ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ....................................................... 114 Ʉɥɚɫɫɢɮɢɤɚɰɢɹ ɫɬɪɚɬɟɝɢɣ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ......................................................... 118 Ʉɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ ................................................................................ 120 Ⱥɥɝɨɪɢɬɦɵ PPM ..................................................................................................... 130 Ɉɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ ................................................................................... 144 Ɉɛɧɨɜɥɟɧɢɟ ɫɱɟɬɱɢɤɨɜ ɫɢɦɜɨɥɨɜ ........................................................................... 158 ɉɨɜɵɲɟɧɢɟ ɬɨɱɧɨɫɬɢ ɨɰɟɧɨɤ ɜ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ ɜɵɫɨɤɢɯ ɩɨɪɹɞɤɨɜ....... 160 Ɋɚɡɥɢɱɧɵɟ ɫɩɨɫɨɛɵ ɩɨɜɵɲɟɧɢɹ ɬɨɱɧɨɫɬɢ ɩɪɟɞɫɤɚɡɚɧɢɹ ................................... 166 PPM ɢ PPM*............................................................................................................ 173 Ⱦɨɫɬɨɢɧɫɬɜɚ ɢ ɧɟɞɨɫɬɚɬɤɢ PPM ........................................................................ 174 Ʉɨɦɩɪɟɫɫɨɪɵ ɢ ɚɪɯɢɜɚɬɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɤɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ...... 177 Ɉɛɡɨɪ ɤɥɚɫɫɢɱɟɫɤɢɯ ɚɥɝɨɪɢɬɦɨɜ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ....................... 186 ɋɪɚɜɧɟɧɢɟ ɚɥɝɨɪɢɬɦɨɜ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ....................................... 191 Ⱦɪɭɝɢɟ ɦɟɬɨɞɵ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ.................................................... 192 ȼɨɩɪɨɫɵ ɞɥɹ ɫɚɦɨɤɨɧɬɪɨɥɹ ................................................................................... 193 Ʌɢɬɟɪɚɬɭɪɚ ............................................................................................................ 194 ɋɩɢɫɨɤ ɚɪɯɢɜɚɬɨɪɨɜ ɢ ɤɨɦɩɪɟɫɫɨɪɨɜ ................................................................... 196 Ƚɥɚɜɚ 5. ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ.............................................................. 198 ȼɜɟɞɟɧɢɟ................................................................................................................... 198 ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ........................................................................ 199 Ɇɟɬɨɞɵ, ɢɫɩɨɥɶɡɭɟɦɵɟ ɫɨɜɦɟɫɬɧɨ ɫ BWT ........................................................... 212 ɋɩɨɫɨɛɵ ɫɠɚɬɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɫ ɩɨɦɨɳɶɸ BWT ɞɚɧɧɵɯ ........................... 230 ɋɨɪɬɢɪɨɜɤɚ, ɢɫɩɨɥɶɡɭɟɦɚɹ ɜ BWT......................................................................... 240 Ⱥɪɯɢɜɚɬɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ BWT ɢ ST ................................................................. 251 Ɂɚɤɥɸɱɟɧɢɟ .............................................................................................................. 260 Ʌɢɬɟɪɚɬɭɪɚ ............................................................................................................ 260 Ƚɥɚɜɚ 6. Ɉɛɨɛɳɟɧɧɵɟ ɦɟɬɨɞɵ ɫɨɪɬɢɪɭɸɳɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ............................... 263
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
23
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɋɨɪɬɢɪɨɜɤɚ ɩɚɪɚɥɥɟɥɶɧɵɯ ɛɥɨɤɨɜ ........................................................................ 263 Ɏɪɚɝɦɟɧɬɢɪɨɜɚɧɢɟ................................................................................................. 276 Ƚɥɚɜɚ 7. ɉɪɟɞɜɚɪɢɬɟɥɶɧɚɹ ɨɛɪɚɛɨɬɤɚ ɞɚɧɧɵɯ .......................................................... 287 ɉɪɟɩɪɨɰɟɫɫɢɧɝ ɬɟɤɫɬɨɜ ......................................................................................... 288 ɉɪɟɩɪɨɰɟɫɫɢɧɝ ɧɟɬɟɤɫɬɨɜɵɯ ɞɚɧɧɵɯ ................................................................... 307 ȼɨɩɪɨɫɵ ɞɥɹ ɫɚɦɨɤɨɧɬɪɨɥɹ ................................................................................... 315 Ʌɢɬɟɪɚɬɭɪɚ ............................................................................................................ 315 ȼɵɛɨɪ ɦɟɬɨɞɚ ɫɠɚɬɢɹ................................................................................................. 316 ɍɄȺɁȺɌȿɅɖ ɌȿɊɆɂɇɈȼ ........................................................................................ 321
24
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ƚɥɚɜɚ 5. ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚɍɢɥɟɪɚ ȼɜɟɞɟɧɢɟ ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɪɢɦɟɧɹɟɬɫɹ ɜ ɚɥɝɨɪɢɬɦɚɯ ɫɠɚɬɢɹ ɤɚɱɟɫɬɜɟɧɧɵɯ ɞɚɧɧɵɯ. Ⱦɥɹ ɷɮɮɟɤɬɢɜɧɨɝɨ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɧɟɨɛɯɨɞɢɦɨ, ɱɬɨɛɵ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɞɚɧɧɵɯ ɫɨɨɬɜɟɬɫɬɜɨɜɚɥɢ ɦɨɞɟɥɢ ɢɫɬɨɱɧɢɤɚ ɫ ɩɚɦɹɬɶɸ. Ʉɚɤ ɢ ɦɧɨɝɢɟ ɞɪɭɝɢɟ ɩɪɢɦɟɧɹɟɦɵɟ ɜ ɚɥɝɨɪɢɬɦɚɯ ɫɠɚɬɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɪɟɞɧɚɡɧɚɱɟɧɨ ɞɥɹ ɬɨɝɨ, ɱɬɨɛɵ ɫɞɟɥɚɬɶ ɫɠɚɬɢɟ ɞɚɧɧɵɯ ɜɯɨɞɧɨɝɨ ɛɥɨɤɚ ɛɨɥɟɟ ɷɮɮɟɤɬɢɜɧɵɦ. ɉɨɫɪɟɞɫɬɜɨɦ ɩɟɪɟɫɬɚɧɨɜɤɢ ɷɥɟɦɟɧɬɨɜ ɞɚɧɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɩɪɟɜɪɚɳɚɟɬ ɜɯɨɞɧɨɣ ɛɥɨɤ ɞɚɧɧɵɯ ɫɨ ɫɥɨɠɧɵɦɢ ɡɚɜɢɫɢɦɨɫɬɹɦɢ ɜ ɛɥɨɤ, ɫɬɪɭɤɬɭɪɭ ɤɨɬɨɪɨɝɨ ɦɨɞɟɥɢɪɨɜɚɬɶ ɝɨɪɚɡɞɨ ɥɟɝɱɟ, ɩɪɢɱɟɦ ɨɬɨɛɪɚɠɟɧɢɟ ɩɪɨɢɫɯɨɞɢɬ ɛɟɡ ɩɨɬɟɪɶ ɢɧɮɨɪɦɚɰɢɢ. ɗɬɨɬ ɦɟɬɨɞ ɩɨɹɜɢɥɫɹ ɫɪɚɜɧɢɬɟɥɶɧɨ ɧɟɞɚɜɧɨ. ȼɩɟɪɜɵɟ ɨɧ ɛɵɥ ɨɩɭɛɥɢɤɨɜɚɧ 10 ɦɚɹ 1994 ɝɨɞɚ ɜ ɫɬɚɬɶɟ “A Block-sorting Lossless Data Compression Algorithm” [13]. Ⱥɜɬɨɪɚɦɢ ɦɟɬɨɞɚ ɹɜɥɹɸɬɫɹ Ⱦɷɜɢɞ ɍɢɥɟɪ ɢ Ɇɚɣɤ Ȼɚɪɪɨɭɡ. ɉɪɢɱɟɦ, ɩɟɪɜɵɣ ɢɡ ɧɢɯ ɩɪɢɞɭɦɚɥ ɷɬɨɬ ɦɟɬɨɞ ɟɳɟ ɜ 1983 ɝɨɞɭ, ɤɨɝɞɚ ɪɚɛɨɬɚɥ ɜ ɤɨɦɩɚɧɢɢ AT&T Bell Laboratories. ɇɨ, ɜɢɞɢɦɨ, ɥɢɛɨ ɬɨɝɞɚ ɧɟ ɩɪɢɞɚɥ ɡɧɚɱɟɧɢɹ ɫɜɨɟɦɭ ɨɬɤɪɵɬɢɸ, ɥɢɛɨ ɩɨɫɱɢɬɚɥ ɱɪɟɡɦɟɪɧɵɦɢ ɬɪɟɛɨɜɚɧɢɹ ɤ ɜɵɱɢɫɥɢɬɟɥɶɧɵɦ ɪɟɫɭɪɫɚɦ. ɉɨ ɢɦɟɧɢ ɚɜɬɨɪɨɜ, ɚɥɝɨɪɢɬɦ ɛɵɥ ɧɚɡɜɚɧ «ɉɪɟɨɛɪɚɡɨɜɚɧɢɟɦ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ» (“Burrows-Wheeler Transform”, ɞɚɥɟɟ BWT). Ɇɟɬɨɞ ɛɵɥ ɨɛɴɹɜɥɟɧ ɤɨɦɩɪɨɦɢɫɫɧɵɦ ɦɟɠɞɭ ɛɵɫɬɪɵɦɢ ɫɥɨɜɚɪɧɵɦɢ ɚɥɝɨɪɢɬɦɚɦɢ, ɫ ɨɞɧɨɣ ɫɬɨɪɨɧɵ, ɢ ɫɬɚɬɢɫɬɢɱɟɫɤɢɦɢ ɚɥɝɨɪɢɬɦɚɦɢ, ɞɚɸɳɢɦɢ ɛɨɥɟɟ ɫɢɥɶɧɨɟ ɫɠɚɬɢɟ, ɧɨ ɦɚɥɨɩɪɢɦɟɧɢɦɵɦɢ ɜ ɬɨ ɜɪɟɦɹ ɧɚ ɩɪɚɤɬɢɤɟ, ɫ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ. Ȼɥɚɝɨɞɚɪɹ ɬɚɤɢɦ ɫɜɨɣɫɬɜɚɦ ɨɩɢɫɵɜɚɟɦɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɫɬɚɥɨ ɞɨɜɨɥɶɧɨ ɩɨɩɭɥɹɪɧɵɦ ɢ ɫɪɟɞɢ ɪɚɡɪɚɛɨɬɱɢɤɨɜ ɚɪɯɢɜɚɬɨɪɨɜ, ɢ ɫɪɟɞɢ ɧɚɭɱɧɵɯ ɪɚɛɨɬɧɢɤɨɜ. ɍɠɟ ɨɩɭɛɥɢɤɨɜɚɧɨ ɛɨɥɟɟ ɫɨɬ198 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɧɢ ɫɬɚɬɟɣ ɧɚ ɪɚɡɧɵɯ ɹɡɵɤɚɯ, ɩɨɫɜɹɳɟɧɧɵɯ ɷɬɨɦɭ ɦɟɬɨɞɭ, ɢ ɧɚɩɢɫɚɧɨ ɫɬɨɥɶɤɨ ɠɟ ɩɪɨɝɪɚɦɦ, ɟɝɨ ɪɟɚɥɢɡɭɸɳɢɯ.
ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ Ʉɚɤ ɭɠɟ ɭɤɚɡɵɜɚɥɨɫɶ, ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɪɟɞɧɚɡɧɚɱɟɧɨ ɞɥɹ ɬɨɝɨ, ɱɬɨɛɵ ɩɪɟɨɛɪɚɡɨɜɚɬɶ ɜɯɨɞɧɨɣ ɛɥɨɤ ɜ ɛɨɥɟɟ ɭɞɨɛɧɵɣ ɞɥɹ ɫɠɚɬɢɹ ɜɢɞ. ɉɪɢɱɟɦ, ɤɚɤ ɩɨɤɚɡɵɜɚɟɬ ɩɪɚɤɬɢɤɚ, ɩɨɥɭɱɟɧɧɵɣ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɛɥɨɤ ɨɛɵɱɧɵɟ ɦɟɬɨɞɵ ɫɠɢɦɚɸɬ ɧɟ ɬɚɤ ɷɮɮɟɤɬɢɜɧɨ, ɤɚɤ ɦɟɬɨɞɵ, ɫɩɟɰɢɚɥɶɧɨ ɞɥɹ ɷɬɨɝɨ ɪɚɡɪɚɛɨɬɚɧɧɵɟ. ɉɨɷɬɨɦɭ ɧɟɥɶɡɹ ɪɚɫɫɦɚɬɪɢɜɚɬɶ ɨɩɢɫɵɜɚɟɦɵɣ ɚɥɝɨɪɢɬɦ ɨɬɞɟɥɶɧɨ ɨɬ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɯ ɫɩɟɰɢɮɢɱɟɫɤɢɯ ɦɟɬɨɞɨɜ ɤɨɞɢɪɨɜɚɧɢɹ ɞɚɧɧɵɯ. ȼ ɨɪɢɝɢɧɚɥɶɧɨɣ ɫɬɚɬɶɟ ɛɵɥɚ ɩɪɟɞɥɨɠɟɧɚ, ɤɚɤ ɨɞɧɚ ɢɡ ɜɨɡɦɨɠɧɵɯ ɪɟɚɥɢɡɚɰɢɣ ɫɠɚɬɢɹ ɧɚ ɨɫɧɨɜɟ BWT, ɫɨɜɨɤɭɩɧɨɫɬɶ ɢɡ ɬɪɟɯ ɚɥɝɨɪɢɬɦɨɜ: • ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, • ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Move-To-Front (ɢɡɜɟɫɬɧɨɟ ɜ ɪɭɫɫɤɨɹɡɵɱɧɨɣ ɥɢɬɟɪɚɬɭɪɟ ɤɚɤ ɩɟɪɟɦɟɳɟɧɢɟ ɫɬɨɩɤɢ ɤɧɢɝ), • ɫɬɚɬɢɫɬɢɱɟɫɤɢɣ ɤɨɞɟɪ ɞɥɹ ɫɠɚɬɢɹ ɞɚɧɧɵɯ, ɩɨɥɭɱɟɧɧɵɯ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɝɨ ɩɪɢɦɟɧɟɧɢɹ ɞɜɭɯ ɜɵɲɟɭɩɨɦɹɧɭɬɵɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ. Ⱦɚɥɶɧɟɣɲɢɟ ɢɫɫɥɟɞɨɜɚɧɢɹ ɩɨɤɚɡɚɥɢ, ɱɬɨ ɜɬɨɪɨɟ ɢɡ ɩɟɪɟɱɢɫɥɟɧɧɵɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ ɧɟ ɹɜɥɹɟɬɫɹ ɧɟɨɛɯɨɞɢɦɵɦ ɢ ɦɨɠɟɬ ɛɵɬɶ ɡɚɦɟɧɟɧɨ ɚɥɶɬɟɪɧɚɬɢɜɧɵɦ. ɂɥɢ ɞɚɠɟ ɢɫɤɥɸɱɟɧɨ ɜɨɜɫɟ ɡɚ ɫɱɟɬ ɭɫɥɨɠɧɟɧɢɹ ɤɨɞɢɪɭɸɳɟɣ ɮɚɡɵ. ȼɩɪɨɱɟɦ, ɟɳɟ ɫɚɦɢ ɚɜɬɨɪɵ BWT ɭɩɨɦɢɧɚɥɢ ɨ ɬɚɤɨɣ ɜɨɡɦɨɠɧɨɫɬɢ. ɂɬɚɤ, ɧɚɱɧɟɦ ɫ ɨɩɢɫɚɧɢɹ ɝɥɚɜɧɨɣ ɫɨɫɬɚɜɥɹɸɳɟɣ ɱɚɫɬɢ ɩɪɨɰɟɫɫɚ ɫɠɚɬɢɹ ɞɚɧɧɵɯ ɩɪɢ ɩɨɦɨɳɢ ɦɟɬɨɞɨɜ ɧɚ ɨɫɧɨɜɟ BWT — ɫ ɫɚɦɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. ɉɪɟɠɞɟ ɜɫɟɝɨ, ɫɥɟɞɭɟɬ ɨɬɦɟɬɢɬɶ ɨɞɧɭ ɢɡ ɟɝɨ ɨɫɨɛɟɧɧɨɫɬɟɣ. Ɉɧ ɨɩɟɪɢɪɭɟɬ ɫɪɚɡɭ ɰɟɥɵɦ ɛɥɨɤɨɦ ɞɚɧɧɵɯ. Ɍɨ ɟɫɬɶ, ɟɦɭ ɡɚɪɚɧɟɟ ɢɡɜɟɫɬɧɵ ɫɪɚɡɭ ɜɫɟ ɷɥɟɦɟɧɬɵ ɜɯɨɞɧɨɝɨ ɩɨɬɨɤɚ ɢɥɢ, ɩɨ ɤɪɚɣɧɟɣ ɦɟɪɟ, ɞɨɫɬɚɬɨɱɧɨ ɛɨɥɶɲɨɝɨ ɛɥɨɤɚ. ɗɬɨ ɞɟɥɚɟɬ ɡɚɬɪɭɞɧɢɬɟɥɶɧɵɦ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɚɥɝɨɪɢɬɦɚ ɜ ɬɟɯ ɨɛɥɚɫɬɹɯ ɩɪɢɦɟɧɟɧɢɹ, ɝɞɟ ɬɪɟɛɭɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 199 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɟɬɫɹ ɫɠɚɬɢɟ ɞɚɧɧɵɯ «ɧɚ ɥɟɬɭ», ɫɢɦɜɨɥ ɡɚ ɫɢɦɜɨɥɨɦ. ȼ ɷɬɨɦ ɨɬɧɨɲɟɧɢɢ BWT ɞɚɠɟ ɛɨɥɟɟ ɬɪɟɛɨɜɚɬɟɥɟɧ, ɱɟɦ ɦɟɬɨɞɵ ɫɟɦɟɣɫɬɜɚ LZ77, ɢɫɩɨɥɶɡɭɸɳɢɟ ɞɥɹ ɫɠɚɬɢɹ ɫɤɨɥɶɡɹɳɟɟ ɨɤɧɨ. ɋɥɟɞɭɟɬ ɨɬɦɟɬɢɬɶ, ɱɬɨ ɜɨɡɦɨɠɧɚ ɪɟɚɥɢɡɚɰɢɹ ɫɠɚɬɢɹ ɞɚɧɧɵɯ ɧɚ ɨɫɧɨɜɟ BWT, ɨɛɪɚɛɚɬɵɜɚɸɳɚɹ ɞɚɧɧɵɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨ ɩɨ ɫɢɦɜɨɥɚɦ, ɚ ɧɟ ɩɨ ɛɥɨɤɚɦ. ɇɨ ɫɤɨɪɨɫɬɧɵɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɩɪɨɝɪɚɦɦ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɬɚɤɭɸ ɪɟɚɥɢɡɚɰɢɸ, ɛɭɞɭɬ ɨɱɟɧɶ ɞɚɥɟɤɢ ɨɬ ɫɨɜɟɪɲɟɧɫɬɜɚ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɦɵ ɩɪɢɲɥɢ ɤ ɩɟɪɜɨɣ ɢ ɫɚɦɨɣ ɥɟɝɤɨɣ ɢɡ ɮɚɡ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ — ɤ ɜɵɞɟɥɟɧɢɸ ɢɡ ɧɟɩɪɟɪɵɜɧɨɝɨ ɩɨɬɨɤɚ ɛɥɨɤɚ ɞɚɧɧɵɯ. Ⱦɟ-ɮɚɤɬɨ ɨɩɢɫɵɜɚɬɶ BWT ɫɬɚɥɨ ɩɪɢɧɹɬɨ ɫ ɩɨɦɨɳɶɸ ɩɪɢɦɟɪɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɫɬɪɨɤɢ ɫɢɦɜɨɥɨɜ “ɚɛɪɚɤɚɞɚɛɪɚ”. Ⱦɚɥɟɟ, ɧɭɠɧɨ ɢɡ ɩɨɥɭɱɟɧɧɨɝɨ ɛɥɨɤɚ ɞɚɧɧɵɯ ɫɨɡɞɚɬɶ ɦɚɬɪɢɰɭ ɜɫɟɯ ɜɨɡɦɨɠɧɵɯ ɟɝɨ ɰɢɤɥɢɱɟɫɤɢɯ ɩɟɪɟɫɬɚɧɨɜɨɤ. ɉɟɪɜɨɣ ɫɬɪɨɤɨɣ ɦɚɬɪɢɰɵ ɛɭɞɟɬ ɢɫɯɨɞɧɚɹ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ, ɜɬɨɪɨɣ ɫɬɪɨɤɨɣ — ɨɧɚ ɠɟ, ɫɞɜɢɧɭɬɚɹ ɧɚ ɨɞɢɧ ɫɢɦɜɨɥ ɜɥɟɜɨ ɢ ɬ.ɞ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɩɨɥɭɱɢɦ ɫɥɟɞɭɸɳɭɸ ɦɚɬɪɢɰɭ: ɚɛɪɚɤɚɞɚɛɪɚ ɛɪɚɤɚɞɚɛɪɚɚ ɪɚɤɚɞɚɛɪɚɚɛ ɚɤɚɞɚɛɪɚɚɛɪ ɤɚɞɚɛɪɚɚɛɪɚ ɚɞɚɛɪɚɚɛɪɚɤ ɞɚɛɪɚɚɛɪɚɤɚ ɚɛɪɚɚɛɪɚɤɚɞ ɛɪɚɚɛɪɚɤɚɞɚ ɪɚɚɛɪɚɤɚɞɚɛ ɚɚɛɪɚɤɚɞɚɛɪ Ɋɢɫ. 5.1. Ɇɧɨɠɟɫɬɜɨ ɰɢɤɥɢɱɟɫɤɢɯ ɩɟɪɟɫɬɚɧɨɜɨɤ ɫɬɪɨɤɢ “ɚɛɪɚɤɚɞɚɛɪɚ” ɉɨɦɟɬɢɦ ɜ ɷɬɨɣ ɦɚɬɪɢɰɟ ɢɫɯɨɞɧɭɸ ɫɬɪɨɤɭ ɢ ɨɬɫɨɪɬɢɪɭɟɦ ɜɫɟ ɫɬɪɨɤɢ ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢɦ ɩɨɪɹɞɤɨɦ ɫɢɦɜɨɥɨɜ. Ȼɭɞɟɦ ɫɱɢɬɚɬɶ, ɱɬɨ ɨɞɧɚ ɫɬɪɨɤɚ ɞɨɥɠɧɚ ɧɚɯɨɞɢɬɶɫɹ ɜ ɦɚɬ200 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɪɢɰɟ ɜɵɲɟ ɞɪɭɝɨɣ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɟɫɥɢ ɜ ɫɚɦɨɣ ɥɟɜɨɣ ɢɡ ɩɨɡɢɰɢɣ, ɧɚɱɢɧɚɹ ɫ ɤɨɬɨɪɨɣ ɫɬɪɨɤɢ ɨɬɥɢɱɚɸɬɫɹ, ɜ ɷɬɨɣ ɫɬɪɨɤɟ ɧɚɯɨɞɢɬɫɹ ɫɢɦɜɨɥ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢ ɦɟɧɶɲɢɣ, ɱɟɦ ɭ ɞɪɭɝɨɣ ɫɬɪɨɤɢ. Ⱦɪɭɝɢɦɢ ɫɥɨɜɚɦɢ, ɫɥɟɞɭɟɬ ɨɬɫɨɪɬɢɪɨɜɚɬɶ ɫɢɦɜɨɥɵ ɫɧɚɱɚɥɚ ɩɨ ɩɟɪɜɨɦɭ ɫɢɦɜɨɥɭ, ɡɚɬɟɦ ɫɬɪɨɤɢ, ɭ ɤɨɬɨɪɵɯ ɩɟɪɜɵɟ ɫɢɦɜɨɥɵ ɪɚɜɧɵ, — ɩɨ ɜɬɨɪɨɦɭ ɢ ɬ.ɞ. 0 1 2 3 4 5 6 7 8 9 10
ɚɚɛɪɚɤɚɞɚɛɪ ɚɛɪɚɚɛɪɚɤɚɞ ɚɛɪɚɤɚɞɚɛɪɚ — ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ ɚɞɚɛɪɚɚɛɪɚɤ ɚɤɚɞɚɛɪɚɚɛɪ ɛɪɚɚɛɪɚɤɚɞɚ ɛɪɚɤɚɞɚɛɪɚɚ ɞɚɛɪɚɚɛɪɚɤɚ ɤɚɞɚɛɪɚɚɛɪɚ ɪɚɚɛɪɚɤɚɞɚɛ ɪɚɤɚɞɚɛɪɚɚɛ
Ɋɢɫ. 5.2. Ɇɚɬɪɢɰɚ ɰɢɤɥɢɱɟɫɤɢɯ ɩɟɪɟɫɬɚɧɨɜɨɤ ɫɬɪɨɤɢ “ɚɛɪɚɤɚɞɚɛɪɚ”, ɨɬɫɨɪɬɢɪɨɜɚɧɧɚɹ ɫɥɟɜɚ ɧɚɩɪɚɜɨ ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢɦ ɩɨɪɹɞɤɨɦ ɫɢɦɜɨɥɨɜ ɟɟ ɫɬɪɨɤ Ɍɟɩɟɪɶ ɨɫɬɚɥɫɹ ɩɨɫɥɟɞɧɢɣ ɲɚɝ — ɜɵɩɢɫɚɬɶ ɫɢɦɜɨɥɵ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ ɢ ɡɚɩɨɦɧɢɬɶ ɧɨɦɟɪ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɫɪɟɞɢ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɯ. ɂɬɚɤ, “ɪɞɚɤɪɚɚɚɚɛɛ”,2 — ɷɬɨ ɪɟɡɭɥɶɬɚɬ, ɩɨɥɭɱɟɧɧɵɣ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ. Ɍɟɩɟɪɶ ɧɚɦ ɨɫɬɚɥɨɫɶ ɫɞɟɥɚɬɶ «ɜɫɟɝɨ» ɬɪɢ ɜɟɳɢ: 1) ɞɨɤɚɡɚɬɶ, ɱɬɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɨɛɪɚɬɢɦɨ, 2) ɩɨɤɚɡɚɬɶ, ɱɬɨ ɨɧɨ ɧɟ ɬɪɟɛɭɟɬ ɨɝɪɨɦɧɨɝɨ ɤɨɥɢɱɟɫɬɜɚ ɪɟɫɭɪɫɨɜ, 3) ɱɬɨ ɨɧɨ ɩɨɥɟɡɧɨ ɞɥɹ ɩɨɫɥɟɞɭɸɳɟɝɨ ɫɠɚɬɢɹ.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 201 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɍɩɪɚɠɧɟɧɢɟ: ɉɪɨɞɟɥɚɣɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɫɬɪɨɤɢ “ɤɚɪɚɛɚɫ”. ȾɈɄȺɁȺɌȿɅɖɋɌȼɈ ɈȻɊȺɌɂɆɈɋɌɂ ɉɊȿɈȻɊȺɁɈȼȺɇɂə ȻȺɊɊɈɍɁȺɍɂɅȿɊȺ
ȼɨɡɦɨɠɧɨ, Ⱦɷɜɢɞ ɍɢɥɟɪ ɧɟ ɨɩɭɛɥɢɤɨɜɚɥ ɨɩɢɫɚɧɢɟ ɚɥɝɨɪɢɬɦɚ ɜ 1983 ɝɨɞɭ ɩɨɬɨɦɭ, ɱɬɨ ɟɦɭ ɫɚɦɨɦɭ ɩɨɤɚɡɚɥɨɫɶ ɫɬɪɚɧɧɵɦ, ɱɬɨ ɦɨɠɧɨ ɜɨɫɫɬɚɧɨɜɢɬɶ ɧɚɱɚɥɶɧɭɸ ɫɬɪɨɤɭ ɢɡ ɫɬɨɥɶ ɫɢɥɶɧɨ ɩɟɪɟɦɟɲɚɧɧɵɯ ɦɟɠɞɭ ɫɨɛɨɣ ɫɢɦɜɨɥɨɜ. ɇɨ, ɬɚɤ ɢɥɢ ɢɧɚɱɟ, ɷɬɨ ɧɟ ɮɨɤɭɫ ɢ ɨɛɪɚɬɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɞɟɣɫɬɜɢɬɟɥɶɧɨ ɜɨɡɦɨɠɧɨ. ɉɭɫɬɶ ɧɚɦ ɢɡɜɟɫɬɧɵ ɬɨɥɶɤɨ ɪɟɡɭɥɶɬɚɬ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɬ.ɟ. ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɟɰ ɦɚɬɪɢɰɵ, ɢ ɧɨɦɟɪ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ. Ɋɚɫɫɦɨɬɪɢɦ ɩɪɨɰɟɫɫ ɜɨɫɫɬɚɧɨɜɥɟɧɢɹ ɢɫɯɨɞɧɨɣ ɦɚɬɪɢɰɵ. Ⱦɥɹ ɷɬɨɝɨ ɨɬɫɨɪɬɢɪɭɟɦ ɜɫɟ ɫɢɦɜɨɥɵ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ. 0 1 2 3 4 5 6 7 8 9 10
ɚ ɚ ɚ ɚ ɚ ɛ ɛ ɞ ɤ ɪ ɪ
Ɋɢɫ. 5.3. Ɉɬɫɨɪɬɢɪɨɜɚɧɧɵɟ ɫɢɦɜɨɥɵ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɇɚɦ ɢɡɜɟɫɬɧɨ, ɱɬɨ ɫɬɪɨɤɢ ɦɚɬɪɢɰɵ ɛɵɥɢ ɨɬɫɨɪɬɢɪɨɜɚɧɵ ɩɨ ɩɨɪɹɞɤɭ, ɧɚɱɢɧɚɹ ɫ ɩɟɪɜɨɝɨ ɫɢɦɜɨɥɚ. ɉɨɷɬɨɦɭ, ɨɱɟɜɢɞɧɨ, ɜ ɪɟɡɭɥɶɬɚɬɟ ɬɚɤɨɣ ɫɨɪɬɢɪɨɜɤɢ ɦɵ ɩɨɥɭɱɢɥɢ ɩɟɪɜɵɣ ɫɬɨɥɛɟɰ ɢɫɯɨɞɧɨɣ ɦɚɬɪɢɰɵ. 202 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɨɫɤɨɥɶɤɭ ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɟɰ ɩɨ ɭɫɥɨɜɢɸ ɡɚɞɚɱɢ ɧɚɦ ɢɡɜɟɫɬɟɧ, ɞɨɛɚɜɢɦ ɟɝɨ ɜ ɩɨɥɭɱɟɧɧɭɸ ɦɚɬɪɢɰɭ. ɚ.........ɪ ɚ.........ɞ ɚ.........ɚ ɚ.........ɤ ɚ.........ɪ ɛ.........ɚ ɛ.........ɚ ɞ.........ɚ ɤ.........ɚ ɪ.........ɛ ɪ.........ɛ
0 1 2 3 4 5 6 7 8 9 10
Ɋɢɫ. 5.4. ɉɟɪɜɵɣ ɢ ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɰɵ ɦɚɬɪɢɰɵ ɰɢɤɥɢɱɟɫɤɢɯ ɩɟɪɟɫɬɚɧɨɜɨɤ Ɍɟɩɟɪɶ ɫɚɦɨɟ ɜɪɟɦɹ ɜɫɩɨɦɧɢɬɶ, ɱɬɨ ɫɬɪɨɤɢ ɦɚɬɪɢɰɵ ɛɵɥɢ ɩɨɥɭɱɟɧɵ ɜ ɪɟɡɭɥɶɬɚɬɟ ɰɢɤɥɢɱɟɫɤɨɝɨ ɫɞɜɢɝɚ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ. Ɍɨ ɟɫɬɶ, ɫɢɦɜɨɥɵ ɩɨɫɥɟɞɧɟɝɨ ɢ ɩɟɪɜɨɝɨ ɫɬɨɥɛɰɨɜ ɨɛɪɚɡɭɸɬ ɞɪɭɝ ɫ ɞɪɭɝɨɦ ɩɚɪɵ. ɂ ɧɚɦ ɧɢɱɬɨ ɧɟ ɦɨɠɟɬ ɩɨɦɟɲɚɬɶ ɨɬɫɨɪɬɢɪɨɜɚɬɶ ɷɬɢ ɩɚɪɵ, ɩɨɫɤɨɥɶɤɭ ɨɛɹɡɚɬɟɥɶɧɨ ɫɭɳɟɫɬɜɭɸɬ ɬɚɤɢɟ ɫɬɪɨɤɢ ɜ ɦɚɬɪɢɰɟ, ɤɨɬɨɪɵɟ ɧɚɱɢɧɚɸɬɫɹ ɫ ɷɬɢɯ ɩɚɪ. Ɂɚɨɞɧɨ ɞɨɩɢɲɟɦ ɜ ɦɚɬɪɢɰɭ ɢ ɢɡɜɟɫɬɧɵɣ ɧɚɦ ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɟɰ. 0 1 2 3 4 5 6 7 8 9
ɚɚ........ɪ ɚɛ........ɞ ɚɛ........ɚ ɚɞ........ɤ ɚɤ........ɪ ɛɪ........ɚ ɛɪ........ɚ ɞɚ........ɚ ɤɚ........ɚ ɪɚ........ɛ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 203 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɪɚ........ɛ
10
Ɋɢɫ. 5.5. ɉɟɪɜɵɣ, ɜɬɨɪɨɣ ɢ ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɰɵ ɦɚɬɪɢɰɵ Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɞɜɚ ɫɬɨɥɛɰɚ ɧɚɦ ɭɠɟ ɢɡɜɟɫɬɧɵ. Ʌɟɝɤɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɟ ɩɚɪɵ ɜɦɟɫɬɟ ɫ ɫɢɦɜɨɥɚɦɢ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ ɫɨɫɬɚɜɥɹɸɬ ɬɪɨɣɤɢ. Ⱥɧɚɥɨɝɢɱɧɨ ɜɨɫɫɬɚɧɚɜɥɢɜɚɟɬɫɹ ɜɫɹ ɦɚɬɪɢɰɚ. Ⱥ ɧɚ ɨɫɧɨɜɚɧɢɢ ɡɚɩɢɫɚɧɧɨɝɨ ɡɚɪɚɧɟɟ ɧɨɦɟɪɚ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɜ ɦɚɬɪɢɰɟ — ɢ ɫɚɦɚ ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ. 0 1 2 3 4 5 6 7 8 9 10
ɚɚɛ.......ɪ ɚɛɪ.......ɞ ɚɛɪ.......ɚ ɚɞɚ.......ɤ ɚɤɚ.......ɪ ɛɪɚ.......ɚ ɛɪɚ.......ɚ ɞɚɛ.......ɚ ɤɚɞ.......ɚ ɪɚɚ.......ɛ ɪɚɤ.......ɛ
ɚɚɛɪ......ɪ ɚɛɪɚ......ɞ ɚɛɪɚ......ɚ ɚɞɚɛ......ɤ ɚɤɚɞ......ɪ ɛɪɚɚ......ɚ ɛɪɚɤ......ɚ ɞɚɛɪ......ɚ ɤɚɞɚ......ɚ ɪɚɚɛ......ɛ ɪɚɤɚ......ɛ
...
ɚɚɛɪɚɤɚɞɚ.ɪ ɚɛɪɚɚɛɪɚɤ.ɞ ɚɛɪɚɤɚɞɚɛ.ɚ ɚɞɚɛɪɚɚɛɪ.ɤ ɚɤɚɞɚɛɪɚɚ.ɪ ɛɪɚɚɛɪɚɤɚ.ɚ ɛɪɚɤɚɞɚɛɪ.ɚ ɞɚɛɪɚɚɛɪɚ.ɚ ɤɚɞɚɛɪɚɚɛ.ɚ ɪɚɚɛɪɚɤɚɞ.ɛ ɪɚɤɚɞɚɛɪɚ.ɛ
ɚɚɛɪɚɤɚɞɚɛɪ ɚɛɪɚɚɛɪɚɤɚɞ ɚɛɪɚɤɚɞɚɛɪɚ ɚɞɚɛɪɚɚɛɪɚɤ ɚɤɚɞɚɛɪɚɚɛɪ ɛɪɚɚɛɪɚɤɚɞɚ ɛɪɚɤɚɞɚɛɪɚɚ ɞɚɛɪɚɚɛɪɚɤɚ ɤɚɞɚɛɪɚɚɛɪɚ ɪɚɚɛɪɚɤɚɞɚɛ ɪɚɤɚɞɚɛɪɚɚɛ
Ɋɢɫ. 5.6. ɉɪɨɰɟɫɫ ɨɩɪɟɞɟɥɟɧɢɹ ɜɫɟɯ ɫɬɨɥɛɰɨɜ ɦɚɬɪɢɰɵ ɍɩɪɚɠɧɟɧɢɟ: ȼ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɨɥɭɱɟɧɚ ɫɬɪɨɤɚ “ɬɩɪɨɨɩɩɨ”. ɇɨɦɟɪ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɜ ɦɚɬɪɢɰɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ — 5 (ɫɱɢɬɚɹ ɫ ɧɭɥɹ). ȼɨɫɫɬɚɧɨɜɢɬɟ ɢɫɯɨɞɧɭɸ ɫɬɪɨɤɭ. ȼȿɄɌɈɊ ɈȻɊȺɌɇɈȽɈ ɉɊȿɈȻɊȺɁɈȼȺɇɂə
ɉɨɫɥɟ ɬɨɝɨ, ɤɚɤ ɦɵ ɞɨɤɚɡɚɥɢ ɩɪɢɧɰɢɩɢɚɥɶɧɭɸ ɜɨɡɦɨɠɧɨɫɬɶ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɦɨɠɧɨ ɩɨɤɚɡɚɬɶ, ɱɬɨ ɞɥɹ ɟɝɨ ɨɫɭɳɟɫɬɜɥɟɧɢɹ ɧɟɬ ɧɟɨɛɯɨɞɢɦɨɫɬɢ ɩɨɫɢɦɜɨɥɶɧɨ ɜɵɩɢɫɵɜɚɬɶ ɜɫɟ ɫɬɪɨɤɢ ɦɚɬɪɢɰɵ ɩɟɪɟɫɬɚɧɨɜɨɤ. ȿɫɥɢ ɛɵ ɦɵ ɯɪɚɧɢɥɢ ɜ ɩɚɦɹɬɢ ɜɫɸ ɦɚɬɪɢɰɭ, ɬɪɟɛɭɟɦɭɸ ɞɥɹ ɦɟɝɚɛɚɣɬɧɨɝɨ ɛɥɨɤɚ ɞɚɧɧɵɯ, ɧɚɦ 204 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɨɬɪɟɛɨɜɚɥɨɫɶ ɛɵ... ȼ ɨɛɳɟɦ, ɜɢɞɧɨ, ɱɬɨ ɡɚɬɟɹ ɛɵɥɚ ɛɵ ɛɟɫɩɨɥɟɡɧɨɣ. Ⱦɥɹ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɧɚɦ ɞɨɩɨɥɧɢɬɟɥɶɧɨ ɤ ɫɨɛɫɬɜɟɧɧɨ ɞɚɧɧɵɦ ɧɭɠɟɧ ɬɨɥɶɤɨ ɜɟɤɬɨɪ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɩɪɟɞɫɬɚɜɥɹɸɳɢɣ ɫɨɛɨɣ ɦɚɫɫɢɜ ɱɢɫɟɥ, ɪɚɡɦɟɪ ɤɨɬɨɪɨɝɨ ɪɚɜɟɧ ɱɢɫɥɭ ɫɢɦɜɨɥɨɜ ɜ ɛɥɨɤɟ. ɉɨɷɬɨɦɭ ɡɚɬɪɚɬɵ ɩɚɦɹɬɢ ɩɪɢ ɜɵɩɨɥɧɟɧɢɢ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɥɢɧɟɣɧɨ ɡɚɜɢɫɹɬ ɨɬ ɪɚɡɦɟɪɚ ɛɥɨɤɚ. Ɉɛɪɚɬɢɬɟ ɜɧɢɦɚɧɢɟ, ɱɬɨ ɜ ɩɪɨɰɟɫɫɟ ɜɵɹɜɥɟɧɢɹ ɨɱɟɪɟɞɧɨɝɨ ɫɬɨɥɛɰɚ ɦɚɬɪɢɰɵ ɦɵ ɫɨɜɟɪɲɚɥɢ ɨɞɧɢ ɢ ɬɟ ɠɟ ɞɟɣɫɬɜɢɹ. Ⱥ ɢɦɟɧɧɨ, ɩɨɥɭɱɚɥɢ ɧɨɜɭɸ ɫɬɪɨɤɭ, ɫɥɢɜɚɹ ɫɢɦɜɨɥ ɢɡ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ ɫɬɚɪɨɣ ɫɬɪɨɤɢ ɫ ɢɡɜɟɫɬɧɵɦɢ ɫɢɦɜɨɥɚɦɢ ɩɟɪɜɵɯ ɫɬɨɥɛɰɨɜ ɷɬɨɣ ɠɟ ɫɬɪɨɤɢ. ɂ ɧɨɜɚɹ ɫɬɪɨɤɚ ɩɨɫɥɟ ɫɨɪɬɢɪɨɜɤɢ ɩɟɪɟɦɟɳɚɥɚɫɶ ɜ ɞɪɭɝɭɸ ɩɨɡɢɰɢɸ ɜ ɦɚɬɪɢɰɟ. Ɍɚɤ ɢɡ ɫɬɪɨɤɢ 0 ɦɵ ɩɨɥɭɱɚɥɢ ɫɬɪɨɤɭ 9, ɢɡ ɩɟɪɜɨɣ — ɫɟɞɶɦɭɸ ɢ ɬ.ɩ.: ɧɨɦɟɪ ɫɬɪɨɤɢ 0 1 2 3 4 5 6 7 8 9 10
ɚ.........ɪ ɚ.........ɞ ɚ.........ɚ ɚ.........ɤ ɚ.........ɪ ɛ.........ɚ ɛ.........ɚ ɞ.........ɚ ɤ.........ɚ ɪ.........ɛ ɪ.........ɛ
ɧɨɦɟɪ ɧɨɜɨɣ ɫɬɪɨɤɢ 9 7 0 8 10 1 2 3 4 5 6
— ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ
Ɋɢɫ. 5.7. ɋɩɨɫɨɛ ɩɨɥɭɱɟɧɢɹ ɩɟɪɜɨɝɨ ɫɬɨɥɛɰɚ ɦɚɬɪɢɰɵ ɢɡ ɩɨɫɥɟɞɧɟɝɨ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 205 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼɚɠɧɨ, ɱɬɨ ɩɪɢ ɞɨɛɚɜɥɟɧɢɢ ɥɸɛɨɝɨ ɫɬɨɥɛɰɚ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɪɨɤ ɧɚ ɧɨɜɭɸ ɩɨɡɢɰɢɸ ɛɵɥɢ ɨɞɢɧɚɤɨɜɵ. ɇɭɥɟɜɚɹ ɫɬɪɨɤɚ ɩɟɪɟɦɟɳɚɥɚɫɶ ɜ ɞɟɜɹɬɭɸ ɩɨɡɢɰɢɸ, ɩɟɪɜɚɹ — ɜ ɫɟɞɶɦɭɸ, ɢ ɬ.ɞ. ɑɬɨɛɵ ɩɨɥɭɱɢɬɶ ɜɟɤɬɨɪ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɫɥɟɞɭɟɬ ɨɩɪɟɞɟɥɢɬɶ ɩɨɪɹɞɨɤ ɩɨɥɭɱɟɧɢɹ ɫɢɦɜɨɥɨɜ ɩɟɪɜɨɝɨ ɫɬɨɥɛɰɚ ɢɡ ɫɢɦɜɨɥɨɜ ɩɨɫɥɟɞɧɟɝɨ. Ɍɨ ɟɫɬɶ, ɨɬɫɨɪɬɢɪɨɜɚɬɶ ɦɚɬɪɢɰɭ ɩɨ ɧɨɦɟɪɚɦ ɧɨɜɵɯ ɫɬɪɨɤ. ɧɨɦɟɪ ɫɬɪɨɤɢ
2 5 6 7 8 9 10 1 3 0 4
ɧɨɦɟɪ ɧɨɜɨɣ ɫɬɪɨɤɢ ɚ.........ɚ ɛ.........ɚ ɛ.........ɚ ɞ.........ɚ ɤ.........ɚ ɪ.........ɛ ɪ.........ɛ ɚ.........ɞ ɚ.........ɤ ɚ.........ɪ ɚ.........ɪ
0 1 2 3 4 5 6 7 8 9 10
ɩɟɪɟɧɨɫɢɦ ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɟɰ ɜ ɧɚɱɚɥɨ ɚɚ........ɪ ɚɛ........ɞ ɚɛ........ɚ ɚɞ........ɤ ɚɤ........ɪ ɛɪ........ɚ ɛɪ........ɚ ɞɚ........ɚ ɤɚ........ɚ ɪɚ........ɛ ɪɚ........ɛ
Ɋɢɫ. 5.8. ɉɨɥɭɱɟɧɢɟ ɜɟɤɬɨɪɚ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɉɨɥɭɱɟɧɧɵɟ ɡɧɚɱɟɧɢɹ ɧɨɦɟɪɨɜ ɫɬɪɨɤ T = { 2, 5, 6, 7, 8, 9, 10, 1, 3, 0, 4 } ɢ ɟɫɬɶ ɢɫɤɨɦɵɣ ɜɟɤɬɨɪ, ɫɨɞɟɪɠɚɳɢɣ ɧɨɦɟɪɚ ɩɨɡɢɰɢɣ ɫɢɦɜɨɥɨɜ ɜ ɫɬɪɨɤɟ, ɤɨɬɨɪɭɸ ɧɚɦ ɧɚɞɨ ɞɟɤɨɞɢɪɨɜɚɬɶ (ɫɢɦɜɨɥɵ ɭɩɨɪɹɞɨɱɟɧɵ ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɩɨɥɨɠɟɧɢɟɦ ɜ ɚɥɮɚɜɢɬɟ). Ɍɟɩɟɪɶ ɩɨɥɭɱɢɬɶ ɢɫɯɨɞɧɭɸ ɫɬɪɨɤɭ ɫɨɜɫɟɦ ɩɪɨɫɬɨ. ɉɟɪɜɵɦ ɞɟɥɨɦ ɜɨɡɶɦɟɦ ɷɥɟɦɟɧɬ ɜɟɤɬɨɪɚ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɣ ɧɨɦɟɪɭ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɜ ɦɚɬɪɢɰɟ ɰɢɤɥɢɱɟɫɤɢɯ ɩɟɪɟɫɬɚɧɨɜɨɤ, T[2] = 6. ɂɧɚɱɟ ɝɨɜɨɪɹ, ɜ ɤɚɱɟɫɬɜɟ ɩɟɪɜɨɝɨ ɫɢɦɜɨɥɚ ɜ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɟ ɫɥɟɞɭɟɬ ɜɡɹɬɶ ɲɟɫɬɨɣ ɫɢɦɜɨɥ ɢɡ ɫɬɪɨɤɢ “ɪɞɚɤɪɚɚɚɚɛɛ”. ɗɬɨ ɫɢɦɜɨɥ ‘ɚ’. 206 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɂɚɬɟɦ ɧɭɠɧɨ ɨɩɪɟɞɟɥɢɬɶ, ɤɚɤɨɣ ɫɢɦɜɨɥ ɡɚɫɬɚɜɢɥ ɨɩɭɫɬɢɬɶɫɹ ɧɚɣɞɟɧɧɵɣ ɫɢɦɜɨɥ ‘ɚ’ ɧɚ ɜɬɨɪɭɸ ɩɨɡɢɰɢɸ ɫɪɟɞɢ ɪɚɜɧɵɯ. ɂɫɤɨɦɵɣ ɫɢɦɜɨɥ ɧɚɯɨɞɢɬɫɹ ɜ ɩɨɫɥɟɞɧɟɦ ɫɬɨɥɛɰɟ ɲɟɫɬɨɣ ɫɬɪɨɤɢ ɦɚɬɪɢɰɵ, ɢɡɨɛɪɚɠɟɧɧɨɣ ɧɚ ɪɢɫ. 5.8. Ⱥ ɩɨɫɤɨɥɶɤɭ T[6] = 10, ɜ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɣ ɫɬɪɨɤɟ ɨɧ ɧɚɯɨɞɢɬɫɹ ɜ ɞɟɫɹɬɨɣ ɩɨɡɢɰɢɢ. ɗɬɨ ɫɢɦɜɨɥ ‘ɛ’. ɂ ɬ.ɞ. 6 ɚ
10 ɛ
4 ɪ
8 ɚ
3 ɤ
7 ɚ
1 ɞ
5 ɚ
9 ɛ
0 ɪ
2 ɚ
Ɋɢɫ. 5.9. Ⱦɟɤɨɞɢɪɨɜɚɧɢɟ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɩɪɢ ɩɨɦɨɳɢ ɜɟɤɬɨɪɚ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɍɩɪɚɠɧɟɧɢɟ: ȼ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɨɥɭɱɟɧɚ ɫɬɪɨɤɚ “ɬɩɪɨɨɩɩɨ”. ɇɨɦɟɪ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɜ ɦɚɬɪɢɰɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ — 5 (ɫɱɢɬɚɹ ɫ ɧɭɥɹ). ɉɨɫɬɪɨɣɬɟ ɜɟɤɬɨɪ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. ɊȿȺɅɂɁȺɐɂə ɈȻɊȺɌɇɈȽɈ ɉɊȿɈȻɊȺɁɈȼȺɇɂə
ɉɨɥɭɱɟɧɢɟ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɢɡ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɣ ɦɨɠɧɨ ɩɪɨɢɥɥɸɫɬɪɢɪɨɜɚɬɶ ɩɪɢ ɩɨɦɨɳɢ ɧɟɛɨɥɶɲɨɣ ɩɪɨɝɪɚɦɦɵ. ȼɜɟɞɟɦ ɫɥɟɞɭɸɳɢɟ ɨɛɨɡɧɚɱɟɧɢɹ: n — ɤɨɥɢɱɟɫɬɜɨ ɫɢɦɜɨɥɨɜ ɜ ɛɥɨɤɟ ɜɯɨɞɧɨɝɨ ɩɨɬɨɤɚ; N — ɤɨɥɢɱɟɫɬɜɨ ɫɢɦɜɨɥɨɜ ɜ ɚɥɮɚɜɢɬɟ; pos — ɧɨɦɟɪ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɜ ɦɚɬɪɢɰɟ ɩɟɪɟɫɬɚɧɨɜɨɤ; in — ɜɯɨɞɧɨɣ ɛɥɨɤ; count — ɦɚɫɫɢɜ ɱɚɫɬɨɬ ɤɚɠɞɨɝɨ ɫɢɦɜɨɥɚ ɚɥɮɚɜɢɬɚ ɜɨ ɜɯɨɞɧɨɦ ɛɥɨɤɟ; T — ɜɟɤɬɨɪ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɪɚɡɦɟɪ ɜɟɤɬɨɪɚ ɪɚɜɟɧ n. ɉɟɪɜɵɦ ɞɟɥɨɦ ɫɥɟɞɭɟɬ ɩɨɫɱɢɬɚɬɶ ɱɚɫɬɨɬɵ ɫɢɦɜɨɥɨɜ ɢ ɩɪɨɧɭɦɟɪɨɜɚɬɶ ɜɫɟ ɢɫɯɨɞɧɵɟ ɫɢɦɜɨɥɵ ɜ ɩɨɪɹɞɤɟ ɢɯ ɩɨɹɜɥɟɧɢɹ ɜ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 207 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɚɥɮɚɜɢɬɟ. ɉɨ ɫɭɬɢ, ɷɬɨ ɷɤɜɢɜɚɥɟɧɬɧɨ ɩɨɫɬɪɨɟɧɢɸ ɩɟɪɜɨɝɨ ɫɬɨɥɛɰɚ ɦɚɬɪɢɰɵ ɰɢɤɥɢɱɟɫɤɢɯ ɩɟɪɟɫɬɚɧɨɜɨɤ. for( i=0; i
count[i]=0; count[in[i]]++; { count[i];
ɉɨɫɥɟ ɜɵɩɨɥɧɟɧɢɹ ɷɬɢɯ ɞɟɣɫɬɜɢɣ count[i] ɭɤɚɡɵɜɚɟɬ ɧɚ ɩɟɪɜɭɸ ɩɨɡɢɰɢɸ ɫɢɦɜɨɥɚ ɫ ɤɨɞɨɦ i ɜ ɩɟɪɜɨɦ ɫɬɨɥɛɰɟ ɦɚɬɪɢɰɵ. ɋɥɟɞɭɸɳɢɣ ɲɚɝ — ɫɨɡɞɚɧɢɟ ɜɟɤɬɨɪɚ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. for( i=0; i
Ⱦɚɥɟɟ, ɩɪɢ ɩɨɦɨɳɢ ɩɨɥɭɱɟɧɧɨɝɨ ɜɟɤɬɨɪɚ ɜɨɫɫɬɚɧɨɜɢɦ ɢɫɯɨɞɧɵɣ ɬɟɤɫɬ. for( i=0; i
ɂɋɉɈɅɖɁɈȼȺɇɂȿ BWT ȼ ɋɀȺɌɂɂ ȾȺɇɇɕɏ
Ɍɟɩɟɪɶ, ɩɨɫɥɟ ɬɨɝɨ ɤɚɤ ɜɵɹɫɧɢɥɨɫɶ, ɱɬɨ ɧɚɲɢ ɞɟɣɫɬɜɢɹ ɜɩɨɥɧɟ ɨɛɪɚɬɢɦɵ, ɢ ɞɚɧɧɵɟ ɦɵ ɧɟ ɢɫɤɚɡɢɦ, ɦɨɠɧɨ ɜɟɪɧɭɬɶɫɹ ɤ ɜɨɩɪɨɫɭ ɪɚɫɫɦɨɬɪɟɧɢɹ ɩɨɥɟɡɧɨɫɬɢ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. Ʉɚɤ ɭɠɟ ɨɬɦɟɱɚɥɨɫɶ ɜɵɲɟ, ɝɥɚɜɧɚɹ ɡɚɞɚɱɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨɛɵ ɥɨɜɤɨ ɩɟɪɟɫɬɚɜɢɬɶ ɫɢɦɜɨɥɵ. ɉɟɪɟɫɬɚɜɢɬɶ ɬɚɤ, ɱɬɨɛɵ ɢɯ ɦɨɠɧɨ ɛɵɥɨ ɥɟɝɤɨ ɫɠɚɬɶ, ɧɟ ɥɨɦɚɹ ɝɨɥɨɜɭ ɧɚɞ ɢɯ ɜɡɚɢɦɨɫɜɹɡɹɦɢ. ɉɨɬɨɦɭ ɱɬɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɤɚɤ ɪɚɡ ɬɟɦ ɢ ɡɚɧɢɦɚɟɬɫɹ: «ɜɵɬɚɫɤɢɜɚɟɬ» ɜɫɟ ɜɡɚɢɦɨɫɜɹɡɢ ɧɚɪɭɠɭ. Ɍɨɱɧɟɟ, ɨɱɟɧɶ ɦɧɨɝɢɟ. Ⱦɥɹ ɩɨɧɢɦɚɧɢɹ ɷɬɨɝɨ ɩɪɨɰɟɫɫɚ ɞɨɫɬɚɬɨɱɧɨ ɩɪɟɞɫɬɚɜɢɬɶ ɩɨɬɨɤ ɞɚɧɧɵɯ ɫɨɫɬɨɹɳɢɦ ɢɡ ɧɚɛɨɪɚ ɧɟɤɨɬɨɪɵɯ ɫɬɚɛɢɥɶɧɵɯ ɫɨɱɟɬɚɧɢɣ ɫɢɦɜɨɥɨɜ. ɇɚɩɪɢɦɟɪ, ɤɚɤ ɷɬɨɬ ɬɟɤɫɬ, ɫɨɫɬɨɹɳɢɦ ɢɡ ɫɥɨɜ. ɋɨɱɟ208 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɬɚɧɢɟ ɫɢɦɜɨɥɨɜ, ɩɨɡɜɨɥɹɸɳɟɟ ɩɪɟɞɫɤɚɡɚɬɶ ɧɟɤɨɬɨɪɵɣ ɧɟɢɡɜɟɫɬɧɵɣ ɞɨɫɟɥɟ ɫɢɦɜɨɥ, ɧɚɡɵɜɚɟɬɫɹ ɤɨɧɬɟɤɫɬɨɦ. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɧɚɦ ɢɡɜɟɫɬɧɚ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɫɢɦɜɨɥɨɜ “ɪɟɨɛɪɚɡɨɜɚɧɢɟ”, ɬɨ ɫɤɨɪɟɟ ɜɫɟɝɨ ɟɣ ɩɪɟɞɲɟɫɬɜɭɟɬ ɫɢɦɜɨɥ “ɩ”. ɇɚɡɨɜɟɦ ɭɫɬɨɣɱɢɜɵɦ (ɫɬɚɛɢɥɶɧɵɦ) ɬɚɤɨɣ ɤɨɧɬɟɤɫɬ, ɞɥɹ ɤɨɬɨɪɨɝɨ ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɱɚɫɬɨɬ ɫɢɦɜɨɥɨɜ, ɧɟɩɨɫɪɟɞɫɬɜɟɧɧɨ ɩɪɢɦɵɤɚɸɳɢɯ ɤ ɧɟɦɭ ɫɥɟɜɚ ɢɥɢ ɫɩɪɚɜɚ, ɦɟɧɹɟɬɫɹ ɧɟɡɧɚɱɢɬɟɥɶɧɨ ɜ ɩɪɟɞɟɥɚɯ ɛɥɨɤɚ. ȿɫɥɢ ɧɚɦ ɩɨɬɪɟɛɭɟɬɫɹ ɩɨɞɜɟɪɝɧɭɬɶ ɩɪɟɨɛɪɚɡɨɜɚɧɢɸ ɞɚɧɧɭɸ ɝɥɚɜɭ, ɦɨɠɧɨ ɫ ɭɜɟɪɟɧɧɨɫɬɶɸ ɫɤɚɡɚɬɶ, ɱɬɨ ɫɬɪɨɤɢ, ɧɚɱɢɧɚɸɳɢɟɫɹ ɫ ɫɢɦɜɨɥɨɜ “ɪɟɨɛɪɚɡɨɜɚɧɢɟ”, ɛɭɞɭɬ ɪɚɫɩɨɥɚɝɚɬɶɫɹ ɪɹɞɨɦ ɜ ɨɬɫɨɪɬɢɪɨɜɚɧɧɨɣ ɦɚɬɪɢɰɟ. ɂ ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɯ ɷɬɢɦ ɫɬɪɨɤɚɦ ɩɨɡɢɰɢɹɯ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ ɦɚɬɪɢɰɵ ɛɭɞɟɬ ɧɚɯɨɞɢɬɶɫɹ ɫɢɦɜɨɥ “ɩ”. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɝɥɚɜɧɨɟ ɫɜɨɣɫɬɜɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɜ ɬɨɦ, ɱɬɨ ɨɧɨ ɫɨɛɢɪɚɟɬ ɜɦɟɫɬɟ ɫɢɦɜɨɥɵ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɩɨɯɨɠɢɦ ɤɨɧɬɟɤɫɬɚɦ. ɑɟɦ ɛɨɥɶɲɟ ɫɬɚɛɢɥɶɧɵɯ ɤɨɧɬɟɤɫɬɨɜ ɜ ɛɥɨɤɟ ɞɚɧɧɵɯ, ɬɟɦ ɥɭɱɲɟ ɛɭɞɟɬ ɫɠɢɦɚɬɶɫɹ ɩɨɥɭɱɟɧɧɵɣ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɛɥɨɤ. ɉɪɚɤɬɢɤɚ ɩɨɤɚɡɵɜɚɟɬ, ɱɬɨ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɨɛɵɱɧɵɯ ɬɟɤɫɬɨɜ ɛɨɥɟɟ ɩɨɥɨɜɢɧɵ ɢɡ ɜɫɟɯ ɫɢɦɜɨɥɨɜ ɫɥɟɞɭɟɬ ɡɚ ɬɚɤɢɦɢ ɠɟ. ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤɢɟ ɟɳɟ ɫɢɦɜɨɥɵ ɩɨɦɢɦɨ “ɩ” ɦɨɝɭɬ ɨɤɚɡɚɬɶɫɹ ɜ ɤɨɧɰɟ ɫɬɪɨɤ, ɧɚɱɢɧɚɸɳɢɯɫɹ ɫ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɫɢɦɜɨɥɨɜ “ɪɟɨɛɪɚɡɨɜɚɧɢɟ”, ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɞɚɧɧɨɣ ɝɥɚɜɵ? ɑȺɋɌɂɑɇɈȿ ɋɈɊɌɂɊɍɘɓȿȿ ɉɊȿɈȻɊȺɁɈȼȺɇɂȿ
ɇɟɤɨɬɨɪɨɟ ɜɪɟɦɹ ɫɩɭɫɬɹ ɩɨɫɥɟ ɩɨɹɜɥɟɧɢɹ ɩɟɪɜɵɯ ɚɪɯɢɜɚɬɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, ɛɵɥɨ ɨɩɭɛɥɢɤɨɜɚɧɨ ɨɩɢɫɚɧɢɟ ɟɳɟ ɨɞɧɨɝɨ ɚɥɝɨɪɢɬɦɚ, ɬɚɤɠɟ ɨɫɧɨɜɚɧɧɨɝɨ ɧɚ ɫɨɪɬɢɪɨɜɤɟ ɛɥɨɤɚ ɞɚɧɧɵɯ [33, 1]. Ɉɬɥɢɱɢɟ ɨɬ BWT ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɫɨɪɬɢɪɨɜɤɚ ɫɬɪɨɤ ɦɚɬɪɢɰɵ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɧɟ ɩɨ ɜɫɟɣ ɞɥɢɧɟ ɫɬɪɨɤ, ɚ ɬɨɥɶɤɨ ɩɨ ɧɟɤɨɬɨɪɨɦɭ ɮɢɤɫɢɪɨɜɚɧɧɨɦɭ ɤɨɥɢɱɟɫɬɜɭ ɫɢɦɜɨɥɨɜ. ȼ ɬɨɦ ɫɥɭɱɚɟ, ɟɫɥɢ ɭ ɧɟɫɤɨɥɶɤɢɯ ɫɬɪɨɤ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 209 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɷɬɢ ɫɢɦɜɨɥɵ ɨɞɢɧɚɤɨɜɵ, ɜɵɲɟ ɜ ɫɩɢɫɤɟ ɩɨɦɟɳɚɟɬɫɹ ɫɬɪɨɤɚ, ɩɟɪɜɵɣ ɫɢɦɜɨɥ ɤɨɬɨɪɨɣ ɜɫɬɪɟɬɢɥɫɹ ɜɨ ɜɯɨɞɧɨɦ ɛɥɨɤɟ ɪɚɧɶɲɟ ɩɟɪɜɵɯ ɫɢɦɜɨɥɨɜ ɨɫɬɚɥɶɧɵɯ ɪɚɫɫɦɚɬɪɢɜɚɟɦɵɯ ɫɬɪɨɤ. Ɇɨɠɧɨ ɫɤɚɡɚɬɶ, ɱɬɨ ɩɨɡɢɰɢɹ ɩɟɪɜɨɝɨ ɫɢɦɜɨɥɚ ɫɬɪɨɤɢ ɜɨ ɜɯɨɞɧɨɦ ɛɥɨɤɟ ɭɱɚɫɬɜɭɟɬ ɜ ɫɨɪɬɢɪɨɜɤɟ. ɑɢɫɥɨ ɫɢɦɜɨɥɨɜ ɫɬɪɨɤɢ, ɭɱɚɫɬɜɭɸɳɢɯ ɜ ɩɪɟɨɛɪɚɡɨɜɚɧɢɢ, ɧɚɡɵɜɚɟɬɫɹ ɩɨɪɹɞɤɨɦ ɫɨɪɬɢɪɭɸɳɟɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. Ʌɟɝɤɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɧɭɥɟɜɨɝɨ ɩɨɪɹɞɤɚ, ST(0), ɩɨɥɭɱɚɟɬɫɹ ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ. ȼ ɤɚɱɟɫɬɜɟ ɩɪɢɦɟɪɚ ɜɵɩɨɥɧɢɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɩɟɪɜɨɝɨ ɢ ɜɬɨɪɨɝɨ ɩɨɪɹɞɤɚ ɫɬɪɨɤɢ “ɚɛɪɚɤɚɞɚɛɪɚ”. ɇɨɦɟɪ ɫɬɪɨɤɢ
ST(1)
ST(2)
BWT
ɉɟɪɜɵɣ ɲɚɝ. ɉɨɫɬɪɨɟɧɢɟ ɦɚɬɪɢɰɵ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ: 0 ɚ< 0>ɛɪɚɤɚɞɚɛɪɚ ɚɛ< 0>ɪɚɤɚɞɚɛɪɚ ɚɛɪɚɤɚɞɚɛɪɚ 1 ɛ< 1>ɪɚɤɚɞɚɛɪɚɚ ɛɪ< 1>ɚɤɚɞɚɛɪɚɚ ɛɪɚɤɚɞɚɛɪɚɚ 2 ɪ< 2>ɚɤɚɞɚɛɪɚɚɛ ɪɚ< 2>ɤɚɞɚɛɪɚɚɛ ɪɚɤɚɞɚɛɪɚɚɛ 3 ɚ< 3>ɤɚɞɚɛɪɚɚɛɪ ɚɤ< 3>ɚɞɚɛɪɚɚɛɪ ɚɤɚɞɚɛɪɚɚɛɪ 4 ɤ< 4>ɚɞɚɛɪɚɚɛɪɚ ɤɚ< 4>ɞɚɛɪɚɚɛɪɚ ɤɚɞɚɛɪɚɚɛɪɚ 5 ɚ< 5>ɞɚɛɪɚɚɛɪɚɤ ɚɞ< 5>ɚɛɪɚɚɛɪɚɤ ɚɞɚɛɪɚɚɛɪɚɤ 6 ɞ< 6>ɚɛɪɚɚɛɪɚɤɚ ɞɚ< 6>ɛɪɚɚɛɪɚɤɚ ɞɚɛɪɚɚɛɪɚɤɚ 7 ɚ< 7>ɛɪɚɚɛɪɚɤɚɞ ɚɛ< 7>ɪɚɚɛɪɚɤɚɞ ɚɛɪɚɚɛɪɚɤɚɞ 8 ɛ< 8>ɪɚɚɛɪɚɤɚɞɚ ɛɪ< 8>ɚɚɛɪɚɤɚɞɚ ɛɪɚɚɛɪɚɤɚɞɚ 9 ɪ< 9>ɚɚɛɪɚɤɚɞɚɛ ɪɚ< 9>ɚɛɪɚɤɚɞɚɛ ɪɚɚɛɪɚɤɚɞɚɛ 10 ɚ<10>ɚɛɪɚɤɚɞɚɛɪ ɚɚ<10>ɛɪɚɤɚɞɚɛɪ ɚɚɛɪɚɤɚɞɚɛɪ ȼɬɨɪɨɣ ɲɚɝ. ɋɨɪɬɢɪɨɜɤɚ: 0 ɚ< 0>ɛɪɚɤɚɞɚɛɪɚ ɚɚ<10>ɛɪɚɤɚɞɚɛɪ ɚɚɛɪɚɤɚɞɚɛɪ 1 ɚ< 3>ɤɚɞɚɛɪɚɚɛɪ ɚɛ< 0>ɪɚɤɚɞɚɛɪɚ ɚɛɪɚɚɛɪɚɤɚɞ 2 ɚ< 5>ɞɚɛɪɚɚɛɪɚɤ ɚɛ< 7>ɪɚɚɛɪɚɤɚɞ ɚɛɪɚɤɚɞɚɛɪɚ 3 ɚ< 7>ɛɪɚɚɛɪɚɤɚɞ ɚɞ< 5>ɚɛɪɚɚɛɪɚɤ ɚɞɚɛɪɚɚɛɪɚɤ 4 ɚ<10>ɚɛɪɚɤɚɞɚɛɪ ɚɤ< 3>ɚɞɚɛɪɚɚɛɪ ɚɤɚɞɚɛɪɚɚɛɪ 5 ɛ< 1>ɪɚɤɚɞɚɛɪɚɚ ɛɪ< 1>ɚɤɚɞɚɛɪɚɚ ɛɪɚɚɛɪɚɤɚɞɚ 6 ɛ< 8>ɪɚɚɛɪɚɤɚɞɚ ɛɪ< 8>ɚɚɛɪɚɤɚɞɚ ɛɪɚɤɚɞɚɛɪɚɚ 210 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɇɨɦɟɪ ST(1) ɫɬɪɨɤɢ 7 ɞ< 6>ɚɛɪɚɚɛɪɚɤɚ 8 ɤ< 4>ɚɞɚɛɪɚɚɛɪɚ 9 ɪ< 2>ɚɤɚɞɚɛɪɚɚɛ 10 ɪ< 9>ɚɚɛɪɚɤɚɞɚɛ Ɋɟɡɭɥɶɬɚɬ: ɚɪɤɞɪɚɚɚɚɛɛ,5
ST(2)
BWT
ɞɚ< 6>ɛɪɚɚɛɪɚɤɚ ɤɚ< 4>ɞɚɛɪɚɚɛɪɚ ɪɚ< 2>ɤɚɞɚɛɪɚɚɛ ɪɚ< 9>ɚɛɪɚɤɚɞɚɛ
ɞɚɛɪɚɚɛɪɚɤɚ ɤɚɞɚɛɪɚɚɛɪɚ ɪɚɚɛɪɚɤɚɞɚɛ ɪɚɤɚɞɚɛɪɚɚɛ
ɪɚɞɤɪɚɚɚɚɛɛ,5
ɪɞɚɤɪɚɚɚɚɛɛ,2
Ɋɢɫ. 5.10. ɑɚɫɬɢɱɧɵɟ ɫɨɪɬɢɪɭɸɳɢɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɩɟɪɜɨɝɨ ɢ ɜɬɨɪɨɝɨ ɩɨɪɹɞɤɨɜ Ɍɚɤ ɠɟ, ɤɚɤ ɢ ɜ BWT, ɪɟɡɭɥɶɬɚɬɨɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɹɜɥɹɸɬɫɹ ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɟɰ ɦɚɬɪɢɰɵ ɢ ɧɨɦɟɪ ɫɬɪɨɤɢ, ɩɨɫɥɟɞɧɢɣ ɫɢɦɜɨɥ ɤɨɬɨɪɨɣ ɹɜɥɹɟɬɫɹ ɧɚɱɚɥɶɧɵɦ ɫɢɦɜɨɥɨɦ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ. ɍɩɪɚɠɧɟɧɢɟ: ȼɵɩɨɥɧɢɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ST(3) ɫɬɪɨɤɢ “ɚɛɪɚɤɚɞɚɛɪɚ”.
Ʌɟɝɤɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɪɚɡɥɢɱɢɟ ɦɟɠɞɭ ɱɚɫɬɢɱɧɵɦ ɫɨɪɬɢɪɭɸɳɢɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟɦ ɢ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟɦ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɦɨɠɧɨ ɭɜɢɞɟɬɶ ɬɨɥɶɤɨ ɩɪɢ ɫɨɪɬɢɪɨɜɤɟ ɭɫɬɨɣɱɢɜɵɯ ɤɨɧɬɟɤɫɬɨɜ ɞɥɢɧɧɟɟ ɩɨɪɹɞɤɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ST. ȼ ɦɟɬɨɞɟ BWT ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɩɪɨɞɨɥɠɚɟɬɫɹ ɩɪɨɰɟɫɫ ɫɪɚɜɧɟɧɢɹ ɫɢɦɜɨɥɨɜ, ɚ ɜ ST — ɫɪɚɜɧɟɧɢɟ ɫɢɦɜɨɥɨɜ ɩɪɟɤɪɚɳɚɟɬɫɹ ɢ ɜɵɲɟ ɪɚɫɩɨɥɚɝɚɟɬɫɹ ɬɚ ɫɬɪɨɤɚ, ɩɟɪɜɵɣ ɫɢɦɜɨɥ ɤɨɬɨɪɨɣ ɜɫɬɪɟɬɢɥɫɹ ɜɨ ɜɯɨɞɧɨɦ ɛɥɨɤɟ ɪɚɧɶɲɟ. ɋɥɟɞɨɜɚɬɟɥɶɧɨ, ɬɟ ɞɚɧɧɵɟ, ɜ ɤɨɬɨɪɵɯ ɜɫɬɪɟɱɚɸɬɫɹ ɞɥɢɧɧɵɟ ɩɨɜɬɨɪɵ, ɛɨɥɟɟ ɷɮɮɟɤɬɢɜɧɨ ɫɠɢɦɚɸɬɫɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟɦ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ. Ʉ ɩɪɢɦɟɪɭ, ɬɢɩɢɱɧɵɟ ɬɟɤɫɬɨɜɵɟ ɮɚɣɥɵ ɧɚ ɚɧɝɥɢɣɫɤɨɦ ɹɡɵɤɟ ɬɟɪɹɸɬ ɜ ɫɠɚɬɢɢ ɨɤɨɥɨ 5% ɩɪɢ ɜɵɩɨɥɧɟɧɢɢ ɫɨɪɬɢɪɨɜɤɢ ɩɨ 4 ɫɢɦɜɨɥɚɦ. ɋ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, ɱɚɫɬɢɱɧɨɟ ɫɨɪɬɢɪɭɸɳɟɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɧɟ ɬɪɟɛɭɟɬ ɩɨɥɧɨɣ ɫɨɪɬɢɪɨɜɤɢ ɜɫɟɯ ɫɬɪɨɤ ɦɚɬɪɢɰɵ ɢ ɫɜɨɛɨɞɧɨ ɨɬ ɬɟɯ ɩɪɨɛɥɟɦ, ɤɨɬɨɪɵɟ ɜɨɡɧɢɤɚɸɬ ɩɪɢ ɩɪɟɨɛɪɚɡɨɜɚɧɢɢ ɨɱɟɧɶ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 211 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ ɫ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ ɩɨɥɧɨɣ ɫɨɪɬɢɪɨɜɤɢ. Ʉɚɤ ɩɪɚɜɢɥɨ, ɞɚɧɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɜɵɩɨɥɧɹɟɬɫɹ ɛɵɫɬɪɟɟ, ɱɟɦ BWT. ɇɨ ɩɪɢ ɜɵɩɨɥɧɟɧɢɢ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɧɚɛɥɸɞɚɟɬɫɹ ɢɧɚɹ ɤɚɪɬɢɧɚ. ȿɫɥɢ ɜ ɫɥɭɱɚɟ BWT ɨɧɨ ɜɵɩɨɥɧɹɟɬɫɹ ɥɟɝɤɨ ɢ ɩɪɨɫɬɨ, ɬɨ ɞɥɹ ɜɨɫɫɬɚɧɨɜɥɟɧɢɹ ɢɫɯɨɞɧɵɯ ɞɚɧɧɵɯ ɩɨɫɥɟ ɱɚɫɬɢɱɧɨɝɨ ɫɨɪɬɢɪɭɸɳɟɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɧɟɨɛɯɨɞɢɦɨ ɩɪɨɞɟɥɵɜɚɬɶ ɞɨɩɨɥɧɢɬɟɥɶɧɵɟ ɭɫɢɥɢɹ. Ⱥ ɢɦɟɧɧɨ, ɜɟɫɬɢ ɭɱɟɬ ɤɨɥɢɱɟɫɬɜɚ ɨɞɢɧɚɤɨɜɵɯ ɤɨɧɬɟɤɫɬɨɜ. ɂ ɱɟɦ ɩɨɪɹɞɨɤ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɛɨɥɶɲɟ, ɬɟɦ ɬɪɟɛɭɟɬɫɹ ɛɨɥɶɲɟ ɜɪɟɦɟɧɢ ɧɚ ɩɨɞɫɱɟɬ.
Ɇɟɬɨɞɵ, ɢɫɩɨɥɶɡɭɟɦɵɟ ɫɨɜɦɟɫɬɧɨ ɫ BWT Ʉɚɤ ɭɠɟ ɛɵɥɨ ɫɤɚɡɚɧɨ, ɫɚɦɨ ɩɨ ɫɟɛɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɧɟ ɫɠɢɦɚɟɬ. ɗɬɭ ɪɚɛɨɬɭ ɩɪɨɞɟɥɵɜɚɟɬ ɞɪɭɝɢɟ ɦɟɬɨɞɵ, ɩɪɢɡɜɚɧɧɵɟ ɬɨɥɤɨɜɨ ɪɚɫɩɨɪɹɞɢɬɶɫɹ ɬɟɦɢ ɫɜɨɣɫɬɜɚɦɢ, ɤɨɬɨɪɵɦɢ ɨɛɥɚɞɚɸɬ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɟ ɞɚɧɧɵɟ. ɋɪɟɞɢ ɬɚɤɢɯ ɦɟɬɨɞɨɜ ɦɨɠɧɨ ɨɬɦɟɬɢɬɶ ɫɥɟɞɭɸɳɢɟ: • ɤɨɞɢɪɨɜɚɧɢɟ ɞɥɢɧ ɩɨɜɬɨɪɨɜ (RLE), • ɦɟɬɨɞ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ (MTF), • ɤɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ (DC), • ɦɟɬɨɞ ɏɚɮɮɦɚɧɚ, • ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ ɤɨɞɢɪɨɜɚɧɢɟ. ɉɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɩɪɢɦɟɧɟɧɢɹ ɦɟɬɨɞɨɜ, ɢɫɩɨɥɶɡɭɟɦɵɯ ɫɨɜɦɟɫɬɧɨ ɫ BWT: ɒɚɝ ɂɫɩɨɥɶɡɭɟɦɵɣ ɚɥɝɨɪɢɬɦ 1 Ʉɨɞɢɪɨɜɚɧɢɟ ɞɥɢɧ ɩɨɜɬɨɪɨɜ (ɧɟɨɛɹɡɚɬɟɥɶɧɨ) 2 ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ ɑɚɫɬɢɱɧɨɟ ɫɨɪɬɢɪɭɸɳɟɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ 3 ɉɟɪɟɦɟɳɟɧɢɟ ɫɬɨɩɤɢ Ʉɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ ɤɧɢɝ 4 Ʉɨɞɢɪɨɜɚɧɢɟ ɞɥɢɧ ɩɨɜɬɨɪɨɜ (ɧɟɨɛɹɡɚɬɟɥɶɧɨ) 5 Ɇɟɬɨɞ ɏɚɮɮɦɚɧɚ Ⱥɪɢɮɦɟɬɢɱɟɫɤɨɟ ɤɨɞɢɪɨɜɚɧɢɟ 212 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉȿɊȿɆȿɓȿɇɂȿ ɋɌɈɉɄɂ ɄɇɂȽ
Ɇɟɬɨɞ ɬɚɤɠɟ ɢɡɜɟɫɬɟɧ ɩɨɞ ɧɚɡɜɚɧɢɟɦ MTF (Move To Front). ɋɭɬɶ ɟɝɨ ɥɟɝɤɨ ɩɨɧɹɬɶ, ɟɫɥɢ ɩɪɟɞɫɬɚɜɢɬɶ ɩɪɨɰɟɫɫ ɩɟɪɟɦɟɳɟɧɢɹ ɤɧɢɝ ɜ ɫɬɨɩɤɟ, ɢɡ ɤɨɬɨɪɨɣ ɜɪɟɦɹ ɨɬ ɜɪɟɦɟɧɢ ɞɨɫɬɚɸɬ ɧɭɠɧɭɸ ɤɧɢɝɭ ɢ ɤɥɚɞɭɬ ɫɜɟɪɯɭ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɱɟɪɟɡ ɧɟɤɨɬɨɪɨɟ ɜɪɟɦɹ ɧɚɢɛɨɥɟɟ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɵɟ ɤɧɢɝɢ ɨɤɚɡɵɜɚɸɬɫɹ ɛɥɢɠɟ ɤ ɜɟɪɯɭɲɤɟ ɫɬɨɩɤɢ. ȼɜɟɞɟɦ ɫɥɟɞɭɸɳɢɟ ɨɛɨɡɧɚɱɟɧɢɹ: N — ɱɢɫɥɨ ɫɢɦɜɨɥɨɜ ɜ ɚɥɮɚɜɢɬɟ; M — ɭɩɨɪɹɞɨɱɟɧɧɵɣ ɫɩɢɫɨɤ ɫɢɦɜɨɥɨɜ ɪɚɡɦɟɪɨɦ N; M[0] ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɜɟɪɯɧɟɣ ɤɧɢɝɟ ɫɬɨɩɤɢ, M[N-1] — ɧɢɠɧɟɣ; x — ɨɱɟɪɟɞɧɨɣ ɫɢɦɜɨɥ. int tmp1, tmp2, i=0; tmp1 = M[i]; M[i] = x; while( tmp1 != x ) { i++; tmp2 = tmp1; tmp1 = M[i]; M[i] = tmp2; }
Ⱦɥɹ ɩɪɢɦɟɪɚ, ɩɪɨɢɡɜɟɞɟɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɧɚɞ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶɸ “ɪɞɚɤɪɚɚɚɚɛɛ”, ɩɨɥɭɱɟɧɧɨɣ ɧɚɦɢ ɩɨɫɥɟ BWT. ɉɪɟɞɩɨɥɨɠɢɦ, ɱɬɨ ɦɵ ɢɦɟɟɦ ɞɟɥɨ ɫ ɚɥɮɚɜɢɬɨɦ, ɫɨɞɟɪɠɚɳɢɦ ɬɨɥɶɤɨ ɷɬɢ ɩɹɬɶ ɫɢɦɜɨɥɨɜ, ɢ ɜ ɭɩɨɪɹɞɨɱɟɧɧɨɦ ɫɩɢɫɤɟ ɫɢɦɜɨɥɨɜ ɨɧɢ ɪɚɫɩɨɥɨɠɟɧɵ ɜ ɫɥɟɞɭɸɳɟɦ ɩɨɪɹɞɤɟ: M = { ‘ɚ’, ‘ɛ’, ‘ɞ’, ‘ɤ’, ‘ɪ’ }. ɉɟɪɜɵɣ ɢɡ ɫɢɦɜɨɥɨɜ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ, ‘ɪ’, ɧɚɯɨɞɢɬɫɹ ɜ ɫɩɢɫɤɟ ɩɨɞ ɧɨɦɟɪɨɦ 4. ɗɬɨ ɱɢɫɥɨ ɦɵ ɢ ɡɚɩɢɫɵɜɚɟɦ ɜ ɜɵɯɨɞɧɨɣ ɛɥɨɤ. Ɂɚɬɟɦ ɦɵ ɢɡɦɟɧɹɟɦ ɫɩɢɫɨɤ, ɩɟɪɟɧɨɫɹ ɷɬɨɬ ɫɢɦɜɨɥ ɜ ɜɟɪɲɢɧɭ ɫɩɢɫɤɚ, ɩɪɢ ɷɬɨɦ ɫɞɜɢɝɚɹ ɜɫɟ ɨɫɬɚɥɶɧɵɟ ɷɥɟɦɟɧɬɵ, ɧɚɯɨɞɢɜɲɢɟɫɹ ɞɨ ɷɬɨɝɨ ɜɵɲɟ. ɋɥɟɞɭɸɳɢɣ ɫɢɦɜɨɥ, ‘ɞ’, ɩɨɫɥɟ ɷɬɨɝɨ ɫɞɜɢɝɚ ɨɤɚɡɵɜɚɟɬɫɹ ɜ ɫɩɢɫɤɟ ɩɨɞ ɧɨɦɟɪɨɦ 3. ɂ ɬɚɤ ɞɚɥɟɟ.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 213 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɋɢɦɜɨɥ ɪ ɞ ɚ ɤ ɪ ɚ ɚ ɚ ɚ ɛ ɛ
ɋɩɢɫɨɤ ɚɛɞɤɪ ɪɚɛɞɤ ɞɪɚɛɤ ɚɞɪɛɤ ɤɚɞɪɛ ɪɤɚɞɛ ɚɪɤɞɛ ɚɪɤɞɛ ɚɪɤɞɛ ɚɪɤɞɛ ɛɚɪɤɞ
ɇɨɦɟɪ 4 3 2 4 3 2 0 0 0 4 0
Ɋɢɫ. 5.11. MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɫɬɪɨɤɢ “ɪɞɚɤɪɚɚɚɚɛɛ” Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɩɨ ɦɟɬɨɞɭ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ ɦɵ ɩɨɥɭɱɢɥɢ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ “43243200040”. ȼɫɩɨɦɧɢɦ, ɱɬɨ ɪɟɡɭɥɶɬɚɬ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɫɢɦɜɨɥɨɜ, ɫɪɟɞɢ ɤɨɬɨɪɵɯ ɱɚɫɬɨ ɩɨɩɚɞɚɸɬɫɹ ɢɞɭɳɢɟ ɩɨɞɪɹɞ ɨɞɢɧɚɤɨɜɵɟ ɫɢɦɜɨɥɵ. ɉɨɷɬɨɦɭ, ɱɬɨɛɵ ɷɮɮɟɤɬɢɜɧɨ ɫɠɚɬɶ ɬɚɤɭɸ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ, ɫɬɚɬɢɫɬɢɱɟɫɤɨɦɭ ɤɨɞɟɪɭ ɧɟɨɛɯɨɞɢɦɨ ɜɨɜɪɟɦɹ ɨɬɫɥɟɠɢɜɚɬɶ ɫɦɟɧɭ ɨɞɧɨɝɨ ɱɚɫɬɨɝɨ ɫɢɦɜɨɥɚ ɞɪɭɝɢɦ. MTF ɩɪɟɞɧɚɡɧɚɱɟɧ ɞɥɹ ɬɨɝɨ, ɱɬɨɛɵ ɨɛɥɟɝɱɢɬɶ ɡɚɞɚɱɭ ɫɬɚɬɢɫɬɢɱɟɫɤɨɦɭ ɤɨɞɟɪɭ. Ɋɚɫɫɦɨɬɪɢɦ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ “bbbbcccccdddddaaaaab”, ɨɛɥɚɞɚɸɳɭɸ ɬɚɤɢɦɢ ɫɜɨɣɫɬɜɚɦɢ. ɉɨɩɪɨɛɭɟɦ ɨɛɨɣɬɢɫɶ ɛɟɡ MTF ɢ ɡɚɤɨɞɢɪɨɜɚɬɶ ɟɟ ɩɨ ɦɟɬɨɞɭ ɏɚɮɮɦɚɧɚ. Ⱦɥɹ ɭɩɪɨɳɟɧɢɹ ɛɭɞɟɦ ɢɫɯɨɞɢɬɶ ɢɡ ɩɪɟɞɩɨɥɨɠɟɧɢɹ, ɱɬɨ ɡɚɬɪɚɬɵ ɧɚ ɯɪɚɧɟɧɢɟ ɞɟɪɟɜɚ, ɬɪɟɛɭɟɦɨɝɨ ɞɥɹ ɨɛɟɫɩɟɱɟɧɢɹ ɞɟɤɨɞɢɪɨɜɚɧɢɹ, ɛɭɞɭɬ ɪɚɜɧɵ ɢ ɫ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ MTF, ɢ ɛɟɡ ɧɟɝɨ. ȼɟɪɨɹɬɧɨɫɬɢ ɜɫɟɯ ɱɟɬɵɪɟɯ ɫɢɦɜɨɥɨɜ ɜ ɞɚɧɧɨɦ ɩɪɢɦɟɪɟ ɪɚɜɧɵ 1/4, ɬ.ɟ. ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ɤɚɠɞɨɝɨ ɢɡ ɫɢɦɜɨɥɨɜ ɧɚɦ ɩɨɬɪɟɛɭɟɬɫɹ 2 ɛɢɬɚ. Ʌɟɝɤɨ ɩɨɫɱɢɬɚɬɶ, ɱɬɨ ɜ ɪɟɡɭɥɶɬɚɬɟ ɤɨɞɢɪɨɜɚɧɢɹ ɦɵ ɩɨɥɭɱɢɦ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɞɥɢɧɨɣ 20·2 =40 ɛɢɬ. 214 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɍɟɩɟɪɶ ɩɪɨɞɟɥɚɟɦ ɬɨ ɠɟ ɫɚɦɨɟ ɫɨ ɫɬɪɨɤɨɣ, ɩɨɞɜɟɪɝɧɭɬɨɣ MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɸ. ɉɪɟɞɩɨɥɨɠɢɦ, ɱɬɨ ɧɚɱɚɥɶɧɵɣ ɫɩɢɫɨɤ ɫɢɦɜɨɥɨɜ ɜɵɝɥɹɞɢɬ ɤɚɤ {‘a’, ‘b’, ‘c’, ‘d’}. bbbbcccccdddddaaaaab 10002000030000300003 ɋɢɦɜɨɥ 0 3 1 2
ɑɚɫɬɨɬɚ 15 3 1 1
ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ ɫɬɪɨɤɚ ɩɨɫɥɟ MTF
ȼɟɪɨɹɬɧɨɫɬɶ 3/4 3/20 1/20 1/20
Ʉɨɞ ɏɚɮɮɦɚɧɚ 0 10 110 111
Ɋɢɫ. 5.12. Ʉɨɞɢɪɨɜɚɧɢɟ ɦɟɬɨɞɨɦ ɏɚɮɮɦɚɧɚ ɫɬɪɨɤɢ ɩɨɫɥɟ MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ȼ ɪɟɡɭɥɶɬɚɬɟ ɤɨɞɢɪɨɜɚɧɢɹ ɩɨɥɭɱɚɟɦ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɞɥɢɧɨɣ 15*1 + 3*2 + 1*3 + 1*3 = 27 ɛɢɬ.
ɍɩɪɚɠɧɟɧɢɟ: ɉɪɨɢɡɜɟɞɢɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɦɟɬɨɞɨɦ ɫɬɨɩɤɢ ɤɧɢɝ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ “bbbbbccccdddcceaaaaa” ɢ ɨɩɪɟɞɟɥɢɬɟ, ɛɭɞɟɬ ɥɢ ɢɫɩɨɥɶɡɨɜɚɧɢɟ MTF ɞɚɜɚɬɶ ɩɪɟɢɦɭɳɟɫɬɜɨ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɦɟɬɨɞɨɦ ɏɚɮɮɦɚɧɚ. ɇɚɱɚɥɶɧɵɣ ɭɩɨɪɹɞɨɱɟɧɧɵɣ ɫɩɢɫɨɤ ɫɢɦɜɨɥɨɜ ɭɫɬɚɧɨɜɢɬɶ {‘a’, ‘b’, ‘c’, ‘d’, ‘e’}. ɂɫɯɨɞɢɬɟ ɢɡ ɩɪɟɞɩɨɥɨɠɟɧɢɹ, ɱɬɨ ɚɥɮɚɜɢɬ ɫɨɫɬɨɢɬ ɬɨɥɶɤɨ ɢɡ ɭɤɚɡɚɧɧɵɯ ɩɹɬɢ ɫɢɦɜɨɥɨɜ. ɄɈȾɂɊɈȼȺɇɂȿ ȾɅɂɇ ɉɈȼɌɈɊɈȼ
ɗɬɨɬ ɦɟɬɨɞ ɬɚɤɠɟ ɧɚɡɵɜɚɟɬɫɹ Run Length Encoding (RLE). ɗɬɨ ɨɞɢɧ ɢɡ ɧɚɢɛɨɥɟɟ ɫɬɚɪɵɯ ɦɟɬɨɞɨɜ ɫɠɚɬɢɹ. ɋɭɬɶ ɷɬɨɝɨ ɦɟɬɨɞɚ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɡɚɦɟɧɟ ɢɞɭɳɢɯ ɩɨɞɪɹɞ ɨɞɢɧɚɤɨɜɵɯ ɫɢɦɜɨɥɨɜ ɱɢɫɥɨɦ, ɯɚɪɚɤɬɟɪɢɡɭɸɳɢɦ ɢɯ ɤɨɥɢɱɟɫɬɜɨ. Ʉɨɧɟɱɧɨ, ɬɚɤɠɟ ɦɵ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 215 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɞɨɥɠɧɵ ɢ ɭɤɚɡɚɬɶ ɩɪɢɡɧɚɤ «ɜɤɥɸɱɟɧɢɹ» ɦɟɯɚɧɢɡɦɚ ɤɨɞɢɪɨɜɚɧɢɹ ɞɥɢɧ ɩɨɜɬɨɪɨɜ, ɤɨɬɨɪɵɣ ɦɨɠɟɦ ɪɚɫɩɨɡɧɚɬɶ ɩɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ. Ɉɞɢɧ ɢɡ ɜɨɡɦɨɠɧɵɯ ɜɚɪɢɚɧɬɨɜ — ɜɤɥɸɱɚɬɶ ɤɨɞɢɪɨɜɚɧɢɟ, ɤɨɝɞɚ ɱɢɫɥɨ ɩɨɜɬɨɪɹɸɳɢɯɫɹ ɫɢɦɜɨɥɨɜ ɩɪɟɜɵɫɢɬ ɧɟɤɨɬɨɪɵɣ ɩɨɪɨɝ. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɦɵ ɭɫɥɨɜɢɦɫɹ, ɱɬɨ ɩɨɪɨɝ ɪɚɜɧɹɟɬɫɹ ɬɪɟɦ ɫɢɦɜɨɥɚɦ, ɬɨ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ “aaaaabbbccccdd” ɜ ɪɟɡɭɥɶɬɚɬɟ ɤɨɞɢɪɨɜɚɧɢɹ ɛɭɞɟɬ ɜɵɝɥɹɞɟɬɶ ɤɚɤ “aaa2bbb0ccc1dd”. ȿɫɥɢ ɦɵ ɜɵɛɟɪɟɦ ɜ ɤɚɱɟɫɬɜɟ ɩɨɪɨɝɚ 4 ɫɢɦɜɨɥɚ, ɬɨ ɩɨɥɭɱɢɦ “aaaa1bbbcccc0dd”.
ɍɩɪɚɠɧɟɧɢɟ: ɑɬɨ ɩɨɥɭɱɢɬɫɹ, ɟɫɥɢ ɡɚɤɨɞɢɪɨɜɚɬɶ ɩɨɜɬɨɪɵ ɜ ɞɚɧɧɨɣ ɫɬɪɨɤɟ, ɢɫɩɨɥɶɡɭɹ ɩɨɪɨɝ, ɪɚɜɧɵɣ ɞɜɭɦ ɫɢɦɜɨɥɚɦ?
Ƚɥɚɜɧɨɟ ɧɚɡɧɚɱɟɧɢɟ ɤɨɞɢɪɨɜɚɧɢɹ ɞɥɢɧ ɩɨɜɬɨɪɨɜ ɜ ɫɜɹɡɤɟ ɫ BWT -ɭɜɟɥɢɱɢɬɶ ɫɤɨɪɨɫɬɶ ɫɠɚɬɢɹ ɢ ɪɚɡɠɚɬɢɹ. RLE ɦɨɠɧɨ ɩɪɢɦɟɧɢɬɶ ɞɜɚɠɞɵ — ɞɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɢ ɩɨɫɥɟ. Ⱦɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɞɚɧɧɵɣ ɦɟɬɨɞ ɦɨɠɟɬ ɩɪɢɝɨɞɢɬɶɫɹ, ɟɫɥɢ ɦɵ ɢɦɟɟɦ ɞɟɥɨ ɫ ɩɨɬɨɤɨɦ, ɫɨɞɟɪɠɚɳɢɦ ɦɧɨɝɨ ɩɨɜɬɨɪɨɜ ɨɞɢɧɚɤɨɜɵɯ ɫɢɦɜɨɥɨɜ. ɋɨɪɬɢɪɨɜɤɚ ɫɬɪɨɤ ɦɚɬɪɢɰɵ ɩɟɪɟɫɬɚɧɨɜɨɤ — ɧɚɢɛɨɥɟɟ ɞɥɢɬɟɥɶɧɚɹ ɢɡ ɩɪɨɰɟɞɭɪ, ɧɟɨɛɯɨɞɢɦɵɯ ɞɥɹ ɫɠɚɬɢɹ ɩɪɢ ɩɨɦɨɳɢ BWT. ȼ ɫɥɭɱɚɟ ɜɵɫɨɤɨɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ ɜɪɟɦɹ ɜɵɩɨɥɧɟɧɢɹ ɷɬɨɣ ɩɪɨɰɟɞɭɪɵ ɦɨɠɟɬ ɫɭɳɟɫɬɜɟɧɧɨ (ɜ ɪɚɡɵ) ɜɨɡɪɚɫɬɚɬɶ. ɋɟɣɱɚɫ ɪɚɡɪɚɛɨɬɚɧɵ ɦɟɬɨɞɵ ɫɨɪɬɢɪɨɜɤɢ, ɭɫɬɨɣɱɢɜɵɟ ɤ ɬɚɤɨɝɨ ɪɨɞɚ ɢɡɛɵɬɨɱɧɨɫɬɢ ɞɚɧɧɵɯ, ɧɨ ɪɚɧɟɟ ɦɟɬɨɞ ɤɨɞɢɪɨɜɚɧɢɹ ɞɥɢɧ ɩɨɜɬɨɪɨɜ ɲɢɪɨɤɨ ɢɫɩɨɥɶɡɨɜɚɥɫɹ ɧɚ ɷɬɨɦ ɷɬɚɩɟ ɰɟɧɨɣ ɧɟɛɨɥɶɲɨɝɨ ɭɯɭɞɲɟɧɢɹ ɫɠɚɬɢɹ. RLE ɫɥɟɞɭɟɬ ɩɪɢɦɟɧɹɬɶ, ɟɫɥɢ ɭɤɚɡɚɧɧɵɯ ɩɨɜɬɨɪɨɜ ɭɠ ɫɥɢɲɤɨɦ ɦɧɨɝɨ. ɇɟ ɹɜɥɹɟɬɫɹ ɨɛɹɡɚɬɟɥɶɧɵɦ ɢ ɞɪɭɝɨɟ ɩɪɢɦɟɧɟɧɢɟ RLE — ɤɨɞɢɪɨɜɚɧɢɟ ɞɥɢɧ ɩɨɜɬɨɪɨɜ ɩɨɫɥɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚɍɢɥɟɪɚ. Ɉɧɨ ɞɨɜɨɥɶɧɨ ɷɮɮɟɤɬɢɜɧɨ ɪɟɚɥɢɡɨɜɚɧɨ ɜ szip [33] ɢ BA, ɧɨ ɢɡɜɟɫɬɧɵ ɚɪɯɢɜɚɬɨɪɵ, ɜ ɤɨɬɨɪɵɯ RLE ɧɟ ɬɪɟɛɭɟɬɫɹ, ɧɚɩɪɢɦɟɪ, ɤɨɬɨɪɵɟ ɢɫɩɨɥɶɡɭɸɬ ɤɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ (DC, YBS). 216 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɋɹɞ ɚɪɯɢɜɚɬɨɪɨɜ ɢɫɩɨɥɶɡɭɟɬ ɧɟɤɭɸ ɪɚɡɧɨɜɢɞɧɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ ɞɥɢɧ ɩɨɜɬɨɪɨɜ — 1-2 ɤɨɞɢɪɨɜɚɧɢɟ, ɨɩɢɫɚɧɧɨɟ ɧɢɠɟ. ȼ ɥɸɛɨɦ ɫɥɭɱɚɟ, ɟɫɥɢ ɧɟ ɜɨɫɩɨɥɶɡɨɜɚɬɶɫɹ ɤɚɤɢɦ-ɧɢɛɭɞɶ ɢɡ ɩɟɪɟɱɢɫɥɟɧɧɵɯ ɦɟɬɨɞɨɜ ɫɨɤɪɚɳɟɧɢɹ ɤɨɥɢɱɟɫɬɜɚ ɜɵɯɨɞɧɵɯ ɫɢɦɜɨɥɨɜ, ɫɤɨɪɨɫɬɶ ɪɚɛɨɬɵ ɛɭɞɟɬ ɨɫɬɚɜɥɹɬɶ ɠɟɥɚɬɶ ɥɭɱɲɟɝɨ, ɨɫɨɛɟɧɧɨ ɜ ɫɥɭɱɚɟ ɚɪɯɢɜɚɬɨɪɨɜ, ɜ ɤɨɬɨɪɵɯ ɢɫɩɨɥɶɡɭɟɬɫɹ ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ ɤɨɞɢɪɨɜɚɧɢɟ. ɍɋɈȼȿɊɒȿɇɋɌȼɈȼȺɇɂȿ ɆȿɌɈȾȺ ɉȿɊȿɆȿɓȿɇɂə ɋɌɈɉɄɂ ɄɇɂȽ
MTF ɹɜɥɹɟɬɫɹ ɜɩɨɥɧɟ ɫɚɦɨɫɬɨɹɬɟɥɶɧɵɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟɦ ɢ, ɩɨɦɢɦɨ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɜɤɭɩɟ ɫ BWT, ɩɪɢɦɟɧɹɟɬɫɹ ɢ ɜ ɞɪɭɝɢɯ ɨɛɥɚɫɬɹɯ. ɇɨ ɫɟɣɱɚɫ ɦɵ ɪɚɫɫɦɨɬɪɢɦ ɦɨɞɢɮɢɤɚɰɢɢ ɦɟɬɨɞɚ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ, ɤɨɬɨɪɵɟ ɩɨɦɨɝɚɸɬ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɞɚɧɧɵɯ, ɩɨɥɭɱɟɧɧɵɯ ɢɦɟɧɧɨ ɩɨɫɥɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚɍɢɥɟɪɚ. Ʉɨɝɞɚ ɦɵ ɜɵɩɢɫɵɜɚɟɦ ɫɢɦɜɨɥɵ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ ɦɚɬɪɢɰɵ ɩɟɪɟɫɬɚɧɨɜɨɤ, ɨɬɧɨɫɹɳɢɟɫɹ ɤ ɜɟɫɶɦɚ ɛɥɢɡɤɢɦ ɤɨɧɬɟɤɫɬɚɦ, ɦɵ ɦɨɠɟɦ ɫ ɞɨɫɬɚɬɨɱɧɨ ɛɨɥɶɲɨɣ ɞɨɥɟɣ ɭɜɟɪɟɧɧɨɫɬɢ ɭɬɜɟɪɠɞɚɬɶ, ɱɬɨ ɞɥɹ ɦɧɨɝɢɯ ɬɢɩɨɜ ɞɚɧɧɵɯ ɷɬɢ ɫɢɦɜɨɥɵ ɛɭɞɭɬ ɨɞɢɧɚɤɨɜɵ. ȼ ɱɚɫɬɧɨɫɬɢ, ɤ ɬɚɤɢɦ ɬɢɩɚɦ ɞɚɧɧɵɯ ɨɬɧɨɫɹɬɫɹ ɮɚɣɥɵ, ɫɨɞɟɪɠɚɳɢɟ ɬɟɤɫɬ ɧɚ ɟɫɬɟɫɬɜɟɧɧɨɦ ɹɡɵɤɟ. Ɉɞɧɚɤɨ ɜɨɡɦɨɠɧɵ ɧɟɛɨɥɶɲɢɟ ɧɚɪɭɲɟɧɢɹ ɬɚɤɨɣ ɡɚɤɨɧɨɦɟɪɧɨɫɬɢ — ɡɚ ɫɱɟɬ ɨɲɢɛɨɤ, ɡɚ ɫɱɟɬ ɧɚɥɢɱɢɹ ɛɨɥɶɲɢɯ ɛɭɤɜ ɜ ɧɚɱɚɥɟ ɩɪɟɞɥɨɠɟɧɢɹ, ɩɟɪɟɧɨɫɨɜ ɫɥɨɜ ɢ ɬ. ɞ. ɗɬɢ ɧɚɪɭɲɟɧɢɹ ɧɚ ɜɵɯɨɞɟ BWT ɱɚɫɬɨ ɜɵɝɥɹɞɹɬ ɤɚɤ ɧɟɛɨɥɶɲɢɟ ɜɤɪɚɩɥɟɧɢɹ ɩɨɫɬɨɪɨɧɧɢɯ ɫɢɦɜɨɥɨɜ ɫɪɟɞɢ ɞɥɢɧɧɨɣ ɰɟɩɨɱɤɢ ɨɞɢɧɚɤɨɜɵɯ. Ɉɱɟɜɢɞɧɨ, ɜɤɪɚɩɥɟɧɢɹ ɢɡ ɨɞɧɨɝɨ ɪɟɞɤɨɝɨ ɫɢɦɜɨɥɚ ɛɭɞɭɬ ɜɫɬɪɟɱɚɬɶɫɹ ɱɚɳɟ ɞɜɨɣɧɵɯ, ɬɪɨɣɧɵɯ ɢ ɛɨɥɟɟ ɞɥɢɧɧɵɯ. Ɇɨɠɧɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɩɪɢ MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɢ ɬɚɤɢɟ ɨɞɢɧɨɱɧɵɟ ɫɢɦɜɨɥɵ ɩɪɢɜɨɞɹɬ ɤ ɞɜɨɣɧɨɦɭ ɩɨɹɜɥɟɧɢɸ ɟɞɢɧɢɱɧɵɯ ɤɨɞɨɜ, ɱɬɨ ɭɯɭɞɲɚɟɬ ɧɚɦ ɫɬɚɬɢɫɬɢɤɭ. ɋɩɨɫɨɛ ɩɪɟɨɞɨɥɟɧɢɹ ɬɚɤɨɣ ɧɟɩɪɢɹɬɧɨɫɬɢ ɞɨɜɨɥɶɧɨ ɩɪɨɫɬ. ɋɥɟɞɭɟɬ ɨɬɥɨɠɢɬɶ ɩɪɨɞɜɢɠɟɧɢɟ ɫɢɦɜɨɥɚ ɧɚ ɜɟɪɯɭɲɤɭ ɫɩɢɫɤɚ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɟɫɥɢ ɷɬɨɬ ɫɢɦɜɨɥ ɧɟ ɧɚɯɨɞɢɬɫɹ ɜ ɩɨɡɢɰɢɢ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɤɨɞɭ 1. ȼɨɬ ɤɚɤ ɛɭɞɟɬ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 217 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɜɵɝɥɹɞɟɬɶ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ “ɪɞɚɤɪɚɚɚɚɛɛ” ɜ ɷɬɨɦ ɫɥɭɱɚɟ: ɋɢɦɜɨɥ ɪ ɞ ɚ ɤ ɪ ɚ ɚ ɚ ɚ ɛ ɛ
ɋɩɢɫɨɤ ɚɛɞɤɪ ɚɪɛɞɤ ɚɞɪɛɤ ɚɞɪɛɤ ɚɤɞɪɛ ɚɪɤɞɛ ɚɪɤɞɛ ɚɪɤɞɛ ɚɪɤɞɛ ɚɪɤɞɛ ɚɛɪɤɞ
ȼɵɯɨɞ 4 3 0 4 3 0 0 0 0 4 1
Ɋɢɫ. 5.13. Ɇɨɞɢɮɢɰɢɪɨɜɚɧɧɨɟ MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɫɬɪɨɤɢ “ɪɞɚɤɪɚɚɚɚɛɛ” ɉɪɟɢɦɭɳɟɫɬɜɨ ɬɚɤɨɣ ɦɨɞɢɮɢɤɚɰɢɢ ɜɢɞɧɨ ɧɚ ɩɪɢɦɟɪɟ MTFɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɬɢɩɢɱɧɨɣ ɞɥɹ ɚɧɝɥɢɣɫɤɢɯ ɬɟɤɫɬɨɜ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ “ttttTtttwtt”, ɩɨɥɭɱɟɧɧɨɣ ɢɡ ɱɚɫɬɢ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ ɦɚɬɪɢɰɵ ɩɟɪɟɫɬɚɧɨɜɨɤ: he_ ... t he_ ... t he_ ... t he_ ... t he_ ... T he_ ... t he_ ... t hen_ ... t hen_ ... w hen_ ... t hen_ ... t
218 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɪɟɞɩɨɥɨɠɢɜ, ɱɬɨ ɭɩɨɪɹɞɨɱɟɧɧɵɣ ɫɩɢɫɨɤ ɫɨɞɟɪɠɢɬ ɫɢɦɜɨɥɵ ɜ ɩɨɪɹɞɤɟ {‘t’, ‘w’, ‘T’ ...}, ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɢɦɟɧɟɧɢɹ ɦɟɬɨɞɚ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ ɩɨɥɭɱɚɟɦ ɫɥɟɞɭɸɳɢɟ ɪɟɡɭɥɶɬɚɬɵ: ttttTtttwtt 00002100210 00002000200
ɨɛɵɱɧɵɣ MTF ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɵɣ MTF
Ʉɚɤ ɜɢɞɧɨ ɢɡ ɩɪɢɦɟɪɚ, ɧɚ ɬɢɩɚɯ ɞɚɧɧɵɯ, ɨɛɥɚɞɚɸɳɢɯ ɨɩɢɫɚɧɧɵɦɢ ɫɜɨɣɫɬɜɚɦɢ, ɭɫɨɜɟɪɲɟɧɫɬɜɨɜɚɧɧɵɣ ɦɟɬɨɞ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ ɞɚɟɬ ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɤɨɞɨɜ MTF, ɤɨɬɨɪɨɟ ɥɭɱɲɟ ɩɨɞɞɚɟɬɫɹ ɫɠɚɬɢɸ ɡɚ ɫɱɟɬ ɛɨɥɶɲɟɝɨ ɤɨɥɢɱɟɫɬɜɚ ɧɭɥɟɜɵɯ ɤɨɞɨɜ. ɇɨ ɜ ɫɥɭɱɚɟ ɩɨɹɜɥɟɧɢɹ ɞɜɨɣɧɵɯ ɪɟɞɤɢɯ ɫɢɦɜɨɥɨɜ, ɷɬɨɬ ɦɟɬɨɞ ɞɚɟɬ ɪɟɡɭɥɶɬɚɬɵ ɯɭɠɟ ɤɥɚɫɫɢɱɟɫɤɨɝɨ MTF. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɧɚɦ ɩɨɩɚɥɚɫɶ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ “ttttTTtttwwtt”: ttttTTtttwwtt 0000201002010 0000211002110
ɨɛɵɱɧɵɣ MTF ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɵɣ MTF
ɇɨ, ɤɚɤ ɭɠɟ ɛɵɥɨ ɡɚɦɟɱɟɧɨ, ɜɟɪɨɹɬɧɨɫɬɶ ɩɨɹɜɥɟɧɢɹ ɞɜɭɯ ɢɞɭɳɢɯ ɩɨɞɪɹɞ ɪɟɞɤɢɯ ɫɢɦɜɨɥɨɜ ɦɟɧɶɲɟ, ɱɟɦ ɜɟɪɨɹɬɧɨɫɬɶ ɩɨɹɜɥɟɧɢɹ ɨɞɧɨɝɨ. Ʉɚɪɬɢɧɭ ɬɚɤɠɟ ɦɨɠɟɬ ɢɫɩɨɪɬɢɬɶ ɫɢɬɭɚɰɢɹ, ɤɨɝɞɚ ɦɵ ɢɦɟɟɦ ɞɟɥɨ ɫ ɫɢɦɜɨɥɚɦɢ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɦɢ ɧɟ ɭɫɬɨɣɱɢɜɵɦ ɤɨɧɬɟɤɫɬɚɦ, ɚ ɭɱɚɫɬɤɭ ɫɦɟɧɵ ɨɞɧɨɝɨ ɤɨɧɬɟɤɫɬɚ ɞɪɭɝɢɦ. ȼ ɷɬɨɦ ɫɥɭɱɚɟ ɡɚɞɟɪɠɤɚ ɜ ɩɟɪɟɦɟɳɟɧɢɢ ɫɢɦɜɨɥɚ ɤ ɜɟɪɲɢɧɟ ɫɩɢɫɤɚ ɦɨɠɟɬ ɫɨɫɥɭɠɢɬɶ ɩɥɨɯɭɸ ɫɥɭɠɛɭ ɩɪɢ ɨɬɫɥɟɠɢɜɚɧɢɢ ɩɨɹɜɥɟɧɢɹ ɧɨɜɨɝɨ ɭɫɬɨɣɱɢɜɨɝɨ ɤɨɧɬɟɤɫɬɚ. ɋɩɪɚɜɟɞɥɢɜɨɫɬɢ ɪɚɞɢ ɫɬɨɢɬ ɨɬɦɟɬɢɬɶ, ɱɬɨ ɢ ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɨɟ MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɜɫɟ ɠɟ ɨɛɵɱɧɨ ɪɟɚɝɢɪɭɟɬ ɞɨɫɬɚɬɨɱɧɨ ɛɵɫɬɪɨ. Ɋɟɡɸɦɢɪɭɹ, ɦɨɠɧɨ ɫɤɚɡɚɬɶ, ɱɬɨ ɨɩɢɫɚɧɧɵɣ ɜɚɪɢɚɧɬ ɦɟɬɨɞɚ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ ɧɚ ɬɟɤɫɬɨɜɵɯ ɞɚɧɧɵɯ ɨɤɚɡɵɜɚɟɬɫɹ ɥɭɱɲɟ ɤɥɚɫɫɢɱɟɫɤɨɝɨ, ɚ ɨɞɧɨɡɧɚɱɧɨ ɩɨɪɭɱɢɬɶɫɹ ɡɚ ɫɨɯɪɚɧɟɧɢɟ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 219 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɬɚɤɨɝɨ ɩɪɟɢɦɭɳɟɫɬɜɚ ɩɪɢ ɨɛɪɚɛɨɬɤɟ ɞɚɧɧɵɯ ɞɪɭɝɨɝɨ ɬɢɩɚ ɧɟɥɶɡɹ. ȼɨɡɦɨɠɧɨ, ɛɨɥɟɟ ɩɪɚɜɢɥɶɧɵɦ ɜɵɛɨɪɨɦ ɛɭɞɟɬ ɩɪɟɞɜɚɪɢɬɟɥɶɧɵɣ ɚɧɚɥɢɡ ɞɚɧɧɵɯ ɢɥɢ ɩɨɞɫɱɟɬ ɱɢɫɥɚ ɨɬɥɨɠɟɧɧɵɯ ɩɟɪɟɦɟɳɟɧɢɣ ɧɚ ɜɟɪɲɢɧɭ ɫɩɢɫɤɚ ɞɥɹ ɩɪɢɧɹɬɢɹ ɪɟɲɟɧɢɹ, ɤɚɤɨɣ ɢɡ ɜɚɪɢɚɧɬɨɜ ɢɫɩɨɥɶɡɨɜɚɬɶ.
ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤɨɣ ɢɡ ɦɟɬɨɞɨɜ MTFɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɛɭɞɟɬ ɷɮɮɟɤɬɢɜɧɟɟ ɞɥɹ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɫɢɦɜɨɥɨɜ “aaacbaaa”? ɉɪɟɞɩɨɥɨɠɢɦ, ɱɬɨ ɧɚɱɚɥɶɧɵɣ ɭɩɨɪɹɞɨɱɟɧɧɵɣ ɫɩɢɫɨɤ ɫɢɦɜɨɥɨɜ ɜɵɝɥɹɞɢɬ ɤɚɤ {‘a’, ‘b’, ‘c’}.
ɉɪɟɢɦɭɳɟɫɬɜɨ ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɨɝɨ ɚɥɝɨɪɢɬɦɚ ɞɥɹ ɬɟɤɫɬɨɜɵɯ ɞɚɧɧɵɯ ɦɨɠɧɨ ɨɰɟɧɢɬɶ ɧɚ ɩɪɢɦɟɪɟ ɮɚɣɥɚ book1 ɢɡ ɧɚɛɨɪɚ ɮɚɣɥɨɜ CalgCC, ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɨɝɨ ɞɥɹ ɨɰɟɧɤɢ ɚɪɯɢɜɚɬɨɪɨɜ. ɇɢɠɟ ɩɪɢɜɨɞɹɬɫɹ ɱɚɫɬɨɬɵ ɪɚɧɝɨɜ ɞɥɹ ɨɛɨɢɯ ɦɟɬɨɞɨɜ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ. Ɋɚɧɝ 0 1 2 3 4 5 6 7 8 9 10 11 12
MTF ɨɛɵɱɧɵɣ (%) 49.77 15.36 7.91 5.28 3.79 2.91 2.35 1.98 1.68 1.45 1.26 1.06 0.91
MTF ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɵɣ (%) 51.43 14.93 7.45 4.96 3.67 2.81 2.29 1.94 1.63 1.44 1.23 1.05 0.90
220 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɋɚɧɝ 13-255
MTF ɨɛɵɱɧɵɣ (%) 4.33
MTF ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɵɣ (%) 4.31
Ɋɢɫ. 5.14. ɋɬɚɬɢɫɬɢɤɚ ɪɚɧɝɨɜ MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɞɥɹ ɮɚɣɥɚ book1 1-2 ɄɈȾɂɊɈȼȺɇɂȿ
ɉɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɞɥɢɧ ɩɨɜɬɨɪɨɜ ɫɢɦɜɨɥɨɜ ɩɪɢɦɟɧɢɬɟɥɶɧɨ ɤ ɩɪɟɨɛɪɚɡɨɜɚɧɢɸ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɫɬɨɢɬ 2 ɡɚɞɚɱɢ: 1) ɨɛɟɫɩɟɱɢɬɶ ɤɨɞɢɪɨɜɚɧɢɟ ɱɢɫɟɥ ɥɸɛɨɣ ɜɟɥɢɱɢɧɵ, 2) ɚɞɚɩɬɢɪɨɜɚɬɶɫɹ ɤ ɢɡɦɟɧɟɧɢɸ ɜɟɥɢɱɢɧɵ ɢɡɛɵɬɨɱɧɨɫɬɢ ɞɚɧɧɵɯ. Ⱦɚɧɧɵɟ ɡɚɞɚɱɢ ɭɫɩɟɲɧɨ ɪɟɲɚɟɬ ɚɥɝɨɪɢɬɦ, ɧɚɲɟɞɲɢɣ ɩɪɢɦɟɧɟɧɢɟ ɜ ɪɹɞɟ ɚɪɯɢɜɚɬɨɪɨɜ (bzip2, IMP, BWC) ɢ ɧɚɡɜɚɧɧɵɣ 1-2 ɤɨɞɢɪɨɜɚɧɢɟ. ɋɭɬɶ ɟɝɨ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɱɢɫɥɨ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɟ ɤɨɥɢɱɟɫɬɜɭ ɩɨɜɬɨɪɨɜ, ɤɨɞɢɪɭɟɬɫɹ ɩɨɫɪɟɞɫɬɜɨɦ ɞɜɭɯɫɢɦɜɨɥɶɧɨɝɨ ɚɥɮɚɜɢɬɚ. ɉɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ 1-2 ɤɨɞɢɪɨɜɚɧɢɹ ɜ ɫɜɹɡɤɟ ɫ MTF, ɦɵ ɨɬɜɨɞɢɦ ɩɨɞ ɧɭɥɟɜɨɣ ɪɚɧɝ ɧɟ ɨɞɢɧ, ɚ ɞɜɚ ɫɢɦɜɨɥɚ (ɧɚɡɨɜɟɦ ɢɯ z1 ɢ z2), ɭɜɟɥɢɱɢɜɚɹ ɬɚɤɢɦ ɨɛɪɚɡɨɦ ɚɥɮɚɜɢɬ ɞɨ 257 ɫɢɦɜɨɥɨɜ. ɋɢɦɜɨɥ, ɨɬɥɢɱɧɵɣ ɨɬ z1 ɢ z2, ɹɜɥɹɟɬɫɹ ɩɪɢɡɧɚɤɨɦ ɨɤɨɧɱɚɧɢɹ ɡɚɩɢɫɢ ɱɢɫɥɚ ɩɨɜɬɨɪɨɜ. ɑɢɫɥɨ ɩɨɜɬɨɪɨɜ ɤɨɞɢɪɭɟɬɫɹ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ: ɑɢɫɥɨ ɩɨɜɬɨɪɨɜ 1 2 3 4 5 6 7 8 9
Ʉɨɞ z1 z2 z1z1 z1z2 z1z1 z2z2 z1z1z1 z1z1z2 z1z2z1
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 221 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɑɢɫɥɨ ɩɨɜɬɨɪɨɜ 10 11 12 13 14 15 ...
Ʉɨɞ z1z2z2 z2z1z1 z2z1z2 z2z2z1 z2z2z2 z1z1z1z1
Ɋɢɫ. 5.15. 1-2 Ʉɨɞɢɪɨɜɚɧɢɟ ɱɢɫɟɥ ɍɩɪɚɠɧɟɧɢɟ: Ɂɚɤɨɞɢɪɭɣɬɟ ɩɨɫɪɟɞɫɬɜɨɦ ɨɩɢɫɚɧɧɨɝɨ ɚɥɝɨɪɢɬɦɚ ɱɢɫɥɨ 30. Ʉɚɤɨɦɭ ɱɢɫɥɭ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ z2z2z1z1z2?
Ʉɚɤ ɦɨɠɧɨ ɜɢɞɟɬɶ, ɞɚɧɧɵɣ ɫɩɨɫɨɛ ɨɛɟɫɩɟɱɢɜɚɟɬ ɤɨɞɢɪɨɜɚɧɢɟ ɱɢɫɟɥ ɜ ɥɸɛɨɦ ɞɢɚɩɚɡɨɧɟ. ɗɬɨɬ ɦɟɬɨɞ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɢ ɜɬɨɪɨɦɭ ɢɡ ɩɪɟɞɴɹɜɥɹɟɦɵɯ ɬɪɟɛɨɜɚɧɢɣ. ɍɜɟɥɢɱɟɧɢɟ ɢɡɛɵɬɨɱɧɨɫɬɢ ɞɚɧɧɵɯ, ɩɪɢɜɨɞɹɳɟɟ ɤ ɜɨɡɪɚɫɬɚɧɢɸ ɤɨɧɰɟɧɬɪɚɰɢɢ ɧɭɥɟɜɵɯ ɪɚɧɝɨɜ MTF, ɩɪɢɜɨɞɢɬ ɤ ɭɜɟɥɢɱɟɧɢɸ ɱɚɫɬɨɬ ɫɢɦɜɨɥɨɜ z1 ɢ z2. ɉɪɢɱɟɦ, ɟɫɥɢ ɩɪɟɨɛɥɚɞɚɸɬ ɤɨɪɨɬɤɢɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ MTF-0, ɬɨ ɱɚɫɬɨɬɚ ɫɢɦɜɨɥɚ z1 ɩɪɟɜɨɫɯɨɞɢɬ ɱɚɫɬɨɬɭ ɫɢɦɜɨɥɚ z2. ɉɪɟɞɜɢɞɹ ɜɨɡɦɨɠɧɨɟ ɡɚɦɟɱɚɧɢɟ ɨ ɬɨɦ, ɱɬɨ, ɧɚɩɪɢɦɟɪ, ɱɢɫɥɨ 7 ɩɪɢɜɨɞɢɬ ɤ ɛɨɥɶɲɟɦɭ ɜɨɡɪɚɫɬɚɧɢɸ ɱɚɫɬɨɬɵ ɫɢɦɜɨɥɚ z1, ɱɟɦ ɱɢɫɥɨ 1, ɨɬɦɟɬɢɦ ɫɥɟɞɭɸɳɟɟ. Ʉɚɤ ɩɪɚɜɢɥɨ, ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɱɚɫɬɨɬ ɱɢɫɟɥ ɩɨɜɬɨɪɨɜ ɜ ɫɪɟɞɧɟɦ ɭɛɵɜɚɟɬ ɫ ɪɨɫɬɨɦ ɱɢɫɥɚ, ɚ ɱɚɫɬɨɬɵ ɩɨɹɜɥɟɧɢɣ ɛɥɢɡɤɢɯ ɩɨ ɡɧɚɱɟɧɢɸ ɱɢɫɟɥ ɛɥɢɡɤɢ. ɉɪɢɱɟɦ ɨɛɵɱɧɨ ɫ ɪɨɫɬɨɦ ɱɢɫɟɥ ɪɚɡɥɢɱɢɟ ɱɚɫɬɨɬ ɭɦɟɧɶɲɚɟɬɫɹ. ɉɨɷɬɨɦɭ: 1) ɱɚɫɬɨɬɚ ɱɢɫɥɚ 7 ɛɨɥɶɲɟ ɱɚɫɬɨɬɵ ɱɢɫɥɚ 1 ɬɨɥɶɤɨ ɜ ɪɟɞɤɢɯ, ɫɤɨɪɟɟ ɜɵɪɨɠɞɟɧɧɵɯ ɫɥɭɱɚɹɯ, 2) ɭɜɟɥɢɱɟɧɢɟ ɱɚɫɬɨɬɵ ɱɢɫɥɚ 7 ɡɚ ɫɱɟɬ ɩɪɟɨɛɥɚɞɚɧɢɹ ɧɚɞ ɱɚɫɬɨɬɚɦɢ ɱɢɫɟɥ 8, 9 ɢ 10 ɩɪɢɜɨɞɢɬ ɤ ɛɨɥɟɟ ɢɧɬɟɧɫɢɜɧɨɦɭ ɢɫɩɨɥɶɡɨɜɚɧɢɸ ɫɢɦɜɨɥɚ z1, ɬ.ɤ. ɱɢɫɥɨ ɫɢɦɜɨɥɨɜ z1 ɜ ɤɨɞɟ, ɫɨɨɬɜɟɬɫɬ222 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɜɭɸɳɟɦ ɱɢɫɥɭ 7, ɦɚɤɫɢɦɚɥɶɧɨ ɫɪɟɞɢ ɜɫɟɯ ɬɪɟɯɫɢɦɜɨɥɶɧɵɯ ɤɨɞɨɜ. ȼ ɰɟɥɨɦ, ɩɪɟɨɛɥɚɞɚɧɢɟ ɱɚɫɬɨɬɵ ɫɢɦɜɨɥɚ z1 ɧɚɞ ɱɚɫɬɨɬɨɣ ɫɢɦɜɨɥɚ z2 ɨɩɪɟɞɟɥɹɟɬɫɹ ɩɪɟɨɛɥɚɞɚɧɢɟɦ ɱɚɫɬɨɬɵ ɨɞɧɨɣ ɝɪɭɩɩɵ ɫɢɦɜɨɥɨɜ ɧɚɞ ɞɪɭɝɨɣ: ɝɪɭɩɩɚ, ɩɪɢɜɨɞɹɳɚɹ ɤ ɪɨɫɬɭ ɞɨɥɢ z1 1 3 5 7 ... 3,4 7,8 11,12 ... 7-10 15-18 ...
ɝɪɭɩɩɚ, ɩɪɢɜɨɞɹɳɚɹ ɤ ɪɨɫɬɭ ɞɨɥɢ z2 2 4 6 8 … 5,6 9,10 13,14 … 11-14 19-22 …
Ɋɢɫ. 5.16. ɋɜɨɣɫɬɜɚ 1-2 ɤɨɞɢɪɨɜɚɧɢɹ ɉɨɫɥɟ ɞɜɭɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ ɫɬɪɨɤɚ “ɚɛɪɚɤɚɞɚɛɪɚ” ɜɵɝɥɹɞɟɥɚ ɤɚɤ {4,3,2,4,3,2,0,0,0,4,0}. ɉɨɞɜɟɪɝɧɟɦ ɟɟ 1-2 ɤɨɞɢɪɨɜɚɧɢɸ. ȼɨɫɩɨɥɶɡɨɜɚɜɲɢɫɶ ɜɵɲɟɩɪɢɜɟɞɟɧɧɵɦ ɪɢɫɭɧɤɨɦ, ɩɨɥɭɱɢɦ {4,3,2,4,3,2,z1,z1,4,z1}.
ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤ ɛɭɞɟɬ ɜɵɝɥɹɞɟɬɶ ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ ɜ ɪɟɡɭɥɶɬɚɬɟ ɭɤɚɡɚɧɧɵɯ ɞɜɭɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ ɢ 1-2 ɤɨɞɢɪɨɜɚɧɢɹ, ɟɫɥɢ ɜɦɟɫɬɨ ɨɛɵɱɧɨɝɨ ɩɪɢɦɟɧɢɬɶ ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɵɣ MTF? Ⱦɥɹ ɫɩɪɚɜɤɢ: ɩɨɫɥɟ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 223 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
BWT ɢ ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɨɝɨ MTF ɛɵɥɚ ɩɨɥɭɱɟɧɚ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ {4,3,0,4,2,0,0,0,0,4,1}.
ɊȿȺɅɂɁȺɐɂə 1-2 ɄɈȾɂɊɈȼȺɇɂə // Ɏɭɧɤɰɢɹ 1-2 ɤɨɞɢɪɨɜɚɧɢɹ. // ȼɵɜɨɞɢɬ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɫɢɦɜɨɥɨɜ z1 ɢ // z2, ɫɨɨɬɜɟɬɫɬɜɭɸɳɭɸ ɱɢɫɥɭ count. void z1z2( int count ) { // ɞɥɢɧɚ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ int len=0; // ɱɢɫɥɨ 0 ɧɟ ɤɨɞɢɪɭɟɬɫɹ if( !count ) return; // ɧɚɯɨɞɢɦ ɞɥɢɧɭ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ { int t = count+1; do { len++; t >>= 1; } while( t > 1 ); } // ɤɨɞɢɪɨɜɚɧɢɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ do { len--; putc((count & (1<
224 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
} } z1z2( count ); } // ɞɟɤɨɞɢɪɨɜɚɧɢɟ void decode( void ) { unsigned char c; int count = 0; // ɱɢɫɥɨ ɩɨɜɬɨɪɨɜ while( !feof( input ) ) { c = getc( input ); // ɱɬɟɧɢɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ z1z2 if ( c == z1 ) { count += count + 1; } else if( c == z2 ) { count += count + 2; } else { // ɜɵɜɨɞ MTF-0, ɡɚɞɚɧɧɵɟ ɱɢɫɥɨɦ count while( count-- ) putc( 0, output ); putc( in[i], output ); } i++; } while( count-- ) putc( 0, output ); }
ɄɈȾɂɊɈȼȺɇɂȿ ɊȺɋɋɌɈəɇɂɃ
ȼ ɬɟɱɟɧɢɟ ɧɟɫɤɨɥɶɤɢɯ ɥɟɬ ɦɟɬɨɞ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ ɛɵɥ ɧɟɩɪɟɦɟɧɧɵɦ ɚɬɪɢɛɭɬɨɦ ɚɪɯɢɜɚɬɨɪɚ, ɩɨɫɬɪɨɟɧɧɨɝɨ ɧɚ ɨɫɧɨɜɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ. ȼ ɫɢɥɭ ɬɨɝɨ, ɱɬɨ ɷɬɨɬ ɚɥɝɨɪɢɬɦ ɧɟɞɨɫɬɚɬɨɱɧɨ ɬɨɱɧɨ ɭɱɢɬɵɜɚɥ ɫɨɨɬɧɨɲɟɧɢɟ ɱɚɫɬɨɬ ɫɢɦɜɨɥɨɜ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɯ ɪɚɡɧɵɦ ɪɚɧɝɚɦ, ɪɚɡɪɚɛɨɬɱɢɤɢ ɩɨɫɬɨɹɧɧɨ ɫɬɪɟɦɢɥɢɫɶ ɧɚɣɬɢ ɞɨɫɬɨɣɧɭɸ ɡɚɦɟɧɭ. Ɉɞɧɢɦ ɢɡ ɧɚɢɛɨɥɟɟ ɪɚɫɩɪɨɫɬɪɚɧɟɧɧɵɯ ɛɵɥ ɩɨɞɯɨɞ, ɩɪɢ ɤɨɬɨɪɨɦ ɨɬɞɟɥɶɧɨ ɫɬɪɨɢɥɚɫɶ ɦɨɞɟɥɶ ɞɥɹ ɧɚɢɛɨɥɟɟ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɵɯ ɫɢɦɜɨɥɨɜ. Ⱦɥɹ ɬɚɤɢɯ ɫɢɦɜɨɥɨɜ ɜɟɪɨɹɬɧɨɫɬɢ ɩɪɨɫɱɢɬɵɜɚɥɢɫɶ ɨɬɞɟɥɶɧɨ. ȼɩɟɪɜɵɟ ɷɬɨɬ ɩɨɞɯɨɞ ɛɵɥ ɨɩɢɫɚɧ ɉɟɬɟɪɨɦ Ɏɟɧɜɢɤɨɦ [18], ɧɨ ɚɜɬɨɪɭ ɧɟ ɭɞɚɥɨɫɶ ɩɪɟɜɡɨɣɬɢ ɪɟɡɭɥɶɬɚɬɵ ɦɨɞɟɥɢ, ɢɫɩɨɥɶɡɭɸɳɟɣ ɬɪɚɞɢɰɢɨɧɧɵɣ ɩɨɞɯɨɞ. Ȼɨɥɟɟ ɭɞɚɱɧɵɦ ɛɵɥɨ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 225 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɪɢɦɟɧɟɧɢɟ ɤɷɲɢɪɨɜɚɧɢɹ ɧɚɢɛɨɥɟɟ ɱɚɫɬɵɯ ɫɢɦɜɨɥɨɜ ɜ ɚɪɯɢɜɚɬɨɪɟ szip, ɪɚɡɪɚɛɨɬɚɧɧɨɦ ɒɢɧɞɥɟɪɨɦ [33]. ɋɚɦɵɦ ɩɨɡɞɧɢɦ ɢɡ ɦɟɬɨɞɨɜ, ɩɪɢɲɟɞɲɢɯ ɧɚ ɫɦɟɧɭ MTF, ɹɜɥɹɟɬɫɹ ɦɟɬɨɞ ɤɨɞɢɪɨɜɚɧɢɹ ɪɚɫɫɬɨɹɧɢɣ (Distance Coding). ɉɟɪɜɵɣ ɠɟ ɢɡ ɚɪɯɢɜɚɬɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɷɬɨɬ ɦɟɬɨɞ, ɫɭɦɟɥ ɩɪɟɜɡɨɣɬɢ ɫɜɨɢɯ ɤɨɧɤɭɪɟɧɬɨɜ ɩɨ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɛɨɥɶɲɢɧɫɬɜɚ ɬɢɩɨɜɵɯ ɞɚɧɧɵɯ. Ɍɟɩɟɪɶ, ɩɨɦɢɦɨ ɚɪɯɢɜɚɬɨɪɚ DC, ɤɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ ɢɫɩɨɥɶɡɭɸɬ YBS ɢ SBC. Ȼɵɥɢ ɩɭɛɥɢɤɚɰɢɢ, ɩɨɫɜɹɳɟɧɧɵɟ ɪɨɞɫɬɜɟɧɧɨɦɭ ɦɟɬɨɞɭ, ɧɚɡɜɚɧɧɨɦɭ Inversed Frequencies ɚɜɬɨɪɚɦɢ ɨɞɧɨɣ ɢɡ ɪɚɛɨɬ [5,1]. ɉɨɦɢɦɨ ɦɟɬɨɞɚ ɤɨɞɢɪɨɜɚɧɢɹ ɪɚɫɫɬɨɹɧɢɣ, ɧɢɠɟ ɦɵ ɪɚɫɫɦɨɬɪɢɦ ɢ ɟɝɨ. ȼɨɡɶɦɟɦ ɞɥɹ ɩɪɢɦɟɪɚ ɬɭ ɠɟ ɫɬɪɨɤɭ “ɪɞɚɤɪɚɚɚɚɛɛ”, ɩɨɥɭɱɟɧɧɭɸ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ. ȼ ɤɚɱɟɫɬɜɟ ɩɟɪɜɨɝɨ, ɩɨɞɝɨɬɨɜɢɬɟɥɶɧɨɝɨ ɷɬɚɩɚ, ɧɚɦ ɫɥɟɞɭɟɬ ɨɩɪɟɞɟɥɢɬɶ ɩɟɪɜɵɟ ɜɯɨɠɞɟɧɢɹ ɫɢɦɜɨɥɨɜ ɜ ɞɚɧɧɭɸ ɫɬɪɨɤɭ. Ⱦɥɹ ɷɬɨɝɨ ɜ ɧɚɱɚɥɨ ɫɬɪɨɤɢ ɩɪɢɩɢɲɟɦ ɜɫɟ ɫɢɦɜɨɥɵ ɚɥɮɚɜɢɬɚ ɜ ɩɪɨɢɡɜɨɥɶɧɨɦ, ɧɚɩɪɢɦɟɪ, ɜ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɨɦ, ɩɨɪɹɞɤɟ. ɉɨɫɤɨɥɶɤɭ ɩɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ ɦɵ ɦɨɠɟɦ ɩɪɨɞɟɥɚɬɶ ɬɨ ɠɟ ɫɚɦɨɟ, ɞɚɧɧɚɹ ɨɩɟɪɚɰɢɹ ɹɜɥɹɟɬɫɹ ɨɛɪɚɬɢɦɨɣ. Ⱦɥɹ ɭɞɨɛɫɬɜɚ ɞɨɛɚɜɢɦ ɜ ɤɨɧɟɰ ɫɬɪɨɤɢ ɫɢɦɜɨɥ, ɨɡɧɚɱɚɸɳɢɣ ɤɨɧɟɰ ɛɥɨɤɚ. ɉɪɢ ɫɫɵɥɤɟ ɧɚ ɷɬɨɬ ɫɢɦɜɨɥ ɦɵ ɦɨɠɟɦ ɪɚɫɩɨɡɧɚɬɶ ɨɤɨɧɱɚɧɢɟ ɰɟɩɨɱɤɢ ɫɢɦɜɨɥɨɜ, ɨɬ ɤɨɬɨɪɵɯ ɷɬɚ ɫɫɵɥɤɚ ɫɞɟɥɚɧɚ. Ɉɛɨɡɧɚɱɢɦ ɫɢɦɜɨɥ ɤɨɧɰɚ ɛɥɨɤɚ ɤɚɤ ‘$’. ɂɬɚɤ, ɩɨɫɥɟ ɷɬɢɯ ɩɪɢɝɨɬɨɜɥɟɧɢɣ ɧɚɲɚ ɫɬɪɨɤɚ ɜɵɝɥɹɞɢɬ ɤɚɤ “ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$”. ɉɪɢɱɟɦ ɩɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ ɧɚɦ ɧɚ ɷɬɨɦ ɩɨɞɝɨɬɨɜɢɬɟɥɶɧɨɦ ɷɬɚɩɟ ɢɡɜɟɫɬɧɵ ɩɟɪɜɵɟ ɫɢɦɜɨɥɵ ɫɬɪɨɤɢ, “ɚɛɞɤɪ”, ɢ ɩɨɫɥɟɞɧɢɣ ‘$’. ɫɬɪɨɤɚ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ:
ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$ ɚɛɞɤɪ...........$
Ɍɟɩɟɪɶ ɡɚɣɦɟɦɫɹ ɫɨɛɫɬɜɟɧɧɨ ɤɨɞɢɪɨɜɚɧɢɟɦ ɪɚɫɫɬɨɹɧɢɣ. Ⱦɥɹ ɷɬɨɝɨ ɛɟɪɟɦ ɩɟɪɜɵɣ ɫɢɦɜɨɥ ‘ɚ’ ɢ ɢɳɟɦ ɛɥɢɠɚɣɲɢɣ ɬɚɤɨɣ ɠɟ. 226 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɋɚɫɫɬɨɹɧɢɟ ɞɨ ɧɟɝɨ ɪɚɜɧɨ 6 — ɷɬɨ ɱɢɫɥɨ ɢɧɵɯ ɫɢɦɜɨɥɨɜ ɦɟɠɞɭ ‘ɚ’. Hɨ ɢɡ ɷɬɢɯ ɲɟɫɬɢ ɫɢɦɜɨɥɨɜ ɧɚɦ ɭɠɟ ɢɡɜɟɫɬɧɵ ɱɟɬɵɪɟ ɢ ɩɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ ɦɵ ɡɚɪɚɧɟɟ ɡɧɚɟɦ, ɱɬɨ ɨɱɟɪɟɞɧɨɣ ɫɢɦɜɨɥ ‘ɚ’ ɧɢɤɚɤ ɧɟ ɦɨɠɟɬ ɩɨɩɚɫɬɶ ɜ ɷɬɢ ɩɨɡɢɰɢɢ. ɇɚɲɚ ɡɚɞɚɱɚ — ɡɚɤɨɞɢɪɨɜɚɬɶ ɧɨɦɟɪ ɬɨɣ ɜɚɤɚɧɬɧɨɣ ɩɨɡɢɰɢɢ, ɧɚ ɤɨɬɨɪɭɸ ɜɵɩɚɞɚɟɬ ɷɬɨɬ ɫɢɦɜɨɥ. ɗɬɨ ɧɨɦɟɪ 6 – 4 = 2. ɫɬɪɨɤɚ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ:
ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$ ɚɛɞɤɪ..ɚ........$ 2
Ⱥɧɚɥɨɝɢɱɧɨ ɤɨɞɢɪɭɟɦ ɟɳɟ ɧɟɫɤɨɥɶɤɨ ɫɢɦɜɨɥɨɜ ɩɨ ɨɱɟɪɟɞɢ, ɩɨɞɫɱɢɬɵɜɚɹ ɱɢɫɥɨ ɬɨɱɟɤ, ɫɢɦɜɨɥɢɡɢɪɭɸɳɢɯ ɧɟɡɚɧɹɬɵɟ ɩɨɡɢɰɢɢ, ɜ ɫɬɪɨɤɟ ɢɡɜɟɫɬɧɵɯ ɫɢɦɜɨɥɨɜ. ɫɬɪɨɤɚ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ:
ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$ ɚɛɞɤɪ..ɚ......ɛ.$ 28 ɚɛɞɤɪ.ɞɚ......ɛ.$ 281 ɚɛɞɤɪ.ɞɚɤ.....ɛ.$ 2811 ɚɛɞɤɪɪɞɚɤ.....ɛ.$ 2811-
ɉɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɩɟɪɜɨɝɨ ɢɡ ɫɢɦɜɨɥɨɜ ‘ɪ’ ɜɦɟɫɬɨ ɫɫɵɥɤɢ ɧɚ ɫɥɟɞɭɸɳɢɣ ɫɢɦɜɨɥ ɩɨɫɬɚɜɥɟɧ ɩɪɨɱɟɪɤ, ɩɨɬɨɦɭ ɱɬɨ ɫɪɚɡɭ ɩɨɫɥɟ ɫɢɦɜɨɥɚ ‘ɪ’ ɧɚɯɨɞɢɬɫɹ ɜɚɤɚɧɬɧɚɹ ɩɨɡɢɰɢɹ ɢ ɷɬɨ ɨɡɧɚɱɚɟɬ, ɱɬɨ ɧɢɤɚɤɨɣ ɞɪɭɝɨɣ ɫɢɦɜɨɥ ɧɟ ɫɦɨɠɟɬ ɧɚ ɷɬɭ ɩɨɡɢɰɢɸ ɫɨɫɥɚɬɶɫɹ. Ɂɧɚɱɢɬ, ɧɚɦ ɧɟɬ ɧɟɨɛɯɨɞɢɦɨɫɬɢ ɜɵɩɨɥɧɹɬɶ ɤɨɞɢɪɨɜɚɧɢɟ ɷɬɨɣ ɫɫɵɥɤɢ. ȼ ɞɚɧɧɨɦ ɫɥɭɱɚɟ ɦɵ ɧɚɛɥɸɞɚɟɦ ɫɩɟɰɢɮɢɱɟɫɤɢɣ ɷɮɮɟɤɬ, ɩɪɢɫɭɳɢɣ ɦɟɬɨɞɭ ɤɨɞɢɪɨɜɚɧɢɹ ɪɚɫɫɬɨɹɧɢɣ, ɤɨɬɨɪɵɣ ɩɨɡɜɨɥɹɟɬ ɢɡɛɟɠɚɬɶ ɩɪɢɦɟɧɟɧɢɹ RLE.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 227 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɫɬɪɨɤɚ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ:
ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$ ɚɛɞɤɪɪɞɚɤɪ....ɛ.$ 2811-0
ɉɨɫɤɨɥɶɤɭ ɨɱɟɪɟɞɧɨɣ ɫɢɦɜɨɥ ‘ɪ’ ɡɚɧɢɦɚɟɬ ɛɥɢɠɚɣɲɭɸ ɜɚɤɚɧɬɧɭɸ ɩɨɡɢɰɢɸ, ɦɵ ɤɨɞɢɪɭɟɦ ɟɝɨ ɱɢɫɥɨɦ 0. Ȼɥɚɝɨɞɚɪɹ ɬɚɤɨɦɭ ɫɜɨɣɫɬɜɭ ɦɟɬɨɞɚ ɤɨɞɢɪɨɜɚɧɢɹ ɪɚɫɫɬɨɹɧɢɣ, ɜ ɧɟɦ ɞɨɫɬɚɬɨɱɧɨ ɥɟɝɤɨ ɪɟɲɚɟɬɫɹ ɩɪɨɛɥɟɦɚ ɫɥɭɱɚɣɧɨɣ ɫɦɟɧɵ ɤɨɧɬɟɤɫɬɚ, ɪɚɞɢ ɤɨɬɨɪɨɣ ɬɪɟɛɨɜɚɥɨɫɶ ɫɩɟɰɢɚɥɶɧɨ ɫɨɜɟɪɲɟɧɫɬɜɨɜɚɬɶ ɦɟɬɨɞ ɩɟɪɟɦɟɳɟɧɢɹ ɫɬɨɩɤɢ ɤɧɢɝ. ɫɬɪɨɤɚ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ:
ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$ ɚɛɞɤɪɪɞɚɤɪ....ɛ.$ 2811-05
Ʉɨɞɢɪɭɹ ɫɢɦɜɨɥ ‘ɞ’, ɦɵ ɫɞɟɥɚɥɢ ɫɫɵɥɤɭ ɧɚ ɤɨɧɟɰ ɫɬɪɨɤɢ. ɉɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ ɬɚɤɚɹ ɫɫɵɥɤɚ ɩɨɡɜɨɥɢɬ ɩɨɧɹɬɶ, ɱɬɨ ɫɢɦɜɨɥɵ ‘ɞ’ ɡɚɤɨɧɱɢɥɢɫɶ. ɫɬɪɨɤɚ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ: ɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ: ɪɚɫɫɬɨɹɧɢɟ:
ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$ ɚɛɞɤɪɪɞɚɤɪɚ...ɛ.$ 2811-050 ɚɛɞɤɪɪɞɚɤɪɚ...ɛ.$ 2811-0504 ɚɛɞɤɪɪɞɚɤɪɚ...ɛ.$ 2811-05044 ɚɛɞɤɪɪɞɚɤɪɚɚɚɚɛ.$ 2811-05044--Ⱥɛɞɤɪɪɞɚɤɪɚɚɚɚɛ.$ 2811-05044---1 Ⱥɛɞɤɪɪɞɚɤɪɚɚɚɚɛɛ$ 2811-05044---1-
Ɋɢɫ. 5.17. Ʉɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ ȼ ɢɬɨɝɟ ɩɨɥɭɱɚɟɦ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ { 2,8,1,1,0,5,0,4,4,1 }. 228 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɍɩɪɚɠɧɟɧɢɟ: ȼɵɱɢɫɥɢɬɟ ɪɚɫɫɬɨɹɧɢɹ ɞɥɹ ɫɬɪɨɤɢ “ɛɪɪɚɚɚɚɤɚɚɤɞɪɪ”.
ɈȻɊȺɌɇɕȿ ɑȺɋɌɈɌɕ
ȿɫɬɶ ɟɳɟ ɨɞɢɧ ɦɟɬɨɞ, ɩɨɯɨɠɢɣ ɧɚ ɨɩɢɫɚɧɧɵɣ ɜɵɲɟ. ȼ ɧɟɦ ɬɚɤɠɟ ɤɨɞɢɪɭɸɬɫɹ ɪɚɫɫɬɨɹɧɢɹ ɦɟɠɞɭ ɨɞɢɧɚɤɨɜɵɦɢ ɫɢɦɜɨɥɚɦɢ. Ɉɬɥɢɱɢɟ ɬɨɥɶɤɨ ɜ ɬɨɦ, ɱɬɨ ɫɢɦɜɨɥɵ, ɞɥɹ ɤɨɬɨɪɵɯ ɨɩɪɟɞɟɥɹɸɬɫɹ ɪɚɫɫɬɨɹɧɢɹ, ɛɟɪɭɬɫɹ ɧɟ ɜ ɩɨɪɹɞɤɟ ɩɨɫɬɭɩɥɟɧɢɹ, ɚ ɢɫɯɨɞɹ ɢɡ ɧɟɤɨɬɨɪɨɝɨ ɮɢɤɫɢɪɨɜɚɧɧɨɝɨ ɩɨɪɹɞɤɚ. ɇɚɩɪɢɦɟɪ, ɩɨ ɚɥɮɚɜɢɬɭ. Ⱥɜɬɨɪɵ ɞɚɧɧɨɝɨ ɚɥɝɨɪɢɬɦɚ, ɧɚɡɜɚɧɧɨɝɨ Inversed Frequencies (IF), ɢɫɯɨɞɢɥɢ ɢɡ ɬɨɝɨ, ɱɬɨ ɪɚɫɫɬɨɹɧɢɟ ɦɟɠɞɭ ɨɞɢɧɚɤɨɜɵɦɢ ɫɢɦɜɨɥɚɦɢ ɯɚɪɚɤɬɟɪɢɡɭɟɬ ɱɚɫɬɨɬɭ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɷɬɢɯ ɫɢɦɜɨɥɨɜ ɧɚ ɞɚɧɧɨɦ ɨɬɪɟɡɤɟ ɫɢɦɜɨɥɶɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ. ɑɟɦ ɪɚɫɫɬɨɹɧɢɟ ɦɟɧɶɲɟ, ɬɟɦ ɜɵɲɟ ɱɚɫɬɨɬɚ. ɉɨɹɫɧɢɦ ɪɚɛɨɬɭ ɚɥɝɨɪɢɬɦɚ ɧɚ ɩɪɢɦɟɪɟ. ɉɪɟɞɩɨɥɨɠɢɦ, ɧɚɦ ɧɭɠɧɨ ɨɩɪɟɞɟɥɢɬɶ IF ɞɥɹ ɫɬɪɨɤɢ “ɪɞɚɤɪɚɚɚɚɛɛ”, ɚ ɪɚɫɱɟɬ ɪɚɫɫɬɨɹɧɢɣ ɛɭɞɟɦ ɩɪɨɜɨɞɢɬɶ ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɩɨɥɨɠɟɧɢɟɦ ɫɢɦɜɨɥɨɜ ɜ ɚɥɮɚɜɢɬɟ “ɚɛɞɤɪ”. ɋɧɚɱɚɥɚ ɡɚɩɢɲɟɦ ɞɥɹ ɫɢɦɜɨɥɚ ‘ɚ’ ɩɨɥɨɠɟɧɢɟ ɩɟɪɜɨɝɨ ɢɡ ɬɚɤɢɯ ɫɢɦɜɨɥɨɜ ɜ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɟ ɢ ɢɯ ɤɨɥɢɱɟɫɬɜɨ. ɫɢɦɜɨɥ ɚ
ɩɟɪɜɚɹ ɩɨɡɢɰɢɹ 2
ɱɢɫɥɨ ɫɢɦɜɨɥɨɜ 5
ɋɥɟɞɭɸɳɢɦ ɲɚɝɨɦ – ɞɥɹ ɤɚɠɞɨɝɨ ɢɡ ɫɢɦɜɨɥɨɜ ‘ɚ’ ɜ ɤɚɱɟɫɬɜɟ ɪɚɫɫɬɨɹɧɢɹ ɡɚɩɢɲɟɦ ɱɢɫɥɨ ɢɧɵɯ ɫɢɦɜɨɥɨɜ ɞɨ ɫɥɟɞɭɸɳɟɝɨ ‘ɚ’. ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ: ɪɚɫɫɬɨɹɧɢɹ:
ɪɞɚɤɪɚɚɚɚɛɛ 2 000
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 229 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɨɫɥɟ ɬɨɝɨ, ɤɚɤ ɜɫɟ ɩɨɡɢɰɢɢ ɫɢɦɜɨɥɚ ‘ɚ’ ɨɩɪɟɞɟɥɟɧɵ, ɦɵ ɦɨɠɟɦ ɭɞɚɥɢɬɶ ɢɯ ɢɡ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɢ ɢ ɩɪɨɞɨɥɠɢɬɶ ɨɛɪɚɛɨɬɤɭ ɫɬɪɨɤɢ, ɤɚɤ ɛɭɞɬɨ ɢɯ ɢ ɧɟ ɛɵɥɨ. ɋɢɦɜɨɥ ɚ ɛ ɞ ɤ
ɩɟɪɜɚɹ ɩɨɡɢɰɢɹ 2 4 1 1
ɑɢɫɥɨ ɫɢɦɜɨɥɨɜ 5 2 1 1
ɫɬɪɨɤɚ ɪɞɚɤɪɚɚɚɚɛɛ ɪɞɤɪɛɛ ɪɞɤɪ ɪɤɪ
Ɋɚɫɫɬɨɹɧɢɹ 2,0,0,0 0
Ɋɢɫ. 5.18. ȼɵɱɢɫɥɟɧɢɟ ɨɛɪɚɬɧɵɯ ɱɚɫɬɨɬ ȼ ɤɨɞɢɪɨɜɚɧɢɢ ɫɢɦɜɨɥɚ ‘ɪ’ ɧɟɬ ɧɟɨɛɯɨɞɢɦɨɫɬɢ, ɬɚɤ ɤɚɤ ɡɚɜɟɞɨɦɨ ɢɡɜɟɫɬɧɨ, ɱɬɨ ɨɧ ɡɚɧɢɦɚɟɬ ɨɫɬɚɜɲɢɟɫɹ ɩɨɡɢɰɢɢ ɜ ɫɬɪɨɤɟ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɦɵ ɩɨɥɭɱɢɥɢ ɫɥɟɞɭɸɳɭɸ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ: { {2,5,2,0,0,0}, {4,2,0}, {1,1}, {1,1} }. Ʌɟɝɤɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɫɩɨɫɨɛ ɢ ɷɮɮɟɤɬɢɜɧɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ ɡɚɜɢɫɢɬ ɨɬ ɬɨɝɨ ɩɨɪɹɞɤɚ, ɜ ɤɨɬɨɪɨɦ ɦɵ ɛɭɞɟɦ ɨɛɪɚɛɚɬɵɜɚɬɶ ɫɢɦɜɨɥɵ. ȿɳɟ ɨɞɧɨ ɜɚɠɧɨɟ ɨɬɥɢɱɢɟ ɞɚɧɧɨɝɨ ɦɟɬɨɞɚ ɨɬ ɤɨɞɢɪɨɜɚɧɢɹ ɪɚɫɫɬɨɹɧɢɣ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɨɧ ɧɟ ɨɫɜɨɛɨɠɞɚɟɬ ɨɬ ɧɟɨɛɯɨɞɢɦɨɫɬɢ ɤɨɞɢɪɨɜɚɧɢɹ ɞɥɢɧɧɵɯ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɧɭɥɟɜɵɯ ɡɧɚɱɟɧɢɣ ɨɛɪɚɬɧɵɯ ɱɚɫɬɨɬ.
ɍɩɪɚɠɧɟɧɢɟ: Ɉɩɪɟɞɟɥɢɬɟ ɨɛɪɚɬɧɵɟ ɱɚɫɬɨɬɵ ɞɥɹ ɫɬɪɨɤɢ “ɛɪɪɚɚɚɚɤɚɚɤɞɪɪ”.
ɋɩɨɫɨɛɵ ɫɠɚɬɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɫ ɩɨɦɨɳɶɸ BWT ɞɚɧɧɵɯ ɉɟɪɟɣɞɟɦ ɤ ɪɚɫɫɦɨɬɪɟɧɢɸ ɫɩɨɫɨɛɨɜ ɫɠɚɬɢɹ ɞɚɧɧɵɯ, ɩɨɥɭɱɟɧɧɵɯ ɜ ɪɟɡɭɥɶɬɚɬɟ ɨɩɢɫɚɧɧɵɯ ɜɵɲɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ. Ⱦɥɹ ɧɚɱɚɥɚ ɧɚɞɨ ɪɚɡɨɛɪɚɬɶɫɹ ɫ ɞɚɧɧɵɦɢ, ɤɨɬɨɪɵɟ ɧɚɦ ɧɟɨɛɯɨɞɢɦɨ ɫɠɚɬɶ. 230 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɋɚɫɫɦɨɬɪɢɦ ɮɪɚɝɦɟɧɬ ɞɚɧɧɵɯ, ɬɢɩɢɱɧɵɣ ɞɥɹ ɬɟɤɫɬɚ, ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɩɨɫɪɟɞɫɬɜɨɦ BWT. Ⱦɥɹ ɩɪɢɦɟɪɚ ɜɡɹɬ ɮɚɣɥ book1 ɢɡ ɧɚɛɨɪɚ “Calgary Corpus”. eteksehendeynkrtdserttnregenskngsgsedeneyswmessrne xgynystslgyegsgstssrhmsstetehselxtptneessthndesddy htksthwtpfdttegedmmhysyresprssneenselgetdemsetse,t reehsetrtteseeeeeesssdeedmnlendeedgtdgttdsgtteeysy tddentnrxsltshtghnteeernsdpwlttensedehsteeswekheee teneeeeseslteenestrngsthsdgeyeyrteetklrdtetteyodth eegeercesyttesedenrtresnyssgttsslsawssygsssrewmsht gt,etssgehnehessssehneesesdnrnekhtrsslthdsseestste nbgeeessesdesyndtrdhpeesehesetsrerhyesdnwtlrrhoses hsetdrptttsdhaynenetyntpgstesknhysftsgssdftgteeedu
Ɋɢɫ. 5.19. Ɉɞɧɨɪɨɞɧɵɣ ɮɪɚɝɦɟɧɬ Ɇɨɠɧɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɫɢɦɜɨɥɨɜ ɧɚ ɷɬɨɦ ɮɪɚɝɦɟɧɬɟ ɦɟɧɹɟɬɫɹ ɧɟɡɧɚɱɢɬɟɥɶɧɨ. ɋɨɜɫɟɦ ɞɪɭɝɭɸ ɤɚɪɬɢɧɭ ɦɵ ɦɨɠɟɦ ɧɚɛɥɸɞɚɬɶ ɧɚ ɮɪɚɝɦɟɧɬɟ, ɩɪɢɜɟɞɟɧɧɨɦ ɧɢɠɟ, ɤɨɝɞɚ ɩɪɟɨɛɥɚɞɚɧɢɟ ɨɞɧɢɯ ɫɢɦɜɨɥɨɜ ɫɦɟɧɹɟɬɫɹ ɩɪɟɨɛɥɚɞɚɧɢɟɦ ɞɪɭɝɢɯ. ygeldsd,,ttyogdodgdedndygnmotedgwkgodoowtdoddtotet tndmeggkrdsgtohtdegteddrsttttegtddewdddoootdgdntet ststttstt!uetttdtte-eIttetny,hettItgrlttyIttnttyrt rtttttttetttttdtttstottttttttttntttttttn,ddtkgnde; ed,d,stefoefssfrsnsstyslw,fnoeadere,rteeynsfofhynn nyoytted,yfnedhddtoldtnyhnnhyrtyryttmeryesfoyedney oymd,sedesgnrrsysnssmydsspdyt'-dssehs,gynsdydgee'o defddeynt,,tdnd,os;sttyysofy-nnetognfetdnyldlewheodsttemshsdtsyteny,ngdefs,-offsnntettseyesgleay:es dtsdgllredksyryes,rldosts;dtdeefgghsfrergkdgngkenw
Ɋɢɫ. 5.20. ɂɡɦɟɧɹɸɳɢɣɫɹ ɮɪɚɝɦɟɧɬ Ɍɚɤɠɟ ɢɦɟɸɬ ɦɟɫɬɨ ɛɵɬɶ ɫɥɭɱɚɢ, ɤɨɝɞɚ ɧɚ ɩɪɨɬɹɠɟɧɢɢ ɜɫɟɝɨ ɮɪɚɝɦɟɧɬɚ ɹɜɧɨ ɩɪɟɜɚɥɢɪɭɟɬ ɨɞɢɧ ɨɩɪɟɞɟɥɟɧɧɵɣ ɫɢɦɜɨɥ.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 231 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
edeeeeeIeydeyeeet'eeeIeeeeeeeeeeeeeeeeeeeeeeleeeee eeeeeee!eeeeleeeeeeeeeeeeeeeeeeeeeeeyedeeereeeleee eeeeeeeeeeslyadeeeeeeeeeyeeeeeeeeeeeeeedyereseeeee eIueeeeeeyeeeeeeIsseseeIl'eeIetenhyalehcesyyseessn s'dlesffao,dffeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeTeeee eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeteeeeeeeeeeeeeeee eeeeeeeeeeaerre,see,eywesldsysdhedeeetaeeesaeeyedo
Ɋɢɫ. 5.21. Ɏɪɚɝɦɟɧɬ ɫ ɩɪɟɨɛɥɚɞɚɧɢɟɦ ɨɞɧɨɝɨ ɫɢɦɜɨɥɚ ɂɬɚɤ, ɜɵɞɟɥɢɦ ɬɪɢ ɜɢɞɚ ɞɚɧɧɵɯ: 1) ɧɚ ɩɪɨɬɹɠɟɧɢɢ ɜɫɟɝɨ ɮɪɚɝɦɟɧɬɚ ɧɟɫɤɨɥɶɤɨ ɫɢɦɜɨɥɨɜ ɢɦɟɸɬ ɩɨɫɬɨɹɧɧɭɸ ɱɚɫɬɨɬɭ. 2) ɩɪɨɦɟɠɭɬɨɤ ɜ ɮɪɚɝɦɟɧɬɟ, ɤɨɝɞɚ ɩɪɟɨɛɥɚɞɚɧɢɟ ɨɞɧɢɯ ɫɢɦɜɨɥɨɜ ɫɦɟɧɹɟɬɫɹ ɩɪɟɨɛɥɚɞɚɧɢɟɦ ɞɪɭɝɢɯ. 3) ɨɞɢɧ ɢɡ ɫɢɦɜɨɥɨɜ ɜɫɬɪɟɱɚɟɬɫɹ ɧɚɦɧɨɝɨ ɱɚɳɟ ɞɪɭɝɢɯ. Ɉɞɧɚ ɢɡ ɡɚɞɚɱ ɜɵɛɢɪɚɟɦɨɣ ɦɨɞɟɥɢ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨɛɵ ɩɨɡɜɨɥɢɬɶ ɨɩɟɪɚɬɢɜɧɨ ɧɚɫɬɪɨɢɬɶɫɹ ɧɚ ɬɟɤɭɳɢɣ ɜɢɞ ɞɚɧɧɵɯ. ɋɀȺɌɂȿ ɉɊɂ ɉɈɆɈɓɂ ɄɈȾɂɊɈȼȺɇɂə ɉɈ ȺɅȽɈɊɂɌɆɍ ɏȺɎɎɆȺɇȺ
ɍɤɚɡɚɧɧɵɟ ɫɜɨɣɫɬɜɚ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɞɚɧɧɵɯ ɢɫɩɨɥɶɡɭɟɬ ɚɥɝɨɪɢɬɦ, ɪɟɚɥɢɡɨɜɚɧɧɵɣ ɜ ɚɪɯɢɜɚɬɨɪɟ bzip2 ɢ ɩɨɡɞɧɟɟ ɩɨɡɚɢɦɫɬɜɨɜɚɧɧɵɣ ɬɚɤɠɟ ɪɚɡɪɚɛɨɬɱɢɤɚɦɢ ɚɪɯɢɜɚɬɨɪɚ IMP. ɉɨɫɥɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ BWT ɢ MTF ɛɥɨɤ ɞɚɧɧɵɯ ɞɟɥɢɬɫɹ ɧɚ ɪɚɜɧɵɟ 50-ɫɢɦɜɨɥɶɧɵɟ ɤɭɫɤɢ. ɉɨɥɭɱɟɧɧɵɟ ɤɭɫɤɢ ɨɛɴɟɞɢɧɹɸɬɫɹ ɜ ɝɪɭɩɩɵ ɩɨ ɫɬɟɩɟɧɢ ɛɥɢɡɨɫɬɢ ɪɚɫɩɪɟɞɟɥɟɧɢɣ MTF-ɪɚɧɝɨɜ. Ʉɨɥɢɱɟɫɬɜɨ ɝɪɭɩɩ ɡɚɜɢɫɢɬ ɨɬ ɪɚɡɦɟɪɚ ɮɚɣɥɚ. ɇɚɩɪɢɦɟɪ, ɞɥɹ ɦɟɝɚɛɚɣɬɧɨɝɨ ɮɚɣɥɚ ɬɚɤɢɯ ɝɪɭɩɩ ɛɭɞɟɬ ɲɟɫɬɶ. Ƚɪɭɩɩɢɪɨɜɚɧɢɟ ɤɭɫɤɨɜ ɜɵɩɨɥɧɹɟɬɫɹ ɢɬɟɪɚɬɢɜɧɨ. ɂɡɧɚɱɚɥɶɧɨ ɤɭɫɤɢ ɩɪɢɩɢɫɵɜɚɸɬɫɹ ɝɪɭɩɩɚɦ ɜ ɩɨɪɹɞɤɟ ɫɥɟɞɨɜɚɧɢɹ ɜ ɛɥɨɤɟ ɬɚɤ, ɱɬɨɛɵ ɤɚɠɞɨɣ ɝɪɭɩɩɟ ɫɨɨɬɜɟɬɫɬɜɨɜɚɥɨ ɩɪɢɦɟɪɧɨ ɪɚɜɧɨɟ ɤɨɥɢɱɟɫɬɜɨ ɤɭɫɤɨɜ. Ⱦɥɹ ɤɚɠɞɨɣ ɝɪɭɩɩɵ ɫɬɪɨɢɬɫɹ ɨɬɞɟɥɶɧɨɟ ɞɟɪɟɜɨ ɏɚɮɮɦɚɧɚ. ȼ ɚɪɯɢɜ ɡɚɩɢɫɵɜɚɸɬɫɹ ɞɟɪɟɜɶɹ ɏɚɮɮɦɚɧɚ, ɧɨɦɟɪ ɝɪɭɩɩɵ ɞɥɹ ɤɚɠɞɨɝɨ ɢɡ 50-ɫɢɦɜɨɥɶɧɨɝɨ ɤɭɫɤɨɜ, ɚ ɡɚɬɟɦ ɜɫɟ ɤɭɫɤɢ ɫɠɢɦɚɸɬɫɹ ɩɨ ɚɥɝɨɪɢɬɦɭ ɏɚɮɮɦɚɧɚ ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɧɨɦɟɪɨɦ ɬɨɣ ɝɪɭɩɩɵ, ɤ ɤɨɬɨɪɨɣ ɨɧɢ ɨɬɧɨɫɹɬɫɹ. 232 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼɵɛɨɪ ɝɪɭɩɩɵ ɞɥɹ ɤɭɫɤɚ ɞɟɥɚɟɬɫɹ ɧɚ ɨɫɧɨɜɟ ɩɨɞɫɱɟɬɚ ɞɥɢɧɵ ɡɚɤɨɞɢɪɨɜɚɧɧɨɝɨ ɤɭɫɤɚ, ɤɨɬɨɪɵɣ ɩɨɥɭɱɢɬɫɹ ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɤɚɠɞɨɝɨ ɢɡ ɩɨɫɬɪɨɟɧɧɵɯ ɞɟɪɟɜɶɟɜ ɏɚɮɮɦɚɧɚ. ȼɵɛɢɪɚɟɬɫɹ ɬɚ ɝɪɭɩɩɚ, ɩɪɢ ɜɵɛɨɪɟ ɤɨɬɨɪɨɣ ɤɨɞ ɩɨɥɭɱɚɟɬɫɹ ɤɨɪɨɱɟ. ɉɨɫɤɨɥɶɤɭ ɩɨɫɥɟ ɷɬɨɝɨ ɫɬɚɬɢɫɬɢɤɚ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɫɢɦɜɨɥɨɜ ɜ ɝɪɭɩɩɚɯ ɦɟɧɹɟɬɫɹ, ɩɨ ɡɚɜɟɪɲɟɧɢɢ ɨɛɪɚɛɨɬɤɢ ɛɥɨɤɚ ɞɟɪɟɜɶɹ ɞɥɹ ɤɚɠɞɨɣ ɝɪɭɩɩɵ ɫɬɪɨɢɬɫɹ ɡɚɧɨɜɨ. ɉɪɚɤɬɢɤɚ ɩɨɤɚɡɵɜɚɟɬ, ɱɬɨ ɜɩɨɥɧɟ ɞɨɫɬɚɬɨɱɧɨ ɱɟɬɵɪɟɯ ɢɬɟɪɚɰɢɣ ɞɥɹ ɩɨɥɭɱɟɧɢɹ ɩɪɢɟɦɥɟɦɨɝɨ ɫɠɚɬɢɹ. ɋ ɤɚɠɞɨɣ ɧɨɜɨɣ ɢɬɟɪɚɰɢɢ ɩɪɢɪɨɫɬ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɪɟɡɤɨ ɭɦɟɧɶɲɚɟɬɫɹ. Ɍɚɤɨɣ ɫɩɨɫɨɛ ɤɨɞɢɪɨɜɚɧɢɹ ɧɚɡɵɜɚɟɬɫɹ ɩɨɥɭɚɞɚɩɬɢɜɧɵɦ ɚɥɝɨɪɢɬɦɨɦ ɏɚɮɮɦɚɧɚ. ɉɨɥɭɚɞɚɩɬɢɜɧɨɫɬɶ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɚɞɚɩɬɚɰɢɹ ɩɪɨɢɫɯɨɞɢɬ ɡɚ ɫɱɟɬ ɜɵɛɨɪɚ ɩɨɞɯɨɞɹɳɟɝɨ ɞɟɪɟɜɚ ɏɚɮɮɦɚɧɚ ɞɥɹ ɨɱɟɪɟɞɧɨɝɨ ɤɭɫɤɚ ɞɚɧɧɵɯ, ɚ ɧɟ ɡɚ ɫɱɟɬ ɩɟɪɟɫɬɪɨɣɤɢ ɬɟɤɭɳɟɝɨ ɞɟɪɟɜɚ. ɋɠɚɬɢɟ ɩɨ ɚɥɝɨɪɢɬɦɭ ɏɚɮɮɦɚɧɚ ɞɨɜɨɥɶɧɨ ɷɮɮɟɤɬɢɜɧɨ, ɯɨɬɶ ɢ ɭɫɬɭɩɚɟɬ ɚɥɝɨɪɢɬɦɚɦ, ɜ ɤɨɬɨɪɵɯ ɪɟɚɥɢɡɨɜɚɧɨ ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ ɫɠɚɬɢɟ, ɧɨ ɡɚɬɨ ɡɚɦɟɬɧɨ ɛɵɫɬɪɟɟ ɩɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ. Ⱥɥɝɨɪɢɬɦɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɤɨɞɢɪɨɜɚɧɢɟ ɩɨ ɦɟɬɨɞɭ ɏɚɮɮɦɚɧɚ, ɞɨɜɨɥɶɧɨ ɷɮɮɟɤɬɢɜɧɵ, ɯɨɬɶ ɢ ɭɫɬɭɩɚɸɬ ɚɥɝɨɪɢɬɦɚɦ, ɜ ɤɨɬɨɪɵɯ ɪɟɚɥɢɡɨɜɚɧɨ ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ ɫɠɚɬɢɟ ɋɌɊɍɄɌɍɊɇȺə ɂ ɂȿɊȺɊɏɂɑȿɋɄȺə ɆɈȾȿɅɂ
Ɉɬɦɟɬɢɦ ɨɫɧɨɜɧɨɟ ɫɜɨɣɫɬɜɨ ɬɚɤɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ, ɤɚɤ MTF, DC ɢ IF: ɧɚ ɛɨɥɶɲɢɧɫɬɜɟ ɞɚɧɧɵɯ, ɩɨɥɭɱɟɧɧɵɯ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, ɦɚɥɵɟ ɡɧɚɱɟɧɢɹ ɜɫɬɪɟɱɚɸɬɫɹ ɝɨɪɚɡɞɨ ɱɚɳɟ ɛɨɥɶɲɢɯ ɢ ɥɟɝɱɟ ɩɨɞɞɚɸɬɫɹ ɩɪɟɞɫɤɚɡɚɧɢɸ. ɗɬɨ ɫɜɨɣɫɬɜɨ ɨɱɟɧɶ ɜɚɠɧɨ ɭɱɢɬɵɜɚɬɶ ɩɪɢ ɩɨɫɬɪɨɟɧɢɢ ɚɞɚɩɬɢɜɧɵɯ ɦɨɞɟɥɟɣ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ ɤɨɞɢɪɨɜɚɧɢɟ. Ⱥɧɚɥɢɡɢɪɭɹ ɩɟɪɟɱɢɫɥɟɧɧɵɟ ɜɵɲɟ ɬɪɢ ɜɢɞɚ ɮɪɚɝɦɟɧɬɨɜ, ɦɨɠɧɨ ɨɬɦɟɬɢɬɶ ɧɟɤɨɬɨɪɵɟ ɨɫɨɛɟɧɧɨɫɬɢ, ɤɨɬɨɪɵɦɢ ɦɨɠɧɨ ɜɨɫɩɨɥɶɡɨɜɚɬɶɫɹ ɩɪɢ ɦɨɞɟɥɢɪɨɜɚɧɢɢ: 1) ɛɨɥɶɲɨɟ ɤɨɥɢɱɟɫɬɜɨ ɢɞɭɳɢɯ ɩɨɞɪɹɞ ɨɞɢɧɚɤɨɜɵɯ ɫɢɦɜɨɥɨɜ ɫɜɢɞɟɬɟɥɶɫɬɜɭɟɬ ɨ ɬɨɦ, ɱɬɨ ɜɟɪɨɹɬɧɨ ɩɨɹɜɥɟɧɢɟ ɬɚɤɨɣ ɠɟ ɞɥɢɧɧɨɣ ɢɯ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɢ ɜ ɛɭɞɭɳɟɦ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 233 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
2) ɩɨɹɜɥɟɧɢɟ ɫɢɦɜɨɥɚ, ɞɨɜɨɥɶɧɨ ɞɚɜɧɨ ɜɫɬɪɟɱɚɜɲɟɝɨɫɹ ɩɨɫɥɟɞɧɢɣ ɪɚɡ, ɝɨɜɨɪɢɬ ɨ ɬɨɦ, ɱɬɨ ɜɟɪɨɹɬɧɚ ɫɦɟɧɚ ɭɫɬɨɣɱɢɜɨɝɨ ɤɨɧɬɟɤɫɬɚ, ɚ ɫɥɟɞɨɜɚɬɟɥɶɧɨ, ɢ ɧɚɢɛɨɥɟɟ ɱɚɫɬɵɟ ɞɨ ɷɬɨɝɨ ɫɢɦɜɨɥɵ ɦɨɝɭɬ ɫɦɟɧɢɬɶɫɹ ɞɪɭɝɢɦɢ. ɍɤɚɡɚɧɧɵɟ ɫɜɨɣɫɬɜɚ ɩɨɫɥɭɠɢɥɢ ɩɪɢɱɢɧɨɣ ɬɨɝɨ, ɱɬɨ ɩɪɚɤɬɢɱɟɫɤɢ ɜɫɟ ɪɟɚɥɢɡɚɰɢɢ ɫɠɚɬɢɹ ɧɚ ɨɫɧɨɜɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɭɞɟɥɹɸɬ ɩɨɜɵɲɟɧɧɨɟ ɜɧɢɦɚɧɢɟ ɧɚɢɛɨɥɟɟ ɱɚɫɬɵɦ ɜ ɬɟɤɭɳɟɦ ɮɪɚɝɦɟɧɬɟ ɫɢɦɜɨɥɚɦ. Ⱦɥɹ ɨɛɪɚɛɨɬɤɢ ɪɟɞɤɢɯ ɫɢɦɜɨɥɨɜ ɜɚɠɧɚ ɥɢɲɶ ɩɪɢɛɥɢɡɢɬɟɥɶɧɚɹ ɨɰɟɧɤɚ ɜɨɡɦɨɠɧɨɫɬɢ ɢɯ ɩɨɹɜɥɟɧɢɹ. Ɋɚɫɫɦɨɬɪɢɦ ɞɜɟ ɦɨɞɟɥɢ, ɨɛɥɚɞɚɸɳɢɟ ɨɩɢɫɚɧɧɵɦɢ ɤɚɱɟɫɬɜɚɦɢ — ɫɬɪɭɤɬɭɪɧɭɸ ɢ ɢɟɪɚɪɯɢɱɟɫɤɭɸ ɦɨɞɟɥɢ [18]. ɋɬɪɭɤɬɭɪɧɚɹ ɦɨɞɟɥɶ. Ʉɨɞɢɪɨɜɚɧɢɟ ɫɢɦɜɨɥɚ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɜ ɞɜɚ ɷɬɚɩɚ. ɋɧɚɱɚɥɚ ɤɨɞɢɪɭɟɬɫɹ ɧɨɦɟɪ ɝɪɭɩɩɵ, ɤ ɤɨɬɨɪɨɣ ɷɬɨɬ ɫɢɦɜɨɥ ɨɬɧɨɫɢɬɫɹ. Ⱥ ɡɚɬɟɦ — ɧɨɦɟɪ ɫɢɦɜɨɥɚ ɜɧɭɬɪɢ ɝɪɭɩɩɵ. Ɋɚɡɦɟɪɵ ɝɪɭɩɩ ɪɚɡɥɢɱɧɵ. ɇɚɢɛɨɥɟɟ ɱɚɫɬɵɟ ɫɢɦɜɨɥɵ ɩɨɦɟɳɚɸɬɫɹ ɜ ɝɪɭɩɩɵ, ɫɨɫɬɨɹɳɢɟ ɢɡ ɧɟɛɨɥɶɲɨɝɨ ɱɢɫɥɚ ɫɢɦɜɨɥɨɜ. ɉɪɟɞɥɨɠɟɧɧɚɹ ɉɟɬɟɪɨɦ Ɏɟɧɜɢɤɨɦ ɫɬɪɭɤɬɭɪɧɚɹ ɦɨɞɟɥɶ ɩɪɟɞɩɨɥɚɝɚɟɬ ɫɚɦɨɫɬɨɹɬɟɥɶɧɨɟ ɫɭɳɟɫɬɜɨɜɚɧɢɟ ɧɭɥɟɜɨɝɨ ɢ ɩɟɪɜɨɝɨ ɪɚɧɝɚ, ɬ.ɟ. ɤɚɠɞɵɣ ɢɡ ɧɢɯ ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɨɬɞɟɥɶɧɭɸ ɝɪɭɩɩɭ. ȼ ɫɥɟɞɭɸɳɭɸ (ɬɪɟɬɶɸ ɩɨ ɫɱɟɬɭ) ɝɪɭɩɩɭ ɩɨɦɟɳɚɸɬɫɹ ɜɬɨɪɨɣ ɢ ɬɪɟɬɢɣ ɪɚɧɝɢ, ɡɚɬɟɦ — ɫ ɱɟɬɜɟɪɬɨɝɨ ɩɨ ɫɟɞɶɦɨɣ ɢ ɬ.ɞ. ɝɪɭɩɩɚ 0 1 2 3 ... 8
ɤɨɞɢɪɭɟɦɵɟ ɪɚɧɝɢ 0 1 2 3 4 5 6 ... 128 129 ...
7 255
Ɋɢɫ. 5.22. ɋɬɪɭɤɬɭɪɧɚɹ ɦɨɞɟɥɶ ɇɢɠɟ ɩɪɢɜɨɞɹɬɫɹ ɱɚɫɬɨɬɵ ɝɪɭɩɩ ɞɥɹ ɮɚɣɥɚ book1 ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɨɛɵɱɧɨɝɨ ɢ ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɨɝɨ MTF: 234 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɇɨɦɟɪ ɝɪɭɩɩɵ 0 1 2 3 4 5 6 7 8
MTF ɨɛɵɱɧɵɣ (%)
MTF ɦɨɞɢɮɢɰɢɪɨɜɚɧɧɵɣ (%) 51.44 14.93 12.41 10.72 8.16 2.13 0.20 0.01 0.00
49.77 15.36 13.19 11.05 8.28 2.14 0.20 0.01 0.00
Ɋɢɫ. 5.23. ɋɬɚɬɢɫɬɢɤɚ ɪɚɫɩɪɟɞɟɥɟɧɢɹ ɪɚɧɝɨɜ ɜ ɝɪɭɩɩɚɯ ɫɬɪɭɤɬɭɪɧɨɣ ɦɨɞɟɥɢ ɂɟɪɚɪɯɢɱɟɫɤɚɹ ɦɨɞɟɥɶ. ɗɬɚ ɦɨɞɟɥɶ ɬɚɤɠɟ ɞɟɥɢɬ ɫɢɦɜɨɥɵ ɧɚ ɝɪɭɩɩɵ. ɂ ɩɨ ɬɚɤɨɦɭ ɠɟ ɩɪɢɧɰɢɩɭ. Ɉɬɥɢɱɢɟ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɜ ɤɚɠɞɭɸ ɝɪɭɩɩɭ ɞɨɛɚɜɥɹɟɬɫɹ ɫɢɦɜɨɥ, ɨɡɧɚɱɚɸɳɢɣ ɭɯɨɞ ɤ ɝɪɭɩɩɟ, ɧɚɯɨɞɹɳɟɣɫɹ ɧɚ ɛɨɥɟɟ ɧɢɡɤɨɣ ɫɬɭɩɟɧɢ ɢɟɪɚɪɯɢɢ. 0
1
e0
2
3
e1
4
5
6
7
e2
8
9
… 15
e3 …
128
129
…
255
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 235 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɋɢɫ. 5.24. ɂɟɪɚɪɯɢɱɟɫɤɚɹ ɦɨɞɟɥɶ ɗɤɫɩɟɪɢɦɟɧɬ [16] ɩɨɤɚɡɚɥ, ɱɬɨ ɫɬɪɭɤɬɭɪɧɚɹ ɦɨɞɟɥɶ ɩɨɡɜɨɥɹɟɬ ɞɨɫɬɢɱɶ ɧɟɦɧɨɝɨ ɥɭɱɲɟɝɨ ɫɠɚɬɢɹ ɢ, ɜ ɫɢɥɭ ɬɨɝɨ, ɱɬɨ ɞɥɹ ɤɚɠɞɨɝɨ ɫɢɦɜɨɥɚ ɜ ɫɪɟɞɧɟɦ ɬɪɟɛɭɟɬɫɹ ɦɟɧɶɲɟ ɨɩɟɪɚɰɢɣ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɢɪɨɜɚɧɢɹ, ɱɭɬɶ ɛɵɫɬɪɟɟ. ɊȺɁɆȿɊ ȻɅɈɄȺ
Ɉɞɢɧ ɢɡ ɜɚɠɧɵɯ ɜɨɩɪɨɫɨɜ, ɤɨɬɨɪɵɣ ɜɫɬɚɟɬ ɩɟɪɟɞ ɪɚɡɪɚɛɨɬɱɢɤɨɦ ɚɪɯɢɜɚɬɨɪɚ ɧɚ ɨɫɧɨɜɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɜɵɛɨɪɟ ɪɚɡɦɟɪɚ ɛɥɨɤɚ. BWT — ɚɥɝɨɪɢɬɦ, ɞɚɸɳɢɣ ɧɚɢɥɭɱɲɭɸ ɪɟɡɭɥɶɬɚɬɢɜɧɨɫɬɶ ɩɪɢ ɫɠɚɬɢɢ ɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ. Ⱥ ɨɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ ɩɪɟɞɩɨɥɚɝɚɸɬ ɧɚɥɢɱɢɟ ɭɫɬɨɣɱɢɜɵɯ ɫɨɱɟɬɚɧɢɣ ɫɢɦɜɨɥɨɜ. Ⱥ ɪɚɡ ɫɨɱɟɬɚɧɢɹ ɧɟ ɦɟɧɹɸɬɫɹ, ɬɨ ɭɜɟɥɢɱɟɧɢɟ ɪɚɡɦɟɪɚ ɛɥɨɤɚ ɩɪɢɜɟɞɭɬ ɬɨɥɶɤɨ ɤ ɭɜɟɥɢɱɟɧɢɸ ɱɢɫɥɚ ɨɞɢɧɚɤɨɜɵɯ ɫɢɦɜɨɥɨɜ ɧɚɯɨɞɹɳɢɯɫɹ ɪɹɞɨɦ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. Ⱥ ɭɜɟɥɢɱɟɧɢɟ ɤɨɥɢɱɟɫɬɜɚ ɧɚɯɨɞɹɳɢɯɫɹ ɪɹɞɨɦ ɫɢɦɜɨɥɨɜ ɜɞɜɨɟ ɜ ɢɞɟɚɥɟ ɬɪɟɛɭɟɬ ɜɫɟɝɨ ɨɞɢɧ ɞɨɩɨɥɧɢɬɟɥɶɧɵɣ ɛɢɬ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɞɥɹ ɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ ɦɨɠɧɨ ɫɞɟɥɚɬɶ ɨɞɧɨɡɧɚɱɧɵɣ ɜɵɜɨɞ: ɱɟɦ ɛɥɨɤ ɛɨɥɶɲɟ, ɬɟɦ ɫɠɚɬɢɟ ɛɭɞɟɬ ɫɢɥɶɧɟɟ. ɇɢɠɟ ɩɪɢɜɟɞɟɧɵ ɷɤɫɩɟɪɢɦɟɧɬɚɥɶɧɵɟ ɞɚɧɧɵɟ ɫɠɚɬɢɹ ɮɚɣɥɚ book1 ɢɡ ɧɚɛɨɪɚ CalgCC. Ɍɟɫɬɢɪɨɜɚɧɢɟ ɩɪɨɢɡɜɨɞɢɥɨɫɶ ɧɚ ɤɨɦɩɶɸɬɟɪɟ ɫɥɟɞɭɸɳɟɣ ɤɨɧɮɢɝɭɪɚɰɢɢ: ɉɪɨɰɟɫɫɨɪ ɑɚɫɬɨɬɚ ɲɢɧɵ Ɉɩɟɪɚɬɢɜɧɚɹ ɩɚɦɹɬɶ ɀɟɫɬɤɢɣ ɞɢɫɤ Ɉɩɟɪɚɰɢɨɧɧɚɹ ɫɢɫɬɟɦɚ
Intel Pentium III 840 ɆȽɰ 140 ɆȽɰ 256 Ɇɛɚɣɬ SDRAM Quantum FB 4.3 Ƚɛɚɣɬ Windows NT 4.0 Service Pack 3
236 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɋɚɡɦɟɪ ɛɥɨɤɚ
100kb 200kb 300kb 400kb 500kb 600kb 700kb 800kb
bzip2 1.01 ɪɚɡɦɟɪ ɫɠɚɬɨɝɨ ɮɚɣɥɚ 270,508 256,002 249,793 243,402 242,662 241,169 237,993 232,598
bzip2 1.01 YBS 0.03e ɜɪɟɦɹ ɫɠɚ- ɪɚɡɦɟɪ ɬɢɹ, c ɫɠɚɬɨɝɨ ɮɚɣɥɚ 0.61 255,428 0.66 239,392 0.71 232,681 0.72 225,659 0.73 224,782 0.75 222,782 0.76 218,826 0.77 213,722
YBS 0.03e ɜɪɟɦɹ ɫɠɚɬɢɹ, c 0.65 0.66 0.71 0.73 0.74 0.76 0.77 0.77
ɑɬɨ ɤɚɫɚɟɬɫɹ ɞɚɧɧɵɯ ɧɟɨɞɧɨɪɨɞɧɵɯ, ɬɨ ɡɞɟɫɶ ɤɚɪɬɢɧɚ ɢɧɚɹ. Ɋɚɡɦɟɪ ɛɥɨɤɚ ɧɚɞɨ ɜɵɛɢɪɚɬɶ ɬɚɤɢɦ, ɱɬɨɛɵ ɟɝɨ ɤɪɚɣ ɩɪɢɯɨɞɢɥɫɹ ɧɚ ɬɨ ɦɟɫɬɨ, ɝɞɟ ɞɚɧɧɵɟ ɪɟɡɤɨ ɦɟɧɹɸɬɫɹ. ɉɪɢɱɟɦ, ɞɥɹ BWT ɫɬɪɚɲɧɚ ɧɟ ɫɚɦɚ ɧɟɨɞɧɨɪɨɞɧɨɫɬɶ, ɤɚɤ ɬɚɤɨɜɚɹ, ɚ ɢɡɦɟɧɟɧɢɟ ɫɬɚɬɢɫɬɢɤɢ ɫɢɦɜɨɥɨɜ, ɩɪɟɞɫɤɚɡɵɜɚɟɦɵɯ ɭɫɬɨɣɱɢɜɵɦɢ ɤɨɧɬɟɤɫɬɚɦɢ. ɇɚɩɪɢɦɟɪ, ɧɚɫ ɧɟ ɞɨɥɠɟɧ ɩɭɝɚɬɶ ɬɨɬ ɮɚɤɬ, ɱɬɨ ɜ ɧɚɱɚɥɟ ɮɚɣɥɚ ɱɚɫɬɨ ɜɫɬɪɟɱɚɸɬɫɹ ɫɬɪɨɤɢ “abcd”, ɚ ɜ ɤɨɧɰɟ ɢɯ ɦɟɫɬɨ ɡɚɧɢɦɚɸɬ “efgh”. Ƚɨɪɚɡɞɨ ɧɟɩɪɢɹɬɧɟɟ, ɤɨɝɞɚ ɜɦɟɫɬɨ ɫɬɪɨɤ “abcd” ɧɚɱɢɧɚɸɬ ɩɨɹɜɥɹɬɶɫɹ ɫɬɪɨɤɢ “abgh”. ɗɬɨ ɧɟ ɨɡɧɚɱɚɟɬ, ɱɬɨ ɮɚɣɥ, ɜ ɤɨɬɨɪɨɦ ɧɚɛɥɸɞɚɟɬɫɹ ɜɬɨɪɚɹ ɫɢɬɭɚɰɢɹ, ɫɨɠɦɟɬɫɹ ɩɪɢ ɩɨɦɨɳɢ BWTɤɨɦɩɪɟɫɫɨɪɚ ɨɱɟɧɶ ɩɥɨɯɨ. ɇɨ ɪɚɡɧɢɰɚ ɜ ɫɠɚɬɢɢ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɚɪɯɢɜɚɬɨɪɚɦɢ, ɢɫɩɨɥɶɡɭɸɳɢɦɢ, ɧɚɩɪɢɦɟɪ, ɫɥɨɜɚɪɧɵɟ ɦɟɬɨɞɵ, ɧɚ ɬɚɤɢɯ ɞɚɧɧɵɯ ɛɭɞɟɬ ɧɟ ɜ ɩɨɥɶɡɭ BWT. Ⱦɥɹ ɢɥɥɸɫɬɪɚɰɢɢ ɡɚɜɢɫɢɦɨɫɬɢ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɫɠɚɬɢɹ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ ɨɬ ɪɚɡɦɟɪɚ ɛɥɨɤɚ ɫɨɠɦɟɦ ɢɫɩɨɥɧɢɦɵɣ ɮɚɣɥ ɢɡ ɞɢɫɬɪɢɛɭɬɢɜɚ ɤɨɦɩɢɥɹɬɨɪɚ Watcom 10.0, wcc386.exe (536,624 ɛɚɣɬɚ).
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 237 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɋɚɡɦɟɪ ɛɥɨɤɚ
100kb 200kb 300kb 400kb 500kb 600kb
bzip2 1.01 ɪɚɡɦɟɪ ɫɠɚɬɨɝɨ ɮɚɣɥɚ 309,716 308,668 308,812 309,163 307,131 308,624
bzip2 1.01 YBS 0.03e ɜɪɟɦɹ ɫɠɚ- ɪɚɡɦɟɪ ɬɢɹ, c ɫɠɚɬɨɝɨ ɮɚɣɥɚ 0.66 279,596 0.66 277,312 0.66 277,285 0.66 277,374 0.66 274,351 0.66 276,026
YBS 0.03e ɜɪɟɦɹ ɫɠɚɬɢɹ, c 0.60 0.61 0.61 0.60 0.60 0.60
ɉȿɊȿɍɉɈɊəȾɈɑɂȼȺɇɂȿ ɋɂɆȼɈɅɈȼ
ȼ ɨɬɥɢɱɢɟ ɨɬ ɦɧɨɝɢɯ ɞɪɭɝɢɯ ɦɟɬɨɞɨɜ, ɫɠɚɬɢɟ, ɨɫɧɨɜɚɧɧɨɟ ɧɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɢ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, ɡɚɦɟɬɧɨ ɡɚɜɢɫɢɬ ɨɬ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɨɝɨ ɩɨɪɹɞɤɚ ɫɥɟɞɨɜɚɧɢɹ ɫɢɦɜɨɥɨɜ. Ɂɚɦɟɱɟɧɨ, ɱɬɨ ɫɢɦɜɨɥɵ, ɢɦɟɸɳɢɟ ɫɯɨɞɧɨɟ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɜ ɫɥɨɜɨɨɛɪɚɡɨɜɚɧɢɢ, ɥɭɱɲɟ ɪɚɫɩɨɥɚɝɚɬɶ ɩɨɛɥɢɡɨɫɬɢ. ȼɨɡɶɦɟɦ ɬɚɤɢɟ ɱɚɫɬɨ ɜɫɬɪɟɱɚɸɳɢɟɫɹ ɨɤɨɧɱɚɧɢɹ ɫɥɨɜ ɪɭɫɫɤɨɝɨ ɹɡɵɤɚ, ɤɚɤ “ɵɣ” ɢ “ɢɣ”. Ʌɟɝɤɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɢɦ ɜ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ ɩɪɟɞɲɟɫɬɜɭɸɬ ɨɞɧɢ ɢ ɬɟ ɠɟ ɫɢɦɜɨɥɵ, ɧɚɩɪɢɦɟɪ, ɛɭɤɜɚ “ɧ”. ȿɫɥɢ ɷɬɢ ɨɤɨɧɱɚɧɢɹ ɜ ɪɟɡɭɥɶɬɚɬɟ ɫɨɪɬɢɪɨɜɤɢ ɤɚɤɢɦ-ɬɨ ɨɛɪɚɡɨɦ ɨɤɚɠɭɬɫɹ ɜ ɧɚɱɚɥɟ ɫɨɫɟɞɧɢɯ ɫɬɪɨɤ ɦɚɬɪɢɰɵ ɩɟɪɟɫɬɚɧɨɜɨɤ, ɦɵ ɩɨɥɭɱɢɦ ɜ ɩɨɫɥɟɞɧɟɦ ɫɬɨɥɛɰɟ ɪɹɞɨɦ ɫɬɨɹɳɢɟ ɨɞɢɧɚɤɨɜɵɟ ɫɢɦɜɨɥɵ. ɗɬɨɬ ɷɮɮɟɤɬ ɨɫɨɛɟɧɧɨ ɡɚɦɟɬɟɧ ɧɚ ɬɟɤɫɬɨɜɵɯ ɮɚɣɥɚɯ. Ⱦɥɹ ɪɚɡɧɵɯ ɹɡɵɤɨɜ ɧɸɚɧɫɵ ɜɵɛɨɪɚ ɥɭɱɲɟɝɨ ɩɟɪɟɭɩɨɪɹɞɨɱɢɜɚɧɢɹ ɫɢɦɜɨɥɨɜ ɦɨɝɭɬ ɨɬɥɢɱɚɬɶɫɹ, ɧɨ ɨɛɳɟɟ ɩɪɚɜɢɥɨ ɬɚɤɨɜɨ — ɜɫɟ ɫɢɦɜɨɥɵ ɧɚɞɨ ɩɨɞɟɥɢɬɶ ɧɚ 3 ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢ ɨɬɞɟɥɶɧɵɯ ɝɪɭɩɩɵ: ɝɥɚɫɧɵɟ, ɫɨɝɥɚɫɧɵɟ ɢ ɡɧɚɤɢ ɩɪɟɩɢɧɚɧɢɹ.
238 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɏɚɣɥ
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ, ɛɚɣɬ bzip2 1.01
book1 232,598 book1, ɩɨɫɥɟ ɩɟɪɟɭɩɨɪɹɞɨɱɢɜɚɧɢɹ 231,884 ɫɢɦɜɨɥɨɜ
YBS 0.03e 213,722 212,975
ɇȺɉɊȺȼɅȿɇɂȿ ɋɈɊɌɂɊɈȼɄɂ
Ɇɨɠɧɨ ɫɨɪɬɢɪɨɜɚɬɶ ɫɬɪɨɤɢ ɫɥɟɜɚ ɧɚɩɪɚɜɨ ɢ ɜ ɤɚɱɟɫɬɜɟ ɪɟɡɭɥɶɬɚɬɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɢɫɩɨɥɶɡɨɜɚɬɶ ɩɨɫɥɟɞɧɢɣ ɫɬɨɥɛɟɰ ɦɚɬɪɢɰɵ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɯ ɫɬɪɨɤ. Ⱥ ɦɨɠɧɨ — ɫɩɪɚɜɚ ɧɚɥɟɜɨ ɢ ɢɫɩɨɥɶɡɨɜɚɬɶ ɩɟɪɜɵɣ ɫɬɨɥɛɟɰ. Ʉɚɤ ɞɟɥɚɬɶ ɥɭɱɲɟ ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ? ɉɟɪɜɚɹ ɫɬɪɚɬɟɝɢɹ ɩɨɞɪɚɡɭɦɟɜɚɟɬ ɩɪɟɞɫɤɚɡɚɧɢɟ ɫɢɦɜɨɥɚ ɢɫɯɨɞɹ ɢɡ ɬɨɝɨ, ɤɚɤɢɟ ɫɢɦɜɨɥɵ ɡɚ ɧɢɦ ɫɥɟɞɭɸɬ, ɚ ɜɬɨɪɚɹ — ɢɫɯɨɞɹ ɢɡ ɬɨɝɨ, ɤɚɤɢɟ ɛɵɥɢ ɪɚɧɶɲɟ. ȼ ɥɢɬɟɪɚɬɭɪɟ ɞɥɹ ɨɛɨɡɧɚɱɟɧɢɹ ɷɬɢɯ ɞɜɭɯ ɧɚɩɪɚɜɥɟɧɢɣ ɢɫɩɨɥɶɡɭɸɬɫɹ ɫɥɨɜɨɫɨɱɟɬɚɧɢɹ “following contexts” ɢ “preceding contexts” ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ (ɩɪɚɜɨɫɬɨɪɨɧɧɢɟ ɢ ɥɟɜɨɫɬɨɪɨɧɧɢɟ ɤɨɧɬɟɤɫɬɵ). ɉɪɚɤɬɢɤɚ ɩɨɤɚɡɵɜɚɟɬ, ɱɬɨ ɛɨɥɶɲɢɧɫɬɜɨ ɚɪɯɢɜɚɬɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɬɪɚɞɢɰɢɨɧɧɵɟ BWT ɢ MTF, ɞɨɫɬɢɝɚɸɬ ɥɭɱɲɟɝɨ ɫɠɚɬɢɹ ɧɚ ɬɟɤɫɬɨɜɵɯ ɞɚɧɧɵɯ ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɩɪɚɜɨɫɬɨɪɨɧɧɢɯ ɤɨɧɬɟɤɫɬɨɜ. Ⱦɥɹ ɞɚɧɧɵɯ, ɢɦɟɸɳɢɯ ɧɟ «ɥɢɧɝɜɢɫɬɢɱɟɫɤɭɸ» ɩɪɢɪɨɞɭ, ɥɭɱɲɟ ɢɫɩɨɥɶɡɨɜɚɬɶ ɥɟɜɨɫɬɨɪɨɧɧɢɟ ɤɨɧɬɟɤɫɬɵ. ɇɚɩɪɢɦɟɪ, ɷɬɨ ɫɩɪɚɜɟɞɥɢɜɨ ɞɥɹ ɢɫɩɨɥɧɢɦɵɯ ɮɚɣɥɨɜ. Ⱦɥɹ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɤɨɬɨɪɵɟ ɧɟ ɢɫɩɨɥɶɡɭɸɬ MTF, ɚ ɩɪɨɛɥɟɦɭ ɚɞɚɩɬɚɰɢɢ ɤɨɞɟɪɚ ɤ ɩɨɬɨɤɭ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɞɚɧɧɵɯ ɪɟɲɚɸɬ ɤɚɤ-ɬɨ ɢɧɚɱɟ, ɜɵɛɨɪ ɧɚɩɪɚɜɥɟɧɢɹ ɫɨɪɬɢɪɨɜɤɢ ɦɨɠɟɬ ɛɵɬɶ ɢɧɵɦ. ɇɚɩɪɢɦɟɪ, DC ɢ YBS ɦɧɨɝɢɟ ɢɫɩɨɥɧɢɦɵɟ ɮɚɣɥɵ, ɤɚɤ ɢ ɬɟɤɫɬɨɜɵɟ, ɫɠɢɦɚɸɬ ɥɭɱɲɟ ɩɪɢ ɫɨɪɬɢɪɨɜɤɟ ɫɥɟɜɚ ɧɚɩɪɚɜɨ. ɉɪɨɞɟɥɚɬɶ ɫɚɦɨɫɬɨɹɬɟɥɶɧɨɟ ɫɪɚɜɧɟɧɢɟ ɨɱɟɧɶ ɩɪɨɫɬɨ. ȼɨɡɶɦɢɬɟ ɜɚɲ ɥɸɛɢɦɵɣ ɚɪɯɢɜɚɬɨɪ ɢ ɫɨɠɦɢɬɟ ɫ ɟɝɨ ɩɨɦɨɳɶɸ ɜɚɲ ɥɸɛɢɦɵɣ ɮɚɣɥ. Ɂɚɬɟɦ ɩɟɪɟɜɟɪɧɢɬɟ ɞɚɧɧɵɟ ɷɬɨɝɨ ɮɚɣɥɚ ɧɚɨɛɨɪɨɬ, ɫɨɠɦɢɬɟ ɩɨɥɭɱɟɧɧɨɟ ɢ ɫɪɚɜɧɢɬɟ ɪɟɡɭɥɶɬɚɬɵ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 239 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɏɚɣɥ
book1 book1 wcc386.exe wcc386.exe
ɇɚɩɪɚɜɥɟɧɢɟ ɫɨɪ- Ɋɚɡɦɟɪ ɫɠɚɬɨɝɨ ɮɚɣɥɚ, ɛɚɣɬ ɬɢɪɨɜɤɢ bzip2 1.01 YBS 0.03e following contexts 232,598 213,722 preceding contexts 234,538 214,890 following contexts 308,624 276,026 preceding contexts 306,020 279,198
ɇɟɤɨɬɨɪɵɟ ɩɪɨɝɪɚɦɦɵ ɫɚɦɨɫɬɨɹɬɟɥɶɧɨ ɩɵɬɚɸɬɫɹ ɨɩɪɟɞɟɥɢɬɶ ɬɢɩ ɞɚɧɧɵɯ ɢ ɜɵɛɪɚɬɶ ɧɚɩɪɚɜɥɟɧɢɟ ɫɨɪɬɢɪɨɜɤɢ. ɂɧɨɝɞɚ, ɜɩɪɨɱɟɦ, ɨɲɢɛɚɹɫɶ. ɉɪɨɫɬɟɣɲɢɣ ɫɩɨɫɨɛ ɨɛɦɚɧɭɬɶ ɬɚɤɨɣ ɚɪɯɢɜɚɬɨɪ — ɞɚɬɶ ɟɦɭ ɫɠɚɬɶ ɪɭɫɫɤɢɣ ɬɟɤɫɬ.
ɋɨɪɬɢɪɨɜɤɚ, ɢɫɩɨɥɶɡɭɟɦɚɹ ɜ BWT ɋɨɪɬɢɪɨɜɤɚ — ɷɬɨ ɨɱɟɧɶ ɜɚɠɧɵɣ ɤɨɦɩɨɧɟɧɬ ɚɪɯɢɜɚɬɨɪɚ, ɪɟɚɥɢɡɭɸɳɟɝɨ ɫɠɚɬɢɟ ɧɚ ɨɫɧɨɜɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ. ɂɦɟɧɧɨ ɨɬ ɧɟɟ ɡɚɜɢɫɢɬ ɫɤɨɪɨɫɬɶ ɫɠɚɬɢɹ. Ⱦɨ ɧɟɞɚɜɧɟɝɨ ɜɪɟɦɟɧɢ ɢɦɟɧɧɨ ɫɨɪɬɢɪɨɜɤɚ ɛɵɥɚ ɭɡɤɢɦ ɦɟɫɬɨɦ. ȼ ɧɚɫɬɨɹɳɟɟ ɜɪɟɦɹ ɦɨɞɟɥɢɪɨɜɚɧɢɟ ɫɬɚɥɨ ɞɨɫɬɚɬɨɱɧɨ ɫɥɨɠɧɵɦ, ɱɬɨɛɵ ɤɨɧɤɭɪɢɪɨɜɚɬɶ ɩɨ ɜɪɟɦɟɧɢ ɪɚɛɨɬɵ ɫ ɩɪɨɰɟɞɭɪɨɣ ɫɨɪɬɢɪɨɜɤɢ, ɪɟɚɥɢɡɚɰɢɢ ɤɨɬɨɪɨɣ, ɧɚɩɪɨɬɢɜ, ɫɨɜɟɪɲɟɧɫɬɜɭɸɬɫɹ ɜ ɫɬɨɪɨɧɭ ɭɫɤɨɪɟɧɢɹ. ɇɨ ɢ ɬɟɩɟɪɶ ɜɨɡɦɨɠɧɚ ɫɢɬɭɚɰɢɹ, ɤɨɝɞɚ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɫɠɢɦɚɟɦɵɯ ɞɚɧɧɵɯ ɬɚɤɨɜɵ, ɱɬɨ ɦɨɝɭɬ ɫɭɳɟɫɬɜɟɧɧɨ ɡɚɦɟɞɥɢɬɶ ɫɨɪɬɢɪɨɜɤɭ. Ɉɫɧɨɜɧɵɟ ɬɪɟɛɨɜɚɧɢɹ ɤ ɫɨɪɬɢɪɨɜɤɟ ɡɚɤɥɸɱɚɸɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɨɧɚ ɞɨɥɠɧɚ ɨɛɟɫɩɟɱɢɜɚɬɶ ɛɵɫɬɪɨɟ ɫɠɚɬɢɟ ɨɛɵɱɧɵɯ (ɩɪɟɢɦɭɳɟɫɬɜɟɧɧɨ ɬɟɤɫɬɨɜɵɯ) ɞɚɧɧɵɯ ɢ ɧɟ ɩɪɢɜɨɞɢɬɶ ɤ ɫɭɳɟɫɬɜɟɧɧɨɦɭ ɡɚɦɟɞɥɟɧɢɸ ɧɚ ɨɱɟɧɶ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ. ɉɨɦɟɲɚɬɶ ɫɨɪɬɢɪɨɜɤɟ ɦɨɝɭɬ ɞɜɚ ɜɢɞɚ ɢɡɛɵɬɨɱɧɨɫɬɢ — ɤɨɝɞɚ ɜ ɫɨɪɬɢɪɭɟɦɵɯ ɞɚɧɧɵɯ ɫɨɞɟɪɠɚɬɫɹ: 1) ɞɥɢɧɧɵɟ ɨɞɢɧɚɤɨɜɵɟ ɫɬɪɨɤɢ, 2) ɤɨɪɨɬɤɢɟ ɨɞɢɧɚɤɨɜɵɟ ɫɬɪɨɤɢ ɜ ɛɨɥɶɲɨɦ ɤɨɥɢɱɟɫɬɜɟ. Ɉɬɞɟɥɶɧɵɣ ɫɥɭɱɚɣ ɩɪɟɞɫɬɚɜɥɹɸɬ ɫɨɛɨɣ ɛɨɥɶɲɨɟ ɱɢɫɥɨ ɢɞɭɳɢɯ ɩɨɞɪɹɞ ɨɞɢɧɚɤɨɜɵɯ ɫɢɦɜɨɥɨɜ ɢɥɢ ɞɥɢɧɧɵɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɩɟɪɟɦɟɠɚɸɳɢɯɫɹ ɫɢɦɜɨɥɨɜ ɬɢɩɚ “ɚɛɚɛɚɛɚɛ”. 240 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɑɬɨ ɤɚɫɚɟɬɫɹ ɬɟɤɫɬɨɜɵɯ ɮɚɣɥɨɜ, ɧɚɢɛɨɥɟɟ ɱɚɫɬɨ ɜɫɬɪɟɱɚɟɦɚɹ ɞɥɢɧɚ ɩɨɜɬɨɪɹɸɳɢɯɫɹ ɫɬɪɨɤ — 3-5 ɫɢɦɜɨɥɚ. Ⱦɥɹ ɮɚɣɥɨɜ ɫ ɢɫɯɨɞɧɵɦɢ ɬɟɤɫɬɚɦɢ ɩɪɨɝɪɚɦɦ, ɤɚɤ ɩɪɚɜɢɥɨ, ɷɬɚ ɞɥɢɧɚ ɧɟɫɤɨɥɶɤɨ ɛɨɥɶɲɟ — 8-12 ɫɢɦɜɨɥɨɜ. Ɋɚɫɫɦɨɬɪɢɦ ɚɥɝɨɪɢɬɦɵ ɫɨɪɬɢɪɨɜɤɢ, ɩɨɥɭɱɢɜɲɢɟ ɧɚɢɛɨɥɶɲɭɸ ɢɡɜɟɫɬɧɨɫɬɶ. ɋɈɊɌɂɊɈȼɄȺ ȻȿɇɌɅɂ-ɋȿȾɀȼɂɄȺ
Ⱦɚɧɧɵɣ ɚɥɝɨɪɢɬɦ ɩɨɥɭɱɢɥ, ɩɨɠɚɥɭɣ, ɧɚɢɛɨɥɶɲɟɟ ɪɚɫɩɪɨɫɬɪɚɧɟɧɢɟ ɫɪɟɞɢ ɜɫɟɯ ɢɡɜɟɫɬɧɵɯ ɫɨɪɬɢɪɨɜɨɤ. ȼɩɟɪɜɵɟ ɨɧ ɛɵɥ ɩɪɢɦɟɧɟɧ ɟɳɟ ɨɞɧɢɦ ɢɡ ɨɫɧɨɜɨɩɨɥɨɠɧɢɤɨɜ, ɍɢɥɟɪɨɦ. Ɂɚɬɟɦ ɷɬɚ ɫɨɪɬɢɪɨɜɤɚ ɛɵɥɚ ɪɟɚɥɢɡɨɜɚɧɚ ɜ bzip2 ɢ ɞɪɭɝɢɯ ɚɪɯɢɜɚɬɨɪɚɯ (BWC, BA, YBS). ɋɨɪɬɢɪɨɜɤɚ Ȼɟɧɬɥɢ-ɋɟɞɠɜɢɤɚ (Bentley-Sedgewick) ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɦɨɞɢɮɢɤɚɰɢɸ ɛɵɫɬɪɨɣ ɫɨɪɬɢɪɨɜɤɢ (quick-sort), ɨɪɢɟɧɬɢɪɨɜɚɧɧɭɸ ɧɚ ɫɪɚɜɧɟɧɢɟ ɞɥɢɧɧɵɯ ɫɬɪɨɤ, ɫɪɟɞɢ ɤɨɬɨɪɵɯ ɦɨɠɟɬ ɨɤɚɡɚɬɶɫɹ ɡɧɚɱɢɬɟɥɶɧɨɟ ɤɨɥɢɱɟɫɬɜɨ ɩɨɯɨɠɢɯ. Ƚɥɚɜɧɚɹ ɢɞɟɹ ɨɩɢɫɵɜɚɟɦɨɣ ɫɨɪɬɢɪɨɜɤɢ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɜɫɟ ɫɪɚɜɧɢɜɚɟɦɵɟ ɫ ɷɬɚɥɨɧɧɨɣ ɫɬɪɨɤɢ ɞɟɥɹɬɫɹ ɧɟ ɧɚ ɞɜɟ, ɚ ɧɚ ɬɪɢ ɝɪɭɩɩɵ. ȼ ɬɪɟɬɶɸ ɝɪɭɩɩɭ ɜɯɨɞɢɬ ɫɚɦɚ ɷɬɚɥɨɧɧɚɹ ɫɬɪɨɤɚ ɢ ɫɬɪɨɤɢ, ɫɪɚɜɧɢɜɚɟɦɵɟ ɫɢɦɜɨɥɵ ɤɨɬɨɪɵɯ ɪɚɜɧɵ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɦ ɫɢɦɜɨɥɚɦ ɷɬɚɥɨɧɧɨɣ ɫɬɪɨɤɢ. ȼɵɞɟɥɟɧɢɟ ɬɪɟɬɶɟɣ ɝɪɭɩɩɵ ɩɨɦɨɝɚɟɬ ɧɚɦ ɭɦɟɧɶɲɢɬɶ ɱɢɫɥɨ ɨɩɟɪɚɰɢɣ ɫɪɚɜɧɟɧɢɹ ɫɬɪɨɤ, ɢɦɟɸɳɢɯ ɦɧɨɝɨ ɫɨɜɩɚɞɚɸɳɢɯ ɩɨɞɫɬɪɨɤ. ȼ ɷɬɭ ɝɪɭɩɩɭ ɩɨɩɚɞɚɸɬ ɫɬɪɨɤɢ ɫ ɨɞɢɧɚɤɨɜɵɦɢ ɧɚɱɚɥɶɧɵɦɢ ɫɢɦɜɨɥɚɦɢ, ɱɬɨ ɢɡɛɚɜɥɹɟɬ ɧɚɫ ɨɬ ɧɟɨɛɯɨɞɢɦɨɫɬɢ ɫɪɚɜɧɢɜɚɬɶ ɷɬɢ ɫɢɦɜɨɥɵ ɟɳɟ ɪɚɡ. Ɋɚɛɨɬɭ ɚɥɝɨɪɢɬɦɚ ɦɨɠɧɨ ɨɩɢɫɚɬɶ ɩɪɢ ɩɨɦɨɳɢ ɫɥɟɞɭɸɳɟɝɨ ɢɫɯɨɞɧɨɝɨ ɬɟɤɫɬɚ ɧɚ ɹɡɵɤɟ ɋɢ: void sort(char **s, int n, int d) { char **s_less, **s_eq, **s_greater; int *n_less, *n_eq, *n_greater; // ɜɵɛɨɪ ɡɧɚɱɟɧɢɹ, ɫ ɤɨɬɨɪɵɦ ɛɭɞɭɬ // ɫɪɚɜɧɢɜɚɬɶɫɹ d-ɵɟ ɫɢɦɜɨɥɵ ɫɬɪɨɤ char v = choose_value(&s,d);
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 241 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
// ɨɫɬɚɥɚɫɶ ɬɨɥɶɤɨ ɨɞɧɚ ɫɬɪɨɤɚ if( n <= 1 ) return; // ɞɟɥɟɧɢɟ ɜɫɟɯ ɫɬɪɨɤ ɧɚ ɝɪɭɩɩɵ compare(&s, v, d, // ɫɬɪɨɤɢ, d-ɵɣ ɫɢɦɜɨɥ ɤɨɬɨɪɵɯ ɦɟɧɶɲɟ v &s_less, &n_less, // ɫɬɪɨɤɢ, d-ɵɣ ɫɢɦɜɨɥ ɤɨɬɨɪɵɯ ɪɚɜɟɧ v &s_eq, &n_eq, // ɫɬɪɨɤɢ, d-ɵɣ ɫɢɦɜɨɥ ɤɨɬɨɪɵɯ ɛɨɥɶɲɟ v &s_greater, &n_greater); sort(&s_less, n_less, d); sort(&s_eq, n_eq, d+1); sort(&s_greater, n_greater, d); }
Ⱦɚɧɧɚɹ ɪɟɤɭɪɫɢɜɧɚɹ ɮɭɧɤɰɢɹ ɫɨɪɬɢɪɭɟɬ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɢɡ n ɫɬɪɨɤ s, ɢɦɟɸɳɢɯ d ɨɞɢɧɚɤɨɜɵɯ ɧɚɱɚɥɶɧɵɯ ɫɢɦɜɨɥɨɜ. ɋɚɦɵɣ ɩɟɪɜɵɣ ɜɵɡɨɜ ɜɵɝɥɹɞɢɬ ɤɚɤ sort(s,n,0); Ɋɚɡɭɦɟɟɬɫɹ, ɫ ɬɟɱɟɧɢɟɦ ɜɪɟɦɟɧɢ ɩɪɢɞɭɦɵɜɚɥɨɫɶ ɜɫɟ ɛɨɥɶɲɟ ɭɯɢɳɪɟɧɢɣ, ɭɫɤɨɪɹɸɳɢɯ ɪɚɛɨɬɭ ɫɨɪɬɢɪɨɜɤɢ Ȼɟɧɬɥɢ-ɋɟɞɠɜɢɤɚ ɩɪɢɦɟɧɢɬɟɥɶɧɨ ɤ BWT. ɉɟɪɟɱɢɫɥɢɦ ɨɫɧɨɜɧɵɟ ɢɡ ɧɢɯ: 1) ɉɨɪɚɡɪɹɞɧɚɹ ɫɨɪɬɢɪɨɜɤɚ. ɉɪɢ ɛɨɥɶɲɨɦ ɤɨɥɢɱɟɫɬɜɟ ɫɨɪɬɢɪɭɟɦɵɯ ɫɬɪɨɤ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɩɨɪɚɡɪɹɞɧɚɹ ɫɨɪɬɢɪɨɜɤɚ ɩɨ ɧɟɫɤɨɥɶɤɢɦ ɫɢɦɜɨɥɚɦ. ɉɨ ɪɟɡɭɥɶɬɚɬɭ ɩɨɪɚɡɪɹɞɧɨɣ ɫɨɪɬɢɪɨɜɤɢ ɫɬɪɨɤɢ ɞɟɥɹɬɫɹ ɧɚ ɩɚɤɟɬɵ, ɤɚɠɞɵɣ ɢɡ ɤɨɬɨɪɵɯ ɨɛɪɚɛɚɬɵɜɚɟɬɫɹ ɩɪɢ ɩɨɦɨɳɢ ɫɨɪɬɢɪɨɜɤɢ Ȼɟɧɬɥɢɋɟɞɠɜɢɤɚ. 2) ɂɫɩɨɥɶɡɨɜɚɧɢɟ ɪɟɡɭɥɶɬɚɬɚ ɩɪɟɞɵɞɭɳɢɯ ɫɪɚɜɧɟɧɢɣ ɞɥɹ ɩɨɫɥɟɞɭɸɳɢɯ. ɉɨɫɥɟ ɨɤɨɧɱɚɧɢɹ ɫɨɪɬɢɪɨɜɤɢ ɧɟɤɨɬɨɪɨɝɨ ɤɨɥɢɱɟɫɬɜɚ ɫɬɪɨɤ, ɦɨɠɧɨ ɥɟɝɤɨ ɨɬɫɨɪɬɢɪɨɜɚɬɶ ɫɬɪɨɤɢ, ɧɚɱɢɧɚɸɳɢɟɫɹ ɧɚ ɨɞɢɧ ɫɢɦɜɨɥ ɪɚɧɶɲɟ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɯ. Ⱦɥɹ ɷɬɨɝɨ ɞɨɫɬɚɬɨɱɧɨ ɫɪɚɜɧɢɬɶ ɬɨɥɶɤɨ ɩɟɪɜɵɟ ɢɯ ɫɢɦɜɨɥɵ, ɚ ɞɚɥɶɲɟ — ɜɨɫɩɨɥɶɡɨɜɚɬɶɫɹ ɪɟɡɭɥɶɬɚɬɚɦɢ ɩɪɟɞɵɞɭɳɟɣ ɫɨɪɬɢɪɨɜɤɢ. 3) ɋɪɚɜɧɟɧɢɟ ɧɟ ɨɞɢɧɨɱɧɵɯ ɫɢɦɜɨɥɨɜ, ɚ ɨɞɧɨɜɪɟɦɟɧɧɨ ɧɟɫɤɨɥɶɤɢɯ. Ȼɨɥɶɲɚɹ ɪɚɡɪɹɞɧɨɫɬɶ ɫɨɜɪɟɦɟɧɧɵɯ ɤɨɦɩɶɸɬɟɪɨɜ ɩɨɡɜɨɥɹɟɬ ɜɵɩɨɥɧɹɬɶ ɨɩɟɪɚɰɢɢ ɫɪɚɡɭ ɧɚɞ ɧɟɫɤɨɥɶɤɢɦɢ ɫɢɦ242 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɜɨɥɚɦɢ, ɨɛɵɱɧɨ ɩɪɟɞɫɬɚɜɥɹɟɦɵɦɢ ɛɚɣɬɚɦɢ. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɤɨɦɚɧɞɵ ɩɪɨɰɟɫɫɨɪɚ ɩɨɡɜɨɥɹɸɬ ɨɩɟɪɢɪɨɜɚɬɶ 32-ɯ ɪɚɡɪɹɞɧɵɦɢ ɞɚɧɧɵɦɢ, ɬɨ ɦɨɠɧɨ ɨɫɭɳɟɫɬɜɥɹɬɶ ɨɞɧɨɜɪɟɦɟɧɧɨɟ ɫɪɚɜɧɟɧɢɟ ɱɟɬɵɪɟɯ ɛɚɣɬɨɜ. 4) ɇɟɩɨɥɧɚɹ ɫɨɪɬɢɪɨɜɤɚ. ȼ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɦɵ ɞɨɥɠɧɵ ɩɨɥɭɱɢɬɶ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɫɢɦɜɨɥɨɜ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ ɦɚɬɪɢɰɵ ɩɟɪɟɫɬɚɧɨɜɨɤ. ɇɚɦ ɧɟ ɜɚɠɧɨ, ɤɚɤɚɹ ɢɡ ɞɜɭɯ ɫɬɪɨɤ ɛɭɞɟɬ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢ ɦɟɧɶɲɟ, ɟɫɥɢ ɢɦ ɫɨɨɬɜɟɬɫɬɜɭɸɬ ɨɞɢɧɚɤɨɜɵɟ ɫɢɦɜɨɥɵ ɩɨɫɥɟɞɧɟɝɨ ɫɬɨɥɛɰɚ. ɉɨɷɬɨɦɭ ɦɵ ɦɨɠɟɦ ɢɡɛɟɠɚɬɶ ɥɢɲɧɢɯ ɫɪɚɜɧɟɧɢɣ ɩɪɢ ɫɨɪɬɢɪɨɜɤɟ ɫɬɪɨɤ. ɋɈɊɌɂɊɈȼɄȺ ɋɍɎɎɂɄɋɈȼ
ɉɪɢɦɟɧɹɹ ɞɚɧɧɭɸ ɫɨɪɬɢɪɨɜɤɭ, ɦɵ ɢɫɯɨɞɢɦ ɢɡ ɬɨɝɨ, ɱɬɨ ɧɚɦ ɩɪɢɯɨɞɢɬɫɹ ɫɨɪɬɢɪɨɜɚɬɶ ɫɬɪɨɤɢ, ɤɚɠɞɚɹ ɢɡ ɤɨɬɨɪɵɯ ɹɜɥɹɟɬɫɹ ɱɚɫɬɶɸ ɞɪɭɝɨɣ, ɧɚɱɢɧɚɸɳɟɣɫɹ ɫ ɛɨɥɟɟ ɪɚɧɧɟɣ ɩɨɡɢɰɢɢ ɜ ɛɥɨɤɟ, ɬ.ɟ. ɹɜɥɹɟɬɫɹ ɟɟ ɫɭɮɮɢɤɫɨɦ. Ɂɚɞɚɱɚ ɫɨɪɬɢɪɨɜɤɢ ɫɭɮɮɢɤɫɨɜ ɧɟɪɚɡɪɵɜɧɨ ɫɜɹɡɚɧɚ ɫ ɩɨɫɬɪɨɟɧɢɟɦ ɞɟɪɟɜɚ ɫɭɮɮɢɤɫɨɜ, ɤɨɬɨɪɨɟ ɩɨɦɢɦɨ ɫɠɚɬɢɹ ɞɚɧɧɵɯ ɦɨɠɟɬ ɛɵɬɶ ɬɚɤɠɟ ɢɫɩɨɥɶɡɨɜɚɧɨ ɞɥɹ ɛɵɫɬɪɨɝɨ ɩɨɢɫɤɚ ɫɬɪɨɤ ɜ ɛɥɨɤɟ. Ƚɥɚɜɧɨɟ ɫɜɨɣɫɬɜɨ ɜɫɟɯ ɫɭɮɮɢɤɫɧɵɯ ɫɨɪɬɢɪɨɜɨɤ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɜɪɟɦɹ ɫɨɪɬɢɪɨɜɤɢ ɩɨɱɬɢ ɧɟ ɡɚɜɢɫɢɬ ɨɬ ɞɚɧɧɵɯ. Ɉɩɢɲɟɦ ɨɞɧɭ ɢɡ ɩɨɥɭɱɢɜɲɢɯ ɛɨɥɶɲɭɸ ɢɡɜɟɫɬɧɨɫɬɶ ɫɭɮɮɢɤɫɧɵɯ ɫɨɪɬɢɪɨɜɨɤ, ɤɨɬɨɪɚɹ ɛɵɥɚ ɨɩɭɛɥɢɤɨɜɚɧɚ ɜ 1998 ɝɨɞɭ Ʉɭɧɢɯɢɤɨ ɋɚɞɚɤɚɧɟ. Ɋɚɫɫɦɨɬɪɢɦ ɚɥɝɨɪɢɬɦ ɧɚ ɩɪɢɦɟɪɟ. ȼɜɟɞɟɦ ɨɛɨɡɧɚɱɟɧɢɹ: X I
— ɦɚɫɫɢɜ ɫɭɮɮɢɤɫɨɜ X[i], ɤɚɠɞɵɣ ɢɡ ɤɨɬɨɪɵɯ ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɫɬɪɨɤɭ, ɧɚɱɢɧɚɸɳɭɸɫɹ ɫ i-ɨɣ ɩɨɡɢɰɢɢ ɜ ɛɥɨɤɟ; — ɦɚɫɫɢɜ ɢɧɞɟɤɫɨɜ ɫɭɮɮɢɤɫɨɜ; ɩɨɥɨɠɟɧɢɟ ɢɧɞɟɤɫɨɜ ɜ ɷɬɨɦ ɦɚɫɫɢɜɟ ɞɨɥɠɧɨ ɫɨɨɬɜɟɬɫɬɜɨɜɚɬɶ ɩɨɪɹɞɤɭ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɯ ɫɭɮɮɢɤɫɨɜ;
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 243 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
V[i] — ɧɨɦɟɪ ɝɪɭɩɩɵ, ɤ ɤɨɬɨɪɨɣ ɨɬɧɨɫɢɬɫɹ ɫɭɮɮɢɤɫ X[i]; ɫɨɪɬɢɪɨɜɤɚ ɜɵɩɨɥɧɹɟɬɫɹ ɞɨ ɬɟɯ ɩɨɪ, ɩɨɤɚ ɜɫɟ ɡɧɚɱɟɧɢɹ ɜ V ɧɟ ɫɬɚɧɭɬ ɪɚɡɧɵɦɢ; S[i] — ɱɢɫɥɨ ɫɭɮɮɢɤɫɨɜ, ɨɬɧɨɫɹɳɢɯɫɹ ɤ ɝɪɭɩɩɟ i; k — ɩɨɪɹɞɨɤ ɫɨɪɬɢɪɨɜɤɢ. Ʉɚɤ ɜɫɟɝɞɚ, ɛɭɞɟɦ ɩɪɨɢɡɜɨɞɢɬɶ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚɍɢɥɟɪɚ ɫɬɪɨɤɢ “ɚɛɪɚɤɚɞɚɛɪɚ$” (ɞɨɛɚɜɢɦ ɤ ɫɬɪɨɤɟ ɫɢɦɜɨɥ ‘$’, ɨɡɧɚɱɚɸɳɢɣ ɤɨɧɟɰ ɫɬɪɨɤɢ). ɒɚɝ 1 ɍɩɨɪɹɞɨɱɢɦ ɜɫɟ ɫɢɦɜɨɥɵ ɫɬɪɨɤɢ (ɞɥɹ ɨɩɪɟɞɟɥɟɧɧɨɫɬɢ ɩɪɟɞɩɨɥɨɠɢɦ, ɱɬɨ ɫɢɦɜɨɥ ɤɨɧɰɚ ɫɬɪɨɤɢ ɢɦɟɟɬ ɧɚɢɦɟɧɶɲɟɟ ɡɧɚɱɟɧɢɟ). Ɂɚɬɟɦ ɡɚɩɨɥɧɢɦ ɦɚɫɫɢɜ I ɡɧɚɱɟɧɢɹɦɢ, ɪɚɜɧɵɦɢ ɩɨɡɢɰɢɹɦ ɷɬɢɯ ɫɢɦɜɨɥɨɜ ɜ ɢɫɯɨɞɧɨɣ ɫɬɪɨɤɟ. ȼ ɦɚɫɫɢɜ V ɡɚɩɢɲɟɦ ɩɨ ɩɨɪɹɞɤɭ ɧɨɦɟɪɚ ɝɪɭɩɩ, ɨɫɬɚɜɥɹɹ ɦɟɫɬɨ ɞɥɹ ɟɳɟ ɧɟ ɭɩɨɪɹɞɨɱɟɧɧɵɯ ɷɥɟɦɟɧɬɨɜ. Ɍɚɤ, ɞɥɹ ɫɢɦɜɨɥɚ ‘ɛ’ ɭɤɚɠɟɦ ɧɨɦɟɪ ɝɪɭɩɩɵ, ɪɚɜɧɵɣ 6, ɱɬɨɛɵ ɨɫɬɚɜɢɬɶ ɜɨɡɦɨɠɧɨɫɬɶ ɞɥɹ ɭɩɨɪɹɞɨɱɢɜɚɧɢɹ ɜɫɟɯ ɩɹɬɢ ɫɬɪɨɤ, ɧɚɱɢɧɚɸɳɢɯɫɹ ɫ ɫɢɦɜɨɥɚ ‘ɚ’. ɂ, ɧɚɤɨɧɟɰ, ɜ ɦɚɫɫɢɜ S ɡɚɩɢɲɟɦ ɪɚɡɦɟɪɵ ɩɨɥɭɱɟɧɧɵɯ ɝɪɭɩɩ. ɇɟɛɨɥɶɲɚɹ ɯɢɬɪɨɫɬɶ, ɩɪɢɞɭɦɚɧɧɚɹ ɚɜɬɨɪɨɦ ɨɩɢɫɵɜɚɟɦɨɝɨ ɚɥɝɨɪɢɬɦɚ, ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨɛɵ ɞɥɹ ɝɪɭɩɩ, ɜ ɤɨɬɨɪɵɯ ɨɫɬɚɥɚɫɶ ɬɨɥɶɤɨ ɨɞɧɚ ɫɬɪɨɤɚ, ɡɚɩɢɫɵɜɚɬɶ ɨɬɪɢɰɚɬɟɥɶɧɨɟ ɡɧɚɱɟɧɢɟ, ɪɚɜɧɨɟ ɤɨɥɢɱɟɫɬɜɭ ɭɩɨɪɹɞɨɱɟɧɧɵɯ ɫɭɮɮɢɤɫɨɜ ɞɨ ɛɥɢɠɚɣɲɟɣ ɧɟ ɨɬɫɨɪɬɢɪɨɜɚɧɧɨɣ ɝɪɭɩɩɵ. ɗɬɨ ɫɭɳɟɫɬɜɟɧɧɨ ɭɫɤɨɪɹɟɬ ɪɚɛɨɬɭ ɜ ɫɥɭɱɚɹɯ, ɤɨɝɞɚ ɭ ɧɚɫ ɫɬɚɧɨɜɢɬɫɹ ɦɧɨɝɨ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɯ ɝɪɭɩɩ (ɧɚ ɬɟɤɫɬɚɯ ɬɚɤɨɣ ɦɨɦɟɧɬ, ɤɚɤ ɩɪɚɜɢɥɨ, ɧɚɫɬɭɩɚɟɬ ɭɠɟ ɧɚ ɬɪɟɬɶɟɦɱɟɬɜɟɪɬɨɦ ɲɚɝɟ ɫɨɪɬɢɪɨɜɤɢ).
244 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɨɡɢɰɢɢ: ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ: ɭɩɨɪɹɞɨɱɟɧɧɵɟ ɫɢɦɜɨɥɵ: I[i] V[I[i]] S[i]
0 ɚ
1 ɛ
2 ɪ
3 ɚ
4 ɤ
5 ɚ
6 ɞ
7 ɚ
8 ɛ
9 10 11 ɪ ɚ $
$
ɚ
ɚ
ɚ
ɚ
ɚ
ɛ
ɛ
ɞ
ɤ
11 0 -1
0 1 5
3 1
5 1
7 10 1 1
1 6 2
8 6
6 8 -2
ɪ
ɪ
4 2 9 9 10 10 2
ɒɚɝ 2 Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɡɚɜɟɪɲɟɧɚ ɨɛɪɚɛɨɬɤɚ ɫɭɮɮɢɤɫɨɜ ɩɨɪɹɞɤɚ k=0, ɬ.ɟ. ɨɞɢɧɨɱɧɵɯ ɫɢɦɜɨɥɨɜ. Ɍɟɩɟɪɶ ɨɬɫɨɪɬɢɪɭɟɦ ɩɚɪɵ (k=1). Ⱦɥɹ ɫɨɪɬɢɪɨɜɤɢ ɫɭɮɮɢɤɫɨɜ ɤɚɠɞɨɣ ɝɪɭɩɩɵ ɧɚɦ ɩɨɬɪɟɛɭɸɬɫɹ ɬɨɥɶɤɨ ɡɧɚɱɟɧɢɹ ɧɨɦɟɪɨɜ ɝɪɭɩɩ ɫɭɮɮɢɤɫɨɜ (ɨɛɨɡɧɚɱɚɟɦɵɯ ɞɚɥɟɟ ɤɚɤ Xk), ɧɚɯɨɞɹɳɢɯɫɹ ɧɚ k ɫɢɦɜɨɥɨɜ ɩɪɚɜɟɟ ɫɨɪɬɢɪɭɟɦɵɯ ɫɭɮɮɢɤɫɨɜ. ɇɚɩɪɢɦɟɪ, ɞɥɹ ɫɨɪɬɢɪɨɜɤɢ ɝɪɭɩɩɵ 1, ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɫɢɦɜɨɥɭ ‘ɚ’, ɧɚɦ ɩɨɬɪɟɛɨɜɚɥɢɫɶ ɝɪɭɩɩɵ 6, 9, 8, 6 ɢ 0 ɨɬ ɫɢɦɜɨɥɨɜ ‘ɛ’, ‘ɤ’, ‘ɞ’, ‘ɛ’ ɢ ‘$’. ɉɨɡɢɰɢɢ: ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ: ɭɩɨɪɹɞɨɱɟɧɧɵɟ ɫɢɦɜɨɥɵ: ɫɭɮɮɢɤɫ Xk V[I[i]+1] ɩɚɪɵ:
0 ɚ $
1 ɛ ɚ
2 ɪ ɚ
3 ɚ ɚ
4 ɤ ɚ
5 ɚ ɚ
6 ɞ ɛ
7 ɚ ɛ
8 ɛ ɞ
9 10 11 ɪ ɚ $ ɤ ɪ ɪ
ɚ ɛ ɤ ɞ ɛ $ ɪ ɪ ɚ ɚ ɚ ɚ 1 6 9 8 6 0 10 10 1 1 1 1 $ɚ ɚɛ ɚɤ ɚɞ ɚɛ ɚ$ ɛɪ ɛɪ ɞɚ ɤɚ ɪɚ ɪɚ
ɉɨɫɥɟ ɫɨɪɬɢɪɨɜɤɢ ɧɨɦɟɪɨɜ ɝɪɭɩɩ: V[I[i]+1] ɭɩɨɪɹɞɨɱɟɧɧɵɟ ɩɚɪɵ: I[i] V[I[i]] S[i]
1 0 6 6 8 9 10 10 1 1 1 1 $ɚ ɚ$ ɚɛ ɚɛ ɚɞ ɚɤ ɛɪ ɛɪ ɞɚ ɤɚ ɪɚ ɪɚ 11 10 0 1 -2
0 2 2
7 2
5 4 -2
3 5
1 6 2
8 6
6 8 -2
4 2 9 9 10 10 2
ɒɚɝ 3 ɉɨɫɤɨɥɶɤɭ ɜɫɟ ɩɚɪɵ ɬɟɩɟɪɶ ɨɬɫɨɪɬɢɪɨɜɚɧɵ, ɦɨɠɧɨ ɭɩɨɪɹɞɨɱɢɬɶ ɱɟɬɜɟɪɤɢ. Ⱦɥɹ ɷɬɨɝɨ ɤɚɠɞɭɸ ɝɪɭɩɩɭ (ɤɨɬɨɪɵɟ ɩɪɟɞɫɬɚɜɥɹɸɬ ɫɨɛɨɣ ɫɭɮɮɢɤɫɵ, ɧɚɱɢɧɚɸɳɢɟɫɹ ɫ ɨɞɢɧɚɤɨɜɵɯ ɩɚɪ) ɨɬɫɨɪɬɢɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 245 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɪɭɟɦ ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɩɚɪɨɣ ɫɢɦɜɨɥɨɜ, ɫɥɟɞɭɸɳɢɯ ɩɨɫɥɟ ɷɬɢɯ ɨɞɢɧɚɤɨɜɵɯ ɩɚɪ. ɉɪɨɱɟɪɤɚɦɢ ɨɬɦɟɱɟɧɵ ɭɠɟ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɟ ɫɭɮɮɢɤɫɵ, ɤɨɬɨɪɵɟ ɞɚɥɶɲɟ ɨɛɪɚɛɚɬɵɜɚɬɶ ɧɟɬ ɧɟɨɛɯɨɞɢɦɨɫɬɢ. ɩɨɡɢɰɢɢ: ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ: ɭɩɨɪɹɞɨɱɟɧɧɵɟ ɩɚɪɵ: ɫɭɮɮɢɤɫ Xk V[I[i]+2]
0 1 2 3 4 5 6 7 8 9 10 11 ɚ ɛ ɪ ɚ ɤ ɚ ɞ ɚ ɛ ɪ ɚ $ $ɚ ɚ$ ɚɛ ɚɛ ɚɞ ɚɤ ɛɪ ɛɪ ɞɚ ɤɚ ɪɚ ɪɚ -
—
ɪɚ ɪɚ — 10 10
ɚɤ ɚ$ — 5 1
—
—
ɤɚ $a 9 0
ɉɨɫɥɟ ɫɨɪɬɢɪɨɜɤɢ ɧɨɦɟɪɨɜ ɝɪɭɩɩ: ɫɭɮɮɢɤɫ Xk V[I[i]+2] I[i] V[I[i]] S[i]
ɪɚ ɪɚ — — ɚ$ ɚɤ — — $ɚ ɤa 10 10 1 5 9 0 11 10 0 7 5 3 8 1 6 4 9 2 0 1 2 2 4 5 6 7 8 9 10 11 -2 2 -8
-
—
ɒɚɝ 4 Ʉɚɤ ɦɨɠɧɨ ɡɚɦɟɬɢɬɶ, ɧɚɦ ɨɫɬɚɥɨɫɶ ɨɬɫɨɪɬɢɪɨɜɚɬɶ ɜɫɟɝɨ ɨɞɧɭ ɝɪɭɩɩɭ, ɫɨɫɬɨɹɳɭɸ ɢɡ ɞɜɭɯ ɷɥɟɦɟɧɬɨɜ. ɩɨɡɢɰɢɢ: ɢɫɯɨɞɧɚɹ ɫɬɪɨɤɚ: ɭɩɨɪɹɞɨɱɟɧɧɵɟ ɱɟɬɜɟɪɤɢ: ɫɭɮɮɢɤɫ Xk V[I[i]+4]
0 ɚ
1 ɛ
4 ɤ
5 ɚ
6 ɞ
7 ɚ
8 ɛ
9 ɪ
$ɚɛɪ —
ɚɛɪɚ ɚɛɪɚ —
—
—
—
—
ɤɚɞɚ —
-
-
ɤɚɞɚ $ɚɛɪ — 9 0
—
—
—
—
—
-
—
2 ɪ
3 ɚ
10 11 ɚ $
—
ɉɨɫɥɟ ɫɨɪɬɢɪɨɜɤɢ ɧɨɦɟɪɨɜ ɝɪɭɩɩ: V[I[i]+4] I[i] V[I[i]] S[i]
11 10 0 1 -12
0 7 2
9 0 3
5 4
3 5
1 8 6
5 1 7
6 8
9 0 4 9 2 9 10 11
246 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɍɚɤɢɦ ɨɛɪɚɡɨɦ ɦɵ ɩɨɥɭɱɢɥɢ ɭɩɨɪɹɞɨɱɟɧɧɵɟ ɫɭɮɮɢɤɫɵ, ɢɧɞɟɤɫɵ ɤɨɬɨɪɵɯ ɡɚɩɢɫɚɧɵ ɜ ɦɚɫɫɢɜɟ I: i 0 1 2 3 4 5 6 7 8 9 10 11
I[i] 11 10 7 0 5 3 8 1 6 4 9 2
ɫɭɮɮɢɤɫ $ ɚ$ ɚɛɪɚ$ ɚɛɪɚɤɚɞɚɛɪɚ$ ɚɞɚɛɪɚ$ ɚɤɚɞɚɛɪɚ$ ɛɪɚ$ ɛɪɚɤɚɞɚɛɪɚ$ ɞɚɛɪɚ$ ɤɚɞɚɛɪɚ$ ɪɚ$ ɪɚɤɚɞɚɛɪɚ$
Ɋɢɫ. 5.25. Ɋɟɡɭɥɶɬɚɬ ɫɨɪɬɢɪɨɜɤɢ ɫɭɮɮɢɤɫɨɜ ɍɩɪɚɠɧɟɧɢɟ: ȼɵɩɨɥɧɢɬɟ ɫɨɪɬɢɪɨɜɤɭ ɫɬɪɨɤɢ “tobeornottobe”, ɢɫɩɨɥɶɡɭɹ ɨɩɢɫɚɧɧɵɣ ɚɥɝɨɪɢɬɦ.
ɋɊȺȼɇȿɇɂȿ ȺɅȽɈɊɂɌɆɈȼ ɋɈɊɌɂɊɈȼɄɂ
ɉɨɫɤɨɥɶɤɭ ɫɤɨɪɨɫɬɶ ɫɨɪɬɢɪɨɜɤɢ ɜɨ ɦɧɨɝɨɦ ɨɩɪɟɞɟɥɹɟɬ ɛɵɫɬɪɨɞɟɣɫɬɜɢɟ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɨɫɭɳɟɫɬɜɥɹɸɳɢɯ ɫɠɚɬɢɟ ɩɪɢ ɩɨɦɨɳɢ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, ɧɚɞ ɫɨɜɟɪɲɟɧɫɬɜɨɜɚɧɢɟɦ ɚɥɝɨɪɢɬɦɨɜ ɫɨɪɬɢɪɨɜɤɢ ɩɨɫɬɨɹɧɧɨ ɜɟɞɟɬɫɹ ɪɚɛɨɬɚ. Ɇɨɠɧɨ ɨɬɦɟɬɢɬɶ, ɱɬɨ ɢɫɫɥɟɞɨɜɚɬɟɥɢ, ɬɹɝɨɬɟɸɳɢɟ ɤ ɩɪɚɤɬɢɱɟɫɤɨɦɭ ɩɪɢɦɟɧɟɧɢɸ, ɭɞɟɥɹɸɬ ɨɫɨɛɨɟ ɜɧɢɦɚɧɢɟ ɫɠɚɬɢɸ ɬɢɩɢɱɧɵɯ ɮɚɣɥɨɜ, ɜ ɬɨ ɜɪɟɦɹ ɤɚɤ ɛɨɥɶɲɢɧɫɬɜɨ ɩɭɛɥɢɤɚɰɢɣ ɜ ɧɚɭɱɧɵɯ ɢɡɞɚɧɢɹɯ ɩɨɫɜɹɳɟɧɨ ɦɟɬɨɞɚɦ, ɩɨɡɜɨɥɹɸɳɢɦ ɪɟɚɥɢɡɨɜɚɬɶ ɫɨɪɬɢɪɨɜɤɭ, ɭɫɬɨɣɱɢɜɭɸ ɤ ɜɵɪɨɠɞɟɧɧɵɦ ɞɚɧɧɵɦ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 247 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱦɥɹ ɫɪɚɜɧɟɧɢɹ ɦɟɬɨɞɨɜ ɫɨɪɬɢɪɨɜɤɢ ɩɨɥɟɡɧɨ ɜɜɟɫɬɢ ɩɨɧɹɬɢɟ ɫɪɟɞɧɟɣ ɞɥɢɧɵ ɫɨɜɩɚɞɟɧɢɣ (Average Match Length, AML), ɜɵɱɢɫɥɹɟɦɨɣ ɩɨ ɫɥɟɞɭɸɳɟɣ ɮɨɪɦɭɥɟ:
AML =
1 n −1 D(X[I[i]], X[I[i + 1]]) n − 1 i =1ƒ
ɝɞɟ N
— ɪɚɡɦɟɪ ɛɥɨɤɚ ɞɚɧɧɵɯ, ɩɨɞɜɟɪɝɚɟɦɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɸ; X — ɦɚɫɫɢɜ ɫɭɮɮɢɤɫɨɜ X[i], ɤɚɠɞɵɣ ɢɡ ɤɨɬɨɪɵɯ ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɫɬɪɨɤɭ, ɧɚɱɢɧɚɸɳɭɸɫɹ ɫ i-ɨɣ ɩɨɡɢɰɢɢ ɜ ɛɥɨɤɟ; I — ɦɚɫɫɢɜ ɢɧɞɟɤɫɨɜ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢ ɭɩɨɪɹɞɨɱɟɧɧɵɯ ɫɭɮɮɢɤɫɨɜ; D(x,y) — ɱɢɫɥɨ ɫɨɜɩɚɞɚɸɳɢɯ ɫɢɦɜɨɥɨɜ ɜ ɨɞɢɧɚɤɨɜɵɯ ɩɨɡɢɰɢɹɯ ɫɬɪɨɤ x ɢ y, ɧɚɱɢɧɚɹ ɨɬ ɩɟɪɜɨɝɨ ɫɢɦɜɨɥɚ ɫɬɪɨɤɢ ɢ ɡɚɤɚɧɱɢɜɚɹ ɩɟɪɜɵɦ ɧɟɫɨɜɩɚɞɟɧɢɟɦ. ɂɫɫɥɟɞɨɜɚɧɢɹ ɩɨɤɚɡɚɥɢ, ɱɬɨ ɜɪɟɦɹ, ɡɚɬɪɚɱɢɜɚɟɦɨɟ ɫɭɮɮɢɤɫɧɨɣ ɫɨɪɬɢɪɨɜɤɨɣ, ɩɪɨɩɨɪɰɢɨɧɚɥɶɧɨ ɥɨɝɚɪɢɮɦɭ ɫɪɟɞɧɟɣ ɞɥɢɧɵ ɫɨɜɩɚɞɟɧɢɣ, ɜ ɬɨ ɜɪɟɦɹ ɤɚɤ ɚɥɝɨɪɢɬɦɵ, ɨɫɧɨɜɚɧɧɵɟ ɧɚ ɛɵɫɬɪɨɣ ɫɨɪɬɢɪɨɜɤɟ ɢɥɢ ɫɨɪɬɢɪɨɜɤɟ ɫɥɢɹɧɢɟɦ, ɞɟɦɨɧɫɬɪɢɪɭɸɬ, ɤɚɤ ɩɪɚɜɢɥɨ, ɥɢɧɟɣɧɨ ɩɪɨɩɨɪɰɢɨɧɚɥɶɧɭɸ AML ɡɚɜɢɫɢɦɨɫɬɶ. ȼɩɪɨɱɟɦ, ɫɩɪɚɜɟɞɥɢɜɨɫɬɢ ɪɚɞɢ ɫɬɨɢɬ ɨɬɦɟɬɢɬɶ, ɱɬɨ ɭɫɨɜɟɪɲɟɧɫɬɜɨɜɚɧɢɹ ɚɥɝɨɪɢɬɦɚ ɫɨɪɬɢɪɨɜɤɢ Ȼɟɧɬɥɢ-ɋɟɞɠɜɢɤɚ, ɨɩɢɫɚɧɧɵɟ ɜɵɲɟ, ɫɭɳɟɫɬɜɟɧɧɨ ɫɨɤɪɚɳɚɸɬ ɜɪɟɦɹ ɫɨɪɬɢɪɨɜɤɢ ɢ ɩɨɷɬɨɦɭ ɷɬɨɬ ɚɥɝɨɪɢɬɦ ɡɚɱɚɫɬɭɸ ɧɟ ɭɫɬɭɩɚɟɬ ɫɭɮɮɢɤɫɧɨɣ ɫɨɪɬɢɪɨɜɤɟ ɞɚɠɟ ɧɚ ɪɹɞɟ ɜɵɪɨɠɞɟɧɧɵɯ ɞɚɧɧɵɯ. ɐɟɧɚ ɬɚɤɨɣ ɭɫɬɨɣɱɢɜɨɫɬɢ — ɩɨɜɵɲɟɧɧɵɟ ɧɚɤɥɚɞɧɵɟ ɪɚɫɯɨɞɵ ɧɚ ɟɟ ɨɛɟɫɩɟɱɟɧɢɟ. Ⱦɥɹ ɫɪɚɜɧɟɧɢɹ ɧɢɠɟ ɩɪɢɜɟɞɟɧɵ ɷɤɫɩɟɪɢɦɟɧɬɚɥɶɧɵɟ ɞɚɧɧɵɟ, ɩɨɥɭɱɟɧɧɵɟ ɧɚ ɤɨɦɩɶɸɬɟɪɟ ɫ ɩɪɨɰɟɫɫɨɪɨɦ Intel Pentium 233 ɆȽɰ ɢ ɨɩɟɪɚɬɢɜɧɨɣ ɩɚɦɹɬɶɸ 64 Ɇɛɚɣɬ. Ȼɵɥɢ ɜɵɛɪɚɧɵ ɨɞɧɢ ɢɡ ɧɚɢɛɨɥɟɟ ɨɩɬɢɦɢɡɢɪɨɜɚɧɧɵɯ ɩɪɟɞɫɬɚɜɢɬɟɥɟɣ BWTɤɨɦɩɪɟɫɫɨɪɨɜ ɞɥɹ ɜɵɹɜɥɟɧɢɹ ɫɥɚɛɵɯ ɢ ɫɢɥɶɧɵɯ ɫɬɨɪɨɧ ɪɚɡɥɢɱ248 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɧɵɯ ɦɟɬɨɞɨɜ. Ɍɪɟɛɨɜɚɧɢɹ ɤ ɩɚɦɹɬɢ ɭɱɚɫɬɜɭɸɳɢɯ ɜ ɷɤɫɩɟɪɢɦɟɧɬɟ ɩɪɨɝɪɚɦɦ ɞɨɜɨɥɶɧɨ ɛɥɢɡɤɢ (ɨɬ 6 ɞɨ 8 ɪɚɡɦɟɪɨɜ ɛɥɨɤɚ). 1) DC 0.99.015b (ɚɜɬɨɪ — ɗɞɝɚɪ Ȼɢɧɞɟɪ). ȼ ɞɚɧɧɨɦ ɚɪɯɢɜɚɬɨɪɟ ɢɫɩɨɥɶɡɨɜɚɧɵ ɩɨɪɚɡɪɹɞɧɚɹ ɫɨɪɬɢɪɨɜɤɚ ɢ ɫɨɪɬɢɪɨɜɤɚ ɫɥɢɹɧɢɟɦ. 2) BA 1.01br5 (Ɇɢɤɚɟɥɶ Ʌɭɧɞɤɜɢɫɬ), YBS 0.03e (ȼɚɞɢɦ ɘɤɢɧ), ARC (əɧ ɋɚɬɬɨɧ). ȼɨ ɜɫɟɯ ɬɪɟɯ ɩɪɨɝɪɚɦɦɚɯ ɧɚɲɥɚ ɫɜɨɟ ɩɪɢɦɟɧɟɧɢɟ ɫɨɪɬɢɪɨɜɤɚ Ȼɟɧɬɥɢ-ɋɟɞɠɜɢɤɚ ɜɦɟɫɬɟ ɫ ɩɨɪɚɡɪɹɞɧɨɣ. ȿɳɟ ɫɬɨɢɬ ɭɩɨɦɹɧɭɬɶ SBC 0.910 (ɋɚɦɢ Ɇɹɤɢɧɟɧ), ɤɨɬɨɪɚɹ ɧɟ ɭɱɚɫɬɜɨɜɚɥɚ ɜ ɷɤɫɩɟɪɢɦɟɧɬɟ ɩɨ ɩɪɢɱɢɧɟ ɧɟɜɨɡɦɨɠɧɨɫɬɢ ɜɵɞɟɥɢɬɶ ɫɨɪɬɢɪɨɜɤɭ ɨɬɞɟɥɶɧɨ ɨɬ ɜɫɟɯ ɨɫɬɚɥɶɧɵɯ ɩɪɨɰɟɞɭɪ. 3) QSuf (Ʌɚɪɫɫɨɧ ɢ ɋɚɞɚɤɚɧɟ). ȼ ɷɬɨɣ ɩɪɨɝɪɚɦɦɟ ɪɟɚɥɢɡɨɜɚɧɚ ɬɨɥɶɤɨ ɫɭɮɮɢɤɫɧɚɹ ɫɨɪɬɢɪɨɜɤɚ, ɧɟɦɧɨɝɨ ɭɥɭɱɲɟɧɧɚɹ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɨɩɢɫɚɧɧɨɣ ɜɵɲɟ. Ⱦɥɹ ɷɤɫɩɟɪɢɦɟɧɬɚ ɢɫɩɨɥɶɡɨɜɚɥɢɫɶ ɫɥɟɞɭɸɳɢɟ ɮɚɣɥɵ: 1) book1 ɢɡ ɬɟɫɬɨɜɨɝɨ ɧɚɛɨɪɚ “Calgary Corpus”, ɤɚɤ ɮɚɣɥ, ɨɛɥɚɞɚɸɳɢɣ ɨɫɧɨɜɧɵɦɢ ɫɜɨɣɫɬɜɚɦɢ ɬɢɩɢɱɧɵɯ ɬɟɤɫɬɨɜ. Ɋɚɡɦɟɪ ɮɚɣɥɚ — 768771 ɛɚɣɬɨɜ. 2) file2 (1,000,000 ɛɚɣɬɨɜ). ɗɬɨɬ ɮɚɣɥ ɛɵɥ ɫɨɫɬɚɜɥɟɧ ɢɡ ɧɟɫɤɨɥɶɤɢɯ ɛɨɥɶɲɢɯ ɨɞɢɧɚɤɨɜɵɯ ɱɚɫɬɟɣ, ɩɨɡɚɢɦɫɬɜɨɜɚɧɧɵɯ ɢɡ ɮɚɣɥɚ book1. Ȼɵɥ ɫɤɨɧɫɬɪɭɢɪɨɜɚɧ ɞɥɹ ɩɪɨɜɟɪɤɢ ɭɦɟɧɢɹ ɚɥɝɨɪɢɬɦɨɜ ɫɨɪɬɢɪɨɜɤɢ ɭɩɨɪɹɞɨɱɢɜɚɬɶ ɞɥɢɧɧɵɟ ɨɞɢɧɚɤɨɜɵɟ ɫɬɪɨɤɢ. 3) wat.c (1,890,501 ɛɚɣɬɨɜ). Ɏɚɣɥ ɢɫɯɨɞɧɵɯ ɬɟɤɫɬɨɜ, ɩɨɥɭɱɟɧɧɵɣ ɩɭɬɟɦ ɫɥɢɹɧɢɹ ɢɫɯɨɞɧɵɯ ɬɟɤɫɬɨɜ, ɩɨɫɬɚɜɥɹɟɦɵɯ ɫ ɞɢɫɬɪɢɛɭɬɢɜɨɦ ɤɨɦɩɢɥɹɬɨɪɚ Watcom C 10.0. Ʉɚɤ ɭɠɟ ɨɬɦɟɱɚɥɚɫɶ ɜɵɲɟ, ɫɪɟɞɧɹɹ ɞɥɢɧɚ ɭɫɬɨɣɱɢɜɨɝɨ ɤɨɧɬɟɤɫɬɚ ɭ ɬɚɤɢɯ ɮɚɣɥɨɜ ɧɟɦɧɨɝɨ ɜɵɲɟ, ɱɟɦ ɭ ɬɢɩɢɱɧɵɯ ɬɟɤɫɬɨɜ. 4) kennedy.xls (1,029,744 ɛɚɣɬɨɜ). Ⱦɚɧɧɵɣ ɮɚɣɥ ɢɫɩɨɥɶɡɨɜɚɥɫɹ ɞɥɹ ɚɧɚɥɢɡɚ ɫɩɨɫɨɛɧɨɫɬɢ ɫɨɪɬɢɪɨɜɳɢɤɨɜ ɨɛɪɚɛɚɬɵɜɚɬɶ ɛɨɥɶɲɨɟ ɤɨɥɢɱɟɫɬɜɨ ɨɞɢɧɚɤɨɜɵɯ ɫɬɪɨɤ ɧɟɛɨɥɶɲɨɣ ɞɥɢɧɵ.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 249 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
QSuf * YBS DC ARC BA bzip2 **
book1 3.30 3.13 2.36 4.17 4.45 3.03
file2 9.23 4.77 4:23.59 4.34 5.82 4.23
wat_c 10.00 6.76 6.92 6.43 7.36 6.81
kennedy 4.23 4.15 2.97 5.00 4.73 4.07
ɉɪɢɦɟɱɚɧɢɹ: * ȼ ɩɪɨɝɪɚɦɦɟ QSuf ɪɟɚɥɢɡɨɜɚɧɚ ɬɨɥɶɤɨ ɫɨɪɬɢɪɨɜɤɚ, ɛɟɡ ɫɠɚɬɢɹ ɢ ɡɚɩɢɫɢ ɢɧɮɨɪɦɚɰɢɢ ɜ ɮɚɣɥ. ɗɬɨ ɧɟɨɛɯɨɞɢɦɨ ɭɱɢɬɵɜɚɬɶ ɩɪɢ ɫɪɚɜɧɟɧɢɢ ɛɵɫɬɪɨɞɟɣɫɬɜɢɹ. ɇɚɩɪɢɦɟɪ, ɚɪɯɢɜɚɬɨɪ YBS ɩɨɬɪɚɬɢɥ ɧɚ ɫɠɚɬɢɟ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɮɚɣɥɚ book1 ɩɪɢɦɟɪɧɨ ɨɞɧɭ ɫɟɤɭɧɞɭ. ** Ⱥɪɯɢɜɚɬɨɪ bzip2 ɩɪɢɜɟɞɟɧ ɬɨɥɶɤɨ ɞɥɹ ɫɩɪɚɜɤɢ, ɬ.ɤ. ɜ ɧɟɦ ɪɟɚɥɢɡɨɜɚɧɨ ɫɠɚɬɢɟ ɧɚ ɨɫɧɨɜɟ ɦɟɬɨɞɚ ɏɚɮɮɦɚɧɚ, ɚ ɜ ɨɫɬɚɥɶɧɵɯ — ɢɫɩɨɥɶɡɭɟɬɫɹ ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ, ɤɨɬɨɪɨɟ ɡɚɦɟɬɧɨ ɦɟɞɥɟɧɧɟɟ, ɧɨ ɞɚɟɬ ɫɭɳɟɫɬɜɟɧɧɨ ɥɭɱɲɟɟ ɫɠɚɬɢɟ (ɧɚ 510 ɩɪɨɰɟɧɬɨɜ). Ʉɪɨɦɟ ɬɨɝɨ, ɦɚɤɫɢɦɚɥɶɧɵɣ ɪɚɡɦɟɪ ɛɥɨɤɚ, ɤɨɬɨɪɵɣ ɩɨɡɜɨɥɹɟɬ ɢɫɩɨɥɶɡɨɜɚɬɶ bzip2 — 900 ɤɛɚɣɬ, ɱɬɨ ɧɟ ɩɨɡɜɨɥɹɟɬ ɞɨɫɬɢɱɶ ɞɨɥɠɧɨɝɨ ɫɠɚɬɢɹ ɜɫɟɯ ɮɚɣɥɨɜ, ɤɪɨɦɟ book1. ɏɨɬɹ ɢ ɞɚɟɬ ɧɟɛɨɥɶɲɨɣ ɩɪɢɪɨɫɬ ɜ ɫɤɨɪɨɫɬɢ (2-3% ɧɚ ɮɚɣɥɟ wat.c). ɍɜɟɥɢɱɟɧɢɟ ɪɚɡɦɟɪɚ ɛɥɨɤɚ ɞɨ ɪɚɡɦɟɪɚ ɮɚɣɥɚ ɦɨɝɥɨ ɛɵ ɡɚɦɟɞɥɢɬɶ ɫɤɨɪɨɫɬɶ ɫɠɚɬɢɹ ɮɚɣɥɚ wat.c ɧɚ 2-3%.
ɉɨ ɪɟɡɭɥɶɬɚɬɚɦ ɷɤɫɩɟɪɢɦɟɧɬɚ ɦɨɠɧɨ ɫɞɟɥɚɬɶ ɧɚɛɥɸɞɟɧɢɹ: 1) ɉɪɟɞɫɬɚɜɢɬɟɥɶ ɚɥɝɨɪɢɬɦɨɜ, ɪɟɚɥɢɡɭɸɳɢɯ ɫɨɪɬɢɪɨɜɤɭ ɫɭɮɮɢɤɫɨɜ, ɜɟɥ ɫɟɛɹ ɞɨɜɨɥɶɧɨ ɪɨɜɧɨ, ɯɨɬɹ ɧɚ ɬɢɩɢɱɧɵɯ ɮɚɣɥɚɯ ɨɤɚɡɚɥɫɹ ɧɚ ɩɨɫɥɟɞɧɟɦ-ɩɪɟɞɩɨɫɥɟɞɧɟɦ ɦɟɫɬɟ. Ʉɚɤ ɭɠɟ ɨɬɦɟɱɚɥɨɫɶ, ɫɭɮɮɢɤɫɧɚɹ ɫɨɪɬɢɪɨɜɤɚ ɯɨɪɨɲɚ, ɧɨ ɭɠ ɛɨɥɶɧɨ ɜɟɥɢɤɢ ɧɚɤɥɚɞɧɵɟ ɪɚɫɯɨɞɵ. 2) DC ɩɪɨɜɚɥɢɥɫɹ ɢɦɟɧɧɨ ɬɚɦ, ɝɞɟ ɨɠɢɞɚɥɨɫɶ — ɧɚ ɞɥɢɧɧɵɯ ɫɨɜɩɚɞɟɧɢɹɯ. Ⱥɪɯɢɜɚɬɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɛɵɫɬɪɭɸ ɫɨɪɬɢɪɨɜɤɭ, ɩɨɬɟɧɰɢɚɥɶɧɨ ɦɨɝɭɬ ɨɬɫɬɚɬɶ ɨɬ ɤɨɧɤɭɪɟɧɬɨɜ ɧɚ ɞɚɧɧɵɯ ɫ ɛɨɥɶɲɢɦ ɤɨɥɢɱɟɫɬɜɨɦ ɥɟɤɫɢɤɨɝɪɚɮɢɱɟɫɤɢ ɭɩɨɪɹɞɨɱɟɧɧɵɯ ɫɨɜɩɚɞɟɧɢɣ. ȼ ɩɪɢɧɰɢɩɟ, ɦɨɠɧɨ ɭɫɩɟɲɧɨ ɛɨɪɨɬɶɫɹ ɢ ɫ ɬɟɦɢ ɢ ɞɪɭɝɢɦɢ ɫɥɚɛɨɫɬɹɦɢ. ɇɨ ɦɨɠɧɨ ɩɪɟɞɩɨɥɨɠɢɬɶ, ɱɬɨ ɧɚ ɬɢɩɢɱɧɵɯ ɮɚɣɥɚɯ, ɫɤɨɪɟɟ ɜɫɟɝɨ, ɫɨɪɬɢɪɨɜɤɚ ɫɥɢɹɧɢɟɦ ɨɫɬɚɧɟɬɫɹ ɥɭɱɲɟ ɧɚ ɤɨɪɨɬɤɢɯ ɤɨɧɬɟɤɫɬɚɯ, ɚ ɫɨɪɬɢɪɨɜɤɚ Ȼɟɧɬɥɢɋɟɞɠɜɢɤɚ — ɧɚ ɞɥɢɧɧɵɯ (ɱɬɨ ɜɢɞɧɨ ɧɚ ɩɪɢɦɟɪɟ ɮɚɣɥɚ wat.c). 250 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
3) Ɇɨɠɧɨ ɛɵɥɨ ɪɚɫɫɦɨɬɪɟɬɶ ɱɚɫɬɢɱɧɨɟ ɫɨɪɬɢɪɭɸɳɟɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɜ ɤɚɱɟɫɬɜɟ ɚɥɶɬɟɪɧɚɬɢɜɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɧɟ ɬɪɟɛɭɸɳɟɝɨ ɬɚɤɢɯ ɯɢɬɪɨɫɬɟɣ ɩɪɢ ɫɨɪɬɢɪɨɜɤɟ. ɇɨ ɡɞɟɫɶ ɭɠɟ ɩɨɹɜɥɹɸɬɫɹ ɞɪɭɝɢɟ ɬɪɟɛɨɜɚɧɢɹ ɩɪɢ ɪɚɫɩɚɤɨɜɤɟ — ɛɨɥɶɲɢɟ ɡɚɬɪɚɬɵ ɩɚɦɹɬɢ ɢ ɜɪɟɦɟɧɢ. ɂ, ɤɚɤ ɩɪɚɜɢɥɨ, ɧɟɦɧɨɝɨ ɯɭɞɲɟɟ ɫɠɚɬɢɟ. ɏɨɬɹ ɫɨɪɬɢɪɨɜɤɚ ɫɭɮɮɢɤɫɨɜ ɢ ɧɟ ɡɚɜɢɫɢɬ ɨɬ ɢɡɛɵɬɨɱɧɨɫɬɢ ɞɚɧɧɵɯ, ɧɚ ɬɢɩɢɱɧɵɯ ɞɚɧɧɵɯ ɦɟɬɨɞɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɛɵɫɬɪɭɸ ɫɨɪɬɢɪɨɜɤɭ ɢ ɫɨɪɬɢɪɨɜɤɭ ɫɥɢɹɧɢɟɦ, ɨɤɚɡɵɜɚɸɬɫɹ ɛɵɫɬɪɟɟ.
Ⱥɪɯɢɜɚɬɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ BWT ɢ ST Ⱦɨɜɨɥɶɧɨ ɛɵɫɬɪɨ ɩɨɫɥɟ ɨɩɭɛɥɢɤɨɜɚɧɢɹ ɫɬɚɬɶɢ Ȼɚɪɪɨɭɡɚ ɢ ɍɢɥɟɪɚ ɫɬɚɥɢ ɩɨɹɜɥɹɬɶɫɹ ɩɟɪɜɵɟ ɤɨɦɩɪɟɫɫɨɪɵ. ɗɬɨ ɨɛɴɹɫɧɹɟɬɫɹ, ɜɨ-ɩɟɪɜɵɯ, ɬɟɦ, ɱɬɨ ɷɬɨɬ ɦɟɬɨɞ ɨɤɚɡɚɥɫɹ ɯɨɪɨɲɢɦ ɤɨɦɩɪɨɦɢɫɫɨɦ ɦɟɠɞɭ ɛɵɫɬɪɵɦɢ ɚɪɯɢɜɚɬɨɪɚɦɢ, ɢɫɩɨɥɶɡɭɸɳɢɦɢ ɫɥɨɜɚɪɧɨɟ ɫɠɚɬɢɟ, ɢ ɦɟɞɥɟɧɧɵɦɢ ɩɨ ɬɨɦɭ ɜɪɟɦɟɧɢ ɫɬɚɬɢɫɬɢɱɟɫɤɢɦɢ ɤɨɦɩɪɟɫɫɨɪɚɦɢ. ȼɨ-ɜɬɨɪɵɯ, ɚɜɬɨɪɵ ɫɪɚɡɭ ɡɚɹɜɢɥɢ, ɱɬɨ ɪɚɡɪɟɲɚɸɬ ɧɟɤɨɦɦɟɪɱɟɫɤɨɟ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɫɜɨɟɝɨ ɢɡɨɛɪɟɬɟɧɢɹ. ɋ ɬɟɯ ɩɨɪ ɤɨɥɢɱɟɫɬɜɨ ɩɪɨɝɪɚɦɦ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, ɧɟɩɪɟɪɵɜɧɨ ɪɚɫɬɟɬ. ɇɢɠɟ ɩɪɢɜɟɞɟɧɚ ɬɚɛɥɢɰɚ, ɜ ɤɨɬɨɪɨɣ ɭɩɨɦɹɧɭɬɵ ɧɚɢɛɨɥɟɟ ɢɧɬɟɪɟɫɧɵɟ ɢɡ ɧɢɯ. Ʉɨɦɩɪɟɫɫɨɪ ɢ ɜɟɪɫɢɹ BRed*
Ⱦɚɬɚ
Ⱥɜɬɨɪ
Ⱥɞɪɟɫ
06.1997
ftp://ftp.cl.cam.ac.uk/users/djw3
X1 –m7 0.95
05.1997
D.J. Wheeler Stig Valentini
mailto:
[email protected] http://www.saunalahti.fi/~x1
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 251 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ʉɨɦɩɪɟɫɫɨɪ ɢ ɜɟɪɫɢɹ BWC 0.99
Ⱦɚɬɚ
Ⱥɜɬɨɪ
01.1999
IMP -2 1.12 WinImp 1.21 szip 1.12
01.2000 09.2000
Willem Monsuwe Conor McCarthy
03.2000
bzip2 1.01 (bzip 0.21)
06.2000
DC 0.99.298b YBS 0.03e
08.2000
BA 1.01br5
10.2000
Zzip 0.36c
06.2001
SBC 0.910b
11.2001
ERI 5.0re
12.2001
GCA 0.9k
12.2001
7-Zip 2.30b12
01.2002
09.2000
Ⱥɞɪɟɫ
mailto:
[email protected] ftp://ftp.stack.nl/pub/users/willem mailto:
[email protected] http://www.technelysium.com.au/ http://www.winimp.com Michael mailto:michael@compressconsult Schindler .com http://www.compressconsult.com/ Julian mailto:
[email protected] Seward http://sourceware.cygnus.com/bzi p2 Edgar mailto:
[email protected] Binder ftp://ftp.elf.stuba.sk/pub/pc/pack Vadim mailto:
[email protected] Yoockin mailto:
[email protected] http://ybs.freeservers.com Mikael mailto:
[email protected] Lundqvist http://hem.spray.se/mikael.lundqv ist Damien mailto:
[email protected] Debin http://www.zzip.f2s.com/ Sami mailto:
[email protected] Makinen http://www.geocities.com/sbcarch iver Alexanmailto:
[email protected] der Ra- http://geocities.com/eri32 tushnyak Shin-ichi mailto:
[email protected] Tsuruta http://www1.odn.ne.jp/~synsyr/ Igor Mailto:
[email protected] Pavlov Http://www.7-zip.org
252 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɋɟɦɟɣɫɬɜɨ ɩɪɨɝɪɚɦɦ BRed, BRed ɢ BRed3 ɧɚɩɢɫɚɧɨ ɨɞɧɢɦ ɢɡ ɪɨɞɨɧɚɱɚɥɶɧɢɤɨɜ BWT, Ⱦɷɜɢɞɨɦ ɍɢɥɟɪɨɦ. Ɇɧɨɝɢɟ ɢɞɟɢ, ɢɫɩɨɥɶɡɨɜɚɧɧɵɟ ɜ ɷɬɢɯ ɤɨɦɩɪɟɫɫɨɪɚɯ, ɨɩɢɫɚɧɵ ɜ ɪɚɛɨɬɚɯ ɉɟɬɟɪɚ Ɏɟɧɜɢɤɚ [18] ɢ ɧɚɲɥɢ ɫɜɨɟ ɩɪɢɦɟɧɟɧɢɟ ɜ ɪɹɞɟ ɞɪɭɝɢɯ ɩɪɨɝɪɚɦɦ, ɧɚɩɪɢɦɟɪ ɜ X1. Bzip ɢɫɩɨɥɶɡɭɟɬ ɚɞɚɩɬɢɪɨɜɚɧɧɭɸ ɤ BWT ɫɨɪɬɢɪɨɜɤɭ Ȼɟɧɬɥɢɋɟɞɠɜɢɤɚ, ɜɨ ɦɧɨɝɨɦ ɩɨɡɚɢɦɫɬɜɨɜɚɧɧɭɸ ɢɡ ɜɵɲɟɭɩɨɦɹɧɭɬɨɝɨ ɫɟɦɟɣɫɬɜɚ. ɉɨɫɥɟ BWT ɜɵɩɨɥɧɹɟɬɫɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɦɟɬɨɞɨɦ ɫɬɨɩɤɢ ɤɧɢɝ, ɜɵɯɨɞɧɵɟ ɞɚɧɧɵɟ ɤɨɬɨɪɨɝɨ ɫɠɢɦɚɸɬɫɹ ɩɪɢ ɩɨɦɨɳɢ ɢɧɬɟɪɜɚɥɶɧɨɝɨ ɤɨɞɢɪɨɜɚɧɢɹ (ɚɧɚɥɨɝ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɫɠɚɬɢɹ) ɫ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ 1-2 ɤɨɞɢɪɨɜɚɧɢɹ ɢ ɫɬɪɭɤɬɭɪɧɨɣ ɦɨɞɟɥɢ ɉɟɬɟɪɚ Ɏɟɧɜɢɤɚ. Ⱦɥɹ ɬɨɝɨ ɱɬɨɛɵ ɫɨɡɞɚɬɶ ɩɪɨɝɪɚɦɦɭ, ɤɨɬɨɪɭɸ ɦɨɠɧɨ ɫɜɨɛɨɞɧɨ ɢɫɩɨɥɶɡɨɜɚɬɶ ɜ ɧɟɤɨɦɦɟɪɱɟɫɤɢɯ ɰɟɥɹɯ, ɜ bzip2 ɢɧɬɟɪɜɚɥɶɧɨɟ ɤɨɞɢɪɨɜɚɧɢɟ ɛɵɥɨ ɡɚɦɟɧɟɧɨ ɧɚ ɫɠɚɬɢɟ ɩɨ ɦɟɬɨɞɭ ɏɚɮɮɦɚɧɚ. ȼɢɞɢɦɨ, ɛɥɚɝɨɞɚɪɹ ɷɬɨɦɭ bzip2 ɧɚɯɨɞɢɬ ɜɫɟ ɛɨɥɶɲɟɟ ɪɚɫɩɪɨɫɬɪɚɧɟɧɢɟ ɜ ɪɚɡɥɢɱɧɵɯ ɨɛɥɚɫɬɹɯ ɩɪɢɦɟɧɟɧɢɹ ɢ ɞɟ-ɮɚɤɬɨ ɭɠɟ ɫɬɚɧɨɜɢɬɫɹ ɨɞɧɢɦ ɢɡ ɫɬɚɧɞɚɪɬɨɜ. ɋɨɪɬɢɪɨɜɤɚ ɜ bzip2 ɢɡɦɟɧɟɧɚ ɧɟɡɧɚɱɢɬɟɥɶɧɨ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ bzip. ȼ ɨɫɧɨɜɧɨɦ, ɩɨɜɵɲɟɧɚ ɭɫɬɨɣɱɢɜɨɫɬɶ ɤ ɢɡɛɵɬɨɱɧɵɦ ɞɚɧɧɵɦ ɢ ɨɩɬɢɦɢɡɢɪɨɜɚɧ ɪɹɞ ɩɪɨɰɟɞɭɪ. ȼ BWC ɢɫɩɨɥɶɡɭɸɬɫɹ ɬɚɤɢɟ ɠɟ ɦɟɬɨɞɵ, ɱɬɨ ɢ bzip ɢ bzip2. Ⱥ ɢɦɟɧɧɨ, ɨɩɬɢɦɢɡɢɪɨɜɚɧɧɚɹ ɫɨɪɬɢɪɨɜɤɚ, MTF, 1-2 ɤɨɞɢɪɨɜɚɧɢɟ ɢ ɢɧɬɟɪɜɚɥɶɧɨɟ ɤɨɞɢɪɨɜɚɧɢɟ. IMP ɢɫɩɨɥɶɡɭɟɬ ɫɨɛɫɬɜɟɧɧɭɸ ɫɨɪɬɢɪɨɜɤɭ, ɨɱɟɧɶ ɛɵɫɬɪɭɸ ɧɚ ɨɛɵɱɧɵɯ ɬɟɤɫɬɚɯ, ɧɨ ɛɭɤɜɚɥɶɧɨ ɡɚɜɢɫɚɸɳɭɸ ɧɚ ɞɚɧɧɵɯ, ɜ ɤɨɬɨɪɵɯ ɜɫɬɪɟɱɚɸɬɫɹ ɞɥɢɧɧɵɟ ɨɞɢɧɚɤɨɜɵɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɫɢɦɜɨɥɨɜ. ɋɠɚɬɢɟ ɩɨɥɧɨɫɬɶɸ ɩɨɡɚɢɦɫɬɜɨɜɚɧɨ ɢɡ bzip2. Ⱥɥɝɨɪɢɬɦ ɫɠɚɬɢɹ, ɢɫɩɨɥɶɡɭɟɦɵɣ ɜ bzip2, ɬɚɤɠɟ ɜɤɥɸɱɟɧ ɢ ɜ ɚɪɯɢɜɚɬɨɪ 7-Zip. ȼ szip, ɩɨɦɢɦɨ ɭɩɨɦɢɧɚɜɲɟɝɨɫɹ ɱɚɫɬɢɱɧɨɝɨ ɫɨɪɬɢɪɭɸɳɟɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɪɟɚɥɢɡɨɜɚɧɚ ɢ ɜɨɡɦɨɠɧɨɫɬɶ ɢɫɩɨɥɶɡɨɜɚɧɢɹ BWT. Ɋɟɚɥɢɡɨɜɚɧɚ, ɩɪɹɦɨ ɫɤɚɠɟɦ, ɬɨɥɶɤɨ ɞɥɹ ɩɪɢɦɟɪɚ, ɛɟɡ ɡɚɬɟɣ. Ⱥ ɜɨɬ ɞɥɹ ɫɠɚɬɢɹ ɢɫɩɨɥɶɡɭɸɬɫɹ ɨɱɟɧɶ ɢɧɬɟɪɟɫɧɵɟ ɪɟɲɟɧɢɹ, ɩɪɟɞɫɬɚɜɥɹɸɳɢɟ ɫɨɛɨɣ ɧɟɤɢɣ ɝɢɛɪɢɞ MTF-ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɢ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 253 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɚɞɚɩɬɢɜɧɵɣ ɤɨɞɟɪ, ɛɟɪɭɳɢɣ ɫɬɚɬɢɫɬɢɤɭ ɢɡ ɤɨɪɨɬɤɨɝɨ ɨɤɧɚ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɫ ɩɨɦɨɳɶɸ BWT ɞɚɧɧɵɯ. ɋ ɭɱɚɫɬɢɟɦ ɚɜɬɨɪɚ szip ɢ ɫ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ ɨɩɢɫɚɧɧɵɯ ɪɟɲɟɧɢɣ ɛɵɥ ɬɚɤɠɟ ɫɨɡɞɚɧ ɚɪɯɢɜɚɬɨɪ ICT UC. ȼ Zzip ɩɪɢɦɟɧɹɟɬɫɹ ɜɫɟ ɬɟ ɠɟ ɢɫɩɵɬɚɧɧɵɟ ɜɪɟɦɟɧɟɦ ɫɬɪɭɤɬɭɪɧɚɹ ɦɨɞɟɥɶ, ɫɨɪɬɢɪɨɜɤɚ Ȼɟɧɬɥɢ-ɋɟɞɠɜɢɤɚ ɢ ɤɨɞɢɪɨɜɚɧɢɟ ɞɢɚɩɚɡɨɧɨɜ. BA ɢɫɩɨɥɶɡɭɟɬ ɚɧɚɥɨɝɢɱɧɭɸ ɫɨɪɬɢɪɨɜɤɭ. ɇɨ ɩɨɜɵɲɟɧɢɟ ɭɫɬɨɣɱɢɜɨɫɬɢ ɪɟɚɥɢɡɨɜɚɧɨ ɜ BA ɞɪɭɝɢɦ ɫɩɨɫɨɛɨɦ. Ⱦɟɥɟɧɢɟ ɫɬɪɨɤ ɩɨ ɤɥɸɱɭ ɩɪɟɤɪɚɳɚɟɬɫɹ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɤɨɝɞɚ ɨɤɚɡɵɜɚɟɬɫɹ, ɱɬɨ ɷɬɢɦ ɫɬɪɨɤɚɦ ɩɪɟɞɲɟɫɬɜɭɸɬ ɨɞɢɧɚɤɨɜɵɟ ɫɢɦɜɨɥɵ. ȿɳɟ ɨɞɧɨ ɧɨɜɲɟɫɬɜɨ, ɪɟɚɥɢɡɨɜɚɧɧɨɟ ɜ BA — ɷɬɨ ɜɵɛɨɪ ɫɬɪɭɤɬɭɪɧɨɣ ɦɨɞɟɥɢ MTF ɜ ɨɬɞɟɥɶɧɨɦ ɩɪɨɯɨɞɟ. Ɍɚɤɠɟ ɡɚ ɫɱɟɬ ɞɢɧɚɦɢɱɟɫɤɨɝɨ ɨɩɪɟɞɟɥɟɧɢɹ ɪɚɡɦɟɪɚ ɛɥɨɤɚ ɭɥɭɱɲɟɧɨ ɫɠɚɬɢɟ ɧɟɨɞɧɨɪɨɞɧɵɯ ɮɚɣɥɨɜ. Ⱦɥɹ ɭɫɢɥɟɧɢɹ ɫɠɚɬɢɹ ɚɧɝɥɢɣɫɤɢɯ ɬɟɤɫɬɨɜ ɢɫɩɨɥɶɡɭɟɬɫɹ ɩɟɪɟɭɩɨɪɹɞɨɱɢɜɚɧɢɟ ɚɥɮɚɜɢɬɚ. ȼ DC ɜɩɟɪɜɵɟ ɪɟɚɥɢɡɨɜɚɧ ɰɟɥɵɣ ɪɹɞ ɧɨɜɚɬɨɪɫɤɢɯ ɢɞɟɣ. ȼɨɩɟɪɜɵɯ, ɤɨɧɟɱɧɨ, ɷɬɨ ɦɨɞɟɥɶ ɫɠɚɬɢɹ, ɨɬɥɢɱɧɚɹ ɨɬ MTF – ɤɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ. ȼɨ-ɜɬɨɪɵɯ, ɧɨɜɵɣ ɦɟɬɨɞ ɫɨɪɬɢɪɨɜɤɢ, ɨɱɟɧɶ ɛɵɫɬɪɵɣ ɧɚ ɬɟɤɫɬɚɯ, ɯɨɬɹ ɢ ɞɚɸɳɢɣ ɫɥɚɛɢɧɭ ɧɚ ɫɢɥɶɧɨ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ. ɂ, ɧɚɤɨɧɟɰ, ɛɨɥɶɲɨɣ ɧɚɛɨɪ ɦɟɬɨɞɨɜ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɬɟɤɫɬɨɜɵɯ ɞɚɧɧɵɯ, ɩɨɡɜɨɥɹɸɳɢɣ ɞɨɛɢɬɶɫɹ ɨɫɨɛɟɧɧɨɝɨ ɭɫɩɟɯɚ ɧɚ ɚɧɝɥɢɣɫɤɢɯ ɬɟɤɫɬɚɯ. Ɉɬɥɢɱɢɬɟɥɶɧɚɹ ɨɫɨɛɟɧɧɨɫɬɶ SBC — ɧɚɥɢɱɢɟ ɦɨɳɧɨɣ ɤɪɢɩɬɨɫɢɫɬɟɦɵ. ɇɢ ɜ ɨɞɧɨɦ ɢɡ ɚɪɯɢɜɚɬɨɪɨɜ, ɩɨɠɚɥɭɣ, ɧɟ ɪɟɚɥɢɡɨɜɚɧɨ ɫɬɨɥɶɤɨ ɚɥɝɨɪɢɬɦɨɜ ɲɢɮɪɨɜɚɧɢɹ, ɤɚɤ ɜ SBC. ȼ SBC ɢɫɩɨɥɶɡɭɟɬɫɹ ɚɥɝɨɪɢɬɦ BWT, ɨɪɢɟɧɬɢɪɨɜɚɧɧɵɣ ɧɚ ɛɨɥɶɲɢɟ ɛɥɨɤɢ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ ɢ ɩɨɡɜɨɥɹɸɳɢɣ ɨɱɟɧɶ ɛɵɫɬɪɨ ɫɨɪɬɢɪɨɜɚɬɶ ɞɚɧɧɵɟ ɫ ɛɨɥɶɲɢɦ ɤɨɥɢɱɟɫɬɜɨɦ ɞɥɢɧɧɵɯ ɩɨɯɨɠɢɯ ɫɬɪɨɤ. ȼɦɟɫɬɨ MTF ɜ ɚɪɯɢɜɚɬɨɪɟ ɢɫɩɨɥɶɡɭɟɬɫɹ ɤɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ, ɯɨɬɹ ɩɨɤɚ ɧɟ ɬɚɤ ɷɮɮɟɤɬɢɜɧɨ, ɤɚɤ ɜ YBS ɢ DC, ɧɨ ɷɬɨ ɤɨɦɩɟɧɫɢɪɭɟɬɫɹ ɛɨɥɶɲɢɦ ɤɨɥɢɱɟɫɬɜɨɦ ɮɢɥɶɬɪɨɜ (ɦɟɬɨɞɨɜ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ), ɧɚɫɬɪɨɟɧɧɵɯ ɧɚ ɨɩɪɟɞɟɥɟɧɧɵɟ ɬɢɩɵ ɞɚɧɧɵɯ. ARC (ɚɜɬɨɪ Ian Sutton, ɤɨɬɨɪɨɦɭ ɬɚɤɠɟ ɩɪɢɧɚɞɥɟɠɢɬ PPMɚɪɯɢɜɚɬɨɪ BOA). Ʉɚɤ ɢ ɦɧɨɝɢɟ ɞɪɭɝɢɟ, ɢɫɩɨɥɶɡɭɟɬ BWT ɧɚ ɨɫ254 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɧɨɜɟ ɫɨɪɬɢɪɨɜɤɢ Ȼɟɧɬɥɢ-ɋɟɞɠɜɢɤɚ ɢ MTF. Ʉɚɤ ɢ ɜ SBC, ɞɨɩɨɥɧɢɬɟɥɶɧɨ ɨɬɫɥɟɠɢɜɚɸɬɫɹ ɨɱɟɧɶ ɞɥɢɧɧɵɟ ɩɨɜɬɨɪɵ ɞɚɧɧɵɯ. ɉɟɪɜɵɟ ɜɟɪɫɢɢ YBS ɬɚɤɠɟ ɢɫɩɨɥɶɡɨɜɚɥɢ ɩɟɪɟɦɟɳɟɧɢɟ ɫɬɨɩɤɢ ɤɧɢɝ, ɤɨɬɨɪɨɟ ɡɚɬɟɦ ɛɵɥɨ ɡɚɦɟɧɟɧɨ ɧɚ ɤɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ. ɑɬɨ ɞɚɥɨ ɡɚɦɟɬɧɵɣ ɜɵɢɝɪɵɲ ɜ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. ɋɪɟɞɢ ɧɟ ɪɚɫɩɪɨɫɬɪɚɧɹɟɦɵɯ ɫɜɨɛɨɞɧɨ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɨɩɢɫɚɧɢɟ ɤɨɬɨɪɵɯ ɨɩɭɛɥɢɤɨɜɚɧɨ ɜ ɧɚɭɱɧɵɯ ɬɪɭɞɚɯ, ɦɨɠɧɨ ɨɬɦɟɬɢɬɶ BKS98 ɢ BKS99, ɤɨɬɨɪɵɟ ɩɪɢɧɚɞɥɟɠɚɬ ɫɪɚɡɭ ɬɪɟɦ ɚɜɬɨɪɚɦ [10]. ɗɬɢ ɤɨɦɩɪɟɫɫɨɪɵ ɢɫɩɨɥɶɡɭɸɬ ɫɭɮɮɢɤɫɧɭɸ ɫɨɪɬɢɪɨɜɤɭ ɢ ɦɧɨɝɨɤɨɧɬɟɤɫɬɨɜɭɸ ɦɨɞɟɥɶ MTF ɩɨ ɬɪɟɦ ɩɨɫɥɟɞɧɢɦ ɤɨɞɚɦ. ɋɊȺȼɇȿɇɂȿ BWT-ȺɊɏɂȼȺɌɈɊɈȼ
ɉɚɪɚɦɟɬɪɵ, ɢɫɩɨɥɶɡɭɟɦɵɟ ɞɥɹ ɭɤɚɡɚɧɢɹ ɪɟɠɢɦɚ ɪɚɛɨɬɵ ɚɪɯɢɜɚɬɨɪɨɜ, ɜɵɛɪɚɧɵ ɬɚɤɢɦ ɨɛɪɚɡɨɦ, ɱɬɨɛɵ ɞɨɛɢɬɶɫɹ ɧɚɢɥɭɱɲɢɯ ɪɟɡɭɥɶɬɚɬɨɜ ɜ ɫɠɚɬɢɢ ɛɟɡ ɨɫɨɛɨɝɨ ɭɯɭɞɲɟɧɢɹ ɫɤɨɪɨɫɬɢ. Ɍɟɫɬɢɪɨɜɚɧɢɟ ɩɪɨɢɡɜɨɞɢɥɨɫɶ ɧɚ ɤɨɦɩɶɸɬɟɪɟ ɫɨ ɫɥɟɞɭɸɳɟɣ ɤɨɧɮɢɝɭɪɚɰɢɟɣ: ɉɪɨɰɟɫɫɨɪ Intel Pentium III 840 ɆȽɰ ɑɚɫɬɨɬɚ ɲɢɧɵ 140 ɆȽɰ Ɉɩɟɪɚɬɢɜɧɚɹ ɩɚɦɹɬɶ 256 Ɇɛɚɣɬ SDRAM ɀɟɫɬɤɢɣ ɞɢɫɤ Quantum FB 4.3 Ƚɛɚɣɬ Ɉɩɟɪɚɰɢɨɧɧɚɹ ɫɢɫɬɟɦɚ Windows NT 4.0 Service Pack 3 ɇɚɱɧɟɦ ɫɨ ɫɠɚɬɢɹ ɪɭɫɫɤɢɯ ɬɟɤɫɬɨɜ, ɩɨɬɨɦɭ ɱɬɨ BWTɚɪɯɢɜɚɬɨɪɵ ɨɫɨɛɟɧɧɨ ɷɮɮɟɤɬɢɜɧɵ ɢɦɟɧɧɨ ɞɥɹ ɫɠɚɬɢɹ ɬɟɤɫɬɨɜ. Ⱥ ɪɭɫɫɤɢɟ ɬɟɤɫɬɵ ɜɵɛɪɚɧɵ ɞɥɹ ɬɨɝɨ, ɱɬɨɛɵ ɩɨɤɚɡɚɬɶ ɷɮɮɟɤɬɢɜɧɨɫɬɶ ɫɠɚɬɢɹ ɜ ɱɢɫɬɨɦ ɜɢɞɟ, ɛɟɡ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɬɟɤɫɬɨɜɵɯ ɮɢɥɶɬɪɨɜ, ɤɨɬɨɪɵɟ ɞɥɹ ɪɭɫɫɤɢɯ ɬɟɤɫɬɨɜ ɟɳɟ ɧɟ ɫɨɡɞɚɧɵ ɚɜɬɨɪɚɦɢ ɨɩɢɫɵɜɚɟɦɵɯ ɩɪɨɝɪɚɦɦ. Ɏɚɣɥ ɢɦɟɟɬ ɞɥɢɧɭ 1,639,139 ɛɚɣɬɨɜ. Ⱥɪɯɢɜɚɬɨɪ, ɜɟɪɫɢɹ ɢ ɩɚɪɚ- Ɋɚɡɦɟɪ ȼɪɟɦɹ ȼɪɟɦɹ ɦɟɬɪɵ ɫɠɚɬɨɝɨ ɫɠɚɬɢɹ, ɪɚɡɠɚɬɢɹ, ɮɚɣɥɚ c c YBS 0.03e 446,151 1.81 0.93 DC 0.99.298b -a 449,403 1.21 1.00 SBC 0.860 451,240 1.69 0.87 ARC (I.Sutton) b20 459,409 2.08 1.37 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 255 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱥɪɯɢɜɚɬɨɪ, ɜɟɪɫɢɹ ɢ ɩɚɪɚ- Ɋɚɡɦɟɪ ȼɪɟɦɹ ȼɪɟɦɹ ɦɟɬɪɵ ɫɠɚɬɨɝɨ ɫɠɚɬɢɹ, ɪɚɡɠɚɬɢɹ, ɮɚɣɥɚ c c Compressia' b2048 462,873 2.92 2.66 BA 1.01b5 -24-m 463,214 2.17 1.26 Zzip 0.36 -mx -b8 467,383 1.96 1.65 szip 1.12 b21 o0 470,894 3.34 0.78 ICT UC 1.0 472,556 2.54 1.27 szip 1.12 b21 o8 472,577 2.32 1.12 GCA 0.90g -v 477,999 2.17 1.17 BWC/PGCC 0.99 m2m 479,162 1.69 0.83 BWC/PGCC 0.99 m900k 503,556 1.56 0.83 szip 1.12 b21 o4 506,348 0.48 0.94 IMP 1.10 -2 u1000 506,524 1.07 0.64 bzip2/PGCC 1.0b7 -9 507,828 1.55 0.66 Ʉɚɤ ɦɨɠɧɨ ɡɚɦɟɬɢɬɶ, ɩɟɪɜɟɧɫɬɜɨ ɭɞɟɪɠɢɜɚɸɬ ɤɨɦɩɪɟɫɫɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɤɨɞɢɪɨɜɚɧɢɟ ɪɚɫɫɬɨɹɧɢɣ. ɇɚ ɚɧɝɥɢɣɫɤɨɦ ɬɟɤɫɬɟ (2,042,760 ɛɚɣɬɨɜ) ɧɟɤɨɬɨɪɵɟ ɚɪɯɢɜɚɬɨɪɵ ɢɫɩɨɥɶɡɭɸɬ ɮɢɥɶɬɪɵ, ɬɟɦ ɫɚɦɵɦ ɡɚɦɟɬɧɨ ɭɥɭɱɲɚɹ ɫɠɚɬɢɟ. ɇɢɠɟ ɩɪɢɜɟɞɟɧɵ ɪɟɡɭɥɶɬɚɬɵ, ɩɪɢɧɚɞɥɟɠɚɳɢɟ ɬɟɦ ɩɪɨɝɪɚɦɦɚɦ, ɤɨɬɨɪɵɟ ɩɨɤɚɡɚɥɢ ɧɚɢɥɭɱɲɢɟ ɪɟɡɭɥɶɬɚɬɵ ɜ ɩɟɪɜɨɦ ɬɟɫɬɟ. Ⱥɪɯɢɜɚɬɨɪ, ɜɟɪ- Ɋɚɡɦɟɪ ɫɢɹ ɢ ɩɚɪɚɦɟɬɪɵ ɫɠɚɬɨɝɨ ɮɚɣɥɚ
ȼɪɟɦɹ ɫɠɚɬɢɹ, ɫ
DC 0.99.298b SBC 0.860 b3m1 YBS 0.03e DC 0.99.298b -a ARC (I.Sutton) b20 BA 1.01b5 -24 Zzip 0.36 -mx -b8
476,215 489,612 496,703 500,421 508,737
1.58 1.59 2.32 1.50 2.62
ȼɪɟɦɹ ɂɫɩɨɥɶɪɚɡɠɚɬɢɹ, ɡɨɜɚɧɢɟ ɫ ɮɢɥɶɬɪɨɜ 1.28 + 0.96 + 1.09 1.18 1.71
512,696 515,672
2.87 2.84
1.53 2.08
+ +
256 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱥɪɯɢɜɚɬɨɪ, ɜɟɪ- Ɋɚɡɦɟɪ ɫɢɹ ɢ ɩɚɪɚɦɟɬɪɵ ɫɠɚɬɨɝɨ ɮɚɣɥɚ
ȼɪɟɦɹ ɫɠɚɬɢɹ, ɫ
Compressia b2048 BA 1.01b5 -24-x
3.67 2.75
517,484 517,626
ȼɪɟɦɹ ɂɫɩɨɥɶɪɚɡɠɚɬɢɹ, ɡɨɜɚɧɢɟ ɫ ɮɢɥɶɬɪɨɜ 2.12 1.42
ɉɪɢ ɫɠɚɬɢɢ ɞɚɧɧɵɯ, ɩɪɟɞɫɬɚɜɥɹɸɳɢɯ ɫɨɛɨɣ ɢɫɯɨɞɧɵɟ ɬɟɤɫɬɵ ɩɪɨɝɪɚɦɦ, ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɫɪɟɞɢ ɥɢɞɟɪɨɜ ɬɟɫɬɨɜ ɩɪɚɤɬɢɱɟɫɤɢ ɧɟ ɦɟɧɹɟɬɫɹ. Ⱦɥɹ ɢɥɥɸɫɬɪɚɰɢɢ ɩɨɜɟɞɟɧɢɹ BWT-ɚɪɯɢɜɚɬɨɪɨɜ ɧɚ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ ɢɫɩɨɥɶɡɨɜɚɧ ɢɫɩɨɥɧɢɦɵɣ ɦɨɞɭɥɶ ɢɡ ɞɢɫɬɪɢɛɭɬɢɜɚ ɤɨɦɩɢɥɹɬɨɪɚ Watcom 10.0 wcc386.exe (536,624 ɛɚɣɬɚ). Ⱦɥɹ ɬɨɝɨ, ɱɬɨɛɵ ɦɨɠɧɨ ɛɵɥɨ ɫɭɞɢɬɶ ɨɛ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɪɚɡɥɢɱɧɵɯ ɦɟɬɨɞɨɜ ɢ ɪɟɠɢɦɨɜ, ɧɟɤɨɬɨɪɵɟ ɫɬɪɨɤɢ ɩɨɦɟɱɟɧɵ ɫɩɟɰɢɚɥɶɧɵɦɢ ɡɧɚɤɚɦɢ: Ⱥɪɯɢɜɚɬɨɪ, ɜɟɪɫɢɹ ɢ ɩɚɪɚɦɟɬɪɵ
Ɋɚɡɦɟɪ ɫɠɚɬɨɝɨ ɮɚɣɥɚ
ȼɪɟɦɹ ɫɠɚɬɢɹ, ɫ
ȼɪɟɦɹ ɪɚɡɠɚɬɢɹ, ɫ
Ɏɢɥɶɬ ɪɵ
ɍɦɟɧɶɲɟɧɧɵɣ ɪɚɡɦɟɪ ɛɥɨɤɚ
YBS 0.03e m512k YBS 0.03e SBC 0.860 m3a ARC b5mm1 DC 0.99.298b -b512 DC 0.99.298b ARC mm1 Zzip 0.36 -mx
275,396
0.66
0.51
+
+
276,035 278,061
0.66 0.98
0.57 0.69
+ +
278,392 279,424
1.33 0.67
0.48 0.36
+ +
279,759 280,052 291,199
0.66 1.34 0.74
0.37 0.46 0.66
+ +
Ⱥɜɬɨɦɚɬɢɱɟɫɤɨɟ ɨɩɪɟɞɟɥɟɧɢɟ ɪɚɡɦɟɪɚ ɛɥɨɤɚ
+ + +
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 257 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱥɪɯɢɜɚɬɨɪ, ɜɟɪɫɢɹ ɢ ɩɚɪɚɦɟɬɪɵ
Ɋɚɡɦɟɪ ɫɠɚɬɨɝɨ ɮɚɣɥɚ
ȼɪɟɦɹ ɫɠɚɬɢɹ, ɫ
ȼɪɟɦɹ ɪɚɡɠɚɬɢɹ, ɫ
ARC (I.Sutton) b5 ARC (I.Sutton) BA 1.01b5 24-z DC 0.99.298b -a IMP 1.10 -2 u1000 Compressia b512 ICT UC 1.0 BA 1.01b5 szip 1.12 b21 o0 szip 1.12 b21 o4 BWC/PGCC 0.99 m600k bzip2/PGCC 1.0b7 -6
291,345
0.58
0.48
292,979
0.58
0.48
293,489
0.82
0.64
293,807
0.52
0.39
294,679
0.38
0.18
297,647
0.97
1.16
298,348 298,617 298,668
0.75 0.82 0.76
0.53 0.66 0.31
299,249
0.27
0.39
304,996
0.58
0.37
308,624
0.63
0.26
Ɏɢɥɶɬ ɪɵ
ɍɦɟɧɶɲɟɧɧɵɣ ɪɚɡɦɟɪ ɛɥɨɤɚ
Ⱥɜɬɨɦɚɬɢɱɟɫɤɨɟ ɨɩɪɟɞɟɥɟɧɢɟ ɪɚɡɦɟɪɚ ɛɥɨɤɚ
+
+
+
ȼ ɤɚɱɟɫɬɜɟ ɮɚɣɥɚ, ɫɨɞɟɪɠɚɳɟɝɨ ɫɦɟɫɶ ɬɟɤɫɬɨɜɵɯ ɢ ɛɢɧɚɪɧɵɯ ɞɚɧɧɵɯ, ɢɫɩɨɥɶɡɨɜɚɥɫɹ Fileware.doc ɪɚɡɦɟɪɨɦ 427,520 ɛɚɣɬɨɜ ɢɡ ɩɨɫɬɚɜɤɢ ɪɭɫɫɤɨɝɨ MS Office'95. Ⱦɚɧɧɵɣ ɩɪɢɦɟɪ ɩɨɤɚɡɵɜɚɟɬ, ɱɬɨ ɢɧɨɝɞɚ ɦɨɞɟɥɶ, ɢɫɩɨɥɶɡɭɸɳɚɹ MTF, ɨɤɚɡɵɜɚɟɬɫɹ ɞɨɫɬɚɬɨɱɧɨ ɷɮɮɟɤɬɢɜɧɨɣ.
258 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱥɪɯɢɜɚɬɨɪ, ɜɟɪɫɢɹ ɢ ɩɚɪɚɦɟɬɪɵ
Ɋɚɡɦɟɪ ɫɠɚɬɨɝɨ ɮɚɣɥɚ
ȼɪɟɦɹ ɫɠɚɬɢɹ, ɫ
ȼɪɟɦɹ ɪɚɡɠɚɬɢɹ, ɫ
Ɏɢɥɶɬɪɵ
ɍɦɟɧɶɲɟɧɧɵɣ ɪɚɡɦɟɪ ɛɥɨɤɚ
SBC 0.860 m3a DC 0.99.298b ARC b2 YBS 0.03e m256k Compressia b256 BA 1.01b5 24-r Zzip 0.36 -a1 DC 0.99.298b -a YBS 0.03e BWC/PGCC 0.99 m600k bzip2/PGCC 1.0b7 -6 szip 1.12 b21 o0 IMP 1.10 -2 u1000 ICT UC 1.0 BA 1.01b5 24-z szip 1.12 b21 o4
126,811
0.69
0.42
+
127,377 128,685 130,356
0.38 0.38 0.37
0.18 0.23 0.24
+ +
131,737
0.61
0.40
132,651
0.41
0.30
132,711 133,825
0.65 0.34
0.40 0.23
133,915 134,183
0.37 0.33
0.25 0.19
+
134,932
0.44
0.14
+
134,945
0.90
0.15
135,431
0.30
0.12
136,842 137,566
0.41 0.49
0.29 0.31
141,784
0.17
0.18
Ⱥɜɬɨɦɚɬɢɱɟɫɤɨɟ ɨɩɪɟɞɟɥɟɧɢɟ ɪɚɡɦɟɪɚ ɛɥɨɤɚ +
+ + +
+
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 259 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɂɚɤɥɸɱɟɧɢɟ ɇɟɫɦɨɬɪɹ ɧɚ ɬɨ, ɱɬɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɛɵɥɨ ɨɩɭɛɥɢɤɨɜɚɧɨ ɫɪɚɜɧɢɬɟɥɶɧɨ ɧɟɞɚɜɧɨ, ɨɧɨ ɩɨɥɶɡɭɟɬɫɹ ɛɨɥɶɲɢɦ ɜɧɢɦɚɧɢɟɦ ɫɨ ɫɬɨɪɨɧɵ ɪɚɡɪɚɛɨɬɱɢɤɨɜ ɚɪɯɢɜɚɬɨɪɨɜ. ɂ, ɩɨɠɚɥɭɣ, ɟɳɟ ɜɩɟɪɟɞɢ ɧɨɜɵɟ ɢɫɫɥɟɞɨɜɚɧɢɹ, ɤɨɬɨɪɵɟ ɩɨɡɜɨɥɹɬ ɩɨɜɵɫɢɬɶ ɷɮɮɟɤɬɢɜɧɨɫɬɶ ɫɠɚɬɢɹ ɧɚ ɨɫɧɨɜɟ BWT ɟɳɟ ɜ ɛɨɥɶɲɟɣ ɫɬɟɩɟɧɢ. Ɇɨɠɧɨ ɨɬɦɟɬɢɬɶ ɯɚɪɚɤɬɟɪɧɵɟ ɨɫɨɛɟɧɧɨɫɬɢ ɚɪɯɢɜɚɬɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɨɩɢɫɚɧɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ, ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɞɪɭɝɢɦɢ. ɋɤɨɪɨɫɬɶ ɫɠɚɬɢɹ — ɧɚ ɭɪɨɜɧɟ ɚɪɯɢɜɚɬɨɪɨɜ, ɩɪɢɦɟɧɹɸɳɢɯ ɫɥɨɜɚɪɧɵɟ ɦɟɬɨɞɵ, ɧɚɩɪɢɦɟɪ, LZ77. Ɋɚɡɠɚɬɢɟ, ɤɚɤ ɩɪɚɜɢɥɨ, ɜ 34 ɪɚɡɚ ɛɵɫɬɪɟɟ ɫɠɚɬɢɹ. ɋɬɟɩɟɧɶ ɫɠɚɬɢɹ ɫɢɥɶɧɨ ɡɚɜɢɫɢɬ ɨɬ ɬɢɩɚ ɞɚɧɧɵɯ. ɇɚɢɛɨɥɟɟ ɷɮɮɟɤɬɢɜɧɨ ɩɪɢɦɟɧɟɧɢɟ BWT-ɚɪɯɢɜɚɬɨɪɨɜ ɞɥɹ ɬɟɤɫɬɨɜ ɢ ɥɸɛɵɯ ɞɚɧɧɵɯ ɫɨ ɫɬɚɛɢɥɶɧɵɦɢ ɤɨɧɬɟɤɫɬɚɦɢ. ȼ ɷɬɨɦ ɫɥɭɱɚɟ ɪɚɫɫɦɚɬɪɢɜɚɟɦɵɟ ɤɨɦɩɪɟɫɫɨɪɵ ɩɨ ɫɜɨɢɦ ɯɚɪɚɤɬɟɪɢɫɬɢɤɚɦ ɛɥɢɡɤɢ ɤ ɩɪɨɝɪɚɦɦɚɦ, ɢɫɩɨɥɶɡɭɸɳɢɦ PPM. ɇɚ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ ɫɭɳɟɫɬɜɭɸɳɢɟ ɚɪɯɢɜɚɬɨɪɵ ɧɚ ɨɫɧɨɜɟ BWT ɧɟɦɧɨɝɨ ɭɫɬɭɩɚɸɬ ɥɭɱɲɢɦ ɫɨɜɪɟɦɟɧɧɵɦ ɤɨɦɩɪɟɫɫɨɪɚɦ, ɢɫɩɨɥɶɡɭɸɳɢɦ ɫɥɨɜɚɪɧɵɟ ɦɟɬɨɞɵ ɢɥɢ PPM. ȼɩɪɨɱɟɦ, ɫɭɳɟɫɬɜɭɸɬ ɫɩɨɫɨɛɵ ɤɨɦɩɟɧɫɢɪɨɜɚɬɶ ɷɬɨɬ ɧɟɞɨɫɬɚɬɨɤ. Ɋɚɫɯɨɞɵ ɩɚɦɹɬɢ ɜ ɪɟɠɢɦɟ ɦɚɤɫɢɦɚɥɶɧɨɝɨ ɫɠɚɬɢɹ ɞɨɜɨɥɶɧɨ ɛɥɢɡɤɢ ɭ ɜɫɟɯ ɫɨɜɪɟɦɟɧɧɵɯ ɚɪɯɢɜɚɬɨɪɨɜ. ɇɚɢɛɨɥɶɲɟɟ ɨɬɥɢɱɢɟ ɧɚɛɥɸɞɚɟɬɫɹ ɩɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ. ɇɚɢɛɨɥɟɟ ɫɤɪɨɦɧɵɦɢ ɜ ɷɬɨɦ ɨɬɧɨɲɟɧɢɢ ɹɜɥɹɸɬɫɹ ɚɪɯɢɜɚɬɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɚɥɝɨɪɢɬɦɵ ɫɟɦɟɣɫɬɜɚ LZ77, ɚ ɧɚɢɛɨɥɟɟ ɪɚɫɬɨɱɢɬɟɥɶɧɵɦɢ — PPMɤɨɦɩɪɟɫɫɨɪɵ, ɬɪɟɛɭɸɳɢɟ ɫɬɨɥɶɤɨ ɠɟ ɪɟɫɭɪɫɨɜ, ɫɤɨɥɶɤɨ ɢɦ ɬɪɟɛɭɟɬɫɹ ɩɪɢ ɫɠɚɬɢɢ. Ⱥɪɯɢɜɚɬɨɪɵ ɧɚ ɨɫɧɨɜɟ BWT ɡɚɧɢɦɚɸɬ ɩɪɨɦɟɠɭɬɨɱɧɨɟ ɩɨɥɨɠɟɧɢɟ.
Ʌɢɬɟɪɚɬɭɪɚ 1. Ʉɚɞɚɱ Ⱥ.ȼ. ɗɮɮɟɤɬɢɜɧɵɟ ɚɥɝɨɪɢɬɦɵ ɧɟɢɫɤɚɠɚɸɳɟɝɨ ɫɠɚɬɢɹ ɬɟɤɫɬɨɜɨɣ ɢɧɮɨɪɦɚɰɢɢ. — Ⱦɢɫɫɟɪɬɚɰɢɹ ɧɚ ɫɨɢɫɤɚɧɢɟ 260 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
2. 3. 4. 5. 6. 7.
8.
9. 10.
11. 12. 13.
14.
ɭɱɟɧɨɣ ɫɬɟɩɟɧɢ ɤ.ɮ-ɦ.ɧ. — ɂɧɫɬɢɬɭɬ ɫɢɫɬɟɦ ɢɧɮɨɪɦɚɬɢɤɢ ɢɦ. Ⱥ.ɉ.ȿɪɲɨɜɚ, 1997. Albers S., v.Stengel B., Werchner R. A combined BIT and TIMESTAMP Algorithm for the List Update Problem. 1995. Ambuhl C., Gartnerm B., v.Stengel B. A New Lower Bound for the List Update Problem in the Partial Cost Model. 1999. Arimura M., Yamamoto H. Asymptotic Optimality of the Block Sorting Data Compression Algorithm. 1998. Arnavaut Z., Magliveras S.S. Block Sorting and Compression // Proceedings of Data Compression Conference. 1999. Arnavaut Z., Magliveras S.S. Lexical Permutation Sorting Algorithm. Baik H-K., Ha D.S., Yook H-G., Shin S-C., Park M-S. A New Method to Improve the Performance of JPEG Entropy Coding Using Burrows-Wheeler Transformation. 1999. Baik H., Ha D.S., Yook H-G., Shin S-C., Park M-S. Selective Application of Burrows-Wheeler Transformation for Enhancement of JPEG Entropy Coding. 1999. Balkenhol B., Kurtz S. Universal Data Compression Based on the Burrows and Wheeler-Transformation: Theory and Practice. Balkenhol B., Kurtz S., Shtarkov Y.M. Modifications of the Burrows and Wheeler Data Compression Algorithm // Proceedings of Data Compression Conference, Snowbird, Utah, IEEE Computer Society Press, 1999, pp. 188-197. Balkenhol B., Shtarkov Y.M. One attempt of a compression algorithm using the BWT. Baron D., Bresler Y. Tree Source Identification with the BWT. 2000. Burrows M., Wheeler D.J. A Block-sorting Lossless Data Compression Algorithm // SRC Research Report 124, Digital Systems Research Center, Palo Alto, May 1994. http://gatekeeper.dec.com/pub/DEC/SRC/research-reports/SRC124.ps.Z Chapin B. Switching Between Two On-line List Update algorithms for Higher Compression of Burrows-Wheeker Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 261 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
15. 16. 17. 18.
19. 20. 21. 22.
23. 24. 25. 26. 27. 28.
29. 30. 31.
Transformed Data // Proceedings of Data Compression Conference. 2000. Chapin B., Tate S. Higher Compression from the BurrowsWheeler Transform by Modified strings. 2000. Deorowicz S. An analysis of second step algorithms in the Burrows-Wheeler compression algorithm. 2000. Deorowicz S. Improvements to Burrows-Wheeler Compression Algorithm. 2000. Fenwick P.M. Block sorting text compression // Australasian Computer Science Conference, ACSC'96, Melbourne, Australia, Feb 1996. ftp://ftp.cs.auckland.ac.nz/out/peter-f/ACSC96.ps Ferragina P., Manzini G. An experimental study of an opportunistic index. 2001. Kruse H., Mukherjee A. Improve Text Compression Ratios with Burrows-Wheeler Transform. 1999. Kurtz S. Reducing the Space Requirement of Suffix Trees. Kurtz S. Space efficient linear time computation of the Burrows and Wheeler Transformation // Proceedings of Data Compression Conference. 2000. Kurtz S., Giegerich R., Stoye J. Efficient Implementation of Lazy Suffix Trees. 1999. Larsson J. Attack of the Mutant Suffix Tree. Larsson J. The Context Trees of Block Sorting Compression. Larsson J., Sadakane K. Faster Suffix Sorting. Manzini G. The Burrows-Wheeler Transform: Theory and Practice. 1999. Nelson P.M. Data Compression with the Burrows Wheeler Transform // Dr. Dobbs Journal, Sept. 1996, pp 46-50. http://web2.airmail.net/markn/articles/bwt/bwt.htm Sadakane K. A Fast Algorithm for Making Suffix Arrays and for BWT. Sadakane K. Comparison among Suffix Array Constructions Algorithms. Sadakane K. On Optimality of Variants of Block-Sorting Compression.
262 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
32. Sadakane K. Text Compression using Recency Rank with Context and Relation to Context Sorting, Block Sorting and PPM. 33. Schindler M. A Fast Block-sorting Algorithm for lossless Data Compression // Vienna University of Technology. 1997. 34. Schulz F. Two New Families of List Update Algorithms. 1998.
Ƚɥɚɜɚ 6. Ɉɛɨɛɳɟɧɧɵɟ ɦɟɬɨɞɵ ɫɨɪɬɢɪɭɸɳɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ ɋɨɪɬɢɪɨɜɤɚ ɩɚɪɚɥɥɟɥɶɧɵɯ ɛɥɨɤɨɜ Ⱥɧɝɥɢɣɫɤɨɟ ɧɚɡɜɚɧɢɟ ɦɟɬɨɞɚ — Parallel Blocks Sorting (PBS). Ⱦɜɚ ɛɥɨɤɚ A ɢ B ɧɚɡɵɜɚɸɬɫɹ ɩɚɪɚɥɥɟɥɶɧɵɦɢ, ɟɫɥɢ ɤɚɠɞɨɦɭ ɷɥɟɦɟɧɬɭ A[i] ɩɟɪɜɨɝɨ ɛɥɨɤɚ ɩɨɫɬɚɜɥɟɧ ɜ ɫɨɨɬɜɟɬɫɬɜɢɟ ɨɞɢɧ ɷɥɟɦɟɧɬ B[i] ɜɬɨɪɨɝɨ ɛɥɨɤɚ, ɢ ɧɚɨɛɨɪɨɬ. Ⱦɥɢɧɵ ɛɥɨɤɨɜ LA ɢ LB ɪɚɜɧɵ: LA = LB = L. Ɋɚɡɦɟɪɵ ɷɥɟɦɟɧɬɨɜ ɛɥɨɤɨɜ RA ɢ RB ɦɨɝɭɬ ɛɵɬɶ ɪɚɡɧɵɦɢ. Ɉɫɧɨɜɧɚɹ ɢɞɟɹ ɦɟɬɨɞɚ PBS ɫɨɫɬɨɢɬ ɜ ɫɨɪɬɢɪɨɜɤɟ ɷɥɟɦɟɧɬɨɜ In[i] ɜɯɨɞɧɨɝɨ ɛɥɨɤɚ In ɢ ɢɯ ɪɚɫɤɥɚɞɵɜɚɧɢɢ ɜ ɧɟɫɤɨɥɶɤɨ ɜɵɯɨɞɧɵɯ ɛɥɨɤɨɜ Outj ɧɚ ɨɫɧɨɜɚɧɢɢ ɚɬɪɢɛɭɬɨɜ A[i] ɷɬɢɯ ɷɥɟɦɟɧɬɨɜ. Ⱥɬɪɢɛɭɬ A[i] ɟɫɬɶ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ A, ɨɩɪɟɞɟɥɹɟɦɨɣ ɡɧɚɱɟɧɢɹɦɢ ɩɪɟɞɲɟɫɬɜɭɸɳɢɯ ɷɥɟɦɟɧɬɨɜ In[j] ɢ/ɢɥɢ ɷɥɟɦɟɧɬɨɜ P[k] ɢɡ ɩɚɪɚɥɥɟɥɶɧɨɝɨ ɛɥɨɤɚ P: A[i]=A(i, In[j], k=0,...,L-1
P[k]),
i=0...L-1;
j=0,...,i-1;
ɉɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɨɛɪɚɬɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ: ɷɥɟɦɟɧɬɵ ɢɡ ɧɟɫɤɨɥɶɤɢɯ ɛɥɨɤɨɜ Outj ɫɨɛɢɪɚɸɬɫɹ ɜ ɨɞɢɧ ɪɟɡɭɥɶɬɢɪɭɸɳɢɣ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɣ ɧɟɫɠɚɬɨɦɭ ɛɥɨɤɭ In.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 263 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
P
3
250
7
1
7
3
1
In
72
233
93
18
126
53
27
18
27
72
53
93
126
ȼɵɯɨɞɧɵɟ ɛɥɨɤɢ Outi
233 Ɋɢɫ. 6.1. ɂɥɥɸɫɬɪɚɰɢɹ PBS: ɚɬɪɢɛɭɬ A[i] ɨɩɪɟɞɟɥɹɟɬɫɹ ɡɧɚɱɟɧɢɟɦ ɷɥɟɦɟɧɬɚ P[i]; ɡɧɚɱɟɧɢɟ A[i] ɩɨɤɚɡɚɧɨ ɲɬɪɢɯɨɜɤɨɣ ɑɟɦ ɥɭɱɲɟ ɡɧɚɱɟɧɢɹ In[i] ɩɪɟɞɫɤɚɡɭɟɦɵ ɩɨ ɡɧɚɱɟɧɢɹɦ A[i], ɬɟɦ ɷɮɮɟɤɬɢɜɧɟɟ ɩɨɫɥɟɞɭɸɳɟɟ ɫɠɚɬɢɟ ɛɥɨɤɨɜ Outj ɫ ɩɨɦɨɳɶɸ ɩɪɨɫɬɵɯ ɭɧɢɜɟɪɫɚɥɶɧɵɯ ɦɟɬɨɞɨɜ. Ɇɟɬɨɞɵ ɷɬɨɣ ɝɪɭɩɩɵ ɬɪɚɧɫɮɨɪɦɢɪɭɸɳɢɟ ɢ ɛɥɨɱɧɵɟ, ɬ.ɟ. ɦɨɝɭɬ ɩɪɢɦɟɧɹɬɶɫɹ ɬɨɥɶɤɨ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɤɨɝɞɚ ɢɡɜɟɫɬɧɚ ɞɥɢɧɚ ɛɥɨɤɚ ɫ ɞɚɧɧɵɦɢ. Ɋɚɡɦɟɪ ɞɚɧɧɵɯ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɢɦɟɧɟɧɢɹ PBS, ɤɚɤ ɢ ɩɪɢ ST/BWT, ɧɟ ɢɡɦɟɧɹɟɬɫɹ. Ⱦɥɹ ɫɠɚɬɢɹ ɪɟɡɭɥɶɬɚɬɚ ɪɚɛɨɬɵ ɦɟɬɨɞɚ 264 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɦɨɠɟɬ ɛɵɬɶ ɩɪɢɦɟɧɟɧɚ ɥɸɛɚɹ ɤɨɦɛɢɧɚɰɢɹ ɦɟɬɨɞɨɜ — RLE, LPC, MTF, DC, HUFF, ARIC, ENUC, SEM... ȼ ɨɛɳɟɦ ɫɥɭɱɚɟ ɫɤɨɪɨɫɬɶ VC ɪɚɛɨɬɵ ɤɨɦɩɪɟɫɫɨɪɚ (ɪɟɚɥɢɡɭɸɳɟɝɨ ɩɪɹɦɨɟ, «ɫɠɢɦɚɸɳɟɟ» ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ) ɪɚɜɧɚ ɫɤɨɪɨɫɬɢ VD ɞɟɤɨɦɩɪɟɫɫɨɪɚ (ɪɟɚɥɢɡɭɸɳɟɝɨ ɨɛɪɚɬɧɨɟ, «ɪɚɡɠɢɦɚɸɳɟɟ» ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ) ɢ ɡɚɜɢɫɢɬ ɬɨɥɶɤɨ ɨɬ ɪɚɡɦɟɪɚ ɞɚɧɧɵɯ, ɧɨ ɧɟ ɨɬ ɢɯ ɫɨɞɟɪɠɚɧɢɹ: VC = VD = O(L). ɉɚɦɹɬɢ ɬɪɟɛɭɟɬɫɹ 2·L+C. Ʉɨɧɫɬɚɧɬɚ C ɨɩɪɟɞɟɥɹɟɬɫɹ ɨɫɨɛɟɧɧɨɫɬɹɦɢ ɪɟɚɥɢɡɚɰɢɢ ɢ ɦɨɠɟɬ ɛɵɬɶ ɞɨɜɨɥɶɧɨ ɛɨɥɶɲɨɣ. Ɉɩɟɪɚɰɢɣ ɭɦɧɨɠɟɧɢɹ ɢ ɞɟɥɟɧɢɹ ɧɟɬ.
1) 2) 3)
4)
5)
ɂɡ ɤɪɚɬɤɨɝɨ ɨɩɢɫɚɧɢɹ ɨɛɳɟɣ ɢɞɟɢ ɜɢɞɧɨ, ɱɬɨ ɞɥɹ ɪɚɫɩɚɤɨɜɤɢ ɧɭɠɧɨ ɢɦɟɬɶ ɧɟ ɬɨɥɶɤɨ ɫɨɞɟɪɠɢɦɨɟ ɫɨɪɬɢɪɨɜɚɧɧɵɯ ɛɥɨɤɨɜ Outj, ɧɨ ɢ ɢɯ ɪɚɡɦɟɪɵ; ɩɚɪɚɥɥɟɥɶɧɵɯ ɛɥɨɤɨɜ ɦɨɠɟɬ ɛɵɬɶ ɢ ɞɜɚ, ɢ ɛɨɥɶɲɟ; ɟɫɥɢ ɮɭɧɤɰɢɹ A ɧɟ ɢɫɩɨɥɶɡɭɟɬ ɬɟ P[k], ɤɨɬɨɪɵɟ ɧɚɯɨɞɹɬɫɹ ɩɨɫɥɟ ɬɟɤɭɳɟɣ ɩɨɡɢɰɢɢ i, ɬ.ɟ. k=i+1,...,L , ɬɨ ɦɨɠɧɨ ɫɨɡɞɚɜɚɬɶ ɩɚɪɚɥɥɟɥɶɧɵɣ ɛɥɨɤ P ɨɞɧɨɜɪɟɦɟɧɧɨ ɫ ɬɟɤɭɳɢɦ ɫɨɪɬɢɪɭɟɦɵɦ In; ɟɫɥɢ A ɡɚɞɚɧɚ ɬɚɤ, ɱɬɨ ɩɪɢɧɢɦɚɟɬ ɦɚɥɨ ɡɧɚɱɟɧɢɣ: ɨɬ 2 ɞɨ, ɞɨɩɭɫɬɢɦ, 16, ɦɟɬɨɞ ɜɩɨɥɧɟ ɦɨɠɟɬ ɛɵɬɶ ɩɪɢɦɟɧɢɦ ɢ ɤ ɩɨɬɨɤɚɦ ɞɚɧɧɵɯ; ɟɫɥɢ ɩɚɪɚɥɥɟɥɶɧɨɝɨ ɛɥɨɤɚ P ɧɟɬ, ɩɨɥɭɱɚɟɦ ST/BWT ɤɚɤ ɱɚɫɬɧɵɣ ɫɥɭɱɚɣ PBS.
ɈɋɇɈȼɇɈɃ ȺɅȽɈɊɂɌɆ ɉɊȿɈȻɊȺɁɈȼȺɇɂə
ȼ ɩɪɨɫɬɟɣɲɟɦ ɫɥɭɱɚɟ ɫɨɪɬɢɪɭɸɳɟɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ST(1) ɡɧɚɱɟɧɢɟ ɚɬɪɢɛɭɬɚ ɜɵɱɢɫɥɹɟɬɫɹ ɬɚɤ: A[i]=In[i-1] ; ɩɪɢ ST(2): A[i]=In[i-1]·2R + In[i-2] , ɢ ɬɚɤ ɞɚɥɟɟ. ȼ ɩɪɨɫɬɟɣɲɟɦ ɫɥɭɱɚɟ PBS A[i]=P[i], ɬɨ ɟɫɬɶ ɡɧɚɱɟɧɢɟ ɚɬɪɢɛɭɬɚ ɪɚɜɧɨ ɡɧɚɱɟɧɢɸ ɷɥɟɦɟɧɬɚ ɢɡ ɩɚɪɚɥɥɟɥɶɧɨɝɨ ɛɥɨɤɚ. ȼɵɯɨɞɧɵɯ ɛɥɨɤɨɜ ɫɬɨɥɶɤɨ, ɫɤɨɥɶɤɨ ɡɧɚɱɟɧɢɣ ɩɪɢɧɢɦɚɸɬ P[i]. Ⱦɟɥɚɹ ɩɪɨɯɨɞ ɩɨ P, ɫɱɢɬɚɟɦ ɱɚɫɬɨɬɵ ɡɧɚɱɟɧɢɣ ɚɬɪɢɛɭɬɚ, ɢ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɨɥɭɱɚɟɦ ɪɚɡɦɟɪɵ ɫɨɪɬɢɪɨɜɚɧɧɵɯ ɛɥɨɤɨɜ (ɞɚɥɟɟ «ɤɨɧɬɟɣɧɟɪɨɜ»), ɜ ɤɨɬɨɪɵɟ ɛɭɞɟɦ ɪɚɫɤɥɚɞɵɜɚɬɶ ɷɥɟɦɟɧɬɵ ɢɡ ɜɯɨɞɧɨɝɨ ɛɥɨɤɚ In: Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 265 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
for( a=0; a
(1) (2)
In — ɜɯɨɞɧɨɣ ɫɨɪɬɢɪɭɟɦɵɣ ɛɥɨɤ ɞɥɢɧɵ L; P — ɩɚɪɚɥɥɟɥɶɧɵɣ ɛɥɨɤ ɞɥɢɧɵ L; L — ɤɨɥɢɱɟɫɬɜɨ ɷɥɟɦɟɧɬɨɜ ɜɨ ɜɯɨɞɧɨɦ ɛɥɨɤɟ; n=2R — ɱɢɫɥɨ ɜɫɟɯ ɜɨɡɦɨɠɧɵɯ ɡɧɚɱɟɧɢɣ ɚɬɪɢɛɭɬɚ; Attr[n] — ɱɚɫɬɨɬɵ ɡɧɚɱɟɧɢɣ ɚɬɪɢɛɭɬɚ. ɇɚɩɪɢɦɟɪ, ɜ P ɫɨɞɟɪɠɚɬɫɹ ɫɬɚɪɲɢɟ 8 ɛɢɬɨɜ ɦɚɫɫɢɜɚ 16ɛɢɬɧɵɯ ɱɢɫɟɥ, ɚ ɜ In — ɦɥɚɞɲɢɟ 8. Ɂɚɦɟɬɢɦ, ɱɬɨ ɷɬɨɬ ɩɪɨɰɟɫɫ «ɞɪɨɛɥɟɧɢɹ» ɦɨɠɧɨ ɩɪɨɞɨɥɠɚɬɶ ɢ ɞɚɥɶɲɟ, ɫɨɡɞɚɜɚɹ ɜɩɥɨɬɶ ɞɨ 16-ɢ ɩɚɪɚɥɥɟɥɶɧɵɯ ɛɥɨɤɨɜ: ɫɨɞɟɪɠɚɳɢɣ ɩɟɪɜɵɟ ɛɢɬɵ, ɜɬɨɪɵɟ, ɢ ɬɚɤ ɞɚɥɟɟ. Ʉɪɨɦɟ ɬɨɝɨ, ɩɪɢ ɫɠɚɬɢɢ ɦɭɥɶɬɢɦɟɞɢɣɧɵɯ ɞɚɧɧɵɯ ɱɚɫɬɨ ɭɠɟ ɢɦɟɸɬɫɹ ɩɚɪɚɥɥɟɥɶɧɵɟ ɛɥɨɤɢ: ɧɚɩɪɢɦɟɪ, ɥɟɜɵɣ ɢ ɩɪɚɜɵɣ ɤɚɧɚɥɵ ɫɬɟɪɟɨɡɜɭɤɚ, ɤɪɚɫɧɚɹ, ɡɟɥɟɧɚɹ ɢ ɫɢɧɹɹ ɤɨɦɩɨɧɟɧɬɵ ɢɡɨɛɪɚɠɟɧɢɹ, ɢ ɬ.ɩ. ȿɫɥɢ ɮɭɧɤɰɢɹ A ɡɚɞɚɧɚ ɢɧɚɱɟ, ɬɨ ɢ ɩɪɢ ɩɨɞɫɱɟɬɟ ɱɚɫɬɨɬ ɮɨɪɦɭɥɚ ɛɭɞɟɬ ɢɧɨɣ: // A[i]=P[i]&252 : for( i=0; i
ɂɬɚɤ, ɩɨɫɥɟ ɞɜɭɯ ɰɢɤɥɨɜ — ɢɧɢɰɢɚɥɢɡɚɰɢɢ ɢ ɩɨɞɫɱɟɬɚ ɱɚɫɬɨɬ — ɦɵ ɩɨɥɭɱɢɥɢ ɜ ɦɚɫɫɢɜɟ Attr ɞɥɢɧɵ ɤɨɧɬɟɣɧɟɪɨɜ (ɫɨɪɬɢɪɨɜɚɧɧɵɯ ɛɥɨɤɨɜ). Ɍɟɩɟɪɶ ɦɨɠɧɨ ɜɵɱɢɫɥɢɬɶ, ɝɞɟ ɤɚɤɨɣ ɤɨɧɬɟɣɧɟɪ ɛɭɞɟɬ ɧɚɱɢɧɚɬɶɫɹ, ɟɫɥɢ ɢɯ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨ ɫɰɟɩɢɬɶ ɜ ɨɞɢɧ ɛɥɨɤ ɜ ɩɨɪɹɞɤɟ ɜɨɡɪɚɫɬɚɧɢɹ ɡɧɚɱɟɧɢɹ ɚɬɪɢɛɭɬɚ:
266 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
for( a=0, pos=0; a
ȼ ɬɨɦ ɠɟ ɦɚɫɫɢɜɟ Attr[n] ɬɟɩɟɪɶ ɚɞɪɟɫɚ-ɭɤɚɡɚɬɟɥɢ ɧɚ ɧɚɱɚɥɚ ɤɨɧɬɟɣɧɟɪɨɜ. Ɉɫɬɚɟɬɫɹ ɬɨɥɶɤɨ ɩɪɨɣɬɢ ɩɨ ɜɯɨɞɧɨɦɭ ɛɥɨɤɭ, ɪɚɫɤɥɚɞɵɜɚɹ ɷɥɟɦɟɧɬɵ ɢɡ ɧɟɝɨ ɩɨ ɤɨɧɬɟɣɧɟɪɚɦ: for(i=0; i
//(4c)
Out — ɜɵɯɨɞɧɨɣ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɣ ɛɥɨɤ (sorted, transformed), ɫɨɞɟɪɠɚɳɢɣ ɜɫɟ ɤɨɧɬɟɣɧɟɪɵ. ɉɨɞɪɨɛɧɟɟ: for( i=0; i
Ɏɭɧɤɰɢɹ Ⱥ — ɬɚ ɠɟ, ɱɬɨ ɢ ɜɨ ɜɬɨɪɨɦ ɰɢɤɥɟ. Ɍɨ ɟɫɬɶ, ɞɥɹ ɜɵɲɟ ɪɚɫɫɦɨɬɪɟɧɧɵɯ ɩɪɢɦɟɪɨɜ: (2a) a=P[i]&252; (2b) a=255-P[i]; (2c) a=(P[i]+P[i-1])/2; //ɩɪɢɱɟɦ i=1...L-1, ɚ ɤɨɝɞɚ i=0, a=P[0].
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 267 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɈȻɊȺɌɇɈȿ ɉɊȿɈȻɊȺɁɈȼȺɇɂȿ
ɋɨɜɟɪɲɟɧɧɨ ɢɞɟɧɬɢɱɧɵ ɩɟɪɜɵɟ ɬɪɢ ɰɢɤɥɚ: ɢɧɢɰɢɚɥɢɡɢɪɭɟɦ, ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɨɯɨɞɚ ɩɨ ɩɚɪɚɥɥɟɥɶɧɨɦɭ ɛɥɨɤɭ ɧɚɯɨɞɢɦ ɞɥɢɧɵ ɤɨɧɬɟɣɧɟɪɨɜ, ɡɚɬɟɦ ɨɩɪɟɞɟɥɹɟɦ ɚɞɪɟɫɚ ɧɚɱɚɥ ɤɨɧɬɟɣɧɟɪɨɜ ɜɨ ɜɯɨɞɧɨɦ ɨɬɫɨɪɬɢɪɨɜɚɧɧɨɦ ɛɥɨɤɟ In. ɂɦɟɧɧɨ ɷɬɢ ɚɞɪɟɫɚ — ɰɟɥɶ ɜɵɩɨɥɧɟɧɢɹ ɩɟɪɜɵɯ ɬɪɟɯ ɰɢɤɥɨɜ. ɂ ɬɨɥɶɤɨ ɜ ɱɟɬɜɟɪɬɨɦ ɰɢɤɥɟ — ɧɚɨɛɨɪɨɬ: ɛɟɪɟɦ ɢɡ ɨɬɫɨɪɬɢɪɨɜɚɧɧɨɝɨ ɛɥɨɤɚ ɫ ɤɨɧɬɟɣɧɟɪɚɦɢ In, ɤɥɚɞɟɦ ɜ ɟɞɢɧɵɣ ɜɵɯɨɞɧɨɣ ɛɥɨɤ Out: for(i=0;i
//(4d)
In — ɜɯɨɞɧɨɣ ɨɬɫɨɪɬɢɪɨɜɚɧɧɵɣ ɛɥɨɤ ɫɨ ɜɫɟɦɢ ɤɨɧɬɟɣɧɟɪɚɦɢ Out — ɫɨɡɞɚɜɚɟɦɵɣ ɜɵɯɨɞɧɨɣ ɛɥɨɤ ɉɨɞɪɨɛɧɟɟ: for( i=0; i
ɉɍɌɂ ɍȼȿɅɂɑȿɇɂə ɋɄɈɊɈɋɌɂ ɋɀȺɌɂə
ɂɬɚɤ, ɜ ɨɛɨɢɯ ɫɥɭɱɚɹɯ ɜɵɩɨɥɧɹɟɦ ɞɜɚ ɰɢɤɥɚ ɨɬ 0 ɞɨ n=2R, ɢ ɞɜɚ ɰɢɤɥɚ ɨɬ 0 ɞɨ L. Ʉɚɤɨɣ ɢɡ ɧɢɯ ɡɚɣɦɟɬ ɛɨɥɶɲɟ ɜɪɟɦɟɧɢ? ɑɚɳɟ ɜɫɟɝɨ R=8, n=256, ɚ L — ɨɬ ɧɟɫɤɨɥɶɤɢɯ ɤɢɥɨɛɚɣɬ ɞɨ ɞɟɫɹɬɤɨɜ ɦɟɝɚɛɚɣɬ. ɂ ɱɟɬɜɟɪɬɵɣ, ɝɥɚɜɧɵɣ ɰɢɤɥ — ɫɚɦɵɣ ɞɨɥɝɢɣ, ɜɬɨɪɨɣ ɜɵɩɨɥɧɹɟɬɫɹ ɛɵɫɬɪɟɟ, ɚ ɬɪɟɬɢɣ ɢ ɨɫɨɛɟɧɧɨ ɩɟɪɜɵɣ — ɫɨɜɫɟɦ ɛɵɫɬɪɨ. ɇɨ ɜɨɡɦɨɠɧɚ ɢ ɨɛɪɚɬɧɚɹ ɫɢɬɭɚɰɢɹ: ɟɫɥɢ, ɧɚɩɪɢɦɟɪ, R=16, n=216=65536, ɚ L=512, ɬ.ɟ. ɬɪɟɛɭɟɬɫɹ ɫɠɚɬɶ ɩɨɬɨɤ ɛɥɨɤɨɜ ɢɡ 512ɢ 16-ɛɢɬɧɵɯ ɷɥɟɦɟɧɬɨɜ (ɩɨɬɨɤ «ɮɪɟɣɦɨɜ»). Ɍɨɝɞɚ ɧɚɨɛɨɪɨɬ, ɫɚ268 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɦɵɦ ɞɨɥɝɢɦ ɛɭɞɟɬ ɬɪɟɬɢɣ ɰɢɤɥ, ɡɚɬɟɦ ɩɟɪɜɵɣ, ɱɟɬɜɟɪɬɵɣ ɢ ɜɬɨɪɨɣ. Ⱦɜɚ ɰɢɤɥɚ ɩɪɢ ɛɨɥɶɲɢɯ R ȿɫɥɢ ɩɚɦɹɬɢ ɯɜɚɬɚɟɬ, ɩɨɫɬɭɩɢɦ ɬɚɤ: ɛɭɞɟɦ ɧɚɩɨɥɧɹɬɶ ɤɨɧɬɟɣɧɟɪɵ ɧɟ ɨɞɧɨɜɪɟɦɟɧɧɨ, ɩɪɨɯɨɞɹ ɩɨ In, P ɢ ɡɚɩɢɫɵɜɚɹ ɷɥɟɦɟɧɬɵ In[i] ɜ ɜɵɱɢɫɥɹɟɦɵɟ ɚɞɪɟɫɚ ɛɥɨɤɚ Out, ɚ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨ: ɩɪɨɯɨɞɹ ɩɨ Out ɢ ɜɵɱɢɫɥɹɹ ɚɞɪɟɫɚ ɜ In, P, ɢɡ ɤɨɬɨɪɵɯ ɧɭɠɧɨ ɛɪɚɬɶ ɡɧɚɱɟɧɢɹ ɚɬɪɢɛɭɬɚ ɢ ɷɥɟɦɟɧɬɵ, ɩɨɦɟɳɚɟɦɵɟ ɡɚɬɟɦ ɜ Out. Ɉɫɬɚɧɭɬɫɹ ɞɜɚ ɰɢɤɥɚ ɨɬ 0 ɞɨ L, ɚ ɰɢɤɥɵ ɨɬ 0 ɞɨ n=2R — ɢɫɱɟɡɧɭɬ. ɉɪɢ ɩɟɪɜɨɦ ɩɪɨɯɨɞɟ ɡɚɩɨɥɧɹɟɦ ɜɫɩɨɦɨɝɚɬɟɥɶɧɵɣ ɦɚɫɫɢɜ Anext, ɫɨɞɟɪɠɚɳɢɣ ɰɟɩɨɱɤɢ ɭɤɚɡɚɬɟɥɟɣ ɧɚ ɩɨɡɢɰɢɢ ɫ ɨɞɢɧɚɤɨɜɵɦɢ ɚɬɪɢɛɭɬɚɦɢ (A-ɰɟɩɨɱɤɢ). Ɍɨ ɟɫɬɶ ɜ Anext[i] ɡɚɩɢɫɵɜɚɟɦ ɭɤɚɡɚɬɟɥɶ ɧɚ ɫɥɟɞɭɸɳɭɸ ɩɨɡɢɰɢɸ (i+k) ɫ ɬɚɤɢɦ ɠɟ ɡɧɚɱɟɧɢɟɦ ɚɬɪɢɛɭɬɚ A[i], ɟɫɥɢ ɬɚɤɨɜɚɹ (i+k) ɜ ɨɫɬɚɜɲɟɣɫɹ ɱɚɫɬɢ ɛɥɨɤɚ ɟɫɬɶ. ȼ ɩɪɨɬɢɜɨɩɨɥɨɠɧɨɦ ɫɥɭɱɚɟ, ɟɫɥɢ ɜ ɨɫɬɚɜɲɟɣɫɹ ɱɚɫɬɢ ɛɥɨɤɚ ɚɬɪɢɛɭɬ ɧɟ ɩɪɢɧɢɦɚɟɬ ɡɧɚɱɟɧɢɟ A[i], ɜ Anext[i] ɡɚɩɢɫɵɜɚɟɦ i. // ɩɪɢ ɢɧɢɰɢɚɥɢɡɚɰɢɢ: ɜɫɩɨɦɨɝɚɬɟɥɶɧɵɟ ɦɚɫɫɢɜɵ int Anext[L]; int Beg[n]; // ɧɚɱɚɥɚ, int End[n]; // ɤɨɧɰɵ ɢ int Flg[n]; // ɮɥɚɝɢ ɧɚɥɢɱɢɹ A-ɰɟɩɨɱɟɤ ɜ ɬɟɤɭɳɟɦ ɮɪɟɣɦɟ // ɜ ɰɢɤɥɟ ɞɥɹ ɤɚɠɞɨɝɨ ɮɪɟɣɦɚ: FrameNumber++; // ɫɥɟɞɭɸɳɢɣ L-ɷɥɟɦɟɧɬɧɵɣ ɮɪɟɣɦ for( i=0; i
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 269 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɇɚɫɫɢɜ Flg ɧɭɠɟɧ ɬɨɥɶɤɨ ɡɚɬɟɦ, ɱɬɨɛɵ ɢɧɢɰɢɚɥɢɡɢɪɨɜɚɬɶ ɧɟ Beg ɢ End ɩɟɪɟɞ ɤɚɠɞɵɦ ɮɪɟɣɦɨɦ, ɚ ɬɨɥɶɤɨ Flg ɩɟɪɟɞ ɜɫɟɦɢ ɮɪɟɣɦɚɦɢ. ȿɫɥɢ ɫɨɡɞɚɬɶ ɟɳɟ ɞɜɚ ɦɚɫɫɢɜɚ Fprev ɢ Fnext, ɫɨɟɞɢɧɹɸɳɢɟ ɜɫɟ ɷɥɟɦɟɧɬɵ Flg ɫ ɨɞɧɢɦ ɡɧɚɱɟɧɢɟɦ ɜ ɨɞɧɭ F-ɰɟɩɨɱɤɭ (ɩɪɢɱɟɦ Fnext ɭɤɚɡɵɜɚɟɬ ɧɚ ɫɥɟɞɭɸɳɢɣ ɷɥɟɦɟɧɬ F-ɰɟɩɨɱɤɢ, Fprev — ɧɚ ɩɪɟɞɵɞɭɳɢɣ), ɬɨ ɧɟ ɩɪɢɞɟɬɫɹ ɩɪɢ ɜɬɨɪɨɦ ɩɪɨɯɨɞɟ ɥɢɧɟɣɧɨ ɢɫɤɚɬɶ ɜ Flg ɩɨɹɜɥɹɜɲɢɟɫɹ ɜ ɬɟɤɭɳɟɦ ɮɪɟɣɦɟ Aɰɟɩɨɱɤɢ. ɂ ɰɢɤɥɚ ɨɬ 0 ɞɨ n ɭɞɚɫɬɫɹ ɢɡɛɟɠɚɬɶ. ɋɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɢɡɦɟɧɟɧɢɹ ɱɢɬɚɬɟɥɶ ɥɟɝɤɨ ɜɧɟɫɟɬ ɜ ɚɥɝɨɪɢɬɦ ɫɚɦ. ɉɪɢ ɜɬɨɪɨɦ ɩɪɨɯɨɞɟ ɜɵɩɨɥɧɹɟɦ ɫɨɪɬɢɪɨɜɤɭ: pos=f=0; while (Fnext[f]!=f) { // (ɥɢɧɟɣɧɵɣ ɩɨɢɫɤ ɫɥɟɞɭɸɳɟɣ f=Fnext[f]; // A-ɰɟɩɨɱɤɢ ɜ Flg, ɟɫɥɢ ɛɟɡ Fnext) i=Beg[f]; // ɩɟɪɜɵɣ ɷɥɟɦɟɧɬ ɬɟɤɭɳɟɣ A-ɰɟɩɨɱɤɢ, do { // ɢ ɞɚɥɟɟ ɞɥɹ ɜɫɟɯ ɟɟ ɷɥɟɦɟɧɬɨɜ: Out[pos]=In[i]; // ɛɟɪɟɦ ɢɡ In, ɤɥɚɞɟɦ ɜ Out pos++; // ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨ, i=Anext[i]; //ɢ ɬɚɤ ɞɚɥɟɟ, ɩɪɨɯɨɞɹ ɜɫɸ A-ɰɟɩɨɱɤɭ } while(i!=Anext[i]) //ɞɨ ɤɨɧɰɚ }
ɇɚ ɷɬɨɬ ɪɚɡ ɜɨ ɜɬɨɪɨɦ ɰɢɤɥɟ ɭɠɟ ɧɟɬ ɨɛɪɚɳɟɧɢɣ ɤ P, ɩɨɷɬɨɦɭ ɦɨɠɧɨ ɫɨɜɦɟɫɬɢɬɶ A ɢ P. ɉɚɦɹɬɢ ɠɟ ɬɪɟɛɭɟɬɫɹ ɧɟ 2·L + n·sizeof(*char), ɚ 2·L + 5·n·sizeof(*char), ɬɚɤ ɤɚɤ Beg, End, Flg, Fprv, Fnxt ɡɚɧɢɦɚɸɬ ɩɨ n·sizeof(*char) ɛɚɣɬ. Ⱦɜɚ ɰɢɤɥɚ ɩɪɢ ɦɚɥɵɯ R ȿɫɥɢ ɩɚɦɹɬɢ ɞɨɫɬɭɩɧɨ ɛɨɥɶɲɟ, ɱɟɦ ɧɟɨɛɯɨɞɢɦɨ ɞɥɹ ɯɪɚɧɟɧɢɹ 2·L+n·C ɷɥɟɦɟɧɬɨɜ, ɢ C ɞɨɫɬɚɬɨɱɧɨ ɜɟɥɢɤɨ — 256 ɢɥɢ, ɧɚɩɪɢɦɟɪ, 512, ɦɨɠɧɨ ɫɪɚɡɭ «ɪɚɫɮɨɪɦɚɬɢɪɨɜɚɬɶ» ɩɚɦɹɬɶ ɩɨɞ ɧɚɱɚɥɚ ɤɨɧɬɟɣɧɟɪɨɜ: #define K 256; for( i=0; i
270 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
//
(1 «ɫɟɤɬɨɪ»)
ɂ ɡɚɬɟɦ, ɩɪɢ ɩɪɨɯɨɞɟ ɩɨ In, P, ɟɫɥɢ ɫɜɨɛɨɞɧɨɟ ɦɟɫɬɨ ɜ ɤɚɤɨɦɬɨ ɤɨɧɬɟɣɧɟɪɟ ɤɨɧɱɚɟɬɫɹ, ɛɭɞɟɦ ɡɚɩɢɫɵɜɚɬɶ ɜ ɤɨɧɰɟ «ɫɟɤɬɨɪɚ» ɭɤɚɡɚɬɟɥɶ ɧɚ ɫɥɟɞɭɸɳɢɣ ɫɟɤɬɨɪ, ɜɵɞɟɥɹɟɦɵɣ ɩɨɞ ɩɪɨɞɨɥɠɟɧɢɟ ɷɬɨɝɨ ɤɨɧɬɟɣɧɟɪɚ: FreeSector=n; for( i=0; i
>8)%256; // Out[pos+2]=(FreeSector>>16)%256; // Out[pos+3]=(FreeSector>>24)%256; //ɫɜɨɛɨɞɧɨɟ ɦɟɫɬɨ= ɧɚɱɚɥɨ ɧɨɜɨɝɨ ɫɟɤɬɨɪɚ: pos=FreeSector*K; // ɫɜɨɛɨɞɧɵɣ ɫɟɤɬɨɪ ɧɚ ɨɞɢɧ ɫɟɤɬɨɪ ɞɚɥɶɲɟ: FreeSector++; } Attr[a]=pos; }
ɍɩɪɚɠɧɟɧɢɟ: ɋɪɚɜɧɢɬɟ ɷɬɨɬ ɰɢɤɥ ɫ (4c) ɢ ɨɰɟɧɢɬɟ, ɧɚɫɤɨɥɶɤɨ ɨɧ ɛɭɞɟɬ ɦɟɞɥɟɧɧɟɣ.
ɗɬɨ ɨɱɟɧɶ ɜɵɝɨɞɧɨ, ɟɫɥɢ n≤256, ɢ, ɤɪɨɦɟ ɬɨɝɨ, ɩɨɫɥɟ PBS ɜɵɩɨɥɧɹɟɬɫɹ ɟɳɟ ɨɞɢɧ ɩɪɨɯɨɞ ɩɨ ɜɫɟɦ ɷɥɟɦɟɧɬɚɦ ɛɥɨɤɚ Out. Ʉɚɤ ɩɪɚɜɢɥɨ, ɷɬɨ ɬɚɤ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɜɟɫɶ ɚɥɝɨɪɢɬɦ ɫɜɨɞɢɬɫɹ ɤ ɨɞɧɨɦɭ ɬɪɢɜɢɚɥɶɧɨɦɭ ɰɢɤɥɭ (1sm), ɢ ɨɞɧɨɦɭ ɩɪɨɯɨɞɭ ɩɨ ɞɚɧɧɵɦ (2sm). Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 271 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɍȼȿɅɂɑȿɇɂȿ ɋɄɈɊɈɋɌɂ ɊȺɁɀȺɌɂə
ɍɫɤɨɪɟɧɢɟ ɪɚɡɠɚɬɢɹ ɜɨɡɦɨɠɧɨ, ɟɫɥɢ ɞɥɢɧɵ ɤɨɧɬɟɣɧɟɪɨɜ ɫɠɢɦɚɬɶ ɢ ɩɟɪɟɞɚɜɚɬɶ ɨɬɞɟɥɶɧɨ. ȿɫɥɢ L ɫɭɳɟɫɬɜɟɧɧɨ ɛɨɥɶɲɟ n, ɨɩɢɫɚɧɢɟ ɞɥɢɧ ɡɚɧɢɦɚɟɬ ɧɟɡɧɚɱɢɬɟɥɶɧɭɸ ɱɚɫɬɶ ɫɠɚɬɨɝɨ ɛɥɨɤɚ, ɬɚɤ ɱɬɨ ɩɨɬɟɪɢ ɜ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɛɭɞɭɬ ɧɟɜɟɥɢɤɢ. Ɍɨɝɞɚ ɜ ɦɚɫɫɢɜ Attr[n] ɩɪɢ ɪɚɡɠɚɬɢɢ ɦɨɠɧɨ ɫɪɚɡɭ ɡɚɩɢɫɵɜɚɬɶ ɧɟ ɞɥɢɧɵ, ɚ ɧɚɱɚɥɚ ɤɨɧɬɟɣɧɟɪɨɜ. Ɂɚɦɟɬɢɦ, ɱɬɨ ɢ ɜ ɫɥɭɱɚɟ ST/BWT ɷɬɨ ɞɚɫɬ ɡɚɦɟɬɧɨɟ ɭɜɟɥɢɱɟɧɢɟ ɫɤɨɪɨɫɬɢ: ɩɨɞɫɱɟɬ ɱɚɫɬɨɬ ɷɥɟɦɟɧɬɨɜ ɬɪɟɛɭɟɬ ɩɪɢ ɪɚɡɠɚɬɢɢ ɞɨɩɨɥɧɢɬɟɥɶɧɨɝɨ ɩɪɨɯɨɞɚ ɩɨ ɞɚɧɧɵɦ. ɉɍɌɂ ɍɅɍɑɒȿɇɂə ɋɀȺɌɂə
Ɉɛɳɢɣ ɫɥɭɱɚɣ ȿɫɥɢ ɫɨɞɟɪɠɢɦɨɟ ɤɚɠɞɨɝɨ ɤɨɧɬɟɣɧɟɪɚ (ɢɥɢ ɧɟɤɨɬɨɪɵɯ ɢɡ ɧɢɯ) ɩɨɞɜɟɪɝɚɟɬɫɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɸ, ɡɚɜɢɫɹɳɟɦɭ ɨɬ ɟɝɨ ɚɬɪɢɛɭɬɚ, ɬɨ ɞɥɢɧɵ ɤɨɧɬɟɣɧɟɪɨɜ ɧɚɞɨ ɨɛɹɡɚɬɟɥɶɧɨ ɩɟɪɟɞɚɜɚɬɶ ɞɟɤɨɦɩɪɟɫɫɨɪɭ, ɢɧɚɱɟ ɨɧ ɧɟɩɪɚɜɢɥɶɧɨ ɩɨɫɬɪɨɢɬ ɬɚɛɥɢɰɭ ɱɚɫɬɨɬ ɩɨ ɫɨɞɟɪɠɢɦɨɦɭ ɤɨɧɬɟɣɧɟɪɨɜ. ȿɫɥɢ ɩɚɪɚɥɥɟɥɶɧɵɣ ɛɥɨɤ ɭɠɟ ɫɭɳɟɫɬɜɭɟɬ ɢ ɧɟ ɢɡɦɟɧɹɟɬɫɹ ɩɪɢ ɩɪɹɦɨɦ ɢ ɨɛɪɚɬɧɨɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɢ, ɮɭɧɤɰɢɸ A ɦɨɠɧɨ ɫɬɪɨɢɬɶ ɛɟɡ ɜɫɹɤɢɯ ɨɝɪɚɧɢɱɟɧɢɣ, ɢɫɩɨɥɶɡɭɹ ɥɸɛɭɸ ɤɨɦɛɢɧɚɰɢɸ ɚɪɢɮɦɟɬɢɱɟɫɤɢɯ, ɥɨɝɢɱɟɫɤɢɯ ɢ ɞɪɭɝɢɯ ɨɩɟɪɚɰɢɣ. ɇɚɩɪɢɦɟɪ, A[i]=(int)P[i]/2; // ɞɟɥɟɧɢɟ ɰɟɥɨɱɢɫɥɟɧɧɨɟ
ȿɫɥɢ ɫɪɚɜɧɢɜɚɬɶ ɫɨ ɫɥɭɱɚɟɦ A[i] = P[i], ɬɨ ɦɨɠɧɨ ɫɤɚɡɚɬɶ, ɱɬɨ ɤɚɠɞɚɹ ɩɚɪɚ ɤɨɧɬɟɣɧɟɪɨɜ ɨɛɴɟɞɢɧɹɟɬɫɹ ɜ ɨɞɢɧ «ɞɜɨɣɧɨɣ» ɤɨɧɬɟɣɧɟɪ. A[i]=P[i]^(n-1); // ɢɥɢ, ɱɬɨ ɬɨ ɠɟ ɫɚɦɨɟ, A[i]=n-1-P[i].
Ɍɨ ɟɫɬɶ ɤɨɧɬɟɣɧɟɪɵ ɛɭɞɭɬ ɥɟɠɚɬɶ ɜ Out ɜ ɨɛɪɚɬɧɨɦ ɩɨɪɹɞɤɟ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ A[i]=P[i]. ɗɬɨ ɩɨɥɟɡɧɨ ɞɥɹ ɜɬɨɪɨɝɨ ɨɬɫɨɪɬɢɪɨɜɚɧɧɨɝɨ ɛɥɨɤɚ Out2, ɡɚɩɢɫɵɜɚɟɦɨɝɨ ɡɚ ɩɟɪɜɵɦ Out1, ɨɫɨɛɟɧɧɨ ɟɫɥɢ ɞɚɧɧɵɟ — ɦɭɥɶɬɢɦɟɞɢɣɧɵɟ, ɩɨɫɤɨɥɶɤɭ ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɡɧɚɱɟɧɢɹ In[i] ɢ In[i+1], ɤɚɤ ɩɪɚɜɢɥɨ, ɛɥɢɡɤɢ. ȿɳɟ ɞɜɚ ɜɚɪɢɚɧɬɚ ɜɵɱɢɫɥɟɧɢɹ ɚɬɪɢɛɭɬɚ: 272 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
1. A[i]=(P[i] & 16 == 0)? P[i] : (P[i]^15);
Ɇɥɚɞɲɢɟ ɱɟɬɵɪɟ ɛɢɬɚ ɢɡɦɟɧɹɸɬɫɹ ɬɨɥɶɤɨ ɧɚ +1 ɢɥɢ –1: abs(P[i]&15 – P[i–1]&15)=1. 2. A[i]=(P[i]<0)? (-P[i]*2+1 ) : P[i]*2;
Ɋɚɫɫɬɨɹɧɢɟ ɞɨ ɧɭɥɹ, ɚ ɡɧɚɤ — ɜ ɦɥɚɞɲɟɦ ɛɢɬɟ.
ɍɩɪɚɠɧɟɧɢɟ: ɇɚɩɢɲɢɬɟ ɤ ɩɨɫɥɟɞɧɢɦ ɞɜɭɦ ɮɨɪɦɭɥɚɦ ɮɨɪɦɭɥɵ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ.
Ɏɭɧɤɰɢɹ A ɦɨɠɟɬ ɛɵɬɶ ɢ ɚɞɚɩɬɢɜɧɨɣ, ɬ.ɟ. ɩɪɨɢɡɜɨɞɢɬɫɹ ɩɟɪɢɨɞɢɱɟɫɤɚɹ ɤɨɪɪɟɤɬɢɪɨɜɤɚ ɤɚɤɢɯ-ɬɨ ɟɟ ɤɨɷɮɮɢɰɢɟɧɬɨɜ, ɱɬɨɛɵ ɜɵɯɨɞɧɨɣ ɛɥɨɤ ɛɨɥɶɲɟ ɫɨɨɬɜɟɬɫɬɜɨɜɚɥ ɡɚɞɚɧɧɨɦɭ ɤɪɢɬɟɪɢɸ. ɇɚɩɪɢɦɟɪ, ɢɡɜɟɫɬɧɨ, ɱɬɨ ɩɨɫɥɟɞɧɢɟ 20-30 ɤɨɧɬɟɣɧɟɪɨɜ ɢɡ 256-ɢ ɩɨɥɟɡɧɨ ɨɛɴɟɞɢɧɹɬɶ ɜ ɱɟɬɜɟɪɤɢ, ɚ ɨɫɬɚɥɶɧɵɟ — ɜ ɩɚɪɵ: // ɩɨɫɥɟɞɧɢɟ 256-232=24 ɤɨɧɬɟɣɧɟɪɚ ɨɛɴɟɞɢɧɹɟɦ ɜ ɱɟɬɜɟɪɤɢ K=232; A[i]=(P[i]>K)? P[i]/4 : P[i]/2; // ɞɟɥɟɧɢɟ — ɰɟɥɨɱɢɫɥɟɧɧɨɟ
ɉɪɢ ɷɬɨɦ ɤɪɢɬɟɪɢɣ ɢɫɩɨɥɶɡɭɟɬɫɹ ɬɚɤɨɣ: ɫɭɦɦɚ ɩɟɪɜɨɣ ɩɪɨɢɡɜɨɞɧɨɣ ɜɵɯɨɞɧɨɝɨ ɛɥɨɤɚ Out ɞɨɥɠɧɚ ɫɬɪɟɦɢɬɶɫɹ ɤ ɧɭɥɸ: L −1
Sum = ƒ(Out[i ] − Out[i − 1]) = 0 , i =1 ɝɞɟ Out[i]–Out[i–1] — ɩɟɪɜɚɹ ɩɪɨɢɡɜɨɞɧɚɹ ɛɥɨɤɚ. Ɍɨɝɞɚ ɦɨɠɧɨ ɜɵɱɢɫɥɹɬɶ SumCurrent+=Out[i]-Out[i-1], ɩɪɢ ɬɟɤɭɳɟɦ ɡɧɚɱɟɧɢɢ K, SumMinus+=Outm[i]-Outm[i-1] ɩɪɢ K=K-4, SumPlus+=Outp[i]-Outp[i-1] ɩɪɢ K=K+4,
ɢ ɱɟɪɟɡ ɤɚɠɞɵɟ StepK ɲɚɝɨɜ ɜɵɛɢɪɚɬɶ ɧɨɜɨɟ ɡɧɚɱɟɧɢɟ K ɩɨ ɪɟɡɭɥɶɬɚɬɭ ɫɪɚɜɧɟɧɢɹ SumCurrent, SumMinus ɢ SumPlus: if (SumMinus<SumCurrent && SumMinus<SumPlus) K=K-4;
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 273 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
else if (SumPlus<SumCurrent) K=K+4;
Ɇɨɠɟɬ ɨɤɚɡɚɬɶɫɹ ɩɨɥɟɡɧɵɦ ɫɨɯɪɚɧɹɬɶ ɛɥɨɤ A ɜɦɟɫɬɨ P, ɨɫɨɛɟɧɧɨ ɟɫɥɢ ɩɚɪɚɥɥɟɥɶɧɵɣ ɛɥɨɤ ɫɬɪɨɢɬɫɹ ɨɞɧɨɜɪɟɦɟɧɧɨ ɫ ɫɨɪɬɢɪɭɟɦɵɦ — ɧɚɩɪɢɦɟɪ, P[i] ɜɵɱɢɫɥɹɟɬɫɹ ɩɨ P[i-1] ɢ In[i-1]. Ɍɨɝɞɚ P ɞɨɥɠɟɧ ɛɵɬɶ ɜɨɫɫɬɚɧɨɜɢɦ ɩɨ A, ɢ ɮɭɧɤɰɢɹ A ɞɨɥɠɧɚ ɛɵɬɶ ɛɢɟɤɬɢɜɧɨɣ: ɩɨ ɡɧɚɱɟɧɢɸ A[i]=A(P[i]) ɨɞɧɨɡɧɚɱɧɨ ɧɚɯɨɞɢɬɫɹ P[i]. Ɋɟɚɥɶɧɨ ɬɚɤɚɹ ɮɭɧɤɰɢɹ A ɫɜɨɞɢɬɫɹ ɤ ɩɟɪɟɫɬɚɧɨɜɤɟ: ɢɦɟɟɦ ɤɨɧɬɟɣɧɟɪɵ ɫ ɚɬɪɢɛɭɬɚɦɢ A[i]=P[i], ɡɚɬɟɦ ɩɟɪɟɬɚɫɨɜɵɜɚɟɦ ɢɯ, ɦɟɧɹɹ ɦɟɫɬɚɦɢ ɜɧɭɬɪɢ ɟɞɢɧɨɝɨ ɜɵɯɨɞɧɨɝɨ ɛɥɨɤɚ Out, ɧɨ ɧɟ ɢɡɦɟɧɹɹ ɢɯ ɫɨɞɟɪɠɢɦɨɝɨ. ɇɨ ɮɨɪɦɚɥɶɧɨ A ɦɨɠɟɬ ɜɵɝɥɹɞɟɬɶ ɨɱɟɧɶ ɩɨ-ɪɚɡɧɨɦɭ, ɫɨɞɟɪɠɚɬɶ ɩɪɢɛɚɜɥɟɧɢɟ ɤɨɧɫɬɚɧɬɵ: A[i]=P[i]+123; // ɪɟɡɭɥɶɬɚɬ ɛɟɪɟɬɫɹ ɩɨ ɦɨɞɭɥɸ n
ɥɨɝɢɱɟɫɤɢɣ XOR: A[i]=P[i]^157;
ɫɪɚɜɧɟɧɢɹ ɢ ɩɟɪɟɫɬɚɧɨɜɤɢ ɛɢɬɨɜ, ɜ ɬɨɦ ɱɢɫɥɟ ɰɢɤɥɢɱɟɫɤɢɦ ɜɪɚɳɟɧɢɟɦ: A[i]=(P[i]&(n/2))? ( (P[i]-(n/2))*2+1 ) : P[i]*2;
ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤ ɛɭɞɟɬ ɜɵɝɥɹɞɟɬɶ A, ɫɨɛɢɪɚɸɳɚɹ ɜɦɟɫɬɟ ɷɥɟɦɟɧɬɵ In[i], ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɬɟɦ P[i], ɨɫɬɚɬɨɤ ɤɨɬɨɪɵɯ ɨɬ ɞɟɥɟɧɢɹ ɧɚ ɡɚɞɚɧɧɨɟ K ɨɞɢɧɚɤɨɜ? ɇɚɱɧɢɬɟ ɫɨ ɫɥɭɱɚɟɜ K=4 ɢ K=8.
ȿɫɥɢ ɮɭɧɤɰɢɹ A ɧɟ ɚɞɚɩɬɢɜɧɚ ɢɥɢ ɡɚɜɢɫɢɬ ɬɨɥɶɤɨ ɨɬ ɷɥɟɦɟɧɬɨɜ ɩɚɪɚɥɥɟɥɶɧɨɝɨ ɛɥɨɤɚ, ɫɚɦɢ ɤɨɧɬɟɣɧɟɪɵ, ɩɨɫɤɨɥɶɤɭ ɢɯ ɞɥɢɧɵ ɢɡɜɟɫɬɧɵ, ɦɨɠɧɨ ɫɨɪɬɢɪɨɜɚɬɶ ɜɧɭɬɪɢ ɟɞɢɧɨɝɨ ɜɵɯɨɞɧɨɝɨ ɛɥɨɤɚ ɩɨ ɢɯ ɞɥɢɧɚɦ. ɗɬɨ ɦɨɠɟɬ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɞɚɠɟ ɩɪɢ ST/BWT, ɨɫɨɛɟɧɧɨ ɜ ɫɥɭɱɚɟ ɤɚɱɟɫɬɜɟɧɧɵɯ ɞɚɧɧɵɯ, ɚ ɧɟ ɤɨɥɢɱɟɫɬɜɟɧɧɵɯ. ɑɚɫɬɨ ɨɤɚɡɵɜɚɟɬɫɹ ɜɵɝɨɞɧɵɦ ɝɪɭɩɩɢɪɨɜɚɬɶ ɤɨɪɨɬɤɢɟ ɤɨɧɬɟɣɧɟɪɵ ɜ ɨɞɧɨɦ ɤɨɧɰɟ ɜɵɯɨɞɧɨɝɨ ɛɥɨɤɚ, ɚ ɞɥɢɧɧɵɟ — ɜ ɞɪɭɝɨɦ. ɂ 274 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɪɢ ɫɠɚɬɢɢ, ɢ ɩɪɢ ɪɚɡɠɚɬɢɢ ɩɪɨɰɟɞɭɪɚ ɫɨɪɬɢɪɨɜɤɢ ɤɨɧɬɟɣɧɟɪɨɜ ɩɨ ɞɥɢɧɚɦ ɞɨɛɚɜɢɬɫɹ ɦɟɠɞɭ ɰɢɤɥɚɦɢ (2) ɢ (3). Ɋɚɫɫɦɨɬɪɢɦ ɩɨɫɥɟɞɧɢɣ ɜɚɪɢɚɧɬ: ɜɟɫɶ ɛɥɨɤ A ɫɨɯɪɚɧɹɟɬɫɹ ɢ ɩɟɪɟɞɚɟɬɫɹ (ɤɨɦɩɪɟɫɫɨɪɨɦ ɞɟɤɨɦɩɪɟɫɫɨɪɭ), ɩɨɷɬɨɦɭ ɢ ɫɬɪɨɢɬɫɹ ɨɧ ɢɦɟɧɧɨ ɫ ɭɱɟɬɨɦ ɬɚɤɨɣ ɨɫɨɛɟɧɧɨɫɬɢ. ȿɫɥɢ ɟɫɬɶ ɩɚɪɚɥɥɟɥɶɧɵɣ ɛɥɨɤ P, ɦɨɠɧɨ ɫɬɪɨɢɬɶ A ɬɚɤ, ɱɬɨɛɵ ɢ P ɩɪɟɨɛɪɚɡɨɜɵɜɚɬɶ ɧɚ ɨɫɧɨɜɟ A, ɢ ɱɬɨɛɵ ɫɭɦɦɚɪɧɨ ɛɥɨɤɢ A, P, In ɫɠɢɦɚɥɢɫɶ ɥɭɱɲɟ, ɱɟɦ P ɢ In. ȿɫɥɢ ɧɟɬ P, ɬɨ ɩɨɥɭɱɚɟɬɫɹ, ɱɬɨ In ɪɚɫɩɚɞɚɟɬɫɹ ɧɚ ɞɜɟ ɤɨɦɩɨɧɟɧɬɵ: «ɢɞɟɚɥɶɧɭɸ» — ɦɨɞɟɥɢɪɭɟɦɵɟ, ɩɪɟɞɫɤɚɡɵɜɚɟɦɵɟ A[i], ɢ «ɪɟɚɥɶɧɭɸ» — ɨɬɤɥɨɧɟɧɢɹ In[i] ɨɬ ɩɪɟɞɫɤɚɡɚɧɧɵɯ ɡɧɚɱɟɧɢɣ A[i]. Ⱦɜɭɦɟɪɧɵɣ ɫɥɭɱɚɣ ɉɚɪɚɥɥɟɥɶɧɵɦ ɛɥɨɤɨɦ ɦɨɠɟɬ ɛɵɬɶ ɩɪɟɞɵɞɭɳɚɹ, ɭɠɟ ɨɛɪɚɛɨɬɚɧɧɚɹ ɫɬɪɨɤɚ ɬɚɛɥɢɰɵ. Ʌɢɛɨ ɩɪɟɞɫɤɚɡɵɜɚɟɦɚɹ (ɬɟɤɭɳɚɹ), ɮɨɪɦɢɪɭɟɦɚɹ ɧɚ ɨɫɧɨɜɟ ɨɞɧɨɣ ɢɥɢ ɧɟɫɤɨɥɶɤɢɯ ɩɪɟɞɵɞɭɳɢɯ ɫɬɪɨɤ. ȼ ɨɛɨɢɯ ɫɥɭɱɚɹɯ ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɜɵɱɢɫɥɹɬɶ ɚɬɪɢɛɭɬ ɤɚɤ ɫɪɟɞɧɟɟ ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ ɫɨɫɟɞɧɢɯ ɷɥɟɦɟɧɬɨɜ, ɨɫɨɛɟɧɧɨ ɞɥɹ ɦɭɥɶɬɢɦɟɞɢɣɧɵɯ ɞɚɧɧɵɯ: //ɟɫɥɢ ɢɡɜɟɫɬɧɵ ɬɟ, ɱɬɨ ɜɵɲɟ ɢ ɥɟɜɟɟ, ɬɨ ɫɨɫɟɞɧɢɯ – ɱɟɬɵɪɟ: // P[i-2] P[i-1] P[i] P[i+1] // In[i-2] In[i-1] In[i] A[i]=(P[i-1]+ P[i]+P[i+1])/3; A[i]=(P[i-1]+2*P[i]+P[i+1])/4; A[i]=(P[i-1]+ P[i]+In[i-1])/3; A[i]=(P[i-1]+2*P[i]+In[i-1])/4; A[i]=(P[i-1]+ P[i]+2*In[i-1])/4; A[i]=(P[i-1]+ P[i]+P[i+1]+In[i-1])/4;
Ɍɨɝɞɚ, ɨɩɹɬɶ ɠɟ, ɞɥɢɧɵ ɤɨɧɬɟɣɧɟɪɨɜ (ɱɚɫɬɨɬɵ ɡɧɚɱɟɧɢɣ ɚɬɪɢɛɭɬɨɜ) ɧɚɞɨ ɨɛɹɡɚɬɟɥɶɧɨ ɩɟɪɟɞɚɜɚɬɶ ɞɟɤɨɦɩɪɟɫɫɨɪɭ. ɉɟɪɟɞ ɞɟɥɟɧɢɟɦ ɩɨɥɟɡɧɨ ɞɟɥɚɬɶ ɨɤɪɭɝɥɟɧɢɟ ɞɨ ɛɥɢɠɚɣɲɟɝɨ ɱɢɫɥɚ, ɤɪɚɬɧɨɝɨ ɞɟɥɢɬɟɥɸ. ȿɳɟ ɫɥɨɠɧɟɟ ɛɭɞɭɬ ɮɨɪɦɭɥɵ, ɟɫɥɢ ɢɫɩɨɥɶɡɨɜɚɬɶ ɛɨɥɟɟ ɨɞɧɨɣ ɩɪɟɞɵɞɭɳɟɣ ɫɬɪɨɤɢ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 275 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɂɚɦɟɬɢɦ ɜɚɠɧɨɟ ɩɨɥɟɡɧɨɟ ɫɜɨɣɫɬɜɨ ɦɟɬɨɞɚ: ɭɜɟɥɢɱɟɧɢɟ ɫɥɨɠɧɨɫɬɢ ɜɵɱɢɫɥɟɧɢɣ ɧɟ ɜɥɟɱɟɬ ɭɜɟɥɢɱɟɧɢɹ ɨɛɴɟɦɚ ɧɟɨɛɯɨɞɢɦɨɣ ɩɚɦɹɬɢ. ȿɫɥɢ ɪɚɫɫɦɚɬɪɢɜɚɬɶ ɦɧɨɠɟɫɬɜɨ ɫɬɪɨɤ ɤɚɤ ɟɞɢɧɵɣ ɛɥɨɤ, ɬɨ ɜ ɩɪɨɫɬɟɣɲɟɦ ɫɥɭɱɚɟ A[i]=P[i]=In[i–W] (W — ɱɢɫɥɨ ɷɥɟɦɟɧɬɨɜ ɜ ɫɬɪɨɤɟ), ɬɨ ɟɫɬɶ ɜ ɤɚɱɟɫɬɜɟ ɚɬɪɢɛɭɬɚ ɢɫɩɨɥɶɡɭɟɬɫɹ ɡɧɚɱɟɧɢɟ «ɜɟɪɯɧɟɝɨ» ɷɥɟɦɟɧɬɚ. Ɍɨɝɞɚ ɬɚɛɥɢɰɭ ɞɥɢɧ ɫɨɯɪɚɧɹɬɶ ɧɟ ɧɭɠɧɨ, ɧɨ ɩɟɪɜɵɟ W ɷɥɟɦɟɧɬɨɜ ɜ ɧɟɢɡɦɟɧɧɨɦ ɜɢɞɟ — ɨɛɹɡɚɬɟɥɶɧɨ.
ɍɩɪɚɠɧɟɧɢɟ: Ɉɩɢɲɢɬɟ ɩɨɞɪɨɛɧɨ ɚɥɝɨɪɢɬɦ ɫɨɪɬɢɪɨɜɤɢ ɜ ɫɥɭɱɚɟ A[i]=In[i-W]. ɇɚɱɧɢɬɟ ɫ W=1 ɢ W=2.
ɏɚɪɚɤɬɟɪɢɫɬɢɤɢ ɦɟɬɨɞɨɜ ɫɟɦɟɣɫɬɜɚ PBS: ɋɬɟɩɟɧɶ ɫɠɚɬɢɹ: ɭɜɟɥɢɱɢɜɚɟɬɫɹ ɜ 1.0 ... 2.0 ɪɚɡɚ. Ɍɢɩɵ ɞɚɧɧɵɯ: ɦɧɨɝɨɦɟɪɧɵɟ ɢɥɢ ɦɧɨɝɨɭɪɨɜɧɟɜɵɟ ɞɚɧɧɵɟ. ɋɢɦɦɟɬɪɢɱɧɨɫɬɶ ɩɨ ɫɤɨɪɨɫɬɢ: ɜ ɨɛɳɟɦ ɫɥɭɱɚɟ 1:1. ɏɚɪɚɤɬɟɪɧɵɟ ɨɫɨɛɟɧɧɨɫɬɢ: ɧɟɨɛɯɨɞɢɦɨ ɧɚɥɢɱɢɟ ɤɚɤ ɦɢɧɢɦɭɦ ɞɜɭɯ ɩɚɪɚɥɥɟɥɶɧɵɯ ɛɥɨɤɨɜ ɞɚɧɧɵɯ.
Ɏɪɚɝɦɟɧɬɢɪɨɜɚɧɢɟ ɐɟɥɶ: ɪɚɡɛɢɟɧɢɟ ɢɫɯɨɞɧɨɝɨ ɩɨɬɨɤɚ ɢɥɢ ɛɥɨɤɚ ɧɚ ɮɪɚɝɦɟɧɬɵ ɫ ɪɚɡɧɵɦɢ ɫɬɚɬɢɫɬɢɱɟɫɤɢɦɢ ɫɜɨɣɫɬɜɚɦɢ. Ɍɚɤɨɟ ɪɚɡɛɢɟɧɢɟ ɞɨɥɠɧɨ ɭɜɟɥɢɱɢɬɶ ɫɬɟɩɟɧɶ ɩɨɫɥɟɞɭɸɳɟɝɨ ɫɠɚɬɢɹ. ȼ ɩɪɨɫɬɟɣɲɟɦ ɫɥɭɱɚɟ ɛɢɬɨɜɨɝɨ ɩɨɬɨɤɚ ɧɟɨɛɯɨɞɢɦɨ ɧɚɯɨɞɢɬɶ ɝɪɚɧɢɰɵ ɭɱɚɫɬɤɨɜ ɫ ɩɪɟɨɛɥɚɞɚɧɢɟɦ ɧɭɥɟɣ, ɭɱɚɫɬɤɨɜ ɫ ɩɪɟɨɛɥɚɞɚɧɢɟɦ ɟɞɢɧɢɰ, ɢ ɭɱɚɫɬɤɨɜ ɫ ɪɚɜɧɨɦɟɪɧɵɦ ɪɚɫɩɪɟɞɟɥɟɧɢɟɦ ɧɭɥɟɣ ɢ ɟɞɢɧɢɰ. ȿɫɥɢ 276 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɨɬɨɤ ɫɢɦɜɨɥɶɧɵɣ, ɦɨɠɟɬ ɨɤɚɡɚɬɶɫɹ ɜɵɝɨɞɧɵɦ ɪɚɡɛɢɬɶ ɟɝɨ ɧɚ ɮɪɚɝɦɟɧɬɵ, ɨɬɥɢɱɚɸɳɢɟɫɹ ɪɚɫɩɪɟɞɟɥɟɧɢɟɦ ɜɟɪɨɹɬɧɨɫɬɟɣ ɷɥɟɦɟɧɬɨɜ: ɧɚɩɪɢɦɟɪ, ɧɚ ɮɪɚɝɦɟɧɬɵ ɫ ɪɭɫɫɤɢɦ ɬɟɤɫɬɨɦ ɢ ɮɪɚɝɦɟɧɬɵ ɫ ɚɧɝɥɢɣɫɤɢɦ. Ɉɫɧɨɜɧɚɹ ɢɞɟɹ ɫɨɫɬɨɢɬ ɜ ɬɨɦ, ɱɬɨɛɵ ɞɥɹ ɤɚɠɞɨɣ ɬɨɱɤɢ ɩɨɬɨɤɚ X (ɥɟɠɚɳɟɣ ɦɟɠɞɭ ɩɚɪɨɣ ɫɨɫɟɞɧɢɯ ɷɥɟɦɟɧɬɨɜ) ɧɚɯɨɞɢɬɶ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ FO(X) ɩɪɟɞɵɞɭɳɟɣ ɱɚɫɬɢ ɩɨɬɨɤɚ ɨɬ ɩɨɫɥɟɞɭɸɳɟɣ. ȼ ɛɚɡɨɜɨɦ ɩɪɨɫɬɟɣɲɟɦ ɜɚɪɢɚɧɬɟ ɢɫɩɨɥɶɡɭɟɬɫɹ «ɫɤɨɥɶɡɹɳɟɟ ɨɤɧɨ» ɮɢɤɫɢɪɨɜɚɧɧɨɣ ɞɥɢɧɵ: Z ɷɥɟɦɟɧɬɨɜ ɞɨ ɬɨɱɤɢ X, ɢ Z ɷɥɟɦɟɧɬɨɜ ɩɨɫɥɟ ɧɟɟ. ɂɥɥɸɫɬɪɚɰɢɹ (Z=7): …8536429349586436542 58676780674389…
|
9865332
|
X
|
6564387
|
ɐɢɮɪɚɦɢ ɨɛɨɡɧɚɱɟɧɵ ɷɥɟɦɟɧɬɵ ɩɨɬɨɤɚ, ɜɟɪɬɢɤɚɥɶɧɵɦɢ ɱɟɪɬɚɦɢ «|» ɝɪɚɧɢɰɵ ɥɟɜɨɝɨ ɢ ɩɪɚɜɨɝɨ ɨɤɨɧ. X — ɧɟ ɷɥɟɦɟɧɬ ɩɨɬɨɤɚ, ɚ ɬɨɱɤɚ ɦɟɠɞɭ ɩɚɪɨɣ ɷɥɟɦɟɧɬɨɜ, ɜ ɞɚɧɧɨɦ ɫɥɭɱɚɟ ɦɟɠɞɭ ”2“ ɢ ”6“. ɉɪɢ ɮɢɤɫɢɪɨɜɚɧɧɨɣ ɞɥɢɧɟ ɨɤɨɧ Z ɢ ɨɞɢɧɚɤɨɜɨɣ ɡɧɚɱɢɦɨɫɬɢ, ɢɥɢ ɜɟɫɟ, ɜɫɟɯ ɷɥɟɦɟɧɬɨɜ ɜɧɭɬɪɢ ɨɤɨɧ (ɧɟɡɚɜɢɫɢɦɨ ɨɬ ɢɯ ɭɞɚɥɟɧɧɨɫɬɢ ɨɬ ɬɨɱɤɢ X), ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ ɦɨɠɟɬ ɛɵɬɶ ɥɟɝɤɨ ɜɵɱɢɫɥɟɧɨ ɧɚ ɨɫɧɨɜɚɧɢɢ ɪɚɡɧɨɫɬɢ ɱɚɫɬɨɬ ɷɥɟɦɟɧɬɨɜ ɜ ɥɟɜɨɦ ɢ ɩɪɚɜɨɦ ɨɤɧɚɯ. ɗɬɨ ɫɭɦɦɚ ɩɨ ɜɫɟɦ 2R ɜɨɡɦɨɠɧɵɦ ɡɧɚɱɟɧɢɹɦ Vi ɷɥɟɦɟɧɬɨɜ. ɋɭɦɦɢɪɭɸɬɫɹ ɚɛɫɨɥɸɬɧɵɟ ɡɧɚɱɟɧɢɹ ɪɚɡɧɨɫɬɟɣ: ɱɢɫɥɨ ɷɥɟɦɟɧɬɨɜ ɫ ɬɟɤɭɳɢɦ ɡɧɚɱɟɧɢɟɦ V ɜ ɥɟɜɨɦ ɨɤɧɟ ɞɥɢɧɨɣ Z ɦɢɧɭɫ ɱɢɫɥɨ ɷɥɟɦɟɧɬɨɜ ɫ ɞɚɧɧɵɦ ɡɧɚɱɟɧɢɟɦ V ɜ ɩɪɚɜɨɦ ɨɤɧɟ ɞɥɢɧɨɣ Z. ɋɭɦɦɢɪɭɹ 2R ɦɨɞɭɥɟɣ ɪɚɡɧɨɫɬɢ, ɩɨɥɭɱɚɟɦ ɡɧɚɱɟɧɢɟ FO(X) ɜ ɞɚɧɧɨɣ ɬɨɱɤɟ X:
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 277 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
FO ( X ) =
2 R −1
ƒCountLeft[V ] − CountRight[V ] ,
V =0
ɝɞɟ CountLeft[V] — ɱɢɫɥɨ ɷɥɟɦɟɧɬɨɜ ɫɨ ɡɧɚɱɟɧɢɟɦ V ɜ ɥɟɜɨɦ ɨɤɧɟ; CountRight[V] — ɱɢɫɥɨ ɷɥɟɦɟɧɬɨɜ ɫɨ ɡɧɚɱɟɧɢɟɦ V ɜ ɩɪɚɜɨɦ ɨɤɧɟ. ȼɢɞɧɨ, ɱɬɨ ɟɫɥɢ ɜ ɨɛɨɢɯ ɨɤɧɚɯ ɷɥɟɦɟɧɬɵ ɨɞɢɧɚɤɨɜɵɟ, ɬɨ ɫɭɦɦɚ ɛɭɞɟɬ ɫɬɪɟɦɢɬɶɫɹ ɤ ɧɭɥɸ, ɟɫɥɢ ɠɟ ɷɥɟɦɟɧɬɵ ɫɨɜɟɪɲɟɧɧɨ ɪɚɡɧɵɟ — ɤ 2·Z. Ⱦɥɹ ɩɪɢɜɟɞɟɧɧɨɝɨ ɜɵɲɟ ɩɪɢɦɟɪɚ: V= 2 3 4 5 6 7 8 9 FO(X) = +|1-0| +|2-1| +|0-1| +|1-1| +|1-2| +|0-1| +|1-1| +|1-0| =6 ɉɨɫɥɟ ɬɨɝɨ ɤɚɤ ɜɫɟ ɡɧɚɱɟɧɢɹ FO(X) ɧɚɣɞɟɧɵ, ɨɫɬɚɟɬɫɹ ɨɬɫɨɪɬɢɪɨɜɚɬɶ ɢɯ ɩɨ ɜɨɡɪɚɫɬɚɧɢɸ ɢ ɜɵɛɪɚɬɶ ɝɪɚɧɢɰɵ ɩɨ ɡɚɞɚɧɧɨɦɭ ɤɪɢɬɟɪɢɸ (ɡɚɞɚɧɧɨɟ ɱɢɫɥɨ ɝɪɚɧɢɰ ɢ/ɢɥɢ ɩɨɤɚ FO(X)>Fmin). Ɋɚɡɦɟɪ ɞɚɧɧɵɯ ɜ ɪɟɡɭɥɶɬɚɬɟ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɹ ɭɜɟɥɢɱɢɜɚɟɬɫɹ: ɥɢɛɨ ɩɨɹɜɥɹɟɬɫɹ ɜɬɨɪɨɣ ɩɨɬɨɤ ɫ ɞɥɢɧɚɦɢ ɮɪɚɝɦɟɧɬɨɜ, ɥɢɛɨ ɮɥɚɝɢ ɝɪɚɧɢɰ ɜ ɨɞɧɨɦ ɪɟɡɭɥɶɬɢɪɭɸɳɟɦ ɩɨɬɨɤɟ. Ⱦɥɹ ɫɠɚɬɢɹ ɪɟɡɭɥɶɬɚɬɚ ɪɚɛɨɬɵ ɦɟɬɨɞɚ ɦɨɠɟɬ ɛɵɬɶ ɩɪɢɦɟɧɟɧɚ ɥɸɛɚɹ ɤɨɦɛɢɧɚɰɢɹ ɦɟɬɨɞɨɜ — RLE, LPC, MTF, DC, PBS, HUFF, ARIC, ENUC, SEM... Ɇɟɬɨɞɵ ɷɬɨɣ ɝɪɭɩɩɵ ɬɪɚɧɫɮɨɪɦɢɪɭɸɳɢɟ ɢ ɩɨɬɨɱɧɵɟ, ɬ.ɟ. ɦɨɝɭɬ ɩɪɢɦɟɧɹɬɶɫɹ ɞɚɠɟ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɤɨɝɞɚ ɞɥɢɧɚ ɛɥɨɤɚ ɫ ɞɚɧɧɵɦɢ ɧɟ ɡɚɞɚɧɚ. Ɉɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɧɟ ɬɪɟɛɭɟɬɫɹ. ȼ ɨɛɳɟɦ ɫɥɭɱɚɟ ɫɤɨɪɨɫɬɶ ɪɚɛɨɬɵ ɤɨɦɩɪɟɫɫɨɪɚ ɡɚɜɢɫɢɬ ɬɨɥɶɤɨ ɨɬ ɪɚɡɦɟɪɚ ɞɚɧɧɵɯ, ɧɨ ɧɟ ɨɬ ɢɯ ɫɨɞɟɪɠɚɧɢɹ: ɋɤɨɪɨɫɬɶ=O(Ɋɚɡɦɟɪ). ɉɚɦɹɬɢ ɬɪɟɛɭɟɬɫɹ ɩɨɪɹɞɤɚ 2R+1. Ⱦɥɹ ɥɟɜɨɝɨ ɨɤɧɚ O(2R), ɢ ɫɬɨɥɶɤɨ ɠɟ ɞɥɹ ɩɪɚɜɨɝɨ. Ɉɩɟɪɚɰɢɣ ɭɦɧɨɠɟɧɢɹ ɢ ɞɟɥɟɧɢɹ ɧɟɬ. 278 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɋ ɬɨɱɤɢ ɡɪɟɧɢɹ ɫɟɝɦɟɧɬɚɰɢɢ ɞɚɧɧɵɯ, ɦɟɬɨɞ ɨɬɥɢɱɚɟɬɫɹ ɨɬ RLE ɥɢɲɶ ɬɟɦ, ɱɬɨ ɜɵɞɟɥɹɟɬ ɢɡ ɩɨɬɨɤɚ (ɢɥɢ ɛɥɨɤɚ) ɧɟ ɬɨɥɶɤɨ ɰɟɩɨɱɤɢ ɨɞɢɧɚɤɨɜɵɯ ɷɥɟɦɟɧɬɨɜ, ɧɨ ɢ ɜɨɨɛɳɟ ɨɬɞɟɥɹɟɬ ɞɪɭɝ ɨɬ ɞɪɭɝɚ ɮɪɚɝɦɟɧɬɵ ɫ ɪɚɡɧɵɦɢ ɪɚɫɩɪɟɞɟɥɟɧɢɹɦɢ ɜɟɪɨɹɬɧɨɫɬɟɣ ɡɧɚɱɟɧɢɣ ɷɥɟɦɟɧɬɨɜ.
1)
2)
3)
4)
ɂɡ ɤɪɚɬɤɨɝɨ ɨɩɢɫɚɧɢɹ ɨɛɳɟɣ ɢɞɟɢ ɜɢɞɧɨ, ɱɬɨ ɩɨɪɨɠɞɚɟɬɫɹ ɥɢɛɨ ɜɬɨɪɨɣ ɩɨɬɨɤ ɫ ɞɥɢɧɚɦɢ ɮɪɚɝɦɟɧɬɨɜ, ɥɢɛɨ ɜ ɢɫɯɨɞɧɵɣ ɩɨɬɨɤ ɞɨɛɚɜɥɹɸɬɫɹ ɮɥɚɝɢ ɝɪɚɧɢɰ (ɮɥɚɝ ɦɨɠɟɬ ɨɬɜɟɱɚɬɶ ɭɫɥɨɜɢɸ ɧɟ ɬɨɥɶɤɨ ɧɚ ɡɧɚɱɟɧɢɟ ɨɞɧɨɝɨ ɷɥɟɦɟɧɬɚ, ɧɨ ɢ ɭɫɥɨɜɢɸ ɧɚ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɧɟɫɤɨɥɶɤɢɯ ɷɥɟɦɟɧɬɨɜ); ɡɚɞɚɜɚɟɦɵɦɢ ɩɚɪɚɦɟɬɪɚɦɢ ɦɨɝɭɬ ɛɵɬɶ (ɦɚɤɫɢɦɚɥɶɧɚɹ) ɞɥɢɧɚ ɨɤɧɚ Z, Fmin — ɦɢɧɢɦɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ FO(X), ɦɢɧɢɦɚɥɶɧɨɟ ɪɚɫɫɬɨɹɧɢɟ ɦɟɠɞɭ ɝɪɚɧɢɰɚɦɢ Rmin (ɚ ɜ ɫɥɭɱɚɟ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɹ ɛɥɨɤɚ ɡɚɞɚɧɧɨɣ ɞɥɢɧɵ — ɟɳɟ ɢ ɱɢɫɥɨ ɝɪɚɧɢɰ NG, ɦɢɧɢɦɚɥɶɧɨɟ ɢ/ɢɥɢ ɦɚɤɫɢɦɚɥɶɧɨɟ ɱɢɫɥɨ ɝɪɚɧɢɰ: Nmin, Nmax); ɜɵɱɢɫɥɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ ɩɪɢ ɧɟɫɤɨɥɶɤɢɯ ɞɥɢɧɚɯ ɨɤɨɧ — Z1 , Z2 , … , Zn — ɜ ɨɛɳɟɦ ɫɥɭɱɚɟ ɭɥɭɱɲɢɬ ɤɚɱɟɫɬɜɨ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɹ; ɭɦɟɧɶɲɟɧɢɟ ɜɟɫɚ ɷɥɟɦɟɧɬɨɜ ɨɤɧɚ ɫ ɭɞɚɥɟɧɢɟɦ ɨɬ ɬɨɱɤɢ X ɬɚɤɠɟ ɜ ɨɛɳɟɦ ɫɥɭɱɚɟ ɭɥɭɱɲɢɬ ɤɚɱɟɫɬɜɨ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɹ.
ɈɋɇɈȼɇɈɃ ȺɅȽɈɊɂɌɆ ɉɊȿɈȻɊȺɁɈȼȺɇɂə
Ʉɚɤɨɜ ɛɵ ɧɢ ɛɵɥ ɪɚɡɦɟɪ ɨɤɨɧ Z, ɩɪɢ ɩɪɨɯɨɞɟ ɩɨ ɜɯɨɞɧɵɦ ɞɚɧɧɵɦ In[N] ɜ ɤɚɠɞɨɣ ɬɨɱɤɟ X ɩɪɢ ɩɟɪɟɯɨɞɟ ɤ ɫɥɟɞɭɸɳɟɣ ɬɨɱɤɟ (X+1) ɞɨɫɬɚɬɨɱɧɨ ɫɥɟɞɢɬɶ ɡɚ ɬɪɟɦɹ ɷɥɟɦɟɧɬɚɦɢ: ɜɵɲɟɞɲɢɦ ɢɡ ɥɟɜɨɝɨ ɨɤɧɚ (ɢɡ-ɡɚ ɫɞɜɢɝɚ ɬɨɱɤɢ X ɜɩɪɚɜɨ), ɜɨɲɟɞɲɢɦ ɜ ɩɪɚɜɨɟ ɨɤɧɨ, ɢ ɩɟɪɟɲɟɞɲɢɦ ɢɡ ɩɪɚɜɨɝɨ ɨɤɧɚ ɜ ɥɟɜɨɟ. ɇɨ ɫɧɚɱɚɥɚ ɪɚɡɛɟɪɟɦ ɫɚɦɵɣ ɩɨɧɹɬɧɵɣ ɚɥɝɨɪɢɬɦ: ɫ ɩɪɨɯɨɞɨɦ ɩɨ ɜɫɟɦ ɷɥɟɦɟɧɬɚɦ ɨɤɨɧ ɞɥɹ ɤɚɠɞɨɣ ɬɨɱɤɢ X. #define Z 32 for( i=0; i
//ɢɧɢɰɢɚɥɢɡɚɰɢɹ
//ɰɢɤɥ ɩɨ ɞɥɢɧɟ ɨɤɨɧ:
(1) (2)
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 279 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
i=In[x]; //ɜɨɡɶɦɟɦ ɨɱɟɪɟɞɧɨɣ ɷɥɟɦɟɧɬ ɥɟɜɨɝɨ ɨɤɧɚ In[x] CountLeft[i]++; //ɜ ɥɟɜɨɦ ɨɤɧɟ ɷɥɟɦɟɧɬɨɜ ɧɚ 1 ɛɨɥɶɲɟ i=In[x+Z]; //ɢ ɚɧɚɥɨɝɢɱɧɨ ɫ ɩɪɚɜɵɦ ɨɤɧɨɦ CountRight[i]++; }
In[N] — ɜɯɨɞɧɨɣ ɮɪɚɝɦɟɧɬɢɪɭɟɦɵɣ ɛɥɨɤ; N — ɤɨɥɢɱɟɫɬɜɨ ɛɚɣɬɨɜ ɜɨ ɜɯɨɞɧɨɦ ɛɥɨɤɟ; n=2R — ɤɚɠɞɵɣ ɛɚɣɬ ɦɨɠɟɬ ɢɦɟɬɶ 2R ɡɧɚɱɟɧɢɣ; FO[N–2·Z] — ɡɧɚɱɟɧɢɹ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ; CountLeft[n] — ɱɚɫɬɨɬɵ ɷɥɟɦɟɧɬɨɜ ɜ ɥɟɜɨɦ ɨɤɧɟ; CountRight[n] — ɱɚɫɬɨɬɵ ɷɥɟɦɟɧɬɨɜ ɜ ɩɪɚɜɨɦ ɨɤɧɟ. ɉɨɫɥɟ ɞɜɭɯ ɰɢɤɥɨɜ, ɢɧɢɰɢɚɥɢɡɢɪɭɸɳɢɯ ɨɛɚ ɨɤɧɚ, ɧɚɱɢɧɚɟɦ ɩɪɨɯɨɞ ɩɨ ɜɯɨɞɧɨɦɭ ɛɥɨɤɭ. ɂɡɧɚɱɚɥɶɧɨ ɥɟɜɚɹ ɝɪɚɧɢɰɚ ɥɟɜɨɝɨ ɨɤɧɚ ɫɨɜɩɚɞɚɟɬ ɫ ɧɚɱɚɥɨɦ ɞɚɧɧɵɯ. for(x=Z; xCountRight[i]) f+=CountLeft[i]-CountRight[i]; else f+=CountRight[i]-CountLeft[i]; */ FO[x]=f; //ɢ ɡɚɩɢɲɟɦ ɜ ɦɚɫɫɢɜ for(i=0;i
ɇɚɤɨɧɟɰ, ɩɨɫɥɟɞɧɢɣ ɰɢɤɥ — ɷɬɨ ɥɢɛɨ ɫɨɪɬɢɪɨɜɤɚ FO[N] ɫ ɰɟɥɶɸ ɧɚɯɨɠɞɟɧɢɹ ɡɚɞɚɧɧɨɝɨ ɱɢɫɥɚ ɦɚɤɫɢɦɚɥɶɧɵɯ ɡɧɚɱɟɧɢɣ (ɡɚɞɚɧɧɨɝɨ ɱɢɫɥɚ ɫɚɦɵɯ «ɱɟɬɤɢɯ» ɝɪɚɧɢɰ), ɥɢɛɨ ɩɪɨɫɬɨ ɧɚɯɨɠ280 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɞɟɧɢɟ ɬɚɤɢɯ FO[k], ɡɧɚɱɟɧɢɟ ɤɨɬɨɪɵɯ ɛɨɥɶɲɟ ɡɚɞɚɧɧɨɝɨ. ɉɨɫɥɟɞɧɟɟ ɦɨɠɧɨ ɞɟɥɚɬɶ ɜ ɨɫɧɨɜɧɨɦ ɰɢɤɥɟ.
ɍɩɪɚɠɧɟɧɢɟ: ȼɧɟɫɢɬɟ ɧɟɨɛɯɨɞɢɦɵɟ ɢɡɦɟɧɟɧɢɹ ɜ (3), ɟɫɥɢ ɡɚɞɚɧɨ ɦɢɧɢɦɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ ɨɬɥɢɱɢɹ Fmin.
ɉɍɌɂ ɍɅɍɑɒȿɇɂə ɋɄɈɊɈɋɌɂ
ȿɫɥɢ ɩɨɫɥɟɞɧɢɟ ɞɜɚ ɰɢɤɥɚ ɜɧɭɬɪɢ (3) ɩɟɪɟɧɟɫɬɢ ɢ ɜɵɩɨɥɧɹɬɶ ɢɯ ɞɨ ɩɟɪɜɨɝɨ, ɜɵɱɢɫɥɹɸɳɟɝɨ FO, ɬɨ (1) ɢ (2) ɧɟ ɧɭɠɧɵ. ɇɨ ɩɨɫɤɨɥɶɤɭ ɜɧɭɬɪɢ ɰɢɤɥɚ-ɩɪɨɯɨɞɚ (3) ɩɨ In ɞɨɫɬɚɬɨɱɧɨ ɫɥɟɞɢɬɶ ɡɚ ɬɪɟɦɹ ɷɥɟɦɟɧɬɚɦɢ, ɜ ɧɟɦ ɜɨɨɛɳɟ ɧɟ ɛɭɞɟɬ ɜɧɭɬɪɟɧɧɢɯ ɰɢɤɥɨɜ. ɉɨɫɥɟ ɜɵɩɨɥɧɟɧɢɹ (1) ɢ (2) ɩɨɫɬɭɩɢɦ ɬɚɤ: f=0; //ɢɫɯɨɞɧɨɟ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ for( i=0; i
Ⱥ ɜɧɭɬɪɢ ɨɫɧɨɜɧɨɝɨ ɰɢɤɥɚ, ɩɪɨɯɨɞɹɳɟɝɨ ɩɨ ɜɯɨɞɧɨɦɭ ɛɥɨɤɭ In[N]: for(x=Z; x
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 281 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
i=In[x]; //ɷɥɟɦɟɧɬ, ɩɟɪɟɲɟɞɲɢɣ ɢɡ ɩɪɚɜɨɝɨ ɨɤɧɚ ɜ ɥɟɜɨɟ f-=abs(CountLeft[i]-CountRight[i]); //ɬɟɩɟɪɶ ɜ ɥɟɜɨɦ ɨɤɧɟ ɬɚɤɢɯ ɧɚ 1 ɛɨɥɶɲɟ: CountLeft[i]++; CountRight[i]--; //ɚ ɜ ɩɪɚɜɨɦ - ɧɚ 1 ɦɟɧɶɲɟ f+=abs(CountLeft[i]-CountRight[i]); FO[x]=f; //ɡɚɩɢɲɟɦ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ ɜ ɦɚɫɫɢɜ }
ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤ ɢɡɦɟɧɢɬɫɹ ɡɧɚɱɟɧɢɟ f, ɟɫɥɢ ɜɫɟ ɬɪɢ ɷɥɟɦɟɧɬɚ — ɨɞɢɧɚɤɨɜɵ, ɩɪɢɱɟɦ ɜ ɥɟɜɨɦ ɨɤɧɟ ɬɚɤɢɯ ɛɵɥɨ 7, ɚ ɜ ɩɪɚɜɨɦ 8?
ȿɫɥɢ Z ɫɭɳɟɫɬɜɟɧɧɨ ɦɟɧɶɲɟ n, ɜɦɟɫɬɨ (2a) ɥɭɱɲɟ ɞɟɥɚɬɶ ɞɪɭɝɨɣ ɰɢɤɥ, ɞɨ 2*Z. ȼɧɭɬɪɢ ɧɟɝɨ ɛɭɞɟɬ ɩɪɢɛɚɜɥɟɧɢɟ ɦɨɞɭɥɹ ɪɚɡɧɨɫɬɢ ɞɥɹ ɬɟɤɭɳɟɝɨ ɷɥɟɦɟɧɬɚ ɤ ɫɭɦɦɟ, ɟɫɥɢ ɷɬɨɬ ɦɨɞɭɥɶ ɟɳɟ ɧɟ ɜɨɲɟɥ ɜ ɫɭɦɦɭ, ɢ ɩɪɨɰɟɞɭɪɚ, ɡɚɩɨɦɢɧɚɸɳɚɹ ɤɚɤɢɟ ɷɥɟɦɟɧɬɵ ɭɠɟ ɜɨɲɥɢ ɜ ɫɭɦɦɭ: f=0; // ɢɫɯɨɞɧɨɟ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ stacksize=0; // ɢ ɪɚɡɦɟɪɚ ɫɬɟɤɚ for (x=0; x<2*Z; x++) (2z) { i=In[x]; // ɬɟɤɭɳɢɣ ɷɥɟɦɟɧɬ s=0; // ɩɪɨɫɦɨɬɪɢɦ ɜɫɟ ɭɠɟ ɨɛɪɚɛɨɬɚɧɧɵɟ: while(s<stacksize) if (Stack[s]==i) goto NEXT // ɟɫɥɢ ɷɥɟɦɟɧɬ ɟɳɟ ɧɟ ɜɨɲɟɥ f+= abs(CountLeft[i]-CountRight[i]); Stack[stacksize++]=i; // ɬɨ ɜɧɨɫɢɦ ɫɟɣɱɚɫ NEXT: } FO[0]=f; // ɡɚɩɢɲɟɦ ɜ ɦɚɫɫɢɜ
Ɍɨɱɧɨ ɬɚɤ ɠɟ ɦɨɠɧɨ ɦɨɞɢɮɢɰɢɪɨɜɚɬɶ ɩɟɪɜɵɣ ɰɢɤɥ ɜɧɭɬɪɢ (3), ɜɵɱɢɫɥɹɸɳɢɣ FO: ɜɦɟɫɬɨ ɧɟɝɨ ɛɭɞɟɬ (2z), ɬ.ɟ. ɰɢɤɥ ɧɟ ɞɨ n, ɚ ɞɨ 2·Z. 282 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɑɬɨɛɵ ɢɡɛɚɜɢɬɶɫɹ ɨɬ ɜɬɨɪɨɝɨ ɰɢɤɥɚ ɞɨ n ɜɧɭɬɪɢ (3), ɡɚɜɟɞɟɦ ɞɜɚ ɦɚɫɫɢɜɚ ɫ ɮɥɚɝɚɦɢ FlagLeft ɢ FlagRight, ɩɚɪɚɥɥɟɥɶɧɵɟ CountLeft ɢ CountRight. ȼ ɧɢɯ ɛɭɞɟɦ ɡɚɩɢɫɵɜɚɬɶ, ɜ ɤɚɤɨɣ ɩɨɡɢɰɢɢ x ɞɟɥɚɥɚɫɶ ɡɚɩɢɫɶ ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɭɸ ɩɨɡɢɰɢɸ ɦɚɫɫɢɜɚ Count. ɉɪɢ ɱɬɟɧɢɢ ɠɟ ɢɡ Count ɛɭɞɟɦ ɱɢɬɚɬɶ ɢ ɢɡ Flag. ȿɫɥɢ ɡɧɚɱɟɧɢɟ ɜ Flag ɦɟɧɶɲɟ ɬɟɤɭɳɟɝɨ x, ɬɨ ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɹɱɟɣɤɟ ɦɚɫɫɢɜɚ Count ɞɨɥɠɟɧ ɛɵɬɶ ɧɨɥɶ.
ɍɩɪɚɠɧɟɧɢɟ: ɉɟɪɟɩɢɲɢɬɟ (3) ɬɚɤ, ɱɬɨɛɵ ɧɟ ɛɵɥɨ ɰɢɤɥɨɜ ɞɨ n.
ɉɍɌɂ ɍɅɍɑɒȿɇɂə ɋɀȺɌɂə
Ɉɛɳɢɣ ɫɥɭɱɚɣ ɋɚɦɵɣ ɜɵɝɨɞɧɵɣ ɩɭɬɶ — ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɨɤɧɚ ɫ ɭɛɵɜɚɧɢɟɦ ɜɟɫɚ ɷɥɟɦɟɧɬɨɜ ɩɪɢ ɭɞɚɥɟɧɢɢ ɨɬ ɬɨɱɤɢ X. Ʌɢɧɟɣɧɨɟ ɭɛɵɜɚɧɢɟ, ɧɚɩɪɢɦɟɪ: ɜɟɫ ɞɜɭɯ ɷɥɟɦɟɧɬɨɜ, ɦɟɠɞɭ ɤɨɬɨɪɵɦɢ ɥɟɠɢɬ ɬɨɱɤɚ X, ɪɚɜɟɧ Z, ɜɟɫ ɞɜɭɯ ɫɥɟɞɭɸɳɢɯ, ɧɚ ɪɚɫɫɬɨɹɧɢɢ 1 ɨɬ X, ɪɚɜɟɧ Z-1, ɢ ɬɚɤ ɞɚɥɟɟ, (Z-d) ɭ ɷɥɟɦɟɧɬɨɜ ɧɚ ɪɚɫɫɬɨɹɧɢɢ d, ɧɨɥɶ ɭ ɷɥɟɦɟɧɬɚ, ɬɨɥɶɤɨ ɱɬɨ ɜɵɲɟɞɲɟɝɨ ɢɡ ɥɟɜɨɝɨ ɨɤɧɚ, ɢ ɭ ɷɥɟɦɟɧɬɚ, ɤɨɬɨɪɵɣ ɜɨɣɞɟɬ ɜ ɩɪɚɜɨɟ ɨɤɧɨ ɧɚ ɫɥɟɞɭɸɳɟɦ ɲɚɝɟ. ȼɧɭɬɪɢ ɨɫɧɨɜɧɨɝɨ ɰɢɤɥɚ ɛɭɞɟɬ ɰɢɤɥ ɥɢɛɨ ɞɨ Z — ɩɨ ɞɥɢɧɟ ɨɤɧɚ, ɥɢɛɨ ɞɨ n — ɩɨ ɜɫɟɦ ɜɨɡɦɨɠɧɵɦ ɡɧɚɱɟɧɢɹɦ ɷɥɟɦɟɧɬɨɜ. ȼ ɡɚɜɢɫɢɦɨɫɬɢ ɨɬ ɡɧɚɱɟɧɢɣ Z ɢ n, ɨɞɢɧ ɢɡ ɷɬɢɯ ɞɜɭɯ ɜɚɪɢɚɧɬɨɜ ɦɨɠɟɬ ɨɤɚɡɚɬɶɫɹ ɫɭɳɟɫɬɜɟɧɧɨ ɷɮɮɟɤɬɢɜɧɟɟ ɞɪɭɝɨɝɨ. ȼ ɩɟɪɜɨɦ ɫɥɭɱɚɟ — Z ɫɭɳɟɫɬɜɟɧɧɨ ɦɟɧɶɲɟ n, ɜɵɝɨɞɧɟɟ ɰɢɤɥ ɞɨ Z — ɜɦɟɫɬɨ ɢɧɤɪɟɦɟɧɬɢɪɨɜɚɧɢɹ ɛɭɞɟɦ ɞɨɛɚɜɥɹɬɶ ɜɟɫɚ, ɬɨ ɟɫɬɶ ɪɚɫɫɬɨɹɧɢɹ ɨɬ X ɞɨ ɞɚɥɶɧɟɣ ɝɪɚɧɢɰɵ (ɫɚɦɨɣ ɥɟɜɨɣ ɜ ɫɥɭɱɚɟ ɥɟɜɨɝɨ ɨɤɧɚ, ɫɚɦɨɣ ɩɪɚɜɨɣ ɜ ɫɥɭɱɚɟ ɩɪɚɜɨɝɨ): for( x=0; x
(2`)
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 283 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
// CountRight[In[x+Z]]++; //ɚ ɬɟɩɟɪɶ: ɩɪɢɛɚɜɥɹɟɦ // ɪɚɫɫɬɨɹɧɢɟ ɨɬ ɥɟɜɨɣ ɝɪɚɧɢɰɵ ɞɨ x: CountLeft[In[x]]+=x+1; CountRight[In[x+Z]]+=Z-x;// ɨɬ x+Z ɞɨ ɩɪɚɜɨɣ ɝɪɚɧɢɰɵ: // 2*Z-(x+Z) }
ɂ ɚɧɚɥɨɝɢɱɧɵɟ ɦɨɞɢɮɢɤɚɰɢɢ ɜ ɰɢɤɥɟ (3). ȼɨ ɜɬɨɪɨɦ ɫɥɭɱɚɟ — n ɫɭɳɟɫɬɜɟɧɧɨ ɦɟɧɶɲɟ Z, ɜɵɝɨɞɧɟɟ ɰɢɤɥ ɞɨ n — ɪɟɚɥɢɡɚɰɢɹ ɝɨɪɚɡɞɨ ɫɥɨɠɧɟɟ: ɜ ɞɨɩɨɥɧɟɧɢɟ ɤ ɦɚɫɫɢɜɭ ɫɨ ɫɱɟɬɱɢɤɚɦɢ ɩɨɹɜɥɹɟɬɫɹ ɜɬɨɪɨɣ ɦɚɫɫɢɜ ɫ ɜɟɫɚɦɢ. Ɂɚɬɨ ɫɨɯɪɚɧɹɟɬɫɹ ɜɨɡɦɨɠɧɨɫɬɶ ɞɟɣɫɬɜɨɜɚɬɶ ɬɚɤ, ɤɚɤ ɜ (3a), ɧɟ ɞɟɥɚɹ ɰɢɤɥɚ ɩɨ ɞɥɢɧɟ ɨɤɧɚ Z ɜɧɭɬɪɢ ɨɫɧɨɜɧɨɝɨ ɰɢɤɥɚ: for(x=Z;x
284 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
// ɷɥɟɦɟɧɬ, ɩɟɪɟɲɟɞɲɢɣ ɢɡ ɩɪɚɜɨɝɨ ɨɤɧɚ ɜ ɥɟɜɨɟ: i=In[x]; f-=abs(WeightLeft[i]-WeightRight[i]); // ɫɭɦɦɚ ɛɟɡ 1 ɫɥɚɝɚɟɦɨɝɨ // ɬɟɩɟɪɶ ɜ ɥɟɜɨɦ ɨɤɧɟ ɬɚɤɢɯ ɧɚ 1 ɛɨɥɶɲɟ: CountLeft[i]++; WeightLeft[i]+=Z; // ɜɟɫ ɢɯ ɧɚ Z ɛɨɥɶɲɟ CountRight[i]--; // ɚ ɜ ɩɪɚɜɨɦ - ɧɚ 1 ɦɟɧɶɲɟ WeightRight[i]-=Z; // ɜɟɫ ɢɯ ɧɚ Z ɦɟɧɶɲɟ // ɨɛɪɚɬɧɨ ɤ ɩɨɥɧɨɣ ɫɭɦɦɟ f+=abs(WeightLeft[i]-WeightRight[i]); FO[x]=f; // ɡɚɩɢɲɟɦ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ ɜ ɦɚɫɫɢɜ }
ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤ ɛɭɞɭɬ ɜɵɝɥɹɞɟɬɶ ɰɢɤɥɵ (1) ɢ (2) ?
ȼɬɨɪɨɣ ɩɭɬɶ ɭɥɭɱɲɟɧɢɹ ɤɚɱɟɫɬɜɚ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɹ — ɧɚɯɨɞɢɬɶ ɦɚɤɫɢɦɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ ɩɪɢ ɧɟɫɤɨɥɶɤɢɯ ɞɥɢɧɚɯ ɨɤɧɚ: Z1, Z2, … , Zq . Ɍɨɝɞɚ ɷɬɢ ɜɵɱɢɫɥɹɟɦɵɟ ɡɧɚɱɟɧɢɹ FOi ɩɪɢɞɟɬɫɹ ɞɟɥɢɬɶ ɧɚ ɞɥɢɧɭ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɝɨ ɨɤɧɚ Zi, ɩɪɢ ɤɨɬɨɪɨɦ ɷɬɨ FOi ɜɵɱɢɫɥɟɧɨ. ɂ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨ ɭɦɧɨɠɚɬɶ ɧɚ 2K, ɱɬɨɛɵ ɩɨɥɭɱɚɥɢɫɶ ɜɟɥɢɱɢɧɵ ɧɟ ɨɬ 0 ɞɨ 2, ɚ ɨɬ 0 ɞɨ 2K+1. Ɍɪɟɬɢɣ ɩɭɬɶ — ɩɟɪɢɨɞɢɱɟɫɤɨɟ (ɱɟɪɟɡ ɤɚɠɞɵɟ Y ɬɨɱɟɤ) ɧɚɯɨɠɞɟɧɢɟ ɨɩɬɢɦɚɥɶɧɨɣ ɞɥɢɧɵ ɨɤɧɚ Z0. ɑɟɬɜɟɪɬɵɣ — ɚɧɚɥɢɡ ɦɚɫɫɢɜɚ FO, ɩɨɫɥɟ ɬɨɝɨ ɤɚɤ ɨɧ ɩɨɥɧɨɫɬɶɸ ɡɚɩɨɥɧɟɧ. ɉɹɬɵɣ — ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɢ ɞɪɭɝɢɯ ɤɪɢɬɟɪɢɟɜ ɩɪɢ ɜɵɱɢɫɥɟɧɢɢ FO(X): ɧɚɩɪɢɦɟɪ, ɧɟ Σ| CountLeft[V] – CountRight[V] | , ɚ Σ(CountLeft[V] – CountRight[V])2.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 285 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
D-ɦɟɪɧɵɣ ɫɥɭɱɚɣ ȼ ɞɜɭɦɟɪɧɨɦ ɫɥɭɱɚɟ ɩɨɹɜɥɹɟɬɫɹ ɜɨɡɦɨɠɧɨɫɬɶ ɫɥɟɞɢɬɶ ɡɚ ɢɡɦɟɧɟɧɢɟɦ ɯɚɪɚɤɬɟɪɢɫɬɢɤ ɷɥɟɦɟɧɬɨɜ ɩɪɢ ɩɟɪɟɦɟɳɟɧɢɢ ɱɟɪɟɡ ɬɨɱɤɭ X ɩɨ K ɪɚɡɧɵɦ ɩɪɹɦɵɦ. ȼ ɩɪɨɫɬɟɣɲɟɦ ɜɚɪɢɚɧɬɟ — ɩɨ ɞɜɭɦ ɩɟɪɩɟɧɞɢɤɭɥɹɪɧɵɦ: ɝɨɪɢɡɨɧɬɚɥɶɧɨɣ ɢ ɜɟɪɬɢɤɚɥɶɧɨɣ. Ⱥɥɝɨɪɢɬɦ ɦɨɠɟɬ ɜɵɝɥɹɞɟɬɶ, ɧɚɩɪɢɦɟɪ, ɬɚɤ: ɫɧɚɱɚɥɚ ɩɪɨɯɨɞɢɦ ɩɨ ɫɬɪɨɤɚɦ ɢ ɡɚɩɨɥɧɹɟɦ ɦɚɫɫɢɜ FO ɡɧɚɱɟɧɢɹɦɢ ɮɭɧɤɰɢɢ ɨɬɥɢɱɢɹ ɩɪɢ ɝɨɪɢɡɨɧɬɚɥɶɧɨɦ ɩɪɨɯɨɞɟ: FO[X]=FOȽɈɊ(X). Ɂɚɬɟɦ ɢɞɟɦ ɩɨ ɫɬɨɥɛɰɚɦ, ɜɵɱɢɫɥɹɹ ɨɬɥɢɱɢɹ ɩɪɢ ɜɟɪɬɢɤɚɥɶɧɨɦ ɩɪɨɯɨɞɟ FOȼȿɊ(X) ɢ ɡɚɩɢɫɵɜɚɹ ɜ ɦɚɫɫɢɜ ɦɚɤɫɢɦɚɥɶɧɨɟ ɢɡ ɷɬɢɯ ɞɜɭɯ ɡɧɚɱɟɧɢɣ — FOȽɈɊ(X) ɢ FOȼȿɊ(X). Ⱦɚɥɶɲɟ ɦɨɠɧɨ ɬɚɤɢɦ ɠɟ ɨɛɪɚɡɨɦ ɞɨɛɚɜɢɬɶ FO ɩɪɢ ɞɜɭɯ ɞɢɚɝɨɧɚɥɶɧɵɯ ɩɪɨɯɨɞɚɯ (ɫɦ. ɪɢɫ. 6.2), ɩɪɢɱɟɦ ɧɟ ɞɥɹ ɤɚɠɞɨɣ ɬɨɱɤɢ, ɚ ɜ ɨɤɪɟɫɬɧɨɫɬɹɯ ɬɨɱɟɤ ɫ ɦɚɤɫɢɦɭɦɚɦɢ FO[X]. 3
2 3 2 1 1 X 4 2 4 2
4 4 1 1 3 3
Ɋɢɫ. 6.2. ɂɥɥɸɫɬɪɚɰɢɹ ɞɜɭɦɟɪɧɨɝɨ ɫɥɭɱɚɹ ɫ K=4 Ʉɪɨɦɟ ɬɨɝɨ, ɟɫɥɢ ɯɜɚɬɚɟɬ ɪɟɫɭɪɫɨɜ, ɦɨɠɧɨ ɪɚɫɫɦɚɬɪɢɜɚɬɶ ɨɬɥɢɱɢɟ ɧɟ ɨɬɪɟɡɤɨɜ ɞɥɢɧɨɣ Z, ɨɬɦɟɱɟɧɧɵɯ ɧɚ K ɩɪɹɦɵɯ, ɚ ɫɟɤɬɨɪɨɜ ɤɪɭɝɚ ɪɚɞɢɭɫɚ Z, ɪɚɡɛɢɬɨɝɨ ɧɚ K ɫɟɤɬɨɪɨɜ. ɗɬɨ ɦɨɝɭɬ ɛɵɬɶ, ɧɚɩɪɢɦɟɪ, ɞɜɟ ɩɨɥɨɜɢɧɵ ɤɪɭɝɚ, ɢɥɢ ɠɟ ɱɟɬɵɪɟ ɱɟɬɜɟɪɬɢɧɤɢ ɤɪɭɝɚ. Ɍɟɩɟɪɶ ɦɨɠɧɨ ɜɚɪɶɢɪɨɜɚɬɶ ɧɟ ɬɨɥɶɤɨ Z, ɩɵɬɚɹɫɶ ɧɚɣɬɢ ɨɩɬɢɦɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ, ɧɨ ɬɚɤɠɟ ɢ K. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɛɭɞɭɬ ɧɚɣɞɟɧɵ «ɤɨɧɬɭɪɵ» — ɝɪɚɧɢɰɵ, ɨɬɞɟɥɹɸɳɢɟ ɨɛɥɚɫɬɢ ɫ ɪɚɡɧɵɦɢ ɯɚɪɚɤɬɟɪɢɫɬɢɤɚɦɢ ɫɨɜɨɤɭɩɧɨɫɬɢ ɫɨɞɟɪɠɚɳɢɯɫɹ ɜ ɷɬɢɯ ɨɛɥɚɫɬɹɯ ɷɥɟɦɟɧɬɨɜ. ȼ ɬɪɟɯɦɟɪɧɨɦ ɫɥɭɱɚɟ: ɥɢɛɨ ɢɫɩɨɥɶɡɭɟɦ Kɉ ɩɪɹɦɵɯ, ɥɢɛɨ KɄ ɫɟɤɬɨɪɨɜ ɤɪɭɝɚ, ɥɢɛɨ Kɋ ɫɟɤɬɨɪɨɜ ɫɮɟɪɵ. ɉɪɢɱɟɦ ɨɩɬɢɦɚɥɶɧɵɟ 286 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
(ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɜɵɱɢɫɥɟɧɢɹ) ɡɧɚɱɟɧɢɹ Kɉ — ɧɟ 2, 4, 8…, ɤɚɤ ɜ ɞɜɭɦɟɪɧɨɦ, ɚ 3, 7, 13…
ɍɩɪɚɠɧɟɧɢɟ: ɇɚɪɢɫɭɣɬɟ ɷɬɢ ɜɚɪɢɚɧɬɵ ɫ ɬɪɟɦɹ ɩɪɹɦɵɦɢ, ɫɟɦɶɸ ɢ ɬɪɢɧɚɞɰɚɬɶɸ. Ʉɚɤ ɩɪɨɞɨɥɠɢɬɶ ɩɪɨɰɟɫɫ ɞɚɥɶɲɟ?
ɋɨɜɟɪɲɟɧɧɨ ɚɧɚɥɨɝɢɱɧɨ ɢ ɜ D-ɦɟɪɧɨɦ ɫɥɭɱɚɟ.
ɏɚɪɚɤɬɟɪɢɫɬɢɤɢ ɦɟɬɨɞɚ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɹ: ɋɬɟɩɟɧɶ ɫɠɚɬɢɹ: ɭɜɟɥɢɱɢɜɚɟɬɫɹ ɜ 1.0 ... 1.2 ɪɚɡɚ. Ɍɢɩɵ ɞɚɧɧɵɯ: ɧɟɨɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ, ɨɫɨɛɟɧɧɨ ɫ ɬɨɱɧɵɦɢ ɝɪɚɧɢɰɚɦɢ ɮɪɚɝɦɟɧɬɨɜ. ɋɢɦɦɟɬɪɢɱɧɨɫɬɶ ɩɨ ɫɤɨɪɨɫɬɢ: ɛɨɥɟɟ ɱɟɦ 10:1. ɏɚɪɚɤɬɟɪɧɵɟ ɨɫɨɛɟɧɧɨɫɬɢ: ɦɨɠɟɬ ɩɪɢɦɟɧɹɬɶɫɹ ɧɟ ɬɨɥɶɤɨ ɞɥɹ ɫɠɚɬɢɹ ɞɚɧɧɵɯ, ɧɨ ɢ ɞɥɹ ɚɧɚɥɢɡɚ ɢɯ ɫɬɪɭɤɬɭɪɵ.
Ƚɥɚɜɚ 7. ɉɪɟɞɜɚɪɢɬɟɥɶɧɚɹ ɨɛɪɚɛɨɬɤɚ ɞɚɧɧɵɯ ɉɪɟɞɜɚɪɢɬɟɥɶɧɚɹ ɨɛɪɚɛɨɬɤɚ ɞɚɧɧɵɯ ɜɵɩɨɥɧɹɟɬɫɹ ɞɨ ɢɯ ɫɠɚɬɢɹ ɤɚɤ ɬɚɤɨɜɨɝɨ ɢ ɩɪɢɡɜɚɧɚ ɭɥɭɱɲɢɬɶ ɤɨɷɮɮɢɰɢɟɧɬ ɫɠɚɬɢɹ. ɋɯɟɦɚ ɤɨɞɢɪɨɜɚɧɢɹ ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɩɪɢɨɛɪɟɬɚɟɬ ɜɢɞ: ɢɫɯɨɞɧɵɟ ɞɚɧɧɵɟ Æ ɩɪɟɩɪɨɰɟɫɫɨɪ Æ ɤɨɞɟɪ Æ ɫɠɚɬɵɟ ɞɚɧɧɵɟ,
ɚ ɫɯɟɦɚ ɞɟɤɨɞɢɪɨɜɚɧɢɹ: ɫɠɚɬɵɟ ɞɚɧɧɵɟ Æ ɞɟɤɨɞɟɪ Æ ɩɨɫɬɩɪɨɰɟɫɫɨɪ Æ ɜɨɫɫɬɚɧɨɜɥɟɧɧɵɟ ɞɚɧɧɵɟ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 287 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɪɟɩɪɨɰɟɫɫɨɪ ɞɨɥɠɟɧ ɬɚɤ ɜɢɞɨɢɡɦɟɧɢɬɶ ɜɯɨɞɧɨɣ ɩɨɬɨɤ, ɱɬɨɛɵ ɤɨɷɮɮɢɰɢɟɧɬ ɫɠɚɬɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɞɚɧɧɵɯ ɛɵɥ ɜ ɫɪɟɞɧɟɦ ɥɭɱɲɟ ɤɨɷɮɮɢɰɢɟɧɬɚ ɫɠɚɬɢɹ ɢɫɯɨɞɧɵɯ, «ɫɵɪɵɯ» ɞɚɧɧɵɯ. ɋɢɫɬɟɦɚ ɩɪɟɩɪɨɰɟɫɫɨɪ-ɩɨɫɬɩɪɨɰɟɫɫɨɪ ɪɚɛɨɬɚɟɬ ɚɜɬɨɧɨɦɧɨ; ɤɨɞɟɪ «ɧɟ ɡɧɚɟɬ», ɱɬɨ ɨɧ ɫɠɢɦɚɟɬ ɭɠɟ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɟ ɞɚɧɧɵɟ. ɉɨɫɬɩɪɨɰɟɫɫɨɪ ɜɨɫɫɬɚɧɚɜɥɢɜɚɟɬ ɢɫɯɨɞɧɵɟ ɞɚɧɧɵɟ ɛɟɡ ɩɨɬɟɪɶ ɢɧɮɨɪɦɚɰɢɢ, ɩɨɷɬɨɦɭ ɪɟɡɭɥɶɬɚɬɵ ɪɚɛɨɬɵ ɢ ɫɚɦɨ ɫɭɳɟɫɬɜɨɜɚɧɢɟ ɫɢɫɬɟɦɵ ɩɪɟɩɪɨɰɟɫɫɨɪ-ɩɨɫɬɩɪɨɰɟɫɫɨɪ ɦɨɝɭɬ ɛɵɬɶ ɧɟ ɡɚɦɟɬɧɵ ɞɥɹ ɜɧɟɲɧɟɝɨ ɧɚɛɥɸɞɚɬɟɥɹ. ȼ ɨɛɳɟɦ ɫɥɭɱɚɟ, ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɜɵɩɨɥɧɹɟɦɵɟ ɩɪɟɩɪɨɰɟɫɫɨɪɨɦ, ɦɨɝɭɬ ɛɵɬɶ ɪɟɚɥɢɡɨɜɚɧɵ ɜ ɤɨɞɟɪɟ ɢ ɩɪɢ ɷɬɨɦ ɛɵɬɶ ɬɚɤɢɦɢ ɠɟ ɷɮɮɟɤɬɢɜɧɵɦɢ ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɭɥɭɱɲɟɧɢɹ ɫɠɚɬɢɹ. ɇɨ ɩɪɟɞɜɚɪɢɬɟɥɶɧɚɹ ɨɛɪɚɛɨɬɤɚ ɩɨɡɜɨɥɹɟɬ ɫɭɳɟɫɬɜɟɧɧɨ ɭɩɪɨɫɬɢɬɶ ɚɥɝɨɪɢɬɦ ɪɚɛɨɬɵ ɤɨɞɟɪɚ ɢ ɞɟɤɨɞɟɪɚ, ɞɚɟɬ ɜɨɡɦɨɠɧɨɫɬɶ ɫɨɡɞɚɧɢɹ ɞɨɫɬɚɬɨɱɧɨ ɝɢɛɤɨɣ ɫɩɟɰɢɚɥɢɡɢɪɨɜɚɧɧɨɣ ɫɢɫɬɟɦɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ ɨɩɪɟɞɟɥɟɧɧɨɝɨ ɬɢɩɚ ɧɚ ɨɫɧɨɜɟ ɭɧɢɜɟɪɫɚɥɶɧɵɯ ɚɥɝɨɪɢɬɦɨɜ. Ɇɨɞɭɥɢ «ɩɪɟɩɪɨɰɟɫɫɨɪ-ɩɨɫɬɩɪɨɰɟɫɫɨɪ» ɨɛɵɱɧɨ ɦɨɠɧɨ ɩɪɢɦɟɧɹɬɶ ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɪɚɡɥɢɱɧɵɦɢ ɤɨɞɟɪɚɦɢ ɢ ɚɪɯɢɜɚɬɨɪɚɦɢ, ɩɨɜɵɲɚɹ ɢɯ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɢ, ɜɨɡɦɨɠɧɨ, ɫɤɨɪɨɫɬɶ ɪɚɛɨɬɵ. ȼ ɷɬɨɣ ɝɥɚɜɟ ɪɚɫɫɦɨɬɪɟɧɨ ɧɟɫɤɨɥɶɤɨ ɫɩɨɫɨɛɨɜ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ ɬɢɩɢɱɧɵɯ ɞɚɧɧɵɯ. ɉɪɟɞɩɨɥɚɝɚɟɬɫɹ, ɱɬɨ ɚɥɝɨɪɢɬɦ ɫɠɚɬɢɹ ɩɪɟɞɧɚɡɧɚɱɟɧ ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ɢɫɬɨɱɧɢɤɨɜ ɫ ɩɚɦɹɬɶɸ. Ɉɩɢɫɵɜɚɟɦɵɟ ɦɟɬɨɞɵ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɞɨɫɬɚɬɨɱɧɨ ɯɨɪɨɲɨ ɢɡɜɟɫɬɧɵ ɜ ɤɪɭɝɭ ɪɚɡɪɚɛɨɬɱɢɤɨɜ ɩɪɨɝɪɚɦɦ ɫɠɚɬɢɹ, ɧɨ ɧɟ ɩɨɥɭɱɢɥɢ ɲɢɪɨɤɨɝɨ ɨɫɜɟɳɟɧɢɹ ɜ ɥɢɬɟɪɚɬɭɪɟ.
ɉɪɟɩɪɨɰɟɫɫɢɧɝ ɬɟɤɫɬɨɜ ȼ ɩɨɫɥɟɞɧɢɟ ɧɟɫɤɨɥɶɤɨ ɥɟɬ ɩɪɢɨɛɪɟɥɢ ɩɨɩɭɥɹɪɧɨɫɬɶ ɢ ɛɵɥɢ ɫɭɳɟɫɬɜɟɧɧɨ ɪɚɡɜɢɬɵ ɦɟɬɨɞɵ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ ɬɟɤɫɬɨɜɨɣ ɢɧɮɨɪɦɚɰɢɢ. ȼ ɧɚɫɬɨɹɳɟɟ ɜɪɟɦɹ ɫɩɟɰɢɚɥɢɡɢɪɨɜɚɧɧɵɣ ɩɪɟɩɪɨɰɟɫɫɢɧɝ ɬɟɤɫɬɨɜ, ɩɨɡɜɨɥɹɸɳɢɣ ɡɚɦɟɬɧɨ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ, ɢɫɩɨɥɶɡɭɟɬɫɹ ɜ ɬɚɤɢɯ ɚɪɯɢɜɚɬɨɪɚɯ ɤɚɤ ARHANGEL, JAR, RK, SBC, UHARC, ɜ ɤɨɦɩɪɟɫɫɨɪɚɯ DC, PPMN.
288 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɂɋɉɈɅɖɁɈȼȺɇɂȿ ɋɅɈȼȺɊȿɃ
ɂɞɟɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɞɚɧɧɵɯ ɫ ɩɨɦɨɳɶɸ ɫɥɨɜɚɪɹ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɡɚɦɟɧɟ ɤɚɤɢɯ-ɬɨ ɫɬɪɨɤ ɬɟɤɫɬɚ ɧɚ ɤɨɞɵ ɮɪɚɡ ɫɥɨɜɚɪɹ, ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɯ ɷɬɢɦ ɫɬɪɨɤɚɦ. ɑɚɫɬɨ ɭɤɚɡɵɜɚɟɬɫɹ ɩɪɨɫɬɨ ɧɨɦɟɪ ɮɪɚɡɵ ɜ ɫɥɨɜɚɪɟ. ɉɨɠɚɥɭɣ, ɦɟɬɨɞ ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɵ ɹɜɥɹɟɬɫɹ ɫɚɦɵɦ ɫɬɚɪɵɦ ɢ ɢɡɜɟɫɬɧɵɦ ɫɪɟɞɢ ɬɟɯɧɢɤ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɬɟɤɫɬɨɜ, ɞɚ ɢ ɥɸɛɵɯ ɞɚɧɧɵɯ ɜɨɨɛɳɟ. ɋɚɦɚ ɫɥɨɜɚɪɧɚɹ ɡɚɦɟɧɚ ɦɨɠɟɬ ɩɪɢɜɨɞɢɬɶ ɤɚɤ ɫɠɚɬɢɸ ɩɪɟɞɫɬɚɜɥɟɧɢɹ ɢɧɮɨɪɦɚɰɢɢ, ɬɚɤ ɢ ɤ ɪɚɫɲɢɪɟɧɢɸ. Ƚɥɚɜɧɨɟ, ɱɬɨɛɵ ɩɪɢ ɷɬɨɦ ɞɨɫɬɢɝɚɥɚɫɶ ɰɟɥɶ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ — ɢɡɦɟɧɟɧɢɟ ɫɬɪɭɤɬɭɪɵ ɞɚɧɧɵɯ, ɩɨɡɜɨɥɹɸɳɟɟ ɩɨɜɵɫɢɬɶ ɷɮɮɟɤɬɢɜɧɨɫɬɶ ɩɨɫɥɟɞɭɸɳɟɝɨ ɫɠɚɬɢɹ. Ɇɨɠɧɨ ɜɵɞɟɥɢɬɶ ɧɟɫɤɨɥɶɤɨ ɫɬɪɚɬɟɝɢɣ ɩɨɫɬɪɨɟɧɢɹ ɫɥɨɜɚɪɹ. ɉɨ ɫɩɨɫɨɛɭ ɩɨɫɬɪɨɟɧɢɹ ɫɥɨɜɚɪɢ ɛɵɜɚɸɬ: • ɫɬɚɬɢɱɟɫɤɢɦɢ, ɬ.ɟ. ɡɚɪɚɧɟɟ ɩɨɫɬɪɨɟɧɧɵɦɢ ɢ ɩɨɥɧɨɫɬɶɸ ɢɡɜɟɫɬɧɵɦɢ ɤɚɤ ɩɪɟɩɪɨɰɟɫɫɨɪɭ, ɬɚɤ ɢ ɩɨɫɬɩɪɨɰɟɫɫɨɪɭ; • ɩɨɥɭɚɞɚɩɬɢɜɧɵɦɢ, ɤɨɝɞɚ ɫɥɨɜɚɪɶ ɜɵɛɢɪɚɟɬɫɹ ɢɡ ɧɟɫɤɨɥɶɤɢɯ ɡɚɪɚɧɟɟ ɫɤɨɧɫɬɪɭɢɪɨɜɚɧɧɵɯ ɢ ɢɡɜɟɫɬɧɵɯ ɩɪɟɩɪɨɰɟɫɫɨɪɭ ɢ ɩɨɫɬɩɪɨɰɟɫɫɨɪɭ ɢɥɢ ɞɨɫɬɪɚɢɜɚɟɬɫɹ, ɩɪɢ ɷɬɨɦ ɨɞɢɧ ɢɡ ɢɦɟɸɳɢɯɫɹ ɫɥɨɜɚɪɟɣ ɛɟɪɟɬɫɹ ɡɚ ɨɫɧɨɜɭ; • ɚɞɚɩɬɢɜɧɵɦɢ, ɬ.ɟ. ɰɟɥɢɤɨɦ ɫɨɡɞɚɜɚɟɦɵɦɢ ɫɩɟɰɢɚɥɶɧɨ ɞɥɹ ɫɠɢɦɚɟɦɨɝɨ ɮɚɣɥɚ (ɛɥɨɤɚ) ɞɚɧɧɵɯ ɧɚ ɨɫɧɨɜɚɧɢɢ ɟɝɨ ɚɧɚɥɢɡɚ. ȼ ɤɚɱɟɫɬɜɟ ɮɪɚɡ ɨɛɵɱɧɨ ɢɫɩɨɥɶɡɭɸɬɫɹ [4]: • ɰɟɥɵɟ ɫɥɨɜɚ; • ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɢɡ ɞɜɭɯ ɫɢɦɜɨɥɨɜ (ɛɢɝɪɚɮɵ); • ɩɚɪɵ ɛɭɤɜ, ɮɨɧɟɬɢɱɟɫɤɢ ɷɤɜɢɜɚɥɟɧɬɧɵɯ ɨɞɧɨɦɭ ɡɜɭɤɭ; • ɩɚɪɵ ɛɭɤɜ ɫɨɝɥɚɫɧɚɹ-ɝɥɚɫɧɚɹ ɢɥɢ ɝɥɚɫɧɚɹ-ɫɨɝɥɚɫɧɚɹ; • ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɢɡ n ɫɢɦɜɨɥɨɜ (n-ɝɪɚɮɵ). Ʉɚɤ ɩɪɚɜɢɥɨ, ɫɭɳɟɫɬɜɭɟɬ ɨɝɪɨɦɧɨɟ ɤɨɥɢɱɟɫɬɜɨ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ, ɤɨɬɨɪɵɟ ɜ ɩɪɢɧɰɢɩɟ ɦɨɝɭɬ ɫɬɚɬɶ ɮɪɚɡɚɦɢ, ɩɨɷɬɨɦɭ ɧɟɨɛɯɨɞɢɦɨ ɩɪɢɦɟɧɹɬɶ ɤɚɤɢɟ-ɬɨ ɤɪɢɬɟɪɢɢ ɨɬɛɨɪɚ. Ɉɛɵɱɧɨ ɜ ɫɥɨɜɚɪɶ ɞɨɛɚɜɥɹɸɬɫɹ: • ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ, ɱɚɳɟ ɜɫɟɝɨ ɜɫɬɪɟɱɚɸɳɢɟɫɹ ɜ ɫɠɢɦɚɟɦɨɦ ɬɟɤɫɬɟ ɢɥɢ ɜ ɬɟɤɫɬɚɯ ɨɩɪɟɞɟɥɟɧɧɨɝɨ ɤɥɚɫɫɚ; Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 289 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
• ɨɞɧɢ ɢɡ ɫɚɦɵɯ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɵɯ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ, ɭɞɨɜɥɟɬɜɨɪɹɸɳɢɟ ɧɟɤɨɬɨɪɵɦ ɨɝɪɚɧɢɱɟɧɢɹɦ; • ɫɥɨɜɚ, ɛɟɡ ɤɨɬɨɪɵɯ ɟɞɜɚ ɥɢ ɫɦɨɠɟɬ ɩɨɥɭɱɢɬɶɫɹ ɫɜɹɡɧɵɣ ɬɟɤɫɬ: ɩɪɟɞɥɨɝɢ, ɦɟɫɬɨɢɦɟɧɢɹ, ɫɨɸɡɵ, ɚɪɬɢɤɥɢ ɢ ɬ.ɩ. ɋɥɨɜɚɪɶ n-ɝɪɚɮɨɜ ɋɭɞɹ ɩɨ ɜɫɟɦɭ, ɧɚɢɛɨɥɶɲɟɟ ɪɚɫɩɪɨɫɬɪɚɧɟɧɢɟ ɜ ɫɨɜɪɟɦɟɧɧɵɯ ɚɪɯɢɜɚɬɨɪɚɯ ɢ ɤɨɦɩɪɟɫɫɨɪɚɯ ɩɨɥɭɱɢɥɚ ɫɬɪɚɬɟɝɢɹ ɫɬɚɬɢɱɟɫɤɨɝɨ ɫɥɨɜɚɪɹ, ɫɨɫɬɨɹɳɟɝɨ ɢɡ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɛɭɤɜ ɞɥɢɧɵ ɨɬ 2 ɞɨ ɧɟɛɨɥɶɲɨɝɨ ɱɢɫɥɚ n (ɨɛɵɱɧɨ 4…5). ȼ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ ɪɚɡɦɟɪ ɫɥɨɜɚɪɹ ɪɚɜɟɧ ɩɪɢɦɟɪɧɨ 100 ɬɚɤɢɦ ɮɪɚɡɚɦ. Ʉ ɞɨɫɬɨɢɧɫɬɜɚɦ ɞɚɧɧɨɝɨ ɬɢɩɚ ɫɥɨɜɚɪɹ ɦɨɠɧɨ ɨɬɧɟɫɬɢ: • ɦɚɥɵɣ ɪɚɡɦɟɪ; • ɨɬɫɭɬɫɬɜɢɟ ɠɟɫɬɤɨɣ ɩɪɢɜɹɡɤɢ ɤ ɨɩɪɟɞɟɥɟɧɧɨɦɭ ɹɡɵɤɭ; • ɨɛɟɫɩɟɱɟɧɢɟ ɫɭɳɟɫɬɜɟɧɧɨɝɨ ɩɪɢɪɨɫɬɚ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ; • ɩɪɨɫɬɨɬɚ ɪɟɚɥɢɡɚɰɢɢ. ɇɟɛɨɥɶɲɨɣ ɪɚɡɦɟɪ ɫɥɨɜɚɪɹ ɨɛɭɫɥɨɜɥɟɧ ɞɜɭɦɹ ɩɪɢɱɢɧɚɦɢ: • ɷɬɨ ɭɩɪɨɳɚɟɬ ɤɨɞɢɪɨɜɚɧɢɟ ɮɪɚɡ ɫɥɨɜɚɪɹ; • ɞɚɥɶɧɟɣɲɟɟ ɭɜɟɥɢɱɟɧɢɟ ɪɚɡɦɟɪɚ ɫɥɨɜɚɪɹ ɭɥɭɱɲɚɟɬ ɫɠɚɬɢɟ ɥɢɲɶ ɧɟɡɧɚɱɢɬɟɥɶɧɨ (ɫɩɪɚɜɟɞɥɢɜɨ ɞɥɹ BWT, ɢ, ɜ ɦɟɧɶɲɟɣ ɫɬɟɩɟɧɢ, LZ), ɥɢɛɨ ɞɚɠɟ ɜɪɟɞɢɬ ɜ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ (ɫɩɪɚɜɟɞɥɢɜɨ ɞɥɹ PPM). Ɉɛɵɱɧɨ ɬɟɤɫɬɵ ɩɪɟɞɫɬɚɜɥɟɧɵ ɜ ɮɨɪɦɚɬɟ «plain text», ɤɨɝɞɚ ɨɞɢɧ ɛɚɣɬ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɨɞɧɨɦɭ ɫɢɦɜɨɥɭ. Ɍɚɤ ɤɚɤ ɪɚɡɦɟɪ ɫɥɨɜɚɪɹ ɦɚɥ, ɬɨ ɜ ɤɚɱɟɫɬɜɟ ɢɧɞɟɤɫɚ ɮɪɚɡ ɜɵɫɬɭɩɚɸɬ ɧɟɢɫɩɨɥɶɡɭɟɦɵɟ, ɢɥɢ ɪɟɞɤɨ ɢɫɩɨɥɶɡɭɟɦɵɟ ɡɧɚɱɟɧɢɹ ɛɚɣɬɨɜ. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɨɛɪɚɛɚɬɵɜɚɟɬɫɹ ɬɟɤɫɬ ɧɚ ɚɧɝɥɢɣɫɤɨɦ ɹɡɵɤɟ, ɬɨ ɩɨɹɜɥɟɧɢɟ ɧɟ-ASCII ɛɚɣɬɨɜ ɫɨ ɡɧɚɱɟɧɢɟɦ 0x80 ɢ ɛɨɥɶɲɟ ɦɚɥɨɜɟɪɨɹɬɧɨ. ɉɨɷɬɨɦɭ ɦɵ ɦɨɠɟɦ ɡɚɦɟɫɬɢɬɶ ɜɫɟ ɛɢɝɪɚɮɵ “th” ɧɚ ɱɢɫɥɨ 0x80. ȿɫɥɢ ɛɚɣɬ 0x80 ɜɫɟ ɠɟ ɜɫɬɪɟɬɢɬɫɹ ɜ ɨɛɪɚɛɚɬɵɜɚɟɦɵɯ ɞɚɧɧɵɯ, ɬɨ ɨɧ ɦɨɠɟɬ ɛɵɬɶ ɩɟɪɟɞɚɧ ɤɚɤ ɩɚɪɚ (<ɮɥɚɝ ɢɫɤɥɸɱɟɧɢɹ>, <0x80>), ɝɞɟ ɮɥɚɝ ɢɫɤɥɸɱɟɧɢɹ ɦɨɠɟɬ ɛɵɬɶ ɪɚɜɟɧ, ɧɚɩɪɢɦɟɪ, 0xFF. ɗɬɨ ɨɛɟɫɩɟɱɢɜɚɟɬ ɨɞɧɨɡɧɚɱɧɨɫɬɶ ɜɨɫɫɬɚɧɨɜɥɟɧɢɹ ɬɟɤɫɬɚ ɩɨɫɬɩɪɨɰɟɫɫɨɪɨɦ.
290 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤɢɦ ɨɛɪɚɡɨɦ ɛɭɞɟɬ ɩɟɪɟɞɚɧ ɛɚɣɬ, ɪɚɜɧɵɣ ɫɚɦɨɦɭ ɮɥɚɝɭ ɢɫɤɥɸɱɟɧɢɹ? ɇɟɞɨɫɬɚɬɤɨɦ ɞɚɧɧɨɝɨ ɬɢɩɚ ɫɥɨɜɚɪɹ ɹɜɥɹɟɬɫɹ ɨɬɫɭɬɫɬɜɢɟ ɮɨɪɦɚɥɢɡɨɜɚɧɧɨɝɨ ɚɥɝɨɪɢɬɦɚ ɩɨɫɬɪɨɟɧɢɹ. Ʉɚɤ ɩɨɤɚɡɚɥɢ ɷɤɫɩɟɪɢɦɟɧɬɵ, ɞɨɛɚɜɥɟɧɢɟ ɜ ɫɥɨɜɚɪɶ ɫɚɦɵɯ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɵɯ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɛɭɤɜ ɧɟɛɨɥɶɲɨɣ ɞɥɢɧɵ ɞɟɣɫɬɜɢɬɟɥɶɧɨ ɭɥɭɱɲɚɟɬ ɫɠɚɬɢɟ, ɧɨ ɬɚɤɨɣ ɩɨɞɯɨɞ ɧɟ ɩɪɢɜɨɞɢɬ ɤ ɩɨɥɭɱɟɧɢɸ ɨɩɬɢɦɚɥɶɧɨɝɨ ɫɨɫɬɚɜɚ ɫɥɨɜɚɪɹ. ɉɨɷɬɨɦɭ ɩɨɫɬɪɨɟɧɢɟ ɫɥɨɜɚɪɹ ɞɟɥɚɟɬɫɹ ɜ ɩɨɥɭɚɜɬɨɦɚɬɢɱɟɫɤɨɦ ɪɟɠɢɦɟ, ɤɨɝɞɚ ɞɥɹ ɡɚɞɚɧɧɨɝɨ ɤɨɞɟɪɚ ɢ ɡɚɞɚɧɧɨɝɨ ɬɟɫɬɨɜɨɝɨ ɧɚɛɨɪɚ ɬɟɤɫɬɨɜ ɷɦɩɢɪɢɱɟɫɤɢ ɨɩɪɟɞɟɥɹɟɬɫɹ ɰɟɥɟɫɨɨɛɪɚɡɧɨɫɬɶ ɜɧɟɫɟɧɢɹ ɢɥɢ ɭɞɚɥɟɧɢɹ ɢɡ ɫɥɨɜɚɪɹ ɬɨɣ ɢɥɢ ɢɧɨɣ ɮɪɚɡɵ ɢɫɯɨɞɹ ɢɡ ɢɡɦɟɧɟɧɢɹ ɤɨɷɮɮɢɰɢɟɧɬɚ ɫɠɚɬɢɹ ɬɟɫɬɨɜɨɝɨ ɧɚɛɨɪɚ. ɇɚɩɪɢɦɟɪ, ɞɥɹ ɚɧɝɥɢɣɫɤɨɝɨ ɹɡɵɤɚ ɯɨɪɨɲɨ ɪɚɛɨɬɚɟɬ ɫɥɨɜɚɪɶ, ɩɪɟɞɫɬɚɜɥɟɧɧɵɣ ɜ ɬɚɛɥ. 7.1. ȼ ɧɟɝɨ ɜɯɨɞɹɬ 45 ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɞɥɢɧɵ 2 (ɛɢɝɪɚɮɨɜ), 25 ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɞɥɢɧɵ 3 (ɬɪɢɝɪɚɮɨɜ) ɢ 16 ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɞɥɢɧɵ 4 (ɬɟɬɪɚɝɪɚɮɨɜ). ɋɩɢɫɨɤ ɨɬɫɨɪɬɢɪɨɜɚɧ ɜ ɩɪɢɦɟɪɧɨɦ ɩɨɪɹɞɤɟ ɭɛɵɜɚɧɢɹ ɩɨɥɟɡɧɨɫɬɢ ɮɪɚɡ (ɜɧɭɬɪɢ ɤɚɠɞɨɣ ɝɪɭɩɩɵ n-ɝɪɚɮɨɜ — ɫɥɟɜɚ ɧɚɩɪɚɜɨ ɢ ɫɜɟɪɯɭ ɜɧɢɡ). Ɍɚɛɥɢɰɚ 7.1 Ȼɢɝɪɚɮɵ th er in ea or ll st gh ed ow ss ur id sa ic as ir ec ai ch ot ol to qu
ou is ee ld tr ul it
an on om at al ly av
en ar oo sh il et im
Ɍɪɢɝɪɚɮɵ the ing for ess was igh our ell had ich her out ead ard est ght ith
and ver ous een ugh his ome rom
Ɍɟɬɪɚɝɪɚɮɵ ight self ward this have been able nder ttle with ound reat that what from ther
ɉɪɢɦɟɪ ɋɬɪɨɤɚ he took his vorpal sword in hand ɛɭɞɟɬ ɩɪɟɨɛɪɚɡɨɜɚɧɚ ɜ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ: Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 291 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
he ok vp swd h ȼ ɭɝɥɨɜɵɯ ɫɤɨɛɤɚɯ ɩɨɤɚɡɚɧɵ n-ɝɪɚɮɵ, ɡɚɦɟɧɹɟɦɵɟ ɧɚ ɢɯ ɢɧɞɟɤɫ ɜ ɫɥɨɜɚɪɟ. ɋɧɚɱɚɥɚ ɨɬɨɛɪɚɠɚɸɬɫɹ ɬɟɬɪɚɝɪɚɮɵ (ɜ ɪɚɡɛɢɪɚɟɦɨɣ ɫɬɪɨɤɟ ɢɯ ɧɟɬ), ɡɚɬɟɦ ɬɪɢɝɪɚɮɵ, ɢ, ɜ ɫɚɦɭɸ ɩɨɫɥɟɞɧɸɸ ɨɱɟɪɟɞɶ, ɛɢɝɪɚɮɵ. Ɋɚɫɫɦɨɬɪɢɦ ɩɪɢɦɟɪ ɪɟɚɥɢɡɚɰɢɢ ɩɪɨɫɬɟɣɲɟɣ ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɵ ɞɥɹ ɚɧɝɥɢɣɫɤɢɯ ɬɟɤɫɬɨɜ. ɉɭɫɬɶ ɫɥɨɜɚɪɶ ɫɨɫɬɨɢɬ ɬɨɥɶɤɨ ɢɡ 10 ɛɢɝɪɚɮɨɜ, ɜ ɤɚɱɟɫɬɜɟ ɤɨɞɨɜ ɛɢɝɪɚɮɨɜ ɢɫɩɨɥɶɡɭɸɬɫɹ ɧɟ-ASCII ɛɚɣɬɵ ɫɨ ɡɧɚɱɟɧɢɹɦɢ 128…137, ɢɫɤɥɸɱɢɬɟɥɶɧɵɟ ɫɢɬɭɚɰɢɢ ɧɟ ɨɬɫɥɟɠɢɜɚɸɬɫɹ, ɬ.ɟ. ɩɪɟɞɩɨɥɚɝɚɟɬɫɹ, ɱɬɨ ɜɨ ɜɯɨɞɧɨɦ ɮɚɣɥɟ ɨɬɫɭɬɫɬɜɭɸɬ ɧɟ-ASCII ɫɢɦɜɨɥɵ. const int BIGRAPH_NUM = 10; const char blist [BIGRAPH_NUM][3] = { "th", "er", "in", "ou", "an", "en", "ea", "or", "ll", "is" }; /*ɩɪɟɞɩɨɥɚɝɚɟɦ, ɱɬɨ bnum — ɝɥɨɛɚɥɶɧɚɹ ɩɟɪɟɦɟɧɧɚɹ ɢ ɢɧɢɰɢɚɥɢɡɢɪɭɟɬɫɹ ɧɭɥɹɦɢ; ɜ ɷɬɨɦ ɦɚɫɫɢɜɟ ɛɭɞɟɦ ɯɪɚɧɢɬɶ ɤɨɞɵ ɛɢɝɪɚɮɨɜ */ unsigned char bnum [256][256]; int code = 128; for (int i = 0; i < BIGRAPH_NUM; i++){ //ɡɚɩɨɥɧɢɦ bnum bnum [ blist[i][0] ] [ blist[i][1] ] = code++; } int c1, c2; c1 = DataFile.ReadSymbol(); while ( c1 != EOF ) { c2 = DataFile.ReadSymbol(); if ( c2 == EOF ) { PreprocFile.WriteSymbol (c1); break; } if (bnum[c1][c2]){ //ɬɚɤɨɣ ɛɢɝɪɚɮ ɢɦɟɟɬɫɹ ɜ ɫɥɨɜɚɪɟ, ɩɪɨɢɡɜɟɞɟɦ ɡɚɦɟɧɭ PreprocFile.WriteSymbol (bnum[c1][c2]); c1 = DataFile.ReadSymbol(); }else{ PreprocFile.WriteSymbol (c1);
292 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
c1 = c2; } }
Ⱦɥɹ ɪɭɫɫɤɨɝɨ ɹɡɵɤɚ ɧɟɩɥɨɯɢɟ ɪɟɡɭɥɶɬɚɬɵ ɩɨɤɚɡɵɜɚɟɬ ɫɥɨɜɚɪɶ, ɨɩɢɫɚɧɧɵɣ ɜ ɬɚɛɥ. 7.2. Ɂɚɦɟɬɢɦ, ɱɬɨ ɫɥɨɜɚɪɶ ɞɥɹ ɪɭɫɫɤɢɯ ɬɟɤɫɬɨɜ ɢɦɟɟɬ ɦɟɧɶɲɢɣ ɪɚɡɦɟɪ, ɱɟɦ ɞɥɹ ɚɧɝɥɢɣɫɤɢɯ. Ɍɚɛɥɢɰɚ 7.2 Ȼɢɝɪɚɮɵ ɬɨ ɫɬ ɨɜ ɨɧ ɟɥ ɟɬ ɧɚ ɡɚ ɚɪ ɟɦ ɬɶ ɚɥ ɢɫ ɨɝ ɢɦ
ɟɧ ɚɦ ɢɤ ɚɬ ɟɝ
ɩɨ ɨɬ ɩɪ ɚɜ ɢɱ
ɚɡ ɨɦ ɟɜ ɫɹ ɫɶ
ɚɤ ɚɫ ɢɜ ɟɫ
ɟɪ ɚɧ ɢɬ ɨɛ
ɨɥ ɢɧ ɢɥ ɨɞ
ɨɪ ɫɤ ɟɞ ɨɫ
Ɍɪɢɝɪɚɮɵ ɫɬɜ ɛɵɥ ɩɪɢ ɩɪɨ ɟɪɟ ɨɝɨ ɨɫɬ ɢɫɶ ɟɧɧ ɜɟɬ
Ɍɟɬɪɚɝɪɚɮɵ ɥɶɤɨ ɜɪɟɦ ɬɨɛɵ ɨɝɞɚ ɚɡɚɥ ɨɥɶɲ ɟɪɟɞ ɨɬɨɪ
Ɂɚ ɫɱɟɬ ɨɩɢɫɚɧɧɨɣ ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɵ ɞɨɫɬɢɝɚɟɬɫɹ ɡɧɚɱɢɬɟɥɶɧɨɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ ɬɟɤɫɬɨɜ (ɫɦ. ɬɚɛɥ. 7.3). ȼ ɤɚɱɟɫɬɜɟ ɬɟɫɬɨɜɨɝɨ ɮɚɣɥɚ ɛɵɥ ɢɫɩɨɥɶɡɨɜɚɧ ɪɨɦɚɧ ɧɚ ɚɧɝɥɢɣɫɤɨɦ ɹɡɵɤɟ «Three men in a boat (to say nothing of the dog)» («Ɍɪɨɟ ɜ ɥɨɞɤɟ, ɧɟ ɫɱɢɬɚɹ ɫɨɛɚɤɢ»), ɷɥɟɤɬɪɨɧɧɵɣ ɜɚɪɢɚɧɬ ɤɨɬɨɪɨɝɨ ɡɚɧɢɦɚɥ ɨɤɨɥɨ 360 ɤɛɚɣɬ ɜ ɢɫɯɨɞɧɨɦ ɜɢɞɟ. Ɉɬɤɚɡ ɨɬ ɫɪɚɜɧɟɧɢɹ ɫ ɩɨɦɨɳɶɸ ɛɨɥɶɲɢɯ ɬɟɤɫɬɨɜɵɯ ɮɚɣɥɨɜ Book1 ɢ Book2, ɜɯɨɞɹɳɢɯ ɜ ɫɨɫɬɚɜ ɫɬɚɧɞɚɪɬɧɨɝɨ ɧɚɛɨɪɚ CalgCC, ɛɵɥ ɨɛɭɫɥɨɜɥɟɧ ɬɟɦ, ɱɬɨ ɨɧɢ ɹɜɥɹɸɬɫɹ ɧɟ ɜɩɨɥɧɟ ɬɢɩɢɱɧɵɦɢ ɬɟɤɫɬɚɦɢ. ɉɟɪɜɵɣ ɮɚɣɥ ɫɨɞɟɪɠɢɬ ɡɧɚɱɢɬɟɥɶɧɨɟ ɤɨɥɢɱɟɫɬɜɨ ɨɩɟɱɚɬɨɤ, ɚ ɜɬɨɪɨɣ — ɛɨɥɶɲɨɣ ɨɛɴɟɦ ɫɥɭɠɟɛɧɨɣ ɢɧɮɨɪɦɚɰɢɢ ɨ ɮɨɪɦɚɬɢɪɨɜɚɧɢɢ ɬɟɤɫɬɚ. Ɍɚɛɥɢɰɚ 7.3 Ⱥɪɯɢɜɚɬɨɪ Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ BWT LZ77 PPM
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɢɫɯɨɞɧɨɝɨ ɮɚɣɥɚ 109736 130174 108443
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɮɚɣɥɚ 107904 126026 106831
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ 1.7% 3.2% 1.5%
Ɂɚɦɟɬɢɦ, ɱɬɨ ɜ ɫɥɭɱɚɟ Bzip2 ɢ HA ɫɠɚɬɢɟ ɦɨɝɥɨ ɛɵɬɶ ɭɥɭɱɲɟɧɨ. ɋ ɨɞɧɨɣ ɫɬɨɪɨɧɵ, ɤɨɷɮɮɢɰɢɟɧɬ ɫɠɚɬɢɹ ɚɥɝɨɪɢɬɦɚ BWT ɡɚɜɢɫɢɬ ɨɬ ɧɨɦɟɪɨɜ ɫɢɦɜɨɥɨɜ ɜ ɚɥɮɚɜɢɬɟ, ɚ ɧɚɦɢ ɧɟ ɞɟɥɚɥɨɫɶ ɧɢɤɚɤɢɯ ɩɨɩɵɬɨɤ ɩɟɪɟɭɩɨɪɹɞɨɱɢɬɶ ɛɨɥɟɟ ɩɨɞɯɨɞɹɳɢɦ ɨɛɪɚɡɨɦ ASCII-ɫɢɦɜɨɥɵ ɢ ɧɨɦɟɪɚ ɞɨɛɚɜɥɟɧɧɵɯ ɧɚɦɢ ɮɪɚɡ. ɋ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, HA ɢɫɩɨɥɶɡɭɟɬ ɧɟɛɨɥɶɲɨɣ ɨɛɴɟɦ ɩɚɦɹɬɢ, ɢ ɱɚɫɬɶ ɧɚɤɚɩɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 293 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɥɢɜɚɟɦɨɣ ɜ PPM-ɦɨɞɟɥɢ ɫɬɚɬɢɫɬɢɤɢ ɩɟɪɢɨɞɢɱɟɫɤɢ ɜɵɛɪɚɫɵɜɚɟɬɫɹ, ɱɬɨ ɭɯɭɞɲɚɟɬ ɩɪɟɞɫɤɚɡɚɧɢɟ ɢ, ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ, ɫɠɚɬɢɟ. ɗɮɮɟɤɬɢɜɧɨɫɬɶ ɢɫɩɨɥɶɡɨɜɚɧɢɹ n-ɝɪɚɮɨɜɨɝɨ ɫɥɨɜɚɪɹ ɫ ɞɪɭɝɢɦ ɫɨɫɬɚɜɨɦ ɮɪɚɡ ɫɨɜɦɟɫɬɧɨ ɫ BWT ɚɪɯɢɜɚɬɨɪɚɦɢ ɨɰɟɧɟɧɚ ɜ [2]. Ɉɛɵɱɧɨ ɩɪɢɦɟɧɟɧɢɟ n-ɝɪɚɮɨɜɨɝɨ ɫɥɨɜɚɪɹ ɭɥɭɱɲɚɟɬ ɫɠɚɬɢɟ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ PPM ɢɥɢ BWT, ɧɚ 2%. ɋɬɟɩɟɧɶ ɫɠɚɬɢɹ ɤɨɦɩɪɟɫɫɨɪɨɜ ɧɚ ɛɚɡɟ ɦɟɬɨɞɨɜ Ɂɢɜɚ-Ʌɟɦɩɟɥɚ ɦɨɠɟɬ ɛɵɬɶ ɡɚɦɟɬɧɨ ɭɥɭɱɲɟɧɚ ɡɚ ɫɱɟɬ ɭɜɟɥɢɱɟɧɢɹ ɪɚɡɦɟɪɚ ɫɥɨɜɚɪɹ ɩɪɟɩɪɨɰɟɫɫɨɪɚ ɢ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɮɪɚɡ ɛɨɥɶɲɟɣ ɞɥɢɧɵ. ȼ ɩɪɢɧɰɢɩɟ, ɮɪɚɡɵ ɦɨɝɭɬ ɜɤɥɸɱɚɬɶ ɧɟ ɬɨɥɶɤɨ ɛɭɤɜɵ, ɧɨ ɢ ɩɪɨɛɟɥɵ, ɱɬɨ, ɤɫɬɚɬɢ, ɩɪɢɜɨɞɢɬ ɤ ɭɯɭɞɲɟɧɢɸ ɫɠɚɬɢɹ ɜ ɫɥɭɱɚɟ BWT ɢɥɢ PPM. ɋɥɨɜɚɪɶ LIPT ȼ ɤɚɱɟɫɬɜɟ ɩɪɢɦɟɪɚ ɫɥɨɜɚɪɹ, ɜ ɤɨɬɨɪɨɦ ɮɪɚɡɚɦɢ ɹɜɥɹɸɬɫɹ ɫɥɨɜɚ, ɪɚɫɫɦɨɬɪɢɦ ɫɯɟɦɭ Length Index Preserving Transformation (LIPT) — «ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɫ ɫɨɯɪɚɧɟɧɢɟɦ ɢɧɞɟɤɫɚ ɞɥɢɧɵ» [1]. ȼ ɫɥɨɜɚɪɶ ɜɤɥɸɱɚɸɬɫɹ ɫɚɦɵɟ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɵɟ ɫɥɨɜɚ, ɨɩɪɟɞɟɥɹɟɦɵɟ ɢɫɯɨɞɹ ɢɡ ɚɧɚɥɢɡɚ ɛɨɥɶɲɨɝɨ ɤɨɥɢɱɟɫɬɜɚ ɬɟɤɫɬɨɜ ɧɚ ɡɚɞɚɧɧɨɦ ɹɡɵɤɟ ɢ, ɜɨɡɦɨɠɧɨ, ɨɩɪɟɞɟɥɟɧɧɨɣ ɬɟɦɚɬɢɤɢ. ɉɨɞ ɫɥɨɜɨɦ ɡɞɟɫɶ ɩɨɧɢɦɚɟɬɫɹ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɛɭɤɜ, ɨɝɪɚɧɢɱɟɧɧɚɹ ɫ ɞɜɭɯ ɫɬɨɪɨɧ ɫɢɦɜɨɥɚɦɢ, ɧɟ ɹɜɥɹɸɳɢɦɢɫɹ ɛɭɤɜɚɦɢ («ɧɟ-ɛɭɤɜ»). ȼɟɫɶ ɫɥɨɜɚɪɶ ɞɟɥɢɬɫɹ ɧɚ ɱɚɫɬɢ (ɩɨɞɫɥɨɜɚɪɢ). ȼ ɡɚɜɢɫɢɦɨɫɬɢ ɨɬ ɫɜɨɟɣ ɞɥɢɧɵ Li ɫɥɨɜɨ ɩɨɩɚɞɚɟɬ ɜ ɱɚɫɬɶ ɫɥɨɜɚɪɹ ɫ ɧɨɦɟɪɨɦ i. ȼ ɩɪɟɞɟɥɚɯ ɩɨɞɫɥɨɜɚɪɹ ɮɪɚɡɵ ɨɬɫɨɪɬɢɪɨɜɚɧɵ ɜ ɩɨɪɹɞɤɟ ɭɛɵɜɚɧɢɹ ɱɚɫɬɨɬɵ, ɬ.ɟ. ɫɚɦɨɟ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɨɟ ɫɥɨɜɨ ɢɦɟɟɬ ɦɢɧɢɦɚɥɶɧɵɣ ɢɧɞɟɤɫ 0. Ʉɚɠɞɨɟ ɫɥɨɜɨ ɢɫɯɨɞɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ, ɤɨɬɨɪɨɦɭ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɤɚɤɚɹ-ɬɚ ɮɪɚɡɚ ɫɥɨɜɚɪɹ, ɤɨɞɢɪɭɟɬɫɹ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ: ɮɥɚɝ ɞɥɢɧɚ ɫɥɨɜɚ (ɧɨɦɟɪ ɩɨɞɫɥɨɜɚɪɹ) ɢɧɞɟɤɫ ɜ ɩɨɞɫɥɨɜɚɪɟ ȼ ɤɚɱɟɫɬɜɟ ɚɥɮɚɜɢɬɚ ɞɥɹ ɡɚɩɢɫɢ ɞɥɢɧɵ ɫɥɨɜɚ ɢ ɢɧɞɟɤɫɚ ɚɜɬɨɪɚɦɢ ɚɥɝɨɪɢɬɦɚ ɩɪɟɞɥɚɝɚɟɬɫɹ ɢɫɩɨɥɶɡɨɜɚɬɶ ɚɥɮɚɜɢɬ ɹɡɵɤɚ. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɦɵ ɪɚɛɨɬɚɟɦ ɫ ɚɧɝɥɢɣɫɤɢɦ ɹɡɵɤɨɦ, ɬɨ “a” ɫɨɨɬɜɟɬɫɬɜɭɟɬ 1, “b” — 2, …, “z” — 26, “A” — 27, …, “Z” — 52, ɢ, ɞɚɥɟɟ, “aa” — 53, “ab” — 54… ɇɭɥɟɜɨɣ ɢɧɞɟɤɫ ɹɜɧɵɦ ɨɛɪɚɡɨɦ 294 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɧɟ ɩɟɪɟɞɚɟɬɫɹ. ȿɫɥɢ, ɞɨɩɭɫɬɢɦ, ɫɥɨɜɨ “mere” ɢɦɟɟɬ ɢɧɞɟɤɫ 29 ɜ ɫɜɨɟɦ ɩɨɞɫɥɨɜɚɪɟ 4, ɬɨ ɨɧɨ ɛɭɞɟɦ ɩɪɟɨɛɪɚɡɨɜɚɧɨ ɬɚɤ (ɞɥɹ ɛɨɥɶɲɟɣ ɞɨɯɨɞɱɢɜɨɫɬɢ ɪɚɡɥɢɱɧɵɟ ɱɚɫɬɢ ɤɨɞɚ ɮɪɚɡɵ ɜɵɞɟɥɟɧɵ ɩɨɞɱɟɪɤɢɜɚɧɢɟɦ): “mere” Æ “<ɮɥɚɝ>_d_C”. ȿɫɥɢ ɢɧɞɟɤɫ ɪɚɜɟɧ 56, ɬɨ ɨɬɨɛɪɚɠɟɧɢɟ ɛɭɞɟɬ ɬɚɤɢɦ: “mere” Æ “<ɮɥɚɝ>_d_ad”. ɂɧɞɟɤɫ ɭɤɚɡɚɧ ɤɚɤ “ad”, ɩɨɫɤɨɥɶɤɭ ɨɧ ɡɚɩɢɫɵɜɚɟɬɫɹ ɜ ɩɨɡɢɰɢɨɧɧɨɣ ɫɢɫɬɟɦɟ ɫɱɢɫɥɟɧɢɹ, ɢ ɩɟɪɜɚɹ ɛɭɤɜɚ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɫɬɚɪɲɟɦɭ ɩɨɪɹɞɤɭ. Ʉɨɧɟɰ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ, ɩɟɪɟɞɚɸɳɟɣ ɢɧɞɟɤɫ, ɧɟɬ ɧɭɠɞɵ ɭɤɚɡɵɜɚɬɶ ɹɜɧɨ, ɩɨɫɤɨɥɶɤɭ, ɟɫɥɢ ɦɵ ɪɚɫɫɦɚɬɪɢɜɚɟɦ “mere” ɤɚɤ ɫɥɨɜɨ, ɬɨ ɨɧɨ ɞɨɥɠɧɨ ɨɝɪɚɧɢɱɢɜɚɬɶɫɹ ɤɚɤɨɣ-ɬɨ «ɧɟɛɭɤɜɨɣ», ɤɨɬɨɪɚɹ ɢ ɫɬɚɧɟɬ ɦɚɪɤɟɪɨɦ ɤɨɧɰɚ ɡɚɩɢɫɢ ɢɧɞɟɤɫɚ. ȿɫɥɢ ɫɥɨɜɨ ɨɬɫɭɬɫɬɜɭɟɬ ɜ ɫɥɨɜɚɪɟ, ɬɨ ɨɧɨ ɛɟɡ ɢɡɦɟɧɟɧɢɣ ɤɨɩɢɪɭɟɬɫɹ ɜ ɮɚɣɥ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɞɚɧɧɵɯ. ɗɤɫɩɟɪɢɦɟɧɬɵ ɩɨɤɚɡɵɜɚɸɬ, ɱɬɨ ɞɥɹ ɪɚɡɥɢɱɧɵɯ ɚɥɝɨɪɢɬɦɨɜ ɫɠɚɬɢɹ ɜɵɝɨɞɧɟɟ ɢɫɩɨɥɶɡɨɜɚɬɶ ɪɚɡɧɵɟ ɚɥɮɚɜɢɬɵ ɞɥɢɧɵ ɫɥɨɜɚ ɢ ɢɧɞɟɤɫɚ. Ɍɚɤɠɟ ɢɧɨɝɞɚ ɢɦɟɟɬ ɫɦɵɫɥ ɢɫɩɨɥɶɡɨɜɚɬɶ ɢɧɨɣ ɩɪɢɧɰɢɩ ɪɚɡɛɢɟɧɢɹ ɫɥɨɜɚɪɹ. Ɋɚɫɫɦɨɬɪɢɦ ɪɟɡɭɥɶɬɚɬɵ ɫɠɚɬɢɹ ɬɟɤɫɬɚ «Three men in a boat (to say nothing of the dog)» ɞɥɹ ɫɥɟɞɭɸɳɢɯ ɬɪɟɯ ɚɥɝɨɪɢɬɦɨɜ LIPT: 1. ɚɥɝɨɪɢɬɦ 1 — ɩɪɚɤɬɢɱɟɫɤɢ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɚɜɬɨɪɫɤɨɦɭ, ɧɨ ɚɥɮɚɜɢɬ ɨɝɪɚɧɢɱɟɧ ɬɨɥɶɤɨ ɫɬɪɨɱɧɵɦɢ ɚɧɝɥɢɣɫɤɢɦɢ ɛɭɤɜɚɦɢ; 2. ɚɥɝɨɪɢɬɦ 2 — ɚɥɮɚɜɢɬɵ ɞɥɢɧɵ ɫɥɨɜɚ ɢ ɢɧɞɟɤɫɚ ɨɬɥɢɱɚɸɬɫɹ ɨɬ ɚɥɮɚɜɢɬɚ ɛɭɤɜ ɢ ɧɟ ɩɟɪɟɫɟɤɚɸɬɫɹ ɦɟɠɞɭ ɫɨɛɨɣ; 3. ɚɥɝɨɪɢɬɦ 3 — ɫɥɨɜɚɪɶ ɪɚɡɛɢɜɚɟɬɫɹ ɧɚ ɩɨɞɫɥɨɜɚɪɢ ɧɟ ɬɨɥɶɤɨ ɩɨ ɤɪɢɬɟɪɢɸ ɞɥɢɧɵ ɮɪɚɡ, ɧɨ ɢ ɩɨ ɫɨɨɬɜɟɬɫɬɜɢɸ ɫɥɨɜɚ ɨɩɪɟɞɟɥɟɧɧɨɣ ɱɚɫɬɢ ɪɟɱɢ9; ɢɫɩɨɥɶɡɭɸɬɫɹ ɬɚɤɢɟ ɠɟ ɚɥɮɚɜɢɬɵ, ɱɬɨ ɢ ɜ ɚɥɝɨɪɢɬɦɟ 2.
9
ɗɬɚ ɦɨɞɢɮɢɤɚɰɢɹ LIPT ɪɚɡɪɚɛɨɬɚɧɚ ɢ ɪɟɚɥɢɡɨɜɚɧɚ Ɇ.Ⱥ.ɋɦɢɪɧɨɜɵɦ ɥɟɬɨɦ 2001 ɝɨɞɚ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 295 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɋɥɨɜɚɪɶ LIPT ɛɵɥ ɩɨɫɬɪɨɟɧ ɧɚ ɨɫɧɨɜɚɧɢɢ ɚɧɚɥɢɡɚ ɩɪɢɦɟɪɧɨ 50 Ɇɛɚɣɬ ɚɧɝɥɢɣɫɤɢɯ ɬɟɤɫɬɨɜ ɪɚɡɥɢɱɧɨɝɨ ɯɚɪɚɤɬɟɪɚ. Ɉɛɳɢɣ ɨɛɴɟɦ ɫɥɨɜɚɪɹ ɫɨɫɬɚɜɢɥ ɨɤɨɥɨ 53 ɬɵɫ. ɮɪɚɡ, ɢɥɢ 480 ɤɛɚɣɬ. Ⱦɥɹ ɪɟɚɥɢɡɚɰɢɢ ɚɥɝɨɪɢɬɦɚ 3 ɩɪɢɦɟɪɧɨ 11.6 ɬɵɫɹɱɚɦ ɫɥɨɜ ɛɵɥ ɩɪɢɫɜɨɟɧ ɚɬɪɢɛɭɬ ɩɪɢɧɚɞɥɟɠɧɨɫɬɢ ɤ ɨɩɪɟɞɟɥɟɧɧɨɣ ɱɚɫɬɢ ɪɟɱɢ, ɧɚɩɪɢɦɟɪ, «the» — ɚɪɬɢɤɥɶ ɢ ɬ.ɞ. Ʉɥɚɫɫɢɮɢɤɚɰɢɹ ɛɵɥɚ ɨɱɟɧɶ ɝɪɭɛɚ — ɢɫɩɨɥɶɡɨɜɚɥɨɫɶ ɜɫɟɝɨ ɥɢɲɶ 9 ɤɚɬɟɝɨɪɢɣ. ȿɫɥɢ ɫɥɨɜɨ ɦɨɝɥɨ ɨɬɧɨɫɢɬɶɫɹ ɤ ɧɟɫɤɨɥɶɤɢɦ ɱɚɫɬɹɦ ɪɟɱɢ, ɬɨ ɜɵɛɢɪɚɥɚɫɶ ɫɚɦɚɹ ɱɚɫɬɨ ɭɩɨɬɪɟɛɥɹɟɦɚɹ ɮɨɪɦɚ (ɩɨɧɹɬɧɨ, ɡɞɟɫɶ ɛɵɥ ɨɩɪɟɞɟɥɟɧɧɵɣ ɩɪɨɢɡɜɨɥ). ɋɥɨɜɚ, ɧɟ ɩɨɥɭɱɢɜɲɢɟ ɬɚɤɨɝɨ ɥɟɤɫɢɱɟɫɤɨɝɨ ɚɬɪɢɛɭɬɚ, ɬɪɚɤɬɨɜɚɥɢɫɶ ɤɚɤ ɫɭɳɟɫɬɜɢɬɟɥɶɧɵɟ. ɋɯɟɦɚ ɤɨɞɢɪɨɜɚɧɢɹ ɞɥɹ ɚɥɝɨɪɢɬɦɚ 3 ɢɦɟɥɚ ɜɢɞ: ɮɥɚɝ ɱɚɫɬɶ ɪɟɱɢ ɞɥɢɧɚ ɫɥɨɜɚ ɢɧɞɟɤɫ ɜ ɩɨɞɫɥɨɜɚɪɟ ɇɚɩɪɢɦɟɪ: “mere” Æ “<ɮɥɚɝ><ɩɪɢɥɚɝɚɬɟɥɶɧɨɟ><ɞɥɢɧɚ = 4><ɢɧɞɟɤɫ>”, ɝɞɟ ɢɧɞɟɤɫ ɨɩɪɟɞɟɥɹɟɬ ɩɨɥɨɠɟɧɢɟ ɮɪɚɡɵ ɜ ɩɨɞɫɥɨɜɚɪɟ 4ɛɭɤɜɟɧɧɵɯ ɩɪɢɥɚɝɚɬɟɥɶɧɵɯ. Ɋɟɡɭɥɶɬɚɬɵ ɷɤɫɩɟɪɢɦɟɧɬɚ ɩɪɢɜɟɞɟɧɵ ɜ ɬɚɛɥ. 7.4. Ɍɚɛɥɢɰɚ 7.4 Ⱥɪɯɢɜɚɬɨɪ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ BWT
Ⱥɥɝɨɪɢɬɦ LIPT 1 Ɋɚɡɦɟɪ ɍɥɭɱɚɪɯɢɜɚ ɲɟɧɢɟ ɫɠɚɬɢɹ 102797 6.3%
Ⱥɥɝɨɪɢɬɦ LIPT 2 Ɋɚɡɦɟɪ ɍɥɭɱɚɪɯɢɜɚ ɲɟɧɢɟ ɫɠɚɬɢɹ 100106 8.8%
Ⱥɥɝɨɪɢɬɦ LIPT 3 Ɋɚɡɦɟɪ ɍɥɭɱɚɪɯɢɜɚ ɲɟɧɢɟ ɫɠɚɬɢɹ 101397 7.6%
Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
LZ77
118647
8.9%
122118
6.2%
125725
3.4%
PPM
100342
7.5%
98838
8.9%
98173
9.5%
Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɞɥɹ LZ77 ɥɭɱɲɟ ɜɫɟɝɨ ɩɨɞɯɨɞɢɬ ɨɛɵɱɧɵɣ ɚɥɝɨɪɢɬɦ LIPT. Ɉɱɟɜɢɞɧɨ, ɱɬɨ LZ77 ɩɥɨɯɨ ɢɫɩɨɥɶɡɭɟɬ ɤɨɪɪɟɥɹɰɢɸ ɦɟɠɞɭ ɫɬɪɨɤɚɦɢ, ɢ ɨɫɧɨɜɧɨɣ ɜɵɢɝɪɵɲ ɞɨɫɬɢɝɚɟɬɫɹ ɡɚ ɫɱɟɬ ɭɦɟɧɶɲɟɧɢɹ ɞɥɢɧ ɫɨɜɩɚɞɟɧɢɹ ɢ ɜɟɥɢɱɢɧ ɫɦɟɳɟɧɢɣ. Ⱥɥɝɨɪɢɬɦ 2 ɦɨɠɧɨ ɩɪɢɡɧɚɬɶ ɤɨɦɩɪɨɦɢɫɫɧɵɦ ɜɚɪɢɚɧɬɨɦ. Ⱦɥɹ PPMɤɨɦɩɪɟɫɫɨɪɨɜ ɢɦɟɟɬ ɫɦɵɫɥ ɢɫɩɨɥɶɡɨɜɚɬɶ ɚɥɝɨɪɢɬɦ 3. 296 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɊȿɈȻɊȺɁɈȼȺɇɂȿ ɁȺȽɅȺȼɇɕɏ ȻɍɄȼ
Ɂɚɝɥɚɜɧɵɟ ɛɭɤɜɵ ɫɭɳɟɫɬɜɟɧɧɨ ɭɜɟɥɢɱɢɜɚɸɬ ɱɢɫɥɨ ɜɫɬɪɟɱɚɸɳɢɯɫɹ ɜ ɬɟɤɫɬɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɢ, ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ, ɩɪɢɜɨɞɹɬ ɤ ɭɯɭɞɲɟɧɢɸ ɫɠɚɬɢɹ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɬɟɦ ɫɥɭɱɚɟɦ, ɟɫɥɢ ɛɵ ɢɯ ɧɟ ɛɵɥɨ ɜɨɨɛɳɟ. ɋɩɨɫɨɛ ɱɚɫɬɢɱɧɨɝɨ ɭɫɬɪɚɧɟɧɢɹ ɷɬɨɝɨ ɧɟɩɪɢɹɬɧɨɝɨ ɹɜɥɟɧɢɹ ɨɱɟɜɢɞɟɧ. ȿɫɥɢ ɫɥɨɜɨ ɧɚɱɢɧɚɟɬɫɹ ɫ ɡɚɝɥɚɜɧɨɣ ɛɭɤɜɵ, ɬɨ ɛɭɞɟɦ ɩɪɟɨɛɪɚɡɨɜɵɜɚɬɶ ɟɝɨ ɬɚɤ, ɤɚɤ ɩɨɤɚɡɚɧɨ ɧɚ ɪɢɫ. 7.1 [2]. ɮɥɚɝ ɩɟɪɜɚɹ ɛɭɤɜɚ, ɩɪɟɨɛɪɚɡɨɜɚɧɧɚɹ ɨɫɬɚɜɲɚɹɫɹ ɱɚɫɬɶ ɜ ɫɬɪɨɱɧɭɸ ɫɥɨɜɚ Ɋɢɫ. 7.1. ɉɪɟɨɛɪɚɡɨɜɚɧɧɵɣ ɜɢɞ ɫɥɨɜɚ, ɧɚɱɢɧɚɜɲɟɝɨɫɹ ɫ ɡɚɝɥɚɜɧɨɣ ɛɭɤɜɵ ɉɪɢ ɷɬɨɦ ɩɨɞ ɫɥɨɜɨɦ ɩɨɧɢɦɚɟɬɫɹ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɛɭɤɜ, ɨɝɪɚɧɢɱɟɧɧɚɹ ɫ ɞɜɭɯ ɫɬɨɪɨɧ «ɧɟ-ɛɭɤɜɚɦɢ». ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɜ ɤɚɱɟɫɬɜɟ ɮɥɚɝɚ ɢɫɩɨɥɶɡɭɟɬɫɹ ɛɚɣɬ 0x00, ɬɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɦɨɠɟɬ ɢɦɟɬɶ ɜɢɞ: “_ȿɫɥɢ_” Æ “_<0x00>ɟɫɥɢ_” Ⱦɥɹ BWT- ɢ PPM-ɤɨɦɩɪɟɫɫɨɪɨɜ ɨɬɦɟɱɚɟɬɫɹ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ, ɟɫɥɢ ɩɨɫɥɟ ɮɥɚɝɚ ɜɫɬɚɜɥɹɟɬɫɹ ɩɪɨɛɟɥ, ɬ.ɟ. ɤɨɝɞɚ ɪɟɡɭɥɶɬɚɬ ɬɪɚɧɫɮɨɪɦɚɰɢɢ ɢɦɟɟɬ ɜɢɞ ɬɢɩɚ “_<0x00>_ɟɫɥɢ_”. ɇɟɜɵɝɨɞɧɨ ɩɪɟɨɛɪɚɡɨɜɵɜɚɬɶ ɫɥɨɜɚ, ɫɨɫɬɨɹɳɢɟ ɬɨɥɶɤɨ ɢɡ ɨɞɧɨɣ ɡɚɝɥɚɜɧɨɣ ɛɭɤɜɵ. ɂɧɨɝɞɚ ɜ ɬɟɤɫɬɚɯ ɜɫɬɪɟɱɚɟɬɫɹ ɦɧɨɝɨ ɫɥɨɜ, ɧɚɛɪɚɧɧɵɯ ɩɨɥɧɨɫɬɶɸ ɡɚɝɥɚɜɧɵɦɢ ɛɭɤɜɚɦɢ. Ɉɱɟɜɢɞɧɨ, ɱɬɨ ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɨɩɢɫɚɧɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɧɟ ɬɨɥɶɤɨ ɧɟ ɩɨɦɨɝɚɟɬ, ɧɨ ɢ, ɜɨɡɦɨɠɧɨ, ɞɚɠɟ ɜɪɟɞɢɬ. ɉɨɷɬɨɦɭ ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɢɫɩɨɥɶɡɨɜɚɬɶ ɟɳɟ ɨɞɧɨ ɨɬɨɛɪɚɠɟɧɢɟ, ɩɟɪɟɜɨɞɹɳɟɟ ɫɥɨɜɚ, ɫɨɫɬɨɹɳɢɟ ɰɟɥɢɤɨɦ ɢɡ ɡɚɝɥɚɜɧɵɯ ɛɭɤɜ, ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɫɥɨɜɚ ɢɡ ɫɬɪɨɱɧɵɯ ɛɭɤɜ (ɪɢɫ 7.2). ɮɥɚɝ 2 ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɛɭɤɜ ɫɥɨɜɚ, ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɜ ɫɬɪɨɱɧɵɟ Ɋɢɫ. 7.2. ɉɪɟɨɛɪɚɡɨɜɚɧɧɵɣ ɜɢɞ ɫɥɨɜɚ, ɰɟɥɢɤɨɦ ɫɨɫɬɨɹɜɲɟɝɨ ɢɡ ɡɚɝɥɚɜɧɵɯ ɛɭɤɜ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 297 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȿɫɥɢ ɜ ɪɨɥɢ ɮɥɚɝɚ 2 ɜɵɫɬɭɩɚɟɬ ɛɚɣɬ 0x01, ɬɨ ɫɩɪɚɜɟɞɥɢɜ ɬɚɤɨɣ ɩɪɢɦɟɪ ɨɬɨɛɪɚɠɟɧɢɹ: “_ȺɅȽɈɊɂɌɆɕ_” Æ “_<0x01>ɚɥɝɨɪɢɬɦɵ_”. Ʉɚɤ ɭɠɟ ɭɤɚɡɵɜɚɥɨɫɶ, ɞɨɛɚɜɥɟɧɢɟ ɩɪɨɛɟɥɚ ɩɨɫɥɟ ɮɥɚɝɨɜ ɭɥɭɱɲɚɟɬ ɫɠɚɬɢɟ BWT ɢ PPM ɤɨɦɩɪɟɫɫɨɪɨɜ. Ɇɨɠɟɬ ɩɨɤɚɡɚɬɶɫɹ, ɱɬɨ ɨɩɢɫɚɧɧɵɣ ɚɥɝɨɪɢɬɦ ɜɧɨɫɢɬ ɢɡɛɵɬɨɱɧɨɫɬɶ ɡɚ ɫɱɟɬ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɮɥɚɝɚ ɞɚɠɟ ɜ ɬɟɯ ɫɥɭɱɚɹɯ, ɤɨɝɞɚ ɜ ɧɟɦ ɧɟɬ ɨɫɨɛɨɣ ɧɟɨɛɯɨɞɢɦɨɫɬɢ. ȿɫɥɢ ɬɟɤɭɳɟɟ ɫɥɨɜɨ ɹɜɥɹɟɬɫɹ ɩɟɪɜɵɦ ɜɫɬɪɟɱɟɧɧɵɦ ɩɨɫɥɟ ɬɨɱɤɢ, ɜɨɫɤɥɢɰɚɬɟɥɶɧɨɝɨ ɢɥɢ ɜɨɩɪɨɫɢɬɟɥɶɧɨɝɨ ɡɧɚɤɚ, ɬɨ ɟɝɨ ɧɚɱɚɥɶɧɚɹ ɛɭɤɜɚ ɧɚɜɟɪɧɹɤɚ ɹɜɥɹɟɬɫɹ ɡɚɝɥɚɜɧɨɣ, ɢ ɮɥɚɝ ɢɡɥɢɲɟɧ. ȿɫɬɟɫɬɜɟɧɧɨ, ɞɥɹ ɨɛɟɫɩɟɱɟɧɢɹ ɩɪɚɜɢɥɶɧɨɫɬɢ ɞɟɤɨɞɢɪɨɜɚɧɢɹ ɧɟɨɛɯɨɞɢɦɨ ɥɢɛɨ: • ɨɫɨɛɨ ɨɛɪɚɛɚɬɵɜɚɬɶ ɫɢɬɭɚɰɢɢ, ɤɨɝɞɚ ɩɟɪɜɚɹ ɛɭɤɜɚ ɜɫɟɬɚɤɢ ɫɬɪɨɱɧɚɹ, ɧɚɩɪɢɦɟɪ, ɢɫɩɨɥɶɡɨɜɚɬɶ ɫɩɟɰɢɚɥɶɧɵɣ ɮɥɚɝ, ɫɢɝɧɚɥɢɡɢɪɭɸɳɢɣ ɨɛ ɢɫɤɥɸɱɟɧɢɢ; • ɞɟɥɚɬɶ ɤɨɦɩɟɧɫɢɪɭɸɳɟɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ, ɨɬɨɛɪɚɠɚɸɳɟɟ ɜɫɟ ɫɬɪɨɱɧɵɟ ɛɭɤɜɵ, ɜɫɬɪɟɱɚɟɦɵɟ ɩɨɫɥɟ ɡɧɚɤɨɜ ɤɨɧɰɚ ɩɪɟɞɥɨɠɟɧɢɹ, ɜ ɡɚɝɥɚɜɧɵɟ. ɇɟɫɦɨɬɪɹ ɧɚ ɤɚɠɭɳɭɸɫɹ ɷɮɮɟɤɬɢɜɧɨɫɬɶ, ɜ ɫɥɭɱɚɟ ɤɨɦɩɪɟɫɫɨɪɨɜ BWT ɢ PPM ɬɚɤɚɹ ɬɟɯɧɢɤɚ ɪɚɛɨɬɚɟɬ ɯɭɠɟ ɪɚɧɟɟ ɪɚɫɫɦɨɬɪɟɧɧɵɯ, ɩɨɫɤɨɥɶɤɭ ɧɚɪɭɲɚɟɬ ɪɟɝɭɥɹɪɧɨɫɬɶ ɜ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɮɥɚɝɨɜ ɢ ɢɫɤɚɠɚɟɬ ɤɨɧɬɟɤɫɬɧɨ-ɡɚɜɢɫɢɦɭɸ ɫɬɚɬɢɫɬɢɤɭ ɱɚɫɬɨɬ ɫɢɦɜɨɥɨɜ. ȿɫɥɢ ɠɟ ɧɟɨɛɯɨɞɢɦɨ ɪɚɡɪɚɛɨɬɚɬɶ ɩɪɟɩɪɨɰɟɫɫɨɪ ɬɟɤɫɬɨɜɵɯ ɞɚɧɧɵɯ ɢɫɤɥɸɱɢɬɟɥɶɧɨ ɞɥɹ LZ-ɚɪɯɢɜɚɬɨɪɨɜ, ɬɨ ɞɟɣɫɬɜɢɬɟɥɶɧɨ ɫɥɟɞɭɟɬ ɢɡɛɚɜɢɬɶɫɹ ɨɬ ɧɟɧɭɠɧɵɯ ɮɥɚɝɨɜ. ȼ ɬɚɛɥ. 7.5 ɨɩɢɫɵɜɚɟɬɫɹ ɷɮɮɟɤɬ ɨɬ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɡɚɝɥɚɜɧɵɯ ɛɭɤɜ ɞɥɹ ɚɪɯɢɜɚɬɨɪɨɜ ɪɚɡɥɢɱɧɵɯ ɬɢɩɨɜ ɧɚ ɩɪɢɦɟɪɟ ɫɠɚɬɢɹ ɭɠɟ ɭɩɨɦɢɧɚɜɲɟɝɨɫɹ ɷɥɟɤɬɪɨɧɧɨɝɨ ɜɚɪɢɚɧɬɚ ɤɧɢɝɢ «Three men in a boat (to say nothing of the dog)». ɑɬɨɛɵ ɩɪɨɞɟɦɨɧɫɬɪɢɪɨɜɚɬɶ ɪɨɥɶ ɜɫɬɚɜɤɢ ɩɪɨɛɟɥɚ ɩɨɫɥɟ ɮɥɚɝɨɜ, ɦɵ ɪɚɫɫɦɨɬɪɟɥɢ ɞɜɚ ɚɥɝɨɪɢɬɦɚ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ. Ⱥɥɝɨɪɢɬɦ 1 ɩɪɟɨɛɪɚɡɭɟɬ: • ɫɥɨɜɚ, ɧɚɱɢɧɚɸɳɢɟɫɹ ɫ ɡɚɝɥɚɜɧɨɣ ɛɭɤɜɵ, ɧɨ ɞɚɥɟɟ ɫɨɫɬɨɹɳɢɟ ɢɡ ɨɞɧɨɣ ɢɥɢ ɛɨɥɟɟ ɫɬɪɨɱɧɵɯ, ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɩɪɚɜɢɥɨɦ, ɢɡɨɛɪɚɠɟɧɧɨɦ ɧɚ ɪɢɫ. 7.1; 298 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
• ɫɥɨɜɚ ɢɡ 2 ɢ ɛɨɥɟɟ ɫɢɦɜɨɥɨɜ, ɫɨɞɟɪɠɚɳɢɟ ɬɨɥɶɤɨ ɡɚɝɥɚɜɧɵɟ ɛɭɤɜɵ, ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɩɪɚɜɢɥɨɦ, ɩɪɢɜɟɞɟɧɧɨɦ ɧɚ ɪɢɫ. 7.2. Ⱥɥɝɨɪɢɬɦ 2 ɢɫɩɨɥɶɡɭɟɬ ɷɬɢ ɠɟ ɞɜɚ ɨɬɨɛɪɚɠɟɧɢɹ, ɧɨ ɞɨɛɚɜɥɹɟɬ ɩɨɫɥɟ ɮɥɚɝɨɜ ɩɪɨɛɟɥ. Ɍɚɛɥɢɰɚ 7.5 Ⱥɪɯɢɜɚɬɨɪ Ɍɢɩ ɦɟɬɨȺɥɝɨɪɢɬɦ 1 Ⱥɥɝɨɪɢɬɦ 2 ɞɚ ɫɠɚɬɢɹ
Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
BWT LZ77 PPM
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ 108883 128351 107285
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ 0.8% 1.4% 1.1%
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ 108600 128563 107137
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ 1.0% 1.2% 1.2%
Ⱦɨɛɚɜɥɟɧɢɟ ɩɪɨɛɟɥɚ ɡɚɦɟɬɧɨ ɭɥɭɱɲɢɥɨ ɫɠɚɬɢɟ ɞɥɹ ɚɥɝɨɪɢɬɦɚ BWT, ɛɥɚɝɨɩɪɢɹɬɧɨ ɩɨɜɥɢɹɥɨ ɧɚ ɷɮɮɟɤɬɢɜɧɨɫɬɶ PPM, ɧɨ ɫɤɚɡɚɥɨɫɶ ɨɬɪɢɰɚɬɟɥɶɧɨ ɜ ɫɥɭɱɚɟ LZ77. ɆɈȾɂɎɂɄȺɐɂə ɊȺɁȾȿɅɂɌȿɅȿɃ
Ɍɟɤɫɬ ɫɨɞɟɪɠɢɬ ɧɟ ɬɨɥɶɤɨ ɛɭɤɜɵ, ɧɨ ɢ ɫɢɦɜɨɥɵ-ɪɚɡɞɟɥɢɬɟɥɢ. Ɋɚɡɞɟɥɢɬɟɥɢ ɛɵɜɚɸɬ: • ɟɫɬɟɫɬɜɟɧɧɵɦɢ — ɷɬɨ ɡɧɚɤɢ ɩɪɟɩɢɧɚɧɢɹ, ɩɪɨɛɟɥɵ; • ɫɜɹɡɚɧɧɵɦɢ ɫ ɮɨɪɦɚɬɢɪɨɜɚɧɢɟɦ ɬɟɤɫɬɚ — ɫɢɦɜɨɥɵ ɤɨɧɰɚ ɫɬɪɨɤɢ (ɋɄɋ), ɫɢɦɜɨɥɵ ɬɚɛɭɥɹɰɢɢ. ɋɢɦɜɨɥɵ-ɪɚɡɞɟɥɢɬɟɥɢ ɜ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ ɩɥɨɯɨ ɩɪɟɞɫɤɚɡɵɜɚɸɬɫɹ ɧɚ ɨɫɧɨɜɚɧɢɢ ɤɨɧɬɟɤɫɬɧɨ-ɡɚɜɢɫɢɦɨɣ ɫɬɚɬɢɫɬɢɤɢ. Ɉɫɨɛɟɧɧɨ ɩɥɨɯɨ ɩɪɟɞɫɤɚɡɵɜɚɸɬɫɹ ɫɢɦɜɨɥɵ ɤɨɧɰɚ ɫɬɪɨɤɢ, ɬ.ɟ. ɩɚɪɚ ɫɢɦɜɨɥɨɜ {ɩɟɪɟɜɨɞ ɤɚɪɟɬɤɢ, ɩɟɪɟɜɨɞ ɫɬɪɨɤɢ} CR/LF ɢɥɢ ɫɢɦɜɨɥ ɩɟɪɟɜɨɞɚ ɫɬɪɨɤɢ LF. Ʉɨɷɮɮɢɰɢɟɧɬ ɫɠɚɬɢɹ BWT ɢ PPM ɤɨɦɩɪɟɫɫɨɪɨɜ ɦɨɠɟɬ ɛɵɬɶ ɭɥɭɱɲɟɧ, ɟɫɥɢ ɩɪɟɨɛɪɚɡɨɜɚɬɶ ɡɧɚɤɢ ɩɪɟɩɢɧɚɧɢɹ ɢ ɋɄɋ, ɜɵɞɟɥɢɜ ɢɯ ɢɡ ɩɨɬɨɤɚ ɛɭɤɜ. ɇɚɢɛɨɥɟɟ ɷɮɮɟɤɬɢɜɧɵɦ ɢ ɩɪɨɫɬɵɦ ɫɩɨɫɨɛɨɦ ɦɨɞɢɮɢɤɚɰɢɢ ɹɜɥɹɟɬɫɹ ɞɨɛɚɜɥɟɧɢɟ ɩɪɨɛɟɥɚ ɩɟɪɟɞ ɷɬɢɦɢ ɪɚɡɞɟɥɢɬɟɥɹɦɢ [2]. ɇɚɩɪɢɦɟɪ: “ɨɱɟɜɢɞɧɨ,” Æ “ɨɱɟɜɢɞɧɨ_,”, ɩɪɢ ɷɬɨɦ: “ɨɱɟɜɢɞɧɨ_,” Æ “ɨɱɟɜɢɞɧɨ__,”. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 299 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ ɨɞɧɨɡɧɚɱɧɨ: ɤɨɝɞɚ ɩɨɫɬɩɪɨɰɟɫɫɨɪ ɜɫɬɪɟɱɚɟɬ ɩɪɨɛɟɥ, ɨɧ ɫɦɨɬɪɢɬ ɧɚ ɫɥɟɞɭɸɳɢɣ ɫɢɦɜɨɥ, ɢ, ɟɫɥɢ ɷɬɨ ɪɚɡɞɟɥɢɬɟɥɶ (ɡɧɚɤ ɩɪɟɩɢɧɚɧɢɹ ɢɥɢ ɋɄɋ), ɩɪɨɛɟɥ ɧɚ ɜɵɯɨɞ ɧɟ ɜɵɞɚɟɬɫɹ. ɉɨɥɨɠɢɬɟɥɶɧɵɣ ɷɮɮɟɤɬ ɨɬɨɛɪɚɠɟɧɢɹ ɨɛɴɹɫɧɹɟɬɫɹ ɬɟɦ, ɱɬɨ ɩɪɨɛɟɥ ɜɫɬɪɟɱɚɟɬɫɹ ɜ ɬɚɤɢɯ ɠɟ ɤɨɧɬɟɤɫɬɚɯ, ɱɬɨ ɢ ɩɪɟɨɛɪɚɡɭɟɦɵɟ ɡɧɚɤɢ. ɉɨɷɬɨɦɭ ɜɵɩɨɥɧɟɧɢɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɩɪɢɜɨɞɢɬ ɤ ɫɥɟɞɭɸɳɟɦɭ: • ɭɦɟɧɶɲɚɟɬɫɹ ɤɨɥɢɱɟɫɬɜɨ ɢɫɩɨɥɶɡɭɟɦɵɯ ɤɨɧɬɟɤɫɬɨɜ ɢ, ɫɥɟɞɨɜɚɬɟɥɶɧɨ, ɭɜɟɥɢɱɢɜɚɟɬɫɹ ɬɨɱɧɨɫɬɶ ɧɚɤɚɩɥɢɜɚɟɦɨɣ ɫɬɚɬɢɫɬɢɤɢ; • ɩɪɨɛɟɥ ɫɠɢɦɚɟɬɫɹ ɱɚɫɬɨ ɫɢɥɶɧɟɟ, ɱɟɦ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɣ ɡɧɚɤ ɩɪɟɩɢɧɚɧɢɹ ɢɥɢ ɋɄɋ, ɢ ɩɪɢ ɷɬɨɦ ɩɪɟɞɨɫɬɚɜɥɹɟɬ ɧɟɫɤɨɥɶɤɨ ɥɭɱɲɢɣ ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɬɨɱɧɨɫɬɢ ɩɪɟɞɫɤɚɡɚɧɢɹ ɤɨɧɬɟɤɫɬ ɞɥɹ ɩɨɫɥɟɞɭɸɳɟɝɨ ɪɚɡɞɟɥɢɬɟɥɹ. ɍɤɚɠɟɦ ɧɟɫɤɨɥɶɤɨ ɫɩɨɫɨɛɨɜ ɩɨɜɵɲɟɧɢɹ ɩɪɨɢɡɜɨɞɢɬɟɥɶɧɨɫɬɢ ɫɯɟɦɵ: • ɜ ɫɥɭɱɚɟ ɋɄɋ ɩɪɨɛɟɥ ɜ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟ ɜɵɝɨɞɧɨ ɞɨɛɚɜɥɹɬɶ ɢ ɩɨɫɥɟ ɫɢɦɜɨɥɚ (-ɨɜ) ɤɨɧɰɚ ɫɬɪɨɤɢ; ɩɪɢ ɷɬɨɦ ɥɭɱɲɟ ɜɨɡɞɟɪɠɚɬɶɫɹ ɨɬ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɟɫɥɢ ɩɟɪɜɵɣ ɫɢɦɜɨɥ ɧɨɜɨɣ ɫɬɪɨɤɢ ɧɟ ɹɜɥɹɟɬɫɹ ɧɢ ɛɭɤɜɨɣ, ɧɢ ɩɪɨɛɟɥɨɦ; • ɫɠɚɬɢɟ ɨɛɵɱɧɨ ɭɥɭɱɲɚɟɬɫɹ ɜ ɫɪɟɞɧɟɦ, ɟɫɥɢ ɧɟ ɞɟɥɚɟɬɫɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɡɧɚɤɨɜ ɩɪɟɩɢɧɚɧɢɹ, ɡɚ ɤɨɬɨɪɵɦɢ ɧɟ ɫɥɟɞɭɟɬ ɧɢ ɩɪɨɛɟɥ, ɧɢ ɋɄɋ; • ɧɟ ɫɥɟɞɭɟɬ ɜɫɬɚɜɥɹɬɶ ɩɪɨɛɟɥ ɩɟɪɟɞ ɡɧɚɤɨɦ ɩɪɟɩɢɧɚɧɢɹ, ɟɫɥɢ ɩɪɟɞɵɞɭɳɢɣ ɫɢɦɜɨɥ ɧɟ ɹɜɥɹɟɬɫɹ ɧɢ ɛɭɤɜɨɣ, ɧɢ ɩɪɨɛɟɥɨɦ. ɍɩɪɚɠɧɟɧɢɟ: ɉɨɱɟɦɭ ɧɟɨɛɯɨɞɢɦɨ ɞɟɥɚɬɶ ɦɨɞɢɮɢɤɚɰɢɸ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɤɨɝɞɚ ɩɪɟɞɵɞɭɳɢɣ ɫɢɦɜɨɥ ɹɜɥɹɟɬɫɹ ɩɪɨɛɟɥɨɦ? ȼ ɰɟɥɨɦ, ɷɮɮɟɤɬ ɨɬ ɦɨɞɢɮɢɤɚɰɢɢ ɪɚɡɞɟɥɢɬɟɥɟɣ ɦɟɧɟɟ ɫɬɚɛɢɥɟɧ, ɱɟɦ ɨɬ ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɵ ɢɥɢ ɩɟɪɟɜɨɞɚ ɡɚɝɥɚɜɧɵɯ ɛɭɤɜ ɜ 300 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɫɬɪɨɱɧɵɟ. ȼɵɢɝɪɵɲ ɩɪɚɤɬɢɱɟɫɤɢ ɜɫɟɝɞɚ ɞɨɫɬɢɝɚɟɬɫɹ ɝɥɚɜɧɵɦ ɨɛɪɚɡɨɦ ɡɚ ɫɱɟɬ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɋɄɋ ɢ ɫɨɫɬɚɜɥɹɟɬ 1-2%. ȼ ɫɥɭɱɚɟ BWT ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɡɧɚɤɨɜ ɩɪɟɩɢɧɚɧɢɹ ɞɚɟɬ ɧɟɭɫɬɨɣɱɢɜɵɣ ɷɮɮɟɤɬ, ɥɭɱɲɟ ɨɛɪɚɛɚɬɵɜɚɬɶ ɬɚɤɢɦ ɨɛɪɚɡɨɦ ɬɨɥɶɤɨ ɋɄɋ. Ɋɟɡɭɥɶɬɚɬɵ ɫɠɚɬɢɹ ɪɚɡɥɢɱɧɵɦɢ ɚɪɯɢɜɚɬɨɪɚɦɢ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɬɟɤɫɬɚ ɤɧɢɝɢ «Three men in a boat (to say nothing of the dog)» ɩɪɢɜɟɞɟɧɵ ɜ ɬɚɛɥ. 7.6. Ɍɚɛɥɢɰɚ 7.6 Ⱥɪɯɢɜɚɬɨɪ Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ BWT LZ77 PPM
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɮɚɣɥɚ 108864 130835 106582
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ 0.8% -0.5% 1.7%
Ⱦɚɧɧɵɟ ɬɚɛɥ. 7.6 ɩɨɞɬɜɟɪɠɞɚɸɬ, ɱɬɨ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɨɩɢɫɚɧɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɦɟɬɨɞɨɜ LZ77 ɛɟɫɫɦɵɫɥɟɧɧɨ. ɋɉȿɐɂȺɅɖɇɈȿ ɄɈȾɂɊɈȼȺɇɂȿ ɋɂɆȼɈɅɈȼ ɄɈɇɐȺ ɋɌɊɈɄɂ
Ʉɚɤ ɭɠɟ ɨɬɦɟɱɚɥɨɫɶ, ɋɄɋ ɩɥɨɯɨ ɫɠɢɦɚɸɬɫɹ ɫɚɦɢ ɢ ɭɯɭɞɲɚɸɬ ɫɠɚɬɢɟ ɨɤɪɭɠɚɸɳɢɯ ɢɯ ɫɢɦɜɨɥɨɜ. Ɉɱɟɜɢɞɧɨ, ɱɬɨ ɟɫɥɢ ɛɵ ɦɵ ɡɚɦɟɧɢɥɢ ɋɄɋ ɧɚ ɩɪɨɛɟɥɵ, ɬɨ ɫɠɚɬɢɟ ɬɟɤɫɬɨɜ ɭɥɭɱɲɢɥɨɫɶ ɛɵ ɫɭɳɟɫɬɜɟɧɧɵɦ ɨɛɪɚɡɨɦ. ɗɬɨɝɨ ɦɨɠɧɨ ɞɨɫɬɢɝɧɭɬɶ, ɢɫɤɭɫɫɬɜɟɧɧɨ ɪɚɡɛɢɜ ɢɫɯɨɞɧɵɣ ɮɚɣɥ ɧɚ ɞɜɚ ɛɥɨɤɚ: ɫɨɛɫɬɜɟɧɧɨ ɬɟɤɫɬ, ɜ ɤɨɬɨɪɨɦ ɋɄɋ ɡɚɦɟɧɟɧɵ ɧɚ ɩɪɨɛɟɥɵ, ɢ ɫɜɟɞɟɧɢɹ ɨ ɪɚɫɩɨɥɨɠɟɧɢɢ ɋɄɋ ɜ ɮɚɣɥɟ, ɬ.ɟ., ɮɚɤɬɢɱɟɫɤɢ, ɢɧɮɨɪɦɚɰɢɹ ɨ ɞɥɢɧɚɯ ɫɬɪɨɤ. ȿɫɥɢ ɜ ɪɚɫɩɨɥɨɠɟɧɢɢ ɋɄɋ ɢɦɟɟɬɫɹ ɞɨɫɬɚɬɨɱɧɨ ɫɬɪɨɝɚɹ ɪɟɝɭɥɹɪɧɨɫɬɶ, ɬɨ ɫɭɦɦɚ ɪɚɡɦɟɪɨɜ ɫɠɚɬɨɝɨ ɛɥɨɤɚ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɬɟɤɫɬɚ ɢ ɫɠɚɬɨɝɨ ɛɥɨɤɚ ɞɥɢɧ ɫɬɪɨɤ ɛɭɞɟɬ ɦɟɧɶɲɟ ɪɚɡɦɟɪɚ ɚɪɯɢɜɚ ɢɫɯɨɞɧɨɝɨ ɮɚɣɥɚ [2]. ɗɮɮɟɤɬɢɜɧɨɫɬɶ ɫɩɟɰɢɚɥɶɧɨɝɨ ɤɨɞɢɪɨɜɚɧɢɹ ɋɄɋ ɧɚɩɪɹɦɭɸ ɡɚɜɢɫɢɬ ɨɬ ɯɚɪɚɤɬɟɪɚ ɪɚɫɩɪɟɞɟɥɟɧɢɹ ɞɥɢɧ ɫɬɪɨɤ ɜ ɬɟɤɫɬɟ. ȿɫɥɢ ɬɟɤɫɬ ɨɬɮɨɪɦɚɬɢɪɨɜɚɧ ɩɨ ɲɢɪɢɧɟ ɫɬɪɨɤɢ, ɬɨ ɫɜɟɞɟɧɢɹ ɨ ɞɥɢɧɚɯ ɫɬɪɨɤ ɦɨɝɭɬ ɛɵɬɶ ɩɪɟɞɫɬɚɜɥɟɧɵ ɨɱɟɧɶ ɤɨɦɩɚɤɬɧɨ. ɇɚɩɪɨɬɢɜ, ɟɫɥɢ ɜ ɬɟɤɫɬɟ ɦɧɨɝɨ ɤɨɪɨɬɤɢɯ ɫɬɪɨɤ, ɦɚɤɫɢɦɚɥɶɧɚɹ ɞɥɢɧɚ ɫɬɪɨɤɢ ɜ ɫɢɦɜɨɥɚɯ ɧɟ ɜɵɞɟɪɠɢɜɚɟɬɫɹ ɩɨɫɬɨɹɧɧɨɣ, ɬɨ, ɫɤɨɪɟɟ ɜɫɟɝɨ, ɫɩɟɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 301 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɰɢɚɥɶɧɨɟ ɤɨɞɢɪɨɜɚɧɢɟ ɋɄɋ ɛɭɞɟɬ ɦɚɥɨ ɩɨɥɟɡɧɨ ɢɥɢ ɜɨɜɫɟ ɧɟ ɜɵɝɨɞɧɨ. Ɉɞɧɢɦ ɢɡ ɜɨɡɦɨɠɧɵɦ ɫɩɨɫɨɛɨɜ ɡɚɞɚɧɢɹ ɞɥɢɧɵ ɫɬɪɨɤɢ ɹɜɥɹɟɬɫɹ ɤɨɥɢɱɟɫɬɜɨ ɩɪɨɛɟɥɨɜ, ɥɟɠɚɳɢɯ ɦɟɠɞɭ ɩɪɟɞɵɞɭɳɢɦ ɢ ɬɟɤɭɳɢɦ ɋɄɋ. ɇɚɩɪɢɦɟɪ: ɋɬɪɨɤɚ Ⱦɥɢɧɚ ɫɬɪɨɤɢ ɜ ɩɪɨɛɟɥɚɯ Twas_brillig,_and_the_slithy_toves 5 Did_gyre_and_gimble_in_the_wabe; 6 All_mimsy_were_the_borogoves, 4 And_the_mome_raths_outgrabe. 4 ɉɨɫɤɨɥɶɤɭ ɦɵ ɢɡɦɟɪɹɟɦ ɞɥɢɧɭ ɫɬɪɨɤɢ ɧɟ ɜ ɫɢɦɜɨɥɚɯ, ɚ, ɫɤɨɪɟɟ, ɜ ɫɥɨɜɚɯ, ɬɨ ɤɨɥɢɱɟɫɬɜɨ ɧɚɛɥɸɞɚɟɦɵɯ ɞɥɢɧ ɫɬɪɨɤ ɧɟ ɛɭɞɟɬ ɜɟɥɢɤɨ, ɢ ɫ ɩɨɦɨɳɶɸ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɢɪɨɜɚɧɢɹ ɦɨɠɧɨ ɞɨɫɬɚɬɨɱɧɨ ɤɨɦɩɚɤɬɧɨ ɩɪɟɞɫɬɚɜɢɬɶ ɢɧɮɨɪɦɚɰɢɸ ɨ ɪɚɫɩɨɥɨɠɟɧɢɢ ɋɄɋ ɜ ɬɟɤɫɬɟ. ȼ ɩɪɨɫɬɟɣɲɟɦ ɫɥɭɱɚɟ ɞɨɫɬɚɬɨɱɧɨ ɤɨɞɢɪɨɜɚɬɶ ɞɥɢɧɵ ɧɚ ɨɫɧɨɜɚɧɢɢ ɛɟɡɭɫɥɨɜɧɵɯ ɱɚɫɬɨɬ ɢɯ ɢɫɩɨɥɶɡɨɜɚɧɢɹ. ɉɨɫɬɩɪɨɰɟɫɫɨɪ ɩɨɥɭɱɢɬ ɞɜɚ ɛɥɨɤɚ ɞɚɧɧɵɯ: Ȼɥɨɤ Ⱦɚɧɧɵɟ ɛɥɨɤɚ Ɍɟɤɫɬ Twas_brillig,_and_the_slithy_toves_ Did_gyre_and_gimble_in_the_wabe;_ All_mimsy_… Ⱦɥɢɧɵ ɫɬɪɨɤ 5, 6, … Ɍɚɤ ɤɚɤ ɩɨɫɬɩɪɨɰɟɫɫɨɪɭ ɢɡɜɟɫɬɧɨ, ɱɬɨ ɩɟɪɜɚɹ ɫɬɪɨɤɚ ɫɨɞɟɪɠɢɬ 5 ɩɪɨɛɟɥɨɜ, ɬɨ ɨɧ ɡɚɦɟɧɢɬ 6-ɨɣ ɩɨ ɫɱɟɬɭ ɩɪɨɛɟɥ ɧɚ ɋɄɋ: “…toves_ Did…” Æ “…toves<ɋɄɋ>Did…” Ⱦɥɹ ɫɥɟɞɭɸɳɟɣ ɫɬɪɨɤɢ ɨɧ ɡɚɦɟɧɢɬ ɧɚ ɋɄɋ 7-ɨɣ ɩɪɨɛɟɥ ɢ ɬ.ɞ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ ɬɟɤɫɬ ɛɭɞɟɬ ɩɨɥɧɨɫɬɶɸ ɪɟɤɨɧɫɬɪɭɢɪɨɜɚɧ. ɍɤɚɠɟɦ ɧɟɫɤɨɥɶɤɨ ɫɩɨɫɨɛɨɜ ɩɨɜɵɲɟɧɢɹ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. Ɉɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɞɥɢɧɵ ɫɬɪɨɤɢ ɦɨɠɟɬ ɛɵɬɶ ɭɥɭɱɲɟɧɚ, ɟɫɥɢ ɩɪɢɧɢɦɚɬɶ ɜɨ ɜɧɢɦɚɧɢɟ ɫɢɦɜɨɥɵ, ɩɪɢɦɵɤɚɸɳɢɟ ɤ ɩɪɨɛɟɥɭ ɫɥɟɜɚ ɢ ɫɩɪɚɜɚ, ɢ ɟɫɥɢ ɭɱɢɬɵɜɚɬɶ ɬɟɤɭɳɭɸ ɞɥɢɧɭ ɫɬɪɨɤɢ ɜ ɫɢɦɜɨɥɚɯ. ɗɬɨ ɩɨɡɜɨɥɢɬ ɤɨɦɩɚɤɬɧɟɟ ɩɪɟɞɫɬɚɜɢɬɶ ɢɧɮɨɪɦɚɰɢɸ ɨ ɞɥɢɧɚɯ ɫɬɪɨɤ ɫ ɩɨɦɨɳɶɸ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɢɪɨɜɚɧɢɹ. 302 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɗɤɫɩɟɪɢɦɟɧɬɵ ɩɨɤɚɡɵɜɚɸɬ, ɱɬɨ ɦɨɠɧɨ ɡɚɦɟɧɹɬɶ ɧɚ ɩɪɨɛɟɥɵ ɧɟ ɜɫɟ ɋɄɋ, ɚ ɬɨɥɶɤɨ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɞɨɫɬɚɬɨɱɧɨ ɞɥɢɧɧɵɦ ɫɬɪɨɤɚɦ. Ɂɚɱɚɫɬɭɸ ɷɬɨ ɫɩɨɫɨɛɫɬɜɭɟɬ ɩɨɜɵɲɟɧɢɸ ɨɛɳɟɣ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. ɉɪɢ ɷɬɨɦ, ɨɞɧɚɤɨ, ɩɨɹɜɥɹɟɬɫɹ ɩɪɨɛɥɟɦɚ ɨɩɪɟɞɟɥɟɧɢɹ ɩɪɢ ɤɚɤɢɯ ɠɟ ɢɦɟɧɧɨ ɞɥɢɧɚɯ ɫɬɪɨɤ ɜɵɝɨɞɧɨ «ɡɚɩɭɫɤɚɬɶ» ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ. ȼ ɤɨɦɩɪɟɫɫɨɪɟ PPMN ɢɫɩɨɥɶɡɭɟɬɫɹ ɫɥɟɞɭɸɳɢɣ ɫɩɨɫɨɛ ɧɚɯɨɠɞɟɧɢɹ ɩɨɪɨɝɚ, ɩɪɢ ɩɪɟɜɵɲɟɧɢɢ ɤɨɬɨɪɨɝɨ ɞɥɢɧɨɣ L ɫɬɪɨɤɢ ɜɤɥɸɱɚɟɬɫɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɋɄɋ. ȼɟɥɢɱɢɧɚ L ɩɪɢɧɢɦɚɟɬɫɹ ɡɚ ɩɨɫɬɨɹɧɧɭɸ ɧɚ ɩɪɨɬɹɠɟɧɢɢ ɨɛɪɚɛɨɬɤɢ ɜɫɟɝɨ ɮɚɣɥɚ. Ⱦɥɹ ɜɵɱɢɫɥɟɧɢɹ L ɚɧɚɥɢɡɢɪɭɟɬɫɹ ɞɨɫɬɚɬɨɱɧɨ ɛɨɥɶɲɨɣ ɛɥɨɤ (ɞɨ 32 ɤɛɚɣɬ) ɢɫɯɨɞɧɨɝɨ ɮɚɣɥɚ ɢ ɫɨɛɢɪɚɟɬɫɹ ɢɧɮɨɪɦɚɰɢɹ ɨ ɤɨɥɢɱɟɫɬɜɟ (ɱɚɫɬɨɬɟ) ɫɬɪɨɤ ɫ ɨɩɪɟɞɟɥɟɧɧɨɣ ɞɥɢɧɨɣ L, ɢɡɦɟɪɹɟɦɨɣ ɜ ɫɢɦɜɨɥɚɯ. ȼ ɩɨɞɚɜɥɹɸɳɟɦ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ ɱɚɫɬɨɬɵ ɞɥɢɧ ɫɬɪɨɤ ɦɚɤɫɢɦɚɥɶɧɵ ɜ ɪɚɣɨɧɟ ɧɚɢɛɨɥɶɲɟɣ ɧɚɛɥɸɞɚɟɦɨɣ ɞɥɢɧɵ Lmax ɫɬɪɨɤ, ɚ ɡɚɬɟɦ ɞɨɫɬɚɬɨɱɧɨ ɪɟɡɤɨ ɩɚɞɚɸɬ ɫ ɭɦɟɧɶɲɟɧɢɟɦ L. ɉɨɷɬɨɦɭ, ɞɜɢɝɚɹɫɶ ɨɬ Lmax ɤ ɧɭɥɟɜɨɣ ɞɥɢɧɟ, ɧɚɯɨɞɢɦ ɫɧɚɱɚɥɚ ɦɚɤɫɢɦɭɦ ɱɚɫɬɨɬɵ, ɚ ɡɚɬɟɦ, ɩɪɨɞɨɥɠɚɹ ɭɦɟɧɶɲɚɬɶ L, ɢɳɟɦ ɩɨɪɨɝɨɜɨɟ ɡɧɚɱɟɧɢɟ. ɉɨɪɨɝ ɩɪɢɧɢɦɚɟɬɫɹ ɪɚɜɧɵɦ L, ɞɥɹ ɤɨɬɨɪɨɣ ɱɚɫɬɨɬɚ ɜɩɟɪɜɵɟ ɫɬɚɧɨɜɢɬɫɹ ɦɟɧɶɲɟ ɫɪɟɞɧɟɣ ɱɚɫɬɨɬɵ ɞɥɢɧ ɫɬɪɨɤ. ɋ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, ɜ ɤɚɱɟɫɬɜɟ ɩɨɪɨɝɚ ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɜɵɛɢɪɚɬɶ ɬɨɱɤɭ, ɜ ɤɨɬɨɪɨɣ ɩɪɨɢɡɨɲɥɨ ɦɧɨɝɨɤɪɚɬɧɨɟ ɩɚɞɟɧɢɟ ɱɚɫɬɨɬɵ, ɱɬɨ ɯɚɪɚɤɬɟɪɧɨ ɞɥɹ ɬɟɤɫɬɨɜ ɫɨ ɫɬɪɨɝɢɦ ɜɵɪɚɜɧɢɜɚɧɢɟɦ ɩɨ ɲɢɪɢɧɟ. Ⱦɚɧɧɚɹ ɬɟɯɧɢɤɚ ɩɨɡɜɨɥɹɟɬ ɨɩɪɟɞɟɥɹɬɶ ɩɨɪɨɝ ɫ ɨɱɟɧɶ ɜɵɫɨɤɨɣ ɬɨɱɧɨɫɬɶɸ ɜ ɫɥɭɱɚɟ ɬɟɤɫɬɨɜ ɞɨɫɬɚɬɨɱɧɨ ɩɪɨɫɬɵɦ ɮɨɪɦɚɬɢɪɨɜɚɧɢɟɦ. ɇɚ ɪɢɫ. 7.3 ɢɡɨɛɪɚɠɟɧɨ ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɱɚɫɬɨɬ ɞɥɢɧ ɫɬɪɨɤ, ɩɨɥɭɱɟɧɧɨɟ ɞɥɹ ɩɟɪɜɵɯ 32 ɤɛɚɣɬ ɬɟɤɫɬɚ «Three men in a boat (to say nothing of the dog)». ȼɢɞɧɨ, ɱɬɨ Lmax = 73, ɦɚɤɫɢɦɭɦ ɱɚɫɬɨɬɵ ɧɚɯɨɞɢɬɫɹ ɜ ɬɨɱɤɟ L = 72, ɚ ɩɨɪɨɝ ɪɚɜɟɧ 65 ɫɢɦɜɨɥɚɦ, ɩɨɫɤɨɥɶɤɭ ɩɪɢ ɷɬɨɦ ɱɚɫɬɨɬɚ ɜɩɟɪɜɵɟ ɫɬɚɧɨɜɢɬɫɹ ɦɟɧɶɲɟ ɫɪɟɞɧɟɣ ɱɚɫɬɨɬɵ, ɟɫɥɢ ɫɱɢɬɚɬɶ ɨɬ ɬɨɱɤɢ L = 72.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 303 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɤɨɥɢɱɟɫɬɜɨ ɫɬɪɨɤ
100 80 60 40 20 0 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
ɞɥɢɧɚ ɫɬɪɨɤɢ ɜ ɫɢɦɜɨɥɚɯ (L ) ɑɚɫɬɨɬɚ ɫɬɪɨɤ ɬɚɤɨɣ ɞɥɢɧɵ
ɋɪɟɞɧɹɹ ɱɚɫɬɨɬɚ ɞɥɢɧ ɫɬɪɨɤ
Ɋɢɫ. 7.3. Ɋɚɫɩɪɟɞɟɥɟɧɢɟ ɱɚɫɬɨɬ ɞɥɢɧ ɫɬɪɨɤ, ɩɨɥɭɱɟɧɧɨɟ ɞɥɹ ɩɟɪɜɵɯ 32 ɤɛɚɣɬ ɬɟɤɫɬɚ «Three men in a boat (to say nothing of the dog)» ȼ ɤɚɱɟɫɬɜɟ ɩɪɢɦɟɪɚ ɭɤɚɠɟɦ ɜ ɬɚɛɥ. 7.7 ɪɟɡɭɥɶɬɚɬɵ ɫɠɚɬɢɹ ɬɪɟɦɹ ɜɵɛɪɚɧɧɵɦɢ ɧɚɦɢ ɚɪɯɢɜɚɬɨɪɚɦɢ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɬɟɤɫɬɚ «Three men in a boat (to say nothing of the dog)». Ⱦɥɢɧɚ ɫɬɪɨɤ ɢɡɦɟɪɹɥɚɫɶ ɜ ɩɪɨɛɟɥɚɯ, ɩɪɟɨɛɪɚɡɨɜɵɜɚɥɢɫɶ ɬɨɥɶɤɨ ɋɄɋ ɜ ɫɬɪɨɤɚɯ ɫ ɞɥɢɧɨɣ 65 ɫɢɦɜɨɥɨɜ ɢ ɛɨɥɟɟ. Ⱦɥɢɧɵ ɫɬɪɨɤ ɫɠɢɦɚɥɢɫɶ ɫ ɩɨɦɨɳɶɸ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɟɪɚ ɧɚ ɨɫɧɨɜɚɧɢɢ ɢɯ ɛɟɡɭɫɥɨɜɧɵɯ ɱɚɫɬɨɬ. Ɋɚɡɦɟɪ ɡɚɤɨɞɢɪɨɜɚɧɧɨɝɨ ɨɩɢɫɚɧɢɹ ɞɥɢɧ ɩɨɥɭɱɢɥɫɹ ɪɚɜɧɵɦ 793 ɛɚɣɬɚɦ, ɢ ɷɬɨ ɱɢɫɥɨ ɞɨɛɚɜɥɹɥɨɫɶ ɤ ɪɚɡɦɟɪɭ ɚɪɯɢɜɚ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɮɚɣɥɚ ɩɪɢ ɫɪɚɜɧɟɧɢɢ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɨɬɧɨɫɢɬɟɥɶɧɨ ɪɚɡɧɵɯ ɦɟɬɨɞɨɜ ɫɠɚɬɢɹ (BWT, LZ77, PPM). Ɍɚɛɥɢɰɚ 7.7 Ⱥɪɯɢɜɚɬɨɪ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɢɫɯɨɞɧɨɝɨ ɮɚɣɥɚ
Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
BWT LZ77 PPM
109736 130174 108443
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɮɚɣɥɚ ɩɥɸɫ ɪɚɡɦɟɪ ɨɩɢɫɚɧɢɹ ɞɥɢɧ ɫɬɪɨɤ 106069 126042 105018
304 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ
3.3% 3.2% 3.2%
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼɢɞɧɨ, ɱɬɨ ɫɩɟɰɢɚɥɶɧɨɟ ɤɨɞɢɪɨɜɚɧɢɟ ɋɄɋ ɜɵɝɨɞɧɨ ɢɫɩɨɥɶɡɨɜɚɬɶ ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɥɸɛɵɦ ɭɧɢɜɟɪɫɚɥɶɧɵɦ ɦɟɬɨɞɨɦ ɫɠɚɬɢɹ. ɈɐȿɇɄȺ ɈȻɓȿȽɈ ɗɎɎȿɄɌȺ ɈɌ ɂɋɉɈɅɖɁɈȼȺɇɂə ɉɊȿȾȼȺɊɂɌȿɅɖɇɈɃ ɈȻɊȺȻɈɌɄɂ
Ⱦɨ ɫɢɯ ɦɵ ɪɚɫɫɦɚɬɪɢɜɚɥɢ ɪɚɡɥɢɱɧɵɟ ɦɟɬɨɞɵ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɬɟɤɫɬɨɜ ɧɟɡɚɜɢɫɢɦɨ ɞɪɭɝ ɨɬ ɞɪɭɝɚ. ȿɫɬɟɫɬɜɟɧɧɨ, ɱɬɨ ɩɪɚɤɬɢɱɟɫɤɢɣ ɢɧɬɟɪɟɫ ɬɪɟɛɭɟɬ ɢɯ ɨɞɧɨɜɪɟɦɟɧɧɨɝɨ ɢɫɩɨɥɶɡɨɜɚɧɢɹ. ɉɨɥɭɱɢɦ ɥɢ ɦɵ ɩɪɢ ɷɬɨɦ ɭɜɟɥɢɱɟɧɢɟ ɫɠɚɬɢɹ ɪɚɜɧɵɦ ɫɭɦɦɟ ɭɥɭɱɲɟɧɢɣ, ɨɛɟɫɩɟɱɢɜɚɟɦɵɯ ɤɚɠɞɵɦ ɫɩɨɫɨɛɨɦ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɩɨ ɨɬɞɟɥɶɧɨɫɬɢ? Ɉɬɜɟɬ ɧɚ ɷɬɨɬ ɜɨɩɪɨɫ ɞɚɸɬ ɬɚɛɥ. 7.8 ɢ ɬɚɛɥ. 7.9, ɜ ɤɨɬɨɪɵɯ ɩɪɢɜɟɞɟɧɵ ɪɟɡɭɥɶɬɚɬɵ ɫɠɚɬɢɹ ɬɟɤɫɬɚ «Three men in a boat (to say nothing of the dog)», ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɫ ɩɨɦɨɳɶɸ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɝɨ ɩɪɢɦɟɧɟɧɢɹ 4 ɬɟɯɧɢɤ: • ɫɩɟɰɢɚɥɶɧɨɝɨ ɤɨɞɢɪɨɜɚɧɢɹ ɋɄɋ; • ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɡɚɝɥɚɜɧɵɯ ɛɭɤɜ; • ɦɨɞɢɮɢɤɚɰɢɢ ɪɚɡɞɟɥɢɬɟɥɟɣ; • ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɵ n-ɝɪɚɮɨɜ (ɫɥɨɜɚɪɶ ɢɡ ɬɚɛɥ. 7.1). ȼ ɬɚɛɥ. 7.9 ɨɠɢɞɚɟɦɨɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ ɜɵɱɢɫɥɹɥɨɫɶ ɤɚɤ ɫɭɦɦɚ ɭɥɭɱɲɟɧɢɣ ɞɥɹ ɜɫɟɯ ɱɟɬɵɪɟɯ ɬɢɩɨɜ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɨɬɧɨɫɢɬɟɥɶɧɨ ɪɚɡɦɟɪɚ ɚɪɯɢɜɚ ɢɫɯɨɞɧɨɝɨ ɧɟɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɮɚɣɥɚ (ɫɦ. ɬɚɛɥ. 7.3, 7.5, 7.6, 7.7). Ɍɚɛɥɢɰɚ 7.8 Ⱥɪɯɢɜɚɬɨɪ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɢɫɯɨɞɧɨɝɨ ɮɚɣɥɚ
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ
109736
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɮɚɣɥɚ ɩɥɸɫ ɪɚɡɦɟɪ ɨɩɢɫɚɧɢɹ ɞɥɢɧ ɫɬɪɨɤ 103047
6.1%
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ ɛɟɡ ɜɵɩɨɥɧɟɧɢɹ ɦɨɞɢɮɢɤɚɰɢɢ ɪɚɡɞɟɥɢɬɟɥɟɣ 6.0%
Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
BWT LZ77
130174
120632
7.3%
7.8%
PPM
108443
99788
8.0%
7.3%
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 305 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɍɚɛɥɢɰɚ 7.9 Ⱥɪɯɢɜɚɬɨɪ Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ BWT
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ
Ɉɠɢɞɚɟɦɨɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ
6.1%
6.8%
LZ77
7.3%
7.1%
PPM
8.0%
7.6%
ɂɡ ɬɚɛɥɢɰ ɜɢɞɧɨ, ɱɬɨ ɞɥɹ HA ɢ, ɜ ɦɟɧɶɲɟɣ ɫɬɟɩɟɧɢ, WinRAR, ɩɪɨɹɜɢɥɫɹ ɞɚɠɟ ɩɨɥɨɠɢɬɟɥɶɧɵɣ ɤɭɦɭɥɹɬɢɜɧɵɣ ɷɮɮɟɤɬ ɨɬ ɩɪɢɦɟɧɟɧɢɹ ɧɟɫɤɨɥɶɤɢɯ ɚɥɝɨɪɢɬɦɨɜ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ. ɗɬɨ ɞɨɫɬɚɬɨɱɧɨ ɫɬɪɚɧɧɵɣ ɧɚ ɩɟɪɜɵɣ ɜɡɝɥɹɞ ɪɟɡɭɥɶɬɚɬ, ɬɚɤ ɤɚɤ ɱɟɦ ɫɨɜɟɪɲɟɧɧɟɟ ɚɥɝɨɪɢɬɦ ɫɠɚɬɢɹ, ɬɟɦ ɦɟɧɶɲɢɣ ɜɵɢɝɪɵɲ ɞɨɥɠɧɨ ɞɚɜɚɬɶ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɞɨɩɨɥɧɢɬɟɥɶɧɵɯ ɦɟɯɚɧɢɡɦɨɜ, ɱɬɨ, ɫɨɛɫɬɜɟɧɧɨ, ɦɵ ɢ ɧɚɛɥɸɞɚɟɦ ɜ ɫɥɭɱɚɟ ɚɪɯɢɜɚɬɨɪɚ BZIP2. Ⱦɨ ɧɟɤɨɬɨɪɨɣ ɫɬɟɩɟɧɢ ɷɬɨ ɦɨɠɧɨ ɨɛɴɹɫɧɢɬɶ ɬɟɦ, ɱɬɨ ɩɨɫɥɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɡɚɝɥɚɜɧɵɯ ɛɭɤɜ ɛɨɥɶɲɟɟ ɤɨɥɢɱɟɫɬɜɨ n-ɝɪɚɮɨɜ ɦɨɠɟɬ ɛɵɬɶ ɡɚɦɟɧɟɧɨ ɧɚ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɢɦ ɢɧɞɟɤɫɵ ɫɥɨɜɚɪɹ, ɱɬɨ ɭɦɟɧɶɲɚɟɬ ɪɚɡɧɨɨɛɪɚɡɢɟ ɢɫɩɨɥɶɡɭɟɦɵɯ ɫɬɪɨɤ ɢ ɫɩɨɫɨɛɫɬɜɭɟɬ ɭɜɟɥɢɱɟɧɢɸ ɫɠɚɬɢɹ. ȼɨɡɦɨɠɧɨ, ɫɨɱɟɬɚɧɢɟ ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɵ ɫɨ ɫɩɟɰɢɚɥɶɧɵɦ ɤɨɞɢɪɨɜɚɧɢɟɦ ɋɄɋ ɧɚɫɬɨɥɶɤɨ ɭɦɟɧɶɲɚɟɬ ɨɛɳɟɟ ɤɨɥɢɱɟɫɬɜɨ ɫɬɪɨɤ, ɫɠɢɦɚɟɦɵɯ ɫ ɩɨɦɨɳɶɸ ɫɥɨɜɚɪɹ LZ77, ɩɪɢ ɨɞɧɨɜɪɟɦɟɧɧɨɦ ɭɦɟɧɶɲɟɧɢɢ ɢɯ ɮɢɤɬɢɜɧɨɣ ɞɥɢɧɵ, ɱɬɨ ɷɬɨ ɤɨɦɩɟɧɫɢɪɭɟɬ ɩɚɞɟɧɢɟ ɨɛɳɟɝɨ ɩɪɨɰɟɧɬɚ ɭɥɭɱɲɟɧɢɹ ɫɠɚɬɢɹ. ȼɫɬɚɜɤɚ ɩɪɨɛɟɥɨɜ ɢɥɢ ɡɚɦɟɧɚ ɋɄɋ ɧɚ ɩɪɨɛɟɥɵ ɭɦɟɧɶɲɚɟɬ ɤɨɥɢɱɟɫɬɜɨ ɤɨɧɬɟɤɫɬɨɜ ɢ, ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ, ɭɦɟɧɶɲɚɟɬ ɪɚɡɦɟɪ PPM-ɦɨɞɟɥɢ, ɩɨɷɬɨɦɭ HA, ɨɝɪɚɧɢɱɟɧɧɵɣ ɜɫɟɝɨ ɥɢɲɶ ɩɪɢɦɟɪɧɨ 400 ɤɛɚɣɬ ɩɚɦɹɬɢ, ɦɨɠɟɬ ɢɫɩɨɥɶɡɨɜɚɬɶ ɞɥɹ ɨɰɟɧɤɢ ɛɨɥɶɲɟɟ ɤɨɥɢɱɟɫɬɜɨ ɫɬɚɬɢɫɬɢɤɢ, ɱɬɨ ɭɥɭɱɲɚɟɬ ɫɠɚɬɢɟ. ɋɭɞɹ ɩɨ ɜɫɟɦɭ, ɪɟɚɥɢɡɚɰɢɹ BWT ɢ ɫɨɩɭɬɫɬɜɭɸɳɢɯ ɦɟɬɨɞɨɜ ɜ BZIP2 ɢ ɩɪɢɧɰɢɩɢɚɥɶɧɵɟ ɨɫɨɛɟɧɧɨɫɬɢ ɚɥɝɨɪɢɬɦɚ ɛɥɨɱɧɨɣ ɫɨɪɬɢɪɨɜɤɢ ɧɟ ɩɨɡɜɨɥɢɥɢ BWT «ɜɨɫɩɨɥɶɡɨɜɚɬɶɫɹ» ɫɢɬɭɚɰɢɟɣ ɬɚɤ ɠɟ ɷɮɮɟɤɬɢɜɧɨ, ɤɚɤ LZ77 ɢ PPM. Ɋɚɫɫɦɨɬɪɢɦ, ɱɬɨ ɩɪɨɢɡɨɣɞɟɬ ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ LIPT ɜɦɟɫɬɨ ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɵ n-ɝɪɚɮɨɜ. ȼ ɬɚɛɥ. 7.10 ɩɪɟɞɫɬɚɜɥɟɧɵ ɪɟɡɭɥɶɬɚɬɵ ɫɠɚɬɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɝɨ ɬɟɤɫɬɚ, ɩɨɥɭɱɟɧɧɨɝɨ ɫ ɩɨɦɨɳɶɸ ɬɪɟɯ ɭɩɨɦɢɧɚɜɲɢɯɫɹ ɬɟɯɧɢɤ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɫ ɩɨɫɥɟɞɭɸɳɢɦ 306 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ LIPT, ɚɥɝɨɪɢɬɦ 2 (ɫɦ. ɩɨɞɩɭɧɤɬ «ɂɫɩɨɥɶɡɨɜɚɧɢɟ ɫɥɨɜɚɪɟɣ»). Ɍɚɛɥɢɰɚ 7.10 Ⱥɪɯɢɜɚɬɨɪ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɢɫɯɨɞɧɨɝɨ ɮɚɣɥɚ
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ
Ɉɠɢɞɚɟɦɨɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ
109736
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɮɚɣɥɚ ɩɥɸɫ ɪɚɡɦɟɪ ɨɩɢɫɚɧɢɹ ɞɥɢɧ ɫɬɪɨɤ 93882
Bzip2, ɜɟɪ. 1.00 WinRAR, ɜɟɪ. 2.71 HA a2, ɜɟɪ. 0.999ɫ
BWT
14.4%
12.9%
LZ77
130174
114566
12.0%
10.1%
PPM
108443
94191
13.1%
14.9%
ɂ ɨɩɹɬɶ ɦɵ ɜɢɞɢɦ, ɱɬɨ ɪɚɡɥɢɱɧɵɟ ɫɩɨɫɨɛɵ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɞɨɩɨɥɧɹɸɬ ɞɪɭɝ ɞɪɭɝɚ, ɨɛɟɫɩɟɱɢɜɚɹ ɪɨɫɬ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. ɏɨɬɹ ɬɟɩɟɪɶ ɫɢɬɭɚɰɢɹ ɞɨ ɧɟɤɨɬɨɪɨɣ ɫɬɟɩɟɧɢ ɩɨɦɟɧɹɥɚɫɶ: ɭɜɟɥɢɱɟɧɢɟ ɫɠɚɬɢɹ ɛɨɥɶɲɟ ɨɠɢɞɚɟɦɨɝɨ ɞɥɹ BWT ɢ LZ77, ɚ ɜ ɫɥɭɱɚɟ PPM ɧɚɛɥɸɞɚɟɬɫɹ ɷɮɮɟɤɬ «ɧɚɫɵɳɟɧɢɹ». Ɉɬɦɟɬɢɦ, ɱɬɨ ɢɫɩɨɥɶɡɨɜɚɧɧɚɹ ɫɯɟɦɚ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ ɞɚɥɟɤɨ ɧɟ ɫɚɦɚɹ ɥɭɱɲɚɹ, ɟɫɥɢ ɟɟ ɩɪɟɞɩɨɥɚɝɚɟɬɫɹ ɢɫɩɨɥɶɡɨɜɚɬɶ ɫɨɜɦɟɫɬɧɨ ɫ LZɤɨɦɩɪɟɫɫɨɪɨɦ. ȼ ɷɬɨɦ ɫɥɭɱɚɟ ɡɚ ɫɱɟɬ ɭɩɨɦɢɧɚɜɲɢɯɫɹ ɦɨɞɢɮɢɤɚɰɢɣ ɦɨɠɧɨ ɩɨɜɵɫɢɬɶ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɟɳɟ ɧɚ ɧɟɫɤɨɥɶɤɨ ɩɪɨɰɟɧɬɨɜ. ȼɵɜɨɞ: Ɉɞɧɨɜɪɟɦɟɧɧɨɟ ɩɪɢɦɟɧɟɧɢɟ ɪɚɫɫɦɨɬɪɟɧɧɵɯ ɫɩɨɫɨɛɨɜ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ ɬɟɤɫɬɨɜ ɩɨɡɜɨɥɹɟɬ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɧɚ 5-8% ɜ ɫɥɭɱɚɟ ɩɪɨɫɬɨɣ ɫɥɨɜɚɪɧɨɣ ɫɯɟɦɵ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ ɢ ɧɚ 12-15% ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɝɪɨɦɨɡɞɤɨɝɨ ɫɥɨɜɚɪɹ.
ɉɪɟɩɪɨɰɟɫɫɢɧɝ ɧɟɬɟɤɫɬɨɜɵɯ ɞɚɧɧɵɯ Ȼɵɥɨ ɡɚɦɟɱɟɧɨ, ɱɬɨ ɦɧɨɝɢɟ ɮɚɣɥɵ ɫɨɞɟɪɠɚɬ ɞɚɧɧɵɟ, ɡɚɩɢɫɚɧɧɵɟ ɧɟ ɜ ɫɚɦɨɦ ɭɞɨɛɧɨɦ ɜɢɞɟ ɞɥɹ ɫɠɚɬɢɹ ɬɪɚɞɢɰɢɨɧɧɵɦɢ ɭɧɢɜɟɪɫɚɥɶɧɵɦɢ ɤɨɦɩɪɟɫɫɨɪɚɦɢ. ɂ, ɟɫɥɢ ɢɡɦɟɧɢɬɶ ɮɨɪɦɭ ɩɪɟɞɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 307 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɫɬɚɜɥɟɧɢɹ ɷɬɢɯ ɞɚɧɧɵɯ, ɬɨ ɷɮɮɟɤɬɢɜɧɨɫɬɶ ɫɠɚɬɢɹ ɮɚɣɥɨɜ ɡɚɦɟɬɧɨ ɭɜɟɥɢɱɢɬɫɹ. Ɇɧɨɝɢɟ ɤɨɦɩɪɟɫɫɨɪɵ ɭɠɟ ɨɫɧɚɳɟɧɵ ɩɪɟɩɪɨɰɟɫɫɨɪɚɦɢ ɪɟɝɭɥɹɪɧɵɯ ɫɬɪɭɤɬɭɪ ɢ ɢɫɩɨɥɧɢɦɵɯ ɮɚɣɥɨɜ. ɋɪɟɞɢ ɧɢɯ ɦɨɠɧɨ ɨɬɦɟɬɢɬɶ 7-Zip, ACE, CABARC, DC, IMP, PPMN, SBC, UHARC, YBS. ɉɊȿɈȻɊȺɁɈȼȺɇɂȿ ɈɌɇɈɋɂɌȿɅɖɇɕɏ ȺȾɊȿɋɈȼ
Ʉɚɤ ɢɡɜɟɫɬɧɨ, ɜ ɫɢɫɬɟɦɟ ɤɨɦɚɧɞ ɩɪɨɰɟɫɫɨɪɨɜ Intel ɚɞɪɟɫɚ ɦɟɬɨɤ ɜ ɪɹɞɟ ɫɥɭɱɚɟɜ ɡɚɩɢɫɵɜɚɸɬɫɹ ɜ ɜɢɞɟ ɫɦɟɳɟɧɢɹ ɨɬ ɚɞɪɟɫɚ ɬɟɤɭɳɟɣ ɤɨɦɚɧɞɵ ɞɨ ɚɞɪɟɫɚ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɦɟɬɤɢ. Ɍɚɤ ɡɚɩɢɫɵɜɚɸɬɫɹ ɤɨɦɚɧɞɵ CALL (ɤɨɞ ɨɩɟɪɚɰɢɢ 0xE8), JMP (ɤɨɞ ɨɩɟɪɚɰɢɢ 0xE9). ȼ ɪɟɡɭɥɶɬɚɬɟ, ɟɫɥɢ ɪɹɞ ɤɨɦɚɧɞ ɫɫɵɥɚɟɬɫɹ ɧɚ ɨɞɧɭ ɢ ɬɭ ɠɟ ɦɟɬɤɭ, ɤɚɠɞɵɣ ɪɚɡ ɚɞɪɟɫ ɷɬɨɣ ɦɟɬɤɢ ɡɚɩɢɫɵɜɚɟɬɫɹ ɩɨ-ɪɚɡɧɨɦɭ. Ƚɥɚɜɧɚɹ ɢɞɟɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɡɚɦɟɧɟ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɚɞɪɟɫɨɜ ɧɚ ɚɛɫɨɥɸɬɧɵɟ. Ɉɛɵɱɧɨ ɩɨɞɩɪɨɝɪɚɦɦɚ ɜɵɡɵɜɚɟɬɫɹ ɧɟɫɤɨɥɶɤɨ ɪɚɡ ɢɡ ɪɚɡɧɵɯ ɭɱɚɫɬɤɨɜ ɩɪɨɝɪɚɦɦɵ. Ɍɨɝɞɚ ɧɟɫɤɨɥɶɤɨ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɚɞɪɟɫɨɜ ɛɭɞɭɬ ɩɪɟɨɛɪɚɡɨɜɚɧɵ ɜ ɨɞɢɧ ɚɛɫɨɥɸɬɧɵɣ ɚɞɪɟɫ, ɜɫɥɟɞɫɬɜɢɟ ɱɟɝɨ ɤɨɥɢɱɟɫɬɜɨ ɪɚɡɥɢɱɧɵɯ ɫɬɪɨɤ ɜ ɮɚɣɥɟ ɭɦɟɧɶɲɢɬɫɹ, ɚ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɜɨɡɪɚɫɬɟɬ. ɉɪɢɱɟɦ, ɧɟ ɨɛɹɡɚɬɟɥɶɧɨ ɩɨɥɭɱɚɬɶ ɢɫɬɢɧɧɵɟ ɚɛɫɨɥɸɬɧɵɟ ɚɞɪɟɫɚ ɦɟɬɨɤ. Ʌɢɲɶ ɛɵ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɛɵɥɨ ɨɛɪɚɬɢɦɨ. Ɋɚɫɫɦɨɬɪɢɦ, ɧɚɩɪɢɦɟɪ, ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɚɞɪɟɫɨɜ 32ɪɚɡɪɹɞɧɨɣ ɤɨɦɚɧɞɵ CALL. Ʉɨɦɚɧɞɚ ɡɚɩɢɫɵɜɚɟɬɫɹ ɜ ɜɢɞɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɩɹɬɢ ɛɚɣɬɨɜ: 0xE8
R0
R1
R2
R3
Ɉɬɧɨɫɢɬɟɥɶɧɨɟ ɫɦɟɳɟɧɢɟ R ɜɵɱɢɫɥɹɟɬɫɹ ɩɨ ɮɨɪɦɭɥɟ: R = R0 + (R1<<8) + (R2<<16) + (R3<<24) Ɂɧɚɹ ɫɦɟɳɟɧɢɟ ɤɨɦɚɧɞɵ CALL ɨɬ ɧɚɱɚɥɚ ɮɚɣɥɚ ɢ ɨɬɧɨɫɢɬɟɥɶɧɨɟ ɫɦɟɳɟɧɢɟ R, ɦɨɠɧɨ ɜɵɱɢɫɥɢɬɶ ɚɛɫɨɥɸɬɧɵɣ ɚɞɪɟɫ. ɉɪɢ ɷɬɨɦ ɫɥɟɞɭɟɬ ɭɱɢɬɵɜɚɬɶ, ɱɬɨ ɧɟ ɜɫɟ ɫɢɦɜɨɥɵ ɫ ɤɨɞɨɦ 0xE8 ɹɜɥɹɸɬɫɹ ɧɚɱɚɥɨɦ ɤɨɦɚɧɞɵ CALL. ɑɬɨɛɵ ɨɬɥɢɱɢɬɶ ɧɚɫɬɨɹɳɢɟ 308 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɤɨɦɚɧɞɵ, ɩɪɟɞɥɚɝɚɟɬɫɹ ɞɨɜɨɥɶɧɨ ɩɪɨɫɬɨɣ ɫɩɨɫɨɛ, ɩɪɢɦɟɧɟɧɧɵɣ ɜ ɚɪɯɢɜɚɬɨɪɟ CABARC [3]. ȼɜɟɞɟɦ ɫɥɟɞɭɸɳɢɟ ɨɛɨɡɧɚɱɟɧɢɹ: C N R A
ɜɟɥɢɱɢɧɚ ɫɦɟɳɟɧɢɹ ɚɧɚɥɢɡɢɪɭɟɦɨɣ ɤɨɦɚɧɞɵ ɨɬ ɧɚɱɚɥɚ ɮɚɣɥɚ (ɚ ɢɦɟɧɧɨ, ɫɦɟɳɟɧɢɟ ɛɚɣɬɚ ɤɨɞɚ ɨɩɟɪɚɰɢɢ – 0xE8 ɢɥɢ 0xE9) ɪɚɡɦɟɪ ɮɚɣɥɚ ɫɦɟɳɟɧɢɟ ɦɟɬɤɢ, ɧɚ ɤɨɬɨɪɭɸ ɭɤɚɡɵɜɚɟɬ ɨɩɟɪɚɧɞ ɤɨɦɚɧɞɵ, ɨɬɧɨɫɢɬɟɥɶɧɨ ɫɚɦɨɣ ɤɨɦɚɧɞɵ CALL ɚɛɫɨɥɸɬɧɵɣ ɚɞɪɟɫ ɦɟɬɤɢ
Ɋɚɡɞɟɥɢɦ ɜɫɟ ɡɧɚɱɟɧɢɹ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɫɦɟɳɟɧɢɣ ɧɚ 4 ɞɢɚɩɚɡɨɧɚ. ɉɟɪɜɵɦ ɞɟɥɨɦ ɨɩɪɟɞɟɥɢɦ ɞɢɚɩɚɡɨɧ ɡɧɚɱɟɧɢɣ ɫɦɟɳɟɧɢɣ, ɤɨɬɨɪɵɟ ɢɦɟɟɬ ɫɦɵɫɥ ɩɨɞɜɟɪɝɚɬɶ ɩɪɟɨɛɪɚɡɨɜɚɧɢɸ. Ɇɢɧɢɦɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ ɷɬɨɝɨ ɞɢɚɩɚɡɨɧɚ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɫɫɵɥɤɟ ɤɨɦɚɧɞɵ ɧɚ ɧɚɱɚɥɨ ɮɚɣɥɚ, ɦɚɤɫɢɦɚɥɶɧɨɟ — ɧɚ ɤɨɧɟɰ. ɋɦɟɳɟɧɢɹ, ɩɪɢɧɢɦɚɸɳɢɟ ɡɧɚɱɟɧɢɹ ɦɟɧɶɲɟ ɜɵɲɟɭɤɚɡɚɧɧɵɯ, ɧɟɰɟɥɟɫɨɨɛɪɚɡɧɨ ɩɨɞɜɟɪɝɚɬɶ ɩɪɟɨɛɪɚɡɨɜɚɧɢɸ, ɩɨɫɤɨɥɶɤɭ ɨɱɟɜɢɞɧɨ, ɨɧɢ ɧɟ ɩɪɢɧɚɞɥɟɠɚɬ ɤɨɦɚɧɞɚɦ. ɗɬɨ ɜɬɨɪɨɣ ɞɢɚɩɚɡɨɧ. ɉɪɟɠɞɟ ɱɟɦ ɨɩɪɟɞɟɥɹɬɶ ɨɫɬɚɥɶɧɵɟ ɞɜɚ ɞɢɚɩɚɡɨɧɚ, ɪɚɫɫɦɨɬɪɢɦ ɩɪɨɰɟɫɫ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɡɧɚɱɟɧɢɣ ɢɡ ɩɟɪɜɨɝɨ ɞɢɚɩɚɡɨɧɚ ɜ ɚɛɫɨɥɸɬɧɵɟ: A=R+C ȼ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɩɨɥɭɱɢɦ ɜɟɥɢɱɢɧɭ, ɤɨɬɨɪɚɹ ɦɨɠɟɬ ɩɪɢɧɢɦɚɬɶ ɡɧɚɱɟɧɢɹ ɨɬ ɧɭɥɹ ɞɨ N–1. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɦɵ ɨɬɨɛɪɚɠɚɟɦ ɡɧɚɱɟɧɢɹ ɢɡ ɨɬɪɟɡɤɚ [–C,N–C) ɧɚ ɡɧɚɱɟɧɢɹ ɨɬɪɟɡɤɚ [0,N). Ⱦɥɹ ɨɛɟɫɩɟɱɟɧɢɹ ɜɨɡɦɨɠɧɨɫɬɢ ɨɞɧɨɡɧɚɱɧɨɝɨ ɞɟɤɨɞɢɪɨɜɚɧɢɹ ɜɜɟɞɟɦ ɬɪɟɬɢɣ ɞɢɚɩɚɡɨɧ [0,N), ɧɚɞ ɤɨɬɨɪɵɦ ɛɭɞɟɦ ɨɫɭɳɟɫɬɜɥɹɬɶ ɤɨɦɩɟɧɫɢɪɭɸɳɟɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ, ɬ.ɟ. [0,N) Æ [–C, N–C).
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 309 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɉɫɬɚɜɲɢɟɫɹ ɡɧɚɱɟɧɢɹ ɫɦɟɳɟɧɢɣ ɩɨɦɟɫɬɢɦ ɜ ɱɟɬɜɟɪɬɵɣ ɞɢɚɩɚɡɨɧ. ɗɬɢ ɡɧɚɱɟɧɢɹ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɛɭɞɭɬ ɨɫɬɚɜɚɬɶɫɹ ɧɟɢɡɦɟɧɧɵɦɢ. ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɚɞɪɟɫɨɜ ɦɨɠɧɨ ɩɪɟɞɫɬɚɜɢɬɶ ɜ ɜɢɞɟ ɪɢɫ. 7.4. ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɡɧɚɱɟɧɢɣ [– C,N–C) ɜ ɚɛɫɨɥɸɬɧɵɟ ɡɧɚɱɟɧɢɹ [0,N) ɩɨɤɚɡɚɧɨ ɬɨɥɫɬɨɣ ɫɩɥɨɲɧɨɣ ɫɬɪɟɥɤɨɣ, ɤɨɦɩɟɧɫɢɪɭɸɳɟɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ — ɬɨɥɫɬɨɣ ɩɭɧɤɬɢɪɧɨɣ. [–0x80000000, –C) [–C,N–C) [N–C,N) [N,0x7FFFFFFF) ɛɟɡ ɢɡɦɟɧɟɧɢɣ ɛɟɡ ɢɡɦɟɧɟɧɢɣ
[–0x80000000, –C)
[–C,0)
[0,N)
[N,0x7FFFFFFF)
Ɋɢɫ. 7.4. ɋɯɟɦɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɡɧɚɱɟɧɢɣ ɜ ɚɛɫɨɥɸɬɧɵɟ ɉɨɫɥɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɡɚɦɟɧɢɦ ɡɚɩɢɫɶ ɤɨɦɚɧɞɵ CALL ɫɥɟɞɭɸɳɟɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶɸ: 0xE8
A0
A1
A2
A3
ɝɞɟ A0 = A & 0xFF A1 = (A>>8) & 0xFF A2 = (A>>16) & 0xFF A3 = (A>>24) & 0xFF Ɏɭɧɤɰɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɜɵɝɥɹɞɢɬ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ: // in — ɭɤɚɡɚɬɟɥɶ ɧɚ ɧɚɣɞɟɧɧɭɸ ɤɨɦɚɧɞɭ // op — ɚɞɪɟɫ ɜ ɛɭɮɟɪɟ, ɝɞɟ ɡɚɩɢɫɚɧ ɨɩɟɪɚɧɞ
310 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
// cur_pos — ɧɨɦɟɪ ɩɨɡɢɰɢɢ ɤɨɦɚɧɞɵ ɜ ɮɚɣɥɟ // file_size — ɪɚɡɦɟɪ ɮɚɣɥɚ op = (long if( *op >= *op < *op += } else if(
*)&in[1]; -cur_pos && file_size — cur_pos ) { cur_pos; *op > 0 && *op < file_size ) { *op -= file_size;
}
Ⱥɧɚɥɨɝɢɱɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɜɵɩɨɥɧɹɟɬɫɹ ɢ ɞɥɹ ɤɨɦɚɧɞɵ ɛɟɡɭɫɥɨɜɧɨɝɨ ɩɟɪɟɯɨɞɚ, JMP. ɉɪɚɜɞɚ, ɡɚɦɟɧɚ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɡɧɚɱɟɧɢɣ ɚɞɪɟɫɨɜ ɞɥɹ ɷɬɨɣ ɤɨɦɚɧɞɵ ɧɟ ɬɚɤ ɷɮɮɟɤɬɢɜɧɚ. ȼ ɱɚɫɬɧɨɫɬɢ, ɢɡ-ɡɚ ɬɨɝɨ, ɱɬɨ, ɤɚɤ ɩɪɚɜɢɥɨ, ɱɢɫɥɨ ɤɨɦɚɧɞ ɨɬɧɨɫɢɬɟɥɶɧɨɝɨ ɩɟɪɟɯɨɞɚ ɧɚ ɨɞɢɧ ɢ ɬɨɬ ɠɟ ɚɛɫɨɥɸɬɧɵɣ ɚɞɪɟɫ ɜ ɫɪɟɞɧɟɦ ɦɟɧɶɲɟ, ɱɟɦ ɤɨɥɢɱɟɫɬɜɨ ɜɵɡɨɜɨɜ ɨɞɧɨɣ ɢ ɬɨɣ ɠɟ ɩɨɞɩɪɨɝɪɚɦɦɵ. Ⱥ ɬɚɤɠɟ ɢɡ-ɡɚ ɬɨɝɨ, ɱɬɨ ɨɬɧɨɫɢɬɟɥɶɧɵɟ ɚɞɪɟɫɚ ɨɛɵɱɧɨ ɩɪɢɧɢɦɚɸɬ ɦɟɧɶɲɢɟ ɡɧɚɱɟɧɢɹ, ɱɟɦ ɜ ɫɥɭɱɚɟ ɫ ɤɨɦɚɧɞɨɣ CALL, ɬ.ɟ. ɦɨɝɭɬ ɛɵɬɶ ɷɮɮɟɤɬɢɜɧɨ ɫɠɚɬɵ ɢ ɛɟɡ ɤɚɤɨɝɨ-ɥɢɛɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. ɉɨɷɬɨɦɭ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɦɨɠɟɬ ɞɚɠɟ ɭɯɭɞɲɢɬɶ ɫɠɚɬɢɟ. Ɋɟɲɟɧɢɟ ɨ ɩɪɢɦɟɧɟɧɢɢ ɞɚɧɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɦɨɠɧɨ ɩɪɢɧɢɦɚɬɶ ɧɚ ɨɫɧɨɜɟ ɨɰɟɧɤɢ ɫɬɚɬɢɫɬɢɤɢ ɟɝɨ ɜɵɩɨɥɧɟɧɢɹ. Ʉɪɢɬɟɪɢɟɦ ɰɟɥɟɫɨɨɛɪɚɡɧɨɫɬɢ ɜɵɩɨɥɧɟɧɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɦɨɠɟɬ ɜɵɫɬɭɩɚɬɶ ɫɥɟɞɭɸɳɟɟ ɭɫɥɨɜɢɟ: ɞɨɥɹ ɤɨɦɩɟɧɫɢɪɭɸɳɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ ɚɞɪɟɫɨɜ ɧɟɡɧɚɱɢɬɟɥɶɧɚ, ɢ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɩɨɥɭɱɚɟɬɫɹ ɛɨɥɶɲɨɟ ɱɢɫɥɨ ɫɨɜɩɚɞɚɸɳɢɯ ɡɧɚɱɟɧɢɣ ɚɛɫɨɥɸɬɧɵɯ ɚɞɪɟɫɨɜ. ɋɪɚɜɧɢɦ ɜɥɢɹɧɢɟ ɨɩɢɫɵɜɚɟɦɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɤɨɦɚɧɞ CALL ɢ JMP ɧɚ ɫɠɚɬɢɟ ɞɚɧɧɵɯ ɤɨɦɩɪɟɫɫɨɪɚɦɢ, ɩɪɟɞɫɬɚɜɥɹɸɳɢɦɢ ɪɚɡɥɢɱɧɵɟ ɦɟɬɨɞɵ. ȼ ɤɚɱɟɫɬɜɟ ɬɟɫɬɨɜɨɝɨ ɮɚɣɥɚ ɛɵɥ ɢɫɩɨɥɶɡɨɜɚɧ ɢɫɩɨɥɧɢɦɵɣ ɦɨɞɭɥɶ wcc386.exe ɢɡ ɞɢɫɬɪɢɛɭɬɢɜɚ Watcom C 10.0.
Ɍɚɛɥɢɰɚ 7.11 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 311 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱥɪɯɢɜɚɬɨɪ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ
Bzip2, ɜɟɪ 1.00 WinRAR, ɜɟɪ 2.70 HA a2, ɜɟɪ. 0.999ɫ
BWT
308624
291492
5.55%
292051
5.37%
LZ77
298959
281584
5.81%
280995
6.01%
PPM
296769
280316
5.54%
279959
5.66%
Ɂɚɦɟɧɚ ɨɩɟɪɚɧɞɨɜ ɤɨɦɚɧɞɵ CALL Ɋɚɡɦɟɪ ɍɥɭɱɚɪɯɢɜɚ ɲɟɧɢɟ ɫɠɚɬɢɹ
Ɂɚɦɟɧɚ ɨɩɟɪɚɧɞɨɜ ɤɨɦɚɧɞ CALL ɢ JMP Ɋɚɡɦɟɪ ɍɥɭɱɚɪɯɢɜɚ ɲɟɧɢɟ ɫɠɚɬɢɹ
ɋɥɟɞɭɟɬ ɨɬɦɟɬɢɬɶ, ɱɬɨ ɞɚɧɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ, ɯɨɬɹ ɢ ɹɜɥɹɟɬɫɹ ɞɨɫɬɚɬɨɱɧɨ ɩɪɨɫɬɵɦ ɢ ɷɮɮɟɤɬɢɜɧɵɦ, ɦɨɠɟɬ ɛɵɬɶ ɭɫɨɜɟɪɲɟɧɫɬɜɨɜɚɧɨ ɞɥɹ ɞɨɫɬɢɠɟɧɢɹ ɛɨɥɟɟ ɫɢɥɶɧɨɝɨ ɫɠɚɬɢɹ. ɇɚɩɪɢɦɟɪ, ɦɨɠɧɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɤɨɞ ɨɩɟɪɚɰɢɢ 0xE8 ɫɨɫɟɞɫɬɜɭɟɬ ɫ ɦɥɚɞɲɢɦ ɛɚɣɬɨɦ ɡɧɚɱɟɧɢɹ ɚɛɫɨɥɸɬɧɨɝɨ ɚɞɪɟɫɚ A0, ɜ ɬɨ ɜɪɟɦɹ ɤɚɤ ɛɨɥɟɟ ɥɨɝɢɱɧɵɦ ɛɵɥɨ ɛɵ ɪɚɫɩɨɥɨɠɢɬɶ ɪɹɞɨɦ ɛɨɥɟɟ ɫɜɹɡɚɧɧɵɟ ɞɪɭɝ ɫ ɞɪɭɝɨɦ 0xE8 ɢ A3. Ɍ.ɟ., ɦɨɠɧɨ ɡɚɩɢɫɵɜɚɬɶ ɡɧɚɱɟɧɢɟ ɚɛɫɨɥɸɬɧɨɝɨ ɚɞɪɟɫɚ ɫɬɚɪɲɢɦɢ ɛɚɣɬɚɦɢ ɜɩɟɪɟɞ. Ⱦɪɭɝɨɣ ɫɩɨɫɨɛ ɩɨɜɵɲɟɧɢɹ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɦ ɫɨɫɬɚɜɥɟɧɢɢ ɫɩɢɫɤɚ ɜɫɟɯ ɩɪɨɰɟɞɭɪ, ɧɚ ɤɨɬɨɪɵɟ ɞɟɥɚɸɬɫɹ ɫɫɵɥɤɢ ɜ ɩɪɨɝɪɚɦɦɟ, ɢ ɭɤɚɡɚɧɢɢ ɧɨɦɟɪɨɜ ɩɪɨɰɟɞɭɪ ɜ ɫɩɢɫɤɟ ɜɦɟɫɬɨ ɚɞɪɟɫɨɜ.
ɍɩɪɚɠɧɟɧɢɟ: ɇɚɩɢɲɢɬɟ ɩɪɨɰɟɞɭɪɭ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɚɛɫɨɥɸɬɧɨɝɨ ɡɧɚɱɟɧɢɹ ɚɞɪɟɫɚ ɜ ɨɬɧɨɫɢɬɟɥɶɧɨɟ. ɉɊȿɈȻɊȺɁɈȼȺɇɂȿ ɌȺȻɅɂɑɇɕɏ ɋɌɊɍɄɌɍɊ
ȼ ɮɚɣɥɚɯ ɡɚɱɚɫɬɭɸ ɦɨɠɧɨ ɜɫɬɪɟɬɢɬɶ ɪɟɝɭɥɹɪɧɵɟ ɫɬɪɭɤɬɭɪɵ, ɬɚɤɢɟ ɤɚɤ, ɧɚɩɪɢɦɟɪ, ɪɚɡɥɢɱɧɨɝɨ ɪɨɞɚ ɫɥɭɠɟɛɧɵɟ ɬɚɛɥɢɰɵ, ɢ 312 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɬ.ɩ. Ɉɱɟɜɢɞɧɨ, ɬɚɤɢɟ ɫɬɪɭɤɬɭɪɵ ɬɪɟɛɭɸɬ ɨɫɨɛɨɝɨ ɜɧɢɦɚɧɢɹ. ɉɪɢɱɟɦ, ɧɟɨɛɹɡɚɬɟɥɶɧɨ ɢɯ ɜɵɧɨɫɢɬɶ ɜ ɨɬɞɟɥɶɧɵɣ ɮɚɣɥ ɢ ɫɠɢɦɚɬɶ ɩɪɢ ɩɨɦɨɳɢ ɫɩɟɰɢɚɥɢɡɢɪɨɜɚɧɧɨɝɨ ɚɥɝɨɪɢɬɦɚ. ɂɧɨɝɞɚ ɞɨɫɬɚɬɨɱɧɨ ɩɪɟɨɛɪɚɡɨɜɚɬɶ ɢɯ ɜ ɬɚɤɨɣ ɜɢɞ, ɤɨɬɨɪɵɣ ɛɭɞɟɬ ɩɪɢɟɦɥɟɦ ɢ ɞɥɹ ɭɧɢɜɟɪɫɚɥɶɧɨɝɨ ɚɪɯɢɜɚɬɨɪɚ. ɇɚɩɪɢɦɟɪ, ɪɚɫɫɦɨɬɪɢɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɬɚɛɥɢɰ, ɩɪɟɞɫɬɚɜɥɹɸɳɢɯ ɫɨɛɨɣ ɭɩɨɪɹɞɨɱɟɧɧɵɣ ɩɨ ɜɨɡɪɚɫɬɚɧɢɸ ɫɩɢɫɨɤ 32ɪɚɡɪɹɞɧɵɯ ɡɧɚɱɟɧɢɣ. ɑɟɦ ɧɚɦ ɦɨɝɭɬ ɩɨɦɟɲɚɬɶ ɷɬɢ ɫɬɪɭɤɬɭɪɵ ɜ ɩɟɪɜɨɧɚɱɚɥɶɧɨɦ ɜɢɞɟ? ɋɬɚɬɢɫɬɢɱɟɫɤɢɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɬɚɤɢɯ ɬɚɛɥɢɱɧɵɯ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ ɨɛɵɱɧɨ ɫɢɥɶɧɨ ɨɬɥɢɱɚɸɬɫɹ ɨɬ ɯɚɪɚɤɬɟɪɢɫɬɢɤ ɮɚɣɥɚ ɜ ɰɟɥɨɦ. ɇɚɩɪɢɦɟɪ, ɜ ɬɚɛɥɢɰɚɯ ɪɹɞɨɦ ɧɚɯɨɞɹɬɫɹ ɛɚɣɬɵ, ɢɦɟɸɳɢɟ ɪɚɡɧɵɣ ɜɟɫ ɜ ɫɨɫɬɚɜɟ 32-ɪɚɡɪɹɞɧɵɯ ɡɧɚɱɟɧɢɣ ɢ ɫɬɚɬɢɫɬɢɱɟɫɤɢ ɫɥɚɛɨɫɜɹɡɚɧɧɵɟ ɦɟɠɞɭ ɫɨɛɨɣ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɷɬɢ ɬɚɛɥɢɰɵ ɧɟ ɬɨɥɶɤɨ ɫɚɦɢ ɯɪɚɧɹɬɫɹ ɜ ɧɟɭɞɨɛɧɨɦ ɞɥɹ ɫɠɚɬɢɹ ɜɢɞɟ, ɧɨ ɢ ɭɯɭɞɲɚɸɬ ɫɠɚɬɢɟ ɨɤɪɭɠɚɸɳɢɯ ɢɯ ɞɚɧɧɵɯ ɡɚ ɫɱɟɬ ɢɫɤɚɠɟɧɢɹ ɜɟɪɨɹɬɧɨɫɬɧɵɯ ɯɚɪɚɤɬɟɪɢɫɬɢɤ. ɉɟɪɜɚɹ ɡɚɞɚɱɚ, ɤɨɬɨɪɚɹ ɜɫɬɚɟɬ ɩɟɪɟɞ ɧɚɦɢ — ɪɚɫɩɨɡɧɚɬɶ ɬɚɤɢɟ ɬɚɛɥɢɰɵ ɫɪɟɞɢ ɨɫɬɚɥɶɧɵɯ ɞɚɧɧɵɯ. ɍɱɬɟɦ, ɱɬɨ ɬɚɛɥɢɰɵ ɦɨɝɭɬ ɛɵɬɶ ɩɪɨɢɡɜɨɥɶɧɨɝɨ ɪɚɡɦɟɪɚ ɢ ɪɚɫɩɨɥɚɝɚɬɶɫɹ ɜ ɥɸɛɨɦ ɦɟɫɬɟ ɮɚɣɥɚ. Ȼɭɞɟɦ ɪɚɫɫɦɚɬɪɢɜɚɬɶ ɤɚɤɭɸ-ɬɨ ɨɛɥɚɫɬɶ ɞɚɧɧɵɯ ɤɚɤ ɬɚɛɥɢɰɭ ɩɪɢ ɜɵɩɨɥɧɟɧɢɢ ɫɥɟɞɭɸɳɢɯ ɭɫɥɨɜɢɣ: 1) ȿɫɥɢ ɧɚɦ ɜ ɮɚɣɥɟ ɜɫɬɪɟɬɢɥɢɫɶ ɩɨɞɪɹɞ ɬɪɢ 32-ɪɚɡɪɹɞɧɵɯ ɱɢɫɥɚ, ɢɞɭɳɢɟ ɜ ɧɟɭɛɵɜɚɸɳɟɦ ɩɨɪɹɞɤɟ, ɛɭɞɟɦ ɫɱɢɬɚɬɶ ɷɬɨ ɧɚɱɚɥɨɦ ɬɚɛɥɢɰɵ. ɇɚɩɪɢɦɟɪ (ɩɟɪɜɵɣ ɛɚɣɬ ɫɚɦɵɣ ɦɥɚɞɲɢɣ): 0x05 0x00 0x80 0x3f 0x05 0x00 0x80 0x3f 0x35 0x00 0x80 0x3f 2) ȿɫɥɢ ɷɬɢ ɱɢɫɥɚ ɦɨɝɭɬ ɛɵɬɶ ɡɚɤɨɞɢɪɨɜɚɧɵ ɩɪɢ ɩɨɦɨɳɢ RLE, ɨɬɤɚɡɵɜɚɟɦɫɹ ɨɬ ɩɪɢɦɟɧɟɧɢɹ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɬɚɛɥɢɰ. 3) Ʉɨɧɰɨɦ ɬɚɛɥɢɰɵ ɛɭɞɟɦ ɫɱɢɬɚɬɶ ɱɢɫɥɨ, ɤɨɬɨɪɨɟ ɩɪɟɜɵɲɚɟɬ ɩɪɟɞɵɞɭɳɟɟ ɛɨɥɟɟ ɱɟɦ ɧɚ 28–2, ɢɥɢ ɦɟɧɶɲɟ ɩɪɟɞɵɞɭɳɟɝɨ. ȼɵɩɨɥɧɢɦ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɬɚɤɢɯ ɬɚɛɥɢɰ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ: 1) ɉɟɪɜɵɟ 3 ɱɢɫɥɚ ɬɚɛɥɢɰɵ ɡɚɩɢɫɵɜɚɟɦ ɜ ɧɟɢɡɦɟɧɧɨɦ ɜɢɞɟ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 313 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
2) Ⱦɥɹ ɡɚɩɢɫɢ ɨɫɬɚɥɶɧɵɯ ɱɢɫɟɥ ɧɚɦ ɬɪɟɛɭɟɬɫɹ ɬɨɥɶɤɨ ɜɟɥɢɱɢɧɚ, ɧɚ ɤɨɬɨɪɭɸ ɤɚɠɞɨɟ ɱɢɫɥɨ ɨɬɥɢɱɚɟɬɫɹ ɨɬ ɩɪɟɞɵɞɭɳɟɝɨ. Ⱦɥɹ ɡɚɩɢɫɢ ɷɬɨɣ ɪɚɡɧɢɰɵ ɞɨɫɬɚɬɨɱɧɨ ɨɞɧɨɝɨ ɛɚɣɬɚ. 3) ȼ ɤɚɱɟɫɬɜɟ ɩɪɢɡɧɚɤɚ ɤɨɧɰɚ ɬɚɛɥɢɰɵ ɡɚɩɢɫɵɜɚɟɦ ɞɨɩɨɥɧɢɬɟɥɶɧɨ ɫɢɦɜɨɥ ɫ ɤɨɞɨɦ 28–1 = 0xFF. ȼ ɤɚɱɟɫɬɜɟ ɬɟɫɬɨɜɨɝɨ ɮɚɣɥɚ ɜɨɡɶɦɟɦ ɬɨɬ ɠɟ ɢɫɩɨɥɧɢɦɵɣ ɦɨɞɭɥɶ wcc386.exe ɢɡ ɞɢɫɬɪɢɛɭɬɢɜɚ Watcom C 10.0. Ɍɚɛɥɢɰɚ 7.12 Ⱥɪɯɢɜɚɬɨɪ
Ɍɢɩ ɦɟɬɨɞɚ ɫɠɚɬɢɹ
Ɋɚɡɦɟɪ ɚɪɯɢɜɚ
ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ 32ɪɚɡɪɹɞɧɵɯ ɬɚɛɥɢɰ Ɋɚɡɦɟɪ ɍɥɭɱɲɟɧɢɟ ɚɪɯɢɜɚ ɫɠɚɬɢɹ 306791 0.59%
Bzip2, ɜɟɪ 1.00 WinRAR, ɜɟɪ 2.70 HA a2, ɜɟɪ. 0.999ɫ
BWT
308624
LZ77
298959
298342
0.21%
PPM
296769
295240
0.52%
Ɇɨɠɧɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɞɥɹ ɚɪɯɢɜɚɬɨɪɚ, ɢɫɩɨɥɶɡɭɸɳɟɝɨ LZ77, ɜɵɢɝɪɵɲ ɜ ɫɠɚɬɢɢ ɨɤɚɡɚɥɫɹ ɫɭɳɟɫɬɜɟɧɧɨ ɦɟɧɶɲɟ, ɱɟɦ ɞɥɹ ɞɪɭɝɢɯ ɦɟɬɨɞɨɜ. ɗɬɨ ɨɛɴɹɫɧɹɟɬɫɹ ɨɫɨɛɟɧɧɨɫɬɶɸ ɚɥɝɨɪɢɬɦɚ ɤɨɞɢɪɨɜɚɧɢɹ ɭɤɚɡɚɬɟɥɟɣ, ɢɫɩɨɥɶɡɭɟɦɨɝɨ ɜ WinRAR, ɩɨɡɜɨɥɹɸɳɟɝɨ ɷɮɮɟɤɬɢɜɧɨ ɨɛɪɚɛɚɬɵɜɚɬɶ ɬɚɤɨɝɨ ɪɨɞɚ ɫɬɪɭɤɬɭɪɵ. Ɉɩɢɫɚɧɧɵɣ ɚɥɝɨɪɢɬɦ ɧɟ ɹɜɥɹɟɬɫɹ ɫɚɦɵɦ ɷɮɮɟɤɬɢɜɧɵɦ ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɫɠɚɬɢɹ, ɧɨ ɩɨɡɜɨɥɹɟɬ ɨɰɟɧɢɬɶ ɩɨɥɟɡɧɵɟ ɫɜɨɣɫɬɜɚ ɬɚɤɨɝɨ ɪɨɞɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ. ɋɩɨɫɨɛɨɜ ɭɥɭɱɲɟɧɢɹ ɞɨɜɨɥɶɧɨ ɦɧɨɝɨ. ɇɚɩɪɢɦɟɪ, ɛɨɥɶɲɢɟ ɬɚɛɥɢɰɵ ɫɥɟɞɭɟɬ ɤɨɞɢɪɨɜɚɬɶ ɨɬɞɟɥɶɧɨ ɨɬ ɜɫɟɝɨ ɮɚɣɥɚ. Ʉɪɨɦɟ ɬɨɝɨ, ɩɨɦɢɦɨ 32-ɪɚɡɪɹɞɧɵɯ ɬɚɛɥɢɰ, ɜ ɮɚɣɥɟ ɦɨɝɭɬ ɩɪɢɫɭɬɫɬɜɨɜɚɬɶ ɢ, ɧɚɩɪɢɦɟɪ, 16-ɪɚɡɪɹɞɧɵɟ; ɜ ɬɚɛɥɢɰɚɯ ɦɨɝɭɬ ɧɚɯɨɞɢɬɶɫɹ ɤɚɤ ɜɨɡɪɚɫɬɚɸɳɢɟ, ɬɚɤ ɢ ɭɛɵɜɚɸɳɢɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɱɢɫɟɥ ɢ ɬ.ɩ. ɂ, ɧɚɞɨ ɫɤɚɡɚɬɶ, ɡɚɱɚɫɬɭɸ ɫɭɦɦɚɪɧɵɣ ɷɮɮɟɤɬ ɨɬ ɩɪɢɦɟɧɟɧɢɹ ɬɚɤɨɝɨ ɪɨɞɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ ɨɤɚɡɵɜɚɟɬɫɹ ɞɨɜɨɥɶɧɨ ɨɳɭɬɢɦɵɦ. 314 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɍɩɪɚɠɧɟɧɢɟ: ɉɪɢɞɭɦɚɣɬɟ ɫɩɨɫɨɛ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɞɥɹ 16-ɪɚɡɪɹɞɧɵɯ ɬɚɛɥɢɰ.
ȼɨɩɪɨɫɵ ɞɥɹ ɫɚɦɨɤɨɧɬɪɨɥɹ10 1. ɉɨɱɟɦɭ ɧɟɜɵɝɨɞɧɨ ɜɤɥɸɱɟɧɢɟ ɞɥɢɧɧɵɯ ɮɪɚɡ ɜ ɫɥɨɜɚɪɶ nɝɪɚɮɨɜ? 2. Ʉɚɤɨɜɵ ɧɟɞɨɫɬɚɬɤɢ ɢ ɩɪɟɢɦɭɳɟɫɬɜɚ ɞɢɧɚɦɢɱɟɫɤɨɝɨ ɫɨɫɬɚɜɥɟɧɢɹ ɫɥɨɜɚɪɹ n-ɝɪɚɮɨɜ? 3. Ɉɛɴɹɫɧɢɬɟ, ɩɨɱɟɦɭ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɩɪɢ ɫɥɨɜɚɪɧɨɣ ɡɚɦɟɧɟ ɮɪɚɡ, ɫɨɞɟɪɠɚɳɢɯ ɩɪɨɛɟɥɵ, ɩɪɢɜɨɞɢɬ ɤ ɭɦɟɧɶɲɟɧɢɸ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ ɜ ɫɥɭɱɚɟ ɚɥɝɨɪɢɬɦɨɜ ɤɥɚɫɫɚ PPM ɢ BWT. 4. ɉɨɱɟɦɭ ɩɪɢ ɨɪɝɚɧɢɡɚɰɢɢ LIPT ɞɥɹ ɡɚɩɢɫɢ ɢɧɞɟɤɫɚ ɮɪɚɡ ɭɞɨɛɧɨ ɢɫɩɨɥɶɡɨɜɚɬɶ ɬɨɥɶɤɨ ɬɟ ɫɢɦɜɨɥɵ, ɤɨɬɨɪɵɟ ɜɯɨɞɹɬ ɜ ɫɥɨɜɚɪɶ ɛɭɤɜ? 5. ȼ ɤɚɤɢɯ ɫɥɭɱɚɹɯ ɩɪɢ ɫɩɟɰɢɚɥɶɧɨɦ ɤɨɞɢɪɨɜɚɧɢɢ ɫɢɦɜɨɥɨɜ ɤɨɧɰɚ ɫɬɪɨɤɢ ɜɵɝɨɞɧɟɟ ɭɤɚɡɵɜɚɬɶ ɞɥɢɧɭ ɫɬɪɨɤɢ ɧɟ ɱɟɪɟɡ ɤɨɥɢɱɟɫɬɜɨ ɫɢɦɜɨɥɨɜ, ɚ ɱɟɪɟɡ ɤɨɥɢɱɟɫɬɜɨ ɩɪɨɛɟɥɨɜ? 6. ɉɨɱɟɦɭ ɩɪɢ ɩɪɟɨɛɪɚɡɨɜɚɧɢɢ ɨɬɧɨɫɢɬɟɥɶɧɨɝɨ ɚɞɪɟɫɚ ɩɨɞɩɪɨɝɪɚɦɦ, ɜɵɡɵɜɚɟɦɵɯ ɤɨɦɚɧɞɨɣ CALL, ɨɛɵɱɧɨ ɜɵɝɨɞɧɨ ɡɚɩɢɫɵɜɚɬɶ ɡɧɚɱɟɧɢɟ ɚɛɫɨɥɸɬɧɨɝɨ ɚɞɪɟɫɚ ɫɬɚɪɲɢɦɢ ɛɚɣɬɚɦɢ ɜɩɟɪɟɞ? 7. ɉɨɱɟɦɭ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɚɞɪɟɫɨɜ ɞɥɹ ɤɨɦɚɧɞɵ JUMP, ɤɚɤ ɩɪɚɜɢɥɨ, ɦɟɧɟɟ ɷɮɮɟɤɬɢɜɧɨ, ɱɟɦ ɞɥɹ CALL?
Ʌɢɬɟɪɚɬɭɪɚ 1. Awan F., Motgi N.Zh.N., Iqbal R., Mukherjee A. LIPT: A Reversible Lossless Text Transform to Improve Compression Per10
Ɉɬɜɟɬɵ ɤ ɜɨɩɪɨɫɚɦ ɢ ɭɩɪɚɠɧɟɧɢɹɦ ɢ ɢɫɯɨɞɧɵɟ ɬɟɤɫɬɵ ɩɪɨɝɪɚɦɦ ɜɵ ɦɨɠɟɬɟ ɧɚɣɬɢ ɧɚ http://www.compression.ru/
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 315 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
formance // Proceedings of Data Compression Conference, Snowbird, Utah, March 2001. 2. Grabowski Sz. Text preprocessing for Burrows-Wheeler block sorting compression // VII Konferencja "Sieci i Systemy Informatyczne" (7th Conference "Networks and IT Systems"), Lodz, Oct. 1999, conf. proc., pp. 229-239. http://www.compression.ru/download/articles/text/grabowski_19 99_preproc_rtf.rar 3. Microsoft Corporation. Microsoft LZX Data Compression Format. 1997. 4. Teahan W.J. Modelling English Texts // PhD thesis, Department of Computer Science, The University of Waikato, Hamilton, New Zealand, May 1998.
ȼɵɛɨɪ ɦɟɬɨɞɚ ɫɠɚɬɢɹ ȼ ɡɚɤɥɸɱɟɧɢɟ ɪɚɡɞɟɥɚ ɫɤɚɠɟɦ ɧɟɫɤɨɥɶɤɨ ɫɥɨɜ ɨ ɩɪɨɰɟɞɭɪɟ ɜɵɛɨɪɚ ɦɟɬɨɞɚ ɫɠɚɬɢɹ. ȼɵɛɨɪ ɦɟɬɨɞɚ — ɷɬɨ ɩɟɪɜɚɹ ɡɚɞɚɱɚ, ɤɨɬɨɪɭɸ ɞɨɥɠɟɧ ɪɟɲɢɬɶ ɪɚɡɪɚɛɨɬɱɢɤ ɩɪɨɝɪɚɦɦɧɵɯ ɫɪɟɞɫɬɜ ɫɠɚɬɢɹ ɞɚɧɧɵɯ. ȼɵɛɨɪ ɡɚɜɢɫɢɬ ɨɬ ɬɢɩɚ ɞɚɧɧɵɯ, ɤɨɬɨɪɵɟ ɩɪɟɞɫɬɨɢɬ ɨɛɪɚɛɚɬɵɜɚɬɶ, ɚɩɩɚɪɚɬɧɵɯ ɪɟɫɭɪɫɨɜ, ɬɪɟɛɨɜɚɧɢɣ ɤ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɢ ɨɝɪɚɧɢɱɟɧɢɣ ɧɚ ɜɪɟɦɹ ɪɚɛɨɬɵ ɩɪɨɝɪɚɦɦɵ. Ⱦɚɞɢɦ ɪɹɞ ɪɟɤɨɦɟɧɞɚɰɢɣ, ɩɪɟɞɩɨɥɚɝɚɹ, ɱɬɨ ɧɟɨɛɯɨɞɢɦɨ ɫɠɢɦɚɬɶ ɤɚɱɟɫɬɜɟɧɧɵɟ ɞɚɧɧɵɟ, ɦɟɠɞɭ ɷɥɟɦɟɧɬɚɦɢ ɤɨɬɨɪɵɯ ɢɦɟɸɬɫɹ ɫɢɥɶɧɵɟ ɢ ɞɨɫɬɚɬɨɱɧɨ ɩɪɨɬɹɠɟɧɧɵɟ ɫɬɚɬɢɫɬɢɱɟɫɤɢɟ ɫɜɹɡɢ, ɬ.ɟ. ɞɚɧɧɵɟ ɩɨɪɨɠɞɟɧɵ ɢɫɬɨɱɧɢɤɨɦ ɫ ɩɚɦɹɬɶɸ. ɉɪɟɠɞɟ ɜɫɟɝɨ, ɫɥɟɞɭɟɬ ɭɱɢɬɵɜɚɬɶ, ɱɬɨ ɤɚɠɞɵɣ ɢɡ ɪɚɫɫɦɨɬɪɟɧɧɵɯ ɜ ɪɚɡɞɟɥɟ ɭɧɢɜɟɪɫɚɥɶɧɵɯ ɦɟɬɨɞɨɜ ɫɠɚɬɢɹ ɞɚɧɧɵɯ ɢɫɬɨɱɧɢɤɨɜ ɫ ɩɚɦɹɬɶɸ ɞɨɩɭɫɤɚɟɬ ɦɨɞɢɮɢɤɚɰɢɢ, ɩɨɡɜɨɥɹɸɳɢɟ ɫɭɳɟɫɬɜɟɧɧɨ ɢɡɦɟɧɢɬɶ ɩɚɪɚɦɟɬɪɵ ɤɨɦɩɪɟɫɫɨɪɚ. Ɍɚɤ, ɭɜɟɥɢɱɟɧɢɟ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ PPM ɩɪɢɜɨɞɢɬ ɤ ɡɚɦɟɬɧɨɦɭ ɭɫɢɥɟɧɢɸ ɫɠɚɬɢɹ ɰɟɧɨɣ ɡɚɦɟɞɥɟɧɢɹ ɪɚɛɨɬɵ ɢ ɭɜɟɥɢɱɟɧɢɹ ɪɚɫɯɨɞɨɜ ɩɚɦɹɬɢ. Ʉ ɚɧɚɥɨɝɢɱɧɨɦɭ ɪɟɡɭɥɶɬɚɬɭ ɩɪɢɜɨɞɢɬ ɭɜɟɥɢɱɟɧɢɟ ɪɚɡɦɟɪɚ ɫɥɨɜɚɪɹ 316 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
LZ77-ɦɟɬɨɞɨɜ, ɧɨ ɩɪɢ ɷɬɨɦ ɜɪɟɦɹ ɪɚɡɠɚɬɢɹ ɨɫɬɚɟɬɫɹ ɩɪɚɤɬɢɱɟɫɤɢ ɧɟɢɡɦɟɧɧɵɦ. ɋɜɨɣɫɬɜɚ ɤɨɦɩɪɟɫɫɨɪɨɜ ɧɚ ɨɫɧɨɜɟ BWT ɜɚɪɶɢɪɭɸɬɫɹ ɜ ɦɟɧɶɲɟɣ ɫɬɟɩɟɧɢ. Ɉɝɪɚɧɢɱɟɧɢɹ ɧɚ ɜɪɟɦɹ ɪɚɛɨɬɵ ɩɪɨɝɪɚɦɦɵ ɜɨɡɧɢɤɚɸɬ ɜ ɡɚɜɢɫɢɦɨɫɬɢ ɨɬ ɭɫɥɨɜɢɣ, ɜ ɤɨɬɨɪɵɯ ɩɪɟɞɫɬɨɢɬ ɪɚɛɨɬɚɬɶ ɚɪɯɢɜɚɬɨɪɭ. ɇɚɩɪɢɦɟɪ, ɩɪɢ ɫɠɚɬɢɢ ɞɚɧɧɵɯ ɞɥɹ ɮɨɪɦɢɪɨɜɚɧɢɹ ɞɢɫɬɪɢɛɭɬɢɜɚ ɩɪɨɝɪɚɦɦɧɨɝɨ ɨɛɟɫɩɟɱɟɧɢɹ ɨɝɪɚɧɢɱɟɧɢɟ ɧɚ ɜɪɟɦɹ ɤɨɦɩɪɟɫɫɢɢ ɩɪɚɤɬɢɱɟɫɤɢ ɨɬɫɭɬɫɬɜɭɟɬ, ɜ ɬɨ ɜɪɟɦɹ ɤɚɤ ɬɪɟɛɭɟɬɫɹ ɦɚɤɫɢɦɚɥɶɧɨ ɭɦɟɧɶɲɢɬɶ ɜɪɟɦɹ ɜɨɫɫɬɚɧɨɜɥɟɧɢɹ ɢɫɯɨɞɧɵɯ ɞɚɧɧɵɯ. ɉɪɢ ɪɟɡɟɪɜɧɨɦ ɫɨɯɪɚɧɟɧɢɢ ɞɚɧɧɵɯ ɩɨɥɨɠɟɧɢɟ ɜɟɳɟɣ ɨɛɪɚɬɧɨ, ɩɨɫɤɨɥɶɤɭ ɫɢɬɭɚɰɢɹ, ɤɨɝɞɚ ɬɪɟɛɭɟɬɫɹ ɜɵɩɨɥɧɢɬɶ ɪɚɡɠɚɬɢɟ, ɞɨɜɨɥɶɧɨ ɪɟɞɤɚ. ɇɟɨɛɯɨɞɢɦɨɫɬɶ ɨɩɟɪɚɬɢɜɧɨɣ ɩɟɪɟɞɚɱɢ ɞɚɧɧɵɯ ɩɨ ɫɟɬɢ ɨɛɭɫɥɚɜɥɢɜɚɟɬ ɨɞɢɧɚɤɨɜɵɟ ɬɪɟɛɨɜɚɧɢɹ ɤ ɜɪɟɦɟɧɚɦ ɫɠɚɬɢɹ ɢ ɪɚɡɠɚɬɢɹ; ɟɫɥɢ ɞɚɧɧɵɟ ɩɟɪɟɞɚɸɬɫɹ ɧɟɫɤɨɥɶɤɢɦ ɚɛɨɧɟɧɬɚɦ, ɧɟɤɨɬɨɪɨɟ ɩɪɟɢɦɭɳɟɫɬɜɨ ɢɦɟɸɬ ɚɪɯɢɜɚɬɨɪɵ, ɨɛɥɚɞɚɸɳɢɟ ɛɨɥɟɟ ɛɵɫɬɪɵɦ ɚɥɝɨɪɢɬɦɨɦ ɪɚɡɠɚɬɢɹ. Ɇɟɬɨɞɵ ɫɟɦɟɣɫɬɜɚ LZ77 ɨɛɥɚɞɚɸɬ ɧɚɢɛɨɥɶɲɟɣ ɫɤɨɪɨɫɬɶɸ ɞɟɤɨɦɩɪɟɫɫɢɢ. ɉɪɟɜɵɲɟɧɢɟ ɧɚɞ ɫɤɨɪɨɫɬɶɸ ɫɠɚɬɢɹ ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɦɟɬɨɞɚ ɏɚɮɮɦɚɧɚ ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ɪɟɡɭɥɶɬɚɬɨɜ ɪɚɛɨɬɵ LZ77-ɦɟɬɨɞɚ — ɞɟɫɹɬɢɤɪɚɬɧɨɟ. Ɇɟɧɶɲɚɹ ɪɚɡɧɢɰɚ ɭ ɦɟɬɨɞɨɜ ɧɚ ɨɫɧɨɜɟ BWT — ɜ ɫɪɟɞɧɟɦ ɫɤɨɪɨɫɬɶ ɪɚɡɠɚɬɢɹ ɜ 2-4 ɪɚɡɚ ɜɵɲɟ ɫɤɨɪɨɫɬɢ ɫɠɚɬɢɹ. Ⱦɟɤɨɞɢɪɨɜɚɧɢɟ ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ PPM ɧɚ 510% ɦɟɞɥɟɧɧɟɟ ɤɨɞɢɪɨɜɚɧɢɹ. Ʉɨɦɩɪɟɫɫɨɪɵ ɧɚ ɛɚɡɟ ɱɚɫɬɢɱɧɵɯ ɫɨɪɬɢɪɭɸɳɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ ɦɚɥɨɝɨ ɩɨɪɹɞɤɚ ɯɚɪɚɤɬɟɪɢɡɭɸɬɫɹ ɟɳɟ ɛɨɥɶɲɢɦ ɨɬɫɬɚɜɚɧɢɟɦ ɪɚɡɠɚɬɢɹ — ɧɚ ɧɟɤɨɬɨɪɵɯ ɮɚɣɥɚɯ ɨɧɨ ɜ ɧɟɫɤɨɥɶɤɨ ɪɚɡ ɦɟɞɥɟɧɧɟɟ ɫɠɚɬɢɹ. ɉɨɯɨɠɚɹ ɤɚɪɬɢɧɚ ɧɚɛɥɸɞɚɟɬɫɹ, ɟɫɥɢ ɫɪɚɜɧɢɜɚɬɶ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɩɚɦɹɬɢ ɩɪɢ ɞɟɤɨɞɢɪɨɜɚɧɢɢ. ȼ ɫɥɭɱɚɟ ɩɪɢɦɟɧɟɧɢɹ LZ77 ɪɚɫɯɨɞɵ ɩɚɦɹɬɢ ɦɢɧɢɦɚɥɶɧɵ. Ⱥɪɯɢɜɚɬɨɪɵ ɧɚ ɨɫɧɨɜɟ PPM ɧɚɢɛɨɥɟɟ ɬɪɟɛɨɜɚɬɟɥɶɧɵ — ɢɦ ɧɟɨɛɯɨɞɢɦɨ ɫɬɨɥɶɤɨ ɠɟ ɩɚɦɹɬɢ, ɫɤɨɥɶɤɨ ɢ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ. ɋɥɟɞɭɟɬ ɨɬɦɟɬɢɬɶ, ɱɬɨ ɩɪɢ ɫɠɚɬɢɢ ɬɪɟɛɨɜɚɧɢɹ ɤ ɩɚɦɹɬɢ ɭ ɩɪɨɝɪɚɦɦ-ɩɪɟɞɫɬɚɜɢɬɟɥɟɣ ɪɚɡɧɵɯ ɦɟɬɨɞɨɜ ɩɪɢɦɟɪɧɨ ɛɥɢɡɤɢ, ɯɨɬɹ ɢ ɦɨɝɭɬ ɢɡɦɟɧɹɬɶɫɹ ɞɥɹ ɪɚɡɧɵɯ ɬɢɩɨɜ ɫɠɢɦɚɟɦɵɯ ɞɚɧɧɵɯ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 317 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɟɫɥɢ ɦɨɠɧɨ ɩɪɟɧɟɛɪɟɱɶ ɫɬɟɩɟɧɶɸ ɫɠɚɬɢɹ, ɦɟɬɨɞɵ ɫɟɦɟɣɫɬɜɚ LZ77 ɧɚɢɛɨɥɟɟ ɷɮɮɟɤɬɢɜɧɵ ɞɥɹ ɫɨɡɞɚɧɢɹ ɞɢɫɬɪɢɛɭɬɢɜɨɜ, ɚ ɦɟɬɨɞɵ ɧɚ ɨɫɧɨɜɟ ɱɚɫɬɢɱɧɵɯ ɫɨɪɬɢɪɭɸɳɢɯ ɩɪɟɨɛɪɚɡɨɜɚɧɢɣ — ɞɥɹ ɪɟɡɟɪɜɧɨɝɨ ɤɨɩɢɪɨɜɚɧɢɹ. Ɍɢɩɢɱɧɵɟ ɞɚɧɧɵɟ ɤɚɱɟɫɬɜɟɧɧɨɝɨ ɯɚɪɚɤɬɟɪɚ ɦɨɠɧɨ ɭɫɥɨɜɧɨ ɪɚɡɞɟɥɢɬɶ ɧɚ 4 ɬɢɩɚ: 1) ɨɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ (ɧɚɩɪɢɦɟɪ, ɬɢɩɢɱɧɵɟ ɬɟɤɫɬɵ); 2) ɨɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ ɫ ɛɨɥɶɲɨɣ ɢɡɛɵɬɨɱɧɨɫɬɶɸ ɜ ɜɢɞɟ ɞɥɢɧɧɵɯ ɩɨɜɬɨɪɹɸɳɢɯɫɹ ɫɬɪɨɤ (ɧɚɩɪɢɦɟɪ, ɧɚɛɨɪ ɢɫɯɨɞɧɵɯ ɬɟɤɫɬɨɜ); 3) ɧɟɨɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ, ɜ ɤɨɬɨɪɵɯ ɢɦɟɟɬɫɹ ɜɵɪɚɠɟɧɧɚɹ ɧɟɫɬɚɛɢɥɶɧɨɫɬɶ ɤɨɧɬɟɤɫɬɧɨ-ɡɚɜɢɫɢɦɨɣ ɫɬɚɬɢɫɬɢɤɢ (ɧɚɩɪɢɦɟɪ, ɢɫɩɨɥɧɢɦɵɟ ɮɚɣɥɵ); 4) ɞɚɧɧɵɟ ɫ ɦɚɥɨɣ ɢɡɛɵɬɨɱɧɨɫɬɶɸ (ɧɚɩɪɢɦɟɪ, ɮɚɣɥɵ, ɫɨɞɟɪɠɚɳɢɟ ɭɠɟ ɫɠɚɬɵɟ ɛɥɨɤɢ); Ɋɚɫɫɦɨɬɪɢɦ, ɤɚɤ ɜɟɞɭɬ ɫɟɛɹ ɪɚɡɥɢɱɧɵɟ ɦɟɬɨɞɵ ɩɪɢ ɫɠɚɬɢɢ ɞɚɧɧɵɯ ɪɚɡɧɵɯ ɬɢɩɨɜ. ɉɪɢ ɚɧɚɥɢɡɟ ɛɭɞɟɦ ɨɪɢɟɧɬɢɪɨɜɚɬɶɫɹ ɧɚ ɧɚɢɥɭɱɲɢɯ ɩɪɟɞɫɬɚɜɢɬɟɥɟɣ ɦɟɬɨɞɨɜ. Ⱦɥɹ ɫɠɚɬɢɹ ɬɚɤɢɯ ɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ, ɤɚɤ ɬɟɤɫɬɵ ɧɚ ɟɫɬɟɫɬɜɟɧɧɵɯ ɹɡɵɤɚɯ, ɧɚɢɛɨɥɟɟ ɩɨɞɯɨɞɹɳɢɦɢ ɹɜɥɹɸɬɫɹ PPM-ɦɟɬɨɞɵ ɢ ɦɟɬɨɞɵ ɧɚ ɨɫɧɨɜɟ BWT. ɉɟɪɜɵɟ ɩɨɡɜɨɥɹɸɬ ɞɨɫɬɢɱɶ ɛɨɥɶɲɟɣ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ, ɜɬɨɪɵɟ ɨɛɥɚɞɚɸɬ ɛɨɥɶɲɟɣ ɫɤɨɪɨɫɬɶɸ ɞɟɤɨɞɢɪɨɜɚɧɢɹ. ɉɪɨɝɪɚɦɦɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɦɟɬɨɞɵ ɫɟɦɟɣɫɬɜɚ LZ77, ɫɠɢɦɚɸɬ ɭɤɚɡɚɧɧɵɟ ɞɚɧɧɵɟ ɡɚɦɟɬɧɨ ɯɭɠɟ ɢ, ɩɪɢ ɭɜɟɥɢɱɟɧɢɢ ɞɥɢɧɵ ɫɥɨɜɚɪɹ, ɫɭɳɟɫɬɜɟɧɧɨ ɦɟɞɥɟɧɧɟɟ. ȿɫɥɢ ɜ ɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ ɟɫɬɶ ɞɥɢɧɧɵɟ ɩɨɜɬɨɪɹɸɳɢɟɫɹ ɫɬɪɨɤɢ, ɭ ɩɪɨɝɪɚɦɦ ɧɚ ɨɫɧɨɜɟ LZ77 ɟɫɬɶ ɲɚɧɫ ɫɟɛɹ ɪɟɚɛɢɥɢɬɢɪɨɜɚɬɶ. ȼɩɪɨɱɟɦ, ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɧɚɢɛɨɥɟɟ ɜɵɝɨɞɧɵɦ ɛɭɞɟɬ ɢɫɩɨɥɶɡɨɜɚɬɶ ɝɢɛɪɢɞ LZ77 ɢ ɥɸɛɨɝɨ ɢɡ ɞɜɭɯ ɟɝɨ ɤɨɧɤɭɪɟɧɬɨɜ ɢɥɢ ɩɪɢɦɟɧɹɬɶ LZ77-ɩɪɟɩɪɨɰɟɫɫɢɧɝ. ɉɪɢ ɫɠɚɬɢɢ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ ɩɚɥɶɦɚ ɩɟɪɜɟɧɫɬɜɚ ɩɪɢɧɚɞɥɟɠɢɬ ɫɟɦɟɣɫɬɜɭ ɦɟɬɨɞɨɜ LZ77, ɤɨɬɨɪɵɟ ɩɪɢ ɫɨɯɪɚɧɟɧɢɢ ɫɜɨɢɯ ɜɵɫɨɤɢɯ ɫɤɨɪɨɫɬɧɵɯ ɤɚɱɟɫɬɜ ɧɚɫɬɢɝɚɸɬ ɩɨ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɡɚɦɟɬɧɨ ɛɨɥɟɟ ɦɟɞɥɟɧɧɵɯ ɥɭɱɲɢɯ ɩɪɟɞɫɬɚɜɢɬɟɥɟɣ PPMɤɨɦɩɪɟɫɫɨɪɨɜ. ȿɫɥɢ ɧɟ ɢɫɩɨɥɶɡɨɜɚɬɶ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɟ, BWT318 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɤɨɦɩɪɟɫɫɨɪɵ ɩɨɤɚɡɵɜɚɸɬ ɧɟ ɨɱɟɧɶ ɜɵɫɨɤɭɸ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ. ɇɚ ɞɚɧɧɵɯ ɫ ɦɚɥɨɣ ɢɡɛɵɬɨɱɧɨɫɬɶɸ ɜɫɟ ɦɟɬɨɞɵ ɜɵɫɬɭɩɚɸɬ ɧɟ ɥɭɱɲɢɦ ɨɛɪɚɡɨɦ. ɇɟɤɨɬɨɪɨɟ ɩɪɟɢɦɭɳɟɫɬɜɨ ɜ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɢɦɟɸɬ ɚɪɯɢɜɚɬɨɪɵ ɧɚ ɨɫɧɨɜɟ LZ77 ɢ PPM. ɇɨ ɩɨɫɥɟɞɧɢɟ ɩɪɢ ɷɬɨɦ ɬɪɟɛɭɸɬ ɡɧɚɱɢɬɟɥɶɧɨɝɨ ɪɚɫɯɨɞɚ ɩɚɦɹɬɢ ɢ ɫɤɨɪɨɫɬɶ ɢɯ ɪɚɛɨɬɵ ɡɚɦɟɬɧɨ ɩɚɞɚɟɬ. ȼ ɡɚɤɥɸɱɟɧɢɟ ɩɪɢɜɟɞɟɦ ɬɚɛɥɢɰɭ, ɜ ɤɨɬɨɪɨɣ ɨɩɢɫɚɧɵ ɫɜɨɣɫɬɜɚ ɦɟɬɨɞɨɜ ɩɪɢ ɫɠɚɬɢɢ ɤɚɱɟɫɬɜɟɧɧɵɯ ɞɚɧɧɵɯ ɪɚɡɥɢɱɧɵɯ ɬɢɩɨɜ. ɉɚɪɚɦɟɬɪɵ
Ɇɟɬɨɞ
Ɉɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ (ɬɢɩɢɱɧɵɣ ɬɟɤɫɬ)
ɋɬɟɩɟɧɶ ɫɠɚɬɢɹ
PPM
ɜɵɫɨɤɚɹ
Ɉɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ ɫ ɛɨɥɶɲɨɣ ɢɡɛɵɬɨɱɧɨɫɬɶɸ (ɢɫɯɨɞɧɵɟ ɬɟɤɫɬɵ ɩɪɨɝɪɚɦɦ) ɜɵɫɨɤɚɹ
BWT
ɛɥɢɡɤɚɹ ɤ PPM
ɛɥɢɡɤɚɹ ɤ PPM
LZ77
ɡɚɦɟɬɧɨ ɯɭɞɲɚɹ
BWT
ɜɵɫɨɤɚɹ
ɩɪɢ ɛɨɥɶɲɨɦ ɤɨɥɢɱɟɫɬɜɟ ɞɥɢɧɧɵɯ ɩɨɜɬɨɪɨɜ ɞɨɜɨɥɶɧɨ ɜɵɫɨɤɚɹ ɫɪɟɞɧɹɹ
PPM
ɫɪɟɞɧɹɹ ɩɪɢ ɛɨɥɶɲɨɦ ɩɨɟɫɥɢ ɧɟ ɢɫɪɹɞɤɟ ɦɨɞɟɥɢ — ɩɨɥɶɡɨɜɚɬɶ ɫɚɦɚɹ ɧɢɡɤɚɹ, ɫɥɨɠɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ — ɩɪɢ ɧɟɛɨɥɶɲɨɦ — ɜɵɫɨɤɚɹ ɧɟɦɧɨɝɨ ɛɵɫɬɪɟɟ BWT ɫɪɟɞɧɹɹ, ɚ ɩɪɢ ɫɪɟɞɧɹɹ, ɩɪɢ ɜɵɫɨɤɚɹ ɦɚɥɨɦ ɫɥɨɜɚɪɟ — ɦɚɥɨɦ ɫɥɨɜɚɪɟ ɫɚɦɚɹ ɜɵɫɨɤɚɹ — ɜɵɫɨɤɚɹ ɩɪɢɦɟɪɧɨ ɜ 10 ɪɚɡ ɜɵɲɟ ɫɤɨɪɨɫɬɢ ɤɨɞɢɪɨɜɚɧɢɹ; ɪɚɡɧɢɰɚ ɟɳɟ ɛɨɥɶɲɟ ɧɚ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ ɨɛɵɱɧɨ ɧɚ 5-10% ɦɟɞɥɟɧɧɟɟ ɤɨɞɢɪɨɜɚɧɢɹ ɜ 2-4 ɪɚɡɚ ɜɵɲɟ ɫɤɨɪɨɫɬɢ ɤɨɞɢɪɨɜɚɧɢɹ ɩɨɫɬɨɹɧɧɵɣ ɩɪɢ ɫɠɚɬɢɢ ɞɚɧɧɵɯ ɥɸɛɨɝɨ ɬɢɩɚ
ɋɤɨɪɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ
LZ77
LZ77 ɋɤɨɪɨɫɬɶ PPM ɞɟɤɨɞɢBWT ɪɨɜɚɧɢɹ BWT Ɍɪɟɛɭɟɦɵɣ ɨɛɴɟɦ ɩɚɦɹɬɢ ɩɪɢ ɫɠɚɬɢɢɄɧɢɝɚ “Ɇɟɬɨɞɵ
ɇɟɨɞɧɨɪɨɞɧɵɟ ɞɚɧɧɵɟ
ɜɵɫɨɤɚɹ ɛɟɡ ɮɪɚɝɦɟɧɬɢɪɨɜɚɧɢɹ — ɯɭɞɲɚɹ ɛɥɢɡɤɚɹ ɤ PPM
ɜɵɫɨɤɚɹ
Ⱦɚɧɧɵɟ ɫ ɦɚɥɨɣ ɢɡɛɵɬɨɱɧɨɫɬɶɸ ɧɟɜɵɫɨɤɚɹ ɧɟɜɵɫɨɤɚɹ
ɧɟɜɵɫɨɤɚɹ
ɜɵɫɨɤɚɹ ɧɢɡɤɚɹ
ɜɵɫɨɤɚɹ
ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 319 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
PPM
Ɍɪɟɛɭɟɦɵɣ ɨɛɴɟɦ ɩɚɦɹɬɢ ɩɪɢ ɪɚɡɠɚɬɢɢ
LZ77 LZ77 PPM BWT
ɜɚɪɶɢɪɭɟɬɫɹ ɜ ɲɢɪɨɤɢɯ ɩɪɟɞɟɥɚɯ, ɜ ɡɚɜɢɫɢɦɨɫɬɢ ɨɬ ɫɥɨɠɧɨɫɬɢ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɢ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ; ɜɵɪɚɫɬɚɟɬ ɧɚ ɦɚɥɨɢɡɛɵɬɨɱɧɵɯ ɢ ɨɱɟɧɶ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ11 ɩɪɨɩɨɪɰɢɨɧɚɥɟɧ ɪɚɡɦɟɪɭ ɫɥɨɜɚɪɹ ɦɢɧɢɦɚɥɶɧɵɣ ɦɚɤɫɢɦɚɥɶɧɵɣ, ɟɫɥɢ ɩɪɨɰɟɫɫ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɫɢɦɦɟɬɪɢɱɟɧ, ɬɨ ɩɪɢɦɟɪɧɨ ɪɚɜɟɧ ɪɚɫɯɨɞɭ ɩɚɦɹɬɢ ɩɪɢ ɫɠɚɬɢɢ ɫɪɟɞɧɢɣ
ȿɫɥɢ ɜɵ ɨɛɧɚɪɭɠɢɬɟ ɨɲɢɛɤɢ ɢɥɢ ɧɟɬɨɱɧɨɫɬɢ ɜ ɞɚɧɧɨɦ ɬɟɤɫɬɟ, ɩɪɨɫɶɛɚ ɫɨɨɛɳɢɬɶ ɨ ɧɢɯ ɚɜɬɨɪɚɦ ɩɨ ɚɞɪɟɫɭ: [email protected] Ɉɬɜɟɬɵ ɤ ɜɨɩɪɨɫɚɦ ɢ ɭɩɪɚɠɧɟɧɢɹɦ ɢ ɢɫɯɨɞɧɵɟ ɬɟɤɫɬɵ ɩɪɨɝɪɚɦɦ ɜɵ ɦɨɠɟɬɟ ɧɚɣɬɢ ɧɚ http://www.compression.ru/
11
ɍɬɜɟɪɠɞɟɧɢɟ ɨɛ ɭɜɟɥɢɱɟɧɢɢ ɪɚɫɯɨɞɚ ɩɚɦɹɬɢ ɜ ɫɥɭɱɚɟ ɦɚɥɨɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ ɫɩɨɪɧɨ. ɗɬɨ ɡɚɜɢɫɢɬ ɨɬ ɢɫɩɨɥɶɡɭɟɦɵɯ ɜ ɤɨɦɩɪɟɫɫɨɪɟ ɫɬɪɭɤɬɭɪ ɞɚɧɧɵɯ. ȼ ɬɨɦ ɫɥɭɱɚɟ, ɟɫɥɢ ɜ ɦɨɞɟɥɢ ɧɟ ɯɪɚɧɢɬɫɹ ɜ ɹɜɧɨɦ ɜɢɞɟ ɢɧɮɨɪɦɚɰɢɹ ɨ ɬɚɤ ɧɚɡɵɜɚɟɦɵɯ "ɜɢɪɬɭɚɥɶɧɵɯ" ɫɨɫɬɨɹɧɢɹɯ, ɜɨɡɧɢɤɲɢɯ ɬɨɥɶɤɨ ɨɞɢɧ ɪɚɡ, ɬɨ ɫɢɬɭɚɰɢɹ ɦɨɠɟɬ ɛɵɬɶ ɢ ɨɛɪɚɬɧɨɣ, ɨɫɨɛɟɧɧɨ ɩɪɢ ɛɨɥɶɲɨɦ ɩɨɪɹɞɤɟ ɦɨɞɟɥɢ. ȼ ɢɬɨɝɟ ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ɭɠɟ ɫɠɚɬɨɝɨ ɮɚɣɥɚ (ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɨɤɨɥɨ 1) ɦɨɠɟɬ ɬɪɟɛɨɜɚɬɶɫɹ ɦɟɧɶɲɢɣ ɨɛɴɟɦ ɩɚɦɹɬɢ, ɱɟɦ ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ɬɟɤɫɬɨɜɨɝɨ ɮɚɣɥɚ (ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ 3-4) ɬɚɤɨɝɨ ɠɟ ɪɚɡɦɟɪɚ.
320 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɍɄȺɁȺɌȿɅɖ ɌȿɊɆɂɇɈȼ 7 7-Zip, 108, 308
A Abrahamson, 188 ACE, 110, 308 ADSM, 188 ARHANGEL, 186, 288 ARJ, 110 ARJZ, 110
D DAFC, 187, 190 DC, 288, 308 Deflate, 82 Delta Coding, 29 Deterministic scaling, 168 DHPC, 190 Distance Coding, 226 DMC, 193 Dynamic Markov compression, 193
E B Bell, 61, 76 Bender, 76, 102 Bentley-Sedgewick, 241 Blending, 125 Bloom, 76, 186 BMF, 189 Boa, 186 Brent, 76 Burrows-Wheeler Transform, 199 BWT, 199, 264, 265, 272
C CABARC, 100, 108, 109, 110, 308 CELP, 39 CM, 178 Context tree weighting, 193 cPPMII, 183 CS-ACELP, 39 CTW, 193
Escape, 129, 131 Exclusion, 132
F Fenwick Peter, 225 Fiala, 76, 104 Finite-context modeling, 123 Full updates, 158
G Greedy parsing, 97 Greene, 76, 104
H HA, 177 Herklotz, 186 Hirvola, 177 Hoang, 77
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 321 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
I Imp, 110 IMP, 308 Info-ZIP, 94, 110 Inversed Frequencies, 229
J JAR, 110, 288 Jung, 110
K Katz, 82
L Langdon, 115, 187 Lazy matching, 95 Lemke, 110 Lempel, 60 Length Index Preserving Transformation. ɋɦ. LIPT LFF, 98 LGHA, 186 Linear Prediction Coding. ɋɦ. LPC LIPT, 294 Local Order Estimation. ɋɦ. LOE LOE, 161, 179 LOEMA, 186 Long, 77 Longest Fragment First. ɋɦ. LFF Lookahead buffer, 62 LPC, 28 analysis, 39 synthesis, 39 ɨɩɬɢɦɚɥɶɧɚɹ ɦɨɞɟɥɶ, 35 ɫɢɧɬɟɡ ɦɨɞɟɥɟɣ, 40 LRU, 107 Lyapko, 186 LZ77, 60, 61
ɉɪɢɦɟɪ, 63 LZ77-PM, 77, 106 LZ78, 60, 72 ɉɪɢɦɟɪ, 72 LZB, 76 LZBW, 76, 102 ɉɪɢɦɟɪ, 102 LZCB, 76 LZFG, 76, 104 LZFG-PM, 77, 106 LZH, 76 LZMV, 76 LZP, 76 LZRW1, 76 LZSS, 67 ɉɪɢɦɟɪ, 68 LZW, 76, 83 LZW-PM, 77, 106 LZX, 109
M Match length, 62 MELP, 39 Microsoft, 110 Miller, 76 Move To Front. ɋɦ. MTF MTF, 213
N n-ɝɪɚɮ, 289
O Offset, 62
P Parallel Blocks Sorting. ɋɦ. PBS Pavlov, 110 PBS, 263
322 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
PKWARE, 110 PKZIP, 82, 110 PPM, 80, 130 ɩɪɢɦɟɪ, 133 PPM*, 159, 173 PPMA, 144, 190 PPMB, 144, 190 PPMC, 145 PPMd, 149, 183 PPMD, 145 PPMII, 183 PPMN, 166, 180, 288, 308 PPMonstr, 149, 183 PPMY, 183 PPMZ, 147, 186 Prediction by Partial Matching. ɋɦ. PPM
SEQUITUR, 193 Shelwien, 183 Shkarin, 183 Smirnov, 180 Sort Transformation, 209 SSE, 170 ST, 264, 265, 272 Storer, 67 Subband Coding, 44 Suffix sorting, 243 Sutton, 186 Szymanski, 67
T Taylor, 179 Technelysium, 110
R Radix sorting, 242 RAR, 108, 110 Recency scaling, 166 Reordering, 238 Rissanen, 115, 187 RK, 179, 288 RKUC, 179 RLE, 215 Roberts, 186 Roshal, 110
S Sadakane Kunihiko, 243 SBC, 288, 308 Schindler Mikael, 226 Schindler Transform, 209 Secondary Escape Estimation. ɋɦ. SEE Symbol Estimation. ɋɦ. SSE SEE, 146 SEM, 43 Sepulizing. ɋɦ. ɋɟɩɭɥɢɪɨɜɚɧɢɟ
U UHARC, 186, 288, 308 Unisys, 83 Universal modelling and coding, 115 Update exclusion, 158 partial, 159
V Valentini, 186 Vitter, 77
W Wegman, 76 Welch, 76 Williams, 76, 190 WinRAR. ɋɦ. RAR WinZip, 110 Wolf, 76, 102 WORD, 191
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 323 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
X X1, 186
Y YBS, 308
Z Ziganshin, 110, 178 Zip, 94, 110 Ziv, 60
Ⱥ Ⱥɛɪɚɯɚɦɫɨɧ, 188 Ⱥɥɝɨɪɢɬɦ Lossless JPEG, 42 PNG, 41, 42 ɏɚɮɮɦɚɧɚ, 232 Ⱥɬɪɢɛɭɬ, 263
Ȼ Ȼɚɡɚ ɞɥɢɧɵ ɫɨɜɩɚɞɟɧɢɹ, 86 ɫɦɟɳɟɧɢɹ, 87 Ȼɚɪɪɨɭɡ Ɇɚɣɤ, 198 Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ. ɋɦ. ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɟɥɥ, 61, 76 Ȼɟɧɞɟɪ, 76, 102 Ȼɢɝɪɚɮ. ɋɦ. n-ɝɪɚɮ Ȼɥɭɦ, 76, 186 Ȼɪɟɧɬ, 76 Ȼɭɮɟɪ ɭɩɪɟɠɞɚɸɳɢɣ, 62 Ȼɭɮɟɪɢɡɚɰɢɹ ɫɦɟɳɟɧɢɣ, 106
ȼ ȼɚɥɟɧɬɢɧɢ, 186
ȼɟɤɬɨɪ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, 204 ȼɟɪɨɹɬɧɨɫɬɶ ɭɯɨɞɚ, 131, 144 ȼɡɜɟɲɢɜɚɧɢɟ, 126 ɧɟɹɜɧɨɟ, 129 ȼɢɬɬɟɪ, 77 ȼɭɥɮ, 76, 102 ȼɷɣɜɥɟɬ-ɮɢɥɶɬɪ, 56
Ƚ Ƚɪɚɧɢɰɵ ɞɢɚɩɚɡɨɧɚ ɞɨɩɭɫɬɢɦɵɯ ɡɧɚɱɟɧɢɣ, 43 Ƚɪɢɧɢ, 76, 104
Ⱦ Ⱦɟɥɶɬɚ-ɤɨɞɢɪɨɜɚɧɢɟ, 29, 51 ɩɪɢɦɟɪ, 30 Ⱦɠɚɧɝ, 110 Ⱦɢɧɚɦɢɱɟɫɤɨɟ ɦɚɪɤɨɜɫɤɨɟ ɫɠɚɬɢɟ, 193 Ⱦɢɫɤɪɟɬɧɨɟ ɜɷɣɜɥɟɬɧɨɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɟ, 53 Ⱦɥɢɧɚ ɫɨɜɩɚɞɟɧɢɹ, 62 Ⱦɥɢɧɚ ɫɨɨɬɜɟɬɫɬɜɢɹ. ɋɦ. ɞɥɢɧɚ ɫɨɜɩɚɞɟɧɢɹ
ɀ ɀɚɞɧɵɣ ɪɚɡɛɨɪ, 97 ɀɢɦɚɧɫɤɢ, 67
Ɂ Ɂɢɜ, 60 Ɂɢɝɚɧɲɢɧ, 110, 178
ɂ ɂɫɤɥɸɱɟɧɢɟ, 132 ɂɫɤɥɸɱɟɧɢɟ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ, 158
324 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɱɚɫɬɢɱɧɨɟ, 159, 169 ɂɫɬɨɱɧɢɤ ɞɚɧɧɵɯ, 115 Ɇɚɪɤɨɜɚ, 131
Ʉ Ʉɚɰ, 82 Ʉɨɞɟɪ, 115 Ʉɨɞɢɪɨɜɚɧɢɟ, 115 1-2, 221 ɞɥɢɧ ɩɨɜɬɨɪɨɜ. ɋɦ. RLE ɥɢɧɟɣɧɨ-ɩɪɟɞɫɤɚɡɵɜɚɸɳɟɟ. ɋɦ. LPC ɪɚɫɫɬɨɹɧɢɣ. ɋɦ. Distance Coding ɫɬɚɬɢɫɬɢɱɟɫɤɨɟ, 116 ɫɭɛɩɨɥɨɫɧɨɟ. ɋɦ. Subband Coding Ʉɨɞɢɪɨɜɳɢɤ, 115 Ʉɨɞɵ ɫɪɟɞɧɹɹ ɞɥɢɧɚ, 25 ɏɚɮɮɦɚɧɚ, 84 ɗɥɢɚɫɚ, 77 Ʉɨɦɩɪɟɫɫɨɪ, 115 Dummy, 144 PPM, 138 Ʉɨɧɬɟɣɧɟɪ, 265 Ʉɨɧɬɟɤɫɬ, 42, 122 ɚɤɬɢɜɧɵɣ, 123 ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɵɣ, 159, 168 ɞɨɱɟɪɧɢɣ, 124 ɥɟɜɨɫɬɨɪɨɧɧɢɣ, 122 ɩɪɚɜɨɫɬɨɪɨɧɧɢɣ, 122 -ɩɪɟɞɨɤ, 124 ɪɚɡɛɪɨɫɚɧɧɵɣ, 180 ɪɨɞɢɬɟɥɶɫɤɢɣ, 124 ɭɯɨɞɚ, 147 Ʉɨɧɬɟɤɫɬɧɚɹ ɦɨɞɟɥɶ, 123 ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɚɹ, 150, 159 ɫ ɡɚɦɚɫɤɢɪɨɜɚɧɧɵɦɢ ɫɢɦɜɨɥɚɦɢ, 150
ɫ ɧɟɡɚɦɚɫɤɢɪɨɜɚɧɧɵɦɢ ɫɢɦɜɨɥɚɦɢ, 150 ɭɯɨɞɨɜ, 147 Ʉɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ, 98, 105, 120 ɨɝɪɚɧɢɱɟɧɧɨɝɨ ɩɨɪɹɞɤɚ, 122 ɫ ɩɨɥɧɵɦ ɫɦɟɲɢɜɚɧɢɟɦ, 126 ɫ ɱɚɫɬɢɱɧɵɦ ɫɦɟɲɢɜɚɧɢɟɦ, 126 ɱɢɫɬɨɟ ɩɨɪɹɞɤɚ N, 125, 188 Ʉɨɧɬɭɪ, 286
Ʌ Ʌɟɦɤɟ, 110 Ʌɟɦɩɟɥ, 60 Ʌɟɧɢɜɨɟ ɫɪɚɜɧɟɧɢɟ, 95 Ʌɢɧɟɣɧɚɹ ɤɨɦɛɢɧɚɰɢɹ, 28 Ʌɢɧɟɣɧɨ-ɩɪɟɞɫɤɚɡɵɜɚɸɳɟɟ ɤɨɞɢɪɨɜɚɧɢɟ. ɋɦ. LPC Ʌɢɬɟɪɚɥ, 63 Ʌɨɧɝ, 77 Ʌɷɧɝɞɨɧ, 115, 187 Ʌɹɩɤɨ, 186
Ɇ Ɇɚɬɪɢɰɚ ɰɢɤɥɢɱɟɫɤɢɯ ɩɟɪɟɫɬɚɧɨɜɨɤ, 201 Ɇɟɬɨɞɵ Ɂɢɜɚ-Ʌɟɦɩɟɥɚ, 60 Ɇɟɯɚɧɢɡɦ ɭɯɨɞɨɜ, 131 Ɇɢɥɥɟɪ, 76 Ɇɨɞɟɥɢɪɨɜɚɧɢɟ, 115 ɚɞɚɩɬɢɜɧɨɟ, 119 ɛɥɨɱɧɨ-ɚɞɚɩɬɢɜɧɨɟ, 119, 178 ɤɨɧɬɟɤɫɬɧɨɟ ɨɝɪɚɧɢɱɟɧɧɨɝɨ ɩɨɪɹɞɤɚ, 122 ɩɨɥɭɚɞɚɩɬɢɜɧɨɟ, 119 ɫɬɚɬɢɱɟɫɤɨɟ, 118 Ɇɨɞɟɥɢɪɨɜɳɢɤ, 115 Ɇɨɞɟɥɶ "ɚɧɚɥɨɝɨɜɵɣ ɫɢɝɧɚɥ", 45 ɢɟɪɚɪɯɢɱɟɫɤɚɹ, 233 ɢɫɬɨɱɧɢɤɚ ɞɚɧɧɵɯ, 115, 124
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 325 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɫɬɪɭɤɬɭɪɧɚɹ, 233 ɲɭɦɨɜɚɹ, 34 ɷɜɨɥɸɰɢɨɧɧɚɹ, 34
ɇ ɇɚɤɨɩɥɟɧɧɚɹ ɱɚɫɬɨɬɚ, 136 ɇɚɫɥɟɞɨɜɚɧɢɟ ɢɧɮɨɪɦɚɰɢɢ, 164 ɨɬɥɨɠɟɧɧɨɟ, 165
Ɉ Ɉɛɪɚɛɨɬɤɚ ɞɚɧɧɵɯ ɩɪɟɞɜɚɪɢɬɟɥɶɧɚɹ. ɋɦ. ɩɪɟɞɨɛɪɚɛɨɬɤɚ Ɉɛɪɚɬɧɵɟ ɱɚɫɬɨɬɵ, 229 Ɉɛɯɨɞ ɩɥɨɫɤɨɫɬɢ, 39 Ɉȼɍ, 144 Ɉɩɬɢɦɚɥɶɧɵɣ ɪɚɡɛɨɪ, 97, 99 Ɉɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ, 144 ɚɞɚɩɬɢɜɧɵɟ ɦɟɬɨɞɵ. ɋɦ. SEE ɚɩɪɢɨɪɧɵɟ ɦɟɬɨɞɵ, 144 ɦɟɬɨɞ A, 145, 188 ɦɟɬɨɞ B, 145 ɦɟɬɨɞ C, 145 ɦɟɬɨɞ D, 145 ɦɟɬɨɞ P, 145 ɦɟɬɨɞ SEE-d1, 149 ɦɟɬɨɞ SEE-d2, 149 ɦɟɬɨɞ X, 145 ɦɟɬɨɞ XC, 145 ɦɟɬɨɞ Z, 147, 180 Ɉɲɢɛɤɚ ɩɪɟɞɫɤɚɡɚɧɢɹ, 28 ɦɢɧɢɦɢɡɚɰɢɹ, 35
ɉ ɉɚɜɥɨɜ, 110 ɉɚɪɚɥɥɟɥɶɧɵɟ ɛɥɨɤɢ, 263 ɉɟɪɟɦɟɳɟɧɢɟ ɫɬɨɩɤɢ ɤɧɢɝ. ɋɦ. MTF ɉɟɪɟɫɬɚɧɨɜɤɚ, 274
ɉɟɪɟɭɩɨɪɹɞɨɱɢɜɚɧɢɟ ɫɢɦɜɨɥɨɜ, 238 ɉɨɢɫɤ ɝɪɚɧɢɰ, 50, 276 ɉɨɥɧɨɟ ɨɛɧɨɜɥɟɧɢɟ ɫɱɟɬɱɢɤɨɜ, 158 ɉɨɪɹɞɨɤ ɦɨɞɟɥɢ PPM, 131, 175 ɉɨɫɬɩɪɨɰɟɫɫɨɪ, 287 ɉɪɟɞɨɛɪɚɛɨɬɤɚ, 287 ɉɪɟɞɫɤɚɡɚɧɢɟ ɧɚɢɛɨɥɟɟ ɜɟɪɨɹɬɧɵɯ ɫɢɦɜɨɥɨɜ, 169 ɩɨ ɱɚɫɬɢɱɧɨɦɭ ɫɨɜɩɚɞɟɧɢɸ. ɋɦ. PPM ɉɪɟɨɛɪɚɡɨɜɚɧɢɟ Ȼɚɪɪɨɭɡɚ-ɍɢɥɟɪɚ, 199 ɨɬɧɨɫɢɬɟɥɶɧɵɯ ɚɞɪɟɫɨɜ, 308 ɫɨɪɬɢɪɭɸɳɟɟ ɱɚɫɬɢɱɧɨɟ, 209 ɬɚɛɥɢɱɧɵɯ ɫɬɪɭɤɬɭɪ, 312 ɒɢɧɞɥɟɪɚ, 209 ɉɪɟɩɪɨɰɟɫɫɢɧɝ. ɋɦ. ɩɪɟɞɨɛɪɚɛɨɬɤɚ ɉɪɟɩɪɨɰɟɫɫɨɪ, 287 ɉɪɨɢɡɜɨɞɧɚɹ ɛɥɨɤɚ, 273
Ɋ Ɋɚɡɥɨɠɟɧɢɟ ɧɚ ɩɨɥɭɫɭɦɦɵ ɢ ɪɚɡɧɨɫɬɢ, 45 Ɋɚɡɦɟɪ ɛɥɨɤɚ ɜ BWT, 236 Ɋɢɫɫɚɧɟɧ, 115, 187 Ɋɨɛɟɪɬɫ, 186 Ɋɨɲɚɥ, 110
ɋ ɋɚɞɚɤɚɧɟ Ʉɭɧɢɯɢɤɨ, 243 ɋɚɬɬɨɧ, 186 ɋɟɩɭɥɢɪɨɜɚɧɢɟ. ɋɦ. Sepulizing ɋɠɚɬɢɟ ɩɚɪɚɥɥɟɥɶɧɵɯ ɩɨɬɨɤɨɜ, 50 ɋɢɦɜɨɥ ɭɯɨɞɚ, 129 ɋɢɦɜɨɥɵ ɤɨɧɰɚ ɫɬɪɨɤɢ, 299 ɋɤɨɥɶɡɹɳɟɟ ɨɤɧɨ, 62, 277 ɋɄɋ. ɋɦ. ɫɢɦɜɨɥɵ ɤɨɧɰɚ ɫɬɪɨɤɢ ɋɥɨɜɚɪɶ, 57, 289
326 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɤɥɚɫɫɢɮɢɤɚɰɢɹ, 289 ɤɨɧɬɟɤɫɬɧɨ-ɡɚɜɢɫɢɦɵɣ, 105 ɫɤɨɥɶɡɹɳɢɣ, 62 ɋɦɟɲɢɜɚɧɢɟ, 125 ɋɦɟɳɟɧɢɟ, 62 ɋɦɢɪɧɨɜ, 180 ɋɨɪɬɢɪɨɜɤɚ Ȼɟɧɬɥɢ-ɋɟɞɠɜɢɤɚ, 241 ɛɵɫɬɪɚɹ, 241 ɢɫɩɨɥɶɡɭɟɦɚɹ ɜ BWT, 240 ɧɚɩɪɚɜɥɟɧɢɟ, 239 ɩɚɪɚɥɥɟɥɶɧɵɯ ɛɥɨɤɨɜ. ɋɦ. PBS ɩɨɪɚɡɪɹɞɧɚɹ, 242 ɫɭɮɮɢɤɫɨɜ, 243 ɋɪɚɜɧɟɧɢɟ ɚɥɝɨɪɢɬɦɨɜ LZ, 80 ɚɥɝɨɪɢɬɦɨɜ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ, 192 ɚɪɯɢɜɚɬɨɪɨɜ LZ, 110 ɚɪɯɢɜɚɬɨɪɨɜ PPM, 185 ɋɬɨɪɟɪ, 67 ɋɭɛɩɨɥɨɫɧɨɟ ɤɨɞɢɪɨɜɚɧɢɟ. ɋɦ. Subband Coding
Ɍ Ɍɟɣɥɨɪ, 179 Ɍɟɨɪɟɦɚ ɨ ɤɨɞɢɪɨɜɚɧɢɢ ɢɫɬɨɱɧɢɤɚ, 25, 116 Ɍɟɬɪɚɝɪɚɮ. ɋɦ. n-ɝɪɚɮ Ɍɪɢɝɪɚɮ. ɋɦ. n-ɝɪɚɮ
ɍ ɍɢɥɟɪ Ⱦɷɜɢɞ, 198 ɍɢɥɥɶɹɦɫ, 76, 190 ɍɤɚɡɚɬɟɥɶ, 62 ɍɦɟɧɶɲɟɧɢɟ ɲɭɦɚ, 38 ɍɷɝɧɚɦ, 76 ɍɷɥɱ, 76
Ɏ Ɏɚɣɷɥɷ, 76, 104 Ɏɟɧɜɢɤ ɉɟɬɟɪ, 225 Ɏɢɥɶɬɪ Paeth, 41 ɜɵɛɨɪ, 42, 56 Ɏɨɪɦɚɬ Deflate, 82 Ɏɪɚɝɦɟɧɬɢɪɨɜɚɧɢɟ, 276 Ɏɪɚɡɚ ɫɥɨɜɚɪɹ, 57, 289 Ɏɪɟɣɦ, 268 Ɏɭɧɤɰɢɹ ɚɞɚɩɬɢɜɧɚɹ, 273 ɨɬɥɢɱɢɹ, 277
ɏ ɏɚɪɚɤɬɟɪɢɫɬɢɤɢ ɚɥɝɨɪɢɬɦɨɜ PPM, 176 ɚɥɝɨɪɢɬɦɨɜ ɫɟɦɟɣɫɬɜɚ LZ77, 81 ɚɥɝɨɪɢɬɦɨɜ ɫɟɦɟɣɫɬɜɚ LZ78, 82 ɏɟɪɤɥɨɰ, 186 ɏɟɲ-ɮɭɧɤɰɢɹ, 94 ɏɢɪɜɨɥɚ, 177 ɏɨɚɧɝ, 77
ɑ ɑɚɫɬɨɬɚ ɷɥɟɦɟɧɬɚ, 266, 272, 277
ɒ ɒɟɥɜɢɧ, 183 ɒɟɧɧɨɧ, 25, 116 ɒɢɧɞɥɟɪ Ɇɢɤɚɷɥɶ, 226 ɒɤɚɪɢɧ, 149, 164, 183
ɗ ɗɧɬɪɨɩɢɹ, 25
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 327 http://www.compression.ru/