心衰吃什么食物好| 3月19日什么星座| 羊奶和牛奶有什么区别| 类风湿因子高吃什么药| 胃不舒服喝什么| 1997属什么| 忠心不二是什么生肖| 补气血喝什么口服液好| 一片冰心在玉壶是什么意思| 微信中抱拳是什么意思| 颈椎退行性病变是什么意思| 西梅什么时候成熟| 1970属什么生肖| 繁星是什么意思| 无法入睡是什么原因| 北京为什么叫帝都| 大腿外侧麻木是什么原因| 晚上吃什么减肥效果最好| 肺部结节是什么意思啊| 人在什么情况下会发烧| 测骨龄挂什么科| 心理健康是什么| 什么人不能喝牛奶| 尿酸低有什么危害| 夫妻肺片是什么肉| 总警监是什么级别| 为什么发烧会觉得冷| 胸闷出汗是什么原因| 三高人群适合吃什么| 胎儿畸形是什么原因造成的| 乙酰氨基酚片是什么药| 特长是什么| 肝内低密度影是什么意思| 宫颈肥大是什么意思| 女人眉毛稀少代表什么| 为什么嘴唇发紫| 勃起困难吃什么药| 吃什么可以快速排便| 宝宝出牙晚是什么原因| 生存是什么意思| 肠系膜淋巴结炎吃什么药最有效| 菁字五行属什么| 红楼梦是一部什么小说| 器材是什么意思| 血清胰岛素测定查什么| 公开课是什么意思| babyface是什么意思| 白什么什么| 餐后胆囊是什么意思| 尿胆原弱阳性什么意思| 孤芳不自赏什么意思| 中元节与什么生肖有关| 西洋参和人参有什么区别| 福肖指什么生肖| 脾虚湿气重喝什么茶| 女人湿气重吃什么药效果好| 撸铁是什么意思| 阿司匹林什么时间吃最好| 六月六是什么节| 卜在姓氏里读什么| 扁桃体发炎吃什么药比较好| 糖类抗原724偏高是什么原因| 胆红素高是什么原因引起的| 小孩脱水有什么症状| 尿隐血阳性什么意思| 养生吃什么最好| 印度为什么那么热| 一声叹息是什么意思| 什么是邪教| 1977属什么生肖| 尿检ph值偏高说明什么| 什么品牌蓝牙耳机好| 龙虎山是什么地貌| 披靡是什么意思| 眼睛胀痛是什么原因| 开心是什么意思| 兔和什么相冲| 提前来大姨妈是什么原因| 438是什么意思| 中性粒细胞高说明什么| 查抗体是做什么检查| 龙和什么属相最配| 1955年出生属什么| 麦芽是什么| 尿蛋白是什么原因造成的| 蒜薹和蒜苔有什么区别| 河南为什么简称豫| 62岁属什么| 鳄鱼的天敌是什么| 大红袍属于什么茶类| 纸尿裤和拉拉裤有什么区别| 头部ct挂什么科| 孕妇鼻炎犯了可以用什么药治疗| 什么叫切片| 心率过缓吃什么药| 躯体形式障碍是什么病| 血沉偏高说明什么| 草口耳是什么字| 大腿根部疼痛是什么原因| 梦见吃豆腐是什么意思| 鬓角长痘痘是什么原因| 做蹲起有什么好处| 打鸡血是什么意思| 气管炎咳嗽吃什么药最有效| smile是什么牌子| 告诉我们什么道理| 手足口病是什么病| 眼睛散光是什么原因造成的| 色觉异常是什么意思| 花漾是什么意思| 崩漏带下是什么症状| 什么叫快闪| 如何查自己是什么命格| 胳肢窝痒是什么原因| 耳朵为什么老是痒| 鮰鱼是什么鱼| 心魔是什么意思| 吃什么利尿| 不将就是什么意思| 因为我们没有什么不同| 贵人多忘事是什么意思| 宫颈癌做什么检查| 肾结石什么原因引起的| 烧心是什么意思| 什么奶粉比较好| 出汗多什么原因| 前列腺炎吃什么药最有效| 礼五行属什么| 腿上的肉疼是什么原因| 天官是什么意思| 脑梗什么原因导致的| 三点水一个希读什么| 小孩拉稀吃什么药| 高胆固醇吃什么药| 奔波是什么意思| 什么是花胶| 隙是什么意思| 做牛排需要什么调料| 血压高的表现症状是什么| 母亲生日送什么礼物| 喝酒头晕是什么原因| 掉头发是身体缺少什么| 什么是善| 愿闻其详是什么意思| 妤是什么意思| 脖子疼是什么原因引起的| 灶心土是什么| 离岸人民币是什么意思| 薛定谔的猫比喻什么| itp是什么意思| pgi是什么意思| 经常口腔溃疡挂什么科| 什么是盆腔炎| 失眠多梦用什么药| 耳石症看什么科| 子官肌瘤吃什么食物| 女龙配什么属相最好| 恙是什么意思| 一什么桌子| 准备要孩子需要注意什么| 看痣挂什么科| 面皮是什么做的| 六味地黄丸是治什么病| 银杯子喝水有什么好处| 大便不规律是什么原因| 葸是什么意思| 9月19日是什么星座| 咳嗽能吃什么水果| 妈妈的哥哥的老婆叫什么| 12岁属什么| 向日葵花代表什么意思| 女性分泌物发黄是什么原因| 肠道菌群失调吃什么药| 棚户区改造和拆迁有什么区别| 11月20号什么星座| 喇蛄和小龙虾什么区别| 肝功能检查什么| 梦见种树是什么兆头| 孩子百天有什么讲究| 请佛容易送佛难什么意思| 大修基金什么时候缴纳| 蓝帽子标志是什么意思| 家里出现蚂蚁预示什么| 肾结石长什么样子图片| 口水多是什么原因| 手脱皮用什么药| 听调不听宣什么意思| 四维空间是什么样子| 什么是宾格| 手脱皮吃什么药| 为什么睡不醒| 二氧化碳是什么| 肺结核吃什么药| 记吃不记打的下一句是什么| 见什么知什么| 什么是粉丝| 血常规是检查什么的| 男人湿气重吃什么药| 皮肤溃烂用什么药治愈最快| 头顶痛什么原因| 除体内湿热最好的中成药是什么| 肩膀疼去医院挂什么科| 吃槟榔有什么危害| 腿上起水泡是什么原因| 浅笑是什么意思| 总是什么意思| 蜈蚣为什么不能打死| 术后吃什么伤口愈合快| 6月26日是什么日子| 西瓜和什么食物相克| 血压高查什么项目| 米非司酮片是什么药| 倾倒是什么意思| 弱酸性是什么意思| 血小板低会有什么症状| 秦始皇的佩剑叫什么剑| 刘少奇属什么生肖| 吃什么对胰腺好| 柠檬是什么季节的水果| 吃什么可以补精子| 为什么经常长口腔溃疡| 物以类聚什么意思| 嗝气是什么原因引起的| 天秤座后面是什么星座| 女人梦见下雪是什么征兆| 肉蔻是什么样子| 水瓶座和什么座最配对| 染色体由什么组成| 9月出生的是什么星座| 红鸡蛋用什么染| 娇喘什么意思| 吃什么补充蛋白| 火龙果是什么季节的水果| 钻牛角尖什么意思| 脚背上长痣代表什么| baumwolle是什么面料| 龈颊沟在什么位置图片| 活碱是什么| yearcon是什么牌子| 桃酥为什么叫桃酥| 风团是什么| 胃肠道感冒吃什么药| 金黄金黄的什么| 男人前列腺炎有什么症状表现| 胚芽是什么意思| 为什么会长水泡| 3月5日是什么纪念日| 梦房子倒塌什么预兆| 缺钙吃什么补钙最快| 6s管理内容是什么| 右胸上方隐痛什么原因| 痰带血丝是什么原因| 猴子屁股为什么是红色| 74年属什么生肖| 病毒性感染是什么原因| 扁桃体发炎不能吃什么东西| 长的像蛇的鱼是什么鱼| 南笙是什么意思| 午餐肉是什么肉| 事急从权是什么意思| paris是什么品牌| 喝酒头疼吃什么药| 大娘的老公叫什么| 查生育能力挂什么科| 百度Jump to content

广州市花都区积极推行生态安葬 绿色殡葬改善生态环境

From Wikipedia, the free encyclopedia
百度 雒树刚强调,文化遗产工作就是要保护好、活起来,造福社会、造福人民。

Golomb coding is a lossless data compression method using a family of data compression codes invented by Solomon W. Golomb in the 1960s. Alphabets following a geometric distribution will have a Golomb code as an optimal prefix code,[1] making Golomb coding highly suitable for situations in which the occurrence of small values in the input stream is significantly more likely than large values.

Rice coding

[edit]

Rice coding (invented by Robert F. Rice) denotes using a subset of the family of Golomb codes to produce a simpler (but possibly suboptimal) prefix code. Rice used this set of codes in an adaptive coding scheme; "Rice coding" can refer either to that adaptive scheme or to using that subset of Golomb codes. Whereas a Golomb code has a tunable parameter that can be any positive integer value, Rice codes are those in which the tunable parameter is a power of two. This makes Rice codes convenient for use on a computer, since multiplication and division by 2 can be implemented more efficiently in binary arithmetic.

Rice was motivated to propose this simpler subset due to the fact that geometric distributions are often varying with time, not precisely known, or both, so selecting the seemingly optimal code might not be very advantageous.

Rice coding is used as the entropy encoding stage in a number of lossless image compression and audio data compression methods.

Overview

[edit]
Golomb coding example for a source x with geometric distribution, with parameter p(0) = 0.2, using Golomb code with M = 3. The 2-bit code 00 is used 20% of the time; the 3-bit codes 010, 011, and 100 are used over 38% of the time; 4 bits or more are needed in a minority of cases. For this source, entropy = 3.610 bits; for this code with this source, rate = 3.639 bits; therefore redundancy = 0.030 bits, or efficiency = 0.992 bits per bit.

Construction of codes

[edit]

Golomb coding uses a tunable parameter M to divide an input value x into two parts: q, the result of a division by M, and r, the remainder. The quotient is sent in unary coding, followed by the remainder in truncated binary encoding. When , Golomb coding is equivalent to unary coding.

Golomb–Rice codes can be thought of as codes that indicate a number by the position of the bin (q), and the offset within the bin (r). The example figure shows the position q and offset r for the encoding of integer x using Golomb–Rice parameter M = 3, with source probabilities following a geometric distribution with p(0) = 0.2.

Formally, the two parts are given by the following expression, where x is the nonnegative integer being encoded:

and

This image shows the redundancy, in bits, of the Golomb code, when M is chosen optimally, for 1 ? p(0) ≥ 0.45

Both q and r will be encoded using variable numbers of bits: q by a unary code, and r by b bits for Rice code, or a choice between b and b+1 bits for Golomb code (i.e. M is not a power of 2), with . If , then use b bits to encode r; otherwise, use b+1 bits to encode r. Clearly, if M is a power of 2 and we can encode all values of r with b bits.

The integer x treated by Golomb was the run length of a Bernoulli process, which has a geometric distribution starting at 0. The best choice of parameter M is a function of the corresponding Bernoulli process, which is parameterized by the probability of success in a given Bernoulli trial. M is either the median of the distribution or the median ±1. It can be determined by these inequalities: which are solved by

For the example with p(0) = 0.2:

The Golomb code for this distribution is equivalent to the Huffman code for the same probabilities, if it were possible to compute the Huffman code for the infinite set of source values.

Use with signed integers

[edit]

Golomb's scheme was designed to encode sequences of non-negative numbers. However, it is easily extended to accept sequences containing negative numbers using an overlap and interleave scheme, in which all values are reassigned to some positive number in a unique and reversible way. The sequence begins: 0, ?1, 1, ?2, 2, ?3, 3, ?4, 4, ... The n-th negative value (i.e., ??) is mapped to the nth odd number (??), and the mth positive value is mapped to the m-th even number (??). This may be expressed mathematically as follows: a positive value x is mapped to (), and a negative value y is mapped to (). Such a code may be used for simplicity, even if suboptimal. Truly optimal codes for two-sided geometric distributions include multiple variants of the Golomb code, depending on the distribution parameters, including this one.[2]

Simple algorithm

[edit]

Below is the Rice–Golomb encoding, where the remainder code uses simple truncated binary encoding, also named "Rice coding" (other varying-length binary encodings, like arithmetic or Huffman encodings, are possible for the remainder codes, if the statistic distribution of remainder codes is not flat, and notably when not all possible remainders after the division are used). In this algorithm, if the M parameter is a power of 2, it becomes equivalent to the simpler Rice encoding:

  1. Fix the parameter M to an integer value.
  2. For N, the number to be encoded, find
    1. quotient = q = floor(N/M)
    2. remainder = r = N modulo M
  3. Generate codeword
    1. The code format : <Quotient code><Remainder code>, where
    2. Quotient code (in unary coding)
      1. Write a q-length string of 1 bits (alternatively, of 0 bits)
      2. Write a 0 bit (respectively, a 1 bit)
    3. Remainder code (in truncated binary encoding)
      1. Let
        1. If code r in binary representation using b bits.
        2. If code the number in binary representation using b + 1 bits.

Decoding:

  1. Decode the unary representation of q (count the number of 1 in the beginning of the code)
  2. Skip the 0 delimiter
  3. Let
    1. Interpret next b bits as a binary number r'. If holds, then the remainder
    2. Otherwise interpret b + 1 bits as a binary number r', the remainder is given by
  4. Compute

Example

[edit]

Set M = 10. Thus . The cutoff is .

Encoding of quotient part
q output bits
0 0
1 10
2 110
3 1110
4 11110
5 111110
6 1111110
N
Encoding of remainder part
r offset binary output bits
0 0 0000 000
1 1 0001 001
2 2 0010 010
3 3 0011 011
4 4 0100 100
5 5 0101 101
6 12 1100 1100
7 13 1101 1101
8 14 1110 1110
9 15 1111 1111

For example, with a Rice–Golomb encoding using parameter M = 10, the decimal number 42 would first be split into q = 4 and r = 2, and would be encoded as qcode(q),rcode(r) = qcode(4),rcode(2) = 11110,010 (you don't need to encode the separating comma in the output stream, because the 0 at the end of the q code is enough to say when q ends and r begins; both the qcode and rcode are self-delimited).

Use for run-length encoding

[edit]
Note that p and 1 – p are reversed in this section compared to the use in earlier sections.

Given an alphabet of two symbols, or a set of two events, P and Q, with probabilities p and (1 ? p) respectively, where p ≥ 1/2, Golomb coding can be used to encode runs of zero or more P′s separated by single Q′s. In this application, the best setting of the parameter M is the nearest integer to . When p = 1/2, M = 1, and the Golomb code corresponds to unary (n ≥ 0 P′s followed by a Q is encoded as n ones followed by a zero). If a simpler code is desired, one can assign Golomb–Rice parameter b (i.e., Golomb parameter ) to the integer nearest to ; although not always the best parameter, it is usually the best Rice parameter and its compression performance is quite close to the optimal Golomb code. (Rice himself proposed using various codes for the same data to figure out which was best. A later JPL researcher proposed various methods of optimizing or estimating the code parameter.[3])

Consider using a Rice code with a binary portion having b bits to run-length encode sequences where P has a probability p. If is the probability that a bit will be part of an k-bit run ( Ps and one Q) and is the compression ratio of that run, then the expected compression ratio is

Compression is often expressed in terms of , the proportion compressed. For , the run-length coding approach results in compression ratios close to entropy. For example, using Rice code for yields 91.89% compression, while the entropy limit is 91.92%.

Adaptive run-length Golomb–Rice encoding

[edit]

When a probability distribution for integers is not known, the optimal parameter for a Golomb–Rice encoder cannot be determined. Thus, in many applications, a two-pass approach is used: first, the block of data is scanned to estimate a probability density function (PDF) for the data. The Golomb–Rice parameter is then determined from that estimated PDF. A simpler variation of that approach is to assume that the PDF belongs to a parametrized family, estimate the PDF parameters from the data, and then compute the optimal Golomb–Rice parameter. That is the approach used in most of the applications discussed below.

An alternative approach to efficiently encode integer data whose PDF is not known, or is varying, is to use a backwards-adaptive encoder. The RLGR encoder [1] achieves that using a very simple algorithm that adjusts the Golomb–Rice parameter up or down, depending on the last encoded symbol. A decoder can follow the same rule to track the variation of the encoding parameters, so no side information needs to be transmitted, just the encoded data. Assuming a generalized Gaussian PDF, which covers a wide range of statistics seen in data such as prediction errors or transform coefficients in multimedia codecs, the RLGR encoding algorithm can perform very well in such applications.

Applications

[edit]
Golomb-coded Rice algorithm experiment compression ratios

Numerous signal codecs use a Rice code for prediction residues. In predictive algorithms, such residues tend to fall into a two-sided geometric distribution, with small residues being more frequent than large residues, and the Rice code closely approximates the Huffman code for such a distribution without the overhead of having to transmit the Huffman table. One signal that does not match a geometric distribution is a sine wave, because the differential residues create a sinusoidal signal whose values are not creating a geometric distribution (the highest and lowest residue values have similar high frequency of occurrences, only the median positive and negative residues occur less often).

Several lossless audio codecs, such as Shorten,[4] FLAC,[5] Apple Lossless, and MPEG-4 ALS, use a Rice code after the linear prediction step (called "adaptive FIR filter" in Apple Lossless). Rice coding is also used in the FELICS lossless image codec.

The Golomb–Rice coder is used in the entropy coding stage of Rice algorithm based lossless image codecs. One such experiment yields the compression ratio graph shown.

The JPEG-LS scheme uses Rice–Golomb to encode the prediction residuals.

The adaptive version of Golomb–Rice coding mentioned above, the RLGR encoder [2],is used for encoding screen content in virtual machines in the RemoteFX component of the Microsoft Remote Desktop Protocol.

See also

[edit]

References

[edit]
  1. ^ Gallager, R. G.; van Voorhis, D. C. (1975). "Optimal source codes for geometrically distributed integer alphabets". IEEE Transactions on Information Theory. 21 (2): 228–230. doi:10.1109/tit.1975.1055357.
  2. ^ Merhav, N.; Seroussi, G.; Weinberger, M. J. (2000). "Coding of sources with two-sided geometric distributions and unknown parameters". IEEE Transactions on Information Theory. 46 (1): 229–236. doi:10.1109/18.817520.
  3. ^ Kiely, A. (2004). Selecting the Golomb Parameter in Rice Coding (Technical report). Jet Propulsion Laboratory. 42-159.
  4. ^ "man shorten". Archived from the original on 2025-08-06. Retrieved 2025-08-06.
  5. ^ "FLAC - Format overview". xiph.org.

Further reading

[edit]
精液长什么样 木加一笔变成什么字 巨细胞病毒是什么病 县尉相当于现在什么官 沈阳有什么特产
什么店可以买到老鼠药 愿闻其详是什么意思 李子有什么功效 胃不消化吃什么药效果最好 什么食物胆固醇含量高
冒虚汗是什么原因 炖排骨什么时候放盐最好 茵是什么意思 麝香对孕妇有什么危害性 丙型肝炎吃什么药最好
什么是三好学生 鸟吃什么食物 hpv阳性意味着什么 人际关系是什么意思 切是什么偏旁
尿白细胞阳性是什么意思hcv8jop3ns1r.cn dle是什么意思hcv9jop5ns6r.cn 有眼不识泰山是什么意思hcv8jop6ns3r.cn e是什么牌子hcv8jop7ns0r.cn 县教育局局长是什么级别hcv8jop6ns6r.cn
经常泡脚有什么好处hcv9jop2ns4r.cn 做美甲师容易得什么病hcv9jop2ns9r.cn 易烊千玺原名叫什么hcv8jop8ns0r.cn 讳疾忌医是什么意思jiuxinfghf.com 2003年出生属什么hcv8jop8ns8r.cn
交会是什么意思hcv9jop5ns7r.cn 乙肝两对半25阳性是什么意思hcv7jop7ns4r.cn 吃什么补白细胞hcv9jop6ns5r.cn 太阳穴胀痛是什么原因hcv8jop2ns1r.cn 小孩割包皮挂什么科室hcv9jop8ns1r.cn
针眼长什么样子图片hcv8jop7ns1r.cn 余事勿取什么意思hcv9jop3ns8r.cn 门庭冷落是什么意思bfb118.com 献血和献血浆有什么区别0297y7.com 顶针什么意思gysmod.com
百度