fbpx
维基百科

截斷二進制編碼

截斷二進制編碼(Truncated binary encoding)是一種適用於擁有均勻分布特性的符號的熵編碼方式。當符號個數不為的整數次方時,比起使用普通固定長度的二元編碼,採用截斷二進制編碼能縮短平均碼長。

編碼方式 编辑

 個符號,    

 不為 的整數次方,以 個進行位元固定二元編碼時,會有 個未使用之碼字,

 

 個符號以碼長為 的二元碼,由小至大依序編碼,剩下 個符號則以碼長為 的二元碼之末 個碼字,依序編碼。

例子 编辑

 

可計算出,

 

 

 個符號須進行碼長為 之二元邊碼,剩下 個符號須進行碼長為 之二元邊碼。

如下表:

截斷二進制編碼符號 固定二元編碼符號 固定二元編碼 截斷二進制編碼
0 0 000 00
1 1 001 01
2 2 010 10
- 3 011 -
- 4 100 -
- 5 101 -
3 6 110 110
4 7 111 111

截斷二進制編碼, truncated, binary, encoding, 是一種適用於擁有均勻分布特性的符號的熵編碼方式, 當符號個數不為2, displaystyle, 的整數次方時, 比起使用普通固定長度的二元編碼, 採用能縮短平均碼長, 編碼方式, 编辑令n, displaystyle, nbsp, 個符號, displaystyle, left, right, nbsp, displaystyle, nbsp, log2n, displaystyle, lfloor, rfloor, nbsp, 當n, . 截斷二進制編碼 Truncated binary encoding 是一種適用於擁有均勻分布特性的符號的熵編碼方式 當符號個數不為2 displaystyle 2 的整數次方時 比起使用普通固定長度的二元編碼 採用截斷二進制編碼能縮短平均碼長 編碼方式 编辑令n displaystyle n nbsp 個符號 s 0 1 2 3 n 1 displaystyle s in left 0 1 2 3 n 1 right nbsp 2k n 2k 1 displaystyle 2 k leq n leq 2 k 1 nbsp k log2n displaystyle k lfloor log 2 n rfloor nbsp 當n displaystyle n nbsp 不為2 displaystyle 2 nbsp 的整數次方 以k 1 displaystyle k 1 nbsp 個進行位元固定二元編碼時 會有m displaystyle m nbsp 個未使用之碼字 m 2k 1 n u n m displaystyle m 2 k 1 n u n m nbsp 首m displaystyle m nbsp 個符號以碼長為k displaystyle k nbsp 的二元碼 由小至大依序編碼 剩下u displaystyle u nbsp 個符號則以碼長為k 1 displaystyle k 1 nbsp 的二元碼之末u displaystyle u nbsp 個碼字 依序編碼 例子 编辑當n 5 displaystyle n 5 nbsp 可計算出 22 n 22 1 k 2 displaystyle 2 2 leq n leq 2 2 1 k 2 nbsp m 3 u 2 displaystyle m 3 u 2 nbsp 首3 displaystyle 3 nbsp 個符號須進行碼長為2 displaystyle 2 nbsp 之二元邊碼 剩下2 displaystyle 2 nbsp 個符號須進行碼長為3 displaystyle 3 nbsp 之二元邊碼 如下表 截斷二進制編碼符號 固定二元編碼符號 固定二元編碼 截斷二進制編碼0 0 000 001 1 001 012 2 010 10 3 011 4 100 5 101 3 6 110 1104 7 111 111 取自 https zh wikipedia org w index php title 截斷二進制編碼 amp oldid 50088047, 维基百科,wiki,书籍,书籍,图书馆,

文章

,阅读,下载,免费,免费下载,mp3,视频,mp4,3gp, jpg,jpeg,gif,png,图片,音乐,歌曲,电影,书籍,游戏,游戏。