JP2011216953A - Variable length encoding method, variable length encoding device, compression method of image, compression device, driver circuit, and electronic equipment - Google Patents
Variable length encoding method, variable length encoding device, compression method of image, compression device, driver circuit, and electronic equipment Download PDFInfo
- Publication number
- JP2011216953A JP2011216953A JP2010080420A JP2010080420A JP2011216953A JP 2011216953 A JP2011216953 A JP 2011216953A JP 2010080420 A JP2010080420 A JP 2010080420A JP 2010080420 A JP2010080420 A JP 2010080420A JP 2011216953 A JP2011216953 A JP 2011216953A
- Authority
- JP
- Japan
- Prior art keywords
- value
- symbol
- encoding
- difference
- negative
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
Images
Landscapes
- Compression, Expansion, Code Conversion, And Decoders (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression Of Band Width Or Redundancy In Fax (AREA)
Abstract
Description
本発明は、可変長符号化技術に関する。 The present invention relates to a variable length coding technique.
画像データやオーディオデータをはじめとする大容量データを圧縮するために、さまざまな方式が提案されている。たとえば画像データを圧縮する方法としてはJPEG(Joint Photographic Experts Group)、GIF(Graphics Interchange Format)、PNG(Portable Network Graphics)などが知られている。 Various methods have been proposed for compressing large amounts of data such as image data and audio data. For example, JPEG (Joint Photographic Experts Group), GIF (Graphics Interchange Format), PNG (Portable Network Graphics), etc. are known as methods for compressing image data.
これらのアルゴリズムは、ハードウェア資源が限られた状況では、時間計算量が多いためリアルタイム処理が困難であること、空間計算量が多いためハードウェアコストが高くなるという問題がある。したがって、リアルタイム性および/または低コスト化が求められる用途での実現は困難である。 These algorithms have a problem that in a situation where hardware resources are limited, real-time processing is difficult because of a large amount of time calculation, and hardware cost is high because of a large amount of space calculation. Therefore, it is difficult to realize in applications that require real-time performance and / or cost reduction.
デジタルデータを圧縮する方法として、ライス符号化、ゴロムライス符号化に代表される可変長符号化技術も知られている。可変長符号化は、出現頻度が高いシンボルを符号長の短いワードに符号化し、出現頻度が低いシンボルを符号長の長いワードに符号化することにより、統計的なデータ量を圧縮する。 As a method for compressing digital data, variable-length coding techniques represented by Rice coding and Golomurice coding are also known. In variable-length coding, a symbol having a high appearance frequency is encoded into a word having a short code length, and a symbol having a low appearance frequency is encoded into a word having a long code length, thereby compressing a statistical data amount.
ライス符号化では、符号化時に使用するパラメータ(除数)が適切でないと、符号長が長くなり、圧縮率が低下するという問題がある。 In Rice encoding, if the parameter (divisor) used at the time of encoding is not appropriate, there is a problem that the code length becomes long and the compression rate decreases.
本発明はかかる課題に鑑みてなされたものであり、そのある態様の例示的な目的のひとつは、高圧縮率が得られる可変長符号化技術の提供にある。 The present invention has been made in view of such a problem, and one of exemplary purposes of an aspect thereof is to provide a variable-length coding technique that can obtain a high compression rate.
本発明のある態様は、その値が非負整数をとり、その値が大きくなるにしたがい出現頻度が低下するシンボルを可変長符号化する方法に関する。この方法では、シンボルの値が所定のしきい値以下のときゴロムライス符号化を行い、しきい値より大きいとき、ガンマ符号化を行う。 An aspect of the present invention relates to a method for variable-length encoding a symbol whose value takes a non-negative integer and whose appearance frequency decreases as the value increases. In this method, Golomb-Rice coding is performed when the symbol value is less than or equal to a predetermined threshold value, and gamma coding is performed when the symbol value is larger than the threshold value.
本発明の別の態様は、その値が正負の整数をとり、その絶対値が大きくなるにしたがい出現頻度が低下するシンボルを可変長符号化する方法に関する。この方法は、シンボルの値が0のとき、「00」に符号化し、シンボルの値が+1または−1のとき、その一方を「010」、他方を「011」に符号化する。シンボルの絶対値が2以上、所定のしきい値以下のとき、ガンマ符号化を行う。シンボルの絶対値がしきい値より大きいとき、ガンマ符号化により得られる符号語からセパレータを除いた符号語を生成する。 Another aspect of the present invention relates to a method for variable-length encoding a symbol whose value takes a positive or negative integer and whose appearance frequency decreases as its absolute value increases. In this method, when the symbol value is 0, it is encoded to “00”, and when the symbol value is +1 or −1, one of them is encoded to “010” and the other is encoded to “011”. When the absolute value of the symbol is not less than 2 and not more than a predetermined threshold value, gamma coding is performed. When the absolute value of the symbol is larger than the threshold value, a code word is generated by removing the separator from the code word obtained by gamma coding.
本発明の別の態様は、その値が非負整数をとり、その値が大きくなるにしたがい出現頻度が低下するシンボルを可変長符号化する方法に関する。この方法は、シンボルの値が0のとき、「00」に符号化し、シンボルの値が1または2のとき、その一方を「010」に、他方を「011」に符号化する。シンボルの値が3以上、所定のしきい値以下のとき、ガンマ符号化を行う。シンボルの値がしきい値より大きいとき、ガンマ符号化により得られる符号語からセパレータを除いた符号語を生成する。 Another aspect of the present invention relates to a method for variable-length encoding a symbol whose value takes a non-negative integer and whose appearance frequency decreases as the value increases. In this method, when the value of the symbol is 0, it is encoded as “00”, and when the value of the symbol is 1 or 2, one of them is encoded as “010” and the other is encoded as “011”. When the symbol value is 3 or more and not more than a predetermined threshold value, gamma encoding is performed. When the value of the symbol is larger than the threshold value, a code word obtained by removing the separator from the code word obtained by gamma coding is generated.
これらの態様によれば、高い圧縮率を実現できる。 According to these aspects, a high compression rate can be realized.
なお、以上の構成要素を任意に組み合わせたもの、あるいは本発明の表現を、方法、装置などの間で変換したものもまた、本発明の態様として有効である。 Note that any combination of the above-described components, or a conversion of the expression of the present invention between methods, apparatuses, and the like is also effective as an aspect of the present invention.
本発明のある態様によれば、高圧縮率を実現できる。 According to an aspect of the present invention, a high compression rate can be realized.
以下、本発明を好適な実施の形態をもとに図面を参照しながら説明する。各図面に示される同一または同等の構成要素、部材、処理には、同一の符号を付するものとし、適宜重複した説明は省略する。また、実施の形態は、発明を限定するものではなく例示であって、実施の形態に記述されるすべての特徴やその組み合わせは、必ずしも発明の本質的なものであるとは限らない。 The present invention will be described below based on preferred embodiments with reference to the drawings. The same or equivalent components, members, and processes shown in the drawings are denoted by the same reference numerals, and repeated descriptions are omitted as appropriate. The embodiments do not limit the invention but are exemplifications, and all features and combinations thereof described in the embodiments are not necessarily essential to the invention.
(第1の実施の形態)
図1は、第1の実施の形態に係る可変長符号化装置を備えるディスプレイ装置の構成を示すブロック図である。ディスプレイ装置2は、ディスプレイパネル4およびディスプレイドライバ6を備える。ディスプレイドライバ6は、ひとつの半導体基板に集積化された機能ICであり、毎秒、所定枚の画像データ(フレームデータ)DIMGを受け、画像データDIMGにもとづきディスプレイパネル4を駆動する。
(First embodiment)
FIG. 1 is a block diagram illustrating a configuration of a display device including the variable length coding device according to the first embodiment. The
たとえばRGB各8ビット、1024×768ピクセルの画像データDIMGの容量は、
1024×768×3×8=18,874,368ビット≒2.4Mバイト
となる。ディスプレイの解像度が上がれば、画像データDIMGを保持するための容量はますます増加する。かかる事情から、画像データDIMGを非圧縮で保持しようとすると、ディスプレイドライバ6は、画像データを保持するためのメモリがその面積の大部分を占めることになる。
For example, the capacity of 8-bit RGB image data D IMG of 1024 × 768 pixels is
1024 × 768 × 3 × 8 = 18,874,368 bits≈2.4 Mbytes. As the resolution of the display increases, the capacity for holding the image data DIMG increases more and more. For this reason, if the image data DIMG is to be stored without compression, the
この問題を解消するために、ディスプレイドライバ6は、画像圧縮装置8、メモリ10、デコーダ12を備える。画像圧縮装置8は画像データDIMGをリアルタイム圧縮し、メモリ10に格納する。デコーダ12は圧縮された画像を読み出し、それをデコードしてディスプレイパネル4へと出力する。
In order to solve this problem, the
続いて画像圧縮装置8の構成を説明する。画像圧縮装置8は、差分演算器20、非負数化部22、符号化装置24を備える。
Next, the configuration of the
差分演算器20は、画像データDIMGを構成するある画素とそれと隣接する画素の画素値の差分を算出する。ここでは画素値がR、G、B値である場合を説明するが、U、V、Y値の差分を算出してもよい。具体的には、あるi番目の画素と隣接するi−1番目の画素のR値、G値、B値それぞれについて、差分ΔR=Ri−Ri−1、ΔG=Gi−Gi−1、ΔB=Bi−Bi−1が算出される。以下では、R、G、BあるいはU、V、Yを、総称してXと書き換える。つまり差分データは、ΔX=Xi−Xi−1となる。なお後述するように、差分演算器20は差分データΔXそのものではなく、それを変換した値ΔX’を出力する。
The
非負数化部22は、差分データΔX’をそれぞれを非負数化し、符号化装置24へと出力する。符号化装置24は非負数化された差分ΔXsを符号化する。
The non-negative
符号化装置24は、その値が非負整数をとり、その値が大きくなるに従い、出現頻度が低下するようなデータ(シンボル)に対して、高い圧縮率を提供する。多くの画像データでは、隣接する画素は同じ色や明るさを有している場合が多いため、隣接する画素値の差分は、ゼロに近い確率が高い。したがって隣接画素値の差分ΔXsを符号化装置24の入力シンボルとすることにより、高い圧縮率を得ることができる。
The
以下、実施の形態に係る符号化装置24について説明する。符号化装置24は、シンボルの値(以下、シンボル値nという)が所定のしきい値α以下のとり、シンボルをゴロムライス符号化し、しきい値αより大きいときシンボルをガンマ符号化する。
Hereinafter, the
符号化装置24は、判定部30、第1符号化部32、第2符号化部34を備える。判定部30は、シンボルの値と所定のしきい値αを比較する。第1符号化部32は、シンボルの値がしきい値α以下のとき、ゴロムライス符号化を行う。第2符号化部34は、シンボルの値がしきい値αより大きいとき、ガンマ符号化を行う。
The
図2は、図1の符号化装置24に入力されるシンボル値nと、生成される符号語の関係を示す図である。図2では、シンボル値nがしきい値α=13以下のときゴロムライス符号化を、n>13のときガンマ符号化をする様子が示される。
FIG. 2 is a diagram showing the relationship between the symbol value n input to the
ゴロムライス符号化では、シンボルを、上位ビット群(可変符号長部分)UBと下位ビット群(固定符号長部)LBに符号化する。上位ビット群UBは、シンボル値を固定パラメータm(=2k)で除算した商qを示すサーモメータコードである。図1には、k=1、m=2の場合が示される。下位ビット群LBは、除算の除余rを示すkビットのバイナリコードである。上位ビット群UBと下位ビット群LBの間には、1ビットのセパレータ(たとえば”0”)が挿入される。図1ではこのセパレータは上位ビット群UBの最下位ビットLSBに付加されている。 In Golombrice coding, symbols are encoded into an upper bit group (variable code length portion) UB and a lower bit group (fixed code length portion) LB. The upper bit group UB is a thermometer code indicating a quotient q obtained by dividing a symbol value by a fixed parameter m (= 2 k ). FIG. 1 shows a case where k = 1 and m = 2. The low-order bit group LB is a k-bit binary code indicating the division remainder r. A 1-bit separator (for example, “0”) is inserted between the upper bit group UB and the lower bit group LB. In FIG. 1, this separator is added to the least significant bit LSB of the upper bit group UB.
符号化装置24は、符号語の符号長がしきい値α=13より大きいとき、ガンマ符号化を行う。ガンマ符号化の符号語も、ゴロムライス符号化による符号語と同様に、サーモメータコードである上位ビット群UBと、セパレータ(0)と、バイナリコードである下位ビット群LBからなる。ガンマ符号化では、下位ビット群LBがオーバーフロー(桁上がり)するごとに、その桁数が、ひとつづつインクリメントされる。また下位ビット群LBがオーバーフローすると、上位ビット群UBの値が1増加する。
The
本実施の形態に係る符号化方法によって画像データをある決まった圧縮率で圧縮する場合、ゴロムライス符号化とガンマ符号化の境界(しきい値α)は、画質指標であるPSNR(Peak Signal-to-Noise Ratio)に影響を与える。入力シンボルが0〜255のβ=8ビットで表される場合について、しきい値αを変化させてPSNRを検討した結果、PSNRは、しきい値αが13のときに最もよい値を示すことが分かった。 When image data is compressed at a certain compression rate by the encoding method according to the present embodiment, the boundary (threshold value α) between Golombrice encoding and gamma encoding is PSNR (Peak Signal-to- -Noise Ratio) is affected. As a result of examining the PSNR by changing the threshold value α when the input symbol is represented by β = 8 bits from 0 to 255, the PSNR shows the best value when the threshold value α is 13. I understood.
このしきい値α=13は、ゴロムライス符号化によって符号化された符号語の符号長が所定値(ここでは8)以下の範囲でシンボルが取り得る最大値となっている。この所定値は、符号化の対象となるシンボルのビット数βと等しいことに着目すべきである。 This threshold value α = 13 is the maximum value that can be taken by a symbol in the range where the code length of a code word encoded by Golomb-Rice encoding is a predetermined value (8 in this case) or less. It should be noted that this predetermined value is equal to the number of bits β of the symbol to be encoded.
つまり効率的に符号化を行うためには、所定値は、入力シンボルのビット長βと等しいか、それと同程度(たとえばβ±1)が好ましいといえる。 That is, in order to perform efficient encoding, it can be said that the predetermined value is preferably equal to or approximately the same as the bit length β of the input symbol (for example, β ± 1).
続いて差分演算器20における差分演算処理を説明する。
図3(a)、(b)は、差分演算器20による差分処理を示す図である。
図3(a)は、現在の値(Xi)が、一つ前(隣接する画素)の値(Xi−1)より小さい場合の処理を示す。具体的にはXi=10、Xi−1=235の場合が示される。この場合、現在のデータXiに、データXが取り得る最大値vmax(8ビットの場合255)を加算し、この値Xi’と前データXi−1の差分ΔXi’を算出する。
Next, the difference calculation process in the
FIGS. 3A and 3B are diagrams illustrating difference processing by the
FIG. 3A shows processing when the current value (X i ) is smaller than the previous value (adjacent pixel) (X i-1 ). Specifically, the case of X i = 10 and X i-1 = 235 is shown. In this case, the maximum value vmax (255 in the case of 8 bits) that can be taken by the data X is added to the current data X i , and a difference ΔX i ′ between the value X i ′ and the previous data X i−1 is calculated.
再生(デコード)時には、Xi=Xi−1+ΔXを算出し、最大値255を超えた場合には256を減ずることで、もとの値Xiを再生することができる。これにより、差分ΔX=0〜255を、ゼロを中心とした範囲ΔX’=−128〜127にシフトすることができ、その絶対値を減らすことができるため、後段での圧縮率を高めることができる。
At the time of reproduction (decoding), X i = X i−1 + ΔX is calculated, and when the
図3(b)は、現在の値(Xi)が、一つ前(隣接する画素)の値(Xi−1)より大きい場合の処理を示す。具体的にはXi=235、Xi−1=10の場合が示される。この場合、現在のデータXiからデータXが取り得る最大値vmax(8ビットの場合255)を減じ、この値Xi’と前データXi−1の差分ΔXi’を算出する。 FIG. 3B shows processing when the current value (X i ) is greater than the previous value (adjacent pixel) (X i-1 ). Specifically, the case of X i = 235 and X i-1 = 10 is shown. In this case, the maximum value vmax (255 in the case of 8 bits) that the data X can take is subtracted from the current data X i , and the difference ΔX i ′ between this value X i ′ and the previous data X i−1 is calculated.
再生(デコード)時には、Xi=Xi−1+ΔXを算出し、最小値0未満の場合には256を減ずることで、もとの値Xiを再生することができる。これにより、差分ΔX=−255〜0を、ゼロを中心とした範囲ΔX’=−128〜127にシフトすることができ、その絶対値を減らすことができるため、後段での圧縮率を高めることができる。 At the time of reproduction (decoding), X i = X i-1 + ΔX is calculated, and when the minimum value is less than 0, 256 is subtracted, whereby the original value X i can be reproduced. Thereby, the difference ΔX = −255 to 0 can be shifted to a range ΔX ′ = − 128 to 127 centered on zero, and the absolute value thereof can be reduced, so that the compression rate at the subsequent stage is increased. Can do.
図3(a)、(b)に示すように、差分演算器20によれば、差分−255〜255を、−128〜127で表現することができるため、必要なビット数を1ビット削減することが可能となる。
As shown in FIGS. 3A and 3B, according to the
続いて、非負数化部22における、非負数化の処理を説明する。非負数化部22に入力される画素値の差分データは、その値が正負整数をとり、ゼロを中心として絶対値が増加するほど出現頻度が低下する傾向にある。
Next, non-negative number processing in the non-negative
図4は、非負数化部22による非負数化処理を示す図である。
FIG. 4 is a diagram illustrating the non-negative number processing by the
最上位ビット(MSB)に符号ビットを付加する場合(最左欄)、出現頻度が高い−1が101b(=5)に変換されるため、後段での符号化処理による圧縮率が低下する。2の補数表現を用いる場合(左から第2欄)も、−1が111b(=7)に変換されるため、圧縮率は低下する。 When a sign bit is added to the most significant bit (MSB) (leftmost column), −1 having a high appearance frequency is converted to 101b (= 5), so that the compression rate by the encoding process in the subsequent stage decreases. Even when 2's complement expression is used (second column from the left), -1 is converted to 111b (= 7), and the compression rate is reduced.
LSBに符号ビットを付加する場合(左から第3欄)は、幾分改善されるが、後段での高圧縮率が期待される001bが利用されないことから、まだ改善の余地がある。 When a sign bit is added to the LSB (third column from the left), it is somewhat improved, but there is still room for improvement because 001b, which is expected to have a high compression rate in the subsequent stage, is not used.
図4の最右欄に、実施の形態に係る非負数化処理が示される。非負数化部22は、差分データのシンボル値が負のとき、その値に1を加算する。正のときは加算しない。続いて、最下位ビットに符号ビットを付加する。図4では、符号ビットとして0を正に、1を負に割り当てている。この場合、0を中心として、入力差分値の絶対値が低下するほど、すなわち出現頻度が低下するほど、非負数化された値は増加していくため、後段の符号化装置24において高圧縮率を得ることができる。非負整数化に際して、符号ビットとして、正を1に、負に0を割り当ててもよい。
The rightmost column of FIG. 4 shows the non-negative number processing according to the embodiment. The
図5は、第1の実施の形態に係る符号化方法のフローチャートである。このフローチャートは、符号化装置24をデジタル信号処理回路で構成する場合に好ましい処理を示しているが、その他のフローに従っても同様の処理が可能であることはいうまでもない。
FIG. 5 is a flowchart of the encoding method according to the first embodiment. This flowchart shows a preferable process when the
ステップS100〜S114は、差分演算器20による差分算出処理を示す。ステップS104において、差分temp(=ΔX)が算出される。続くステップS106において、temp(=ΔX)が、(vmax/2)以下の最大の整数(127)以上のとき(S106のY)、差分diff(=ΔX’)=ΔX−(vmax+1)が得られる(S114)。
Steps S <b> 100 to S <b> 114 show a difference calculation process by the
temp(=ΔX)が、(vmax/2)以下の最大の整数(127)より小さいとき(S106のN)、ステップS108に進む。ステップS108において、値tempが(−vmax/2)以上の最小の整数(−127)より小さいとき(S108のY)、差分diff(=ΔX’)=(vmax+1)+tempが得られる(S112)。 When temp (= ΔX) is smaller than the maximum integer (127) equal to or less than (vmax / 2) (N in S106), the process proceeds to step S108. In step S108, when the value temp is smaller than the minimum integer (−127) equal to or larger than (−vmax / 2) (Y in S108), the difference diff (= ΔX ′) = (vmax + 1) + temp is obtained (S112).
−127≦temp<127のとき(S108のN)、diff=temp、すなわちΔX’=ΔXを得る(S110)。 When −127 ≦ temp <127 (N in S108), diff = temp, that is, ΔX ′ = ΔX is obtained (S110).
ステップS120〜S124は、非負数化部22による非負数化処理を示す。
差分ΔX’が正の場合(S120のN)、sdiff(=ΔXs)=diff×2に変換される(S122)。(×2)は、上位への1ビットシフトを示し、LSBに正を示す符号ビット0を付加することを示す。
Steps S120 to S124 show the non-negative number processing by the
When the difference ΔX ′ is positive (N in S120), it is converted to sdiff (= ΔXs) = diff × 2 (S122). (× 2) indicates a 1-bit shift to the upper side, and indicates that a
差分ΔX’が負の場合(S120のY)、sdiff(=ΔXs)=(|diff|−1)×2+1に変換される(S124)。(×2)は、上位への1ビットシフトを、+1は、負を示す符号ビット1の付加を示す。
When the difference ΔX ′ is negative (Y in S120), the difference ΔX ′ is converted into sdiff (= ΔXs) = (| diff | −1) × 2 + 1 (S124). (× 2) indicates a 1-bit shift to the upper side, and +1 indicates addition of a
ステップS130〜S138は、符号化装置24による符号化処理を示す。
差分入力sdiff(=ΔXs)が、あるしきい値n=m×l未満のとき(S130のN)、第1符号化部32は、ステップS132、S134によってゴロムライス符号化を行う。しきい値nはα+1である。
Steps S <b> 130 to S <b> 138 show encoding processing by the
When the difference input sdiff (= ΔXs) is less than a certain threshold value n = m × l (N in S130), the
差分入力sdiffがしきい値n以上のとき(S130のY)、第2符号化部34はステップS136、S138に従い、ガンマ符号化を行う。
When the difference input sdiff is greater than or equal to the threshold value n (Y in S130), the
第1の実施の形態によれば、画像データを好適に圧縮することができる。 According to the first embodiment, image data can be suitably compressed.
(第2の実施の形態)
図6は、第2の実施の形態に係る可変長符号化装置40の構成を示すブロック図である。この符号化装置40は、図1の画像圧縮装置8において、符号化装置24の代わりに用いることができる。
(Second Embodiment)
FIG. 6 is a block diagram showing the configuration of the variable
符号化装置40は、その値が非負整数をとり、その値が大きくなるに従い、出現頻度が低下するようなデータ(シンボル)に対して、高い圧縮率を提供する。
符号化装置40は、第1符号化部42、第2符号化部44、第3符号化部46、判定部48を備える。
The
The
判定部48は、シンボル値nに応じて、符号化を行うべき第1符号化部42〜第3符号化部46を選択する。具体的にはnが0〜2のとき、第1符号化部42が選択され、nが3≦n<αのとき第2符号化部44が選択され、n≧αのとき第3符号化部を選択する。
The
第1符号化部42は、n=0のとき符号語00を出力する。また第2符号化部44は、n=1および2の一方を符号語「010」に、他方を符号語「011」に符号化する。n=1を「010」、n=2を「011」に割り当てもよいし、その反対であってもよい。
The
第2符号化部44は、シンボル値nが3≦n<αのとき、ガンマ符号化を行う。ガンマ符号化についてはすでに説明した通りである。
The
シンボル値nが所定のしきい値α以上のとき、ガンマ符号化によって得られた符号語の上位ビット群UBと下位ビット群LBの間のセパレータ0が省略される。第3符号化部46は、このときの符号化を行う。
When the symbol value n is greater than or equal to a predetermined threshold value α, the
図7は、図6の符号化装置40に入力されるシンボル値nと、生成される符号語の関係を示す図である。
FIG. 7 is a diagram showing the relationship between the symbol value n input to the
図7の符号化装置40の変形例としては以下の変形例がある。変形例に係る符号化装置40aは、非負数化されない差分データを受け、それを可変長符号化する。
As modifications of the
この変形例において、第1符号化部42aはシンボル値n=0のとき符号語00を出力する。また第2符号化部44aは、n=+1および−1の一方のとき、符号語「010」を出力し、他方のとき「011」に出力する。n=+1を「010」、n=−1を「011」に割り当てもよいし、その反対であってもよい。
In this modification, the first encoding unit 42a outputs the
第2符号化部44aは、シンボルの絶対値nが2≦n<αのとき、ガンマ符号化を行う。第3符号化部46aは、シンボルの絶対値nがしきい値αより大きいとき、ガンマ符号化によって得られた符号語からセパレータ0を省略した符号語を生成する。
The second encoding unit 44a performs gamma encoding when the absolute value n of the symbol is 2 ≦ n <α. When the absolute value n of the symbol is larger than the threshold value α, the third encoding unit 46a generates a code word in which the
図8は、第2の実施の形態に係る符号化方法のフローチャートである。このフローチャートは、非負数化されない差分データを可変長符号化する変形例を示している。 FIG. 8 is a flowchart of the encoding method according to the second embodiment. This flowchart shows a modification in which differential data that is not converted to a non-negative number is variable-length encoded.
差分算出処理に関するステップS100〜S114は、図5のフローチャートと同様である。 Steps S100 to S114 related to the difference calculation processing are the same as those in the flowchart of FIG.
ステップS202〜S212は、非負整数化および符号化処理に相当する。まず、差分データdiffを利用してパラメータlが算出される(S202)。続いて、符号sが生成される(S204)。lが1以下の場合(S206のY)、符号語が0.l.sとなる(S214)。ステップS214の処理は、図6の第1符号化部42による符号化に対応する。
Steps S202 to S212 correspond to non-negative integer conversion and encoding processing. First, the parameter l is calculated using the difference data diff (S202). Subsequently, a code s is generated (S204). If l is 1 or less (Y in S206), the code word is 0. l. s (S214). The process of step S214 corresponds to the encoding by the
lが1より大きい場合(S206のN)、ステップS208に進む。パラメータlが、log2(vmax/2+1)以下の最大の整数(vmax=255のとき9)と等しい場合(S208のN)、第3符号化部46によって、ステップS210の処理により符号語が生成される。ステップS210による符号語は、ガンマ符号化した符号語から、セパレータを省略したものとなる。
If l is greater than 1 (N in S206), the process proceeds to step S208. When the parameter l is equal to the largest integer (9 when vmax = 255) equal to or less than log 2 (vmax / 2 + 1) (N in S208), the
パラメータlがそれ以外のとき(S208のY)、つまり2≦l≦8のとき、第2符号化部44が選択され、ガンマ符号化を行う(S212)。
When the parameter l is other than that (Y in S208), that is, when 2 ≦ l ≦ 8, the
以上、本発明について、実施の形態をもとに説明した。この実施の形態は例示であり、それらの各構成要素や各処理プロセスの組み合わせにいろいろな変形例が可能なこと、またそうした変形例も本発明の範囲にあることは当業者に理解されるところである。以下、こうした変形例について説明する。 The present invention has been described based on the embodiments. This embodiment is an exemplification, and it will be understood by those skilled in the art that various modifications can be made to combinations of the respective constituent elements and processing processes, and such modifications are within the scope of the present invention. is there. Hereinafter, such modifications will be described.
実施の形態では、ディスプレイ装置を例に説明したが、本発明に係る符号化技術の用途はそれに限定されない。たとえばデジタルカメラやデジタルビデオカメラなどの画像データを扱う電子機器において、リアルタイムで画像圧縮が要求される用途に有効である。 In the embodiment, the display device has been described as an example. However, the application of the encoding technique according to the present invention is not limited thereto. For example, it is effective for applications that require real-time image compression in electronic devices that handle image data such as digital cameras and digital video cameras.
またゴロムライス符号化やガンマ符号化において、符号語の「1」と「0」はビット反転されてもよい。 In Golombrice coding or gamma coding, the code words “1” and “0” may be bit-inverted.
実施の形態にもとづき本発明を説明したが、実施の形態は、本発明の原理、応用を示しているにすぎず、実施の形態には、請求の範囲に規定された本発明の思想を逸脱しない範囲において、多くの変形例や配置の変更が認められる。 Although the present invention has been described based on the embodiments, the embodiments merely show the principle and application of the present invention, and the embodiments depart from the idea of the present invention defined in the claims. Many modifications and changes in the arrangement are allowed within the range not to be performed.
2…ディスプレイ装置、4…ディスプレイパネル、6…ディスプレイドライバ、8…画像圧縮装置、10…メモリ、12…デコーダ、20…差分演算器、22…非負数化部、24…符号化装置、30…判定部、32…第1符号化部、34…第2符号化部、40…符号化装置、42…第1符号化部、44…第2符号化部、46…第3符号化部、48…判定部。
DESCRIPTION OF
Claims (21)
シンボルの値が所定のしきい値以下のときゴロムライス符号化を行い、前記しきい値より大きいとき、ガンマ符号化を行うことを特徴とする方法。 A variable length encoding method for a symbol whose value takes a non-negative integer and whose appearance frequency decreases as the value increases,
A method comprising performing Golomb-Rice coding when a symbol value is equal to or less than a predetermined threshold value, and performing gamma coding when the symbol value is larger than the threshold value.
非負数化するステップは、
前記シンボルの値が負のとき、その値に1を加算するステップと、
最下位ビットに符号ビットを付加するステップと、
を含むことを特徴とする請求項1から3のいずれかに記載の方法。 Prior to encoding, the method further comprises a step of making a symbol whose value takes a positive or negative integer and whose appearance frequency decreases around zero as a non-negative number,
The non-negative number step is
When the value of the symbol is negative, adding 1 to the value;
Adding a sign bit to the least significant bit;
The method according to claim 1, comprising:
隣接する画素の画素値の差分を算出するステップと、
前記差分を非負数化するステップと、
非負整数かされたシンボルの値が所定のしきい値以下のときゴロムライス符号化を行い、前記しきい値より大きいとき、ガンマ符号化を行うステップと、
を備えることを特徴とする方法。 A method of compressing image data,
Calculating a difference between pixel values of adjacent pixels;
Non-negative the difference;
Performing Golomb-Rice coding when the value of a symbol that is a non-negative integer is less than or equal to a predetermined threshold, and performing gamma coding when greater than the threshold;
A method comprising the steps of:
シンボルの値と所定のしきい値を比較する判定部と、
前記シンボルの値が前記しきい値以下のときゴロムライス符号化を行う第1符号化部と、
前記シンボルの値が前記しきい値より大きいとき、ガンマ符号化を行う第2符号化部と、
を備えることを特徴とする符号化装置。 An apparatus for variable-length encoding a symbol whose value takes a non-negative integer and whose appearance frequency decreases as the value increases,
A determination unit that compares the value of the symbol with a predetermined threshold;
A first encoding unit that performs Golomu-Rice encoding when the value of the symbol is less than or equal to the threshold value;
A second encoding unit that performs gamma encoding when the value of the symbol is greater than the threshold;
An encoding device comprising:
隣接する画素の画素値の差分を算出する差分演算器と、
前記差分を非負数化する非負数化部と、
非負数化された前記差分を符号化する請求項8から10のいずれかに記載の符号化装置と、
を備えることを特徴とする圧縮装置。 A compression device for image data,
A difference calculator that calculates a difference between pixel values of adjacent pixels;
A non-negative number unit for converting the difference into a non-negative number;
The encoding device according to any one of claims 8 to 10, which encodes the non-negative number difference,
A compression apparatus comprising:
前記シンボルの値が0のとき、「00」に符号化し、
前記シンボルの値が1または2のとき、その一方を「010」に、他方を「011」に符号化し、
前記シンボルの値が3以上、所定のしきい値以下のとき、ガンマ符号化を行い、
前記シンボルの値が前記しきい値より大きいとき、ガンマ符号化により得られる符号語からセパレータを除いた符号語を生成することを特徴とする方法。 A variable length encoding method for a symbol whose value takes a non-negative integer and whose appearance frequency decreases as the value increases,
When the value of the symbol is 0, it is encoded to “00”,
When the value of the symbol is 1 or 2, one of them is encoded as “010” and the other as “011”.
When the value of the symbol is 3 or more and a predetermined threshold value or less, gamma encoding is performed,
When the value of the symbol is larger than the threshold value, a code word obtained by removing a separator from a code word obtained by gamma coding is generated.
隣接する画素の画素値の差分を算出するステップと、
前記差分を非負数化するステップと、
非負数化された差分を符号化する請求項12に記載の方法と、
を備えることを特徴とする圧縮方法。 A method of compressing image data,
Calculating a difference between pixel values of adjacent pixels;
Non-negative the difference;
The method of claim 12, wherein the non-negative numbered difference is encoded;
A compression method comprising:
前記シンボルの値が0のとき、「00」に符号化し、
前記シンボルの値が+1または−1のとき、その一方を「010」、他方を「011」に符号化し、
前記シンボルの絶対値が2以上、所定のしきい値以下のとき、ガンマ符号化を行い、
前記シンボルの絶対値が前記しきい値より大きいとき、ガンマ符号化により得られる符号語からセパレータを除いた符号語を生成することを特徴とする方法。 A variable length encoding method for a symbol whose value takes a positive or negative integer and whose appearance frequency decreases as its absolute value increases,
When the value of the symbol is 0, it is encoded to “00”,
When the value of the symbol is +1 or −1, one of them is encoded as “010” and the other as “011”,
When the absolute value of the symbol is 2 or more and a predetermined threshold value or less, gamma encoding is performed,
When the absolute value of the symbol is larger than the threshold value, a code word obtained by removing a separator from a code word obtained by gamma coding is generated.
隣接する画素の画素値の差分を算出するステップと、
前記差分を符号化する請求項14に記載の方法と、
を備えることを特徴とする圧縮方法。 A method of compressing image data,
Calculating a difference between pixel values of adjacent pixels;
The method of claim 14, wherein the difference is encoded;
A compression method comprising:
前記シンボルの値が0のとき、「00」に符号化し、前記シンボルの値が1または2のとき、その一方を「010」に、他方を「011」に符号化する第1符号化部と、
前記シンボルの値が3以上所定のしきい値以下のとき、ガンマ符号化を行う第2符号化部と、
前記シンボルの値が前記しきい値より大きいとき、ガンマ符号化により得られる符号語からセパレータを除いた符号語を生成する第3符号化部と、
を備えることを特徴とする符号化装置。 An apparatus for variable-length encoding a symbol whose value takes a non-negative integer and whose appearance frequency decreases as the value increases,
A first encoding unit that encodes “00” when the value of the symbol is 0, and encodes one of the symbols to “010” and the other to “011” when the value of the symbol is 1 or 2; ,
A second encoding unit that performs gamma encoding when the value of the symbol is 3 or more and a predetermined threshold value or less;
A third encoding unit that generates a codeword obtained by removing a separator from a codeword obtained by gamma encoding when the value of the symbol is greater than the threshold;
An encoding device comprising:
隣接する画素の画素値の差分を算出する差分演算器と、
前記差分を非負数化する非負数化部と、
非負数化された前記差分を符号化する請求項16に記載の符号化装置と、
を備えることを特徴とする圧縮装置。 A compression device for image data,
A difference calculator that calculates a difference between pixel values of adjacent pixels;
A non-negative number unit for converting the difference into a non-negative number;
The encoding device according to claim 16, which encodes the non-negative number difference,
A compression apparatus comprising:
前記シンボルの値が0のとき、「00」に符号化し、前記シンボルの値が+1または−1のとき、その一方を「010」に、他方を「011」に符号化する第1符号化部と、
前記シンボルの絶対値が2以上、所定のしきい値以下のとき、ガンマ符号化を行う第2符号化部と、
前記シンボルの絶対値が前記しきい値より大きいとき、ガンマ符号化により得られる符号語からセパレータを除いた符号語を生成する第3符号化部と、
を備えることを特徴とする符号化装置。 An apparatus for variable-length coding a symbol whose value takes a positive or negative integer and whose appearance frequency decreases as its absolute value increases,
A first encoding unit that encodes “00” when the value of the symbol is 0, and encodes one of them as “010” and the other as “011” when the value of the symbol is +1 or −1. When,
A second encoding unit that performs gamma encoding when the absolute value of the symbol is not less than 2 and not more than a predetermined threshold;
A third encoding unit that generates a code word obtained by removing a separator from a code word obtained by gamma encoding when the absolute value of the symbol is larger than the threshold;
An encoding device comprising:
隣接する画素の画素値の差分を算出する差分演算器と、
前記差分を符号化する請求項18に記載の符号化装置と、
を備えることを特徴とする圧縮装置。 A compression device for image data,
A difference calculator that calculates a difference between pixel values of adjacent pixels;
The encoding device according to claim 18, which encodes the difference;
A compression apparatus comprising:
前記画像データを圧縮する請求項11、17および19のいずれかに記載の圧縮装置と、
圧縮された画像を保持するメモリと、
前記メモリに保持された画像を復号するデコーダと、
を備えることを特徴とするドライバ回路。 A driver circuit that receives image data and drives a display panel,
The compression device according to any one of claims 11, 17 and 19, which compresses the image data;
Memory to hold the compressed image;
A decoder for decoding the image held in the memory;
A driver circuit comprising:
前記ディスプレイパネルを駆動する請求項20に記載のドライバ回路と、
を備えることを特徴とする電子機器。 A display panel;
The driver circuit according to claim 20, which drives the display panel;
An electronic device comprising:
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010080420A JP2011216953A (en) | 2010-03-31 | 2010-03-31 | Variable length encoding method, variable length encoding device, compression method of image, compression device, driver circuit, and electronic equipment |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP2010080420A JP2011216953A (en) | 2010-03-31 | 2010-03-31 | Variable length encoding method, variable length encoding device, compression method of image, compression device, driver circuit, and electronic equipment |
Publications (1)
Publication Number | Publication Date |
---|---|
JP2011216953A true JP2011216953A (en) | 2011-10-27 |
Family
ID=44946296
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP2010080420A Pending JP2011216953A (en) | 2010-03-31 | 2010-03-31 | Variable length encoding method, variable length encoding device, compression method of image, compression device, driver circuit, and electronic equipment |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2011216953A (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020129718A1 (en) * | 2018-12-21 | 2020-06-25 | 日本電信電話株式会社 | Conversion device, encoding device, decoding device, methods of conversion device, encoding device, and decoding device, and program |
-
2010
- 2010-03-31 JP JP2010080420A patent/JP2011216953A/en active Pending
Cited By (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2020129718A1 (en) * | 2018-12-21 | 2020-06-25 | 日本電信電話株式会社 | Conversion device, encoding device, decoding device, methods of conversion device, encoding device, and decoding device, and program |
JP2020102763A (en) * | 2018-12-21 | 2020-07-02 | 日本電信電話株式会社 | Conversion apparatus, coding apparatus, decode apparatus, and method and program for them |
JP7183776B2 (en) | 2018-12-21 | 2022-12-06 | 日本電信電話株式会社 | Encoding apparatus, decoding apparatus, methods and programs thereof |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7817864B2 (en) | Coding apparatus and decoding apparatus | |
RU2751570C2 (en) | Encoding and decoding of significant coefficients depending on the parameter of the specified significant coefficients | |
US11309907B2 (en) | Guaranteed data compression | |
US11509330B2 (en) | Guaranteed data compression | |
US11258457B2 (en) | Guaranteed data compression | |
US10707895B2 (en) | Guaranteed data compression | |
JP2006311474A (en) | Apparatus and method for image processing, compression, decompression, transfer, transmission, and reception, and program and display device | |
US10720940B2 (en) | Guaranteed data compression | |
US8675732B2 (en) | Method and apparatus of compressing image data | |
US10757415B2 (en) | Guaranteed data compression | |
JP2004040429A (en) | Digital image encoder, digital image encoding method used therefor, and program therefor | |
JP2011216953A (en) | Variable length encoding method, variable length encoding device, compression method of image, compression device, driver circuit, and electronic equipment | |
US8331693B2 (en) | Information encoding apparatus and method, information retrieval apparatus and method, information retrieval system and method, and program | |
TW200937942A (en) | Coding system and method for a bit-plane | |
JP2934603B2 (en) | Method and apparatus for decoding variable length code | |
JP3228943B2 (en) | Encoding device and decoding device, their methods and image processing device | |
Kim et al. | Fixed-length Golomb-Rice coding by quantization level estimation | |
JP2005176169A (en) | Video coding method and apparatus | |
JP2004215304A (en) | Image processing apparatus | |
JP2009260745A (en) | Image encoder, and control method thereof | |
JP2003102012A (en) | Image encoder and image decoder, and image encoding method and image decoding method | |
JPH10145605A (en) | Code processor for multilevel image data |