انت هنا الان : شبكة جامعة بابل > موقع الكلية > نظام التعليم الالكتروني > مشاهدة المحاضرة
الكلية كلية العلوم للبنات
القسم قسم الحاسبات
المرحلة 4
أستاذ المادة محمد عبيد مهدي الجبوري
4/2/2011 12:08:13 PM
Move-to-Front Coding
The basic idea of this method is to maintain the alphabet A of symbols
as a list where frequently occurring symbols are located near the front. A symbol “s” is encoded as the number of symbols that precede it in this list. Thus if A=(“t”, “h”, “e”, “s”,. . . ) and the next symbol in the input stream to be encoded is “e”, it will be encoded as 2, since it is preceded by two symbols. There are several possible variants to this method; the most basic of them adds one more step: After symbol “s” is encoded, it is moved to the front of list A. Thus, after encoding “e”, the alphabet is modified to A=(“e”, “t”, “h”, “s”,. . . ). This move-to-front step reflects the hope that once “e” has been read from the input stream, it will be read many more times and will, at least for a while, be a common symbol. The move-to-front method is locally adaptive, since it adapts itself to the frequencies of symbols in local areas of the input stream.
The method thus produces good results if the input stream satisfies this hope, i.e., if it contains concentrations of identical symbols (if the local frequency of symbols changes significantly from area to area in the input stream). We call this “the concentration property.” Here are two examples that illustrate the move-to-front idea. Both assume the alphabet A=(“a”, “b”, “c”, “d”, “m”, “n”, “o”, “p”).
1. The input stream “abcddcbamnopponm” is encoded as
C = (0, 1, 2, 3, 0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3) (Table 1.1a). Without the move-to-front step it is encoded as C_ = (0, 1, 2, 3, 3, 2, 1, 0, 4, 5, 6, 7, 7, 6, 5, 4) (Table 1.14b). Both C and C_ contain codes in the same range [0, 7], but the elements of C are smaller on the average, since the input starts with a concentration of “abcd” and continues with a concentration of “mnop”. (The average value of C is 2.5, while that of C_ is 3.5.)
|
a abcdmnop 0
b abcdmnop 1
c bacdmnop 2
d cbadmnop 3
d dcbamnop 0
c dcbamnop 1
b cdbamnop 2
a bcdamnop 3
m abcdmnop 4
n mabcdnop 5
o nmabcdop 6
p onmabcdp 7
p ponmabcd 0
o ponmabcd 1
n opnmabcd 2
m nopmabcd 3
mnopabcd
(a)
|
a abcdmnop 0
b abcdmnop 1
c abcdmnop 2
d abcdmnop 3
d abcdmnop 3
c abcdmnop 2
b abcdmnop 1
a abcdmnop 0
m abcdmnop 4
n abcdmnop 5
o abcdmnop 6
p abcdmnop 7
p abcdmnop 7
o abcdmnop 6
n abcdmnop 5
m abcdmnop 4
(b)
|
a abcdmnop 0
b abcdmnop 1
c bacdmnop 2
d cbadmnop 3
m dcbamnop 4
n mdcbanop 5
o nmdcbaop 6
p onmdcbap 7
a ponmdcba 7
b aponmdcb 7
c baponmdc 7
d cbaponmd 7
m dcbaponm 7
n mdcbapon 7
o nmdcbapo 7
p onmdcbap 7
ponmdcba
(c )
|
a abcdmnop 0
b abcdmnop 1
c abcdmnop 2
d abcdmnop 3
m abcdmnop 4
n abcdmnop 5
o abcdmnop 6
p abcdmnop 7
a abcdmnop 0
b abcdmnop 1
c abcdmnop 2
d abcdmnop 3
m abcdmnop 4
n abcdmnop 5
o abcdmnop 6
p abcdmnop 7
(d)
|
Table 1.1: Encoding With and Without Move-to-Front.
2. The input stream “abcdmnopabcdmnop” is encoded as C = (0, 1, 2, 3, 4, 5, 6, 7, 7, 7, 7, 7, 7, 7, 7, 7) (Table 1.14c). Without the move-to-front step it is encoded as C_ = (0, 1, 2, 3, 4, 5, 6, 7, 0, 1, 2, 3, 4, 5, 6, 7) (Table 1.14d). The average of C is now 5.25, greater than that of C_, which is 3.5. The move-to-front rule creates a worse result in this case, since the input does not contain concentrations of identical symbols (it does not satisfy the concentration property).
المادة المعروضة اعلاه هي مدخل الى المحاضرة المرفوعة بواسطة استاذ(ة) المادة . وقد تبدو لك غير متكاملة . حيث يضع استاذ المادة في بعض الاحيان فقط الجزء الاول من المحاضرة من اجل الاطلاع على ما ستقوم بتحميله لاحقا . في نظام التعليم الالكتروني نوفر هذه الخدمة لكي نبقيك على اطلاع حول محتوى الملف الذي ستقوم بتحميله .
|