انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة

Lec #3 - Data Compression 2019/2020

الكلية كلية العلوم للبنات     القسم قسم الحاسبات     المرحلة 4
أستاذ المادة علي كاظم محمد هداب الغرابات       27/10/2019 11:18:24
Is a simple and popular lossless data compression algorithm. The idea behind this approach to data compression is this: If a data item d occurs n consecutive times in the input stream, replace the n occurrences with the single pair nd. The n consecutive occurrences of a data item are called a run length of n, and this approach to data compression is called run length encoding or RLE. We apply this idea first to text compression then to image compression.
RLE Text Compression
Just replacing "2.?all?is?too?well" with "2.?a2l?is?t2o?we2l " will not work. Clearly, the decompressor should have a way to tell that the first "2" is part of the text while the others are repetition factors for the letters "0" and "l". One way to solve this problem is to precede each repetition with a special escape character. If we use the character "@" as the escape character, then the string "2.?a@2l?is?t@2o?we@2l" can be decompressed unambiguously. However, it is longer than the original string, since it replaces two consecutive letters with three characters. We have to adopt the convention that only three or more repetitions of the same character will be replaced with a repetition factor.
The main problems with this method are the following:
1. In plain English text there are not many repetitions. There are many "doubles" but a "triple" is rare. The most repetitive character is the space. Dashes or asterisks may also repeat sometimes. In mathematical texts, some digits may repeat.
2. The character "@" may be part of the text in the input stream, in which case a different escape character must be chosen.
3. Since the repetition count is written on the output stream as a byte, it is limited to counts of up to 255. This limitation can be softened somewhat when we realize that the existence of a repetition count means that there is a repetition (at least three identical consecutive characters). We may adopt

المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .