diff --git a/configure.in b/configure.in index 773a20d..582be10 100644 --- a/configure.in +++ b/configure.in @@ -166,7 +166,7 @@ AC_SUBST(TARGET_HAVE_READLINE) #AC_SUBST(LIBXMLPP_LIBS) -AC_CONFIG_FILES([Makefile src/Makefile src/lib/Makefile src/tools/Makefile]) +AC_CONFIG_FILES([Makefile src/Makefile src/lib/Makefile src/rle1/Makefile src/rle2/Makefile]) AC_OUTPUT dnl configure.in ends here diff --git a/doc/enonce/compression/tp1.html b/doc/enonce/compression/tp1.html new file mode 100644 index 0000000..e1677b8 --- /dev/null +++ b/doc/enonce/compression/tp1.html @@ -0,0 +1,144 @@ + + + + + TP - Documents et compression - M2-SRI + + + + + + + + + + +
+

Formats de documents et compression - TP 1

+
+ +
+

Sujet

+
+ +

On se propose de réaliser, par étapes successives, un logiciel de +(dé)compression basé sur la technique RLE et le code de Golomb.

+ +

Le RLE

+ +

Le principe du codage RLE (Run Length Encoding) est d'obtenir à partir +d'une suite de nombre supposée contenir des répétitions consécutives de mêmes +valeurs, une suite contenant:

+ +

Un tel codage nécessite en pratique d'insérer dans la suite construite des +marqueurs permettant de réaliser le décodage.

+ +

Il est facile d'observer que, par une telle méthode, certaines suites sont +«compressées»; la longueur de la suite après codage est plus +petite que la longueur de la suite originale.

+ +

La suite aaaaabcbaaaaaabbbbbb (de longueur 20) +pourraît être +encodée de façon à produire la suite [RLE]5abcb[RLE]6a[RLE]6b (de +longueur 12).

+ +
+

1. Il est demandé de réaliser dans un langage de +programmation de votre choix un +programme d'encodage et de décodage RLE (basé sur le principe précédent). Ce +programme devra permettre d'encoder tout fichier donné en entrée et produire +en sortie un fichier dont le nom sera étendu en .rl1. Ce +programme devra en outre produire en sortie le taux de compression obtenu.

+ +

Ce programme pourra être paramétré de façon à permettre à l'utilisateur de +choisir ce qu'il considère comme étant un caractère de la suite.

+ +

On testera ce programme sur une variété de fichiers communs: texte +français, binaire, bitmap d'image, etc.

+
+ +

De nombreuses variantes de ce principe sont utilisées. Par exemple, si la +suite considérée est une suite de bits, on peut s'intéresser aux suites de 0 +consécutifs situés entre deux 1.

+ +

La suite 00000100110000000101011 peut être +représentée par la suite 52071100.

+ +
+

2. Écrire un programme (dans le langage de votre choix) +permettant de coder et décoder tout fichier considéré comme une suite de +bits. Le fichier résultat sera nommé en utilisant l'extension +.rl2.

+
+ +
+

3. On étudiera les relations entre cet encodage et le précédent. Du point de +vue de l'encodage lui-même, de leurs performances relatives, etc.

+
+ +
+

4. On recherchera la spécification de formats courants +utilisant le codage RLE. On comparera les techniques employées dans ces divers +formats avec celles réalisées dans ce TP.

+
+ +

Le code de Golomb

+

En ce qui concerne le RLE du second type et précédemment décrit le +problème principal est de trouver un codage adéquat pour la suite des nombres +produits; i.e. comment coder la suite 52071100 ? Le code +de Golomb permet de construire un codage de longueur variable permettant +d'obtenir une compression raisonnablement efficace.

+ +

Code de Golombd

+

Pour l'entier n, Golombd(n) est construit +par concaténation du codage unaire du quotient de n/d et du codage +binaire tronqué du reste de n/d.

+ +

Le codage unaire d'un entier i est une suite de i +1 suivie d'un 0. Le nombre 5 se code +donc 111110.

+ +

Le codage binaire tronqué de l'entier i, +CBTd(i) est obtenu de la façon suivante:

+ +

Ainsi pour d=5, le codage du nombre 23 sera 11110110, car +11110 est le codage unaire de 4 (23/5=4) et 110 le +codage sur 3 bits de 6 (on cherche CBT5(3), on sait que +23-(5-3)=6).

+ +

Comment déterminer une valeur adéquate pour d ? Il +suffit de prendre la médiane de la suite à coder.

+ +
+

5 (difficile). Écrire un programme permettant de coder et +décoder tout fichier considéré comme une suite de bits en utilisant le code de +Golomb.

+
+
+
+

Le TP devra être rédigé (sous la forme de documents HTML) et rendu avec les +codes sources des programmes; ce au plus une semaine après la séance.

+
+ +

Valid XHTML 1.0!Valid CSS!

+ + diff --git a/doc/enonce/cours.css b/doc/enonce/cours.css new file mode 100644 index 0000000..75a4d95 --- /dev/null +++ b/doc/enonce/cours.css @@ -0,0 +1,341 @@ +DIV.resultat { + font-family: helvetica, sans-serif; + border-width: 1px 1px 1px 1px; + background-color: #ccffcc; + color: black; + margin-left: 0em; + margin-right: 0em; + margin-top: 0em; + margin-bottom: 0em; + padding-bottom: 0em; +} +DIV.resultat OL { + list-style-type : decimal; +} +DIV.resultat UL { + list-style-type : disc; +} +DIV.resultat P DEL { + text-decoration : line-through; +} +DIV.resultat P INS { + text-decoration : underline; +} +DIV.resultat H1 { + font-size: 18pt; + font-weight: normal; + background-color: #ccffcc; + color: black; +} +DIV.resultat H2 { + font-size: 14pt; + font-weight: normal; + background-color: #ccffcc; + color: black; +} +DIV.resultat P { + background-color: #ccffcc; + color: black; +} +DIV.resultat Q { + font-weight: bold; +} +DIV.resultat BLOCKQUOTE { + color: green; + font-weight : bold; +} +DIV.resultat ABBR { + background-color: white; + color: green; +} +DIV.resultat ACRONYM { + background-color: white; + color: red; +} +BODY { + font-size : 12pt; + font-family : helvetica, sans-serif; + text-align : justify; + background-color: #e7f7e0; + background-image: url(/~yunes/images/fond.gif); + color: black; +} +A:link { + color : blue; + text-decoration : none; +} +A:visited { + color : navy; + text-decoration : none; +} +A:active { + color : red; + text-decoration : none; +} +A.fin:link, A.fin:visited, A.fin:active, A.fin:hover { + color : #e7f7e0; + background-color : #e7f7e0; +} +DIV.titre { + border-width: 1px 1px 1px 1px; + background-color : #f0fff0; + background-image: url(/~yunes/images/fond-titre.gif); + color: black; + text-align: center; + margin: 0em 0em 0em 0em; + padding-bottom: 0em; +} +DIV.titre H1 { + margin-top: 0.5em; + margin-bottom: 0em; + padding-bottom: 0em; + padding-top: 0em; + text-align: center; + font-weight: bold; + font-size : 24pt; +} +DIV.titre P { + margin: 0em 0em 0em 0em; + padding: 0em 0em 0em 0em; + background-color : #f0fff0; + background-image: url(/~yunes/images/fond-titre.gif); + text-align : center; + font-weight : bold; +} +DIV.titre P.gros { + font-size : 24pt; +} +DIV.tdm { + border-width: 1px 1px 1px 1px; + background-color: #b0bfb0; + color: black; + margin-left: 0em; + margin-right: 0em; + margin-top: 0em; + margin-bottom: 0em; + padding-bottom: 0em; +} +H1 { + margin-top: 0.5em; + margin-bottom: 0em; + padding-bottom: 0em; + padding-top: 0em; + font-size : 24pt; + font-family : helvetica, sans-serif; + background-color: #b0bfb0; + color: black; + font-weight : bold; +} + +H2 { + font-size : 16pt; + font-family : helvetica, sans-serif; + font-weight : bold; + background-color: #b0bfb0; + color: black; +} +H3 { + font-size : 14pt; + font-family : helvetica, sans-serif; + font-weight : bold; +} +H4 { + font-size : 12pt; + font-family : helvetica, sans-serif; + font-weight : bold; +} +H5 { + font-size : 12pt; + font-family : helvetica, sans-serif; + font-weight : normal; + text-decoration : underline; +} + +P { + font-size : 12pt; + font-family : helvetica, sans-serif; + text-align : justify; + background-color: #e7f7e0; + background-image: url(/~yunes/images/fond.gif); + color: black; +} +P.date { + font-size : 8pt; + font-family : helvetica, sans-serif; +} +P.myquote { + margin-top : 0em; + margin-bottom : 0em; + margin-left : 3em; + margin-right : 1em; +} +P.note { + font-size: 10pt; + color: black; + background-color: #ff8888; + background-image: none; +} +P.rem { + color: black; + background-color: #efffef; + background-image: none; + margin-left: 1em; +} +P.message { + font-size : 18pt; + background-color: #cc0000; + color: #ffffff; + background-image: none; +} + +TABLE { + font-size : 12pt; + background-color: #d7e7d0; +} +OL.numeroted { + font-size:12pt; + font-family : helvetica, sans-serif; + list-style-type : decimal; +} +OL { + font-family : helvetica, sans-serif; + font-size:12pt; + list-style-type : decimal; + text-align : justify; +} + +DL { + font-size:12pt; + font-family : helvetica, sans-serif; + text-align: justify; +} + +UL { + font-size:12pt; + font-family : helvetica, sans-serif; + list-style-type : none; + text-align: justify; +} +UL.disc { + font-size:12pt; + font-family : helvetica, sans-serif; + list-style-type : disc; +} +UL SUP { + font-size: 10pt; +} +ADDRESS { + font-size: 8pt; + font-family : helvetica, sans-serif; +} +PRE { + font-family: Terminal, courier, monospace; + font-size: 10pt; + background: #e0e0e0; + border-width: 1px 1px 1px 1px; + border-style: none; + white-space: pre; + text-align: left; +} +.tag, .exc, .pkg, .jclass, .event, .mac, .fct, .macro, .src, .symb { + font-size: 12pt; + font-family: Terminal, courier, monospace; + background-color : white; +} +.def { + font-size: 12pt; + font-family: Terminal, courier, monospace; + background-color : white; +} +.opt, .com, .code, .litteral, .signal { + font-size: 12pt; + font-family: Terminal, courier, monospace; + background-color : white; +} +PRE .typing { + background-color: white; + color: black; +} +PRE .comment { + font-size: 10pt; + background-color: #c0c0c0; + color: black; +} +.type, .field { + font-size: 12pt; + font-family: Terminal, courier, monospace; + background-color: white; + color: #aa2211; +} +VAR { + font-size: 12pt; + font-family: courier, monospace; + font-style: italic; + background-color: white; +} +.var { + font-size: 12pt; + font-family: courier, monospace; + font-style: italic; + background-color: white; +} +.cst { + font-size: 12pt; + font-family: Terminal, courier, monospace; + font-weight: bold; + background-color: white; + color: #333333; +} +.car, .file, .string { + font-size: 12pt; + font-family: Terminal, courier, monospace; + background-color : white; +} +SPAN.author { + font-weight: bold; +} +SPAN.title { + font-style: italic; + font-size: 13pt; +} +A { + text-decoration: none; +} +kbd { + background-color: white; + color: black; +} +DIV.adresse { + font-family : Terminal, courier, monospace; + background-color : #999999; + border-width : 5px 5px 5px 5px; + border-style : none; + padding : 1em 1em 1em 1em; + width : 95%; + text-align : left; + font-size : 10pt; + font-style : normal; +} + +IMG.carte { + display : block; + float : right; +} + +.exemple { + background-color: #dddddd; +} +DIV.todo { + background-image: none; + background-color : #ffdddd; + border-width : 1px 1px 1px 1px; + border-style : solid; + padding : 0em 1em 0em 1em; + width : 90%; + text-align : justify; +} + +DIV.todo P { + background-image: none; + background-color : #ffdddd; +} diff --git a/doc/enonce/graphics/vcss.gif b/doc/enonce/graphics/vcss.gif new file mode 100644 index 0000000..020c75a Binary files /dev/null and b/doc/enonce/graphics/vcss.gif differ diff --git a/doc/enonce/graphics/vxhtml10 b/doc/enonce/graphics/vxhtml10 new file mode 100644 index 0000000..88f0a43 Binary files /dev/null and b/doc/enonce/graphics/vxhtml10 differ