From 906a4b4ace96aaf18a9d135d5324125d1470c1b8 Mon Sep 17 00:00:00 2001 From: glenux Date: Mon, 31 Oct 2005 08:21:06 +0000 Subject: [PATCH] --- configure.in | 2 +- doc/enonce/compression/tp1.html | 144 ++++++++++++++ doc/enonce/cours.css | 341 ++++++++++++++++++++++++++++++++ doc/enonce/graphics/vcss.gif | Bin 0 -> 1547 bytes doc/enonce/graphics/vxhtml10 | Bin 0 -> 2331 bytes 5 files changed, 486 insertions(+), 1 deletion(-) create mode 100644 doc/enonce/compression/tp1.html create mode 100644 doc/enonce/cours.css create mode 100644 doc/enonce/graphics/vcss.gif create mode 100644 doc/enonce/graphics/vxhtml10 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 0000000000000000000000000000000000000000..020c75a73a8e73243d762f000ab6e47c24f2418a GIT binary patch literal 1547 zcmd7R`#;lr9Ki9*?w3;lv0J2Bx4B zfYsI2IB^%wQ|b^=9eA;6X#CyG%nXOasjjY;N~Nu>t#zv5;=2Pml~3q&Iso9(rArhF zW#-+I`TkPnqw$Q43>*$;P}Jwnt!FZsF&DC9 zV`F=Jdslm-j+JzRCoK67CH z5di}r0erbM`0^ouUg1&sf~4e>%c;V&E9uDzSy@z&E6%%mEnh+_D3tzEBrBGAdf14v zCFK?6@~Y|@+OMTIb1LuLscmekE4i7_a95fCTYJ^5Rz=&x+>XAYuKFG|=zmu5SkwT6 z;9>-X$U{P7Z^m*_Xfy_3wZzY#Y07~17%~?(A=Vjx^9n^_k}>8G;{5#ezR&JLiol!r zV9T6U7=+Y%iSPq{BZ*PAI%K~p{ynQ}x zLbLsZn8sIJRDs_zJ@c^LTjsXe*=pRCy z*I*Qh6~2z(v*w2-PvKLShoNT+KPfYa&RnOIvtub^L%2*|qn(=j zEQLkVc?As)_Rt3+*D<#4w+ISwnxrAZ78bshhCgxn0Ca11DpXbsu=tRNkQ-2FdRAzb zM@)!3%cGJDnVw@s1R0;x6TcB0{UdT|@T64a6&9LjMk9d-*cEQ~6^rjJ47~4+e1MAv zLy}cGVX^8XK@4#NR_JQ26pCKE@ALjq#{|=#W-_dA#K5KpV$qhY0ey*As&FH5k6B!| zqrR`j3%4E}R^q|G+<^g@WODKLJ7e3}La%9IJDq(%ofYsA!}|_Km%xo6JvP3LRXPxo zQ$lk{+!T4D9O3WinLO?y17>(NoHAB2RUuBBU~h{GeO(%Q)e8j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