222 47 1MB
Russian Pages 176 Year 2003
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 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/
ɊȺɁȾȿɅ 1. ɆȿɌɈȾɕ ɋɀȺɌɂə ȻȿɁ ɉɈɌȿɊɖ
ȼ ɨɫɧɨɜɟ ɜɫɟɯ ɦɟɬɨɞɨɜ ɫɠɚɬɢɹ ɥɟɠɢɬ ɩɪɨɫɬɚɹ ɢɞɟɹ: ɟɫɥɢ ɩɪɟɞɫɬɚɜɥɹɬɶ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɵɟ ɷɥɟɦɟɧɬɵ ɤɨɪɨɬɤɢɦɢ ɤɨɞɚɦɢ, ɚ ɪɟɞɤɨ ɢɫɩɨɥɶɡɭɟɦɵɟ — ɞɥɢɧɧɵɦɢ ɤɨɞɚɦɢ, ɬɨ ɞɥɹ ɯɪɚɧɟɧɢɹ ɛɥɨɤɚ ɞɚɧɧɵɯ ɬɪɟɛɭɟɬɫɹ ɦɟɧɶɲɢɣ ɨɛɴɟɦ ɩɚɦɹɬɢ, ɱɟɦ ɟɫɥɢ ɛɵ ɜɫɟ ɷɥɟɦɟɧɬɵ ɩɪɟɞɫɬɚɜɥɹɥɢɫɶ ɤɨɞɚɦɢ ɨɞɢɧɚɤɨɜɨɣ ɞɥɢɧɵ. Ⱦɚɧɧɵɣ ɮɚɤɬ ɢɡɜɟɫɬɟɧ ɞɚɜɧɨ: ɜɫɩɨɦɧɢɦ, ɧɚɩɪɢɦɟɪ, ɚɡɛɭɤɭ Ɇɨɪɡɟ, ɜ ɤɨɬɨɪɨɣ ɱɚɫɬɨ ɢɫɩɨɥɶɡɭɟɦɵɦ ɫɢɦɜɨɥɚɦ ɩɨɫɬɚɜɥɟɧɵ ɜ ɫɨɨɬɜɟɬɫɬɜɢɟ ɤɨɪɨɬɤɢɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɬɨɱɟɤ ɢ ɬɢɪɟ, ɚ ɪɟɞɤɨ ɜɫɬɪɟɱɚɸɳɢɦɫɹ — ɞɥɢɧɧɵɟ. Ɍɨɱɧɚɹ ɫɜɹɡɶ ɦɟɠɞɭ ɜɟɪɨɹɬɧɨɫɬɹɦɢ ɢ ɤɨɞɚɦɢ ɭɫɬɚɧɨɜɥɟɧɚ ɜ ɬɟɨɪɟɦɟ ɒɟɧɧɨɧɚ ɨ ɤɨɞɢɪɨɜɚɧɢɢ ɢɫɬɨɱɧɢɤɚ, ɤɨɬɨɪɚɹ ɝɥɚɫɢɬ, ɱɬɨ ɷɥɟɦɟɧɬ si, ɜɟɪɨɹɬɧɨɫɬɶ ɩɨɹɜɥɟɧɢɹ ɤɨɬɨɪɨɝɨ ɪɚɜɧɹɟɬɫɹ p(si), ɜɵɝɨɞɧɟɟ ɜɫɟɝɨ ɩɪɟɞɫɬɚɜɥɹɬɶ –log2 p(si) ɛɢɬɚɦɢ. ȿɫɥɢ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɪɚɡɦɟɪ ɤɨɞɨɜ ɜɫɟɝɞɚ ɜ ɬɨɱɧɨɫɬɢ ɩɨɥɭɱɚɟɬɫɹ ɪɚɜɧɵɦ –log2 p(si) ɛɢɬɚɦ, ɬɨ ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɞɥɢɧɚ ɡɚɤɨɞɢɪɨɜɚɧɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɛɭɞɟɬ ɦɢɧɢɦɚɥɶɧɨɣ ɞɥɹ ɜɫɟɯ ɜɨɡɦɨɠɧɵɯ ɫɩɨɫɨɛɨɜ ɤɨɞɢɪɨɜɚɧɢɹ. ȿɫɥɢ ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɜɟɪɨɹɬɧɨɫɬɟɣ F = {p(si)} ɧɟɢɡɦɟɧɧɨ, ɢ ɜɟɪɨɹɬɧɨɫɬɢ ɩɨɹɜɥɟɧɢɹ ɷɥɟɦɟɧɬɨɜ ɧɟɡɚɜɢɫɢɦɵ, ɬɨ ɦɵ ɦɨɠɟɦ ɧɚɣɬɢ ɫɪɟɞɧɸɸ ɞɥɢɧɭ ɤɨɞɨɜ ɤɚɤ ɫɪɟɞɧɟɟ ɜɡɜɟɲɟɧɧɨɟ H = − p( si ) ⋅ log 2 p ( si ) . (1ɚ) i
ƒ
ɗɬɨ ɡɧɚɱɟɧɢɟ ɬɚɤɠɟ ɧɚɡɵɜɚɟɬɫɹ ɷɧɬɪɨɩɢɟɣ ɪɚɫɩɪɟɞɟɥɟɧɢɹ ɜɟɪɨɹɬɧɨɫɬɟɣ F ɢɥɢ ɷɧɬɪɨɩɢɟɣ ɢɫɬɨɱɧɢɤɚ ɜ ɡɚɞɚɧɧɵɣ ɦɨɦɟɧɬ ɜɪɟɦɟɧɢ. Ɉɛɵɱɧɨ ɜɟɪɨɹɬɧɨɫɬɶ ɩɨɹɜɥɟɧɢɹ ɷɥɟɦɟɧɬɚ ɹɜɥɹɟɬɫɹ ɭɫɥɨɜɧɨɣ, ɬ.ɟ. ɡɚɜɢɫɢɬ ɨɬ ɤɚɤɨɝɨ-ɬɨ ɫɨɛɵɬɢɹ. ȼ ɷɬɨɦ ɫɥɭɱɚɟ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɨɱɟɪɟɞɧɨɝɨ ɷɥɟɦɟɧɬɚ si ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɜɟɪɨɹɬɧɨɫɬɟɣ F ɩɪɢɧɢɦɚɟɬ ɨɞɧɨ ɢɡ ɜɨɡɦɨɠɧɵɯ ɡɧɚɱɟɧɢɣ Fk, ɬɨ ɟɫɬɶ F = Fk, ɢ, ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ, H = Hk. Ɇɨɠɧɨ ɫɤɚɡɚɬɶ, ɱɬɨ ɢɫɬɨɱɧɢɤ ɧɚɯɨɞɢɬɫɹ ɜ ɫɨɫɬɨɹɧɢɢ k, ɤɨɬɨɪɨɦɭ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɧɚɛɨɪ ɜɟɪɨɹɬɧɨɫɬɟɣ pk(si) ɝɟɧɟɪɚɰɢɢ ɜɫɟɯ ɜɨɡɦɨɠɧɵɯ ɷɥɟɦɟɧɬɨɜ si. ɉɨɷɬɨɦɭ ɫɪɟɞɧɸɸ ɞɥɢɧɭ ɤɨɞɨɜ ɦɨɠɧɨ ɜɵɱɢɫɥɢɬɶ ɩɨ ɮɨɪɦɭɥɟ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
25
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
H = − ƒPk ⋅ H k = − ƒPk ⋅ pk ( si ) log 2 pk ( si ) , k
(1ɛ)
k ,i
ɝɞɟ
Pk — ɜɟɪɨɹɬɧɨɫɬɶ ɬɨɝɨ, ɱɬɨ F ɩɪɢɦɟɬ k-ɨɟ ɡɧɚɱɟɧɢɟ, ɢɥɢ, ɢɧɚɱɟ, ɜɟɪɨɹɬɧɨɫɬɶ ɧɚɯɨɠɞɟɧɢɹ ɢɫɬɨɱɧɢɤɚ ɜ ɫɨɫɬɨɹɧɢɢ k. ɂɬɚɤ, ɟɫɥɢ ɧɚɦ ɢɡɜɟɫɬɧɨ ɪɚɫɩɪɟɞɟɥɟɧɢɟ ɜɟɪɨɹɬɧɨɫɬɟɣ ɷɥɟɦɟɧɬɨɜ, ɝɟɧɟɪɢɪɭɟɦɵɯ ɢɫɬɨɱɧɢɤɨɦ, ɬɨ ɦɵ ɦɨɠɟɦ ɩɪɟɞɫɬɚɜɢɬɶ ɞɚɧɧɵɟ ɧɚɢɛɨɥɟɟ ɤɨɦɩɚɤɬɧɵɦ ɨɛɪɚɡɨɦ, ɩɪɢ ɷɬɨɦ ɫɪɟɞɧɹɹ ɞɥɢɧɚ ɤɨɞɨɜ ɦɨɠɟɬ ɛɵɬɶ ɜɵɱɢɫɥɟɧɚ ɩɨ ɮɨɪɦɭɥɟ (1). ɇɨ ɜ ɩɨɞɚɜɥɹɸɳɟɦ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ ɢɫɬɢɧɧɚɹ ɫɬɪɭɤɬɭɪɚ ɢɫɬɨɱɧɢɤɚ ɧɚɦ ɧɟ ɢɡɜɟɫɬɧɚ, ɩɨɷɬɨɦɭ ɧɟɨɛɯɨɞɢɦɨ ɫɬɪɨɢɬɶ ɦɨɞɟɥɶ ɢɫɬɨɱɧɢɤɚ, ɤɨɬɨɪɚɹ ɩɨɡɜɨɥɢɥɚ ɛɵ ɧɚɦ ɜ ɤɚɠɞɨɣ ɩɨɡɢɰɢɢ ɜɯɨɞɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɨɰɟɧɢɬɶ ɜɟɪɨɹɬɧɨɫɬɶ p(si) ɩɨɹɜɥɟɧɢɹ ɤɚɠɞɨɝɨ ɷɥɟɦɟɧɬɚ si ɚɥɮɚɜɢɬɚ ɜɯɨɞɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ. ȼ ɷɬɨɦ ɫɥɭɱɚɟ ɦɵ ɨɩɟɪɢɪɭɟɦ ɨɰɟɧɤɨɣ q(si) ɜɟɪɨɹɬɧɨɫɬɢ ɷɥɟɦɟɧɬɚ si. Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɦɨɝɭɬ ɫɬɪɨɢɬɶ ɦɨɞɟɥɶ ɢɫɬɨɱɧɢɤɚ ɚɞɚɩɬɢɜɧɨ ɩɨ ɦɟɪɟ ɨɛɪɚɛɨɬɤɢ ɩɨɬɨɤɚ ɞɚɧɧɵɯ ɢɥɢ ɢɫɩɨɥɶɡɨɜɚɬɶ ɮɢɤɫɢɪɨɜɚɧɧɭɸ ɦɨɞɟɥɶ, ɫɨɡɞɚɧɧɭɸ ɧɚ ɨɫɧɨɜɟ ɚɩɪɢɨɪɧɵɯ ɩɪɟɞɫɬɚɜɥɟɧɢɣ ɨ ɩɪɢɪɨɞɟ ɬɢɩɨɜɵɯ ɞɚɧɧɵɯ, ɬɪɟɛɭɸɳɢɯ ɫɠɚɬɢɹ. ɉɪɨɰɟɫɫ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɦɨɠɟɬ ɛɵɬɶ ɥɢɛɨ ɹɜɧɵɦ, ɥɢɛɨ ɫɤɪɵɬɵɦ. ȼɟɪɨɹɬɧɨɫɬɢ ɷɥɟɦɟɧɬɨɜ ɦɨɝɭɬ ɢɫɩɨɥɶɡɨɜɚɬɶɫɹ ɜ ɦɟɬɨɞɟ ɤɚɤ ɹɜɧɵɦ, ɬɚɤ ɢ ɧɟɹɜɧɵɦ ɨɛɪɚɡɨɦ. ɇɨ ɜɫɟɝɞɚ ɫɠɚɬɢɟ ɞɨɫɬɢɝɚɟɬɫɹ ɡɚ ɫɱɟɬ ɭɫɬɪɚɧɟɧɢɹ ɫɬɚɬɢɫɬɢɱɟɫɤɨɣ ɢɡɛɵɬɨɱɧɨɫɬɢ ɜ ɩɪɟɞɫɬɚɜɥɟɧɢɢ ɢɧɮɨɪɦɚɰɢɢ. ɇɢ ɨɞɢɧ ɤɨɦɩɪɟɫɫɨɪ ɧɟ ɦɨɠɟɬ ɫɠɚɬɶ ɥɸɛɨɣ ɮɚɣɥ. ɉɨɫɥɟ ɨɛɪɚɛɨɬɤɢ ɥɸɛɵɦ ɤɨɦɩɪɟɫɫɨɪɨɦ ɪɚɡɦɟɪ ɱɚɫɬɢ ɮɚɣɥɨɜ ɭɦɟɧɶɲɢɬɫɹ, ɚ ɨɫɬɚɜɲɟɣɫɹ ɱɚɫɬɢ — ɭɜɟɥɢɱɢɬɫɹ ɢɥɢ ɨɫɬɚɧɟɬɫɹ ɧɟɢɡɦɟɧɧɵɦ. Ⱦɚɧɧɵɣ ɮɚɤɬ ɦɨɠɧɨ ɞɨɤɚɡɚɬɶ ɢɫɯɨɞɹ ɢɡ ɧɟɪɚɜɧɨɦɟɪɧɨɫɬɢ ɤɨɞɢɪɨɜɚɧɢɹ, ɬ.ɟ. ɪɚɡɧɨɣ ɞɥɢɧɵ ɢɫɩɨɥɶɡɭɟɦɵɯ ɤɨɞɨɜ, ɧɨ ɧɚɢɛɨɥɟɟ ɩɪɨɫɬ ɞɥɹ ɩɨɧɢɦɚɧɢɹ ɫɥɟɞɭɸɳɢɣ ɤɨɦɛɢɧɚɬɨɪɧɵɣ ɚɪɝɭɦɟɧɬ. ɋɭɳɟɫɬɜɭɟɬ 2n ɪɚɡɥɢɱɧɵɯ ɮɚɣɥɨɜ ɞɥɢɧɵ n ɛɢɬɨɜ, ɝɞɟ n = 0, 1, 2, … ȿɫɥɢ ɪɚɡɦɟɪ ɤɚɠɞɨɝɨ ɬɚɤɨɝɨ ɮɚɣɥɚ ɜ ɪɟɡɭɥɶɬɚɬɟ ɨɛɪɚɛɨɬɤɢ ɭɦɟɧɶɲɚɟɬɫɹ ɯɨɬɹ ɛɵ ɧɚ 1 ɛɢɬ, ɬɨ 2n ɢɫɯɨɞɧɵɦ ɮɚɣɥɚɦ ɛɭɞɟɬ ɫɨɨɬɜɟɬɫɬɜɨɜɚɬɶ ɫɚɦɨɟ ɛɨɥɶɲɟɟ 2n-1 ɪɚɡɥɢɱɚɸɳɢɯɫɹ ɚɪɯɢɜɧɵɯ ɮɚɣɥɨɜ. Ɍɨɝɞɚ ɩɨ ɤɪɚɣɧɟɣ ɦɟɪɟ ɨɞɧɨɦɭ ɚɪɯɢɜɧɨɦɭ ɮɚɣɥɭ ɛɭɞɟɬ 26
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɫɨɨɬɜɟɬɫɬɜɨɜɚɬɶ ɧɟɫɤɨɥɶɤɨ ɪɚɡɥɢɱɚɸɳɢɯɫɹ ɢɫɯɨɞɧɵɯ, ɢ, ɫɥɟɞɨɜɚɬɟɥɶɧɨ, ɟɝɨ ɞɟɤɨɞɢɪɨɜɚɧɢɟ ɛɟɡ ɩɨɬɟɪɶ ɢɧɮɨɪɦɚɰɢɢ ɧɟɜɨɡɦɨɠɧɨ ɜ ɩɪɢɧɰɢɩɟ.
ȼɵɲɟɫɤɚɡɚɧɧɨɟ ɩɪɟɞɩɨɥɚɝɚɟɬ, ɱɬɨ ɮɚɣɥ ɨɬɨɛɪɚɠɚɟɬɫɹ ɜ ɨɞɢɧ ɮɚɣɥ, ɢ ɨɛɴɟɦ ɞɚɧɧɵɯ ɭɤɚɡɵɜɚɟɬɫɹ ɜ ɫɚɦɢɯ ɞɚɧɧɵɯ. ȿɫɥɢ ɷɬɨ ɧɟ ɬɚɤ, ɬɨ ɫɥɟɞɭɟɬ ɭɱɢɬɵɜɚɬɶ ɧɟ ɬɨɥɶɤɨ ɫɭɦɦɚɪɧɵɣ ɪɚɡɦɟɪ ɚɪɯɢɜɧɵɯ ɮɚɣɥɨɜ, ɧɨ ɢ ɨɛɴɟɦ ɢɧɮɨɪɦɚɰɢɢ, ɧɟɨɛɯɨɞɢɦɨɣ ɞɥɹ ɨɩɢɫɚɧɢɹ ɧɟɫɤɨɥɶɤɢɯ ɜɡɚɢɦɨɫɜɹɡɚɧɧɵɯ ɚɪɯɢɜɧɵɯ ɮɚɣɥɨɜ ɢ/ɢɥɢ ɪɚɡɦɟɪɚ ɢɫɯɨɞɧɨɝɨ ɮɚɣɥɚ. Ɉɛɳɧɨɫɬɶ ɞɨɤɚɡɚɬɟɥɶɫɬɜɚ ɩɪɢ ɷɬɨɦ ɫɨɯɪɚɧɹɟɬɫɹ.
ɉɨɷɬɨɦɭ ɧɟɜɨɡɦɨɠɟɧ «ɜɟɱɧɵɣ» ɚɪɯɢɜɚɬɨɪ, ɤɨɬɨɪɵɣ ɫɩɨɫɨɛɟɧ ɛɟɫɤɨɧɟɱɧɨɟ ɱɢɫɥɨ ɪɚɡ ɫɠɢɦɚɬɶ ɫɜɨɢ ɠɟ ɚɪɯɢɜɵ. «ɇɚɢɥɭɱɲɢɦ» ɚɪɯɢɜɚɬɨɪɨɦ ɹɜɥɹɟɬɫɹ ɩɪɨɝɪɚɦɦɚ ɤɨɩɢɪɨɜɚɧɢɹ, ɩɨɫɤɨɥɶɤɭ ɜ ɷɬɨɦ ɫɥɭɱɚɟ ɦɵ ɦɨɠɟɦ ɛɵɬɶ ɜɫɟɝɞɚ ɭɜɟɪɟɧɵ ɜ ɬɨɦ, ɱɬɨ ɨɛɴɟɦ ɞɚɧɧɵɯ ɜ ɪɟɡɭɥɶɬɚɬɟ ɨɛɪɚɛɨɬɤɢ ɧɟ ɭɜɟɥɢɱɢɬɫɹ. Ɋɟɝɭɥɹɪɧɨ ɩɨɹɜɥɹɸɳɢɟɫɹ ɡɚɹɜɥɟɧɢɹ ɨ ɫɨɡɞɚɧɢɢ ɚɥɝɨɪɢɬɦɨɜ ɫɠɚɬɢɹ, «ɨɛɟɫɩɟɱɢɜɚɸɳɢɯ ɫɠɚɬɢɟ ɜ ɞɟɫɹɬɤɢ ɪɚɡ ɥɭɱɲɟɟ, ɱɟɦ ɭ ɨɛɵɱɧɵɯ ɚɪɯɢɜɚɬɨɪɨɜ», ɹɜɥɹɸɬɫɹ ɥɢɛɨ ɥɨɠɧɵɦɢ ɫɥɭɯɚɦɢ, ɩɨɪɨɠɞɟɧɧɵɦɢ ɧɟɜɟɠɟɫɬɜɨɦ ɢ ɩɨɝɨɧɟɣ ɡɚ ɫɟɧɫɚɰɢɹɦɢ, ɥɢɛɨ ɪɟɤɥɚɦɨɣ ɚɮɟɪɢɫɬɨɜ. ȼ ɨɛɥɚɫɬɢ ɫɠɚɬɢɹ ɛɟɡ ɩɨɬɟɪɶ, ɬ.ɟ. ɫɨɛɫɬɜɟɧɧɨ ɫɠɚɬɢɹ, ɬɚɤɢɟ ɪɟɜɨɥɸɰɢɢ ɧɟɜɨɡɦɨɠɧɵ. Ȼɟɡɭɫɥɨɜɧɨ, ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɤɨɦɩɪɟɫɫɨɪɚɦɢ ɬɢɩɢɱɧɵɯ ɞɚɧɧɵɯ ɛɭɞɟɬ ɧɟɭɤɥɨɧɧɨ ɪɚɫɬɢ, ɧɨ ɭɥɭɱɲɟɧɢɹ ɫɨɫɬɚɜɹɬ ɜ ɫɪɟɞɧɟɦ ɞɟɫɹɬɤɢ ɢɥɢ ɞɚɠɟ ɟɞɢɧɢɰɵ ɩɪɨɰɟɧɬɨɜ, ɩɪɢ ɷɬɨɦ ɤɚɠɞɵɣ ɩɨɫɥɟɞɭɸɳɢɣ ɷɬɚɩ ɷɜɨɥɸɰɢɢ ɛɭɞɟɬ ɨɛɯɨɞɢɬɶɫɹ ɡɧɚɱɢɬɟɥɶɧɨ ɞɨɪɨɠɟ ɩɪɟɞɵɞɭɳɟɝɨ. ɋ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, ɜ ɫɮɟɪɟ ɫɠɚɬɢɹ ɫ ɩɨɬɟɪɹɦɢ, ɜ ɩɟɪɜɭɸ ɨɱɟɪɟɞɶ ɤɨɦɩɪɟɫɫɢɢ ɜɢɞɟɨɞɚɧɧɵɯ, ɜɫɟ ɟɳɟ ɜɨɡɦɨɠɧɨ ɦɧɨɝɨɤɪɚɬɧɨɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ ɩɪɢ ɫɨɯɪɚɧɟɧɢɢ ɫɭɛɴɟɤɬɢɜɧɨɣ ɩɨɥɧɨɬɵ ɩɨɥɭɱɚɟɦɨɣ ɢɧɮɨɪɦɚɰɢɢ.
Ƚɥɚɜɚ 1. Ʉɨɞɢɪɨɜɚɧɢɟ ɢɫɬɨɱɧɢɤɨɜ ɞɚɧɧɵɯ ɛɟɡ ɩɚɦɹɬɢ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
27
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ƚɥɚɜɚ 2. Ʉɨɞɢɪɨɜɚɧɢɟ ɢɫɬɨɱɧɢɤɨɜ ɞɚɧɧɵɯ ɬɢɩɚ «ɚɧɚɥɨɝɨɜɵɣ ɫɢɝɧɚɥ» Ʌɢɧɟɣɧɨ-ɩɪɟɞɫɤɚɡɵɜɚɸɳɟɟ ɤɨɞɢɪɨɜɚɧɢɟ Ⱥɧɝɥɢɣɫɤɨɟ ɧɚɡɜɚɧɢɟ ɦɟɬɨɞɚ — Linear Prediction Coding (LPC). ɐɟɥɶ — ɫɠɚɬɢɟ ɩɨɬɨɤɚ R-ɛɢɬɧɵɯ ɷɥɟɦɟɧɬɨɜ, ɜ ɩɪɟɞɩɨɥɨɠɟɧɢɢ, ɱɬɨ ɡɧɚɱɟɧɢɟ ɤɚɠɞɨɝɨ ɢɡ ɧɢɯ ɹɜɥɹɟɬɫɹ ɥɢɧɟɣɧɨɣ ɤɨɦɛɢɧɚɰɢɟɣ ɡɧɚɱɟɧɢɣ h ɩɪɟɞɵɞɭɳɢɯ ɷɥɟɦɟɧɬɨɜ: j =i −h
Si =
ƒK S j
j
,
j = i −1
Si — i-ɵɣ R-ɛɢɬɧɵɣ ɷɥɟɦɟɧɬ; Kj — ɧɟɤɨɬɨɪɵɟ ɤɨɷɮɮɢɰɢɟɧɬɵ, ɜ ɨɛɳɟɦ ɫɥɭɱɚɟ ɧɟɩɨɫɬɨɹɧɧɵɟ. Ɉɫɧɨɜɧɚɹ ɢɞɟɹ ɫɨɫɬɨɢɬ ɜ ɬɨɦ, ɱɬɨɛɵ ɜ ɮɨɪɦɢɪɭɟɦɵɣ ɩɨɬɨɤ ɡɚɩɢɫɵɜɚɬɶ ɨɲɢɛɤɢ ɩɪɟɞɫɤɚɡɚɧɢɣ: ɪɚɡɧɨɫɬɢ ɦɟɠɞɭ ɪɟɚɥɶɧɵɦɢ Si ɢ ɩɪɟɞɫɤɚɡɚɧɧɵɦɢ ɡɧɚɱɟɧɢɹɦɢ:
ɝɞɟ
j =i − h
Di = Si −
ƒK S j
j
.
j = i −1
Ɋɚɡɦɟɪ ɞɚɧɧɵɯ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɪɢɦɟɧɟɧɢɹ LPC ɧɟ ɢɡɦɟɧɹɟɬɫɹ. Ȼɨɥɟɟ ɬɨɝɨ, ɪɚɡɦɟɪ ɷɥɟɦɟɧɬɨɜ R ɦɨɠɟɬ ɞɚɠɟ ɭɜɟɥɢɱɢɜɚɬɶɫɹ ɧɚ 1: R`=R+1 ɡɚ ɫɱɟɬ ɞɨɛɚɜɥɟɧɢɹ ɛɢɬɚ ɞɥɹ ɫɨɯɪɚɧɟɧɢɹ ɡɧɚɤɚ ɪɚɡɧɨɫɬɢ. ɑɟɦ ɬɨɱɧɟɟ ɩɪɟɞɫɤɚɡɚɧɢɟ, ɬɟɦ ɛɨɥɶɲɟ ɜ ɩɪɟɨɛɪɚɡɨɜɚɧɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɷɥɟɦɟɧɬɨɜ ɫ ɛɥɢɡɤɢɦɢ ɤ ɧɭɥɸ ɡɧɚɱɟɧɢɹɦɢ, ɬɟɦ ɥɭɱɲɟ ɦɨɠɧɨ ɫɠɚɬɶ ɬɚɤɭɸ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ. Ⱦɥɹ ɫɠɚɬɢɹ ɪɟɡɭɥɶɬɚɬɚ ɪɚɛɨɬɵ ɦɟɬɨɞɚ ɦɨɠɟɬ ɛɵɬɶ ɩɪɢɦɟɧɟɧɚ ɥɸɛɚɹ ɤɨɦɛɢɧɚɰɢɹ ɦɟɬɨɞɨɜ — RLE, MTF, DC, PBS, HUFF, ARIC, ENUC, SEM... Ɇɟɬɨɞɵ ɷɬɨɣ ɝɪɭɩɩɵ ɹɜɥɹɸɬɫɹ ɬɪɚɧɫɮɨɪɦɢɪɭɸɳɢɦɢ ɢ ɩɨɬɨɱɧɵɦɢ (ɬ.ɟ. ɦɨɝɭɬ ɩɪɢɦɟɧɹɬɶɫɹ ɞɚɠɟ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɤɨɝɞɚ ɞɥɢɧɚ ɛɥɨɤɚ ɫ ɞɚɧɧɵɦɢ ɧɟ ɡɚɞɚɧɚ). ɋɤɨɪɨɫɬɶ ɜɵɩɨɥɧɟɧɢɹ ɩɪɹɦɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɪɚɜɧɚ ɫɤɨɪɨɫɬɢ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɢ 28
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɡɚɜɢɫɢɬ ɬɨɥɶɤɨ ɨɬ ɪɚɡɦɟɪɚ ɞɚɧɧɵɯ, ɧɨ ɧɟ ɨɬ ɢɯ ɫɨɞɟɪɠɚɧɢɹ, ɬ.ɟ. ɋɤɨɪɨɫɬɶ=O(Ɋɚɡɦɟɪ). ɉɚɦɹɬɢ ɬɪɟɛɭɟɬɫɹ ɩɨɪɹɞɤɚ h ɛɚɣɬɨɜ. ɂɡ ɤɪɚɬɤɨɝɨ ɨɩɢɫɚɧɢɹ ɨɛɳɟɣ ɢɞɟɢ ɜɢɞɧɨ, ɱɬɨ 1) ɦɨɠɧɨ ɨɞɢɧ ɪɚɡ, ɩɪɢ ɢɧɢɰɢɚɥɢɡɚɰɢɢ, ɡɚɞɚɬɶ ɤɚɤ h, ɬɚɤ ɢ Kj, 2) ɧɨ ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɫɥɨɠɧɨɫɬɢ ɜɵɱɢɫɥɟɧɢɣ ɢ ɤɚɱɟɫɬɜɚ ɫɠɚɬɢɹ, ɩɨɥɟɡɧɨ ɨɝɪɚɧɢɱɢɬɶ h, ɧɨ ɩɟɪɢɨɞɢɱɟɫɤɢ ɨɩɪɟɞɟɥɹɬɶ ɨɩɬɢɦɚɥɶɧɵɟ Kj; 3) ɬɟɨɪɟɬɢɱɟɫɤɢ, ɨɞɧɚ ɢ ɬɚ ɠɟ ɡɚɜɢɫɢɦɨɫɬɶ ɦɨɠɟɬ ɛɵɬɶ ɡɚɞɚɧɚ ɧɟɫɤɨɥɶɤɢɦɢ ɮɨɪɦɭɥɚɦɢ, ɧɚɩɪɢɦɟɪ Si=(Si–1+Si–2)/2 ɢ S`i= Si–1/2 + Si–2/2, ɧɨ ɪɟɚɥɶɧɨ, ɢɡ-ɡɚ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɰɟɥɨɱɢɫɥɟɧɧɨɣ ɚɪɢɮɦɟɬɢɤɢ, ɨɧɢ ɧɟ ɷɤɜɢɜɚɥɟɧɬɵ; ɜ ɞɚɧɧɨɦ ɫɥɭɱɚɟ ɩɪɢ ɜɵɱɢɫɥɟɧɢɢ S`i ɢɫɩɨɥɶɡɭɟɬɫɹ ɞɜɚ ɨɤɪɭɝɥɟɧɢɹ ɜɦɟɫɬɨ ɨɞɧɨɝɨ, ɩɨɷɬɨɦɭ ɦɵ ɩɨɥɭɱɢɦ ɪɚɡɥɢɱɢɟ. ɉɊəɆɈȿ ɉɊȿɈȻɊȺɁɈȼȺɇɂȿ
ȼ ɛɚɡɨɜɨɦ ɩɪɨɫɬɟɣɲɟɦ ɫɥɭɱɚɟ ɢɥɥɸɫɬɪɢɪɭɟɬɫɹ ɨɞɧɨɣ ɫɬɪɨɤɨɣ: /* ɩɪɟɞɩɨɥɚɝɚɟɦ, ɱɬɨ S[i]≈S[i–1], ɢ, ɫɥɟɞɨɜɚɬɟɥɶɧɨ, D[i]≈0 */ D[i]=S[i]–S[i–1];
S[N] — ɢɫɯɨɞɧɵɣ ɦɚɫɫɢɜ (Source, ɢɫɬɨɱɧɢɤ) D[N] — ɜɵɯɨɞɧɨɣ ɦɚɫɫɢɜ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɞɚɧɧɵɯ (Destination, ɩɪɢɟɦɧɢɤ, ɫ ɨɬɤɥɨɧɟɧɢɹɦɢ, ɬ.ɟ. ɪɚɡɧɨɫɬɹɦɢ, ɞɟɥɶɬɚɦɢ). Ɍɚɤɨɣ ɜɚɪɢɚɧɬ ɨɛɵɱɧɨ ɧɚɡɵɜɚɟɬɫɹ ɞɟɥɶɬɚ-ɤɨɞɢɪɨɜɚɧɢɟ (Delta ɋoding), ɩɨɫɤɨɥɶɤɭ ɡɚɩɢɫɵɜɚɟɦ ɩɪɢɪɚɳɟɧɢɹ ɷɥɟɦɟɧɬɨɜ ɨɬɧɨɫɢɬɟɥɶɧɨ ɡɧɚɱɟɧɢɣ ɩɪɟɞɵɞɭɳɢɯ ɷɥɟɦɟɧɬɨɜ. ȿɫɥɢ ɜ ɡɧɚɱɟɧɢɹɯ ɷɥɟɦɟɧɬɨɜ ɢɦɟɟɬɫɹ ɹɪɤɨ ɜɵɪɚɠɟɧɧɚɹ ɥɢɧɟɣɧɚɹ ɬɟɧɞɟɧɰɢɹ, ɬɨ ɜ ɪɟɡɭɥɶɬɚɬɟ ɩɨɥɭɱɚɟɦ ɪɹɞ ɱɢɫɟɥ ɫ ɛɥɢɡɤɢɦɢ ɡɧɚɱɟɧɢɹɦɢ. Ɍɪɢ ɫɬɪɨɤɢ, ɟɫɥɢ ɬɪɟɛɭɟɬɫɹ ɩɢɫɚɬɶ ɜ ɬɨɬ ɠɟ ɦɚɫɫɢɜ: current=S[i];
//ɜɨɡɶɦɟɦ ɨɱɟɪɟɞɧɨɣ ɷɥɟɦɟɧɬ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
29
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
S[i]=current-last; //ɜɵɱɢɫɥɢɦ ɟɝɨ ɪɚɡɧɨɫɬɶ ɫ ɩɪɨɲɥɵɦ last=current; //ɬɟɩɟɪɶ ɨɱɟɪɟɞɧɨɣ ɫɬɚɥ ɩɪɨɲɥɵɦ
ɇɚɩɪɢɦɟɪ, ɢɡ ɛɥɨɤɚ (12, 14, 15, 17, 16, 15, 13, 11, 9), ɩɪɢɦɟɧɢɜ ɷɬɨɬ ɩɪɨɫɬɟɣɲɢɣ ɜɚɪɢɚɧɬ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɩɨɥɭɱɢɦ: (2, 1, 2, –1, –1, –2, –2, –2). Ȼɨɥɟɟ ɫɥɨɠɧɵɣ ɜɚɪɢɚɧɬ: h=4, ɩɪɟɞɩɨɥɚɝɚɟɦ, ɱɬɨ Ki=1/4: S[i]≈( S[i–1] + S[i–2] + S[i–3] + S[i–4] )/4. Ɍɨɝɞɚ ɜ ɚɥɝɨɪɢɬɦɟ: D[i]=S[i] – (S[i–1]+S[i–2]+S[i–3]+S[i–4])/4;
Ɂɞɟɫɶ ɦɵ ɩɪɟɞɩɨɥɚɝɚɟɦ, ɱɬɨ ɹɜɧɨ ɜɵɪɚɠɟɧɧɚɹ ɥɢɧɟɣɧɚɹ ɬɟɧɞɟɧɰɢɹ ɨɬɫɭɬɫɬɜɭɟɬ, ɢ ɡɧɚɱɟɧɢɟ ɨɱɟɪɟɞɧɨɝɨ ɷɥɟɦɟɧɬɚ ɩɪɢɦɟɪɧɨ ɪɚɜɧɨ ɡɧɚɱɟɧɢɸ ɩɪɟɞɵɞɭɳɟɝɨ, ɩɪɢɱɟɦ D[i] ɩɪɢɨɛɪɟɬɚɟɬ ɨɬɪɢɰɚɬɟɥɶɧɵɟ ɢ ɩɨɥɨɠɢɬɟɥɶɧɵɟ ɡɧɚɱɟɧɢɹ ɫ ɪɚɜɧɨɣ ɜɟɪɨɹɬɧɨɫɬɶɸ. ɑɬɨɛɵ ɤɨɦɩɟɧɫɢɪɨɜɚɬɶ ɜɥɢɹɧɢɟ ɫɥɭɱɚɣɧɵɯ ɜɨɡɦɭɳɟɧɢɣ, ɡɧɚɱɟɧɢɟ ɫɥɟɞɭɸɳɟɝɨ ɷɥɟɦɟɧɬɚ ɩɪɢɧɢɦɚɟɦ ɪɚɜɧɵɦ ɫɪɟɞɧɟɦɭ ɚɪɢɮɦɟɬɢɱɟɫɤɨɦɭ ɧɟɫɤɨɥɶɤɢɯ ɩɨɫɥɟɞɧɢɯ ɷɥɟɦɟɧɬɨɜ. ɋ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, ɱɟɦ ɛɨɥɶɲɟ ɷɥɟɦɟɧɬɨɜ ɭɫɪɟɞɧɹɟɦ, ɬɟɦ ɤɨɧɫɟɪɜɚɬɢɜɧɟɟ ɧɚɲɚ ɦɨɞɟɥɶ, ɬɟɦ ɫ ɛɨɥɶɲɢɦ ɡɚɩɚɡɞɵɜɚɧɢɟɦ ɨɧɚ ɛɭɞɟɬ ɚɞɚɩɬɢɪɨɜɚɬɶɫɹ ɤ ɫɭɳɟɫɬɜɟɧɧɵɦ ɢɡɦɟɧɟɧɢɹɦ (ɧɟɨɛɹɡɚɬɟɥɶɧɨ ɥɢɧɟɣɧɨɝɨ ɯɚɪɚɤɬɟɪɚ) ɜɨ ɜɯɨɞɧɵɯ ɞɚɧɧɵɯ. ȿɫɥɢ ɪɟɡɭɥɶɬɚɬ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɬɪɟɛɭɟɬɫɹ ɡɚɩɢɫɵɜɚɬɶ ɜ ɬɨɬ ɠɟ ɜɯɨɞɧɨɣ ɦɚɫɫɢɜ S, ɬɨ ɷɬɨ ɦɨɠɧɨ ɪɟɚɥɢɡɨɜɚɬɶ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ. ȼɜɟɞɟɦ ɜɫɩɨɦɨɝɚɬɟɥɶɧɵɣ ɦɚɫɫɢɜ Last, ɜ ɤɨɬɨɪɨɦ ɛɭɞɟɦ ɯɪɚɧɢɬɶ ɢɫ-ɯɨɞɧɵɟ ɡɧɚɱɟɧɢɹ ɩɨɫɥɟɞɧɢɯ ɱɟɬɵɪɟɯ ɩɪɟɨɛɪɚɡɨɜɚɧɧɵɯ ɷɥɟɦɟɧɬɨɜ ɦɚɫɫɢɜɚ S. int Last[4]={ 0,0,0,0 }; int last_pos=0;
ɂ ɞɚɥɟɟ ɜ ɰɢɤɥɟ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɞɥɹ ɤɚɠɞɨɝɨ ɷɥɟɦɟɧɬɚ S[i] ɜɵɩɨɥɧɹɟɦ: current=S[i]; // ɜɨɡɶɦɟɦ ɨɱɟɪɟɞɧɨɣ ɷɥɟɦɟɧɬ ɢ ɜɵɱɢɫɥɢɦ // ɟɝɨ ɪɚɡɧɨɫɬɶ ɫ ɩɪɟɞɫɤɚɡɵɜɚɟɦɵɦ ɡɧɚɱɟɧɢɟɦ:
30
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
S[i]=current-(Last[0]+Last[1]+Last[2]+Last[3])/4; Last[last_pos]=current; // ɜɧɟɫɟɦ current ɜ ɦɚɫɫɢɜ Last last_pos=(last_pos+1)&3; // ɧɨɜɨɟ ɡɧɚɱɟɧɢɟ ɩɨɡɢɰɢɢ ɜ Last
ɍɩɪɚɠɧɟɧɢɟ: Ʉɚɤ ɛɭɞɟɬ ɜɵɝɥɹɞɟɬɶ ɚɥɝɨɪɢɬɦ ɞɥɹ ɦɨɞɟɥɢ S[i]=( S[i–1] + S[i–2] + S[i–3] )/3 ? Ȼɭɞɟɬ ɥɢ ɨɧ ɜɵɩɨɥɧɹɬɶɫɹ ɛɵɫɬɪɟɟ ɢɥɢ ɦɟɞɥɟɧɧɟɟ ɪɚɫɫɦɨɬɪɟɧɧɨɝɨ ɜɚɪɢɚɧɬɚ ɫ h=4 ɢ Kj=1/4 ? ɈȻɊȺɌɇɈȿ ɉɊȿɈȻɊȺɁɈȼȺɇɂȿ
Ⱥɥɝɨɪɢɬɦ ɨɱɟɧɶ ɩɨɯɨɠ ɧɚ ɚɥɝɨɪɢɬɦ ɩɪɹɦɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. ȿɞɢɧɫɬɜɟɧɧɨɟ ɨɬɥɢɱɢɟ — ɬɟɩɟɪɶ ɜɵɱɢɫɥɹɟɦ ɧɟ ɪɚɡɧɨɫɬɶ, ɚ ɫɭɦɦɭ ɩɪɟɞɫɤɚɡɵɜɚɟɦɨɝɨ ɡɧɚɱɟɧɢɹ ɢ ɨɬɤɥɨɧɟɧɢɹ: S[i]=D[i]+S[i-1]; // ɩɨ ɩɪɟɞɩɨɥɨɠɟɧɧɨɦɭ, S[i]=S[i-1]
ȿɫɥɢ ɞɥɹ D ɢ S ɢɫɩɨɥɶɡɭɟɦ ɨɞɢɧ ɢ ɬɨɬ ɠɟ ɦɚɫɫɢɜ (S): S[i]=S[i]+S[i-1]; // ɫɭɦɦɚ ɞɟɥɶɬɵ ɫ ɩɪɟɞɵɞɭɳɢɦ ɷɥɟɦɟɧɬɨɦ
ȼ ɫɥɭɱɚɟ h=4 , Kj=1/4 : S[i]=D[i] + (S[i-1]+S[i-2]+S[i-3]+S[i-4])/4;
ȿɫɥɢ ɩɢɲɟɦ ɜ ɬɨɬ ɠɟ ɦɚɫɫɢɜ, ɬɨ ɢ ɜ ɷɬɨɦ ɫɥɭɱɚɟ, ɜ ɨɬɥɢɱɢɟ ɨɬ ɩɪɹɦɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ, ɧɟ ɬɪɟɛɭɟɬɫɹ ɤɚɤɢɯ-ɬɨ ɭɯɢɳɪɟɧɢɣ: S[i]=S[i] + (S[i-1]+S[i-2]+S[i-3]+S[i-4])/4;
Ⱦɟɣɫɬɜɢɬɟɥɶɧɨ, ɤ ɦɨɦɟɧɬɭ ɨɛɪɚɬɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɨɱɟɪɟɞɧɨɝɨ ɷɥɟɦɟɧɬɚ S[i] ɜ ɹɱɟɣɤɚɯ S[i–1], ..., S[i–4] ɭɠɟ ɧɚɯɨɞɹɬɫɹ ɜɨɫɫɬɚɧɨɜɥɟɧɧɵɟ ɡɧɚɱɟɧɢɹ, ɚ ɧɟ ɨɬɤɥɨɧɟɧɢɹ, ɱɬɨ ɧɚɦ ɤɚɤ ɪɚɡ ɢ ɧɭɠɧɨ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɢɫɩɨɥɶɡɨɜɚɬɶ ɩɪɢ ɪɚɡɠɚɬɢɢ ɞɜɚ ɦɚɫɫɢɜɚ ɫɨɜɟɪɲɟɧɧɨ ɧɟɨɛɹɡɚɬɟɥɶɧɨ.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
31
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɉɍɌɂ ɍȼȿɅɂɑȿɇɂə ɋɄɈɊɈɋɌɂ ɋɀȺɌɂə
ȿɫɥɢ ɦɨɠɧɨ ɡɚɩɢɫɵɜɚɬɶ ɜ ɬɨɬ ɠɟ ɦɚɫɫɢɜ, ɬɨ ɦɨɠɧɨ ɨɛɨɣɬɢɫɶ ɛɟɡ ɢɡɥɢɲɧɟɝɨ ɦɚɫɫɢɜɚ Last[h] ɢ ɫɜɹɡɚɧɧɵɯ ɫ ɧɢɦ ɨɩɟɪɚɰɢɣ, ɜɵɩɨɥɧɹɟɦɵɯ ɧɚ ɤɚɠɞɨɦ ɲɚɝɟ ɰɢɤɥɚ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ. Ɋɚɫɫɦɨɬɪɢɦ ɜɫɟ ɬɨɬ ɠɟ ɩɪɢɦɟɪ ɫ h=4 , Kj=1/4. ɋɞɟɥɚɟɦ ɬɚɤ, ɱɬɨɛɵ ɜɧɭɬɪɢ ɰɢɤɥɚ ɛɵɥɨ ɩɪɢɫɜɚɢɜɚɧɢɟ: S[i-4]=S[i] - (S[i-1]+S[i-2]+S[i-3]+S[i-4])/4;
Ɍɨɝɞɚ ɩɟɪɜɵɟ ɱɟɬɵɪɟ ɷɥɟɦɟɧɬɚ ɧɚɦ ɩɪɢɞɟɬɫɹ ɡɚɩɢɫɵɜɚɬɶ ɨɬɞɟɥɶɧɨ: First[0]=S[0]; First[1]=S[1] - S[0]; First[2]=S[2] - (S[1]+S[0])/2; First[3]=S[3] - (S[2]+S[1]+S[0])/3;
Ⱦɚɥɟɟ ɫ ɩɨɦɨɳɶɸ ɰɢɤɥɚ ɩɪɟɨɛɪɚɡɭɟɦ ɰɟɩɨɱɤɭ ɢɡ ɩɨɫɥɟɞɧɢɯ (N–4) ɷɥɟɦɟɧɬɨɜ ɢ ɡɚɩɢɲɟɦ ɪɟɡɭɥɶɬɚɬɵ ɜ ɩɟɪɜɵɟ (N–4) ɹɱɟɣɤɢ ɦɚɫɫɢɜɚ S: for (i=4; iesc += 1;
140 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
stack[SP]->count[c] += 1; stack[SP]->TotFr += 1; } }
ɋɨɛɫɬɜɟɧɧɨ ɤɨɞɟɪ ɪɟɚɥɢɡɭɟɦ ɮɭɧɤɰɢɟɣ encode. ɗɬɚ ɮɭɧɤɰɢɹ ɭɩɪɚɜɥɹɟɬ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶɸ ɞɟɣɫɬɜɢɣ ɩɪɢ ɫɠɚɬɢɢ ɞɚɧɧɵɯ, ɜɵɡɵɜɚɹ ɜɫɩɨɦɨɝɚɬɟɥɶɧɵɟ ɩɪɨɰɟɞɭɪɵ ɜ ɬɪɟɛɭɟɦɨɦ ɩɨɪɹɞɤɟ, ɚ ɬɚɤɠɟ ɧɚɯɨɞɢɬ ɧɭɠɧɭɸ ɄɆ. Ɉɰɟɧɤɚ ɬɟɤɭɳɟɝɨ ɫɢɦɜɨɥɚ ɩɪɨɢɡɜɨɞɢɬɫɹ ɜ ɮɭɧɤɰɢɢ encode_sym, ɤɨɬɨɪɚɹ ɩɟɪɟɞɚɟɬ ɪɟɡɭɥɶɬɚɬɵ ɫɜɨɟɣ ɪɚɛɨɬɵ ɚɪɢɮɦɟɬɢɱɟɫɤɨɦɭ ɤɨɞɟɪɭ. int encode_sym (ContextModel *CM, int c){ // ɄɆ ɩɨɬɪɟɛɭɟɬ ɢɧɤɪɟɦɟɧɬɚ ɫɱɟɬɱɢɤɨɜ, ɡɚɩɨɦɧɢɦ ɟɟ stack [SP++] = CM; if (CM->count[c]){ /*ɫɱɟɬɱɢɤ ɫɠɢɦɚɟɦɨɝɨ ɫɢɦɜɨɥɚ ɧɟ ɪɚɜɟɧ ɧɭɥɸ, ɬɨɝɞɚ ɟɝɨ ɦɨɠɧɨ ɨɰɟɧɢɬɶ ɜ ɬɟɤɭɳɟɣ ɄɆ; ɧɚɣɞɟɦ ɧɚɤɨɩɥɟɧɧɭɸ ɱɚɫɬɨɬɭ ɩɪɟɞɵɞɭɳɟɝɨ ɜ ɦɚɫɫɢɜɟ count ɫɢɦɜɨɥɚ */ int CumFreqUnder = 0; for (int i = 0; i < c; i++) CumFreqUnder += CM->count[i]; /*ɩɟɪɟɞɚɞɢɦ ɨɩɢɫɚɧɢɟ ɤɨɞɨɜɨɝɨ ɩɪɨɫɬɪɚɧɫɬɜɚ, ɡɚɧɢɦɚɟɦɨɝɨ ɫɢɦɜɨɥɨɦ c, ɚɪɢɮɦɟɬɢɱɟɫɤɨɦɭ ɤɨɞɟɪɭ */ AC.encode (CumFreqUnder, CM->count[c], CM->TotFr + CM->esc); return 1; // ɜɨɡɜɪɚɳɚɟɦɫɹ ɜ encode ɫ ɩɨɛɟɞɨɣ }else{ /*ɧɭɠɧɨ ɭɯɨɞɢɬɶ ɧɚ ɄɆ(0); ɟɫɥɢ ɬɟɤɭɳɢɣ ɤɨɧɬɟɤɫɬ 1-ɝɨ ɩɨɪɹɞɤɚ ɜɫɬɪɟɬɢɥɫɹ ɩɟɪɜɵɣ ɪɚɡ, ɬɨ ɡɚɪɚɧɟɟ ɢɡɜɟɫɬɧɨ, ɱɬɨ ɟɝɨ ɄɆ ɩɭɫɬɚ (ɜɫɟ ɫɱɟɬɱɢɤɢ ɪɚɜɧɵ ɧɭɥɸ), ɢ ɤɨɞɢɪɨɜɚɬɶ ɭɯɨɞ ɧɟ ɬɨɥɶɤɨ ɧɟ ɢɦɟɟɬ ɫɦɵɫɥɚ, ɧɨ ɢ ɧɟɥɶɡɹ, ɬ.ɤ. TotFr+esc = 0 */ if (CM->esc) AC.encode (CM->TotFr, CM->esc, CM->TotFr + CM->esc) ; return 0; // ɡɚɤɨɞɢɪɨɜɚɬɶ ɫɢɦɜɨɥ ɧɟ ɭɞɚɥɨɫɶ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 141 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
} } void encode (void){ int c, // ɬɟɤɭɳɢɣ ɫɢɦɜɨɥ success; // ɭɫɩɟɲɧɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ ɫɢɦɜɨɥɚ ɜ ɄɆ init_model (); AC.StartEncode (); // ɩɪɨɢɧɢɰɢɚɥɢɡɢɪɭɟɦ ɚɪɢɮɦ. ɤɨɞɟɪ while (( c = DataFile.ReadSymbol() ) != EOF) { // ɩɨɩɪɨɛɭɟɦ ɡɚɤɨɞɢɪɨɜɚɬɶ ɜ ɄɆ(1) success = encode_sym (&cm[context[0]], c); if (!success) /*ɭɯɨɞɢɦ ɧɚ ɄɆ(0), ɝɞɟ ɥɸɛɨɣ ɫɢɦɜɨɥ ɩɨɥɭɱɢɬ ɧɟɧɭɥɟɜɭɸ ɨɰɟɧɤɭ ɢ ɛɭɞɟɬ ɡɚɤɨɞɢɪɨɜɚɧ */ encode_sym (&cm[256], c); update_model (c); context [0] = c; // ɫɞɜɢɧɟɦ ɤɨɧɬɟɤɫɬ } // ɡɚɤɨɞɢɪɭɟɦ ɡɧɚɤ ɤɨɧɰɚ ɮɚɣɥɚ ɫɢɦɜɨɥɨɦ ɭɯɨɞɚ ɫ ɄɆ(0) AC.encode (cm[context[0]].TotFr, cm[context[0]].esc, cm[context[0]].TotFr + cm[context[0]].esc); AC.encode (cm[256].TotFr, cm[256].esc, cm[256].TotFr + cm[256].esc); // ɡɚɜɟɪɲɢɦ ɪɚɛɨɬɭ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɟɪɚ AC.FinishEncode(); }
Ɋɟɚɥɢɡɚɰɢɹ ɞɟɤɨɞɟɪɚ ɜɵɝɥɹɞɢɬ ɚɧɚɥɨɝɢɱɧɨ. ȼɧɢɦɚɧɢɹ ɡɚɫɥɭɠɢɜɚɟɬ ɪɚɡɜɟ ɱɬɨ ɬɨɥɶɤɨ ɩɪɨɰɟɞɭɪɚ ɩɨɢɫɤɚ ɫɢɦɜɨɥɚ ɩɨ ɨɩɢɫɚɧɢɸ ɟɝɨ ɤɨɞɨɜɨɝɨ ɩɪɨɫɬɪɚɧɫɬɜɚ. Ɇɟɬɨɞ get_freq ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɟɪɚ ɜɨɡɜɪɚɳɚɟɬ ɱɢɫɥɨ x, ɥɟɠɚɳɟɟ ɜ ɞɢɚɩɚɡɨɧɟ [CumFreqUnder, CumFreqUnder+CM->count[i]), ɬ.ɟ. CumFreqUnder x < CumFreqUnder+CM->count[i]. ɉɨɷɬɨɦɭ ɢɫɤɨɦɵɦ ɫɢɦɜɨɥɨɦ ɹɜɥɹɟɬɫɹ i, ɞɥɹ ɤɨɬɨɪɨɝɨ ɜɵɩɨɥɧɢɬɫɹ ɷɬɨ ɭɫɥɨɜɢɟ. int decode_sym (ContextModel *CM, int *c){ stack [SP++] = CM; if (!CM->esc) return 0; int cum_freq = AC.get_freq (CM->TotFr + CM->esc); if (cum_freq < CM->TotFr){ /*ɫɢɦɜɨɥ ɛɵɥ ɡɚɤɨɞɢɪɨɜɚɧ ɜ ɷɬɨɣ ɄɆ; ɧɚɣɞɟɦ ɫɢɦɜɨɥ ɢ
142 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɟɝɨ ɬɨɱɧɨɟ ɤɨɞɨɜɨɟ ɩɪɨɫɬɪɚɧɫɬɜɨ */ int CumFreqUnder = 0; int i = 0; for (;;){ if ( (CumFreqUnder + CM->count[i]) count[i]; else break; i++; } /*ɨɛɧɨɜɢɦ ɫɨɫɬɨɹɧɢɟ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɟɪɚ ɧɚ ɨɫɧɨɜɚɧɢɢ ɬɨɱɧɨɣ ɧɚɤɨɩɥɟɧɧɨɣ ɱɚɫɬɨɬɵ ɫɢɦɜɨɥɚ */ AC.decode_update (CumFreqUnder, CM->count[i], CM->TotFr + CM->esc); *c = i; return 1; }else{ /*ɨɛɧɨɜɢɦ ɫɨɫɬɨɹɧɢɟ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɟɪɚ ɧɚ ɨɫɧɨɜɚɧɢɢ ɬɨɱɧɨɣ ɧɚɤɨɩɥɟɧɧɨɣ ɱɚɫɬɨɬɵ ɫɢɦɜɨɥɚ, ɨɤɚɡɚɜɲɟɝɨɫɹ ɫɢɦɜɨɥɨɦ ɭɯɨɞɚ */ AC.decode_update (CM->TotFr, CM->esc, CM->TotFr + CM->esc); return 0; } } void decode (void){ int c, success; init_model (); AC.StartDecode (); for (;;){ success = decode_sym (&cm[context[0]], &c); if (!success){ success = decode_sym (&cm[256], &c); if (!success) break; //ɩɪɢɡɧɚɤ ɤɨɧɰɚ ɮɚɣɥɚ } update_model (c); context [0] = c; DataFile.WriteSymbol (c); } }
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 143 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɏɚɪɚɤɬɟɪɢɫɬɢɤɢ ɫɨɡɞɚɧɧɨɝɨ ɤɨɦɩɪɟɫɫɨɪɚ, ɧɚɡɜɚɧɧɨɝɨ Dummy, ɩɪɢɜɟɞɟɧɵ ɜ ɩɭɧɤɬɟ «ɉɪɨɢɡɜɨɞɢɬɟɥɶɧɨɫɬɶ ɧɚ ɬɟɫɬɨɜɨɦ ɧɚɛɨɪɟ Calgary Compression Corpus». ɉɨɥɧɵɣ ɬɟɤɫɬ ɪɟɚɥɢɡɚɰɢɢ Dummy ɨɮɨɪɦɥɟɧ ɜ ɜɢɞɟ ɩɪɢɥɨɠɟɧɢɹ 1.
Ɉɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ ɇɚ ɞɨɥɸ ɫɢɦɜɨɥɨɜ ɭɯɨɞɚ ɨɛɵɱɧɨ ɩɪɢɯɨɞɢɬɫɹ ɩɨɪɹɞɤɚ 30% ɢ ɛɨɥɟɟ ɨɬ ɜɫɟɯ ɨɰɟɧɨɤ, ɜɵɱɢɫɥɹɟɦɵɯ ɦɨɞɟɥɢɪɨɜɳɢɤɨɦ PPM. ɗɬɨ ɨɩɪɟɞɟɥɢɥɨ ɩɪɢɫɬɚɥɶɧɨɟ ɜɧɢɦɚɧɢɟ ɤ ɩɪɨɛɥɟɦɟ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɨɜ ɫ ɧɭɥɟɜɨɣ ɱɚɫɬɨɬɨɣ. Ʌɶɜɢɧɚɹ ɞɨɥɹ ɩɭɛɥɢɤɚɰɢɣ, ɩɨɫɜɹɳɟɧɧɵɯ PPM, ɩɪɹɦɨ ɤɚɫɚɸɬɫɹ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ (Ɉȼɍ). Ɇɨɠɧɨ ɜɵɞɟɥɢɬɶ ɞɜɚ ɩɨɞɯɨɞɚ ɤ ɪɟɲɟɧɢɸ ɩɪɨɛɥɟɦɵ Ɉȼɍ: ɚɩɪɢɨɪɧɵɟ ɦɟɬɨɞɵ, ɨɫɧɨɜɚɧɧɵɟ ɧɚ ɩɪɟɞɩɨɥɨɠɟɧɢɹɯ ɨ ɩɪɢɪɨɞɟ ɫɠɢɦɚɟɦɵɯ ɞɚɧɧɵɯ, ɢ ɚɞɚɩɬɢɜɧɵɟ ɦɟɬɨɞɵ, ɤɨɬɨɪɵɟ ɩɵɬɚɸɬɫɹ ɩɪɢɫɩɨɫɨɛɢɬɶ ɨɰɟɧɤɭ ɤ ɞɚɧɧɵɦ. ɉɨɧɹɬɧɨ, ɱɬɨ ɩɟɪɜɵɟ ɩɪɢɡɜɚɧɵ ɨɛɟɫɩɟɱɢɬɶ ɯɨɪɨɲɢɣ ɤɨɷɮɮɢɰɢɟɧɬ ɫɠɚɬɢɹ ɩɪɢ ɨɛɪɚɛɨɬɤɟ ɬɢɩɢɱɧɵɯ ɞɚɧɧɵɯ ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɜɵɫɨɤɨɣ ɫɤɨɪɨɫɬɶɸ ɜɵɱɢɫɥɟɧɢɣ, ɚ ɜɬɨɪɵɟ ɨɪɢɟɧɬɢɪɨɜɚɧɵ ɧɚ ɨɛɟɫɩɟɱɟɧɢɟ ɦɚɤɫɢɦɚɥɶɧɨ ɜɨɡɦɨɠɧɨɣ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. ȺɉɊɂɈɊɇɕȿ ɆȿɌɈȾɕ
ȼɜɟɞɟɦ ɨɛɨɡɧɚɱɟɧɢɹ: C — ɨɛɳɟɟ ɱɢɫɥɨ ɩɪɨɫɦɨɬɪɨɜ ɤɨɧɬɟɤɫɬɚ, ɬ.ɟ. ɫɤɨɥɶɤɨ ɪɚɡ ɨɧ ɜɫɬɪɟɬɢɥɫɹ ɜ ɨɛɪɚɛɨɬɚɧɧɨɦ ɛɥɨɤɟ ɞɚɧɧɵɯ; S — ɤɨɥɢɱɟɫɬɜɨ ɪɚɡɧɵɯ ɫɢɦɜɨɥɨɜ ɜ ɤɨɧɬɟɤɫɬɟ; S(i) — ɤɨɥɢɱɟɫɬɜɨ ɬɚɤɢɯ ɪɚɡɧɵɯ ɫɢɦɜɨɥɨɜ, ɱɬɨ ɨɧɢ ɜɫɬɪɟɱɚɥɢɫɶ ɜ ɤɨɧɬɟɤɫɬɟ ɪɨɜɧɨ i ɪɚɡ; E(x) — ɡɧɚɱɟɧɢɟ Ɉȼɍ ɩɨ ɦɟɬɨɞɭ x. ɂɡɨɛɪɟɬɚɬɟɥɢ ɚɥɝɨɪɢɬɦɚ PPM ɩɪɟɞɥɨɠɢɥɢ ɞɜɚ ɦɟɬɨɞɚ Ɉȼɍ: ɬɚɤ ɧɚɡɵɜɚɟɦɵɟ ɦɟɬɨɞ A ɢ ɦɟɬɨɞ B. ɂɫɩɨɥɶɡɭɸɳɢɟ ɢɯ ɚɥɝɨɪɢɬɦɵ PPM ɛɵɥɢ ɧɚɡɜɚɧɵ PPMA ɢ PPMB ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ. ȼ ɞɚɥɶɧɟɣɲɟɦ ɛɵɥɨ ɨɩɢɫɚɧɨ ɟɳɟ 5 ɚɩɪɢɨɪɧɵɯ ɩɨɞɯɨɞɨɜ ɤ Ɉȼɍ: ɦɟɬɨɞɵ C, D, P, X ɢ XC [8, 10, 17]. ɉɨ ɚɧɚɥɨɝɢɢ ɫ PPMA ɢ 144 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
PPMB, ɚɥɝɨɪɢɬɦɵ PPM, ɩɪɢɦɟɧɹɸɳɢɟ ɦɟɬɨɞɵ C ɢ D, ɩɨɥɭɱɢɥɢ ɧɚɡɜɚɧɢɹ PPMC ɢ PPMD ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ. ɂɞɟɹ ɦɟɬɨɞɨɜ ɢ ɢɯ ɫɪɚɜɧɟɧɢɟ ɩɪɟɞɫɬɚɜɥɟɧɵ ɜ ɬɚɛɥ. 4.4 ɢ ɬɚɛɥ. 4.5. Ɍɚɛɥɢɰɚ 4.4 ( x) Ɇɟɬɨɞ E = A 1 B C D P X XC
C +1 S − S (1) C S C+S S 2C (1) (2) S S S ( 3) − 2 + 3 − C C C (1) S C (1) ›S , ɩɪɢ 0 < S (1) < C fiC (C ) E fl , ɜ ɩɪɨɬɢɜɧɨɦ ɫɥɭɱɚɟ
Ʉɫɬɚɬɢ, ɜ ɩɪɢɦɟɪɟ 2 ɛɵɥ ɢɫɩɨɥɶɡɨɜɚɧ ɦɟɬɨɞ A, ɚ ɜ ɤɨɦɩɪɟɫɫɨɪɟ Dummy — ɦɟɬɨɞ ɋ. ɉɪɢ ɪɟɚɥɢɡɚɰɢɢ ɦɟɬɨɞɚ B ɜɨɡɞɟɪɠɢɜɚɸɬɫɹ ɨɬ ɨɰɟɧɤɢ ɫɢɦɜɨɥɨɜ ɞɨ ɬɟɯ ɩɨɪ, ɩɨɤɚ ɨɧɢ ɧɟ ɩɨɹɜɹɬɫɹ ɜ ɬɟɤɭɳɟɦ ɤɨɧɬɟɤɫɬɟ ɛɨɥɟɟ ɨɞɧɨɝɨ ɪɚɡɚ. ɗɬɨ ɞɨɫɬɢɝɚɟɬɫɹ ɡɚ ɫɱɟɬ ɜɵɱɢɬɚɧɢɹ ɟɞɢɧɢɰɵ ɢɡ ɫɱɟɬɱɢɤɨɜ. Ɇɟɬɨɞɵ P, X, XC ɛɚɡɢɪɭɸɬɫɹ ɧɚ ɩɪɟɞɩɨɥɨɠɟɧɢɢ ɨ ɬɨɦ, ɱɬɨ ɜɟɪɨɹɬɧɨɫɬɶ ɩɨɹɜɥɟɧɢɹ ɜ ɨɛɪɚɛɚɬɵɜɚɟɦɵɯ ɞɚɧɧɵɯ ɫɢɦɜɨɥɚ si ɩɨɞɱɢɧɹɟɬɫɹ ɡɚɤɨɧɭ ɉɭɚɫɫɨɧɚ ɫ ɩɚɪɚɦɟɬɪɨɦ Ȝi.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 145 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɍɚɛɥɢɰɚ 4.5 Ɍɢɩ ɮɚɣɥɨɜ
Ɍɨɱɧɨɫɬɶ ɩɪɟɞɫɤɚɡɚɧɢɹ Æ Ʌɭɱɲɟ XC D P X C X P XC
ɯɭɠɟ Ɍɟɤɫɬɵ C B A Ⱦɜɨɢɱɧɵɟ D B A ɮɚɣɥɵ Ɇɟɫɬɚ ɜ ɬɚɛɥ. 4.5 ɨɱɟɧɶ ɭɫɥɨɜɧɵ. Ɍɚɤ, ɧɚɩɪɢɦɟɪ, ɩɪɢ ɫɠɚɬɢɢ ɬɟɤɫɬɨɜ ɦɟɬɨɞɵ XC, D, P, X ɩɨɤɚɡɵɜɚɸɬ ɜɟɫɶɦɚ ɛɥɢɡɤɢɟ ɪɟɡɭɥɶɬɚɬɵ, ɢ ɦɧɨɝɨɟ ɡɚɜɢɫɢɬ ɨɬ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ ɢ ɢɫɩɨɥɶɡɭɟɦɵɯ ɞɥɹ ɫɪɚɜɧɟɧɢɹ ɮɚɣɥɨɜ. ȼ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ ɫɭɳɟɫɬɜɟɧɧɵɦ ɹɜɥɹɟɬɫɹ ɬɨɥɶɤɨ ɨɬɫɬɚɜɚɧɢɟ ɬɨɱɧɨɫɬɢ Ɉȼɍ ɩɨ ɫɩɨɫɨɛɚɦ A ɢ B ɨɬ ɞɪɭɝɢɯ ɦɟɬɨɞɨɜ. ɍɩɪɚɠɧɟɧɢɟ: ȼɵɩɨɥɧɢɬɟ ɞɟɣɫɬɜɢɹ, ɨɩɢɫɚɧɧɵɟ ɜ ɩɪɢɦɟɪɟ 2, ɢɫɩɨɥɶɡɭɹ Ɉȼɍ ɩɨ ɦɟɬɨɞɭ C. ȿɫɥɢ ɬɟɤɭɳɢɣ ɫɢɦɜɨɥ ‘ɛ’, ɬɨ ɬɨɱɧɨɫɬɶ ɟɝɨ ɩɪɟɞɫɤɚɡɚɧɢɹ ɭɥɭɱɲɢɬɫɹ, ɨɫɬɚɧɟɬɫɹ ɧɟɢɡɦɟɧɧɨɣ ɢɥɢ ɭɯɭɞɲɢɬɫɹ? ȺȾȺɉɌɂȼɇɕȿ ɆȿɌɈȾɕ
ɑɬɨɛɵ ɭɥɭɱɲɢɬɶ ɨɰɟɧɤɭ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ, ɧɟɨɛɯɨɞɢɦɨ ɢɦɟɬɶ ɬɚɤɭɸ ɦɨɞɟɥɶ ɨɰɟɧɤɢ, ɤɨɬɨɪɚɹ ɛɵ ɚɞɚɩɬɢɪɨɜɚɥɚɫɶ ɤ ɨɛɪɚɛɚɬɵɜɚɟɦɵɦ ɞɚɧɧɵɦ. ɉɨɞɨɛɧɵɣ ɚɞɚɩɬɢɜɧɵɣ ɦɟɯɚɧɢɡɦ ɩɨɥɭɱɢɥ ɧɚɡɜɚɧɢɟ Secondary Escape Estimation (SEE), ɬ.ɟ. «ɞɨɩɨɥɧɢɬɟɥɶɧɨɣ ɨɰɟɧɤɢ ɭɯɨɞɚ», ɢɥɢ «ɜɬɨɪɢɱɧɨɣ ɨɰɟɧɤɢ ɭɯɨɞɚ». Ɇɟɬɨɞ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɪɢɜɢɚɥɶɧɨɦ ɜɵɱɢɫɥɟɧɢɢ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ ɢɡ ɬɟɤɭɳɟɣ ɄɆ ɱɟɪɟɡ ɱɚɫɬɨɬɭ ɩɨɹɜɥɟɧɢɹ ɧɨɜɵɯ ɫɢɦɜɨɥɨɜ (ɢɥɢ, ɱɬɨ ɬɨ ɠɟ, ɫɢɦɜɨɥɨɜ ɭɯɨɞɚ) ɜ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ ɫɨ ɫɯɨɠɢɦɢ ɯɚɪɚɤɬɟɪɢɫɬɢɤɚɦɢ:
E ( SEE ) (i ) = ɝɞɟ
f i ( esc ) , ni
fi(esc) — ɱɢɫɥɨ ɧɚɛɥɸɞɚɜɲɢɯɫɹ ɭɯɨɞɨɜ ɢɡ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ ɬɢɩɚ i; ni — ɱɢɫɥɨ ɩɪɨɫɦɨɬɪɨɜ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ ɬɢɩɚ i.
146 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼɪɚɡɭɦɢɬɟɥɶɧɵɟ ɨɛɨɫɧɨɜɚɧɢɹ ɜɵɛɨɪɚ ɷɬɢɯ ɯɚɪɚɤɬɟɪɢɫɬɢɤ ɢ ɤɪɢɬɟɪɢɟɜ «ɫɯɨɠɟɫɬɢ» ɩɪɢ ɨɬɫɭɬɫɬɜɢɢ ɚɩɪɢɨɪɧɵɯ ɡɧɚɧɢɣ ɨ ɯɚɪɚɤɬɟɪɟ ɫɠɢɦɚɟɦɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɞɚɬɶ ɫɥɨɠɧɨ, ɩɨɷɬɨɦɭ ɢɡɜɟɫɬɧɵɟ ɚɥɝɨɪɢɬɦɵ ɚɞɚɩɬɢɜɧɨɣ ɨɰɟɧɤɢ ɛɚɡɢɪɭɸɬɫɹ ɧɚ ɷɦɩɢɪɢɱɟɫɤɨɦ ɚɧɚɥɢɡɟ ɬɢɩɨɜɵɯ ɞɚɧɧɵɯ. ɆȿɌɈȾ Z
Ɉɞɧɚ ɢɡ ɫɚɦɵɯ ɪɚɧɧɢɯ ɩɨɩɵɬɨɤ ɪɟɚɥɢɡɚɰɢɢ SEE ɢɡɜɟɫɬɧɚ ɤɚɤ ɦɟɬɨɞ Z, ɚ ɢɫɩɨɥɶɡɭɸɳɚɹ ɟɝɨ ɪɚɡɧɨɜɢɞɧɨɫɬɶ ɚɥɝɨɪɢɬɦɚ PPM — PPMZ [3]. Ⱦɥɹ ɬɨɱɧɨɫɬɢ ɨɩɢɫɚɧɢɹ ɷɬɨɣ ɬɟɯɧɢɤɢ SEE ɨɛɴɟɤɬ «ɤɨɧɬɟɤɫɬ» ɧɢɠɟ ɛɭɞɟɬ ɬɚɤɠɟ ɢɦɟɧɨɜɚɬɶɫɹ «PPM-ɤɨɧɬɟɤɫɬɨɦ». Ⱦɥɹ ɧɚɯɨɠɞɟɧɢɹ Ɉȼɍ ɫɬɪɨɹɬɫɹ ɬɚɤ ɧɚɡɵɜɚɟɦɵɟ ɤɨɧɬɟɤɫɬɵ ɭɯɨɞɚ (escape contexts) Ʉɍ, ɮɨɪɦɢɪɭɟɦɵɟ ɢɡ ɱɟɬɵɪɟɯ ɩɨɥɟɣ. ȼ ɩɨɥɹɯ Ʉɍ ɫɨɞɟɪɠɢɬɫɹ ɢɧɮɨɪɦɚɰɢɹ ɨ ɡɧɚɱɟɧɢɹɯ ɫɥɟɞɭɸɳɢɯ ɜɟɥɢɱɢɧ: ɩɨɫɥɟɞɧɢɟ ɱɟɬɵɪɟ ɫɢɦɜɨɥɚ PPM-ɤɨɧɬɟɤɫɬɚ, ɩɨɪɹɞɨɤ PPM-ɤɨɧɬɟɤɫɬɚ, ɤɨɥɢɱɟɫɬɜɨ ɭɯɨɞɨɜ ɢ ɤɨɥɢɱɟɫɬɜɨ ɭɫɩɟɲɧɵɯ ɨɰɟɧɨɤ ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɄɆ. ɇɟɫɤɨɥɶɤɢɦ ɄɆ ɦɨɠɟɬ ɫɨɨɬɜɟɬɫɬɜɨɜɚɬɶ ɨɞɢɧ Ʉɍ. ɂɧɮɨɪɦɚɰɢɹ ɨ ɮɚɤɬɢɱɟɫɤɨɦ ɤɨɥɢɱɟɫɬɜɟ ɭɯɨɞɨɜ ɢ ɭɫɩɟɲɧɵɯ ɤɨɞɢɪɨɜɚɧɢɣ ɜɨ ɜɫɟɯ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ, ɢɦɟɸɳɢɯ ɨɛɳɢɣ Ʉɍ, ɡɚɩɨɦɢɧɚɟɬɫɹ ɜ ɫɱɟɬɱɢɤɚɯ ɤɨɧɬɟɤɫɬɧɨɣ ɦɨɞɟɥɢ ɭɯɨɞɨɜ ɄɆɍ, ɩɨɫɬɪɨɟɧɧɨɣ ɞɥɹ ɞɚɧɧɨɝɨ Ʉɍ. ɗɬɚ ɢɧɮɨɪɦɚɰɢɹ ɨɩɪɟɞɟɥɹɟɬ Ɉȼɍ ɞɥɹ ɬɟɤɭɳɟɣ ɄɆ. Ɉȼɍ ɧɚɯɨɞɢɬɫɹ ɩɭɬɟɦ ɜɡɜɟɲɢɜɚɧɢɹ ɨɰɟɧɨɤ, ɤɨɬɨɪɵɟ ɞɚɸɬ ɬɪɢ ɄɆɍ (ɄɆɍ ɩɨɪɹɞɤɚ 2, 1 ɢ 0), ɨɬɜɟɱɚɸɳɢɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤɚɦ ɬɟɤɭɳɟɣ ɄɆ. Ʉɍ ɩɨɪɹɞɤɚ 2 ɧɚɢɛɨɥɟɟ ɬɨɱɧɨ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɬɟɤɭɳɟɣ ɄɆ, ɤɨɧɬɟɤɫɬɵ ɭɯɨɞɚ ɩɨɪɹɞɤɨɦ ɧɢɠɟ ɮɨɪɦɢɪɭɸɬɫɹ ɝɥɚɜɧɵɦ ɨɛɪɚɡɨɦ ɩɭɬɟɦ ɜɵɛɪɚɫɵɜɚɧɢɹ ɱɚɫɬɢ ɢɧɮɨɪɦɚɰɢɢ ɢɡ ɩɨɥɟɣ Ʉɍ ɩɨɪɹɞɤɚ 2. Ʉɨɦɩɨɧɟɧɬɵ Ʉɍ ɩɨɪɹɞɤɚ 2 ɨɩɪɟɞɟɥɹɸɬɫɹ ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɬɚɛɥ. 4.6 [3].
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 147 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɇɨɦɟɪ ɩɨɥɹ 1
Ɋɚɡɦɟɪ ɜ ɛɢɬɚɯ 2
2
2
3
3
4
9
Ɍɚɛɥɢɰɚ 4.6 ɋɩɨɫɨɛ ɮɨɪɦɢɪɨɜɚɧɢɹ ɡɧɚɱɟɧɢɹ ɩɨɥɹ ɉɚɪɚɦɟɬɪ ɢ ɟɝɨ ɡɧɚɱɟɧɢɹ Ɂɧɚɱɟɧɢɟ ɩɨɥɹ ɉɨɪɹɞɨɤ ɄɆ ɩɨɪɹɞɨɤ ɄɆ / 2 (ɫ ɨɤɪɭɝɥɟɧɢɟɦ ɞɨ ɦɥɚɞɲɟɝɨ); Ʉɨɥɢɱɟɫɬɜɨ ɭɯɨɞɨɜ ɢɡ ɄɆ 1 0 2 1 3 2 >3 3 Ʉɨɥɢɱɟɫɬɜɨ ɭɫɩɟɲɧɵɯ ɨɰɟɧɨɤ ɜ ɄɆ 0 0 1 1 2 2 3, 4 3 5, 6 4 7, 8, 9 5 10, 11, 12 6 > 12 7 X1 = ɫɟɦɶ ɦɥɚɞɲɢɯ ɛɢɬɨɜ ((X2&0x60) esc){ AC.encode (CM->TotFr, esc, CM->TotFr + esc); //ɭɜɟɥɢɱɢɜɚɟɦ ɫɱɟɬɱɢɤ ɭɯɨɞɨɜ ɞɥɹ ɬɟɤɭɳɟɝɨ Ʉɍ E->e++; } return 0; } }
ȼ ɮɭɧɤɰɢɢ ɞɟɤɨɞɢɪɨɜɚɧɢɹ ɫɢɦɜɨɥɚ decode_sym ɩɪɨɢɡɜɟɞɟɦ ɚɧɚɥɨɝɢɱɧɵɟ ɢɡɦɟɧɟɧɢɹ. int decode_sym (ContextModel *CM, int *c){ stack [SP++] = CM; if (!CM->esc) return 0; int esc; SEE_item *E = calc_SEE (CM, &esc); int cum_freq = AC.get_freq (CM->TotFr + esc); if (cum_freq < CM->TotFr){ int CumFreqUnder = 0;
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 155 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
int i = 0; for (;;){ if ( (CumFreqUnder + CM->count[i]) count[i]; else break; i++; } AC.decode_update (CumFreqUnder, CM->count[i], CM->TotFr + esc); *c = i; E->s++; return 1; }else{ AC.decode_update (CM->TotFr, esc, CM->TotFr + esc); E->e++; return 0; } }
Ɂɚɜɢɫɢɦɨɫɬɶ ɦɟɠɞɭ ɬɪɟɛɭɟɦɵɦ ɡɧɚɱɟɧɢɟɦ ɫɱɟɬɱɢɤɚ ɭɯɨɞɨɜ, ɫ ɨɞɧɨɣ ɫɬɨɪɨɧɵ, ɢ ɤɨɥɢɱɟɫɬɜɨɦ ɭɯɨɞɨɜ ɢ ɭɫɩɟɲɧɵɯ ɤɨɞɢɪɨɜɚɧɢɣ, ɫ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, ɢɦɟɟɬ ɜɢɞ
ɨɬɤɭɞɚ
esc e = , TotFr + esc e + s esc =
e ⋅ TotFr . s
ɉɨɷɬɨɦɭ ɮɭɧɤɰɢɸ calc_SEE, ɜ ɤɨɬɨɪɨɣ ɫɨɛɫɬɜɟɧɧɨ ɢ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɚɞɚɩɬɢɜɧɚɹ Ɉȼɍ, ɪɟɚɥɢɡɭɟɦ ɬɚɤ: const int SEE_THRESH1 = 10; const int SEE_THRESH2 = 0x7ff; SEE_item* calc_SEE (ContextModel* CM, int *esc){ SEE_item* E = &SEE[TF2Index[CM->TotFr]]; if ((E->e + E->s) > SEE_THRESH1){ *esc = E->e * CM->TotFr / E->s; //ɚɞɚɩɬɢɜɧɚɹ ɨɰɟɧɤɚ if (!(*esc)) *esc = 1; if ((E->e + E->s) > SEE_THRESH2){ E->e -= E->e >> 1; E->s -= E->s >> 1; }
156 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
} else *esc = CM->esc; //ɚɩɪɢɨɪɧɚɹ ɨɰɟɧɤɚ return E; }
Ʉɨɧɫɬɚɧɬɚ SEE_THRESH1 ɨɩɪɟɞɟɥɹɟɬ ɩɨɪɨɝ ɱɚɫɬɨɬɵ ɢɫɩɨɥɶɡɨɜɚɧɢɹ Ʉɍ, ɧɢɠɟ ɤɨɬɨɪɨɝɨ ɩɪɟɞɩɨɱɬɢɬɟɥɶɧɟɟ ɜɫɟ ɠɟ ɩɪɢɦɟɧɟɧɢɟ ɚɩɪɢɨɪɧɨɝɨ ɦɟɬɨɞɚ ɨɰɟɧɤɢ, ɬ.ɤ. ɧɟ ɧɚɛɪɚɥɨɫɶ ɟɳɟ ɡɧɚɱɢɬɟɥɶɧɨɝɨ ɨɛɴɟɦɚ ɫɬɚɬɢɫɬɢɤɢ ɞɥɹ ɬɟɤɭɳɟɝɨ Ʉɍ. Ʉɨɧɫɬɚɧɬɚ SEE_THRESH2 ɧɚɥɚɝɚɟɬ ɨɝɪɚɧɢɱɟɧɢɟ ɧɚ ɡɧɚɱɟɧɢɟ ɫɱɟɬɱɢɤɨɜ ɭɫɩɟɲɧɵɯ ɤɨɞɢɪɨɜɚɧɢɣ s ɢ ɭɯɨɞɚ e ɱɬɨɛɵ, ɫ ɨɞɧɨɣ ɫɬɨɪɨɧɵ, ɩɪɟɞɨɬɜɪɚɬɢɬɶ ɩɟɪɟɩɨɥɧɟɧɢɟ ɩɪɢ ɭɦɧɨɠɟɧɢɢ E->e * CM->TotFr ɢ, ɫ ɞɪɭɝɨɣ, ɭɥɭɱɲɢɬɶ ɚɞɚɩɬɚɰɢɸ ɤ ɥɨɤɚɥɶɧɵɦ ɢɡɦɟɧɟɧɢɹɦ ɯɚɪɚɤɬɟɪɢɫɬɢɤ ɫɠɢɦɚɟɦɨɝɨ ɩɨɬɨɤɚ. ɉɪɟɞɥɨɠɟɧɧɚɹ ɪɟɚɥɢɡɚɰɢɹ ɜɵɱɢɫɥɟɧɢɹ ɫɪɟɞɧɟɣ ɱɚɫɬɨɬɵ ɭɯɨɞɨɜ ɤɪɚɣɧɟ ɧɟɷɤɨɧɨɦɧɚ. Ɍɚɤ, ɧɚɩɪɢɦɟɪ, ɦɨɠɧɨ ɢɡɛɟɠɚɬɶ ɭɦɧɨɠɟɧɢɹ ɧɚ CM->TotFr, ɬ.ɤ. ɨɛɵɱɧɨ ɜ ɩɪɟɞɟɥɚɯ ɝɪɭɩɩɵ ɄɆ, ɨɬɧɨɫɢɦɵɯ ɤ ɨɞɧɨɦɭ Ʉɍ, ɷɬɚ ɜɟɥɢɱɢɧɚ ɢɡɦɟɧɹɟɬɫɹ ɧɟ ɫɢɥɶɧɨ, ɩɨɷɬɨɦɭ ɢɦɟɟɬ ɫɦɵɫɥ ɡɚɥɨɠɢɬɶ ɧɟɹɜɧɨɟ ɭɦɧɨɠɟɧɢɟ ɧɚ ɫɨɨɬɜɟɬɫɬɜɭɸɳɭɸ ɤɨɧɫɬɚɧɬɭ ɜ ɫɚɦ ɚɥɝɨɪɢɬɦ ɢɡɦɟɧɟɧɢɹ ɫɱɟɬɱɢɤɨɜ e ɢ s. ɉɪɚɤɬɢɱɧɚɹ ɪɟɚɥɢɡɚɰɢɹ ɚɞɚɩɬɢɜɧɨɣ ɨɰɟɧɤɢ ɫɪɟɞɧɟɝɨ ɢɡɥɨɠɟɧɚ ɜ [1]. Ɍɚɤɠɟ ɧɟɨɛɯɨɞɢɦɨ ɫɥɟɞɢɬɶ ɡɚ ɜɟɥɢɱɢɧɨɣ esc, ɩɨɫɤɨɥɶɤɭ ɞɨɫɬɚɬɨɱɧɨ ɛɨɥɶɲɚɹ ɫɭɦɦɚ CM->TotFr + esc ɦɨɠɟɬ ɩɪɢɜɟɫɬɢ ɤ ɩɟɪɟɩɨɥɧɟɧɢɸ ɜ ɚɪɢɮɦɟɬɢɱɟɫɤɨɦ ɤɨɞɟɪɟ. Ɇɵ ɧɟ ɞɟɥɚɥɢ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɯ ɩɪɨɜɟɪɨɤ ɥɢɲɶ ɫ ɰɟɥɶɸ ɭɩɪɨɳɟɧɢɹ ɨɩɢɫɚɧɢɹ. ɍɩɪɚɠɧɟɧɢɟ: Ⱦɨɛɚɜɥɟɧɢɟ ɚɞɚɩɬɢɜɧɨɝɨ ɦɟɬɨɞɚ Ɉȼɍ ɬɪɟɛɭɟɬ ɢɡɦɟɧɟɧɢɹ ɞɟɣɫɬɜɢɣ ɩɨ ɤɨɞɢɪɨɜɚɧɢɸ ɡɧɚɤɚ ɤɨɧɰɚ ɮɚɣɥɚ. ɉɪɟɞɥɨɠɢɬɟ ɜɚɪɢɚɧɬ ɬɚɤɨɣ ɦɨɞɢɮɢɤɚɰɢɢ. ȿɫɥɢ ɫɪɚɜɧɢɜɚɬɶ ɫ ɩɨɦɨɳɶɸ CalgCC, ɬɨ ɩɪɢɦɟɧɟɧɢɟ ɨɩɢɫɚɧɧɨɝɨ ɦɟɬɨɞɚ ɚɞɚɩɬɢɜɧɨɣ Ɉȼɍ ɭɥɭɱɲɚɟɬ ɫɠɚɬɢɟ ɜɫɟɝɨ ɥɢɲɶ ɩɪɢɛɥɢɡɢɬɟɥɶɧɨ ɧɚ 0.3%. ɇɟɛɨɥɶɲɨɣ ɷɮɮɟɤɬ ɨɛɴɹɫɧɹɟɬɫɹ ɧɟ ɬɨɥɶɤɨ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 157 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɪɨɫɬɵɦ ɦɟɯɚɧɢɡɦɨɦ ɜɵɱɢɫɥɟɧɢɹ Ɉȼɍ, ɧɨ ɢ ɦɚɥɵɦ ɩɨɪɹɞɤɨɦ ɢɫɩɨɥɶɡɭɟɦɨɣ ɦɨɞɟɥɢ. Ɂɚɤɥɸɱɟɧɢɟ: Ⱦɚɠɟ ɫɥɨɠɧɵɟ ɚɞɚɩɬɢɜɧɵɟ ɦɟɬɨɞɵ Ɉȼɍ ɭɥɭɱɲɚɸɬ ɫɠɚɬɢɟ ɨɛɵɱɧɨ ɥɢɲɶ ɧɚ 1–2% ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɚɩɪɢɨɪɧɵɦɢ ɦɟɬɨɞɚɦɢ, ɧɨ ɬɪɟɛɭɸɬ ɫɭɳɟɫɬɜɟɧɧɵɯ ɜɵɱɢɫɥɢɬɟɥɶɧɵɯ ɡɚɬɪɚɬ.
Ɉɛɧɨɜɥɟɧɢɟ ɫɱɟɬɱɢɤɨɜ ɫɢɦɜɨɥɨɜ Ɇɨɞɢɮɢɤɚɰɢɹ ɫɱɟɬɱɢɤɨɜ ɩɨɫɥɟ ɨɛɪɚɛɨɬɤɢ ɨɱɟɪɟɞɧɨɝɨ ɫɢɦɜɨɥɚ ɦɨɠɟɬ ɛɵɬɶ ɪɟɚɥɢɡɨɜɚɧɚ ɩɨ-ɪɚɡɧɨɦɭ. ɉɨɫɥɟ ɤɨɞɢɪɨɜɚɧɢɹ ɤɚɠɞɨɝɨ ɫɢɦɜɨɥɚ ɟɫɬɟɫɬɜɟɧɧɨ ɢɡɦɟɧɹɬɶ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɫɱɟɬɱɢɤɢ ɜɨ ɜɫɟɯ ɄɆ ɩɨɪɹɞɤɨɜ 0, 1, …, N, ɱɬɨ ɢ ɩɪɟɞɥɚɝɚɟɬɫɹ, ɜ ɱɚɫɬɧɨɫɬɢ, ɞɟɥɚɬɶ ɜ ɚɥɝɨɪɢɬɦɚɯ PPMA ɢ PPMB. Ɍɚɤɨɣ ɩɨɞɯɨɞ ɧɚɡɵɜɚɟɬɫɹ ɩɨɥɧɵɦ ɨɛɧɨɜɥɟɧɢɟɦ (full updates). ɇɨ ɜ ɫɥɭɱɚɟ ɤɥɚɫɫɢɱɟɫɤɨɝɨ, ɧɟ ɢɫɩɨɥɶɡɭɸɳɟɝɨ ɧɚɫɥɟɞɨɜɚɧɢɟ ɢɧɮɨɪɦɚɰɢɢ PPM, ɥɭɱɲɢɟ ɪɟɡɭɥɶɬɚɬɵ ɞɨɫɬɢɝɚɸɬɫɹ ɤɨɝɞɚ ɫɱɟɬɱɢɤɢ ɨɰɟɧɟɧɧɨɝɨ ɫɢɦɜɨɥɚ ɭɜɟɥɢɱɢɜɚɸɬɫɹ ɬɨɥɶɤɨ ɜ ɄɆ ɩɨɪɹɞɤɨɜ o, o+1, …, N, ɝɞɟ o — ɩɨɪɹɞɨɤ ɄɆ, ɜ ɤɨɬɨɪɨɣ ɫɢɦɜɨɥ ɛɵɥ ɡɚɤɨɞɢɪɨɜɚɧ. ɂɧɚɱɟ ɝɨɜɨɪɹ, ɫɱɟɬɱɢɤ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɫɢɦɜɨɥɚ ɧɟ ɭɜɟɥɢɱɢɜɚɟɬɫɹ ɜ ɤɚɤɨɣ-ɬɨ ɚɤɬɢɜɧɨɣ ɄɆ, ɟɫɥɢ ɨɧ ɛɵɥ ɨɰɟɧɟɧ ɜ ɄɆ ɛɨɥɟɟ ɜɵɫɨɤɨɝɨ ɩɨɪɹɞɤɚ. ɗɬɚ ɬɟɯɧɢɤɚ ɢɦɟɟɬ ɫɚɦɨɫɬɨɹɬɟɥɶɧɨɟ ɧɚɡɜɚɧɢɟ — ɢɫɤɥɸɱɟɧɢɟ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ (update exclusion). Ɍɟɪɦɢɧ «ɢɫɤɥɸɱɟɧɢɟ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ» ɧɟ ɫɥɟɞɭɟɬ ɩɭɬɚɬɶ ɫ ɢɫɤɥɸɱɟɧɢɟɦ (exclusion), ɩɨɞ ɤɨɬɨɪɵɦ ɩɨɧɢɦɚɸɬ ɫɚɦ ɦɟɯɚɧɢɡɦ ɭɯɨɞɨɜ ɫ ɦɚɫɤɢɪɨɜɚɧɢɟɦ ɫɱɟɬɱɢɤɨɜ ɬɟɯ ɫɢɦɜɨɥɨɜ, ɤɨɬɨɪɵɟ ɜɫɬɪɟɱɚɥɢɫɶ ɜ ɤɨɧɬɟɤɫɬɚɯ ɛɨɥɶɲɟɝɨ ɩɨɪɹɞɤɚ. ɉɪɢɦɟɧɟɧɢɟ ɢɫɤɥɸɱɟɧɢɹ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ ɩɨɡɜɨɥɹɟɬ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɨɛɵɱɧɨɝɨ PPM-ɤɨɦɩɪɟɫɫɨɪɚ ɩɪɢɦɟɪɧɨ ɧɚ 1–2% ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɬɟɦ ɫɥɭɱɚɟɦ, ɤɨɝɞɚ ɩɪɨɢɡɜɨɞɢɬɫɹ ɨɛɧɨɜɥɟɧɢɟ ɫɱɟɬɱɢɤɨɜ ɫɢɦɜɨɥɚ ɜɨ ɜɫɟɯ ɄɆ. Ɉɞɧɨɜɪɟɦɟɧɧɨ ɭɫɤɨɪɹɟɬɫɹ ɪɚɛɨɬɚ ɤɨɦɩɪɟɫɫɨɪɚ. ȼ ɫɥɭɱɚɟ ɩɪɢɦɟɧɟɧɢɹ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ, ɚ 158 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɬɚɤɠɟ ɞɥɹ ɚɥɝɨɪɢɬɦɚ PPM* (ɨɩɢɫɚɧɢɟ PPM* ɩɪɢɜɟɞɟɧɨ ɧɢɠɟ), ɩɨɥɶɡɚ ɨɬ ɢɫɤɥɸɱɟɧɢɹ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ ɧɟ ɫɬɨɥɶ ɨɱɟɜɢɞɧɚ. Ɋɨɥɶ ɤɨɧɬɟɤɫɬɨɜ-ɩɪɟɞɤɨɜ ɫɪɚɜɧɢɬɟɥɶɧɨ ɧɟɛɨɥɶɲɢɯ ɩɨɪɹɞɤɨɜ ɡɧɚɱɢɬɟɥɶɧɨ ɜɨɡɪɚɫɬɚɟɬ ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɬɟɯɧɢɤɢ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ, ɩɨɷɬɨɦɭ ɧɟɨɛɯɨɞɢɦɨ ɛɨɥɟɟ ɛɵɫɬɪɨɟ ɨɛɧɨɜɥɟɧɢɟ ɢɯ ɫɬɚɬɢɫɬɢɤɢ. Ʉɚɤ ɩɨɤɚɡɵɜɚɸɬ ɷɤɫɩɟɪɢɦɟɧɬɵ, ɩɨɥɧɨɟ ɨɛɧɨɜɥɟɧɢɟ ɪɚɛɨɬɚɟɬ ɜɫɟ ɠɟ ɩɥɨɯɨ ɢ ɜ ɷɬɨɦ ɫɥɭɱɚɟ. ɉɨɷɬɨɦɭ ɨɛɵɱɧɨ ɫɥɟɞɭɟɬ ɢɫɩɨɥɶɡɨɜɚɬɶ ɪɟɲɟɧɢɟ, ɩɪɨɦɟɠɭɬɨɱɧɨɟ ɦɟɠɞɭ ɢɫɤɥɸɱɟɧɢɟɦ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ ɢ ɩɨɥɧɵɦ ɨɛɧɨɜɥɟɧɢɟɦ. ɇɚɩɪɢɦɟɪ, ɩɨɦɢɦɨ ɭɜɟɥɢɱɟɧɢɹ ɫ ɜɟɫɨɦ 1 ɜ ɪɚɦɤɚɯ ɪɟɚɥɢɡɚɰɢɢ ɢɫɤɥɸɱɟɧɢɹ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ, ɢɦɟɟɬ ɫɦɵɫɥ ɢɧɤɪɟɦɟɧɬɢɪɨɜɚɬɶ ɫ ɜɟɫɨɦ 1/(o– i+1) ɫɱɟɬɱɢɤɢ ɫɢɦɜɨɥɚ ɜ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ ɦɟɧɶɲɢɯ ɩɨɪɹɞɤɨɜ i. ɉɨɞ ɄɆ(i) ɩɨɧɢɦɚɸɬɫɹ ɩɪɟɞɤɢ ɬɨɣ ɄɆ(o), ɜ ɤɨɬɨɪɨɣ ɫɢɦɜɨɥ ɛɵɥ ɨɰɟɧɟɧ. ɇɚɩɪɢɦɟɪ, ɜ ɤɨɦɩɪɟɫɫɨɪɟ PPMd ɞɟɥɚɟɬɫɹ ɦɨɞɢɮɢɤɚɰɢɹ ɫɱɟɬɱɢɤɚ ɫ ɜɟɫɨɦ 1/2 ɬɨɥɶɤɨ ɜ ɪɨɞɢɬɟɥɶɫɤɨɣ ɄɆ ɢ ɬɨɥɶɤɨ ɜ ɨɩɪɟɞɟɥɟɧɧɵɯ ɫɥɭɱɚɹɯ. ɉɪɢ ɷɬɨɦ ɨɫɧɨɜɧɨɟ ɭɫɥɨɜɢɟ ɜɵɩɨɥɧɟɧɢɹ ɬɚɤɨɣ ɦɨɞɢɮɢɤɚɰɢɢ ɬɪɟɛɭɟɬ, ɱɬɨɛɵ ɫɱɟɬɱɢɤ ɨɰɟɧɟɧɧɨɝɨ ɫɢɦɜɨɥɚ ɜ ɄɆ(o) ɛɵɥ ɦɟɧɶɲɟ ɧɟɤɨɬɨɪɨɝɨ ɩɨɪɨɝɚ. ȼ ɚɥɝɨɪɢɬɦɟ PPM* ɩɪɢɦɟɧɹɟɬɫɹ ɱɚɫɬɢɱɧɨɟ ɢɫɤɥɸɱɟɧɢɟ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ (partial update exclusion). ȼ ɷɬɨɦ ɫɥɭɱɚɟ ɩɪɨɢɡɜɨɞɢɬɫɹ ɭɜɟɥɢɱɟɧɢɟ ɫɱɟɬɱɢɤɨɜ ɜɨ ɜɫɟɯ ɬɚɤ ɧɚɡɵɜɚɟɦɵɯ ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɵɯ ɄɆ, ɚ ɟɫɥɢ ɠɟ ɢɯ ɧɟɬ, ɬɨ ɬɨɥɶɤɨ ɜ ɧɟɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɨɣ ɄɆ ɫ ɫɚɦɵɦ ɛɨɥɶɲɢɦ ɩɨɪɹɞɤɨɦ. ɉɨɞ ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɨɣ ɩɨɧɢɦɚɟɬɫɹ ɬɚɤɚɹ ɄɆ, ɱɬɨ ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɦ ɟɣ ɤɨɧɬɟɤɫɬɟ ɞɨ ɞɚɧɧɨɝɨ ɦɨɦɟɧɬɚ ɜɫɬɪɟɱɚɥɫɹ ɬɨɥɶɤɨ ɨɞɢɧ ɫɢɦɜɨɥ (ɥɸɛɨɟ ɱɢɫɥɨ ɪɚɡ). Ⱥɧɚɥɨɝɢɱɧɨ, ɬɚɤɨɣ ɤɨɧɬɟɤɫɬ ɧɚɡɵɜɚɟɬɫɹ ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɵɦ. Ⱦɥɹ ɫɨɛɫɬɜɟɧɧɨ ɫɠɚɬɢɹ ɜ ɫɜɹɡɤɟ ɫ PPM ɩɪɚɤɬɢɱɟɫɤɢ ɜɫɟɝɞɚ ɢɫɩɨɥɶɡɭɟɬɫɹ ɚɪɢɮɦɟɬɢɱɟɫɤɨɟ ɤɨɞɢɪɨɜɚɧɢɟ. ɍɜɟɥɢɱɟɧɢɟ ɡɧɚɱɟɧɢɣ ɫɱɟɬɱɢɤɨɜ ɄɆ ɦɨɠɟɬ ɩɪɢɜɟɫɬɢ ɤ ɨɲɢɛɤɟ ɩɟɪɟɩɨɥɧɟɧɢɹ ɜ ɚɪɢɮɦɟɬɢɱɟɫɤɨɦ ɤɨɞɟɪɟ. ȼɨ ɢɡɛɟɠɚɧɢɟ ɷɬɨɝɨ ɨɛɵɱɧɨ ɩɪɨɢɡɜɨɞɹɬ ɞɟɥɟɧɢɟ ɡɧɚɱɟɧɢɣ ɩɨɩɨɥɚɦ ɩɪɢ ɞɨɫɬɢɠɟɧɢɢ ɡɚɞɚɧɧɨɝɨ ɩɨɪɨɝɚ. Ɇɚɤɫɢɦɚɥɶɧɚɹ ɜɟɥɢɱɢɧɚ ɩɨɪɨɝɚ ɨɩɪɟɞɟɥɹɟɬɫɹ ɨɫɨɛɟɧɧɨɫɬɹɦɢ ɤɨɧɤɪɟɬɧɨɣ ɪɟɚɥɢɡɚɰɢɢ ɚɪɢɮɦɟɬɢɱɟɫɤɨɝɨ ɤɨɞɟɪɚ. ɋ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɫɱɟɬɱɢɤɨɜ ɞɚɟɬ ɩɨɛɨɱɧɵɣ ɷɮɮɟɤɬ ɜ ɜɢɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 159 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɞɟ ɭɥɭɱɲɟɧɢɹ ɫɠɚɬɢɹ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɞɚɧɧɵɯ ɫ ɞɨɫɬɚɬɨɱɧɨ ɛɵɫɬɪɨ ɦɟɧɹɸɳɟɣɫɹ ɫɬɚɬɢɫɬɢɤɨɣ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ. ɑɟɦ ɧɟɫɬɚɛɢɥɶɧɟɟ ɄɆ, ɬɟɦ ɱɚɳɟ ɫɥɟɞɭɟɬ ɦɚɫɲɬɚɛɢɪɨɜɚɬɶ ɟɟ ɫɱɟɬɱɢɤɢ, ɨɬɛɪɚɫɵɜɚɹ ɬɚɤɢɦ ɨɛɪɚɡɨɦ ɱɚɫɬɶ ɢɧɮɨɪɦɚɰɢɢ ɨ ɩɨɜɟɞɟɧɢɢ ɞɚɧɧɨɣ ɄɆ ɜ ɩɪɨɲɥɨɦ. ȼ ɫɜɟɬɟ ɷɬɨɝɨ ɟɫɬɟɫɬɜɟɧɧɨɣ ɹɜɥɹɟɬɫɹ ɢɞɟɹ ɨɛ ɭɜɟɥɢɱɟɧɢɢ ɫɱɟɬɱɢɤɨɜ ɫ ɧɟɪɚɜɧɵɦ ɲɚɝɨɦ, ɬɚɤ ɱɬɨɛɵ ɧɟɞɚɜɧɨ ɜɫɬɪɟɱɟɧɧɵɟ ɫɢɦɜɨɥɵ ɩɨɥɭɱɚɥɢ ɛɨɥɶɲɢɟ ɜɟɫɚ, ɱɟɦ «ɫɬɚɪɵɟ» ɫɢɦɜɨɥɵ. ȼ ɤɚɱɟɫɬɜɟ ɩɨɥɭɦɟɪɵ ɦɨɠɧɨ ɩɪɢɦɟɧɹɬɶ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɫɱɟɬɱɢɤɚ ɩɨɫɥɟɞɧɟɝɨ ɜɫɬɪɟɱɟɧɧɨɝɨ ɫɢɦɜɨɥɚ, ɤɨɬɨɪɨɟ ɷɤɫɩɥɭɚɬɢɪɭɟɬ ɬɚɤɭɸ ɠɟ ɨɫɨɛɟɧɧɨɫɬɶ ɬɢɩɢɱɧɵɯ ɞɚɧɧɵɯ (ɫɦ. ɧɢɠɟ ɩɨɞɩɭɧɤɬ «Ɇɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɫɱɟɬɱɢɤɚ ɩɨɫɥɟɞɧɟɝɨ ɜɫɬɪɟɱɟɧɧɨɝɨ ɫɢɦɜɨɥɚ»). ɋɭɳɟɫɬɜɟɧɧɨɦɭ ɭɥɭɱɲɟɧɢɸ ɫɠɚɬɢɹ ɜ ɬɚɤɢɯ ɫɥɭɱɚɹɯ ɬɚɤɠɟ ɫɩɨɫɨɛɫɬɜɭɟɬ ɜɬɨɪɢɱɧɚɹ ɨɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɨɜ (ɫɦ. ɞɚɥɟɟ ɩɨ ɬɟɤɫɬɭ ɩɨɞɩɭɧɤɬ «ɍɜɟɥɢɱɟɧɢɟ ɬɨɱɧɨɫɬɢ ɩɪɟɞɫɤɚɡɚɧɢɹ ɧɚɢɛɨɥɟɟ ɜɟɪɨɹɬɧɵɯ ɫɢɦɜɨɥɨɜ»). ɂɫɩɨɥɶɡɨɜɚɧɢɟ ɜ ɤɚɱɟɫɬɜɟ ɲɚɝɚ ɩɪɢɪɨɫɬɚ ɫɱɟɬɱɢɤɨɜ ɜɟɥɢɱɢɧ, ɛɨɥɶɲɢɯ ɟɞɢɧɢɰɵ, ɧɟɨɛɯɨɞɢɦɨ ɞɥɹ ɭɫɩɟɲɧɨɣ ɪɚɛɨɬɵ ɫɥɨɠɧɵɯ ɦɟɬɨɞɨɜ ɨɛɧɨɜɥɟɧɢɹ, ɚ ɬɚɤɠɟ ɫɩɨɫɨɛɫɬɜɭɟɬ ɥɭɱɲɟɣ ɚɞɚɩɬɚɰɢɢ ɦɨɞɟɥɢ ɩɪɢ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɢ. ȼ ɤɚɱɟɫɬɜɟ ɞɨɛɚɜɤɢ ɜɟɫɚ 1 ɯɨɪɨɲɨ ɪɚɛɨɬɚɸɬ 4 ɢɥɢ 8, ɩɪɢ ɷɬɨɦ ɜɫɟ ɟɳɟ ɨɬɫɭɬɫɬɜɭɟɬ ɩɪɨɛɥɟɦɚ ɩɟɪɟɩɨɥɧɟɧɢɹ ɞɚɠɟ ɩɪɢ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɞɥɹ ɫɱɟɬɱɢɤɨɜ 16ɛɢɬɧɵɯ ɦɚɲɢɧɧɵɯ ɫɥɨɜ. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɲɚɝ ɩɪɢɪɨɫɬɚ = 4, ɬɨ ɫɱɟɬɱɢɤ ɫɢɦɜɨɥɚ ɦɨɠɟɬ ɩɪɢɧɢɦɚɬɶ ɡɧɚɱɟɧɢɹ: 4 (ɢɧɢɰɢɚɥɢɡɚɰɢɹ ɩɪɢ ɩɟɪɜɨɦ ɩɨɹɜɥɟɧɢɢ ɫɢɦɜɨɥɚ ɜ ɤɨɧɬɟɤɫɬɟ), 8, 12, 16… ȼ ɤɨɦɩɪɟɫɫɨɪɟ Dummy ɢɫɩɨɥɶɡɭɟɬɫɹ ɟɞɢɧɢɱɧɵɣ ɲɚɝ ɩɪɢɪɨɫɬɚ.
ɉɨɜɵɲɟɧɢɟ ɬɨɱɧɨɫɬɢ ɨɰɟɧɨɤ ɜ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ ɜɵɫɨɤɢɯ ɩɨɪɹɞɤɨɜ ɇɚɪɹɞɭ ɫ ɡɚɞɚɱɟɣ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ ɫɟɪɶɟɡɧɨɣ ɩɪɨɛɥɟɦɨɣ PPM ɹɜɥɹɟɬɫɹ ɧɟɞɨɫɬɚɬɨɱɧɵɣ ɨɛɴɟɦ ɫɬɚɬɢɫɬɢɤɢ ɜ ɄɆ ɜɵɫɨɤɢɯ ɩɨɪɹɞɤɨɜ, ɱɬɨ ɩɪɢɜɨɞɢɬ ɤ ɛɨɥɶɲɢɦ ɩɨɝɪɟɲɧɨɫɬɹɦ ɨɰɟɧɨɤ. Ʉɚɤ ɩɨɛɨɱɧɵɣ ɪɟɡɭɥɶɬɚɬ ɢɦɟɟɬɫɹ ɧɟɩɪɢɹɬɧɚɹ ɡɚɜɢɫɢɦɨɫɬɶ ɩɨɪɹɞɤɚ ɨɛɵɱɧɨɣ PPM-ɦɨɞɟɥɢ, ɨɛɟɫɩɟɱɢɜɚɸɳɟɝɨ ɧɚɢɥɭɱɲɟɟ ɫɠɚɬɢɟ, ɨɬ ɜɢɞɚ ɞɚɧɧɵɯ. Ʉɚɤ ɩɪɚɜɢɥɨ, ɨɩɬɢɦɚɥɶɧɵɣ ɩɨɪɹɞɨɤ ɨɛɵɱɧɨɣ ɦɨɞɟɥɢ ɤɨɥɟɛɥɟɬɫɹ ɨɬ 0 ɞɨ 16 (ɞɥɹ ɬɟɤɫɬɨɜ ɜ ɪɚɣɨɧɟ 4– 6), ɤɪɨɦɟ ɬɨɝɨ, ɱɚɫɬɨ ɫɭɳɟɫɬɜɭɸɬ ɡɧɚɱɢɬɟɥɶɧɵɟ ɥɨɤɚɥɶɧɵɟ ɢɡɦɟ160 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
), ɤɪɨɦɟ ɬɨɝɨ, ɱɚɫɬɨ ɫɭɳɟɫɬɜɭɸɬ ɡɧɚɱɢɬɟɥɶɧɵɟ ɥɨɤɚɥɶɧɵɟ ɢɡɦɟɧɟɧɢɹ ɜɧɭɬɪɢ ɮɚɣɥɚ. ɇɚɩɪɢɦɟɪ, ɧɚ ɪɢɫ. 4.3. ɩɪɢɜɟɞɟɧ ɬɢɩɢɱɧɵɣ ɞɥɹ ɤɥɚɫɫɢɱɟɫɤɨɝɨ PPM-ɚɥɝɨɪɢɬɦɚ ɝɪɚɮɢɤ ɡɚɜɢɫɢɦɨɫɬɢ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɬɟɤɫɬɚ ɨɬ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ. ȼɢɞɧɨ, ɱɬɨ ɦɚɤɫɢɦɭɦ ɞɨɫɬɢɝɚɟɬɫɹ ɩɪɢ N = 4…5, ɩɨɫɥɟ ɱɟɝɨ ɧɚɛɥɸɞɚɟɬɫɹ ɩɥɚɜɧɨɟ ɩɚɞɟɧɢɟ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. ɋɬɟɩɟɧɶ ɫɠɚɬɢɹ
4 3.5 3 2.5 2 1.5 1 0
1
2
3
4 5 ɉɨɪɹɞɨɤ
6
7
8
Ɋɢɫ. 4.3. Ɂɚɜɢɫɢɦɨɫɬɶ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɨɬ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ ɞɥɹ ɤɥɚɫɫɢɱɟɫɤɨɝɨ PPM-ɚɥɝɨɪɢɬɦɚ Ɇɨɠɧɨ ɜɵɞɟɥɢɬɶ 2 ɩɨɞɯɨɞɚ ɤ ɪɟɲɟɧɢɸ ɩɪɨɛɥɟɦɵ: • ɜɵɛɨɪ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ, ɨɛɟɫɩɟɱɢɜɚɸɳɟɝɨ ɧɚɢɥɭɱɲɟɟ ɫɠɚɬɢɟ, ɩɪɢ ɨɰɟɧɢɜɚɧɢɢ ɤɚɠɞɨɝɨ ɫɢɦɜɨɥɚ; • ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɫɬɚɬɢɫɬɢɤɢ ɤɨɧɬɟɤɫɬɨɜ-ɩɪɟɞɤɨɜ. ȼɕȻɈɊ ɅɈɄȺɅɖɇɈȽɈ ɉɈɊəȾɄȺ ɆɈȾȿɅɂ
Ɇɟɯɚɧɢɡɦ ɜɵɛɨɪɚ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ɤɚɠɞɨɝɨ ɫɢɦɜɨɥɚ ɩɨɥɭɱɢɥ ɧɚɡɜɚɧɢɟ Local Order Estimation (LOE) — «ɨɰɟɧɤɚ ɥɨɤɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ». ɋɯɟɦɵ LOE ɧɨɫɹɬ ɱɢɫɬɨ ɷɜɪɢɫɬɢɱɟɫɤɢɣ ɯɚɪɚɤɬɟɪ ɢ ɡɚɤɥɸɱɚɸɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɦɵ ɡɚɞɚɟɦ ɧɟɤɭɸ ɮɭɧɤɰɢɸ «ɞɨɜɟɪɢɹ» ɢ ɩɪɨɛɭɟɦ ɩɪɟɞɫɤɚɡɚɬɶ ɫ ɟɟ ɩɨɦɨɳɶɸ ɷɮɮɟɤɬɢɜɧɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ ɬɟɤɭɳɟɝɨ ɫɢɦɜɨɥɚ ɜ ɬɨɣ ɢɥɢ ɢɧɨɣ ɞɨɫɬɭɩɧɨɣ — ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɚɤɬɢɜɧɨɦɭ ɤɨɧɬɟɤɫɬɭ ɢ ɮɢɡɢɱɟɫɤɢ ɫɭɳɟɫɬɜɭɸɳɟɣ — ɄɆ ɩɨɪɹɞɤɚ ɨɬ 0 ɞɨ ɡɚɞɚɧɧɨɝɨ N. Ɇɨɠɧɨ ɜɵɞɟɥɢɬɶ ɬɪɢ ɬɢɩɚ ɫɯɟɦ LOE: Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 161 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɢɳɟɦ ɨɩɬɢɦɚɥɶɧɵɣ ɩɨɪɹɞɨɤ ɫɜɟɪɯɭ ɜɧɢɡ ɨɬ ɄɆ ɦɚɤɫɢɦɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ N ɤ ɄɆ ɦɢɧɢɦɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ; ɩɪɟɤɪɚɳɚɟɦ ɩɨɢɫɤ, ɤɚɤ ɬɨɥɶɤɨ ɄɆ ɦɟɧɶɲɟɝɨ ɩɨɪɹɞɤɚ ɤɚɠɟɬɫɹ ɧɚɦ ɛɨɥɟɟ «ɩɨɞɨɡɪɢɬɟɥɶɧɨɣ», ɱɟɦ ɬɟɤɭɳɚɹ, ɤɨɬɨɪɭɸ ɢ ɢɫɩɨɥɶɡɭɟɦ ɞɥɹ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɚ; 2) ɩɨɢɫɤ ɫɧɢɡɭ ɜɜɟɪɯ; 3) ɨɰɟɧɤɚ ɜɫɟɯ ɞɨɫɬɭɩɧɵɯ ɄɆ. ȿɫɥɢ ɜ ɜɵɛɪɚɧɧɨɣ ɄɆ ɡɚɤɨɞɢɪɨɜɚɬɶ ɫɢɦɜɨɥ ɧɟ ɭɞɚɥɨɫɶ, ɬɨ, ɜɨɨɛɳɟ ɝɨɜɨɪɹ, ɩɪɨɰɟɞɭɪɭ ɩɨɢɫɤɚ ɫɥɟɞɭɸɳɟɣ ɨɩɬɢɦɚɥɶɧɨɣ ɩɨ ɡɚɞɚɧɧɨɦɭ ɤɪɢɬɟɪɢɸ ɄɆ ɦɨɠɧɨ ɩɨɜɬɨɪɢɬɶ. Ɍɟɦ ɧɟ ɦɟɧɟɟ, ɨɛɵɱɧɨ ɢɳɭɬ ɬɨɥɶɤɨ ɧɚɱɚɥɶɧɵɣ ɩɨɪɹɞɨɤ, ɚ ɜ ɫɥɭɱɚɟ ɭɯɨɞɚ ɩɪɨɫɬɨ ɫɩɭɫɤɚɸɬɫɹ ɧɚ ɭɪɨɜɟɧɶ ɧɢɠɟ, ɬɨ ɟɫɬɶ ɞɚɥɶɲɟ ɢɫɩɨɥɶɡɭɸɬ ɨɛɵɱɧɵɣ ɚɥɝɨɪɢɬɦ PPM. ȼɵɛɨɪ ɬɨɣ ɢɥɢ ɢɧɨɣ ɮɭɧɤɰɢɢ ɞɨɜɟɪɢɹ ɡɚɜɢɫɢɬ ɨɬ ɨɫɨɛɟɧɧɨɫɬɟɣ ɤɨɧɤɪɟɬɧɨɣ ɪɟɚɥɢɡɚɰɢɢ PPM, ɯɚɪɚɤɬɟɪɢɫɬɢɤ ɞɚɧɧɵɯ, ɞɥɹ ɫɠɚɬɢɹ ɤɨɬɨɪɵɯ ɪɚɡɪɚɛɚɬɵɜɚɟɬɫɹ ɤɨɦɩɪɟɫɫɨɪ, ɢ, ɤɚɤ ɧɟɪɟɞɤɨ ɛɵɜɚɟɬ, ɥɢɱɧɵɯ ɩɪɢɫɬɪɚɫɬɢɣ ɪɚɡɪɚɛɨɬɱɢɤɚ. Ʉɚɤ ɩɨɤɚɡɚɥ ɨɩɵɬ, ɪɚɡɥɢɱɧɵɟ «ɧɚɢɜɧɵɟ» ɷɧɬɪɨɩɢɣɧɵɟ ɨɰɟɧɤɢ ɧɚɞɟɠɧɨɫɬɢ ɄɆ ɪɚɛɨɬɚɸɬ ɩɥɨɯɨ. ɗɬɢ ɨɰɟɧɤɢ ɨɫɧɨɜɵɜɚɸɬɫɹ ɧɚ ɫɪɚɜɧɟɧɢɢ ɫɪɟɞɧɟɣ ɞɥɢɧɵ ɤɨɞɨɜ ɞɥɹ ɬɟɤɭɳɟɣ ɄɆ(o) ɢ ɪɨɞɢɬɟɥɶɫɤɨɣ ɄɆ(o–1). ɇɟɭɞɚɱɚ ɨɛɴɹɫɧɹɟɬɫɹ, ɜɢɞɢɦɨ, ɬɟɦ, ɱɬɨ ɜ ɫɢɥɭ ɱɢɫɬɨɣ ɫɥɭɱɚɣɧɨɫɬɢ ɮɭɧɤɰɢɹ ɪɚɫɩɪɟɞɟɥɟɧɢɹ ɜ ɄɆ(o) ɦɨɠɟɬ ɛɵɬɶ ɛɨɥɟɟ ɩɥɨɫɤɨɣ, ɱɟɦ ɜ ɫɥɟɞɭɸɳɟɣ ɪɚɫɫɦɚɬɪɢɜɚɟɦɨɣ ɄɆ(o–1). ɉɨɷɬɨɦɭ ɞɥɹ ɩɨɥɭɱɟɧɢɹ ɩɪɚɜɞɨɩɨɞɨɛɧɨɣ ɨɰɟɧɤɢ ɧɚɞɨ ɫɪɚɜɧɢɜɚɬɶ ɫɪɟɞɧɸɸ ɞɥɢɧɭ ɤɨɞɨɜ ɞɥɹ ɜɫɟɯ ɞɨɱɟɪɧɢɯ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ ɬɟɤɭɳɟɣ ɄɆ(o) ɫɨ ɫɪɟɞɧɟɣ ɞɥɢɧɨɣ ɤɨɞɨɜ ɞɥɹ ɜɫɟɯ ɞɨɱɟɪɧɢɯ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ ɪɨɞɢɬɟɥɶɫɤɨɣ ɄɆ(o–1). ȼ [3] ɛɵɥ ɩɪɟɞɥɨɠɟɧ ɷɮɮɟɤɬɢɜɧɵɣ ɢ ɩɪɨɫɬɨɣ ɦɟɬɨɞ, ɞɚɸɳɢɣ ɨɰɟɧɤɭ ɧɚɞɟɠɧɨɫɬɢ ɄɆ ɢɫɯɨɞɹ ɢɡ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ Q ɧɚɢɛɨɥɟɟ ɜɟɪɨɹɬɧɨɝɨ ɜ ɄɆ ɫɢɦɜɨɥɚ (Most Probable Symbol's Probability, MPS-P) ɢ ɤɨɥɢɱɟɫɬɜɚ ɭɯɨɞɨɜ E ɢɡ ɄɆ. Ɉɛɨɛɳɟɧɧɨ ɮɨɪɦɭɥɭ ɦɨɠɧɨ ɡɚɩɢɫɚɬɶ ɬɚɤ: a ⋅ Q log 2 Q + b ⋅ E (log 2 E − c) + d ⋅ (1 − Q)(log 2 E − c) , (4.1) ɝɞɟ ɤɨɧɫɬɚɧɬɵ a, b, c, d ɩɨɞɛɢɪɚɸɬɫɹ ɷɦɩɢɪɢɱɟɫɤɢɦ ɩɭɬɟɦ. 1)
162 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ʉɪɢɬɟɪɢɟɦ ɜɵɛɨɪɚ ɄɆ ɹɜɥɹɟɬɫɹ ɦɢɧɢɦɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ ɜɵɪɚɠɟɧɢɹ (4.1) ɫɪɟɞɢ ɜɫɟɯ ɞɨɫɬɭɩɧɵɯ ɄɆ. Ʉ ɫɱɚɫɬɶɸ, ɨɰɟɧɤɚ ɬɨɥɶɤɨ ɩɨ Q ɞɚɟɬ ɯɨɪɨɲɢɟ ɪɟɡɭɥɶɬɚɬɵ ɭɠɟ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɤɨɝɞɚ ɩɪɨɫɬɨ ɜɵɛɢɪɚɟɦ ɄɆ ɫ ɦɚɤɫɢɦɚɥɶɧɵɦ Q (ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɜɚɪɢɚɧɬɭ ɨɛɨɛɳɟɧɧɨɣ ɮɨɪɦɭɥɵ ɩɪɢ b = d = 0). Ɇɨɠɧɨ ɞɚɬɶ ɫɥɟɞɭɸɳɢɣ ɩɪɢɦɟɪ, ɞɟɦɨɧɫɬɪɢɪɭɸɳɢɣ ɧɟɞɨɫɬɚɬɤɢ «ɧɚɢɜɧɨɝɨ» ɷɧɬɪɨɩɢɣɧɨɝɨ ɩɨɞɯɨɞɚ ɢ ɩɨɞɯɨɞɚ MPS-P. ɉɭɫɬɶ ɦɵ ɤɨɞɢɪɭɟɦ ɫ ɩɨɦɨɳɶɸ PPM-ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɩɨɪɹɞɤɚ 2 ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɚɥɮɚɜɢɬɚ {‘0’, ‘1’}, ɩɨɪɨɠɞɟɧɧɭɸ ɢɫɬɨɱɧɢɤɨɦ ɫ ɬɚɤɢɦɢ ɜɟɪɨɹɬɧɨɫɬɹɦɢ ɝɟɧɟɪɚɰɢɢ ɫɢɦɜɨɥɨɜ: p(0|00) = 0, p(1|00) = 1, p(0|10) = p(1|10) = 0.5. ɉɭɫɬɶ ɩɨɹɜɥɟɧɢɟ ɫɬɪɨɤ “00” ɢ “10” ɪɚɜɧɨɜɟɪɨɹɬɧɨ. ȿɫɥɢ ɭɠɟ ɨɛɪɚɛɨɬɚɧ ɛɨɥɶɲɨɣ ɛɥɨɤ ɜɯɨɞɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ, ɢ ɤɨɧɬɟɤɫɬ ɬɟɤɭɳɟɝɨ ɫɢɦɜɨɥɚ ɪɚɜɟɧ “10”, ɬɨ, ɜ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɡɚɞɚɧɧɵɦ ɨɩɢɫɚɧɢɟɦ ɢɫɬɨɱɧɢɤɚ, ɜ ɄɆ(2) ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɟɣ q(0|10) = q(1|10) = 0.5, ɚ ɜ ɄɆ(1) ɨɰɟɧɤɢ ɫɨɫɬɚɜɥɹɸɬ q(0|0) = 0.25, q(1|0) = 0.75. ɋɪɟɞɧɹɹ ɞɥɢɧɚ ɤɨɞɨɜ ɞɥɹ ɄɆ(2) ɪɚɜɧɚ − q(0 | 10) log 2 q(0 | 10) − q(1 | 10) log 2 q(1 | 10) , ɱɬɨ ɫɨɫɬɚɜɥɹɟɬ 1 ɛɢɬ. ȼ ɬɨ ɠɟ ɜɪɟɦɹ ɫɪɟɞɧɹɹ ɞɥɢɧɚ ɞɥɹ ɄɆ(1) ɪɚɜɧɚ − q(0 | 0) log 2 q(0 | 0) − q(1 | 0) log 2 q(1 | 0) , ɱɬɨ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɩɪɢɦɟɪɧɨ 0.8 ɛɢɬɚ. ɉɨɷɬɨɦɭ, ɟɫɥɢ ɩɨɥɶɡɭɟɦɫɹ «ɧɚɢɜɧɵɦ» ɷɧɬɪɨɩɢɣɧɵɦ ɤɪɢɬɟɪɢɟɦ, ɬɨ ɦɵ ɞɨɥɠɧɵ ɜɵɛɪɚɬɶ ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ɄɆ(1). Ʉɪɢɬɟɪɢɣ MPS-P ɬɚɤɠɟ ɭɤɚɡɵɜɚɟɬ ɧɚ ɄɆ(1). ɗɬɨɬ ɜɵɛɨɪ ɨɲɢɛɨɱɟɧ. Ⱦɟɣɫɬɜɢɬɟɥɶɧɨ, ɟɫɥɢ ɦɵ ɤɨɞɢɪɭɟɦ ɜ ɄɆ(2), ɬɨ ɫɢɦɜɨɥɵ ‘0’ ɢ ‘1’ ɬɪɟɛɭɸɬ ɩɨ –log2 0.5 = 1 ɛɢɬɭ. ȿɫɥɢ ɜ ɄɆ(1), ɬɨ ɞɥɹ ɤɨɞɢɪɨɜɚɧɢɹ ‘0’ ɧɭɠɧɨ –log2 0.25 = 2 ɛɢɬɚ, ɚ ɞɥɹ ‘1’ ɬɪɟɛɭɟɬɫɹ –log2 0.75 § 0.4 ɛɢɬɚ. ȼ ɫɨɨɬɜɟɬɫɬɜɢɢ ɫ ɩɪɢɧɹɬɵɦ ɨɩɢɫɚɧɢɟɦ ɢɫɬɨɱɧɢɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɩɨɹɜɥɟɧɢɹ ‘0’ ɢ ‘1’ ɩɨɫɥɟ ɫɬɪɨɤɢ “10” ɨɞɢɧɚɤɨɜɵ, ɩɨɷɬɨɦɭ ɩɪɢ ɤɚɠɞɨɦ ɨɰɟɧɢɜɚɧɢɢ ɧɚ ɨɫɧɨɜɚɧɢɢ ɫɬɚɬɢɫɬɢɤɢ ɞɥɹ ɤɨɧɬɟɤɫɬɚ “0” ɜɦɟɫɬɨ ɫɬɚɬɢɫɬɢɤɢ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 163 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɞɥɹ ɤɨɧɬɟɤɫɬɚ “10” ɦɵ ɛɭɞɟɦ ɬɟɪɹɬɶ ɜ ɫɪɟɞɧɟɦ 0.5·(2–1) + 0.5·(0.4–1) = 0.2 ɛɢɬɚ. Ⱦɨɛɚɜɢɦ, ɱɬɨ ɢɡɜɟɫɬɧɵɟ ɜɚɪɢɚɧɬɵ ɪɟɚɥɢɡɚɰɢɢ ɩɨɞɯɨɞɚ LOE ɩɥɨɯɨ ɫɨɱɟɬɚɸɬɫɹ ɜ ɫɦɵɫɥɟ ɭɥɭɱɲɟɧɢɹ ɫɠɚɬɢɹ ɫ ɦɟɯɚɧɢɡɦɨɦ ɧɚɫɥɟɞɨɜɚɧɢɟɦ ɢɧɮɨɪɦɚɰɢɢ, ɬ.ɤ. ɷɬɢ ɬɟɯɧɢɤɢ ɷɤɫɩɥɭɚɬɢɪɭɸɬ ɩɪɢɦɟɪɧɨ ɨɞɢɧɚɤɨɜɵɟ ɧɟɞɨɫɬɚɬɤɢ ɤɥɚɫɫɢɱɟɫɤɨɝɨ ɚɥɝɨɪɢɬɦɚ PPM. ɇȺɋɅȿȾɈȼȺɇɂȿ ɂɇɎɈɊɆȺɐɂɂ
Ɇɟɬɨɞ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɩɨɡɜɨɥɹɟɬ ɫɭɳɟɫɬɜɟɧɧɨ ɭɥɭɱɲɢɬɶ ɬɨɱɧɨɫɬɶ ɨɰɟɧɨɤ. ɇɚ ɤɨɧɟɰ 2001 ɝɨɞɚ ɢɦɟɟɬɫɹ ɩɨ ɤɪɚɣɧɟɣ ɦɟɪɟ ɨɞɧɚ ɨɱɟɧɶ ɷɮɮɟɤɬɢɜɧɚɹ ɪɟɚɥɢɡɚɰɢɹ PPM, ɨɛɟɫɩɟɱɢɜɚɸɳɚɹ ɜɵɫɨɤɭɸ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɬɢɩɨɜɵɯ ɞɚɧɧɵɯ, ɜ ɨɫɨɛɟɧɧɨɫɬɢ ɬɟɤɫɬɨɜ, ɜ ɩɟɪɜɭɸ ɨɱɟɪɟɞɶ ɢɡ-ɡɚ ɩɪɢɦɟɧɟɧɢɹ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ [1]. Ɇɟɬɨɞ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ, ɩɪɟɞɥɨɠɟɧɧɵɣ ɒɤɚɪɢɧɵɦ ɜ [1], ɛɨɪɟɬɫɹ ɫ ɧɟɬɨɱɧɨɫɬɶɸ ɨɰɟɧɨɤ ɫɢɦɜɨɥɨɜ ɜ ɄɆ ɛɨɥɶɲɢɯ ɩɨɪɹɞɤɨɜ ɢ ɨɫɧɨɜɚɧ ɧɚ ɨɱɟɧɶ ɩɪɨɫɬɨɣ ɢɞɟɟ. Ʌɨɝɢɱɧɨ ɩɪɟɞɩɨɥɨɠɢɬɶ, ɱɬɨ ɪɚɫɩɪɟɞɟɥɟɧɢɹ ɱɚɫɬɨɬ ɫɢɦɜɨɥɨɜ ɜ ɪɨɞɢɬɟɥɶɫɤɢɯ ɢ ɞɨɱɟɪɧɢɯ ɄɆ ɩɨɯɨɠɢ. Ɍɨɝɞɚ ɩɪɢ ɩɨɹɜɥɟɧɢɢ ɜ ɞɨɱɟɪɧɟɣ ɄɆ(o) ɧɨɜɨɝɨ ɫɢɦɜɨɥɚ si ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɢɧɢɰɢɚɥɢɡɢɪɨɜɚɬɶ ɟɝɨ ɫɱɟɬɱɢɤ f(si|o) ɧɟɤɨɬɨɪɨɣ ɜɟɥɢɱɢɧɨɣ f 0 ( s i | o ) , ɡɚɜɢɫɹɳɟɣ ɨɬ ɢɧɮɨɪɦɚɰɢɢ ɨ ɞɚɧɧɨɦ ɫɢɦɜɨɥɟ ɜ ɪɨɞɢɬɟɥɶɫɤɨɣ ɄɆ (ɢɥɢ ɧɟɫɤɨɥɶɤɢɯ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ-ɩɪɟɞɤɚɯ). ɉɭɫɬɶ ɜ ɪɟɡɭɥɶɬɚɬɟ ɫɟɪɢɢ ɭɯɨɞɨɜ ɦɵ ɫɩɭɫɬɢɥɢɫɶ ɫ ɄɆ(o) ɧɚ ɄɆ(o–k), ɝɞɟ ɫɢɦɜɨɥ ɢ ɛɵɥ ɭɫɩɟɲɧɨ ɨɰɟɧɟɧ. Ɍɨɝɞɚ ɧɚɱɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ ɫɱɟɬɱɢɤɚ ɫɢɦɜɨɥɚ ɜ ɄɆ(o) ɪɚɡɭɦɧɨ ɜɵɱɢɫɥɹɬɶ ɢɫɯɨɞɹ ɢɡ ɪɚɜɟɧɫɬɜɚ
f 0 ( si | o ) f ( si | o − k ) = , f (o) f (o − k ) + Fo−k ,o
ɝɞɟ
f 0 ( si | o) — ɧɚɫɥɟɞɭɟɦɚɹ ɱɚɫɬɨɬɚ; f(o) — ɫɭɦɦɚ ɱɚɫɬɨɬ ɜɫɟɯ ɫɢɦɜɨɥɨɜ ɄɆ(o), ɜɤɥɸɱɚɹ ɫɢɦɜɨɥ ɭɯɨɞɚ; Fo–k,o — ɫɭɦɦɚ ɱɚɫɬɨɬ ɜɫɟɯ ɫɢɦɜɨɥɨɜ, ɪɟɚɥɶɧɨ ɜɫɬɪɟɱɟɧɧɵɯ ɜ ɤɨɧɬɟɤɫɬɚɯ ɩɨɪɹɞɤɨɜ o–k+1 … o.
164 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
(4.2)
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Fo − k ,o = ɝɞɟ
o m = o − k +1
( f (m) − f (esc | m) − ƒ
S(m) j =1
)
f 0 ( s j | m) ,
f(esc|m) — ɱɚɫɬɨɬɚ ɞɥɹ ɫɢɦɜɨɥɚ ɭɯɨɞɚ ɜ ɄɆ(m); S(m) — ɤɨɥɢɱɟɫɬɜɨ ɫɢɦɜɨɥɨɜ ɜ ɄɆ(m), ɧɟ ɜɤɥɸɱɚɹ ɫɢɦɜɨɥ ɭɯɨɞɚ. ɍɩɪɚɠɧɟɧɢɟ: Ɉɛɴɹɫɧɢɬɟ ɫɦɵɫɥ ɫɥɚɝɚɟɦɨɝɨ Fo–k,o ɜ ɜɵɪɚɠɟɧɢɢ (4.2).
ȼɵɪɚɠɟɧɢɟ (4.2) ɨɛɥɚɞɚɟɬ ɛɨɥɶɲɨɣ ɜɵɱɢɫɥɢɬɟɥɶɧɨɣ ɫɥɨɠɧɨɫɬɶɸ ɢ ɬɪɟɛɭɟɬ ɫɭɳɟɫɬɜɟɧɧɵɯ ɡɚɬɪɚɬ ɩɚɦɹɬɢ ɞɥɹ ɨɪɝɚɧɢɡɚɰɢɢ ɜɵɱɢɫɥɟɧɢɹ. Ʉɪɨɦɟ ɬɨɝɨ, ɢɦɟɟɬ ɫɦɵɫɥ ɭɱɢɬɵɜɚɬɶ ɬɨɥɶɤɨ ɫɬɚɬɢɫɬɢɤɭ ɄɆ(o–k), ɬɚɤ ɤɚɤ ɜɫɟ ɪɚɜɧɨ ɜ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ k ɪɚɜɧɨ 1, ɬ.ɟ. ɭɫɩɟɲɧɨɟ ɤɨɞɢɪɨɜɚɧɢɟ ɩɪɨɢɫɯɨɞɢɬ ɜ ɪɨɞɢɬɟɥɶɫɤɨɣ ɄɆ, ɟɫɥɢ ɠɟ ɷɬɨ ɧɟ ɬɚɤ, ɬɨ, ɫɤɨɪɟɟ ɜɫɟɝɨ, ɤɨɧɬɟɤɫɬɵ ɩɨɪɹɞɤɨɜ o–1 … o–k+1 ɹɜɥɹɸɬɫɹ «ɦɨɥɨɞɵɦɢ», ɢ ɞɥɹ ɧɢɯ ɟɳɟ ɧɟ ɧɚɤɨɩɥɟɧɨ ɩɨɥɟɡɧɨɣ ɫɬɚɬɢɫɬɢɤɢ. ɉɨɷɬɨɦɭ ɧɚ ɩɪɚɤɬɢɤɟ ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɢɫɩɨɥɶɡɨɜɚɬɶ ɩɪɢɛɥɢɠɟɧɧɭɸ ɮɨɪɦɭɥɭ
f (o) ⋅ f ( si | o − k ) . f ( o ) − s ( o ) + f ( o − k ) − f ( si | o − k ) ɉɪɢ ɫɚɦɨɣ ɩɪɨɫɬɨɣ ɪɟɚɥɢɡɚɰɢɢ ɜɟɥɢɱɢɧɚ f 0 ( si | o ) ɜɵɱɢɫɥɹf 0 (i | o ) =
ɟɬɫɹ ɢ ɩɪɢɫɜɚɢɜɚɟɬɫɹ ɫɪɚɡɭ ɩɪɢ ɫɨɡɞɚɧɢɢ ɧɨɜɨɝɨ ɫɱɟɬɱɢɤɚ ɜ ɄɆ(o). ɇɨ ɦɨɠɧɨ ɨɬɥɨɠɢɬɶ ɧɚɫɥɟɞɨɜɚɧɢɟ ɱɚɫɬɨɬɵ ɞɨ ɫɥɟɞɭɸɳɟɝɨ ɩɨɹɜɥɟɧɢɹ ɫɢɦɜɨɥɚ si ɜ ɷɬɨɦ ɤɨɧɬɟɤɫɬɟ ɩɨɪɹɞɤɚ o. ȼɟɪɨɹɬɧɟɟ ɜɫɟɝɨ, ɤ ɬɨɦɭ ɜɪɟɦɟɧɢ ɪɨɞɢɬɟɥɶɫɤɚɹ ɄɆ ɛɭɞɟɬ ɨɛɥɚɞɚɬɶ ɛɨɥɶɲɢɦ ɨɛɴɟɦɨɦ ɫɬɚɬɢɫɬɢɤɢ, ɱɬɨ ɞɨɥɠɧɨ ɞɚɬɶ ɛɨɥɟɟ ɬɨɱɧɭɸ ɨɰɟɧɤɭ f 0 ( si | o ) ɢ, ɜ ɤɨɧɟɱɧɨɦ ɢɬɨɝɟ, ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ. Ɍɚɤɨɟ «ɨɬɥɨɠɟɧɧɨɟ» ɧɚɫɥɟɞɨɜɚɧɢɟ ɬɪɟɛɭɟɬ ɩɨɜɬɨɪɧɨɝɨ ɩɨɢɫɤɚ ɪɨɞɢɬɟɥɶɫɤɨɣ ɄɆ ɢ ɫɢɦɜɨɥɚ si ɜ ɧɟɣ, ɱɬɨ ɦɨɠɟɬ ɫɭɳɟɫɬɜɟɧɧɨ ɡɚɦɟɞɥɢɬɶ ɨɛɪɚɛɨɬɤɭ. ȼ ɡɚɜɢɫɢɦɨɫɬɢ ɨɬ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ, ɨɫɨɛɟɧɧɨɫɬɟɣ ɪɟɚɥɢɡɚɰɢɢ ɢ ɫɨɛɫɬɜɟɧɧɨ ɫɠɢɦɚɟɦɵɯ ɞɚɧɧɵɯ ɧɚɫɥɟɞɨɜɚɧɢɟ ɢɧɮɨɪɦɚɰɢɢ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 165 http://www.compression.ru/
ƒ
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɨɡɜɨɥɹɟɬ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɩɪɢɦɟɪɧɨ ɧɚ 1…10%. Ɍɢɩɢɱɧɨɣ ɹɜɥɹɟɬɫɹ ɰɢɮɪɚ ɩɨɪɹɞɤɚ 2–4%. Ɂɚɤɥɸɱɟɧɢɟ: ɋɭɳɟɫɬɜɭɸɳɢɟ ɪɟɚɥɢɡɚɰɢɢ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɦɟɯɚɧɢɡɦ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ, ɨɛɟɫɩɟɱɢɜɚɸɬ ɥɭɱɲɟɟ ɫɠɚɬɢɟ, ɱɟɦ ɤɨɦɩɪɟɫɫɨɪɵ ɫ LOE.
Ɋɚɡɥɢɱɧɵɟ ɫɩɨɫɨɛɵ ɩɨɜɵɲɟɧɢɹ ɬɨɱɧɨɫɬɢ ɩɪɟɞɫɤɚɡɚɧɢɹ ɆȺɋɒɌȺȻɂɊɈȼȺɇɂȿ ɋɑȿɌɑɂɄȺ ɉɈɋɅȿȾɇȿȽɈ ȼɋɌɊȿɑȿɇɇɈȽɈ ɋɂɆȼɈɅȺ
ȿɫɥɢ ɜ ɩɨɫɥɟɞɧɢɣ ɪɚɡ ɜ ɬɟɤɭɳɟɦ ɤɨɧɬɟɤɫɬɟ ɛɵɥ ɜɫɬɪɟɱɟɧ ɧɟɤɢɣ ɫɢɦɜɨɥ s, ɬɨ ɜɟɪɨɹɬɧɨɫɬɶ ɬɨɝɨ, ɱɬɨ ɢ ɬɟɤɭɳɢɣ ɫɢɦɜɨɥ ɬɚɤɠɟ s, ɜɵɪɚɫɬɚɟɬ, ɩɪɢɱɟɦ ɱɚɫɬɨ ɡɧɚɱɢɬɟɥɶɧɨ. ɗɬɨɬ ɮɚɤɬ ɩɨɡɜɨɥɹɟɬ ɭɥɭɱɲɢɬɶ ɩɪɟɞɫɤɚɡɚɧɢɟ ɡɚ ɫɱɟɬ ɭɦɧɨɠɟɧɢɹ ɫɱɟɬɱɢɤɚ ɩɨɫɥɟɞɧɟɝɨ ɜɫɬɪɟɱɟɧɧɨɝɨ ɫɢɦɜɨɥɚ (ɉȼɋ) ɧɚ ɧɟɤɢɣ ɤɨɷɮɮɢɰɢɟɧɬ. ɋɭɞɹ ɩɨ ɜɫɟɦɭ, ɜɩɟɪɜɵɟ ɬɚɤɚɹ ɬɟɯɧɢɤɚ ɨɩɢɫɚɧɚ ɜ [15], ɝɞɟ ɨɧɚ ɧɚɡɵɜɚɟɬɫɹ “recency scaling” — «ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɧɨɜɢɡɧɵ». Ɍɟɯɧɢɤɚ ɛɵɥɚ ɢɫɫɥɟɞɨɜɚɧɚ Ɇ.Ⱥ. ɋɦɢɪɧɨɜɵɦ ɩɪɢ ɪɚɡɪɚɛɨɬɤɟ ɤɨɦɩɪɟɫɫɨɪɚ PPMN. ɉɨ ɫɨɫɬɨɹɧɢɸ ɧɚ 2001 ɝɨɞ ɧɟɢɡɜɟɫɬɧɵ ɞɪɭɝɢɟ ɩɪɨɝɪɚɦɦɵ ɫɠɚɬɢɹ, ɢɫɩɨɥɶɡɭɸɳɢɟ recency scaling. ȼ ɛɨɥɶɲɢɧɫɬɜɟ ɫɥɭɱɚɟɜ ɯɨɪɨɲɨ ɪɚɛɨɬɚɟɬ ɦɧɨɠɢɬɟɥɶ 1.1–1.2, ɬɨ ɟɫɬɶ ɩɪɢ ɬɚɤɨɦ ɡɧɚɱɟɧɢɢ ɧɚɛɥɸɞɚɟɬɫɹ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ ɛɨɥɶɲɢɧɫɬɜɚ ɮɚɣɥɨɜ, ɢ ɦɚɥɨɜɟɪɨɹɬɧɨ ɭɯɭɞɲɟɧɢɟ ɫɠɚɬɢɹ ɤɚɤɨɝɨ-ɬɨ «ɩɪɢɜɟɪɟɞɥɢɜɨɝɨ» ɮɚɣɥɚ. ɇɨ ɱɚɫɬɨ ɨɩɬɢɦɚɥɶɧɚɹ ɜɟɥɢɱɢɧɚ ɦɚɫɲɬɚɛɢɪɭɸɳɟɝɨ ɤɨɷɮɮɢɰɢɟɧɬɚ ɤɨɥɟɛɥɟɬɫɹ ɜ ɪɚɣɨɧɟ 2–2.5, ɬɚɤ ɱɬɨ ɦɨɠɧɨ ɭɥɭɱɲɢɬɶ ɨɰɟɧɤɭ ɡɚ ɫɱɟɬ ɚɞɚɩɬɢɜɧɨɝɨ ɢɡɦɟɧɟɧɢɹ ɦɧɨɠɢɬɟɥɹ. ɉɨɞɯɨɞɹɳɟɟ ɡɧɚɱɟɧɢɟ ɜɵɛɢɪɚɟɬɫɹ ɧɚ ɨɫɧɨɜɟ ɚɧɚɥɢɡɚ ɫɠɢɦɚɟɦɵɯ ɞɚɧɧɵɯ ɫ ɩɨɦɨɳɶɸ ɷɦɩɢɪɢɱɟɫɤɢ ɩɨɥɭɱɟɧɧɵɯ ɮɨɪɦɭɥ. ɂɫɫɥɟɞɨɜɚɧɢɹ ɩɨɤɚɡɚɥɢ, ɱɬɨ ɜɟɥɢɱɢɧɚ ɧɚɛɥɸɞɚɟɦɨɣ ɱɚɫɬɨɬɵ ɫɨɜɩɚɞɟɧɢɹ ɩɨɫɥɟɞɧɟɝɨ ɜɫɬɪɟɱɟɧɧɨɝɨ ɢ ɬɟɤɭɳɟɝɨ ɫɢɦɜɨɥɨɜ ɜ ɧɟɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɵɯ ɤɨɧɬɟɤɫɬɚɯ ɩɨɡɜɨɥɹɟɬ ɩɨɞɛɢɪɚɬɶ ɤɨɷɮɮɢɰɢɟɧɬ ɫ ɯɨɪɨɲɟɣ ɬɨɱɧɨɫɬɶɸ. 166 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱦɥɹ ɩɨɜɵɲɟɧɢɹ ɬɨɱɧɨɫɬɢ ɨɰɟɧɤɢ ɬɚɤɠɟ ɫɥɟɞɭɟɬ ɭɱɢɬɵɜɚɬɶ ɪɚɫɫɬɨɹɧɢɟ ɦɟɠɞɭ ɬɟɤɭɳɟɣ ɩɨɡɢɰɢɟɣ ɢ ɦɨɦɟɧɬɨɦ ɩɨɫɥɟɞɧɟɣ ɜɫɬɪɟɱɢ ɬɟɤɭɳɟɝɨ ɤɨɧɬɟɤɫɬɚ. ȿɫɥɢ ɪɚɫɫɬɨɹɧɢɟ ɛɨɥɶɲɟ 5000 ɫɢɦɜɨɥɨɜ, ɬɨ, ɫɤɨɪɟɟ ɜɫɟɝɨ, ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɫɱɟɬɱɢɤɚ ɉȼɋ ɬɨɥɶɤɨ ɩɨɜɪɟɞɢɬ. ɇɨ ɫɥɟɞɭɟɬ ɩɨɧɢɦɚɬɶ, ɱɬɨ ɭɱɟɬ ɷɬɨɣ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɬɪɟɛɭɟɬ ɫɭɳɟɫɬɜɟɧɧɵɯ ɡɚɬɪɚɬ ɩɚɦɹɬɢ. Ɋɚɫɫɦɨɬɪɢɦ ɪɟɚɥɢɡɚɰɢɸ ɩɪɨɫɬɟɣɲɟɝɨ ɚɥɝɨɪɢɬɦɚ recency scaling ɧɚ ɩɪɢɦɟɪɟ ɧɚɲɟɝɨ ɤɨɦɩɪɟɫɫɨɪɚ Dummy. ȼ ɨɩɢɫɚɧɢɟ ɫɬɪɭɤɬɭɪɵ ɄɆ ɜɧɟɫɟɦ ɩɨɥɟ last, ɨɩɢɫɵɜɚɸɳɟɟ ɉȼɋ ɞɥɹ ɡɚɞɚɧɧɨɝɨ ɤɨɧɬɟɤɫɬɚ. struct ContextModel{ int esc, TotFr, last; int count[256];
}; Ɂɧɚɱɟɧɢɟ last ɛɭɞɟɦ ɜɵɱɢɫɥɹɬɶ ɤɚɤ ɫɭɦɦɭ ɧɨɦɟɪɚ ɫɢɦɜɨɥɚ ɢ 1, ɞɥɹ ɬɨɝɨ ɱɬɨɛɵ ɧɭɥɟɜɨɟ ɡɧɚɱɟɧɢɟ last ɭɤɚɡɵɜɚɥɨ ɧɚ ɨɬɫɭɬɫɬɜɢɟ ɧɟɨɛɯɨɞɢɦɨɫɬɢ ɜɵɩɨɥɧɹɬɶ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ. ȼ ɧɚɱɚɥɟ ɪɚɛɨɬɵ ɩɪɨɝɪɚɦɦɵ last ɛɭɞɟɬ ɪɚɜɧɨ 0, ɬ.ɤ. cm ɹɜɥɹɟɬɫɹ ɝɥɨɛɚɥɶɧɨɣ ɩɟɪɟɦɟɧɧɨɣ. ȼ ɧɚɱɚɥɨ ɮɭɧɤɰɢɣ encode_sym ɢ decode_sym ɞɨɛɚɜɢɦ ɞɟɣɫɬɜɢɹ ɩɨ ɭɦɧɨɠɟɧɢɸ ɫɱɟɬɱɢɤɚ ɉȼɋ ɧɚ ɩɨɫɬɨɹɧɧɵɣ ɤɨɷɮɮɢɰɢɟɧɬ 1.25. int addition; if (CM->last){ addition = CM->count[CM->last-1]>>2; CM->count[CM->last-1] += addition; CM->TotFr += addition; }
Ʉɪɨɦɟ ɬɨɝɨ, ɞɨɛɚɜɢɦ ɫɪɚɡɭ ɠɟ ɩɨɫɥɟ ɜɵɡɨɜɚ ɦɟɬɨɞɨɜ ɢ AC.decode_update ɭɫɥɨɜɧɵɟ ɨɩɟɪɚɬɨɪɵ, ɢɫɩɪɚɜɥɹɸɳɢɟ ɡɧɚɱɟɧɢɹ ɫɱɟɬɱɢɤɨɜ ɧɚ ɩɟɪɜɨɧɚɱɚɥɶɧɵɟ. AC.encode
if (CM->last){
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 167 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
CM->count[CM->last-1] -= addition; CM->TotFr -= addition; }
ɂ, ɧɚɤɨɧɟɰ, ɨɛɟɫɩɟɱɢɦ ɩɪɚɜɢɥɶɧɨɟ ɨɛɧɨɜɥɟɧɢɟ last ɜ ɮɭɧɤɰɢɢ update_model. if (!stack[SP]->count[c]) stack[SP]->esc += 1; else stack[SP]->last = c+1;
Ɉɛɪɚɳɚɟɦ ɜɧɢɦɚɧɢɟ, ɱɬɨ ɧɟɨɛɯɨɞɢɦɨ ɤɨɧɬɪɨɥɢɪɨɜɚɬɶ ɜɟɥɢɱɢɧɭ addition, ɬ.ɤ. ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɦɨɠɟɬ ɩɪɢɜɟɫɬɢ ɤ ɩɟɪɟɩɨɥɧɟɧɢɸ ɜ ɚɪɢɮɦɟɬɢɱɟɫɤɨɦ ɤɨɞɟɪɟ. Ɇɵ ɧɟ ɪɟɚɥɢɡɨɜɚɥɢ ɷɬɭ ɩɪɨɜɟɪɤɭ ɥɢɲɶ ɫ ɰɟɥɶɸ ɭɩɪɨɳɟɧɢɹ ɨɩɢɫɚɧɢɹ. Ɉɩɢɫɚɧɧɚɹ ɦɨɞɢɮɢɤɚɰɢɹ ɤɨɦɩɪɟɫɫɨɪɚ ɩɨɡɜɨɥɹɟɬ ɭɥɭɱɲɢɬɶ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ CalgCC ɩɪɢɦɟɪɧɨ ɧɚ 0.5%. ɇɨ ɨɩɬɢɦɚɥɶɧɚɹ ɜɟɥɢɱɢɧɚ ɤɨɷɮɮɢɰɢɟɧɬɚ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɹ ɫɭɳɟɫɬɜɟɧɧɨ ɦɟɧɹɟɬɫɹ ɨɬ ɮɚɣɥɚ ɤ ɮɚɣɥɭ. Ɍɚɤ, ɧɚɩɪɢɦɟɪ, ɞɥɹ ɮɚɣɥɚ Obj2 ɦɚɤɫɢɦɚɥɶɧɨɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ — ɧɚ 6% — ɛɵɥɨ ɨɬɦɟɱɟɧɨ ɩɪɢ ɤɨɷɮɮɢɰɢɟɧɬɟ 4. ȼɵɜɨɞ: Ɇɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɫɱɟɬɱɢɤɚ ɩɨɫɥɟɞɧɟɝɨ ɜɫɬɪɟɱɟɧɧɨɝɨ ɫɢɦɜɨɥɚ (recency scaling) ɩɨɡɜɨɥɹɟɬ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɜ ɫɪɟɞɧɟɦ ɥɢɲɶ ɧɚ 0.5–1%, ɧɨ ɦɨɠɟɬ ɞɚɬɶ ɫɭɳɟɫɬɜɟɧɧɵɣ ɜɵɢɝɪɵɲ ɩɪɢ ɨɛɪɚɛɨɬɤɟ ɞɚɧɧɵɯ, ɫɬɚɬɢɫɬɢɱɟɫɤɢɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɤɨɬɨɪɵɯ ɩɨɞɜɟɪɠɟɧɵ ɱɚɫɬɵɦ ɢɡɦɟɧɟɧɢɹɦ. ɆȺɋɒɌȺȻɂɊɈȼȺɇɂȿ ȼ ȾȿɌȿɊɆɂɇɂɊɈȼȺɇɇɕɏ ɄɈɇɌȿɄɋɌȺɏ
ɂɡɜɟɫɬɧɨ, ɱɬɨ ɦɟɬɨɞɵ Ɉȼɍ A, B, C ɢ, ɜ ɦɟɧɶɲɟɣ ɫɬɟɩɟɧɢ, ɞɪɭɝɢɟ ɪɚɫɫɦɨɬɪɟɧɧɵɟ ɚɩɪɢɨɪɧɵɟ ɦɟɬɨɞɵ ɧɚɡɧɚɱɚɸɬ ɡɚɜɵɲɟɧɧɭɸ ɜɟɪɨɹɬɧɨɫɬɶ ɭɯɨɞɚ ɢɡ ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɵɯ ɤɨɧɬɟɤɫɬɨɜ [15]. ɗɬɨ ɦɨɠɧɨ ɢɫɩɪɚɜɢɬɶ, ɭɦɧɨɠɚɹ ɫɱɟɬɱɢɤ ɟɞɢɧɫɬɜɟɧɧɨɝɨ ɫɢɦɜɨɥɚ ɧɚ ɨɩɪɟɞɟɥɟɧɧɵɣ ɤɨɷɮɮɢɰɢɟɧɬ. Ɍɚɤɨɣ ɩɪɢɟɦ ɛɵɥ ɜɩɟɪɜɵɟ ɨɩɢɫɚɧ ɜ [15] ɩɨɞ ɧɚɢɦɟɧɨɜɚɧɢɟɦ “deterministic scaling” — «ɞɟɬɟɪ168 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɦɢɧɢɫɬɢɱɟɫɤɨɟ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ». ɇɟɬɪɭɞɧɨ ɡɚɦɟɬɢɬɶ, ɱɬɨ ɷɬɨɬ ɦɟɯɚɧɢɡɦ ɟɫɬɶ ɱɚɫɬɧɵɣ ɫɥɭɱɚɣ recency scaling. ɗɮɮɟɤɬ ɨɬ deterministic scaling ɭɜɟɥɢɱɢɜɚɟɬɫɹ, ɟɫɥɢ ɩɪɢ ɷɬɨɦ ɢɫɩɨɥɶɡɭɟɬɫɹ ɱɚɫɬɢɱɧɨɟ ɢɫɤɥɸɱɟɧɢɟ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ, ɚ ɧɟ ɨɛɵɱɧɨɟ ɢɫɤɥɸɱɟɧɢɟ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ [15]. Deterministic scaling ɢɦɟɟɬ ɫɦɵɫɥ ɩɪɢɦɟɧɹɬɶ ɬɨɥɶɤɨ ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɚɩɪɢɨɪɧɵɦɢ ɦɟɬɨɞɚɦɢ Ɉȼɍ, ɜɟɞɶ ɱɟɦ ɬɨɱɧɟɟ ɜɵɱɢɫɥɹɟɬɫɹ ɜɟɪɨɹɬɧɨɫɬɶ ɭɯɨɞɚ, ɬɟɦ ɩɨɥɶɡɵ ɨɬ ɷɬɨɝɨ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɹ ɦɟɧɶɲɟ. ɍȼȿɅɂɑȿɇɂȿ ɌɈɑɇɈɋɌɂ ɉɊȿȾɋɄȺɁȺɇɂə ɇȺɂȻɈɅȿȿ ȼȿɊɈəɌɇɕɏ ɋɂɆȼɈɅɈȼ
Ʉɨɧɬɟɤɫɬɵ ɛɨɥɶɲɨɣ ɞɥɢɧɵ ɜɫɬɪɟɱɚɸɬɫɹ ɪɟɞɤɨ, ɢ ɫɬɚɬɢɫɬɢɤɚ, ɧɚɛɢɪɚɟɦɚɹ ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɯ ɄɆ, ɨɛɵɱɧɨ ɹɜɥɹɟɬɫɹ ɧɟɞɨɫɬɚɬɨɱɧɨɣ ɞɥɹ ɩɨɥɭɱɟɧɢɹ ɧɚɞɟɠɧɨɣ ɨɰɟɧɤɢ ɞɚɠɟ ɜ ɫɥɭɱɚɟ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɦɟɯɚɧɢɡɦɚ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ. ɇɚɢɛɨɥɟɟ ɧɟɝɚɬɢɜɧɨ ɷɬɨ ɩɪɨɹɜɥɹɟɬɫɹ ɩɪɢ ɩɪɟɞɫɤɚɡɚɧɢɢ ɧɚɢɛɨɥɟɟ ɜɟɪɨɹɬɧɵɯ ɫɢɦɜɨɥɨɜ (ɇɛȼɋ) ɢ ɧɚɢɦɟɧɟɟ ɜɟɪɨɹɬɧɵɯ ɫɢɦɜɨɥɨɜ (ɇɦȼɋ), ɬɚɤ ɤɚɤ ɧɚɯɨɠɞɟɧɢɟ ɢɯ ɢɫɬɢɧɧɨɣ ɱɚɫɬɨɬɵ ɬɪɟɛɭɟɬ ɛɨɥɶɲɨɝɨ ɱɢɫɥɚ ɧɚɛɥɸɞɟɧɢɣ. Ɉɱɟɜɢɞɧɨ, ɱɬɨ ɩɪɢ ɷɬɨɦ ɨɫɧɨɜɧɭɸ ɢɡɛɵɬɨɱɧɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ ɦɵ ɜɧɨɫɢɦ ɢɡ-ɡɚ ɧɟɬɨɱɧɨɣ ɨɰɟɧɤɢ ɧɟ ɇɦȼɋ, ɚ ɇɛȼɋ ɜ ɫɢɥɭ ɢɯ ɛɨɥɟɟ ɱɚɫɬɨɣ ɜɫɬɪɟɱɚɟɦɨɫɬɢ. ȼ ɷɬɢɯ ɫɥɭɱɚɹɯ ɟɫɬɟɫɬɜɟɧɧɵɦ ɹɜɥɹɟɬɫɹ ɭɱɟɬ ɢɧɮɨɪɦɚɰɢɢ ɪɨɞɢɬɟɥɶɫɤɨɣ ɄɆ, ɱɬɨ ɦɨɠɧɨ ɪɚɫɫɦɚɬɪɢɜɚɬɶ ɤɚɤ ɩɟɪɟɯɨɞ ɨɬ ɧɟɹɜɧɨɝɨ ɜɡɜɟɲɢɜɚɧɢɹ ɤ ɹɜɧɨɦɭ. ɉɨɞ ɇɛȼɋ ɛɭɞɟɦ ɡɞɟɫɶ ɩɨɧɢɦɚɬɶ ɫɢɦɜɨɥɵ ɫ ɨɰɟɧɤɚɦɢ ɜɟɪɨɹɬɧɨɫɬɟɣ p(si|o) p(smps|o)/2, ɝɞɟ p(smps|o) ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɫɚɦɨɦɭ ɜɟɪɨɹɬɧɨɦɭ ɫɢɦɜɨɥɭ (most probable symbol) smps ɜ ɬɟɤɭɳɟɣ ɄɆ. ɑɚɫɬɨɬɵ ɇɛȼɋ ɛɭɞɟɦ ɤɨɪɪɟɤɬɢɪɨɜɚɬɶ, ɟɫɥɢ f(o) < f(o–1). ȼ ɷɬɢɯ ɫɥɭɱɚɹɯ ɄɆ(o) «ɦɨɥɨɞɚ», ɢ ɱɚɫɬɨɬɚ f(si|o) ɫɢɦɜɨɥɚ si ɟɳɟ, ɤɚɤ ɩɪɚɜɢɥɨ, ɦɟɧɶɲɟ ɱɚɫɬɨɬɵ f(si|o–1). ɍɬɨɱɧɟɧɧɨɟ ɡɧɚɱɟɧɢɟ fɫɤɨɪɪ(si|o) ɫɱɟɬɱɢɤɚ ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɫɪɟɞɧɟɟ ɜɡɜɟɲɟɧɧɨɟ f(si|o) ɢ «ɩɪɢɜɟɞɟɧɧɨɣ» ɱɚɫɬɨɬɵ f ′( si | o − 1) :
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 169 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
f (o) ⋅ f ( si | o) + f (o − 1) ⋅ f ′( si | o − 1) , f (o) + f (o − 1) f (o ) − f ( s i | o ) f ′( si | o − 1) = f ( si | o − 1) ⋅ . f (o − 1) − f ( si | o − 1) f ɫɤɨɪɪ ( si | o) =
ɝɞɟ
ȼ ɫɥɭɱɚɟ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɧɚɫɥɟɞɭɟɦɵɯ ɱɚɫɬɨɬ ɚɧɚɥɨɝɢɱɧɭɸ ɤɨɪɪɟɤɰɢɸ ɢɦɟɟɬ ɫɦɵɫɥ ɩɪɢɦɟɧɹɬɶ ɩɪɢ ɧɚɫɥɟɞɨɜɚɧɢɢ. Ɉɱɟɜɢɞɧɨ, ɱɬɨ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɫɢɥɶɧɨ ɡɚɜɢɫɢɬ ɨɬ ɬɨɱɧɨɫɬɢ ɩɪɟɞɫɤɚɡɚɧɢɹ ɇɛȼɋ, ɩɨɷɬɨɦɭ ɩɨɫɥɟ ɜɵɩɨɥɧɟɧɢɹ ɤɨɪɪɟɤɰɢɢ ɱɚɫɬɨɬɵ ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɞɟɥɚɬɶ ɚɞɚɩɬɢɜɧɭɸ ɨɰɟɧɤɭ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɚ ɩɨ ɚɧɚɥɨɝɢɢ ɫ SEE. ɇɚɡɨɜɟɦ ɬɚɤɭɸ ɬɟɯɧɢɤɭ Secondary Symbol Estimation (SSE) — «ɜɬɨɪɢɱɧɚɹ ɨɰɟɧɤɚ ɫɢɦɜɨɥɚ». ȼ ɤɨɦɩɪɟɫɫɨɪɟ PPMonstr ɜɟɪɫɢɢ H ɜɬɨɪɢɱɧɚɹ ɨɰɟɧɤɚ ɜɵɩɨɥɧɹɟɬɫɹ ɞɥɹ ɄɆ ɫ ɡɚɦɚɫɤɢɪɨɜɚɧɧɵɦɢ ɫɢɦɜɨɥɚɦɢ (ɄɆ ɬɢɩɚ m) ɢ ɧɟɞɟɪɦɢɧɢɪɨɜɚɧɧɵɯ ɄɆ ɫ ɧɟɡɚɦɚɫɤɢɪɨɜɚɧɧɵɦɢ ɫɢɦɜɨɥɚɦɢ (ɄɆ ɬɢɩɚ nm). ɉɨɥɹ ɤɨɧɬɟɤɫɬɨɜ ɞɥɹ SSE ɫɬɪɨɹɬɫɹ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ. Ⱦɥɹ ɄɆ ɬɢɩɚ nm: 1) ɱɚɫɬɨɬɚ f(smps|o) ɫɚɦɨɝɨ ɜɟɪɨɹɬɧɨɝɨ ɫɢɦɜɨɥɚ, ɤɜɚɧɬɭɟɦɚɹ ɞɨ 68 ɡɧɚɱɟɧɢɣ; 2) ɨɞɧɨɛɢɬɨɜɵɣ ɮɥɚɝ, ɭɤɚɡɵɜɚɸɳɢɣ, ɱɬɨ ɛɵɥɨ ɩɪɨɢɡɜɟɞɟɧɨ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɫɱɟɬɱɢɤɨɜ ɤɨɧɬɟɤɫɬɧɨɣ ɦɨɞɟɥɢ; 3) ɨɞɧɨɛɢɬɨɜɵɣ ɮɥɚɝ, ɯɪɚɧɹɳɢɣ ɪɟɡɭɥɶɬɚɬ ɫɪɚɜɧɟɧɢɹ ɩɨɪɹɞɤɚ o ɬɟɤɭɳɟɣ ɄɆ ɫɨ ɫɪɟɞɧɢɦ ɩɨɪɹɞɤɨɦ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ, ɜ ɤɨɬɨɪɵɯ ɛɵɥɢ ɡɚɤɨɞɢɪɨɜɚɧɵ ɩɨɫɥɟɞɧɢɟ 128 ɫɢɦɜɨɥɨɜ; 4) ɨɞɧɨɛɢɬɨɜɵɣ ɮɥɚɝ, ɩɪɢɧɢɦɚɸɳɢɣ ɡɧɚɱɟɧɢɟ 0, ɟɫɥɢ ɞɜɚ ɫɬɚɪɲɢɯ ɛɢɬɚ ɩɪɟɞɵɞɭɳɟɝɨ ɨɛɪɚɛɨɬɚɧɧɨɝɨ ɫɢɦɜɨɥɚ ɧɭɥɟɜɵɟ, ɢ ɡɧɚɱɟɧɢɟ 1 ɜ ɩɪɨɱɢɯ ɫɥɭɱɚɹɯ (ɚɧɚɥɨɝ ɩɨɥɹ 4 ɤɨɧɬɟɤɫɬɚ ɭɯɨɞɚ ɞɥɹ ɄɆ ɬɢɩɚ d ɜ SEE-d1); 5) ɨɞɧɨɛɢɬɨɜɵɣ ɮɥɚɝ, ɪɚɜɧɵɣ 0, ɟɫɥɢ ɞɜɚ ɫɬɚɪɲɢɯ ɛɢɬɚ ɫɢɦɜɨɥɚ smps ɧɭɥɟɜɵɟ, ɢ 1 ɜ ɨɫɬɚɥɶɧɵɯ ɫɥɭɱɚɹɯ (ɚɧɚɥɨɝ ɩɨɥɹ 6 Ʉɍ ɞɥɹ ɄɆ ɬɢɩɚ d ɜ SEE-d1). Ⱦɥɹ ɄɆ ɬɢɩɚ m: 1) ɨɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ p(smps|o), ɤɜɚɧɬɭɟɦɚɹ ɞɨ 40 ɡɧɚɱɟɧɢɣ; 170 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɨɞɧɨɛɢɬɨɜɵɣ ɮɥɚɝ ɪɟɡɭɥɶɬɚɬɚ ɫɪɚɜɧɟɧɢɹ ɫɪɟɞɧɟɣ ɱɚɫɬɨɬɵ ɡɚɦɚɫɤɢɪɨɜɚɧɧɵɯ ɢ ɧɟɡɚɦɚɫɤɢɪɨɜɚɧɧɵɯ ɫɢɦɜɨɥɨɜ; 3) ɨɞɧɨɛɢɬɨɜɵɣ ɮɥɚɝ, ɭɤɚɡɵɜɚɸɳɢɣ, ɱɬɨ ɬɨɥɶɤɨ ɨɞɢɧ ɫɢɦɜɨɥ ɨɫɬɚɥɫɹ ɧɟɡɚɦɚɫɤɢɪɨɜɚɧɧɵɦ; 4) ɚɧɚɥɨɝ ɩɨɥɹ 2 ɤɨɧɬɟɤɫɬɚ SSE ɞɥɹ ɄɆ ɬɢɩɚ nm (ɫɦ. ɩɪɟɞɵɞɭɳɢɣ ɫɩɢɫɨɤ); 5) ɚɧɚɥɨɝ ɩɨɥɹ 4 ɜ ɩɪɟɞɵɞɭɳɟɦ ɫɩɢɫɤɟ. Ɍɟɯɧɢɤɚ SSE ɪɚɡɪɚɛɨɬɚɧɚ ɒɤɚɪɢɧɵɦ ɢ ɢɫɩɨɥɶɡɭɟɬɫɹ ɞɥɹ ɭɬɨɱɧɟɧɢɹ ɩɪɟɞɫɤɚɡɚɧɢɹ ɇɛȼɋ ɜ ɤɨɦɩɪɟɫɫɨɪɟ PPMonstr ɜɟɪɫɢɢ H. 2)
Ɂɚɤɥɸɱɟɧɢɟ: ɉɪɢɦɟɧɟɧɢɟ SSE ɤ ɇɛȼɋ ɞɚɟɬ ɜɵɢɝɪɵɲ ɜ ɪɚɣɨɧɟ 0.5–1% ɢ ɨɫɨɛɟɧɧɨ ɩɨɥɟɡɧɨ ɩɪɢ ɫɠɚɬɢɢ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ, ɬ.ɟ. ɥɢɛɨ ɩɨɪɨɠɞɟɧɧɵɯ ɢɫɬɨɱɧɢɤɨɦ, ɛɵɫɬɪɨ ɦɟɧɹɸɳɢɦ ɫɜɨɢ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ, ɥɢɛɨ ɫɨɫɬɨɹɳɢɯ ɢɡ ɮɪɚɝɦɟɧɬɨɜ, ɫɝɟɧɟɪɢɪɨɜɚɧɧɵɯ ɫɭɳɟɫɬɜɟɧɧɨ ɨɬɥɢɱɚɸɳɢɦɢɫɹ ɢɫɬɨɱɧɢɤɚɦɢ. ɈȻɓɂɃ ɋɅɍɑȺɃ ɉɊɂɆȿɇȿɇɂə ȼɌɈɊɂɑɇɈɃ ɈɐȿɇɄɂ ɋɂɆȼɈɅȺ
ȿɫɬɟɫɬɜɟɧɧɨɣ ɹɜɥɹɟɬɫɹ ɢɞɟɹ ɩɪɢɦɟɧɟɧɢɹ SSE ɤɨ ɜɫɟɦ ɫɢɦɜɨɥɚɦ ɤɨɧɬɟɤɫɬɚ. Ⱦɟɣɫɬɜɢɬɟɥɶɧɨ, ɷɬɨɬ ɩɪɢɟɦ ɨɛɟɫɩɟɱɢɜɚɟɬ ɫɭɳɟɫɬɜɟɧɧɨɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ. Ɋɚɫɫɦɨɬɪɢɦ ɨɛɨɛɳɟɧɧɵɣ ɚɥɝɨɪɢɬɦ ɩɪɢɦɟɧɟɧɢɹ SSE ɩɨɞɪɨɛɧɟɟ6. ɉɭɫɬɶ ɫɢɦɜɨɥɵ ɄɆ ɯɪɚɧɹɬɫɹ ɜ ɜɢɞɟ ɭɩɨɪɹɞɨɱɟɧɧɨɝɨ ɫɩɢɫɤɚ, ɬɚɤ ɱɬɨ ɫɢɦɜɨɥ ɫ ɧɚɢɛɨɥɶɲɟɣ ɱɚɫɬɨɬɨɣ ɡɚɩɢɫɚɧ ɩɟɪɜɵɦ, ɬ.ɟ. ɢɦɟɟɬ ɪɚɧɝ 1. ɉɪɨɰɟɞɭɪɚ ɨɰɟɧɤɢ ɨɱɟɪɟɞɧɨɝɨ ɫɢɦɜɨɥɚ s ɩɪɢɨɛɪɟɬɚɟɬ ɜɢɞ ɰɟɩɨɱɤɢ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɵɯ ɨɰɟɧɨɤ ɚɥɶɬɟɪɧɚɬɢɜ «ɞɚ»/«ɧɟɬ»: «ɞɚ» — ɫɢɦɜɨɥ ɫ ɬɟɤɭɳɢɦ ɪɚɧɝɨɦ ɪɚɜɟɧ s, «ɧɟɬ» — ɫɢɦɜɨɥɵ ɪɚɡɥɢɱɚɸɬɫɹ, ɧɟɨɛɯɨɞɢɦɨ ɭɜɟɥɢɱɢɬɶ ɪɚɧɝ ɧɚ ɟɞɢɧɢɰɭ ɢ ɩɪɨɞɨɥɠɢɬɶ ɩɨɢɫɤ. ȼɟɪɨɹɬɧɨɫɬɶ «ɞɚ» ɞɥɹ ɪɚɧɝɚ i ɧɚɯɨɞɢɬɫɹ ɤɚɤ
6
Ⱥɥɝɨɪɢɬɦ ɪɚɡɪɚɛɨɬɚɧ ɢ ɪɟɚɥɢɡɨɜɚɧ Ⱦ.ɒɤɚɪɢɧɵɦ ɜ ɧɨɹɛɪɟ 2001 ɝɨɞɚ
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 171 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Qi (o) = q SSE ( si | o) , ɝɞɟ q SSE ( si | o) — ɨɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɚ ɫ ɪɚɧɝɨɦ i, ɩɨɥɭɱɟɧɧɚɹ ɫ ɩɨɦɨɳɶɸ SSE ɩɨɫɥɟ ɨɰɟɧɢɜɚɧɢɹ ɫɢɦɜɨɥɚ ɫ ɪɚɧɝɨɦ i–1; ɜɵɱɢɫɥɹɟɬɫɹ ɧɚ ɨɫɧɨɜɚɧɢɢ ɨɛɵɱɧɨɣ ɨɰɟɧɤɢ q( si | o ) ɢ ɡɧɚɱɟɧɢɣ wi(o) ɩɨɥɟɣ ɤɨɧɬɟɤɫɬɚ ɞɥɹ SSE. q SSE ( si | o) = SSE ( q( si | o), w1 (o), w2 (o), wP (o)) ,
q ( si | o ) =
f ( si | o ) i −1
f (o) − ƒf ( s r | o) r =1
.
ɇɚɩɪɢɦɟɪ, ɩɭɫɬɶ ɫɩɢɫɨɤ ɫɢɦɜɨɥɨɜ ɬɟɤɭɳɟɣ ɄɆ(o) ɢɦɟɟɬ ɜɢɞ ‘ɜ’, ‘ɛ’, ‘ɚ’, ‘ɝ’. ȿɫɥɢ ɨɛɪɚɛɚɬɵɜɚɟɬɫɹ ɫɢɦɜɨɥ ‘ɚ’, ɬɨ ɨɧ ɛɭɞɟɬ ɨɰɟɧɟɧ ɩɨɫɪɟɞɫɬɜɨɦ ɰɟɩɨɱɤɢ ɨɬɜɟɬɨɜ «ɧɟɬ», «ɧɟɬ», «ɞɚ» ɢ ɩɨɥɭɱɢɬ ɜɟɪɨɹɬɧɨɫɬɶ (1 – Q1(o))·(1 – Q2(o))·Q3(o). Ⱦɚɥɶɧɟɣɲɟɟ ɭɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ ɨɛɟɫɩɟɱɢɜɚɟɬɫɹ ɫɨɟɞɢɧɟɧɢɟɦ SSE ɫ ɬɟɯɧɢɤɨɣ recency scaling. ȼ ɷɬɨɦ ɫɥɭɱɚɟ ɫɢɦɜɨɥɨɦ ɫ ɪɚɧɝɨɦ 1 ɫɱɢɬɚɟɬɫɹ ɩɨɫɥɟɞɧɢɣ ɜɫɬɪɟɱɟɧɧɵɣ ɜ ɤɨɧɬɟɤɫɬɟ ɫɢɦɜɨɥ (ɉȼɋ), ɟɫɥɢ, ɤɨɧɟɱɧɨ, ɨɧ ɧɟ ɡɚɦɚɫɤɢɪɨɜɚɧ. Ɍɚɤɚɹ «ɚɞɚɩɬɚɰɢɹ ɧɨɜɢɡɧɵ» ɩɨɡɜɨɥɹɟɬ ɡɧɚɱɢɬɟɥɶɧɨ ɭɥɭɱɲɢɬɶ ɩɪɢɫɩɨɫɨɛɥɹɟɦɨɫɬɶ ɦɨɞɟɥɢ ɤ ɩɨɬɨɤɭ ɞɚɧɧɵɯ ɫ ɦɟɧɹɸɳɢɦɢɫɹ ɜɟɪɨɹɬɧɨɫɬɧɵɦɢ ɯɚɪɚɤɬɟɪɢɫɬɢɤɚɦɢ. ɉɨɥɨɠɢɬɟɥɶɧɵɣ ɷɮɮɟɤɬ ɨɛɟɫɩɟɱɢɜɚɟɬ ɜɧɟɫɟɧɢɟ ɜ ɤɨɧɬɟɤɫɬɵ ɞɥɹ SSE ɮɥɚɝɨɜ, ɭɤɚɡɵɜɚɸɳɢɯ ɧɚ ɫɨɜɩɚɞɟɧɢɟ ɉȼɋ ɬɟɤɭɳɟɝɨ ɤɨɧɬɟɤɫɬɚ ɢ ɤɨɧɬɟɤɫɬɨɜ-ɩɪɟɞɤɨɜ. Ⱥɧɚɥɨɝɢɱɧɨ, ɩɪɢɫɜɚɢɜɚɬɶ ɉȼɋ ɪɚɧɝ 1 ɥɭɱɲɟ ɬɨɥɶɤɨ ɜ ɬɨɦ ɫɥɭɱɚɟ, ɟɫɥɢ ɨɧ ɪɚɜɟɧ ɉȼɋ «ɛɥɢɠɚɣɲɢɯ» ɩɪɟɞɤɨɜ. ȼ ɬɚɛɥ. 4.7 ɩɪɢɜɟɞɟɧɨ ɫɪɚɜɧɟɧɢɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤ ɫɠɚɬɢɹ ɤɨɦɩɪɟɫɫɨɪɚ PPMonstr ɜɟɪɫɢɢ H ɢ ɟɝɨ ɦɨɞɢɮɢɤɚɰɢɢ, ɢɫɩɨɥɶɡɭɸɳɟɣ ɨɛɨɛɳɟɧɧɵɣ ɚɥɝɨɪɢɬɦ SSE ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɚɞɚɩɬɚɰɢɟɣ ɧɨɜɢɡɧɵ. ȼ ɫɪɚɜɧɟɧɢɢ ɛɵɥɢ ɢɫɩɨɥɶɡɨɜɚɧɵ ɮɚɣɥɵ ɢɡ ɧɚɛɨɪɨɜ CalgCC ɢ VYCCT. ȼɫɟ ɮɚɣɥɵ, ɡɚ ɢɫɤɥɸɱɟɧɢɟɦ ɬɟɤɫɬɨɜɨɝɨ Book1, ɫɨɞɟɪɠɚɬ ɧɟɨɞɧɨɪɨɞɧɵɟ ɛɢɧɚɪɧɵɟ ɞɚɧɧɵɟ ɢɥɢ ɫɦɟɫɶ ɬɟɤɫɬɚ ɢ ɛɢɧɚɪɧɵɯ ɞɚɧɧɵɯ. ɂɫɩɨɥɶɡɨɜɚɥɢɫɶ ɦɨɞɟɥɢ 64-ɝɨ ɩɨɪɹɞɤɚ. 172 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ɍɚɛɥɢɰɚ 4.7 ɇɚɡɜɚɧɢɟ ɮɚɣɥɚ
ɞɥɹ ɜɟɪɫɢɢ ɇ
Book1 Fileware.doc Obj2 OS2.ini Samples.xls Wcc386.exe
205144 112111 65093 94218 70912 278045
Ɋɚɡɦɟɪ ɫɠɚɬɨɝɨ ɮɚɣɥɚ, ɛɚɣɬɨɜ ɞɥɹ ɦɨɞɢɮɢɤɚɰɢɢ ɜɟɪɫɢɢ H 203669 100454 58466 83405 64666 255719
ɍɥɭɱɲɟɧɢɟ ɫɠɚɬɢɹ, %
ɉɚɞɟɧɢɟ ɫɤɨɪɨɫɬɢ ɫɠɚɬɢɹ, ɪɚɡ
0.7% 10.4% 10.2% 11.5% 8.8% 8.0%
2.0 2.5 2.1 2.2 2.0 3.3
ȼɵɜɨɞ: ɉɪɢɦɟɧɟɧɢɟ SSE ɤɨ ɜɫɟɦ ɫɢɦɜɨɥɚɦ ɤɨɧɬɟɤɫɬɚ ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɚɞɚɩɬɚɰɢɟɣ ɧɨɜɢɡɧɵ ɡɧɚɱɢɬɟɥɶɧɨ ɭɥɭɱɲɚɟɬ ɫɠɚɬɢɟ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ. ɗɬɨ ɩɨɡɜɨɥɹɟɬ ɩɨɥɭɱɚɬɶ ɫɬɚɛɢɥɶɧɨ ɧɚɢɥɭɱɲɭɸ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɞɪɭɝɢɦɢ ɭɧɢɜɟɪɫɚɥɶɧɵɦɢ ɦɟɬɨɞɚɦɢ (BWT, LZ) ɩɪɢ ɨɛɪɚɛɨɬɤɟ ɮɚɣɥɨɜ ɫɚɦɵɯ ɪɚɡɧɨɨɛɪɚɡɧɵɯ ɬɢɩɨɜ, ɚ ɧɟ ɬɨɥɶɤɨ ɬɟɤɫɬɨɜ. ɐɟɧɨɣ ɭɜɟɥɢɱɟɧɢɹ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɹɜɥɹɟɬɫɹ ɩɚɞɟɧɢɟ ɫɤɨɪɨɫɬɢ ɜ 2 ɢ ɛɨɥɟɟ ɪɚɡ
PPM ɢ PPM* ɉɪɢ ɮɢɤɫɢɪɨɜɚɧɢɢ ɦɚɤɫɢɦɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ ɤɨɧɬɟɤɫɬɨɜ ɜ ɪɚɣɨɧɟ 5–6 PPM ɞɚɠɟ ɛɟɡ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɞɚɟɬ ɨɬɥɢɱɧɵɟ ɪɟɡɭɥɶɬɚɬɵ ɧɚ ɬɟɤɫɬɚɯ, ɧɨ ɧɟ ɨɱɟɧɶ ɯɨɪɨɲɨ ɪɚɛɨɬɚɟɬ ɧɚ ɜɵɫɨɤɨ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ ɫ ɛɨɥɶɲɢɦ ɤɨɥɢɱɟɫɬɜɨɦ ɞɥɢɧɧɵɯ ɩɨɜɬɨɪɹɸɳɢɯɫɹ ɫɬɪɨɤ. ȼ ɫɟɪɟɞɢɧɟ 1990-ɯ ɝɨɞɨɜ ɛɵɥ ɩɪɟɞɥɨɠɟɧ ɦɟɬɨɞ ɛɨɪɶɛɵ ɫ ɷɬɢɦ ɧɟɞɨɫɬɚɬɤɨɦ [6]. ɉɪɟɞɥɨɠɟɧɧɵɣ ɚɥɝɨɪɢɬɦ, PPM* (ɩɪɨɢɡɧɨɫɢɬɫɹ ɤɚɤ «ɩɢ-ɩɢ-ɷɦ ɫɬɚ»), ɛɵɥ ɨɫɧɨɜɚɧ ɧɚ ɢɫɩɨɥɶɡɨɜɚɧɢɢ ɤɨɧɬɟɤɫɬɨɜ ɧɟɨɝɪɚɧɢɱɟɧɧɨɣ ɞɥɢɧɵ. Ⱥɜɬɨɪɵ ɚɥɝɨɪɢɬɦɚ ɩɪɟɞɥɨɠɢɥɢ ɫɥɟɞɭɸɳɭɸ ɫɬɪɚɬɟɝɢɸ ɜɵɛɨɪɚ ɦɚɤɫɢɦɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ ɧɚ ɤɚɠɞɨɦ ɲɚɝɟ: ɦɚɤɫɢɦɚɥɶɧɵɣ ɩɨɪɹɞɨɤ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɩɨɪɹɞɤɭ ɫɚɦɨɝɨ ɤɨɪɨɬɤɨɝɨ ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɨɝɨ ɤɨɧɬɟɤɫɬɚ. ɉɨɞ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 173 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɵɦ ɩɨɧɢɦɚɟɬɫɹ ɤɨɧɬɟɤɫɬ, ɜ ɤɨɬɨɪɨɦ ɞɨ ɞɚɧɧɨɝɨ ɦɨɦɟɧɬɚ ɜɫɬɪɟɱɚɥɫɹ ɬɨɥɶɤɨ ɨɞɢɧ ɫɢɦɜɨɥ (ɥɸɛɨɟ ɱɢɫɥɨ ɪɚɡ). ȿɫɥɢ ɞɟɬɟɪɦɢɧɢɪɨɜɚɧɧɵɯ ɤɨɧɬɟɤɫɬɨɜ ɧɟɬ, ɬɨ ɜɵɛɢɪɚɟɬɫɹ ɫɚɦɵɣ ɞɥɢɧɧɵɣ ɫɪɟɞɢ ɢɦɟɸɳɢɯɫɹ. ɉɨɫɥɟ ɜɵɛɨɪɚ ɦɚɤɫɢɦɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ ɩɪɨɰɟɞɭɪɚ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɚ ɜ ɚɥɝɨɪɢɬɦɟ PPM* ɧɢɱɟɦ ɧɟ ɨɬɥɢɱɚɟɬɫɹ ɨɬ ɩɪɢɦɟɧɹɟɦɨɣ ɜ ɚɥɝɨɪɢɬɦɚɯ ɨɛɵɱɧɨɝɨ PPM, ɬ.ɟ. PPM-ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɨɝɪɚɧɢɱɟɧɧɨɝɨ ɩɨɪɹɞɤɚ. Ɋɟɚɥɢɡɚɰɢɹ PPM*, ɨɩɢɫɚɧɧɚɹ ɜ [6], ɢɦɟɥɚ ɧɟ ɜɩɟɱɚɬɥɹɸɳɢɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ: ɫɠɚɬɢɟ ɧɚ ɭɪɨɜɧɟ PPMC ɩɨɪɹɞɤɚ 5, ɫɤɨɪɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ, ɤɚɤ ɭɬɜɟɪɠɞɚɟɬɫɹ, ɬɚɤɠɟ ɫɨɩɨɫɬɚɜɢɦɚ, ɧɨ ɩɚɦɹɬɢ ɪɚɫɯɨɞɭɟɬɫɹ ɡɧɚɱɢɬɟɥɶɧɨ ɛɨɥɶɲɟ. ɋɭɞɹ ɩɨ ɜɫɟɦɭ, ɚɜɬɨɪɚɦ ɨɱɟɧɶ ɯɨɬɟɥɨɫɶ ɞɨɤɚɡɚɬɶ ɩɪɟɜɨɫɯɨɞɫɬɜɨ ɢɯ ɫɯɟɦɵ ɧɚɞ ɞɪɭɝɢɦɢ ɦɟɬɨɞɚɦɢ PPM ɢ ɫɬɚɧɞɚɪɬɧɵɦ PPMC ɜ ɱɚɫɬɧɨɫɬɢ, ɧɚɥɢɱɢɟ ɤɨɬɨɪɨɝɨ ɜɟɫɶɦɚ ɫɨɦɧɢɬɟɥɶɧɨ. ɑɢɬɚɬɟɥɶ ɦɨɠɟɬ ɫɚɦɨɫɬɨɹɬɟɥɶɧɨ ɫɪɚɜɧɢɬɶ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ PPM* ɫ ɞɪɭɝɢɦɢ ɚɥɝɨɪɢɬɦɚɦɢ PPM, ɩɨɥɶɡɭɹɫɶ ɬɚɛɥ. 4.8 ɢ 4.9. ȼ ɩɪɢɧɰɢɩɟ, ɪɚɫɯɨɞɵ ɩɚɦɹɬɢ ɞɥɹ PPM ɢ PPM* ɦɨɝɭɬ ɛɵɬɶ ɨɞɢɧɚɤɨɜɵ, ɱɬɨ ɩɨɤɚɡɚɧɨ ɜ [4]. ȼɵɜɨɞ: ɉɪɟɢɦɭɳɟɫɬɜɨ ɩɨɞɯɨɞɚ PPM* ɧɚɞ ɨɛɵɱɧɵɦ PPM ɧɟ ɨɱɟɜɢɞɧɨ
Ⱦɨɫɬɨɢɧɫɬɜɚ ɢ ɧɟɞɨɫɬɚɬɤɢ PPM ȼɨɬ ɭɠɟ ɜ ɬɟɱɟɧɢɟ ɩɨɥɭɬɨɪɚ ɞɟɫɹɬɤɨɜ ɥɟɬ ɩɪɟɞɫɬɚɜɢɬɟɥɢ ɫɟɦɟɣɫɬɜɚ PPM ɨɫɬɚɸɬɫɹ ɧɚɢɛɨɥɟɟ ɦɨɳɧɵɦɢ ɩɪɚɤɬɢɱɟɫɤɢɦɢ ɚɥɝɨɪɢɬɦɚɦɢ ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. ɉɨ-ɜɢɞɢɦɨɦɭ, ɞɨɛɢɬɶɫɹ ɥɭɱɲɢɯ ɪɟɡɭɥɶɬɚɬɨɜ ɫɦɨɝɭɬ ɬɨɥɶɤɨ ɛɨɥɟɟ ɢɡɨɳɪɟɧɧɵɟ ɤɨɧɬɟɤɫɬɧɵɟ (ɜ ɲɢɪɨɤɨɦ ɫɦɵɫɥɟ) ɦɟɬɨɞɵ, ɤɨɬɨɪɵɟ, ɧɟɫɨɦɧɟɧɧɨ, ɛɭɞɭɬ ɩɨɹɜɥɹɬɶɫɹ, ɬɚɤ ɤɚɤ ɩɪɨɢɡɜɨɞɹɬɫɹ ɜɫɟ ɛɨɥɟɟ ɛɵɫɬɪɵɟ ɩɪɨɰɟɫɫɨɪɵ, ɚ ɨɛɴɟɦ ɨɩɟɪɚɬɢɜɧɨɣ ɩɚɦɹɬɢ ɗȼɆ ɫɬɚɧɨɜɢɬɫɹ ɜɫɟ ɛɨɥɶɲɟ. ɇɚɢɥɭɱɲɢɟ ɪɟɡɭɥɶɬɚɬɵ ɚɥɝɨɪɢɬɦɵ PPM ɩɨɤɚɡɵɜɚɸɬ ɧɚ ɬɟɤɫɬɚɯ: ɨɬɥɢɱɧɵɣ ɤɨɷɮɮɢɰɢɟɧɬ ɫɠɚɬɢɹ ɩɪɢ ɜɵɫɨɤɨɣ ɫɤɨɪɨɫɬɢ, ɱɟɦɭ ɧɚɝɥɹɞɧɵɦ ɩɪɢɦɟɪɨɦ ɹɜɥɹɸɬɫɹ ɤɨɦɩɪɟɫɫɨɪɵ PPMd ɢ 174 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
PPMonstr. Ʉɪɨɦɟ ɬɨɝɨ, ɟɫɥɢ ɫɬɨɢɬ ɡɚɞɚɱɚ ɦɚɤɫɢɦɢɡɚɰɢɢ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɨɩɪɟɞɟɥɟɧɧɵɯ ɞɚɧɧɵɯ, ɬɨ, ɫɤɨɪɟɟ ɜɫɟɝɨ, PPM-ɩɨɞɨɛɧɵɣ ɚɥɝɨɪɢɬɦ ɛɭɞɟɬ ɧɚɢɥɭɱɲɢɦ ɜɵɛɨɪɨɦ ɜ ɤɚɱɟɫɬɜɟ ɨɫɧɨɜɵ ɫɩɟɰɢɚɥɢɡɢɪɨɜɚɧɧɨɝɨ ɤɨɦɩɪɟɫɫɨɪɚ. ȿɫɥɢ ɜɵɣɬɢ ɡɚ ɪɚɦɤɢ ɱɚɫɬɧɨɣ ɩɪɨɛɥɟɦɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ, ɬɨ ɧɟɫɨɦɧɟɧɧɵɦ ɞɨɫɬɨɢɧɫɬɜɨɦ PPM ɹɜɥɹɟɬɫɹ ɜɨɡɦɨɠɧɨɫɬɶ ɩɨɥɭɱɟɧɢɹ ɯɨɪɨɲɟɣ ɫɬɚɬɢɫɬɢɱɟɫɤɨɣ ɦɨɞɟɥɢ ɨɛɪɚɛɨɬɚɧɧɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɤɚɱɟɫɬɜɟɧɧɵɯ ɞɚɧɧɵɯ (ɢɥɢ ɫɝɟɧɟɪɢɪɨɜɚɜɲɟɝɨ ɟɟ ɢɫɬɨɱɧɢɤɚ). Ⱦɟɣɫɬɜɢɬɟɥɶɧɨ, ɦɨɞɟɥɶ, ɩɨɡɜɨɥɹɸɳɭɸ ɷɮɮɟɤɬɢɜɧɨ ɩɪɟɞɫɤɚɡɵɜɚɬɶ ɧɟɢɡɜɟɫɬɧɵɟ ɫɢɦɜɨɥɵ ɫɨɨɛɳɟɧɢɹ, ɦɨɠɧɨ ɩɪɢɦɟɧɹɬɶ ɧɟ ɬɨɥɶɤɨ ɞɥɹ ɫɠɚɬɢɹ, ɧɨ ɢ ɞɥɹ ɪɟɲɟɧɢɹ ɡɚɞɚɱ ɤɨɪɪɟɤɰɢɢ ɬɟɤɫɬɚ ɜ ɫɢɫɬɟɦɚɯ OCR, ɪɚɫɩɨɡɧɚɜɚɧɢɹ ɪɟɱɢ, ɤɥɚɫɫɢɮɢɤɚɰɢɢ ɬɢɩɚ ɬɟɤɫɬɚ, ɫɟɦɚɧɬɢɱɟɫɤɨɝɨ ɚɧɚɥɢɡɚ ɬɟɤɫɬɚ, ɲɢɮɪɨɜɚɧɢɹ [18]. ɇɟɞɨɫɬɚɬɤɢ ɪɟɚɥɢɡɚɰɢɣ ɩɨɞɯɨɞɚ PPM ɡɚɤɥɸɱɚɸɬɫɹ ɜ ɫɥɟɞɭɸɳɟɦ: • ɦɟɞɥɟɧɧɨɟ ɞɟɤɨɞɢɪɨɜɚɧɢɟ (ɨɛɵɱɧɨ ɧɚ 5–10% ɦɟɞɥɟɧɧɟɟ ɤɨɞɢɪɨɜɚɧɢɹ); • ɧɟɫɨɜɦɟɫɬɢɦɨɫɬɶ ɤɨɞɟɪɚ ɢ ɞɟɤɨɞɟɪɚ ɜ ɫɥɭɱɚɟ ɢɡɦɟɧɟɧɢɹ ɚɥɝɨɪɢɬɦɚ ɨɰɟɧɤɢ; ɜ ɬɨ ɠɟ ɜɪɟɦɹ ɚɥɝɨɪɢɬɦɵ ɫɟɦɟɣɫɬɜɚ LZ77 ɞɨɩɭɫɤɚɸɬ ɫɟɪɶɟɡɧɭɸ ɦɨɞɢɮɢɤɚɰɢɸ ɤɨɞɟɪɚ ɛɟɡ ɧɟɨɛɯɨɞɢɦɨɫɬɢ ɢɫɩɪɚɜɥɟɧɢɹ ɞɟɤɨɞɟɪɚ; • ɦɟɞɥɟɧɧɚɹ ɨɛɪɚɛɨɬɤɚ ɦɚɥɨ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ (ɫɤɨɪɨɫɬɶ ɦɨɠɟɬ ɩɚɞɚɬɶ ɜ ɪɚɡɵ); • ɧɚɢɥɭɱɲɟɟ ɫɠɚɬɢɟ ɪɚɡɥɢɱɧɵɯ ɮɚɣɥɨɜ ɞɨɫɬɢɝɚɟɬɫɹ ɩɪɢ ɩɨɪɹɞɤɚɯ ɦɨɞɟɥɢ PPM ɜ ɪɚɣɨɧɟ 4…12 ɞɥɹ ɦɨɞɟɥɟɣ, ɧɟ ɩɪɢɦɟɧɹɸɳɢɯ ɬɟɯɧɢɤɭ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɢ/ɢɥɢ LOE, ɢ ɩɪɢ ɩɨɪɹɞɤɚɯ 16…32 ɜ ɩɪɨɬɢɜɧɨɦ ɫɥɭɱɚɟ; ɩɨɷɬɨɦɭ ɩɪɢ ɜɵɛɨɪɟ ɤɚɤɨɝɨ-ɬɨ ɮɢɤɫɢɪɨɜɚɧɧɨɝɨ ɩɨɪɹɞɤɚ ɦɨɞɟɥɢ ɦɵ ɦɨɠɟɦ ɬɟɪɹɬɶ ɥɢɛɨ ɜ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ, ɥɢɛɨ ɢɫɩɨɥɶɡɨɜɚɬɶ ɱɟɪɟɫɱɭɪ ɦɧɨɝɨ ɪɟɫɭɪɫɨɜ ɗȼɆ; • ɜ ɨɛɳɟɦ ɫɥɭɱɚɟ ɧɟɞɨɫɬɚɬɨɱɧɨ ɯɨɪɨɲɟɟ ɫɠɚɬɢɟ ɮɚɣɥɨɜ, ɫɬɚɬɢɫɬɢɱɟɫɤɢɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɤɨɬɨɪɵɯ ɩɨɞɜɟɪɠɟɧɵ ɱɚɫɬɵɦ ɢɡɦɟɧɟɧɢɹɦ ɬɚɤɨɝɨ ɬɢɩɚ, ɱɬɨ ɨɰɟɧɤɢ ɪɚɫɩɪɟɞɟɥɟɧɢɣ ɜɟɪɨɹɬɧɨɫɬɟɣ ɜ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ ɛɵɫɬɪɨ ɭɫɬɚɪɟɜɚɸɬ (ɬɚɤ ɧɚɡɵɜɚɟɦɚɹ ɧɟɫɬɚɛɢɥɶɧɨɫɬɶ ɫɬɚɬɢɫɬɢɤ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 175 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɤɨɧɬɟɤɫɬɨɜ); ɫ ɬɨɱɤɢ ɡɪɟɧɢɹ ɬɚɤɨɣ ɚɞɚɩɬɚɰɢɢ ɨɛɵɱɧɵɟ ɚɥɝɨɪɢɬɦɵ PPM ɭɫɬɭɩɚɸɬ ɚɥɝɨɪɢɬɦɚɦ ɬɢɩɚ LZ77, ɯɨɬɹ ɢɡɜɟɫɬɧɵ ɫɩɨɫɨɛɵ ɨɫɥɚɛɥɟɧɢɹ ɢɥɢ, ɜɨɨɛɳɟ, ɭɫɬɪɚɧɟɧɢɹ ɷɬɨɝɨ ɧɟɩɪɢɹɬɧɨɝɨ ɷɮɮɟɤɬɚ (ɫɦ. ɩɨɞɩɭɧɤɬ «Ɉɛɳɢɣ ɫɥɭɱɚɣ ɩɪɢɦɟɧɟɧɢɹ ɜɬɨɪɢɱɧɨɣ ɨɰɟɧɤɢ ɫɢɦɜɨɥɚ»); • ɛɨɥɶɲɢɟ ɡɚɩɪɨɫɵ ɩɚɦɹɬɢ — ɞɟɫɹɬɤɢ ɦɟɝɚɛɚɣɬɨɜ — ɜ ɫɥɭɱɚɟ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɫɥɨɠɧɵɯ ɦɨɞɟɥɟɣ ɜɵɫɨɤɨɝɨ ɩɨɪɹɞɤɚ ɜ ɫɨɱɟɬɚɧɢɢ ɫ ɫɢɦɦɟɬɪɢɱɧɨɫɬɶɸ ɚɥɝɨɪɢɬɦɚ ɩɪɟɩɹɬɫɬɜɭɸɬ ɨɪɝɚɧɢɡɚɰɢɢ ɷɮɮɟɤɬɢɜɧɨɝɨ ɞɨɫɬɭɩɚ ɤ ɫɠɚɬɵɦ ɞɚɧɧɵɦ; • ɡɚɦɟɬɧɵɣ ɩɪɨɢɝɪɵɲ ɜ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɚɥɝɨɪɢɬɦɚɦɢ ɬɢɩɚ LZ77 ɩɪɢ ɫɠɚɬɢɢ ɮɚɣɥɨɜ, ɢɦɟɸɳɢɯ ɞɥɢɧɧɵɟ ɩɨɜɬɨɪɹɸɳɢɟɫɹ ɛɥɨɤɢ ɫɢɦɜɨɥɨɜ. ɉɪɚɤɬɢɱɟɫɤɢ ɜɫɟɝɞɚ ɦɨɠɧɨ ɩɨɞɨɛɪɚɬɶ ɢ ɧɚɫɬɪɨɢɬɶ ɬɚɤɭɸ PPM-ɦɨɞɟɥɶ, ɢɥɢ, ɬɨɱɧɟɟ, ɤɨɧɬɟɤɫɬɧɭɸ ɦɨɞɟɥɶ ɫ ɧɟɹɜɧɵɦ ɜɡɜɟɲɢɜɚɧɢɟɦ, ɱɬɨ ɨɧɚ ɛɭɞɟɬ ɞɚɜɚɬɶ ɥɭɱɲɟɟ ɫɠɚɬɢɟ, ɱɟɦ LZ ɢɥɢ BWT. ɇɟɫɦɨɬɪɹ ɧɚ ɷɬɨ, ɩɪɢɦɟɧɟɧɢɟ PPM-ɤɨɦɩɪɟɫɫɨɪɨɜ ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɝɥɚɜɧɵɦ ɨɛɪɚɡɨɦ ɞɥɹ ɫɠɚɬɢɹ ɬɟɤɫɬɨɜ ɧɚ ɟɫɬɟɫɬɜɟɧɧɵɯ ɹɡɵɤɚɯ ɢ ɩɨɞɨɛɧɵɯ ɢɦ ɞɚɧɧɵɯ, ɩɨɫɤɨɥɶɤɭ ɩɪɢ ɨɛɪɚɛɨɬɤɟ ɦɚɥɨɢɡɛɵɬɨɱɧɵɯ ɮɚɣɥɨɜ ɜɟɥɢɤɢ ɜɪɟɦɟɧɧɵɟ ɡɚɬɪɚɬɵ. ɂɡɛɵɬɨɱɧɵɟ ɮɚɣɥɵ ɫ ɞɥɢɧɧɵɦɢ ɩɨɜɬɨɪɹɸɳɢɦɢɫɹ ɫɬɪɨɤɚɦɢ (ɧɚɩɪɢɦɟɪ, ɬɟɤɫɬɵ ɩɪɨɝɪɚɦɦ) ɢɦɟɟɬ ɫɦɵɫɥ ɫɠɢɦɚɬɶ ɫ ɩɨɦɨɳɶɸ BWTɤɨɦɩɪɟɫɫɨɪɨɜ ɢ ɞɚɠɟ ɫɥɨɜɚɪɧɵɯ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɬɚɤ ɤɚɤ ɫɨɨɬɧɨɲɟɧɢɟ ɫɠɚɬɢɟ-ɫɤɨɪɨɫɬɶ-ɩɚɦɹɬɶ ɨɛɵɱɧɨ ɥɭɱɲɟ. Ⱦɥɹ ɫɢɥɶɧɨ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ ɩɪɟɞɩɨɱɬɢɬɟɥɶɧɟɟ ɜɫɟ-ɬɚɤɢ ɢɫɩɨɥɶɡɨɜɚɬɶ PPM, ɬɚɤ ɤɚɤ ɦɟɬɨɞɵ LZ ɢ BWT, ɨɫɨɛɟɧɧɨ ɧɟ ɢɫɩɨɥɶɡɭɸɳɢɟ ɩɪɟɞɨɛɪɚɛɨɬɤɭ, ɪɚɛɨɬɚɸɬ ɩɪɢ ɷɬɨɦ ɫɪɚɜɧɢɬɟɥɶɧɨ ɦɟɞɥɟɧɧɨ ɢɡ-ɡɚ ɞɟɝɪɚɞɚɰɢɢ ɫɬɪɭɤɬɭɪ ɞɚɧɧɵɯ. ɏɚɪɚɤɬɟɪɢɫɬɢɤɢ ɚɥɝɨɪɢɬɦɨɜ ɫɟɦɟɣɫɬɜɚ PPM: ɋɬɟɩɟɧɢ ɫɠɚɬɢɹ: ɨɩɪɟɞɟɥɹɸɬɫɹ ɞɚɧɧɵɦɢ, ɞɥɹ ɬɟɤɫɬɨɜ ɨɛɵɱɧɨ 3–4, ɞɥɹ ɨɛɴɟɤɬɧɵɯ ɮɚɣɥɨɜ 2–3. Ɍɢɩɵ ɞɚɧɧɵɯ: ɚɥɝɨɪɢɬɦɵ ɭɧɢɜɟɪɫɚɥɶɧɵ, ɧɨ ɥɭɱɲɟ ɜɫɟɝɨ ɩɨɞɯɨɞɹɬ ɞɥɹ ɫɠɚɬɢɹ ɬɟɤɫɬɨɜ. 176 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɋɢɦɦɟɬɪɢɱɧɨɫɬɶ: ɛɥɢɡɤɚ ɤ 1; ɨɛɵɱɧɨ ɞɟɤɨɞɟɪ ɧɟɦɧɨɝɨ ɦɟɞɥɟɧɧɟɟ ɤɨɞɟɪɚ. ɏɚɪɚɤɬɟɪɧɵɟ ɨɫɨɛɟɧɧɨɫɬɢ: ɦɟɞɥɟɧɧɚɹ ɨɛɪɚɛɨɬɤɚ ɦɚɥɨ ɢɡɛɵɬɨɱɧɵɯ ɞɚɧɧɵɯ.
Ʉɨɦɩɪɟɫɫɨɪɵ ɢ ɚɪɯɢɜɚɬɨɪɵ, ɢɫɩɨɥɶɡɭɸɳɢɟ ɤɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ HA
ɉɪɨɝɪɚɦɦɚ HA ɹɜɢɥɚɫɶ, ɩɨɠɚɥɭɣ, ɩɟɪɜɵɦ ɩɭɛɥɢɱɧɨ ɞɨɫɬɭɩɧɵɦ ɚɪɯɢɜɚɬɨɪɨɦ, ɢɫɩɨɥɶɡɭɸɳɢɦ ɤɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ. ɇɟ ɢɫɤɥɸɱɟɧɨ, ɱɬɨ HA ɫɬɚɥ ɛɵ ɨɱɟɧɶ ɩɨɩɭɥɹɪɧɵɦ ɚɪɯɢɜɚɬɨɪɨɦ, ɟɫɥɢ ɛɵ ɟɝɨ ɚɜɬɨɪ, Ƚɚɪɪɢ ɏɢɪɜɨɥɚ (Hirvola), ɧɟ ɩɪɟɤɪɚɬɢɥ ɪɚɛɨɬɚɬɶ ɧɚɞ ɩɪɨɟɤɬɨɦ. ȼ HA ɪɟɚɥɢɡɨɜɚɧɵ ɚɥɝɨɪɢɬɦ ɫɟɦɟɣɫɬɜɚ LZ77 ɢ ɚɥɝɨɪɢɬɦ ɬɢɩɚ PPM. Ⱥɥɝɨɪɢɬɦ PPM ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɯɨɪɨɲɨ ɩɪɨɞɭɦɚɧɧɭɸ ɦɨɞɢɮɢɤɚɰɢɸ ɤɥɚɫɫɢɱɟɫɤɨɝɨ PPMC. Ɇɟɬɨɞ Ɉȼɍ ɹɜɥɹɟɬɫɹ ɚɩɪɢɨɪɧɵɦ ɢ ɨɫɧɨɜɵɜɚɟɬ ɨɰɟɧɤɭ ɭɯɨɞɚ ɢɡ ɄɆ ɧɚ ɤɨɥɢɱɟɫɬɜɟ ɢɦɟɸɳɢɯɫɹ ɜ ɧɟɣ ɫɢɦɜɨɥɨɜ ɫ ɧɟɛɨɥɶɲɨɣ ɱɚɫɬɨɬɨɣ. LOE ɧɟ ɩɪɨɢɡɜɨɞɢɬɫɹ, ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɫɩɭɫɤɚ ɫ ɄɆ ɜɵɫɨɤɢɯ ɩɨɪɹɞɤɨɜ ɹɜɥɹɟɬɫɹ ɨɛɵɱɧɨɣ. Ɇɚɤɫɢɦɚɥɶɧɵɣ ɩɨɪɹɞɨɤ ɄɆ ɪɚɜɟɧ 4, ɦɢɧɢɦɚɥɶɧɵɣ — ɦɢɧɭɫ ɟɞɢɧɢɰɟ. Ⱦɥɹ ɨɪɝɚɧɢɡɚɰɢɢ ɩɨɢɫɤɚ ɄɆ ɩɪɢɦɟɧɹɸɬɫɹ ɯɟɲ-ɰɟɩɨɱɤɢ. ɏɟɲɢɪɨɜɚɧɢɟ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɩɨ ɫɢɦɜɨɥɚɦ ɤɨɧɬɟɤɫɬɚ ɢ ɟɝɨ ɞɥɢɧɟ. Ɋɟɡɭɥɶɬɚɬɵ ɬɟɫɬɢɪɨɜɚɧɢɹ ɧɚ CalgCC, ɩɪɟɞɫɬɚɜɥɟɧɧɵɟ ɜ ɬɚɛɥ. 4.8, ɩɨɥɭɱɟɧɵ ɞɥɹ ɜɟɪɫɢɢ 0.999c. ɋɠɚɬɢɟ ɮɚɣɥɨɜ ɨɫɭɳɟɫɬɜɥɹɥɨɫɶ ɫ ɩɨɦɨɳɶɸ ɦɟɬɨɞɚ 2 ɩɪɨɝɪɚɦɦɵ, ɤɨɬɨɪɵɣ ɤɚɤ ɪɚɡ ɢ ɫɨɨɬɜɟɬɫɬɜɭɟɬ PPM. Ⱥɪɯɢɜɚɬɨɪ ɪɚɡɪɚɛɚɬɵɜɚɥɫɹ ɞɥɹ ɪɚɛɨɬɵ ɜ MS DOS, ɢ ɪɚɡɦɟɪ ɢɫɩɨɥɶɡɭɟɦɨɣ ɩɚɦɹɬɢ ɨɝɪɚɧɢɱɟɧ ɩɪɢɦɟɪɧɨ 400 ɤɛɚɣɬ, ɱɬɨ, ɜɨɨɛɳɟ ɝɨɜɨɪɹ, ɦɚɥɨ ɞɥɹ ɦɨɞɟɥɢ 4 ɩɨɪɹɞɤɚ, ɩɨɷɬɨɦɭ ɫɠɚɬɢɟ ɦɨɠɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 177 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɧɨ ɫɭɳɟɫɬɜɟɧɧɨ ɭɥɭɱɲɢɬɶ ɡɚ ɫɱɟɬ ɭɜɟɥɢɱɟɧɢɹ ɨɛɴɟɦɚ ɞɨɫɬɭɩɧɨɣ ɩɚɦɹɬɢ. CM
CM Ȼɭɥɚɬɚ Ɂɢɝɚɧɲɢɧɚ (Ziganshin) ɹɜɥɹɟɬɫɹ ɤɨɦɩɪɟɫɫɨɪɨɦ, ɩɪɢɦɟɧɹɸɳɢɦ ɛɥɨɱɧɨ-ɚɞɚɩɬɢɜɧɨɟ ɤɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ. Ⱥɥɝɨɪɢɬɦ ɪɚɛɨɬɵ ɤɨɞɟɪɚ ɫɥɟɞɭɸɳɢɣ. ɑɢɬɚɟɬɫɹ ɛɥɨɤ ɜɯɨɞɧɵɯ ɞɚɧɧɵɯ, ɩɨ ɭɦɨɥɱɚɧɢɸ ɞɨ 1 Ɇɛɚɣɬ, ɢ ɧɚ ɨɫɧɨɜɚɧɢɢ ɟɝɨ ɫɬɚɬɢɫɬɢɤɢ ɫɬɪɨɢɬɫɹ ɦɨɞɟɥɶ ɡɚɞɚɧɧɨɝɨ ɩɨɪɹɞɤɚ N. Ɇɨɞɟɥɶ ɫɨɯɪɚɧɹɟɬɫɹ ɜ ɤɨɦɩɚɤɬɧɨɦ ɜɢɞɟ ɜ ɜɵɯɨɞɧɨɦ ɮɚɣɥɟ, ɩɨɫɥɟ ɱɟɝɨ ɫ ɟɟ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ ɤɨɞɢɪɭɟɬɫɹ ɫɚɦ ɫɱɢɬɚɧɧɵɣ ɛɥɨɤ ɞɚɧɧɵɯ. Ɂɚɬɟɦ, ɟɫɥɢ ɟɳɟ ɧɟ ɜɟɫɶ ɜɯɨɞɧɨɣ ɮɚɣɥ ɨɛɪɚɛɨɬɚɧ, ɩɪɨɢɡɜɨɞɹɬɫɹ ɚɧɚɥɨɝɢɱɧɵɟ ɞɟɣɫɬɜɢɹ ɞɥɹ ɫɥɟɞɭɸɳɟɝɨ ɛɥɨɤɚ ɢ ɬ.ɞ. ɂɞɟɹ ɩɨɫɬɪɨɟɧɢɹ ɦɨɞɟɥɢ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɫɥɟɞɭɸɳɟɦ: • ɩɟɪɜɨɧɚɱɚɥɶɧɨ ɫɬɪɨɢɬɫɹ ɦɨɞɟɥɶ ɩɨɪɹɞɤɚ N, ɫɨɞɟɪɠɚɳɚɹ ɫɬɚɬɢɫɬɢɤɭ ɞɥɹ ɜɫɟɯ ɜɫɬɪɟɱɟɧɧɵɯ ɜ ɛɥɨɤɟ ɤɨɧɬɟɤɫɬɨɜ ɞɥɢɧɨɣ ɨɬ 0 ɞɨ N; • ɢɡ ɦɨɞɟɥɢ ɭɞɚɥɹɸɬɫɹ ɤɨɧɬɟɤɫɬɧɵɟ ɦɨɞɟɥɢ ɢ ɫɱɟɬɱɢɤɢ ɫɢɦɜɨɥɨɜ ɫ ɱɚɫɬɨɬɨɣ ɦɟɧɶɲɟ ɩɨɪɨɝɚ fmin, ɹɜɥɹɸɳɟɝɨɫɹ ɩɚɪɚɦɟɬɪɨɦ ɚɥɝɨɪɢɬɦɚ. Ⱦɟɪɟɜɨ ɨɫɬɚɜɲɢɯɫɹ ɄɆ ɡɚɩɢɫɵɜɚɟɬɫɹ ɜ ɜɵɯɨɞɧɨɣ ɮɚɣɥ, ɩɪɢ ɷɬɨɦ ɨɩɢɫɚɧɢɹ ɫɢɦɜɨɥɨɜ ɢ ɢɯ ɱɚɫɬɨɬ ɜ ɨɩɪɟɞɟɥɟɧɧɵɯ ɄɆ ɫɠɢɦɚɸɬɫɹ ɧɚ ɨɫɧɨɜɚɧɢɢ ɢɧɮɨɪɦɚɰɢɢ ɄɆ-ɩɪɟɞɤɨɜ. Ɉɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ ɢɡ ɄɆ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɫɚɦɢɯ ɞɚɧɧɵɯ ɡɚɜɢɫɢɬ ɨɬ ɤɨɥɢɱɟɫɬɜɚ ɟɟ ɞɨɱɟɪɧɢɯ ɄɆ, ɭɞɚɥɟɧɧɵɯ ɩɪɢ «ɩɪɨɱɢɫɬɤɟ» ɦɨɞɟɥɢ. ɋɨɛɫɬɜɟɧɧɨ ɚɥɝɨɪɢɬɦ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɨɜ ɧɟ ɨɬɥɢɱɚɟɬɫɹ ɨɬ ɤɥɚɫɫɢɱɟɫɤɨɝɨ PPM. ɉɪɨɝɪɚɦɦɚ ɧɚɩɢɫɚɧɚ ɞɨɫɬɚɬɨɱɧɨ ɞɚɜɧɨ ɢ ɧɟ ɨɬɜɟɱɚɟɬ ɫɨɜɪɟɦɟɧɧɵɦ ɬɪɟɛɨɜɚɧɢɹɦ ɧɚ ɫɨɨɬɧɨɲɟɧɢɟ ɫɤɨɪɨɫɬɢ ɢ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. Ɍɟɦ ɧɟ ɦɟɧɟɟ, CM ɞɟɦɨɧɫɬɪɢɪɭɟɬ ɢɧɬɟɪɟɫɧɵɣ ɩɨɞɯɨɞ, ɢ ɩɪɢ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɞɨɪɚɛɨɬɤɟ ɩɪɚɤɬɢɱɟɫɤɨɟ ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɬɚɤɨɣ ɬɟɯɧɢɤɢ ɦɨɠɟɬ ɛɵɬɶ ɰɟɥɟɫɨɨɛɪɚɡɧɨ. ɏɚɪɚɤɬɟɪɢɫɬɢɤɢ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɤɨɦɩɪɟɫɫɨɪɚ, ɩɪɢɜɟɞɟɧɧɵɟ ɜ ɬɚɛɥ. 4.8, ɛɵɥɢ ɩɨɥɭɱɟɧɵ ɩɪɢ ɡɚɩɭɫɤɟ ɩɪɨɝɪɚɦɦɵ ɫ ɩɚɪɚɦɟɬɪɚɦɢ –o4 ɢ –m10000000, ɬ.ɟ. ɛɵɥ ɡɚɞɚɧ ɩɨɪɹɞɨɤ N = 4, ɚ ɦɚɤɫɢɦɚɥɶ178 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɧɵɣ ɨɛɴɟɦ ɩɚɦɹɬɢ ɞɥɹ ɯɪɚɧɟɧɢɹ ɦɨɞɟɥɢ ɛɵɥ ɭɜɟɥɢɱɟɧ ɫ 5 Ɇɛɚɣɬ, ɢɫɩɨɥɶɡɭɟɦɵɯ ɩɨ ɭɦɨɥɱɚɧɢɸ, ɞɨ 10 Ɇɛɚɣɬ, ɱɬɨ ɨɛɟɫɩɟɱɢɥɨ ɨɬɫɭɬɫɬɜɢɟ ɩɟɪɟɩɨɥɧɟɧɢɹ ɩɪɢ ɨɛɪɚɛɨɬɤɟ ɜɫɟɯ ɮɚɣɥɨɜ CalgCC. RK ɂ RKUC
ɋ ɬɨɱɤɢ ɡɪɟɧɢɹ ɤɨɷɮɮɢɰɢɟɧɬɚ ɫɠɚɬɢɹ, ɪɚɡɪɚɛɚɬɵɜɚɟɦɵɣ Ɇɚɥɶɤɨɥɶɦɨɦ Ɍɟɣɥɨɪɨɦ (Taylor) ɚɪɯɢɜɚɬɨɪ RK ɹɜɥɹɟɬɫɹ ɥɭɱɲɢɦ ɫɪɟɞɢ ɫɭɳɟɫɬɜɭɸɳɢɯ ɧɚ ɦɨɦɟɧɬ ɧɚɩɢɫɚɧɢɹ ɷɬɨɣ ɤɧɢɝɢ. ɇɨ ɞɨɫɬɢɝɚɟɬɫɹ ɷɬɨ ɧɟ ɫɬɨɥɶɤɨ ɡɚ ɫɱɟɬ ɨɱɟɧɶ ɯɨɪɨɲɟɝɨ PPMɤɨɦɩɪɟɫɫɨɪɚ, ɫɤɨɥɶɤɨ ɛɥɚɝɨɞɚɪɹ ɛɨɥɶɲɨɦɭ ɤɨɥɢɱɟɫɬɜɭ ɩɪɢɦɟɧɹɟɦɵɯ ɬɟɯɧɢɤ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɝɨ ɩɪɟɨɛɪɚɡɨɜɚɧɢɹ ɞɚɧɧɵɯ, ɩɨɡɜɨɥɹɸɳɢɯ ɡɧɚɱɢɬɟɥɶɧɨ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɮɚɣɥɨɜ ɨɩɪɟɞɟɥɟɧɧɵɯ ɬɢɩɨɜ. ɂɦɟɧɧɨ ɝɪɚɦɨɬɧɨ ɪɟɚɥɢɡɨɜɚɧɧɵɣ ɩɪɟɩɪɨɰɟɫɫɢɧɝ ɢ ɩɨɡɜɨɥɹɟɬ ɩɨɤɚɡɵɜɚɬɶ RK ɫɬɚɛɢɥɶɧɨ ɯɨɪɨɲɢɟ ɪɟɡɭɥɶɬɚɬɵ ɩɪɢ ɫɠɚɬɢɢ ɬɚɤɢɯ ɬɢɩɨɜɵɯ ɞɚɧɧɵɯ, ɤɚɤ ɨɛɴɟɤɬɧɵɟ ɮɚɣɥɵ, ɮɚɣɥɵ ɪɟɫɭɪɫɨɜ, ɞɨɤɭɦɟɧɬɵ MS Word ɢ ɬɚɛɥɢɰɵ MS Excel, ɬɟɤɫɬɵ ɧɚ ɚɧɝɥɢɣɫɤɨɦ ɹɡɵɤɟ. ȼ RK ɪɟɚɥɢɡɨɜɚɧɨ ɞɜɚ ɚɥɝɨɪɢɬɦɚ: ɫɬɚɬɢɫɬɢɱɟɫɤɢɣ ɬɢɩɚ PPM ɢ ɫɥɨɜɚɪɧɵɣ ɬɢɩɚ Ɂɢɜɚ-Ʌɟɦɩɟɥɚ. ȼ ɤɚɱɟɫɬɜɟ PPM-ɤɨɦɩɪɟɫɫɨɪɚ ɜ RK ɩɪɢɦɟɧɹɟɬɫɹ ɨɛɥɟɝɱɟɧɧɵɣ ɜɚɪɢɚɧɬ ɩɪɨɝɪɚɦɦɵ RKUC, ɫɨɡɞɚɧɧɨɣ ɬɚɤɠɟ Ɍɟɣɥɨɪɨɦ. ɋ ɭɱɟɬɨɦ ɫɤɚɡɚɧɧɨɝɨ ɦɵ ɢɫɤɥɸɱɢɥɢ RK ɢɡ ɬɚɛɥɢɰɵ ɫɪɚɜɧɟɧɢɹ ɤɨɧɬɟɤɫɬɧɵɯ ɤɨɦɩɪɟɫɫɨɪɨɜ ɩɨ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ (ɬɚɛɥ. 4.8). RKUC ɪɟɚɥɢɡɭɟɬ ɤɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ ɫ ɦɚɤɫɢɦɚɥɶɧɵɦ ɩɨɪɹɞɤɨɦ 16. ɉɨɪɹɞɨɤ ɄɆ ɦɨɠɟɬ ɛɵɬɶ ɪɚɜɟɧ 16, 12, 8, 5, …, 0 ɢ, ɜɟɪɨɹɬɧɨ, –1. ɂɧɚɱɟ ɝɨɜɨɪɹ ɜ RKUC ɢɫɩɨɥɶɡɭɟɬɫɹ ɨɬɥɢɱɚɸɳɢɣɫɹ ɨɬ ɤɥɚɫɫɢɱɟɫɤɨɝɨ ɦɟɯɚɧɢɡɦ ɜɵɛɨɪɚ ɩɨɪɹɞɤɚ ɫɥɟɞɭɸɳɟɣ ɄɆ ɜ ɫɥɭɱɚɟ ɭɯɨɞɚ. ȼ ɞɨɩɨɥɧɟɧɢɟ ɤ ɷɬɨɦɭ ɜ ɡɚɜɢɫɢɦɨɫɬɢ ɨɬ ɩɚɪɚɦɟɬɪɨɜ ɜɵɡɨɜɚ ɩɪɨɝɪɚɦɦɵ ɦɨɠɟɬ ɜɵɩɨɥɧɹɬɶɫɹ LOE. ȿɳɟ ɨɞɧɚ ɢɡ ɨɩɰɢɣ ɤɨɦɩɪɟɫɫɨɪɚ ɪɚɡɪɟɲɚɟɬ ɢɫɩɨɥɶɡɨɜɚɬɶ ɩɪɢ ɨɰɟɧɤɟ ɜɟɪɨɹɬɧɨɫɬɢ ɫɬɚɬɢɫɬɢɤɭ, ɧɚɤɨɩɥɟɧɧɭɸ ɞɥɹ ɪɚɡɛɪɨɫɚɧɧɵɯ (sparse) ɤɨɧɬɟɤɫɬɨɜ, ɢɥɢ ɛɢɧɚɪɧɵɯ (binary) ɜ ɬɟɪɦɢɧɨɥɨɝɢɢ ɚɜɬɨɪɚ ɤɨɦɩɪɟɫɫɨɪɚ. ɂɞɟɹ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɬɨɦ, ɱɬɨ ɧɟɫɤɨɥɶɤɨ ɨɛɵɱɧɵɯ ɤɨɧɬɟɤɫɬɨɜ ɨɞɢɧɚɤɨɜɨɣ ɞɥɢɧɵ ɦɨɝɭɬ ɫɱɢɬɚɬɶɫɹ ɨɞɧɢɦ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 179 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɤɨɧɬɟɤɫɬɨɦ, ɟɫɥɢ ɜ ɨɩɪɟɞɟɥɟɧɧɵɯ ɩɨɡɢɰɢɹɯ ɢɯ ɫɢɦɜɨɥɵ ɨɞɢɧɚɤɨɜɵ. ɇɚɩɪɢɦɟɪ, ɟɫɥɢ ɞɥɹ ɤɨɧɬɟɤɫɬɨɜ ɞɥɢɧɵ 4 ɬɪɟɛɭɟɬɫɹ ɫɨɜɩɚɞɟɧɢɹ ɩɟɪɜɨɝɨ7 (ɩɨɫɥɟɞɧɟɝɨ ɨɛɪɚɛɨɬɚɧɧɨɝɨ), ɜɬɨɪɨɝɨ ɢ ɱɟɬɜɟɪɬɨɝɨ ɫɢɦɜɨɥɨɜ, ɬɨ ɫɬɪɨɤɢ «ɚɛɫɞ» ɢ «ɚɚɫɞ» ɹɜɥɹɸɬɫɹ ɨɞɧɢɦ ɢ ɬɟɦ ɠɟ ɪɚɡɛɪɨɫɚɧɧɵɦ ɤɨɧɬɟɤɫɬɨɦ «ɚXɫɞ», ɝɞɟ X — ɥɸɛɨɣ ɫɢɦɜɨɥ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɬɟɯɧɢɤɚ ɪɚɡɛɪɨɫɚɧɧɵɯ ɤɨɧɬɟɤɫɬɨɜ ɡɚɤɥɸɱɚɟɬɫɹ ɜ ɨɛɴɟɞɢɧɟɧɢɢ ɢɧɮɨɪɦɚɰɢɢ, ɫɨɛɢɪɚɟɦɨɣ ɞɥɹ ɧɟɫɤɨɥɶɤɢɯ ɤɥɚɫɫɢɱɟɫɤɢɯ ɤɨɧɬɟɤɫɬɨɜ. ɉɪɢɦɟɧɟɧɢɟ ɷɬɨɝɨ ɦɟɯɚɧɢɡɦɚ ɱɚɫɬɨ ɩɨɡɜɨɥɹɟɬ ɡɚɦɟɬɧɨ ɭɥɭɱɲɢɬɶ ɫɠɚɬɢɟ ɛɥɨɤɨɜ ɞɚɧɧɵɯ ɫ ɪɟɝɭɥɹɪɧɨɣ ɫɬɪɭɤɬɭɪɨɣ. ȼ RKUC ɩɪɢɦɟɧɹɟɬɫɹ ɭɥɭɱɲɟɧɧɵɣ ɜɚɪɢɚɧɬ ɚɞɚɩɬɢɜɧɨɣ Ɉȼɍ ɩɨ ɦɟɬɨɞɭ Z. ɉɪɢ ɬɟɫɬɢɪɨɜɚɧɢɢ ɢɫɩɨɥɶɡɨɜɚɥɫɹ RKUC ɜɟɪɫɢɢ 1.04, ɤɨɬɨɪɵɣ ɡɚɩɭɫɤɚɥɫɹ ɫ ɩɚɪɚɦɟɬɪɚɦɢ -m10 -o16 -x -b, ɬ.ɟ. ɢɫɩɨɥɶɡɨɜɚɥɚɫɶ ɦɨɞɟɥɶ 16 ɩɨɪɹɞɤɚ, ɨɝɪɚɧɢɱɟɧɧɚɹ 10 Ɇɛɚɣɬ ɩɚɦɹɬɢ, ɢ ɛɵɥɢ ɜɤɥɸɱɟɧɵ ɦɟɯɚɧɢɡɦɵ LOE ɢ ɪɚɡɛɪɨɫɚɧɧɵɯ ɤɨɧɬɟɤɫɬɨɜ. ȿɫɥɢ ɨɬɤɚɡɚɬɶɫɹ ɨɬ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɪɚɡɛɪɨɫɚɧɧɵɯ ɤɨɧɬɟɤɫɬɨɜ, ɬɨ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɬɟɤɫɬɨɜɵɯ ɮɚɣɥɨɜ ɭɥɭɱɲɚɟɬɫɹ ɩɪɢɦɟɪɧɨ ɧɚ 1%, ɚ ɛɢɧɚɪɧɵɯ (Geo, Obj1, Obj2) — ɭɯɭɞɲɚɟɬɫɹ ɧɚ ɧɟɫɤɨɥɶɤɨ ɩɪɨɰɟɧɬɨɜ. PPMN
Ʉɨɦɩɪɟɫɫɨɪ PPMN ɪɚɡɪɚɛɨɬɚɧ Ɇɚɤɫɢɦɨɦ ɋɦɢɪɧɨɜɵɦ (Smirnov) ɜ ɷɤɫɩɟɪɢɦɟɧɬɚɥɶɧɵɯ ɰɟɥɹɯ. Ɉɫɧɨɜɧɚɹ ɰɟɥɶ ɪɚɡɪɚɛɨɬɤɢ ɫɨɫɬɨɹɥɚ ɜ ɫɨɡɞɚɧɢɢ PPM-ɤɨɦɩɪɟɫɫɨɪɚ, ɨɛɟɫɩɟɱɢɜɚɸɳɟɝɨ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɧɚ ɭɪɨɜɧɟ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɪɚɡɧɨɜɢɞɧɨɫɬɢ ɚɥɝɨɪɢɬɦɚ PPMZ, ɢ ɡɧɚɱɢɬɟɥɶɧɨ ɛɨɥɟɟ ɜɵɫɨɤɭɸ ɫɤɨɪɨɫɬɶ ɤɨɞɢɪɨɜɚɧɢɹ ɩɪɢ ɦɟɧɶɲɢɯ ɨɝɪɚɧɢɱɟɧɢɹɯ ɧɚ ɨɛɴɟɦ ɢɫɩɨɥɶɡɭɟɦɨɣ ɩɚɦɹɬɢ. ȼ PPMN ɪɟɚɥɢɡɨɜɚɧ ɚɥɝɨɪɢɬɦ PPM ɫ ɨɝɪɚɧɢɱɟɧɧɵɦ ɩɨɪɹɞɤɨɦ ɤɨɧɬɟɤɫɬɨɜ. Ɇɚɤɫɢɦɚɥɶɧɵɣ ɩɨɪɹɞɨɤ N ɦɨɞɟɥɢ ɪɚɜɟɧ 7, ɧɨ
ɋɢɦɜɨɥɵ ɤɨɧɬɟɤɫɬɚ ɨɛɵɱɧɨ ɧɭɦɟɪɭɸɬɫɹ ɫɩɪɚɜɚ ɧɚɥɟɜɨ, ɩɨɷɬɨɦɭ ɩɟɪɜɵɣ ɫɢɦɜɨɥ ɤɨɧɬɟɤɫɬɚ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɩɨɫɥɟɞɧɟɦɭ ɨɛɪɚɛɨɬɚɧɧɨɦɭ 7
180 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɬɚɤɠɟ ɪɟɚɥɢɡɨɜɚɧɵ ɜɚɪɢɚɧɬɵ ɦɨɞɟɥɢ ɫ «ɩɫɟɜɞɨɩɨɪɹɞɤɚɦɢ» 8 ɢ 9, ɩɪɢ ɤɨɬɨɪɵɯ ɤɚɠɞɨɣ ɄɆ(N), N = 8…9, ɜ ɞɟɣɫɬɜɢɬɟɥɶɧɨɫɬɢ ɦɨɠɟɬ ɫɨɨɬɜɟɬɫɬɜɨɜɚɬɶ ɧɟɫɤɨɥɶɤɨ ɤɨɧɬɟɤɫɬɨɜ ɩɨɪɹɞɤɚ N. ɂɧɚɱɟ ɝɨɜɨɪɹ, ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɫɦɟɲɢɜɚɧɢɟ ɫɬɚɬɢɫɬɢɤɢ, ɧɚɛɢɪɚɟɦɨɣ ɞɥɹ ɧɟɫɤɨɥɶɤɢɯ ɩɨɯɨɠɢɯ ɤɨɧɬɟɤɫɬɨɜ. Ⱦɥɹ Ɉȼɍ ɢɫɩɨɥɶɡɭɟɬɫɹ ɚɞɚɩɬɢɜɧɵɣ ɦɟɯɚɧɢɡɦ, ɤɨɬɨɪɵɣ ɦɨɠɧɨ ɪɚɫɫɦɚɬɪɢɜɚɬɶ ɤɚɤ ɭɩɪɨɳɟɧɧɵɣ ɦɟɬɨɞ Z. ɂɫɩɨɥɶɡɭɟɬɫɹ ɬɨɥɶɤɨ ɨɞɢɧ ɬɢɩ ɤɨɧɬɟɤɫɬɚ ɭɯɨɞɚ, ɩɨɥɹ ɤɨɬɨɪɨɝɨ ɨɩɪɟɞɟɥɹɸɬɫɹ: • ɩɨɪɹɞɤɨɦ ɄɆ; • ɤɨɥɢɱɟɫɬɜɨɦ ɩɪɨɫɦɨɬɪɨɜ ɄɆ; • ɤɨɥɢɱɟɫɬɜɨɦ ɫɢɦɜɨɥɨɜ ɜ ɄɆ; • ɩɨɫɥɟɞɧɢɦ ɨɛɪɚɛɨɬɚɧɧɵɦ ɫɢɦɜɨɥɨɦ; • ɨɞɧɨɛɢɬɨɜɵɦ ɮɥɚɝɨɦ, ɭɤɚɡɵɜɚɸɳɟɦ ɧɚ ɬɨ, ɱɬɨ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ɫɬɪɨɤɢ ɩɨɫɥɟɞɧɢɯ ɨɛɪɚɛɨɬɚɧɧɵɯ ɫɢɦɜɨɥɨɜ ɡɚɞɚɧɧɨɣ ɞɥɢɧɵ L = 16 ɧɢ ɪɚɡɭ ɧɟ ɩɪɨɢɫɯɨɞɢɥ ɭɯɨɞ. ȿɫɥɢ ɩɪɟɞɵɞɭɳɢɣ ɫɢɦɜɨɥ ɛɵɥ ɡɚɤɨɞɢɪɨɜɚɧ ɜ ɄɆ ɦɟɧɶɲɟɝɨ ɩɨɪɹɞɤɚ, ɱɟɦ ɭ ɬɟɤɭɳɟɣ ɪɚɫɫɦɚɬɪɢɜɚɟɦɨɣ, ɢɥɢ ɜɟɥɢɱɢɧɚ ɨɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ ɡɧɚɱɢɬɟɥɶɧɨ ɦɟɧɶɲɟ ɜɵɱɢɫɥɟɧɧɨɣ ɞɥɹ ɩɪɟɞɵɞɭɳɟɝɨ ɫɢɦɜɨɥɚ, ɬɨ ɩɪɨɢɡɜɨɞɢɬɶɫɹ ɭɜɟɥɢɱɟɧɢɟ ɨɰɟɧɤɢ. Ɉɛɧɨɜɥɟɧɢɟ ɫɱɟɬɱɢɤɨɜ ɤɨɧɬɟɤɫɬɧɨɣ ɦɨɞɟɥɢ ɭɯɨɞɨɜ ɢɦɟɟɬ ɫɥɟɞɭɸɳɭɸ ɫɩɟɰɢɮɢɤɭ: ɟɫɥɢ ɪɚɫɫɦɚɬɪɢɜɚɟɬɫɹ ɄɆ ɦɚɤɫɢɦɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ ɫɪɟɞɢ ɢɦɟɸɳɢɯɫɹ ɚɤɬɢɜɧɵɯ, ɬ.ɟ. ɧɟ ɩɪɨɢɡɜɨɞɢɥɫɹ ɭɯɨɞ, ɬɨ ɲɚɝ ɭɜɟɥɢɱɟɧɢɹ ɫɱɟɬɱɢɤɨɜ ɄɆɍ ɢɦɟɟɬ ɜɟɫ 4, ɢɧɚɱɟ — 1. Ʉɚɤ ɩɨɤɚɡɵɜɚɸɬ ɷɤɫɩɟɪɢɦɟɧɬɵ, ɢɫɩɨɥɶɡɭɟɦɚɹ ɫɯɟɦɚ ɩɪɟɜɨɫɯɨɞɢɬ ɦɟɬɨɞ Z ɩɨ ɬɨɱɧɨɫɬɢ Ɉȼɍ ɢ ɩɪɢ ɷɬɨɦ ɬɪɟɛɭɟɬ ɦɟɧɶɲɢɯ ɜɵɱɢɫɥɢɬɟɥɶɧɵɯ ɡɚɬɪɚɬ. Ʉɚɤ ɢ ɜ ɤɨɦɩɪɟɫɫɨɪɟ RKUC, ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɜɵɛɨɪɚ ɩɨɪɹɞɤɚ ɤɨɧɬɟɤɫɬɧɨɣ ɦɨɞɟɥɢ ɜ ɫɥɭɱɚɟ ɭɯɨɞɚ ɨɬɥɢɱɚɟɬɫɹ ɨɬ ɤɥɚɫɫɢɱɟɫɤɨɣ — ɱɚɫɬɶ ɩɨɪɹɞɤɨɜ ɩɪɨɫɬɨ ɧɟ ɢɫɩɨɥɶɡɭɟɬɫɹ. ɇɚɩɪɢɦɟɪ, ɩɪɢ N = 5 PPM-ɦɨɞɟɥɶ ɫɨɫɬɨɢɬ ɢɡ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ 5, 3, 2, 1, 0, –1 ɩɨɪɹɞɤɨɜ, ɩɨɷɬɨɦɭ ɜ ɫɥɭɱɚɟ ɭɯɨɞɚ ɢɡ ɄɆ(5) ɪɚɫɫɦɚɬɪɢɜɚɟɬɫɹ ɄɆ(3). Ɍɚɤɨɣ ɩɪɢɟɦ ɩɨɡɜɨɥɹɟɬ ɭɫɤɨɪɢɬɶ ɨɛɪɚɛɨɬɤɭ, ɚ ɭɦɟɧɶɲɟɧɢɟ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɥɢɛɨ ɧɟɡɧɚɱɢɬɟɥɶɧɨ, ɥɢɛɨ, ɧɚɨɛɨɪɨɬ, ɧɚɛɥɸɞɚɟɬɫɹ ɟɟ ɭɜɟɥɢɱɟɧɢɟ. Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 181 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ʉɚɤ ɭɠɟ ɭɩɨɦɢɧɚɥɨɫɶ ɪɚɧɟɟ, ɜ PPMN ɢɫɩɨɥɶɡɭɟɬɫɹ ɦɚɫɲɬɚɛɢɪɨɜɚɧɢɟ ɫɱɟɬɱɢɤɚ ɩɨɫɥɟɞɧɟɝɨ ɜɫɬɪɟɱɟɧɧɨɝɨ ɫɢɦɜɨɥɚ. ɍɥɭɱɲɟɧɢɸ ɫɠɚɬɢɹ ɧɟɨɞɧɨɪɨɞɧɵɯ ɮɚɣɥɨɜ ɬɚɤɠɟ ɫɩɨɫɨɛɫɬɜɭɟɬ ɨɝɪɚɧɢɱɟɧɢɟ ɧɚ ɤɨɥɢɱɟɫɬɜɨ ɄɆ ɩɨɪɹɞɤɨɜ 1 ɢ 2, ɩɪɢɜɨɞɹɳɟɟ ɤ ɢɧɬɟɧɫɢɜɧɨɦɭ ɨɛɧɨɜɥɟɧɢɸ ɷɬɢɯ ɄɆ — ɫɬɚɬɢɫɬɢɤɚ ɧɟ ɢɫɩɨɥɶɡɭɟɦɵɯ ɞɨɥɶɲɟ ɜɫɟɝɨ ɤɨɧɬɟɤɫɬɨɜ ɩɪɨɫɬɨ ɭɞɚɥɹɟɬɫɹ. ȼ PPMN ɩɪɢɦɟɧɹɟɬɫɹ ɭɩɪɨɳɟɧɧɵɣ ɫɩɨɫɨɛ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ: ɩɪɢ ɞɨɛɚɜɥɟɧɢɢ ɫɢɦɜɨɥɚ ɜ ɄɆ(o) ɧɚɱɚɥɶɧɨɟ ɡɧɚɱɟɧɢɟ ɟɝɨ ɫɱɟɬɱɢɤɚ ɨɩɪɟɞɟɥɹɟɬɫɹ ɱɚɫɬɨɬɨɣ ɫɢɦɜɨɥɚ ɜ ɬɨɣ ɄɆ(o–k), k > 0, ɜ ɤɨɬɨɪɨɣ ɨɧ ɛɵɥ ɡɚɤɨɞɢɪɨɜɚɧ. Ɇɟɯɚɧɢɡɦ ɢɧɤɪɟɦɟɧɬɚ ɫɱɟɬɱɢɤɨɜ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɨɛɵɱɧɨɦɭ ɢɫɤɥɸɱɟɧɢɸ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ. ɉɨ ɚɧɚɥɨɝɢɢ ɫ HA, ɜ ɤɚɱɟɫɬɜɟ ɫɬɪɭɤɬɭɪɵ ɞɚɧɧɵɯ ɞɥɹ ɞɨɫɬɭɩɚ ɤ ɄɆ ɢɫɩɨɥɶɡɭɸɬɫɹ ɯɟɲ-ɰɟɩɨɱɤɢ. Ⱦɥɹ ɭɫɤɨɪɟɧɢɹ ɩɨɢɫɤɚ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ ɤɚɠɞɵɣ ɫɢɦɜɨɥ ɄɆ(N) ɢɦɟɟɬ ɜɧɟɲɧɢɣ ɭɤɚɡɚɬɟɥɶ ɧɚ ɄɆ(N), ɫɨɨɬɜɟɬɫɬɜɭɸɳɭɸ ɫɥɟɞɭɸɳɟɦɭ ɫɢɦɜɨɥɭ ɨɛɪɚɛɚɬɵɜɚɟɦɨɝɨ ɩɨɬɨɤɚ. PPMN ɫɨɞɟɪɠɢɬ ɦɟɯɚɧɢɡɦɵ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ ɬɟɤɫɬɨɜ ɧɚ ɚɧɝɥɢɣɫɤɨɦ ɢ ɪɭɫɫɤɨɦ ɹɡɵɤɚɯ ɢ ɢɫɩɨɥɧɢɦɵɯ ɮɚɣɥɨɜ ɞɥɹ ɩɪɨɰɟɫɫɨɪɨɜ ɬɢɩɚ Intel x86 (ɫɦ. ɝɥɚɜɭ «ɉɪɟɞɜɚɪɢɬɟɥɶɧɚɹ ɨɛɪɚɛɨɬɤɚ ɞɚɧɧɵɯ»). Ʉɪɨɦɟ ɬɨɝɨ, ɢɦɟɸɬɫɹ ɫɪɟɞɫɬɜɚ ɤɨɞɢɪɨɜɚɧɢɹ ɬɚɛɥɢɰ 8-ɢ, 16-ɢ ɢ 32-ɯ ɛɢɬɧɵɯ ɷɥɟɦɟɧɬɨɜ, ɚ ɬɚɤɠɟ ɤɨɞɢɪɨɜɚɧɢɹ ɞɥɢɧ ɩɨɜɬɨɪɨɜ (RLE). ɉɚɪɚɦɟɬɪɵ SEE, ɦɟɯɚɧɢɡɦɨɜ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɢ ɨɛɧɨɜɥɟɧɢɹ ɫɱɟɬɱɢɤɨɜ ɧɚɫɬɪɨɟɧɵ ɧɚ ɨɛɟɫɩɟɱɟɧɢɟ ɧɚɢɥɭɱɲɟɣ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɜ ɪɟɠɢɦɟ ɨɛɪɚɛɨɬɤɢ ɬɟɤɫɬɨɜ ɫ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ ɫɪɟɞɫɬɜ ɩɪɟɩɪɨɰɟɫɫɢɧɝɚ. ȼ ɬɚɛɥ. 4.8 ɭɤɚɡɚɧɵ ɪɟɡɭɥɶɬɚɬɵ ɬɟɫɬɢɪɨɜɚɧɢɹ PPMN ɜɟɪɫɢɢ 1.00 beta 1 ɜ ɪɟɠɢɦɟ ɫɠɚɬɢɹ ɛɟɡ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɩɪɟɞɜɚɪɢɬɟɥɶɧɨɣ ɨɛɪɚɛɨɬɤɢ (ɨɩɰɢɹ –da ɤɨɦɩɪɟɫɫɨɪɚ). ɉɨɪɹɞɨɤ ɦɨɞɟɥɢ ɪɚɜɧɹɥɫɹ 6 (ɨɩɰɢɹ –o6), ɚ ɟɟ ɪɚɡɦɟɪ ɛɵɥ ɨɝɪɚɧɢɱɟɧ 20 Ɇɛɚɣɬ. PPMD ɂ PPMONSTR
ɉɪɨɝɪɚɦɦɵ PPMd ɢ PPMonstr Ⱦɦɢɬɪɢɹ ɒɤɚɪɢɧɚ (Shkarin) ɪɟɚɥɢɡɭɸɬ ɪɚɡɪɚɛɨɬɚɧɧɵɟ ɢɦ ɠɟ ɚɥɝɨɪɢɬɦɵ PPMII ɢ cPPMII (complicated PPMII, ɬ.ɟ. «ɭɫɥɨɠɧɟɧɧɵɣ» PPMII) [1]. Ɉɛɚ ɤɨɦ182 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɪɟɫɫɨɪɚ ɢɫɩɨɥɶɡɭɸɬ ɦɟɯɚɧɢɡɦ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ. ȼ PPMd ɩɪɢɦɟɧɹɟɬɫɹ ɚɞɚɩɬɢɜɧɵɣ ɦɟɬɨɞ Ɉȼɍ SEE-d1, ɚ ɜ PPMonstr — SEE-d2. Ʉɪɨɦɟ ɷɬɨɝɨ ɨɬɥɢɱɢɹ, ɜ PPMonstr ɪɟɚɥɢɡɨɜɚɧɨ ɧɟɫɤɨɥɶɤɨ ɞɨɩɨɥɧɢɬɟɥɶɧɵɯ ɩɪɢɟɦɨɜ ɭɥɭɱɲɟɧɢɹ ɫɠɚɬɢɹ, ɨɫɧɨɜɧɵɦɢ ɢɡ ɤɨɬɨɪɵɯ ɹɜɥɹɸɬɫɹ ɨɬɥɨɠɟɧɧɨɟ ɧɚɫɥɟɞɨɜɚɧɢɟ ɢ ɭɥɭɱɲɟɧɢɟ ɬɨɱɧɨɫɬɢ ɩɪɟɞɫɤɚɡɚɧɢɹ ɧɚɢɛɨɥɟɟ ɜɟɪɨɹɬɧɵɯ ɫɢɦɜɨɥɨɜ. PPMII ɹɜɥɹɟɬɫɹ ɨɞɧɢɦ ɢɡ ɚɥɝɨɪɢɬɦɨɜ, ɢɫɩɨɥɶɡɭɟɦɵɯ ɜ ɚɪɯɢɜɚɬɨɪɟ RAR ɜɟɪɫɢɢ 3. ȼ ɬɟɫɬɢɪɨɜɚɧɢɢ ɛɵɥɢ ɢɫɩɨɥɶɡɨɜɚɧɵ ɜɟɪɫɢɢ H ɤɨɦɩɪɟɫɫɨɪɨɜ. PPMd ɡɚɩɭɫɤɚɥɫɹ ɫ ɨɩɰɢɟɣ –o8, ɚ PPMonstr — ɫ ɨɩɰɢɟɣ –o1, ɱɬɨ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɦɨɞɟɥɹɦ 8 ɢ 64 ɩɨɪɹɞɤɨɜ. Ɇɚɤɫɢɦɚɥɶɧɵɣ ɪɚɡɦɟɪ ɦɨɞɟɥɢ ɛɵɥ ɨɝɪɚɧɢɱɟɧ 20 Ɇɛɚɣɬ (ɩɚɪɚɦɟɬɪ –m20) ɜ ɨɛɨɢɯ ɫɥɭɱɚɹɯ, ɱɬɨ ɩɪɟɞɨɬɜɪɚɬɢɥɨ ɫɛɪɨɫ ɫɬɚɬɢɫɬɢɤɢ ɦɨɞɟɥɢ, ɨɫɭɳɟɫɬɜɥɹɟɦɵɣ ɩɪɢ ɩɨɥɧɨɦ ɡɚɩɨɥɧɟɧɢɢ ɜɵɞɟɥɟɧɧɨɝɨ ɨɛɴɟɦɚ ɩɚɦɹɬɢ. PPMY
PPMY ɹɜɥɹɟɬɫɹ ɷɤɫɩɟɪɢɦɟɧɬɚɥɶɧɵɦ ɤɨɦɩɪɟɫɫɨɪɨɦ, ɪɚɡɪɚɛɚɬɵɜɚɟɦɵɦ ȿɜɝɟɧɢɟɦ ɒɟɥɜɢɧɵɦ (Shelwien). Ⱦɚɧɧɚɹ ɩɪɨɝɪɚɦɦɚ ɨɬɧɨɫɢɬɫɹ ɤ ɧɟɦɧɨɝɨɱɢɫɥɟɧɧɨɦɭ ɤɥɚɫɫɭ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɢɫɩɨɥɶɡɭɸɳɢɯ ɩɨɥɧɨɟ ɫɦɟɲɢɜɚɧɢɟ. ɉɪɢ ɨɛɪɚɛɨɬɤɟ ɤɚɠɞɨɝɨ ɫɢɦɜɨɥɚ ɩɪɨɢɡɜɨɞɢɬɫɹ ɫɦɟɲɢɜɚɧɢɟ ɨɰɟɧɨɤ ɪɚɫɩɪɟɞɟɥɟɧɢɣ ɜɟɪɨɹɬɧɨɫɬɟɣ ɢɡ ɄɆ ɜɫɟɯ ɞɨɫɬɭɩɧɵɯ ɩɨɪɹɞɤɨɜ ɨɬ ɧɟɤɨɬɨɪɨɝɨ N ɞɨ –1. ȼɟɥɢɱɢɧɚ N ɨɝɪɚɧɢɱɢɜɚɟɬɫɹ ɫɜɟɪɯɭ ɡɧɚɱɟɧɢɟɦ ɨɞɧɨɝɨ ɢɡ ɩɚɪɚɦɟɬɪɨɜ ɩɪɨɝɪɚɦɦɵ. ȿɫɥɢ ɩɨɡɜɨɥɹɟɬ ɞɚɧɧɨɟ ɨɝɪɚɧɢɱɟɧɢɟ, ɬɨ ɜ ɤɚɱɟɫɬɜɟ ɄɆ ɦɚɤɫɢɦɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ ɜɵɛɢɪɚɟɬɫɹ ɄɆ ɫ ɫɚɦɵɦ ɞɥɢɧɧɵɦ ɤɨɧɬɟɤɫɬɨɦ, ɪɚɧɟɟ ɜɫɬɪɟɱɚɜɲɢɦɫɹ ɩɨ ɤɪɚɣɧɟɣ ɦɟɪɟ ɨɞɢɧ ɪɚɡ. Ʉɨɦɩɪɟɫɫɨɪ ɨɫɭɳɟɫɬɜɥɹɟɬ ɦɨɞɟɥɢɪɨɜɚɧɢɟ ɧɚ ɭɪɨɜɧɟ ɛɚɣɬɨɜ, ɩɨɷɬɨɦɭ ɄɆ(–1) ɫɨɞɟɪɠɢɬ ɫɱɟɬɱɢɤɢ ɞɥɹ ɜɫɟɯ 256 ɜɨɡɦɨɠɧɵɯ ɫɢɦɜɨɥɨɜ; ɡɧɚɱɟɧɢɟ ɤɚɠɞɨɝɨ ɫɱɟɬɱɢɤɚ ɪɚɜɧɨ 1. Ʉɪɨɦɟ ɫɱɟɬɱɢɤɨɜ ɜɫɬɪɟɱɚɟɦɵɯ ɜ ɟɟ ɤɨɧɬɟɤɫɬɟ ɫɢɦɜɨɥɨɜ, ɤɚɠɞɚɹ ɄɆ(o) ɫɨɞɟɪɠɢɬ ɟɳɟ ɞɜɟ ɩɟɪɟɦɟɧɧɵɟ: • ɱɢɫɥɨ ɫɢɦɜɨɥɨɜ ɜ ɤɨɧɬɟɤɫɬɟ; ɛɭɞɟɦ ɨɛɨɡɧɚɱɚɬɶ ɡɞɟɫɶ ɤɚɤ f(esc|o); ɩɪɢɧɹɬɨɟ ɨɛɨɡɧɚɱɟɧɢɟ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɨɛɭɫɥɨɜɥɟɧɨ ɬɟɦ, ɱɬɨ ɟɟ ɡɧɚɱɟɧɢɟ ɫɨɜɩɚɞɚɥɨ ɛɵ ɫ ɤɨɥɢɱɟɫɬɜɨɦ Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 183 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɭɯɨɞɨɜ ɢɡ ɄɆ(o), ɟɫɥɢ ɛɵ ɦɵ ɢɦɟɥɢ ɞɟɥɨ ɫ ɨɛɵɱɧɵɦ ɚɥɝɨɪɢɬɦɨɦ PPM; • ɱɢɫɥɨ ɫɥɭɱɚɟɜ, ɤɨɝɞɚ ɜɟɪɨɹɬɧɨɫɬɶ ɨɛɪɚɛɚɬɵɜɚɟɦɨɝɨ ɫɢɦɜɨɥɚ ɜ ɞɚɧɧɨɣ ɄɆ(o) ɛɵɥɚ ɦɚɤɫɢɦɚɥɶɧɨɣ ɩɨ ɫɪɚɜɧɟɧɢɸ ɫ ɩɪɨɱɢɦɢ ɤɨɧɬɟɤɫɬɧɵɦɢ ɦɨɞɟɥɹɦɢ; ɨɛɨɡɧɚɱɢɦ ɤɚɤ Opt(o). Ɉɰɟɧɤɢ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɚ, ɞɚɜɚɟɦɵɟ ɪɚɡɧɵɦɢ ɄɆ ɧɟɤɨɬɨɪɨɝɨ ɩɨɪɹɞɤɚ o, ɜɡɜɟɲɢɜɚɸɬɫɹ ɫ ɩɨɦɨɳɶɸ ɚɞɚɩɬɢɜɧɨ ɜɵɱɢɫɥɹɟɦɵɯ ɜɟɫɨɜ wo. ɉɪɨɰɟɞɭɪɭ ɧɚɯɨɠɞɟɧɢɹ wo ɦɨɠɧɨ ɨɩɢɫɚɬɶ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ:
min( f (o), ET ) − f ( esc | o) , f (o ) ( w ( opt ) + Opt (o)) Wo( opt ) = , w ( opt ) + f (o) wo = w ( E ) ⋅ W ( opt ) + (1 − w ( E ) ) ⋅ Wo( esc ) ⋅ Wo( opt ) , Wo( esc ) =
ɝɞɟ
f(o) — ɨɛɳɟɟ ɤɨɥɢɱɟɫɬɜɨ ɩɪɨɫɦɨɬɪɨɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɄɆ(o); ET, w(opt), w(E) — ɧɟɤɨɬɨɪɵɟ ɩɚɪɚɦɟɬɪɵ. Ʉɨɷɮɮɢɰɢɟɧɬɚɦ Wo( esc ) ɢ Wo(opt ) ɦɨɠɧɨ ɞɚɬɶ ɬɚɤɭɸ ɭɩɪɨɳɟɧɧɭɸ ɢɧɬɟɪɩɪɟɬɚɰɢɸ: • Wo( esc ) — ɷɬɨ ɜɟɪɨɹɬɧɨɫɬɶ ɬɨɝɨ, ɱɬɨ ɫɢɦɜɨɥ ɩɪɢɫɭɬɫɬɜɭɟɬ ɜ ɬɟɤɭɳɟɣ ɄɆ(o), ɢɥɢ, ɜ ɬɟɪɦɢɧɚɯ ɤɥɚɫɫɢɱɟɫɤɨɝɨ PPM, ɜɟɪɨɹɬɧɨɫɬɶ ɬɨɝɨ, ɱɬɨ ɭɯɨɞɚ ɧɟ ɛɭɞɟɬ; • Wo( opt ) — ɷɬɨ ɜɟɪɨɹɬɧɨɫɬɶ ɬɨɝɨ, ɱɬɨ ɢɦɟɧɧɨ ɞɚɧɧɚɹ ɄɆ(o) ɢɦɟɟɬ ɦɚɤɫɢɦɚɥɶɧɭɸ ɨɰɟɧɤɭ ɜɟɪɨɹɬɧɨɫɬɢ ɬɟɤɭɳɟɝɨ ɫɢɦɜɨɥɚ. Ⱥɥɝɨɪɢɬɦ ɧɚɯɨɠɞɟɧɢɹ ɡɧɚɱɟɧɢɣ ɩɚɪɚɦɟɬɪɨɜ ET, w(opt), w(E), ɨɛɟɫɩɟɱɢɜɚɸɳɢɣ ɯɨɪɨɲɢɣ ɤɨɷɮɮɢɰɢɟɧɬ ɫɠɚɬɢɹ, ɛɵɥ ɩɨɥɭɱɟɧ ɷɦɩɢɪɢɱɟɫɤɢɦ ɩɭɬɟɦ, ɢ ɪɟɡɭɥɶɬɚɬɵ ɜɵɱɢɫɥɟɧɢɣ ɫɜɟɞɟɧɵ ɜ ɬɚɛɥɢɰɵ. Ⱦɥɹ ɤɚɠɞɨɣ ɄɆ(o) ɜɟɥɢɱɢɧɵ ɩɚɪɚɦɟɬɪɨɜ ɜɵɛɢɪɚɸɬɫɹ ɢɡ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɬɚɛɥɢɰɵ ɩɨ ɚɞɪɟɫɭ, ɨɩɪɟɞɟɥɹɟɦɨɦɭ ɡɧɚɱɟɧɢɟɦ ɩɚɪɵ (o, N). 184 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼɨɨɛɳɟ ɝɨɜɨɪɹ, ɜ ɜɟɪɫɢɢ PPMY 3b ɢɫɩɨɥɶɡɭɟɬɫɹ ɞɨ 120 ɫɩɟɰɢɚɥɶɧɨ ɩɨɞɨɛɪɚɧɧɵɯ ɩɚɪɚɦɟɬɪɨɜ. ȼɨɡɦɨɠɧɨ, ɢɫɩɨɥɶɡɨɜɚɧɢɟ ɞɪɭɝɢɯ ɮɭɧɤɰɢɣ ɩɨɫɬɪɨɟɧɢɹ ɜɟɫɨɜ ɩɨɡɜɨɥɢɬ ɭɦɟɧɶɲɢɬɶ ɤɨɥɢɱɟɫɬɜɨ ɩɚɪɚɦɟɬɪɨɜ ɛɟɡ ɭɳɟɪɛɚ ɞɥɹ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ. ȼ ɬɚɛɥ. 4.8 ɩɪɢɜɟɞɟɧɵ ɪɟɡɭɥɶɬɚɬɵ ɫɠɚɬɢɹ ɧɚɛɨɪɚ ɮɚɣɥɨɜ CalgCC ɞɥɹ PPMY ɜɟɪɫɢɢ 3b. Ʉɨɞɟɪ ɡɚɩɭɫɤɚɥɫɹ ɫ ɨɩɰɢɟɣ /o64. ɉɊɈɂɁȼɈȾɂɌȿɅɖɇɈɋɌɖ ɇȺ ɌȿɋɌɈȼɈɆ ɇȺȻɈɊȿ CALGARY COMPRESSION CORPUS
ȼɫɟ ɪɚɫɫɦɨɬɪɟɧɧɵɟ ɤɨɦɩɪɟɫɫɨɪɵ ɢ ɚɪɯɢɜɚɬɨɪɵ ɛɵɥɢ ɩɪɨɬɟɫɬɢɪɨɜɚɧɵ ɧɚ ɧɚɛɨɪɟ CalgCC, ɨɩɢɫɚɧɧɨɦ ɜ ɩɭɧɤɬɟ «ɋɪɚɜɧɟɧɢɟ ɚɥɝɨɪɢɬɦɨɜ ɩɨ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ». Ⱦɥɹ ɫɪɚɜɧɟɧɢɹ ɞɨɛɚɜɥɟɧɵ ɯɚɪɚɤɬɟɪɢɫɬɢɤɢ ɬɪɢɜɢɚɥɶɧɨɝɨ ɤɨɦɩɪɟɫɫɨɪɚ Dummy, ɧɚ ɩɪɢɦɟɪɟ ɤɨɬɨɪɨɝɨ ɦɵ ɨɛɴɹɫɧɹɥɢ ɢɞɟɸ PPM. ȼ ɬɚɛɥɢɰɟ ɭɤɚɡɚɧɵ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɨɬɞɟɥɶɧɵɯ ɮɚɣɥɨɜ ɧɚɛɨɪɚ, ɫɪɟɞɧɹɹ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ, ɨɛɳɟɟ ɜɪɟɦɹ ɤɨɞɢɪɨɜɚɧɢɹ Tɤɨɞ ɢ ɞɟɤɨɞɢɪɨɜɚɧɢɹ Tɞɟɤ. ɋɪɟɞɧɹɹ ɫɬɟɩɟɧɶ ɜɵɱɢɫɥɹɥɚɫɶ ɤɚɤ ɫɪɟɞɧɹɹ ɧɟ ɜɡɜɟɲɟɧɧɚɹ ɩɨ ɪɚɡɦɟɪɭ ɮɚɣɥɨɜ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ. Ⱦɥɹ Tɤɨɞ ɢ Tɞɟɤ ɡɚ ɟɞɢɧɢɰɭ ɩɪɢɧɹɬɨ ɜɪɟɦɹ ɫɠɚɬɢɹ ɜɫɟɝɨ CalgCC ɤɨɦɩɪɟɫɫɨɪɨɦ PPMd. ɑɬɨɛɵ ɜɧɟɫɬɢ ɹɫɧɨɫɬɶ, ɡɚɦɟɬɢɦ, ɱɬɨ ɟɞɢɧɢɰɚ ɩɪɢɦɟɪɧɨ ɫɨɨɬɜɟɬɫɬɜɭɟɬ ɫɤɨɪɨɫɬɢ ɤɨɞɢɪɨɜɚɧɢɹ 700 ɤɛɚɣɬ/ɫ ɞɥɹ ɉɄ ɫ ɩɪɨɰɟɫɫɨɪɨɦ ɬɢɩɚ Pentium III 733 ɆȽɰ. Ɍɚɛɥɢɰɚ 4.8 Bib book1 book2 Geo News obj1 obj2 Paper1 Paper2 Pic Progc Progl
Dummy CM
HA
PPMY RKUC PPMN PPMd
PPMonstr
2.31 2.22 2.12 1.68 1.92 1.76 1.94 2.08 2.20 9.41 2.06 2.40
4.12 3.27 3.74 1.72 3.05 2.19 3.07 3.39 3.43 10.00 3.36 4.68
4.55 3.72 4.35 1.74 3.60 2.09 3.46 3.59 3.67 10.26 3.51 5.30
4.76 3.74 4.49 1.92 3.74 2.29 3.79 3.74 3.77 11.43 3.70 5.76
3.01 2.99 3.19 1.74 2.52 1.69 2.32 2.37 2.61 9.30 2.27 3.07
4.55 3.62 4.30 2.12 3.57 2.25 3.79 3.51 3.57 10.67 3.45 5.37
4.57 3.64 4.31 1.96 3.58 2.32 3.65 3.59 3.62 11.01 3.54 5.26
4.62 3.65 4.35 1.84 3.62 2.26 3.62 3.65 3.67 10.53 3.60 5.44
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 185 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Progp Trans ɂɬɨɝɨ Tɤɨɞ Tɞɟɤ
Dummy CM
HA
PPMY RKUC PPMN PPMd
PPMonstr
2.36 2.28
2.99 2.96
4.71 5.23
5.33 6.35
5.30 6.40
5.19 6.17
5.26 6.35
5.76 6.84
2.62 0.5 0.6
3.07 2.4 0.8
4.00 3.0 3.1
4.39 14.6 15.6
4.46 6.5 6.7
4.46 1.9 2.0
4.46 1.0 1.0
4.70 2.3 2.4
ȾɊɍȽɂȿ ȺɊɏɂȼȺɌɈɊɕ ɂ ɄɈɆɉɊȿɋɋɈɊɕ
ɋɭɳɟɫɬɜɭɟɬ ɦɧɨɠɟɫɬɜɨ ɤɨɦɩɪɟɫɫɨɪɨɜ, ɩɪɢɦɟɧɹɸɳɢɯ ɤɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ, ɤɨɬɨɪɵɟ ɧɟ ɛɵɥɢ ɨɯɜɚɱɟɧɵ ɞɚɧɧɵɦ ɨɛɡɨɪɨɦ. Ɉɬɦɟɬɢɦ ɫɥɟɞɭɸɳɢɟ ɚɪɯɢɜɚɬɨɪɵ: • BOA, ɚɜɬɨɪ əɧ ɋɚɬɬɨɧ (Sutton); • ARHANGEL, ɚɜɬɨɪ ɘɪɢɣ Ʌɹɩɤɨ (Lyapko); • LGHA, ɹɜɥɹɸɳɢɣɫɹ ɪɟɚɥɢɡɚɰɢɟɣ ɚɪɯɢɜɚɬɨɪɚ HA ɧɚ ɹɡɵɤɟ Ⱥɫɫɟɦɛɥɟɪɚ, ɜɵɩɨɥɧɟɧɧɨɣ ɘɪɢɟɦ Ʌɹɩɤɨ; • UHARC, ɚɜɬɨɪ ɍɜɟ ɏɟɪɤɥɨɰ (Herklotz); • X1, ɚɜɬɨɪ ɋɬɢɝ ȼɚɥɟɧɬɢɧɢ (Valentini); ɚ ɬɚɤɠɟ ɤɨɦɩɪɟɫɫɨɪ PPMZ, ɚɜɬɨɪ ɑɚɪɥɶɡ Ȼɥɭɦ (Bloom).
Ɉɛɡɨɪ ɤɥɚɫɫɢɱɟɫɤɢɯ ɚɥɝɨɪɢɬɦɨɜ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ LOEMA
ɋɭɞɹ ɩɨ ɜɫɟɦɭ, ɜɩɟɪɜɵɟ ɚɥɝɨɪɢɬɦ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɛɵɥ ɪɟɚɥɢɡɨɜɚɧ ɜ 1982 ɝɨɞɭ Ɋɨɛɟɪɬɫɨɦ (Roberts) [2]. Ⱥɜɬɨɪ ɧɚɡɜɚɥ ɫɜɨɣ ɚɥɝɨɪɢɬɦ Local Order Estimation Markov Analysis (Ɇɚɪɤɨɜɫɤɢɣ ɚɧɚɥɢɡ ɩɨɫɪɟɞɫɬɜɨɦ ɨɰɟɧɢɜɚɧɢɹ ɥɨɤɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ). ȼ LOEMA ɢɫɩɨɥɶɡɭɟɬɫɹ ɩɨɥɧɨɟ ɫɦɟɲɢɜɚɧɢɟ ɨɰɟɧɨɤ ɄɆ ɪɚɡɥɢɱɧɨɝɨ ɩɨɪɹɞɤɚ, ɩɪɢ ɷɬɨɦ ɜɟɫɚ ɩɪɟɞɫɬɚɜɥɹɸɬ ɫɨɛɨɣ ɡɧɚɱɟɧɢɹ ɭɪɨɜɧɹ ɞɨɜɟɪɢɹ ɤ ɨɰɟɧɤɟ ɜ ɬɨɦ ɫɦɵɫɥɟ, ɤɚɤ ɷɬɨ ɩɨɧɢɦɚɟɬɫɹ ɜ ɦɚɬɟɦɚɬɢɱɟɫɤɨɣ ɫɬɚɬɢɫɬɢɤɟ. ɋɪɚɜɧɟɧɢɟ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ LOEMA ɫ ɞɪɭɝɢɦɢ ɚɥɝɨɪɢɬɦɚɦɢ ɡɚɬɪɭɞɧɟɧɨ, ɬ.ɤ., ɫ ɨɞɧɨɣ ɫɬɨɪɨɧɵ, ɩɪɨɝɪɚɦɦɚ, ɪɟɚɥɢɡɭɸɳɚɹ ɚɥɝɨɪɢɬɦ, ɧɟ ɫɬɚɥɚ ɩɭɛɥɢɱɧɨ ɞɨɫɬɭɩɧɨɣ, ɢ, ɫ ɞɪɭɝɨɣ ɫɬɨɪɨɧɵ, ɮɚɣɥɵ, ɧɚ ɤɨɬɨɪɵɯ Ɋɨɛɟɪɬɫ ɞɨɤɚɡɵɜɚɥ ɷɮɮɟɤɬɢɜɧɨɫɬɶ ɫɜɨɟɝɨ ɩɨɞɯɨɞɚ, ɬɚɤɠɟ ɧɟ ɞɨɫɬɭɩɧɵ. ɂɦɟɸɬɫɹ ɫɬɨ186 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɪɨɧɧɢɟ ɨɬɱɟɬɵ, ɩɨ ɤɨɬɨɪɵɦ LOEMA ɨɛɟɫɩɟɱɢɜɚɟɬ ɤɨɦɩɪɟɫɫɢɸ ɩɪɢɦɟɪɧɨ ɧɚ ɭɪɨɜɧɟ PPMC (ɫɦ. ɬɚɛɥ. 4.9) ɩɪɢ ɡɧɚɱɢɬɟɥɶɧɨ ɦɟɧɶɲɟɣ ɫɤɨɪɨɫɬɢ, ɱɬɨ ɜɵɝɥɹɞɢɬ ɜɩɨɥɧɟ ɩɪɚɜɞɨɩɨɞɨɛɧɨ. ɋɭɞɹ ɩɨ ɜɫɟɦɭ, LOEMA Ɋɨɛɟɪɬɫɚ ɩɨɡɜɨɥɹɥ ɬɨɥɶɤɨ ɨɰɟɧɢɜɚɬɶ, ɧɨ ɧɟ ɫɠɢɦɚɬɶ, ɬ.ɟ. ɜɵɩɨɥɧɹɥ ɢɫɤɥɸɱɢɬɟɥɶɧɨ ɫɬɚɬɢɫɬɢɱɟɫɤɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ. DAFC
Ⱥɥɝɨɪɢɬɦ Double-Adaptive File Compression (Ⱦɜɚɠɞɵ ɚɞɚɩɬɢɜɧɨɟ ɫɠɚɬɢɟ ɮɚɣɥɨɜ), ɪɚɡɪɚɛɨɬɚɧɧɵɣ Ʌɷɧɝɞɨɧɨɦ (Langdon) ɢ Ɋɢɫɫɚɧɟɧɨɦ (Rissanen) ɜ 1983 ɝɨɞɭ, ɫɵɝɪɚɥ ɫɟɪɶɟɡɧɭɸ ɪɨɥɶ ɜ ɪɚɡɜɢɬɢɢ ɤɨɧɬɟɤɫɬɧɵɯ ɦɟɬɨɞɨɜ [2]. ȼɨ-ɩɟɪɜɵɯ, ɜ ɧɟɦ ɜɩɟɪɜɵɟ, ɟɫɥɢ ɧɟ ɫɱɢɬɚɬɶ LOEMA, ɛɵɥɚ ɪɟɚɥɢɡɨɜɚɧɚ ɢɞɟɹ ɪɚɡɞɟɥɟɧɢɹ ɩɪɨɰɟɫɫɚ ɤɨɞɢɪɨɜɚɧɢɹ ɧɚ ɦɨɞɟɥɢɪɨɜɚɧɢɟ ɢ ɫɬɚɬɢɫɬɢɱɟɫɤɨɟ ɤɨɞɢɪɨɜɚɧɢɟ, ɚ ɬɚɤɠɟ ɢɞɟɹ ɨɞɧɨɜɪɟɦɟɧɧɨɣ ɚɞɚɩɬɚɰɢɢ ɫɬɪɭɤɬɭɪɵ ɦɨɞɟɥɢ (ɬ.ɟ. ɧɚɛɨɪɚ ɄɆ) ɢ ɱɚɫɬɨɬ ɫɢɦɜɨɥɨɜ. ȼɨ-ɜɬɨɪɵɯ, ɩɪɨɫɬɨɬɚ ɚɥɝɨɪɢɬɦɚ ɨɛɟɫɩɟɱɢɜɚɥɚ ɜɨɡɦɨɠɧɨɫɬɶ ɟɝɨ ɪɟɚɥɶɧɨɝɨ ɩɪɢɦɟɧɟɧɢɹ ɩɪɢ ɨɬɧɨɫɢɬɟɥɶɧɨ ɫɤɪɨɦɧɵɯ ɜɨɡɦɨɠɧɨɫɬɹɯ ɜɵɱɢɫɥɢɬɟɥɶɧɨɣ ɬɟɯɧɢɤɢ 1980-ɯ ɝɨɞɨɜ. ȼ-ɬɪɟɬɶɢɯ, DAFC ɩɨɥɸɛɢɥɫɹ ɧɚɭɱɧɵɦ ɪɚɛɨɬɧɢɤɚɦ, ɨɯɨɬɧɨ ɢɫɩɨɥɶɡɨɜɚɜɲɢɦ ɟɝɨ ɪɟɡɭɥɶɬɚɬɵ ɞɥɹ ɫɪɚɜɧɟɧɢɹ ɩɪɢ ɧɚɩɢɫɚɧɢɢ ɫɬɚɬɟɣ. ȼ DAFC ɢɫɩɨɥɶɡɭɸɬɫɹ ɤɨɧɬɟɤɫɬɧɚɹ ɦɨɞɟɥɶ ɧɭɥɟɜɨɝɨ ɩɨɪɹɞɤɚ ɢ n ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ ɩɟɪɜɨɝɨ ɩɨɪɹɞɤɚ. ȼ ɧɚɱɚɥɟ ɫɠɚɬɢɹ ɢɫɩɨɥɶɡɭɟɬɫɹ ɄɆ(0), ɜ ɤɨɬɨɪɨɣ ɜɫɟ ɫɢɦɜɨɥɵ ɚɥɮɚɜɢɬɚ ɨɛɪɚɛɚɬɵɜɚɟɦɨɣ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɢɦɟɸɬ ɨɬɥɢɱɧɵɟ ɨɬ ɧɭɥɹ ɫɱɟɬɱɢɤɢ. ɉɨ ɦɟɪɟ ɯɨɞɚ ɤɨɞɢɪɨɜɚɧɢɹ ɄɆ(1) ɫɨɡɞɚɸɬɫɹ ɬɨɥɶɤɨ ɞɥɹ ɩɟɪɜɵɯ n ɫɢɦɜɨɥɨɜ, ɜɫɬɪɟɬɢɜɲɢɯɫɹ ɜ ɭɠɟ ɨɛɪɚɛɨɬɚɧɧɨɦ ɛɥɨɤɟ m ɪɚɡ. ɂɡ ɫɨɨɛɪɚɠɟɧɢɣ ɷɤɨɧɨɦɢɢ ɩɚɦɹɬɢ ɚɜɬɨɪɵ ɩɪɟɞɥɚɝɚɥɢ ɢɫɩɨɥɶɡɨɜɚɬɶ n = 31 ɢ m = 50. Ⱦɚɥɟɟ, ɟɫɥɢ ɬɟɤɭɳɢɣ ɫɢɦɜɨɥ ɜɫɬɪɟɱɚɟɬɫɹ ɜ ɤɨɧɬɟɤɫɬɟ C ɢ ɞɥɹ ɷɬɨɝɨ ɤɨɧɬɟɤɫɬɚ ɫɭɳɟɫɬɜɭɟɬ ɄɆ(1), ɬɨ ɩɪɨɢɡɜɨɞɢɬɫɹ ɩɨɩɵɬɤɚ ɡɚɤɨɞɢɪɨɜɚɬɶ ɫɢɦɜɨɥ ɜ ɧɟɣ, ɢɧɚɱɟ ɜɵɞɚɟɬɫɹ ɫɢɦɜɨɥ ɭɯɨɞɚ ɫ ɜɟɪɨɹɬɧɨɫɬɶɸ, ɨɰɟɧɢɜɚɟɦɨɣ ɩɨ ɦɟɬɨɞɭ A, ɢ ɫɢɦɜɨɥ ɤɨɞɢɪɭɟɬɫɹ ɜ ɄɆ(0).
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 187 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼ DAFC ɬɚɤɠɟ ɩɪɢɦɟɧɹɟɬɫɹ ɤɨɞɢɪɨɜɚɧɢɟ ɞɥɢɧ ɩɨɜɬɨɪɨɜ (RLE), ɤɨɬɨɪɨɟ «ɡɚɩɭɫɤɚɟɬɫɹ» ɩɪɢ ɜɫɬɪɟɱɟ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɢ ɢɡ ɬɪɟɯ ɨɞɢɧɚɤɨɜɵɯ ɫɢɦɜɨɥɨɜ. ɍɩɪɚɠɧɟɧɢɟ: ɋɪɚɜɧɢɬɟ DAFC ɫ ɚɥɝɨɪɢɬɦɨɦ ɪɚɛɨɬɵ ɤɨɦɩɪɟɫɫɨɪɚ Dummy. ȿɫɥɢ ɩɪɟɧɟɛɪɟɱɶ RLE, ɬɨ ɤɚɤɢɟ ɢɡɦɟɧɟɧɢɹ ɫɥɟɞɭɟɬ ɜɧɟɫɬɢ ɜ Dummy, ɱɬɨɛɵ ɩɨɥɭɱɢɬɶ ɪɟɚɥɢɡɚɰɢɸ DAFC? ɉɨɥɶɡɭɹɫɶ ɩɪɢɜɟɞɟɧɧɵɦɢ ɜ ɬɟɤɫɬɟ ɬɚɛɥɢɰɚɦɢ, ɫɪɚɜɧɢɬɟ DAFC ɢ Dummy ɩɨ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɮɚɣɥɨɜ ɧɚɛɨɪɚ CalgCC (ɫɦ. ɬɚɛɥ. 4.8. ɢ 4.9). ADSM
Ⱥɥɝɨɪɢɬɦ Adaptive Dependency Source Model (Ɇɨɞɟɥɶ ɢɫɬɨɱɧɢɤɚ ɫ ɚɞɚɩɬɢɪɭɸɳɟɣɫɹ ɡɚɜɢɫɢɦɨɫɬɶɸ) Ⱥɛɪɚɯɚɦɫɨɧɚ (Abrahamson) ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɨɛɪɚɡɟɰ ɢɧɬɟɪɟɫɧɨɝɨ ɩɨɞɯɨɞɚ ɤ ɪɟɚɥɢɡɚɰɢɢ ɢɞɟɢ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ [2]. Ɂɞɟɫɶ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɱɢɫɬɨɟ ɤɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ 1 ɩɨɪɹɞɤɚ, ɧɨ ɫɨɛɫɬɜɟɧɧɨ ɨɰɟɧɤɚ ɫɬɪɨɢɬɫɹ ɧɚ ɨɫɧɨɜɚɧɢɢ ɬɨɥɶɤɨ ɨɞɧɨɝɨ ɪɚɫɩɪɟɞɟɥɟɧɢɹ ɱɚɫɬɨɬ, ɨɛɳɟɝɨ ɞɥɹ ɜɫɟɯ ɄɆ. Ⱦɨɫɬɢɝɚɟɬɫɹ ɷɬɨ ɫɥɟɞɭɸɳɢɦ ɨɛɪɚɡɨɦ. ȼ ɤɚɠɞɨɣ ɄɆ(1) ɫɱɟɬɱɢɤɢ ɫɢɦɜɨɥɨɜ ɯɪɚɧɹɬɫɹ ɜ ɜɢɞɟ ɭɩɨɪɹɞɨɱɟɧɧɨɝɨ ɩɨ ɜɟɥɢɱɢɧɟ ɱɚɫɬɨɬ ɫɩɢɫɤɚ. ɋɱɟɬɱɢɤɢ ɪɚɧɠɢɪɭɸɬɫɹ ɬɚɤ, ɱɬɨ ɫɢɦɜɨɥ ɫ ɧɚɢɛɨɥɶɲɟɣ ɱɚɫɬɨɬɨɣ ɢɦɟɟɬ ɧɚɢɦɟɧɶɲɢɣ ɪɚɧɝ 1, ɚ ɫ ɧɚɢɦɟɧɶɲɟɣ ɱɚɫɬɨɬɨɣ — ɧɚɢɛɨɥɶɲɢɣ ɪɚɧɝ. ɉɪɢ ɨɛɪɚɛɨɬɤɟ ɬɟɤɭɳɟɝɨ ɫɢɦɜɨɥɚ ɧɚɯɨɞɢɬɫɹ ɟɝɨ ɪɚɧɝ (ɷɬɨ ɦɨɠɟɬ ɛɵɬɶ ɩɪɨɫɬɨ ɧɨɦɟɪ ɫɢɦɜɨɥɚ ɜ ɭɩɨɪɹɞɨɱɟɧɧɨɦ ɫɩɢɫɤɟ ɫɢɦɜɨɥɨɜ ɬɟɤɭɳɟɣ ɤɨɧɬɟɤɫɬɧɨɣ ɦɨɞɟɥɢ), ɢ ɨɰɟɧɤɚ ɨɩɪɟɞɟɥɹɟɬɫɹ ɱɚɫɬɨɬɨɣ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɷɬɨɝɨ ɪɚɧɝɚ. ɑɚɫɬɨɬɵ ɪɚɧɝɨɜ ɢɡɦɟɧɹɸɬɫɹ ɩɨɫɥɟ ɤɨɞɢɪɨɜɚɧɢɹ ɤɚɠɞɨɝɨ ɫɢɦɜɨɥɚ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɫɬɚɬɢɫɬɢɱɟɫɤɨɟ ɤɨɞɢɪɨɜɚɧɢɟ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɧɟ ɧɚ ɛɚɡɟ ɱɚɫɬɨɬɵ ɫɢɦɜɨɥɚ, ɚ ɧɚ ɨɫɧɨɜɚɧɢɢ ɤɨɥɢɱɟɫɬɜɚ ɩɨɹɜɥɟɧɢɣ ɫɢɦɜɨɥɨɜ ɫ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɦ ɪɚɧɝɨɦ ɱɚɫɬɨɬɵ. Ɋɚɫɫɦɨɬɪɢɦ ɫɠɚɬɢɟ ɫɬɪɨɤɢ “ɦɨɥɨɱɧɨɟ_ɦɨɥɨɤɨ”, ɧɚɱɢɧɚɹ ɫ ɨɬɦɟɱɟɧɧɨɝɨ ɧɚ ɪɢɫɭɧɤɟ ɫɬɪɟɥɤɨɣ ɫɢɦɜɨɥɚ. 188 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɦ ɨ
ɥ
ɨ
ɱ
ɧ
ɨ
ɟ
ɦ
ɨ
ɥ
ɨ
ɤ
ɨ
ȼ ɤɨɧɬɟɤɫɬɟ “ɦ” ɪɟɚɥɶɧɨ ɜɫɬɪɟɱɚɥɫɹ ɬɨɥɶɤɨ ɨɞɢɧ ɫɢɦɜɨɥ ‘ɨ’, ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɣ ɬɟɤɭɳɟɦɭ, ɩɨɷɬɨɦɭ ɦɵ ɤɨɞɢɪɭɟɦ ‘ɨ’, ɨɩɢɪɚɹɫɶ ɧɚ ɱɚɫɬɨɬɭ fr(1) ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɪɚɧɝɚ 1. Ɂɚɬɟɦ fr(1) ɨɛɧɨɜɥɹɟɬɫɹ ɤɚɤ fr(1)++. ɋɥɟɞɭɸɳɢɣ ɫɢɦɜɨɥ, ‘ɥ’, ɤɨɞɢɪɭɟɬɫɹ ɜ ɤɨɧɬɟɤɫɬɟ “ɨ”. ɋɨɨɬɜɟɬɫɬɜɭɸɳɚɹ ɄɆ(1) ɫɨɞɟɪɠɢɬ 3 ɪɟɚɥɶɧɨ ɧɚɛɥɸɞɚɜɲɢɯɫɹ ɫɢɦɜɨɥɚ — ‘ɥ’, ’ɱ’, ’ɟ’. ȿɫɥɢ ɩɪɢɧɹɬɶ, ɱɬɨ ɜ ɫɥɭɱɚɟ ɨɞɢɧɚɤɨɜɨɫɬɢ ɱɚɫɬɨɬ ɧɚɢɦɟɧɶɲɢɣ ɪɚɧɝ ɢɦɟɟɬ ɩɨɫɥɟɞɧɢɣ ɜɫɬɪɟɱɟɧɧɵɣ ɫɢɦɜɨɥ, ɬɨ ‘ɥ’ ɤɨɞɢɪɭɟɬɫɹ ɧɚ ɛɚɡɟ ɱɚɫɬɨɬɵ fr(3) ɩɪɢɦɟɧɟɧɢɹ ɪɚɧɝɚ 3. ɉɪɨɢɡɜɨɞɢɬɫɹ ɨɛɧɨɜɥɟɧɢɟ fr(3)++ ɢ ɩɟɪɟɯɨɞ ɤ ɨɛɪɚɛɨɬɤɟ ɫɥɟɞɭɸɳɟɣ ɛɭɤɜɵ (‘ɨ’). ɇɢ ɪɚɡɭ ɧɟ ɜɫɬɪɟɱɟɧɧɵɟ ɜ ɫɨɨɬɜɟɬɫɬɜɭɸɳɟɣ ɄɆ(1) ɫɢɦɜɨɥɵ, ɬ.ɟ. ɢɦɟɸɳɢɟ ɧɭɥɟɜɭɸ ɱɚɫɬɨɬɭ, ɧɟ ɬɪɚɤɬɭɸɬɫɹ ɤɚɤ ɨɫɨɛɵɣ ɫɥɭɱɚɣ, ɢɦ ɬɚɤɠɟ ɩɪɢɫɜɚɢɜɚɟɬɫɹ ɤɚɤɨɣ-ɬɨ ɪɚɧɝ. Ȼɵɥɢ ɢɫɫɥɟɞɨɜɚɧɵ ɪɚɫɲɢɪɟɧɢɹ ɚɥɝɨɪɢɬɦɚ ADSM ɞɥɹ ɜɬɨɪɨɝɨ ɢ ɬɪɟɬɶɟɝɨ ɩɨɪɹɞɤɨɜ [9]. Ɋɟɡɭɥɶɬɚɬɵ ɷɤɫɩɟɪɢɦɟɧɬɨɜ ɩɨɤɚɡɵɜɚɸɬ, ɱɬɨ, ɜ ɨɬɥɢɱɢɟ ɨɬ ɦɧɨɝɢɯ ɞɪɭɝɢɯ ɤɥɚɫɫɢɱɟɫɤɢɯ ɚɥɝɨɪɢɬɦɨɜ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ, ADSM ɚɤɬɭɚɥɟɧ ɢ ɩɨ ɫɟɣ ɞɟɧɶ, ɬɚɤ ɤɚɤ ɨɛɟɫɩɟɱɢɜɚɟɬ ɯɨɪɨɲɟɟ ɫɨɨɬɧɨɲɟɧɢɟ ɫɤɨɪɨɫɬɢ ɪɚɛɨɬɵ, ɨɛɴɟɦɚ ɢɫɩɨɥɶɡɭɟɦɨɣ ɩɚɦɹɬɢ ɢ ɤɨɷɮɮɢɰɢɟɧɬɚ ɫɠɚɬɢɹ. Ɍɚɤ, ɧɚɩɪɢɦɟɪ, ɬɟɯɧɢɤɚ ADSM ɢɫɩɨɥɶɡɨɜɚɧɚ ɜ ɭɬɢɥɢɬɟ ɛɟɡɭɳɟɪɛɧɨɝɨ ɫɠɚɬɢɹ ɢɡɨɛɪɚɠɟɧɢɣ BMF, ɹɜɥɹɸɳɟɣɫɹ ɨɞɧɨɣ ɢɡ ɥɭɱɲɢɯ ɜ ɫɜɨɟɦ ɤɥɚɫɫɟ. ɍɩɪɚɠɧɟɧɢɟ: ɋɨɠɦɢɬɟ ɫɬɪɨɤɭ ɫ ɫɚɦɨɝɨ ɧɚɱɚɥɚ, ɧɚɣɞɢɬɟ ɞɟɣɫɬɜɢɬɟɥɶɧɵɟ ɡɧɚɱɟɧɢɹ fr(1) ɢ fr(3), ɢɫɩɨɥɶɡɭɟɦɵɟ ɩɪɢ ɤɨɞɢɪɨɜɚɧɢɢ ‘ɨ’ ɢ ‘ɥ’ ɜ ɩɪɢɦɟɪɟ. DHPC
Ɍɟɯɧɢɤɚ Dynamic-History Predictive Compression (ɋɠɚɬɢɟ ɧɚ ɨɫɧɨɜɟ ɩɪɟɞɫɤɚɡɚɧɢɹ ɩɨ ɞɢɧɚɦɢɱɟɫɤɨɣ ɢɫɬɨɪɢɢ), ɩɪɟɞɥɨɠɟɧɧɚɹ ɍɢɥɶɹɦɫɨɦ (Williams), ɢɧɬɟɪɟɫɧɚ ɜ ɫɪɚɜɧɟɧɢɢ ɫ DAFC ɤɚɤ ɢɫɄɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 189 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɩɨɥɶɡɭɸɳɚɹ ɢɧɨɣ ɫɩɨɫɨɛ ɨɝɪɚɧɢɱɟɧɢɹ ɪɨɫɬɚ ɦɨɞɟɥɢ. ȼ ɷɬɨɦ ɚɥɝɨɪɢɬɦɟ ɩɪɨɢɫɯɨɞɢɬ ɫɨɡɞɚɧɢɟ ɄɆ(o) ɬɨɥɶɤɨ ɟɫɥɢ ɪɨɞɢɬɟɥɶɫɤɚɹ ɄɆ(o+1) ɞɨɫɬɚɬɨɱɧɨ ɱɚɫɬɨ ɢɫɩɨɥɶɡɨɜɚɥɚɫɶ. ȿɫɥɢ ɩɪɟɞɫɬɚɜɢɬɶ ɤɨɧɬɟɤɫɬ ɞɨɱɟɪɧɟɣ ɄɆ ɜ ɜɢɞɟ ɫɰɟɩɥɟɧɢɹ (ɤɨɧɤɚɬɟɧɚɰɢɢ) ɚC ɤɚɤɨɝɨ-ɬɨ ɫɢɦɜɨɥɚ a ɢ ɤɨɧɬɟɤɫɬɚ C ɪɨɞɢɬɟɥɶɫɤɨɣ, ɜ ɫɥɭɱɚɟ ɤɥɚɫɫɢɱɟɫɤɨɝɨ DAFC ɹɜɥɹɸɳɟɝɨɫɹ ɩɭɫɬɨɣ ɫɬɪɨɤɨɣ, ɬɨ ɦɨɠɧɨ ɞɚɬɶ ɬɚɤɭɸ ɫɪɚɜɧɢɬɟɥɶɧɭɸ ɯɚɪɚɤɬɟɪɢɫɬɢɤɭ. ȼ DAFC ɨɛɪɚɡɨɜɚɧɢɟ ɞɨɱɟɪɧɟɣ ɄɆ ɜɨɡɦɨɠɧɨ ɜ ɫɥɭɱɚɟ ɩɪɟɜɵɲɟɧɢɹ ɱɚɫɬɨɬɨɣ ɩɨɹɜɥɟɧɢɹ ɨɛɪɚɡɭɸɳɟɝɨ ɤɨɧɬɟɤɫɬ ɫɢɦɜɨɥɚ ‘ɚ’ ɡɚɞɚɧɧɨɝɨ ɩɨɪɨɝɚ, ɚ ɜ DHPC — ɩɪɢ ɩɪɟɜɵɲɟɧɢɢ ɩɨɪɨɝɚ ɱɚɫɬɨɬɨɣ ɩɨɹɜɥɟɧɢɹ ɪɨɞɢɬɟɥɶɫɤɨɝɨ ɤɨɧɬɟɤɫɬɚ C, ɬ.ɟ. ɬɨɥɶɤɨ «ɡɚɫɥɭɠɟɧɧɵɟ» ɄɆ ɦɨɝɭɬ ɢɦɟɬɶ «ɞɟɬɟɣ». ɉɪɢ ɢɫɱɟɪɩɚɧɢɢ ɞɨɫɬɭɩɧɨɣ ɩɚɦɹɬɢ ɪɨɫɬ ɦɨɞɟɥɢ DHPC ɩɪɟɤɪɚɳɚɟɬɫɹ, ɞɚɥɟɟ ɜɨɡɦɨɠɧɚ ɚɞɚɩɬɚɰɢɹ ɬɨɥɶɤɨ ɡɚ ɫɱɟɬ ɢɡɦɟɧɟɧɢɹ ɫɱɟɬɱɢɤɨɜ ɫɢɦɜɨɥɨɜ. Ȼɥɚɝɨɞɚɪɹ ɢɫɩɨɥɶɡɨɜɚɧɢɸ ɄɆ ɛɨɥɶɲɢɯ ɩɨɪɹɞɤɨɜ DHPC ɞɚɟɬ ɥɭɱɲɟɟ ɫɠɚɬɢɟ, ɱɟɦ DAFC, ɧɨ ɭɫɬɭɩɚɟɬ ɩɨ ɷɬɨɦɭ ɩɨɤɚɡɚɬɟɥɸ ɤɥɚɫɫɢɱɟɫɤɢɦ ɩɪɟɞɫɬɚɜɢɬɟɥɹɦ ɫɟɦɟɣɫɬɜɚ PPM (PPMC ɢ PPMD). ȺɅȽɈɊɂɌɆɕ PPMA ɂ PPMB
Ⱥɥɝɨɪɢɬɦɵ PPMA ɢ PPMB ɹɜɥɹɸɬɫɹ ɫɚɦɵɦɢ ɪɚɧɧɢɦɢ ɫɪɟɞɢ ɩɪɟɞɫɬɚɜɢɬɟɥɟɣ ɫɟɦɟɣɫɬɜɚ PPM [5]. Ɉɧɢ ɛɵɥɢ ɩɪɟɞɥɨɠɟɧɵ ɚɜɬɨɪɚɦɢ ɬɟɯɧɢɤɢ PPM ɨɞɧɨɜɪɟɦɟɧɧɨ ɜ ɨɞɧɨɣ ɢ ɬɨɣ ɠɟ ɫɬɚɬɶɟ ɢ ɦɨɝɭɬ ɪɚɫɫɦɚɬɪɢɜɚɬɶɫɹ ɤɚɤ ɟɞɢɧɫɬɜɟɧɧɵɟ «ɱɢɫɬɨɤɪɨɜɧɵɟ» PPM. ȼ PPMA ɢ PPMB ɩɪɢɦɟɧɹɟɬɫɹ Ɉȼɍ ɩɨ ɦɟɬɨɞɚɦ A ɢ B ɫɨɨɬɜɟɬɫɬɜɟɧɧɨ. ɉɨɫɥɟ ɤɨɞɢɪɨɜɚɧɢɹ ɫɢɦɜɨɥɚ ɩɪɨɢɡɜɨɞɢɬɫɹ ɩɨɥɧɨɟ ɨɛɧɨɜɥɟɧɢɟ ɫɱɟɬɱɢɤɨɜ. Ɂɧɚɱɟɧɢɹ ɫɱɟɬɱɢɤɨɜ ɫɢɦɜɨɥɨɜ ɧɟ ɦɚɫɲɬɚɛɢɪɭɸɬɫɹ, ɱɬɨ ɬɪɟɛɭɟɬ ɞɨɫɬɚɬɨɱɧɨ ɛɨɥɶɲɢɯ ɫɱɟɬɱɢɤɨɜ (ɚɜɬɨɪɵ ɚɥɝɨɪɢɬɦɨɜ ɢɫɩɨɥɶɡɨɜɚɥɢ 32-ɯ ɛɢɬɧɵɟ). WORD
Ⱥɥɝɨɪɢɬɦ WORD ɛɵɥ ɫɨɡɞɚɧ Ɇɨɮɮɚɬɨɦ (Moffat) ɜ ɤɨɧɰɟ 1980-ɯ ɝɨɞɨɜ ɫɩɟɰɢɚɥɶɧɨ ɞɥɹ ɫɠɚɬɢɹ ɬɟɤɫɬɨɜ, ɢ ɹɜɥɹɟɬɫɹ ɹɪɤɢɦ ɩɪɟɞɫɬɚɜɢɬɟɥɟɦ ɨɫɨɛɨɝɨ ɫɟɦɟɣɫɬɜɚ ɤɨɧɬɟɤɫɬɧɵɯ ɦɟɬɨɞɨɜ. 190 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼ ɚɥɝɨɪɢɬɦɟ ɢɫɩɨɥɶɡɭɸɬɫɹ ɄɆ ɧɟ ɬɨɥɶɤɨ ɞɥɹ ɫɢɦɜɨɥɨɜ, ɧɨ ɢ ɞɥɹ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɟɣ (ɫɬɪɨɤ) ɤɨɧɟɱɧɨɣ ɞɥɢɧɵ. ȼɟɫɶ ɚɥɮɚɜɢɬ ɫɠɢɦɚɟɦɨɝɨ ɛɥɨɤɚ ɞɟɥɢɬɫɹ ɧɚ «ɛɭɤɜɵ» ɢ «ɧɟ-ɛɭɤɜɵ». ɉɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɛɭɤɜ ɧɚɡɵɜɚɟɬɫɹ «ɫɥɨɜɨɦ», ɚ ɧɟ-ɛɭɤɜ — «ɧɟɫɥɨɜɨɦ». Ⱦɥɹ ɨɰɟɧɢɜɚɧɢɹ ɩɪɢɦɟɧɹɸɬɫɹ ɄɆ 1 ɢ 0 ɩɨɪɹɞɤɨɜ, ɩɪɢ ɷɬɨɦ ɛɭɤɜɚ ɩɪɟɞɫɤɚɡɵɜɚɟɬɫɹ ɛɭɤɜɨɣ, ɚ ɫɥɨɜɨ — ɫɥɨɜɨɦ, ɚɧɚɥɨɝɢɱɧɨ ɞɥɹ ɧɟ-ɛɭɤɜ ɢ ɧɟ-ɫɥɨɜ. ȿɫɥɢ ɨɛɪɚɛɚɬɵɜɚɟɦɨɟ ɫɥɨɜɨ ɧɢ ɪɚɡɭ ɧɟ ɜɫɬɪɟɱɚɥɨɫɶ ɜ ɄɆ(1) ɞɥɹ ɫɥɨɜ, ɬɨ ɩɪɨɢɡɜɨɞɢɬɫɹ ɭɯɨɞ ɧɚ ɭɪɨɜɟɧɶ ɄɆ(0); ɟɫɥɢ ɠɟ ɢ ɬɚɦ ɨɰɟɧɢɜɚɧɢɟ ɧɟɜɨɡɦɨɠɧɨ, ɬ.ɟ. ɬɚɤɚɹ ɫɬɪɨɤɚ ɜɫɬɪɟɬɢɥɚɫɶ ɜɩɟɪɜɵɟ, ɬɨ ɫɥɨɜɨ ɩɟɪɟɞɚɟɬɫɹ ɤɚɤ ɩɨɫɥɟɞɨɜɚɬɟɥɶɧɨɫɬɶ ɛɭɤɜ. Ⱦɥɹ ɷɬɨɝɨ ɫɧɚɱɚɥɚ ɤɨɞɢɪɭɟɬɫɹ ɞɥɢɧɚ ɫɥɨɜɚ, ɚ ɡɚɬɟɦ ɫɨɫɬɚɜɥɹɸɳɢɟ ɟɝɨ ɛɭɤɜɵ ɫ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ ɄɆ ɩɟɪɜɨɝɨ, ɧɭɥɟɜɨɝɨ ɢ ɦɢɧɭɫ ɩɟɪɜɨɝɨ ɩɨɪɹɞɤɨɜ. ɉɪɢ ɨɰɟɧɤɟ ɜɟɪɨɹɬɧɨɫɬɟɣ ɛɭɤɜ ɢɫɩɨɥɶɡɭɟɬɫɹ ɬɟɯɧɢɤɚ ɭɯɨɞɨɜ. Ɉɛɪɚɛɨɬɤɚ ɧɟ-ɫɥɨɜ ɢ ɧɟ-ɛɭɤɜ ɨɫɭɳɟɫɬɜɥɹɟɬɫɹ ɚɧɚɥɨɝɢɱɧɨ. Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɜ WORD ɢɫɩɨɥɶɡɭɟɬɫɹ ɜɫɟɝɨ 12 ɬɢɩɨɜ ɄɆ: ɩɟɪɜɨɝɨ ɢ ɧɭɥɟɜɨɝɨ ɩɨɪɹɞɤɚ ɞɥɹ ɫɥɨɜ (ɧɟ-ɫɥɨɜ), ɩɟɪɜɨɝɨ, ɧɭɥɟɜɨɝɨ ɢ ɦɢɧɭɫ ɩɟɪɜɨɝɨ ɩɨɪɹɞɤɚ ɞɥɹ ɛɭɤɜ (ɧɟ-ɛɭɤɜ), ɧɭɥɟɜɨɝɨ ɩɨɪɹɞɤɚ ɞɥɹ ɞɥɢɧ ɫɥɨɜ (ɧɟ-ɫɥɨɜ). Ⱦɥɢɧɚ ɫɥɨɜɚ (ɧɟ-ɫɥɨɜɚ) ɨɝɪɚɧɢɱɢɜɚɟɬɫɹ 20 ɫɢɦɜɨɥɚɦɢ. Ʉɚɤ ɢ ɜ ɫɥɭɱɚɟ DHPC, ɩɪɢ ɞɨɫɬɢɠɟɧɢɢ ɦɨɞɟɥɶɸ ɡɚɞɚɧɧɨɝɨ ɪɚɡɦɟɪɚ ɭɞɚɥɟɧɢɟ ɜɫɟɣ ɫɬɪɭɤɬɭɪɵ ɢɥɢ ɟɟ ɱɚɫɬɢ ɧɟ ɩɪɨɢɡɜɨɞɢɬɫɹ, ɩɪɨɫɬɨ ɩɪɟɤɪɚɳɚɟɬɫɹ ɪɨɫɬ.
ɋɪɚɜɧɟɧɢɟ ɚɥɝɨɪɢɬɦɨɜ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ȼ ɬɚɛɥ. 4.9 ɩɪɟɞɫɬɚɜɥɟɧɵ ɫɜɟɞɟɧɢɹ ɨ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ ɮɚɣɥɨɜ ɧɚɛɨɪɚ CalgCC ɤɨɦɩɪɟɫɫɨɪɚɦɢ, ɪɟɚɥɢɡɭɸɳɢɦɢ ɫɨɨɬɜɟɬɫɬɜɭɸɳɢɟ ɚɥɝɨɪɢɬɦɵ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ. ȼ ɩɟɪɜɨɣ ɫɬɪɨɤɟ ɭɤɚɡɚɧɨ ɧɚɡɜɚɧɢɟ ɚɥɝɨɪɢɬɦɚ, ɜɨ ɜɬɨɪɨɣ, ɩɨ ɧɟɨɛɯɨɞɢɦɨɫɬɢ, ɩɨɪɹɞɨɤ ɢɫɩɨɥɶɡɨɜɚɧɧɨɣ ɦɨɞɟɥɢ — ɫɬɪɨɤɚ «o-N» ɭɤɚɡɵɜɚɟɬ, ɱɬɨ ɢɫɩɨɥɶɡɨɜɚɥɚɫɶ ɦɨɞɟɥɶ ɩɨɪɹɞɤɚ N. ȼ ɫɬɪɨɤɟ «ɂɬɨɝɨ» ɭɤɚɡɚɧɚ ɫɪɟɞɧɹɹ ɧɟ ɜɡɜɟɲɟɧɧɚɹ ɩɨ ɪɚɡɦɟɪɭ ɮɚɣɥɨɜ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɜɫɟɝɨ CalgCC.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 191 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
Ⱥɥɝɨɪɢɬɦ cPPMII ɪɟɚɥɢɡɭɟɬ ɦɟɯɚɧɢɡɦ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɢ ɢɫɩɨɥɶɡɭɟɬ SEE-d2. Ɉɩɢɫɚɧɢɟ ɩɪɨɱɢɯ ɚɥɝɨɪɢɬɦɨɜ ɛɵɥɨ ɞɚɧɨ ɜɵɲɟ. Ɍɚɛɥɢɰɚ 4.9 ADSM DAFC WORD PPMC PPMC PPM* PPMD cPPMII o-3 o-5 o-5 o-64 Bib Book1 Book2 Geo News Obj1 Obj2 Paper1 Paper2 Pic Progc Progl Progp Trans ɂɬɨɝɨ
2.07 2.11 2.03 1.46 1.84 1.60 1.81 1.96 2.08 7.77 1.90 2.18 2.14 2.06
2.08 2.17 2.04 1.72 1.84 1.55 1.39 1.90 2.08 8.89 1.81 2.22 2.08 1.95
3.65 2.96 3.19 1.58 2.60 1.78 1.84 3.10 3.35 8.99 2.95 4.21 4.17 4.19
3.79 3.23 3.54 1.67 3.02 2.13 2.97 3.23 3.27 7.34 3.21 4.21 4.35 4.52
4.17 3.42 4.00 1.69 3.33 2.14 3.27 3.38 3.39 9.76 3.32 4.62 4.57 5.19
4.19 3.33 3.96 1.66 3.31 2.00 3.29 3.38 3.39 9.41 3.33 4.79 4.94 5.52
4.26 3.48 4.06 1.70 3.39 2.14 3.31 3.42 3.46 9.88 3.36 4.73 4.65 5.33
4.76 3.74 4.49 1.92 3.74 2.29 3.79 3.74 3.77 11.43 3.70 5.76 5.76 6.84
2.36
2.41
3.47
3.61
4.02
4.04
4.08
4.70
Ɍɚɤɢɦ ɨɛɪɚɡɨɦ, ɢɡɨɳɪɟɧɧɵɟ ɦɨɞɟɥɢ ɛɨɥɶɲɨɝɨ ɩɨɪɹɞɤɚ ɨɛɟɫɩɟɱɢɜɚɸɬ ɥɭɱɲɟɟ ɫɠɚɬɢɟ ɞɚɧɧɵɯ, ɧɨ ɪɚɡɧɢɰɚ ɜ ɩɪɨɢɡɜɨɞɢɬɟɥɶɧɨɫɬɢ ɫɯɟɦ ɨɛɵɱɧɨ ɫɨɫɬɚɜɥɹɟɬ ɥɢɲɶ ɞɟɫɹɬɤɢ, ɚ ɬɨ ɢ ɟɞɢɧɢɰɵ ɩɪɨɰɟɧɬɨɜ. ɉɨɷɬɨɦɭ ɨɛɨɫɧɨɜɚɧɧɵɣ ɜɵɛɨɪ ɚɥɝɨɪɢɬɦɚ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɫɥɟɞɭɟɬ ɞɟɥɚɬɶ ɧɚ ɛɚɡɟ ɤɨɦɩɥɟɤɫɧɨɣ ɨɰɟɧɤɢ, ɜɤɥɸɱɚɸɳɟɣ ɬɚɤɠɟ ɨɛɴɟɦ ɢɫɩɨɥɶɡɭɟɦɨɣ ɩɚɦɹɬɢ, ɫɤɨɪɨɫɬɢ ɤɨɞɢɪɨɜɚɧɢɹ ɢ ɞɟɤɨɞɢɪɨɜɚɧɢɹ, ɢ, ɤɨɧɟɱɧɨ ɠɟ, ɜɵɱɢɫɥɹɟɦɨɣ ɢɦɟɧɧɨ ɞɥɹ ɬɟɯ ɞɚɧɧɵɯ, ɤɨɬɨɪɵɟ ɬɪɟɛɭɟɬɫɹ ɫɠɢɦɚɬɶ.
Ⱦɪɭɝɢɟ ɦɟɬɨɞɵ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɋɪɟɞɢ ɧɟɪɚɫɫɦɨɬɪɟɧɧɵɯ ɨɫɬɚɥɫɹ ɢɧɬɟɪɟɫɧɵɣ ɦɟɬɨɞ ɭɧɢɜɟɪɫɚɥɶɧɨɝɨ ɫɠɚɬɢɹ Context Tree Weighting («ȼɡɜɟɲɢɜɚɧɢɟ ɤɨɧɬɟɤɫɬɧɨɝɨ ɞɟɪɟɜɚ»), ɢɥɢ CTW, ɤɨɬɨɪɵɣ ɩɨɬɟɧɰɢɚɥɶɧɨ ɨɛɟɫɩɟɱɢɜɚɟɬ ɥɭɱɲɭɸ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɫɪɟɞɢ ɜɫɟɯ ɢɡɜɟɫɬɧɵɯ ɚɥɝɨɪɢɬɦɨɜ [16]. 192 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ȼ CTW ɩɪɢ ɨɰɟɧɤɟ ɜɟɪɨɹɬɧɨɫɬɢ ɫɢɦɜɨɥɚ ɢɫɩɨɥɶɡɭɟɬɫɹ ɫ ɧɟɤɨɬɨɪɵɦ ɜɟɫɨɦ ɫɬɚɬɢɫɬɢɤɚ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ-ɩɪɟɞɤɨɜ, ɬ.ɟ. ɩɪɨɢɡɜɨɞɢɬɫɹ ɹɜɧɨɟ ɜɡɜɟɲɢɜɚɧɢɟ. Ʉɨɧɬɟɤɫɬɧɨɟ ɦɨɞɟɥɢɪɨɜɚɧɢɟ ɨɝɪɚɧɢɱɟɧɧɨɝɨ ɩɨɪɹɞɤɚ ɯɨɪɨɲɨ ɪɚɛɨɬɚɟɬ ɧɚ ɩɪɚɤɬɢɤɟ, ɨɛɟɫɩɟɱɢɜɚɹ ɜɵɫɨɤɭɸ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ ɩɪɢ ɬɟɪɩɢɦɵɯ ɬɪɟɛɨɜɚɧɢɹɯ ɤ ɜɵɱɢɫɥɢɬɟɥɶɧɵɦ ɪɟɫɭɪɫɚɦ. ɇɨ ɨɧɨ ɩɪɟɞɫɬɚɜɥɹɟɬ ɫɨɛɨɣ ɜɫɟɝɨ ɥɢɲɶ ɨɞɢɧ ɢɡ ɬɢɩɨɜ ɤɨɧɬɟɤɫɬɧɨɝɨ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɜ ɲɢɪɨɤɨɦ ɫɦɵɫɥɟ. Ɇɨɠɧɨ ɨɬɦɟɬɢɬɶ ɞɪɭɝɢɟ ɦɟɬɨɞɵ: • ɦɨɞɟɥɢ ɫɨɫɬɨɹɧɢɣ; ɜ ɤɚɱɟɫɬɜɟ ɤɨɧɤɪɟɬɧɨɝɨ ɚɥɝɨɪɢɬɦɚ ɦɨɠɧɨ ɭɤɚɡɚɬɶ «Ⱦɢɧɚɦɢɱɟɫɤɨɟ ɦɚɪɤɨɜɫɤɨɟ ɫɠɚɬɢɟ» (Dynamic Markov Compression, ɢɥɢ DMC) [4, 7]; • ɝɪɚɦɦɚɬɢɱɟɫɤɢɟ ɦɨɞɟɥɢ; ɤɨɧɤɪɟɬɧɵɣ ɚɥɝɨɪɢɬɦ — SEQUITUR [11]; • ɦɨɞɟɥɢ ɫ ɢɫɩɨɥɶɡɨɜɚɧɢɟɦ ɢɫɤɭɫɫɬɜɟɧɧɵɯ ɧɟɣɪɨɧɧɵɯ ɫɟɬɟɣ ɞɥɹ ɩɨɫɬɪɨɟɧɢɹ ɩɪɟɞɫɤɚɡɚɬɟɥɹ [14]. Ɋɚɫɫɦɨɬɪɟɧɢɟ ɚɥɝɨɪɢɬɦɨɜ ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɞɚɧɧɵɯ ɜɢɞɨɜ ɜɵɯɨɞɢɬ ɡɚ ɪɚɦɤɢ ɷɬɨɣ ɤɧɢɝɢ.
ȼɨɩɪɨɫɵ ɞɥɹ ɫɚɦɨɤɨɧɬɪɨɥɹ8 1. Ɉɛɴɹɫɧɢɬɟ ɫɜɹɡɶ ɦɟɠɞɭ ɬɨɱɧɨɫɬɶɸ ɩɪɟɞɫɤɚɡɚɧɢɹ ɡɧɚɱɟɧɢɣ ɞɚɧɧɵɯ ɢ ɫɬɟɩɟɧɶɸ ɫɠɚɬɢɹ. 2. ɑɬɨ ɫɨɛɨɣ ɩɪɟɞɫɬɚɜɥɹɟɬ ɦɨɞɟɥɶ ɢɫɬɨɱɧɢɤɚ ɞɚɧɧɵɯ ɜ ɫɥɭɱɚɟ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɞɥɹ ɦɨɞɟɥɢɪɨɜɚɧɢɹ PPM-ɚɥɝɨɪɢɬɦɚ? 3. ɉɨɱɟɦɭ ɬɟɯɧɢɤɭ ɭɯɨɞɨɜ ɦɨɠɧɨ ɨɯɚɪɚɤɬɟɪɢɡɨɜɚɬɶ ɤɚɤ ɫɩɨɫɨɛ ɧɟɹɜɧɨɝɨ ɜɡɜɟɲɢɜɚɧɢɹ ɫɬɚɬɢɫɬɢɤɢ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ? 4. ȼ ɤɚɤɢɯ ɫɥɭɱɚɹɯ ɨɰɟɧɤɚ ɜɟɪɨɹɬɧɨɫɬɢ ɭɯɨɞɚ ɦɨɠɟɬ ɪɚɜɧɹɬɶɫɹ ɧɭɥɸ? 5. ɉɪɢɜɟɞɢɬɟ ɩɪɢɦɟɪ ɛɥɨɤɚ ɞɚɧɧɵɯ, ɤɨɬɨɪɵɟ ɜɵɝɨɞɧɟɟ ɫɠɢɦɚɬɶ, ɩɪɟɞɫɤɚɡɵɜɚɹ ɜɟɪɨɹɬɧɨɫɬɶ ɫɢɦɜɨɥɨɜ ɧɚ ɛɚɡɟ ɢɯ ɛɟɡɈɬɜɟɬɵ ɤ ɜɨɩɪɨɫɚɦ ɢ ɭɩɪɚɠɧɟɧɢɹɦ ɢ ɢɫɯɨɞɧɵɟ ɬɟɤɫɬɵ ɩɪɨɝɪɚɦɦ ɜɵ ɦɨɠɟɬɟ ɧɚɣɬɢ ɧɚ http://www.compression.ru/ 8
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 193 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
ɭɫɥɨɜɧɵɯ ɱɚɫɬɨɬ, ɚ ɧɟ ɫ ɩɨɦɨɳɶɸ PPM-ɦɨɞɟɥɢɪɨɜɚɧɢɹ ɩɨɪɹɞɤɚ 1. 6. ɉɨɱɟɦɭ ɩɪɢɦɟɧɟɧɢɟ ɦɟɬɨɞɚ ɢɫɤɥɸɱɟɧɢɹ ɜɫɟɝɞɚ ɭɥɭɱɲɚɟɬ ɫɬɟɩɟɧɶ ɫɠɚɬɢɹ? 7. Ʉɚɤ ɜɵ ɞɭɦɚɟɬɟ, ɰɟɥɟɫɨɨɛɪɚɡɧɨ ɥɢ ɩɪɢɦɟɧɟɧɢɟ ɦɟɬɨɞɚ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɞɥɹ ɨɛɧɨɜɥɟɧɢɹ ɫɬɚɬɢɫɬɢɤɢ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɟɣ ɭɯɨɞɚ? 8. ɉɨɱɟɦɭ ɜ ɫɥɭɱɚɟ ɢɫɩɨɥɶɡɨɜɚɧɢɹ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɩɪɢɦɟɧɟɧɢɟ ɦɟɬɨɞɚ ɢɫɤɥɸɱɟɧɢɹ ɩɪɢ ɨɛɧɨɜɥɟɧɢɢ ɨɛɵɱɧɨ ɧɟ ɩɨɡɜɨɥɹɟɬ ɞɨɫɬɢɝɚɬɶ ɩɨɬɟɧɰɢɚɥɶɧɨ ɜɨɡɦɨɠɧɨɣ ɫɬɟɩɟɧɢ ɫɠɚɬɢɹ? 9. ɉɨɱɟɦɭ ɦɟɬɨɞ ɧɚɫɥɟɞɨɜɚɧɢɹ ɢɧɮɨɪɦɚɰɢɢ ɹɜɥɹɟɬɫɹ ɩɨɬɟɧɰɢɚɥɶɧɨ ɛɨɥɟɟ ɦɨɳɧɵɦ ɫɩɨɫɨɛɨɦ ɤɨɦɩɟɧɫɚɰɢɢ ɧɟɞɨɫɬɚɬɤɚ ɫɬɚɬɢɫɬɢɤɢ ɜ ɤɨɧɬɟɤɫɬɧɵɯ ɦɨɞɟɥɹɯ ɜɵɫɨɤɢɯ ɩɨɪɹɞɤɨɜ, ɱɟɦ ɦɟɬɨɞ ɜɵɛɨɪɚ ɥɨɤɚɥɶɧɨɝɨ ɩɨɪɹɞɤɚ? 10.ȼ ɱɟɦ ɢɞɟɹ ɫɩɨɫɨɛɨɜ ɭɥɭɱɲɟɧɢɹ ɬɨɱɧɨɫɬɢ ɩɪɟɞɫɤɚɡɚɧɢɹ ɩɪɢ ɨɛɪɚɛɨɬɤɟ ɧɟɨɞɧɨɪɨɞɧɵɯ ɞɚɧɧɵɯ? 11.ɉɨɱɟɦɭ ɱɟɦ ɢɡɛɵɬɨɱɧɟɟ ɫɨ ɫɬɚɬɢɫɬɢɱɟɫɤɨɣ ɬɨɱɤɢ ɡɪɟɧɢɹ ɞɚɧɧɵɟ, ɬɟɦ ɫɤɨɪɨɫɬɶ ɢɯ ɨɛɪɚɛɨɬɤɢ PPM-ɚɥɝɨɪɢɬɦɚɦɢ ɜɵɲɟ? 12.ɍɤɚɠɢɬɟ ɡɚɞɚɱɢ, ɩɪɢ ɪɟɲɟɧɢɢ ɤɨɬɨɪɵɯ ɦɨɠɟɬ ɢɫɩɨɥɶɡɨɜɚɬɶɫɹ PPM-ɦɨɞɟɥɢɪɨɜɚɧɢɟ.
Ʌɢɬɟɪɚɬɭɪɚ 1. ɒɤɚɪɢɧ Ⱦ. ɉɨɜɵɲɟɧɢɟ ɷɮɮɟɤɬɢɜɧɨɫɬɢ ɚɥɝɨɪɢɬɦɚ PPM // ɉɪɨɛɥɟɦɵ ɩɟɪɟɞɚɱɢ ɢɧɮɨɪɦɚɰɢɢ, 34(3), ɫ.44-54, 2001. 2. Bell T.C., Witten I.H., Cleary, J.G. Modeling for text compression // ACM Computer Surveys, 24(4), pp.555-591, 1989. 3. Bloom C. Solving the problems of context modeling // California Institute of Technology, 1996. 4. Bunton S. On-Line Stochastic Processes in Data Compression // PhD thesis, University of Washington, 1996.
194 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
5. Cleary J.G., Witten I.H. Data compression using adaptive coding and partial string matching // IEEE Transactions on Communications, Vol. 32(4), pp.396-402, April 1984. 6. Cleary J.G., Teahan W.J. Unbounded length contexts for PPM // The Computer Journal, 40 (2/3), pp. 67-75. 1997. 7. Cormack G.V., Horspool R.N. Data compression using dynamic Markov modelling // The Computer Journal 30(6), pp.541-550. Dec. 1987. 8. Howard P.G. The design and analysis of efficient lossless data compression systems // PhD thesis, Brown University, Providence, Rhode Island. 1993. 9. Lelewer D.A., Hirschberg D.S. Streamlining Context Models for Data Compression. // Proceedings of Data Compression Conference, Snowbird, Utah, pp.313-322, 1991. 10. Moffat A. Implementing the PPM data compression scheme // IEEE Transactions on Communications, Vol. 38(11), pp.19171921, Nov. 1990. 11. Nevill-Manning C.G., Witten I.H. Linear-time, incremental hierarchy inference for compression // Proceedings of Data Compression Conference, J.A. Storer and M. Cohn (Eds.), Los Alamitos, CA: IEEE Press, pp.3-11. 1997. 12. Rissanen J.J., Langdon G.G. Universal modeling and coding // IEEE Transactions on Information Theory, Vol. 27(1), pp.12-23, Jan. 1981. 13. Shannon C.E. A mathematical theory of communication // The Bell System Technical Journal, Vol. 27, pp. 379–423, 623–656, July, October, 1948. 14. Schmidhuber J. Sequential neural text compression // IEEE Transactions on Neural Networks, Vol. 7(1), pp. 142-146. 1996. 15. Teahan W.J. Probability estimation for PPM // Proceedings of the New Zealand Computer Science Research Students Conference, 1995. University of Waikato, Hamilton, New Zealand.
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 195 http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
16. Willems F.M.J., Shtarkov Y.M., Tjalkens T.J. The context-tree weighting method: Basic properties // IEEE Transactions on Information Theory, Vol. 41(3): pp. 653-664, May 1995. 17. Witten I.H., Bell T.C. The zero-frequency problem: estimating the probabilities of novel events in adaptive text compression // IEEE Transactions on Information Theory, Vol. 37(4), pp. 10851094. July 1991. 18. Witten I.H., Bray Z., Mahoui M., Teahan B. Text mining: a new frontier for lossless compression // University of Waikato, NZ, 1999.
ɋɩɢɫɨɤ ɚɪɯɢɜɚɬɨɪɨɜ ɢ ɤɨɦɩɪɟɫɫɨɪɨɜ 1. Bloom C. (1996) PPMZ — PPM Based Compressor — Win95/NT version. ftp://ftp.elf.stuba.sk/pub/pc/pack/ppmz_ntx.zip 2. Herklotz U. (2001) UHARC — high compression multimedia archiver. ftp://ftp.elf.stuba.sk/pub/pc/pack/uharc04.zip 3. Hirvola H. (1995) HA — file archiver utility. ftp://ftp.elf.stuba.sk/pub/pc/pack/ha0999.zip 4. Lyapko G. (2000) ARHANGEL — file archiving utility. ftp://ftp.elf.stuba.sk/pub/pc/pack/arh140.zip 5. Lyapko G. (1997) LGHA — archive processor. ftp://ftp.elf.stuba.sk/pub/pc/pack/lgha11g.zip 6. Shelwien E. (2001) PPMY — context modelling compressor. http://www.pilabs.org.ua/sh/ppmy_3b.zip 7. Shkarin D. (1999) BMF — lossless image compressor. ftp://ftp.elf.stuba.sk/pub/pc/pack/bmf_1_10.zip 8. Shkarin D. (2001) PPMDH — fast PPM compressor for textual data. ftp://ftp.elf.stuba.sk/pub/pc/pack/ppmdh.rar 9. Smirnov M. (2002) PPMN — not so fast PPM compressor. http://www.compression.ru/ms/ppmnb1+.rar 10. Sutton I. (1998) BOA constrictor archiver. ftp://ftp.elf.stuba.sk/pub/pc/pack/boa058.zip 11. Taylor M. (2000) RK — file archiver. ftp://ftp.elf.stuba.sk/pub/pc/pack/rk104a1d.exe 196 Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X http://www.compression.ru/
Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ / Ɋɚɡɞɟɥ 1 http://www.compression.ru/
12. Taylor M. (1999) RKUC — universal compressor. ftp://ftp.elf.stuba.sk/pub/pc/pack/rkuc104.zip 13. Valentini S. (1996) X1 archiver. ftp://ftp.elf.stuba.sk/pub/pc/pack/x1dos95a.zip 14. Ziganshin B. (1997). CM — static context modeling archiver. http://sochi.net.ru/~maxime/src/cm.cpp.gz
Ʉɧɢɝɚ “Ɇɟɬɨɞɵ ɫɠɚɬɢɹ ɞɚɧɧɵɯ”. ISBN 5-86404-170-X 197 http://www.compression.ru/