03.08.2013 Views

Lo Standard JPEG per la Compressione di Immagini Fisse - InfoCom

Lo Standard JPEG per la Compressione di Immagini Fisse - InfoCom

Lo Standard JPEG per la Compressione di Immagini Fisse - InfoCom

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

54 CAPITOLO 3. LO STANDARD <strong>JPEG</strong> PER LA COMPRESSIONE DI IMMAGINI FISSE<br />

DCT si vede che sono necessari 11 cifre binarie <strong>per</strong> rappresentare il valore del generico coefficente AC, sia prima<br />

che dopo <strong>la</strong> quantizzazione.<br />

Il campo SIZE rappresenta il numero <strong>di</strong> cifre binarie utilizzato <strong>per</strong> co<strong>di</strong>ficare il campo AMPLITUDE, cioè <strong>per</strong><br />

co<strong>di</strong>ficare il Simbolo-2, secondo lo schema <strong>di</strong> Tab.3.2.<br />

SIZE AMPLITUDE<br />

1 1, -1<br />

2 -3, -2, 2, 3<br />

3 -7, -6, -5, -4, 4, 5, 6, 7<br />

4 -15, ···, -8, 8, ···,15<br />

5 -31, ···, -16, 16, ···,31<br />

6 -63, ···, -32, 32, ···,63<br />

7 -127, ···, -64, 64, ···, 127<br />

8 -255, ···, -128, 128, ···,255<br />

9 -511, ···, -256, 256, ···,511<br />

10 -1023, ···, -512, 512, ···,1023<br />

11 -2047, ···, -1024, 1024, ···, 2047<br />

Tabel<strong>la</strong> 3.2: Co<strong>di</strong>fica del Simbolo-2<br />

<strong>Lo</strong> schema comprende anche il valore SIZE=11, necessario <strong>per</strong> rappresentare <strong>la</strong> <strong>di</strong>fferenza ∆DCi = DCi − DCi−1.<br />

Il campo RUNLENGTH rappresenta corse <strong>di</strong> zeri <strong>di</strong> lunghezze comprese fra 0 e 15, <strong>per</strong> cui occorrono 4 cifre<br />

binarie <strong>per</strong> <strong>la</strong> sua translitterazione. Poichè <strong>la</strong> lunghezza delle corse può, e s<strong>per</strong>abilmente deve, su<strong>per</strong>are il valore 15,<br />

il valore speciale (15, 0) <strong>di</strong> Simbolo-1 è utilizzato come simbolo estensione del<strong>la</strong> lunghezza <strong>di</strong> corsa (corsa lunga<br />

almeno 16). Poiché abbiamo 63 coefficienti AC, si possono incontrare fno ad un massimo <strong>di</strong> tre simboli estensione,<br />

oltre ad un Simbolo-1 detto terminatore, il cui campo RUNLENGTH completa <strong>la</strong> lunghezza totale del<strong>la</strong> corsa. Per<br />

esempio, i tre Simboli-1 consecutivi, con re<strong>la</strong>tivo Simbolo-2, (15, 0)(15, 0)(3, 4)(11) rappresentano una corsa lunga<br />

16+16+3=35 coefficienti AC nulli, terminata da un Simbolo2 <strong>di</strong> SIZE=4 cifre binarie, con AMPLITUDE=6.<br />

Il Simbolo-1 terminatore è sempre seguito da un singolo Simbolo-2, eccetto il caso nel quale oltre un certo<br />

coefficiente vi siano solo zeri: in tale caso, il valore speciale (0, 0) <strong>di</strong> Simbolo-1 viene specificato <strong>per</strong> rappresentare<br />

<strong>la</strong> fine dei dati <strong>per</strong>tinenti al blocchetto considerato.<br />

Per quanto riguarda il valore <strong>di</strong>fferenziale del coefficiente DC, <strong>la</strong> rappresentazione interme<strong>di</strong>a è simile al caso<br />

AC, con <strong>la</strong> <strong>di</strong>fferenza che Simbolo-1 comprende solo il campo SIZE con valori fra 1 e 11, come mostrato in Fig.3.8.<br />

Simbolo-1 (4 cifre binarie) Simbolo-2 (SIZE cifre binarie)<br />

SIZE<br />

4<br />

AMPLITUDE<br />

Figura 3.8: Struttura del<strong>la</strong> co<strong>di</strong>fica entropica dei coefficienti ∆DCi: Simbolo-1 e Simbolo-2.<br />

Un possibile esempio <strong>di</strong> stringa co<strong>di</strong>ficata interme<strong>di</strong>a è dunque il seguente:<br />

SIZE<br />

(2)(3),(0, 8)(116),(0, 6)(37),···,(12, 4)(12),(15, 0)(15, 0)(2, 2)(3),(0, 0)<br />

La struttura <strong>di</strong> Simbolo-1 è riassunta nel<strong>la</strong> Tab.3.3

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!