Afegint coses a la presentació
authorviric@mandarina
Mon, 15 Dec 2008 01:06:43 +0000
changeset 253 e3aa70211aee
parent 252 d3a405d0742f
child 254 aa2f8de82091
Afegint coses a la presentació
diapositives/Dctjpeg-wikipedia.png
diapositives/base8x8-2-8x8.png
diapositives/base8x8.pgm
diapositives/flors-b.png
diapositives/flors-cb-211-rescaled.png
diapositives/flors-cb-211.png
diapositives/flors-cb.png
diapositives/flors-cr.png
diapositives/flors-g.png
diapositives/flors-r.png
diapositives/flors-y.png
diapositives/flors.png
diapositives/intervals-lena.png
diapositives/qjpegrest.html
src/dctexample.c
Binary file diapositives/Dctjpeg-wikipedia.png has changed
Binary file diapositives/base8x8-2-8x8.png has changed
Binary file diapositives/base8x8.pgm has changed
Binary file diapositives/flors-b.png has changed
Binary file diapositives/flors-cb-211-rescaled.png has changed
Binary file diapositives/flors-cb-211.png has changed
Binary file diapositives/flors-cb.png has changed
Binary file diapositives/flors-cr.png has changed
Binary file diapositives/flors-g.png has changed
Binary file diapositives/flors-r.png has changed
Binary file diapositives/flors-y.png has changed
Binary file diapositives/flors.png has changed
Binary file diapositives/intervals-lena.png has changed
--- a/diapositives/qjpegrest.html	Sun Dec 14 20:00:34 2008 +0000
+++ b/diapositives/qjpegrest.html	Mon Dec 15 01:06:43 2008 +0000
@@ -45,11 +45,11 @@
 
 <!--<img src="keys.jpg" alt=
 "Cover page images (keys)" class="cover" /><br clear="all" /> -->
-
+<br/><br/><br/><br/><br/>
 <h1>Restauració d'imatges JPEG</h1>
 
 <p>Autor: <a href="http://vicerveza.homeunix.net/">Lluís Batlle i Rossell</a>,
-&lt;<a href="mailto:viric@vicerveza.homeunix.net">dsr@w3.org</a>&gt;<br />
+&lt;<a href="mailto:viric@vicerveza.homeunix.net">viric@vicerveza.homeunix.net</a>&gt;<br />
 <p>Director: <a href="http://www-ma4.upc.edu/~aroca/">Josep Maria Aroca i Farrerons</a>,
 &lt;<a href="mailto:viric@vicerveza.homeunix.net">aroca@ma4.upc.edu</a>&gt;<br />
 </div>
@@ -58,7 +58,7 @@
 <h1>Estructura</h1>
 <ul>
 <li>Motius
-<li>Pèrdua als JPEG
+<li>Pèrdues als JPEG
 <li>Tècniques de recuperació
 <li>Implementació
 </ul>
@@ -93,13 +93,14 @@
 <div class="slide">
 <h1>Canvi dels plans de color</h1>
 <h2>RGB a YCbCr</h2>
-<p><img src=""/></p>
+<p><img height=200 src="flors-r.png"/> <img height=200 src="flors-g.png"> <img height=200 src="flors-b.png"> <img height=200 src="flors.png"/></p>
+<p><img height=200 src="flors-y.png"/> <img height=200 src="flors-cb.png"> <img height=200 src="flors-cr.png"></p>
 </div>
 
 <div class="slide">
 <h1>Delmat dels plans de color</h1>
-<h2>1x1:2x2:2x2</h2>
-<p><img src=""/></p>
+<h2>2x2:1x1:1x1 (blavor)</h2>
+<p><img height=380 src="flors-cb.png"/><img height=200 src="flors-cb-211.png"/><img height=380 src="flors-cb-211-rescaled.png"/></p>
 </div>
 
 <div class="slide">
@@ -108,11 +109,170 @@
 <li>Divisió en blocs de 8x8 independents
 <li>Enmirallat als blocs incomplets
 <li>Transformació DCT per bloc
+</ul>
+<p><img height=380 src="Dctjpeg-wikipedia.png"/> <img height=380 src="base8x8-2-8x8.png"/></p>
 </div>
 
 <div class="slide">
 <h1>Transformada DCT per pla [2]</h1>
 <h2>Exemple de bloc transformat</h2>
+<font size="-2">
+<table>
+<tr>
+<td>
+<table border=1>
+<tr>
+<td>127
+<td>127
+<td>127
+<td>127
+<td>127
+<td>127
+<td>127
+<td>0
+<tr>
+<td>127
+<td>127
+<td>127
+<td>0
+<td>0
+<td>127
+<td>0
+<td>127
+<tr>
+<td>127
+<td>127
+<td>0
+<td>127
+<td>127
+<td>0
+<td>127
+<td>127
+<tr>
+<td>127
+<td>0
+<td>127
+<td>0
+<td>127
+<td>127
+<td>0
+<td>127
+<tr>
+<td>191
+<td>0
+<td>191
+<td>191
+<td>0
+<td>191
+<td>0
+<td>191
+<tr>
+<td>191
+<td>191
+<td>0
+<td>191
+<td>191
+<td>0
+<td>191
+<td>191
+<tr>
+<td>191
+<td>0
+<td>191
+<td>0
+<td>0
+<td>191
+<td>191
+<td>191
+<tr>
+<td>0
+<td>191
+<td>191
+<td>191
+<td>191
+<td>191
+<td>191
+<td>191
+</table>
+<td>
+<table border=1>
+<tr>
+<td>914.25
+<td>-18.30
+<td>82.36
+<td>-13.49
+<td>39.75
+<td>14.22
+<td>94.96
+<td>-7.02
+<tr>
+<td>-173.46
+<td>128.41
+<td>-12.29
+<td>60.55
+<td>5.73
+<td>-34.41
+<td>-7.00
+<td>-6.30
+<tr>
+<td>82.36
+<td>-22.47
+<td>-58.21
+<td>-2.88
+<td>-168.41
+<td>-14.50
+<td>-84.32
+<td>15.02
+<tr>
+<td>43.19
+<td>60.55
+<td>30.28
+<td>33.45
+<td>35.68
+<td>88.66
+<td>1.19
+<td>-21.81
+<tr>
+<td>39.75
+<td>0.52
+<td>-168.41
+<td>-17.90
+<td>-39.75
+<td>-7.97
+<td>112.78
+<td>-19.59
+<tr>
+<td>-48.80
+<td>-34.41
+<td>26.71
+<td>88.66
+<td>-18.63
+<td>46.05
+<td>6.01
+<td>116.77
+<tr>
+<td>94.96
+<td>5.09
+<td>-84.32
+<td>-4.57
+<td>112.78
+<td>-22.99
+<td>-339.29
+<td>-3.40
+<tr>
+<td>15.02
+<td>-6.30
+<td>8.21
+<td>-21.81
+<td>-11.80
+<td>116.77
+<td>75.79
+<td>-48.91
+</table>
+</table>
+</font>
+
+
 </div>
 
 <div class="slide">
@@ -120,7 +280,237 @@
 <ul>
 <li>Divisió i arrodoniment
 </ul>
-<h2>Exemple de bloc quantitzat</h2>
+<h2>Exemple de bloc quantitzat (q=40)</h2>
+<font size="-1">
+<table>
+<tr>
+<td>
+<table border=1>
+<tr>
+<td>914.25
+<td>-18.30
+<td>82.36
+<td>-13.49
+<td>39.75
+<td>14.22
+<td>94.96
+<td>-7.02
+<tr>
+<td>-173.46
+<td>128.41
+<td>-12.29
+<td>60.55
+<td>5.73
+<td>-34.41
+<td>-7.00
+<td>-6.30
+<tr>
+<td>82.36
+<td>-22.47
+<td>-58.21
+<td>-2.88
+<td>-168.41
+<td>-14.50
+<td>-84.32
+<td>15.02
+<tr>
+<td>43.19
+<td>60.55
+<td>30.28
+<td>33.45
+<td>35.68
+<td>88.66
+<td>1.19
+<td>-21.81
+<tr>
+<td>39.75
+<td>0.52
+<td>-168.41
+<td>-17.90
+<td>-39.75
+<td>-7.97
+<td>112.78
+<td>-19.59
+<tr>
+<td>-48.80
+<td>-34.41
+<td>26.71
+<td>88.66
+<td>-18.63
+<td>46.05
+<td>6.01
+<td>116.77
+<tr>
+<td>94.96
+<td>5.09
+<td>-84.32
+<td>-4.57
+<td>112.78
+<td>-22.99
+<td>-339.29
+<td>-3.40
+<tr>
+<td>15.02
+<td>-6.30
+<td>8.21
+<td>-21.81
+<td>-11.80
+<td>116.77
+<td>75.79
+<td>-48.91
+</table>
+<td>
+<table border=1>
+<tr>
+<td>20
+<td>14
+<td>13
+<td>20
+<td>30
+<td>50
+<td>64
+<td>76
+<tr>
+<td>15
+<td>15
+<td>18
+<td>24
+<td>33
+<td>73
+<td>75
+<td>69
+<tr>
+<td>18
+<td>16
+<td>20
+<td>30
+<td>50
+<td>71
+<td>86
+<td>70
+<tr>
+<td>18
+<td>21
+<td>28
+<td>36
+<td>64
+<td>109
+<td>100
+<td>78
+<tr>
+<td>23
+<td>28
+<td>46
+<td>70
+<td>85
+<td>136
+<td>129
+<td>96
+<tr>
+<td>30
+<td>44
+<td>69
+<td>80
+<td>101
+<td>130
+<td>141
+<td>115
+<tr>
+<td>61
+<td>80
+<td>98
+<td>109
+<td>129
+<td>151
+<td>150
+<td>126
+<tr>
+<td>90
+<td>115
+<td>119
+<td>123
+<td>140
+<td>125
+<td>129
+<td>124
+</table>
+<td>
+<table border=1>
+<tr>
+<td>46
+<td>-1
+<td>6
+<td>-1
+<td>1
+<td>0
+<td>1
+<td>0
+<tr>
+<td>-12
+<td>9
+<td>-1
+<td>3
+<td>0
+<td>0
+<td>0
+<td>0
+<tr>
+<td>5
+<td>-1
+<td>-3
+<td>0
+<td>-3
+<td>0
+<td>-1
+<td>0
+<tr>
+<td>2
+<td>3
+<td>1
+<td>1
+<td>1
+<td>1
+<td>0
+<td>0
+<tr>
+<td>2
+<td>0
+<td>-4
+<td>0
+<td>0
+<td>0
+<td>1
+<td>0
+<tr>
+<td>-2
+<td>-1
+<td>0
+<td>1
+<td>0
+<td>0
+<td>0
+<td>1
+<tr>
+<td>2
+<td>0
+<td>-1
+<td>0
+<td>1
+<td>0
+<td>-2
+<td>0
+<tr>
+<td>0
+<td>0
+<td>0
+<td>0
+<td>0
+<td>1
+<td>1
+<td>0
+</table>
+</table>
+</font>
 </div>
 
 <div class="slide">
@@ -138,6 +528,7 @@
 <h1>Descodificació convencional [1]</h1>
 <ul>
 <li>Punt mig de l'interval de quantització
+<!-- ****************** Afegir imatge **************** -->
 <li>Independència entre blocs
 <li>Independència entre plans
 <li>Independència del tipus d'imatges
--- a/src/dctexample.c	Sun Dec 14 20:00:34 2008 +0000
+++ b/src/dctexample.c	Mon Dec 15 01:06:43 2008 +0000
@@ -131,6 +131,17 @@
     float input_dct[64];
     float output_dct[64];
     float output[64];
+    float quantize[64] = {
+        20, 14, 13, 20, 30, 50, 64, 76, 
+        15, 15, 18, 24, 33, 73, 75, 69, 
+        18, 16, 20, 30, 50, 71, 86, 70, 
+        18, 21, 28, 36, 64, 109, 100, 78, 
+        23, 28, 46, 70, 85, 136, 129, 96, 
+        30, 44, 69, 80, 101, 130, 141, 115, 
+        61, 80, 98, 109, 129, 151, 150, 126, 
+        90, 115, 119, 123, 140, 125, 129, 124 };
+
+
     struct bitmap obmap;
     int i,j,k;
 
@@ -153,6 +164,33 @@
         }
 
     mydct(input, input_dct);
+
+    {
+        FILE *odct, *ifile, *qtable, *qfile;
+        odct = fopen("dct.txt", "wt");
+        ifile = fopen("ifile.txt", "wt");
+        qtable = fopen("qtable.txt", "wt");
+        qfile = fopen("qfile.txt", "wt");
+        for(j=0;j < 8; ++j)
+        {
+            fprintf(odct, "<tr>\n");
+            fprintf(ifile, "<tr>\n");
+            fprintf(qtable, "<tr>\n");
+            fprintf(qfile, "<tr>\n");
+            for(i=0;i < 8; ++i)
+            {
+                fprintf(odct, "<td>%.2f\n", input_dct[j*8+i]);
+                fprintf(ifile, "<td>%.0f\n", input[j*8+i]);
+                fprintf(qtable, "<td>%.0f\n", quantize[j*8+i]);
+                fprintf(qfile, "<td>%i\n", lrint(input_dct[j*8+i]/quantize[j*8+i]));
+            }
+        }
+        fclose(odct);
+        fclose(ifile);
+        fclose(qtable);
+        fclose(qfile);
+    }
+
     myidct(input_dct, input_test);
 
     obmap = bitmap_alloc(1, 64+7, 64+7);