JP2001298739A - Coder and its method - Google Patents

Coder and its method

Info

Publication number
JP2001298739A
JP2001298739A JP2000114178A JP2000114178A JP2001298739A JP 2001298739 A JP2001298739 A JP 2001298739A JP 2000114178 A JP2000114178 A JP 2000114178A JP 2000114178 A JP2000114178 A JP 2000114178A JP 2001298739 A JP2001298739 A JP 2001298739A
Authority
JP
Japan
Prior art keywords
value
encoding
parameter
output
count
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.)
Withdrawn
Application number
JP2000114178A
Other languages
Japanese (ja)
Inventor
Tadayoshi Nakayama
忠義 中山
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2000114178A priority Critical patent/JP2001298739A/en
Priority to US09/618,461 priority patent/US6865299B1/en
Publication of JP2001298739A publication Critical patent/JP2001298739A/en
Withdrawn legal-status Critical Current

Links

Landscapes

  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)
  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

PROBLEM TO BE SOLVED: To provide a coder and its method that realize a system to apply variable length coding to a multi-value image with a simple processing and a configuration for a processing unit to execute the variable length coding system at a high-speed, which has not conventionally been established yet. SOLUTION: In the case of applying variable length coding to multi-value image data on the basis of individual parameters by each sub block of the data, controlling count of an up-down counter 713 on the basis of the result of comparison between difference values DS and DS+1 of a variable length code quantity in existence between adjacent parameters with a prescribed value N so as to converge the count to optimum values of the parameters.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、画像データを符号
化する符号化装置及びその方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an encoding apparatus and method for encoding image data.

【0002】[0002]

【従来の技術】一般に画像、特に多値画像は非常に多く
の情報を含んでおり、その画像を蓄積・伝送する際には
扱うデータ量が膨大になってしまうという問題がある。
このため、画像の蓄積・伝送に際しては、画像の持つ冗
長性を取り除き、多少の画質の劣化を容認することで、
データ量の削減を図る高能率符号化が用いられる。
2. Description of the Related Art Generally, an image, particularly a multi-valued image, contains a very large amount of information, and there is a problem that the amount of data handled when storing and transmitting the image becomes enormous.
For this reason, when storing and transmitting images, it is necessary to remove the redundancy of the images and tolerate some deterioration in image quality.
High-efficiency coding for reducing the amount of data is used.

【0003】これら高能率符号化の1つとして、JPE
G方式の圧縮符号化が知られている。この方式では多値
画像をブロック毎にDCT変換することにより周波数成
分に変換し、得られた変換係数を量子化して可変長符号
化するというものである。
As one of these high-efficiency codings, JPE
G-system compression encoding is known. In this method, a multi-valued image is converted into frequency components by performing DCT conversion for each block, and the obtained conversion coefficients are quantized and subjected to variable-length coding.

【0004】上記DCT変換を用いた符号化は、圧縮率
を高く設定すると復号画像にブロック歪みが発生してし
まうという問題がある。近年、このような歪みを解消す
るために、ウェーブレット変換を用いる新たな符号化方
式が提案されている。
[0004] The encoding using the DCT transform has a problem that if a high compression ratio is set, block distortion occurs in a decoded image. In recent years, in order to eliminate such distortion, a new encoding method using a wavelet transform has been proposed.

【0005】また、これら種々の高能率符号化の一部と
して、可変長符号化が適用されることが多い。
[0005] Also, variable length coding is often applied as a part of these various high-efficiency codings.

【0006】[0006]

【発明が解決しようとする課題】しかしながら、多値画
像を簡単な処理で可変長符号化するための方式、更には
この可変長符号化方式を高速に実行するための処理装置
の構成については、未だ確立されていないというのが現
状である。
However, a system for performing variable-length coding on multi-valued images by simple processing, and a configuration of a processing device for executing this variable-length coding system at high speed, are described below. At present, it has not been established yet.

【0007】本発明は該状況に鑑みてなされたものであ
り、多値画像を簡易かつ高速に可変長符号化する符号化
装置及びその方法を提供することを目的とする。
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide an encoding device and a method for performing variable-length encoding of a multivalued image easily and at high speed.

【0008】[0008]

【課題を解決するための手段】上記目的を達成するため
の一手段として、本発明の符号化装置は以下の構成を備
える。
As one means for achieving the above object, the coding apparatus of the present invention has the following arrangement.

【0009】即ち、パラメータに基づいて、シンボル群
を可変長符号部分と固定長符号部分とにそれぞれ符号化
する符号化手段を有する符号化装置であって、隣接する
パラメータ間における前記可変長符号部分の符号量の差
分値を算出する差分手段と、前記差分値を所定値と比較
する比較手段と、該比較結果に基づくカウントを行うこ
とによって、前記符号化手段における符号化に適用する
パラメータを生成する生成手段と、を有することを特徴
とする。
More specifically, the present invention provides an encoding apparatus having encoding means for encoding a symbol group into a variable-length code portion and a fixed-length code portion based on parameters, wherein the variable-length code portion between adjacent parameters is encoded. A difference means for calculating a difference value of the code amount, a comparison means for comparing the difference value with a predetermined value, and a count applied based on the comparison result to generate a parameter to be applied to the encoding in the encoding means. And generating means for performing the processing.

【0010】例えば、前記パラメータは、前記固定長符
号部分の符号長を示すことを特徴とする。
For example, the parameter indicates a code length of the fixed-length code portion.

【0011】例えば、前記符号化手段は、ゴロムライス
符号化を行うことを特徴とする。
For example, the encoding means performs Golomb-Rice encoding.

【0012】例えば、前記シンボル群は、多値画像デー
タに対してウェーブレット変換を施して得られたサブブ
ロックに相当する。
For example, the symbol group corresponds to a sub-block obtained by performing a wavelet transform on multi-valued image data.

【0013】例えば、前記比較手段における所定値は、
前記シンボル群における符号化対象シンボルの個数であ
る。
For example, the predetermined value in the comparing means is
This is the number of symbols to be encoded in the symbol group.

【0014】例えば、前記生成手段は、前記比較手段に
おける比較結果に基づいてカウントアップまたはカウン
トダウンを行うアップダウンカウンタである。
For example, the generation means is an up / down counter which counts up or down based on the result of comparison by the comparison means.

【0015】[0015]

【発明の実施の形態】以下、本発明に係る一実施形態に
ついて、図面を参照して詳細に説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment according to the present invention will be described below in detail with reference to the drawings.

【0016】<第1実施形態>本実施形態においては、
8ビットのモノクロ画像データを符号化する例について
説明する。しかしながら本発明はこれに限らず、例えば
各画素を4ビット表現とするモノクロ画像、或いは各画
素における色成分(RGB/Lab/YCrCb)を8
ビットで表現するカラーの多値画像等を符号化する場合
にも適用可能である。本発明をカラー多値画像に適用す
る場合には、各色成分をそれぞれモノクロ画像として符
号化を行えばよい。
<First Embodiment> In the present embodiment,
An example of encoding 8-bit monochrome image data will be described. However, the present invention is not limited to this. For example, a monochrome image in which each pixel is represented by 4 bits, or a color component (RGB / Lab / YCrCb)
The present invention is also applicable to encoding of a color multi-valued image expressed by bits. When the present invention is applied to a color multivalued image, each color component may be encoded as a monochrome image.

【0017】図1は、本実施形態を適用する符号化装置
の構成を示すブロック図である。同図において、101
は画像入力部、102はデータ格納部、103は離散ウ
ェーブレット変換部、104は係数量子化部、105は
符号化パラメータ選択部、106は可変長符号化部、1
07はビットプレーン走査部、108はバッファ、10
9は符号出力部である。
FIG. 1 is a block diagram showing a configuration of an encoding apparatus to which the present embodiment is applied. In FIG.
Is an image input unit, 102 is a data storage unit, 103 is a discrete wavelet transform unit, 104 is a coefficient quantization unit, 105 is a coding parameter selection unit, 106 is a variable length coding unit,
07 is a bit plane scanning unit, 108 is a buffer, 10
9 is a code output unit.

【0018】まず、画像入力部101では、符号化対象
となる画素データをラスタスキャン順に入力する。この
画像入力部101としては、例えばスキャナやデジタル
カメラ等の撮像装置、或いはCCDなどの撮像デバイ
ス、或いはネットワーク回線のインターフェース等から
の画像データ入力処理、等が挙げられる。
First, the image input unit 101 inputs pixel data to be encoded in raster scan order. The image input unit 101 includes, for example, an imaging device such as a scanner or a digital camera, an imaging device such as a CCD, or an image data input process from a network line interface or the like.

【0019】画像データ格納部102は例えばRAMに
よって構成され、画像入力部101で入力される画像デ
ータを記憶するが、例えばMO,ハードディスク,磁気
テープ等の記録媒体によって構成されても良い。
The image data storage unit 102 is constituted by, for example, a RAM and stores image data inputted by the image input unit 101, but may be constituted by a recording medium such as an MO, a hard disk, a magnetic tape, or the like.

【0020】離散ウェーブレット変換部103では、画
像データ格納部102に記憶した1画面分の画像データ
に対して周知の離散ウェーブレット変換を施し、複数の
周波数帯域に分解する。本実施形態では、x(n)で示す
画像データ列に対する離散ウェーブレット変換を、次式
に基づいて行なうとする。
The discrete wavelet transform unit 103 performs a well-known discrete wavelet transform on the image data for one screen stored in the image data storage unit 102 to decompose the image data into a plurality of frequency bands. In the present embodiment, it is assumed that the discrete wavelet transform for the image data sequence represented by x (n) is performed based on the following equation.

【0021】 r(n) = floor{(x(2n)+x(2n+1))/2} d(n) = x(2n+2)-x(2n+3) +floor{(-r(n)+r(n+2)+2)/4} 尚、上式においてr(n),d(n)は変換係数であり、r
(n)は低周波成分、d(n)は高周波成分である。
R (n) = floor {(x (2n) + x (2n + 1)) / 2} d (n) = x (2n + 2) -x (2n + 3) + floor {(-r ( n) + r (n + 2) +2) / 4} where r (n) and d (n) are conversion coefficients, and r
(n) is a low frequency component and d (n) is a high frequency component.

【0022】また上式において、floor{X}はXを超え
ない最大の整数値を表す。本変換式は一次元のデータに
対するものであるが、この変換を水平方向、垂直方向の
順に適用することで二次元の変換を行なうことが可能で
ある。入力された画像データ列に対してこの2次元変換
を施すことにより、図2(a)に示す様なLL,HL,
LH,HHの4つの周波数帯域(サブブロック)に分割
することができる。これらの変換データは、次段の係数
量子化部104へスムーズにデータを出力したり、ある
いは、更なるウェーブレット変換を行なうため、データ
格納部102に記憶される。
In the above equation, floor {X} represents the maximum integer value not exceeding X. Although this conversion formula is for one-dimensional data, it is possible to perform two-dimensional conversion by applying this conversion in the horizontal and vertical directions in this order. By performing this two-dimensional conversion on the input image data sequence, LL, HL, and LL as shown in FIG.
It can be divided into four frequency bands (sub blocks) of LH and HH. These transform data are stored in the data storage unit 102 in order to smoothly output the data to the next-stage coefficient quantization unit 104 or to perform further wavelet transform.

【0023】生成したLL成分について、同様の手順に
て更に離散ウェーブレット変換を施すことにより、図2
(b)に示す様に7個の周波数帯域(サブブロック)に
分解される。そして、更にもう一度離散ウェーブレット
変換を施すことにより、画像データ列を図2(c)に示
す様にLL,HL3,LH3,HH3,HL2,LH
2,HH2,HL1,LH1,HH1の10個の周波数
帯域(サブブロック)に分割することができ、変換係数
をデータ格納部102に記憶する。
The generated LL component is further subjected to a discrete wavelet transform in the same procedure as shown in FIG.
It is decomposed into seven frequency bands (sub-blocks) as shown in FIG. Then, another discrete wavelet transform is performed again to convert the image data sequence into LL, HL3, LH3, HH3, HL2, LH as shown in FIG.
2, HH2, HL1, LH1, and HH1 can be divided into ten frequency bands (sub-blocks), and the transform coefficients are stored in the data storage unit 102.

【0024】変換係数はLL,HL3,LH3,HH
3,HL2,LH2,HH2,HL1,LH1,HH1
のサブブロック順に、かつ各サブブロック毎にはラスタ
ースキャン順に、データ格納部102から係数量子化部
104へと出力される。
The conversion coefficients are LL, HL3, LH3, HH
3, HL2, LH2, HH2, HL1, LH1, HH1
Are output from the data storage unit 102 to the coefficient quantization unit 104 in the order of the sub-blocks and in the order of raster scan for each sub-block.

【0025】係数量子化部104は、ウェーブレット変
換係数の各々を各周波数成分毎に定めた量子化ステップ
によって量子化し、量子化後の値を符号化パラメータ選
択部105及びバッファ108へと出力する。
The coefficient quantization unit 104 quantizes each of the wavelet transform coefficients by a quantization step determined for each frequency component, and outputs the quantized value to the coding parameter selection unit 105 and the buffer 108.

【0026】ここで係数値をX、この係数の属する周波
数成分に対する量子化ステップの値をqとすると、量子
化後の量子化値Q(X)は次式によって求められるとす
る。
Here, assuming that the coefficient value is X and the value of the quantization step for the frequency component to which the coefficient belongs is q, the quantized value Q (X) after quantization is obtained by the following equation.

【0027】Q(X)=floor{(X/q)+0.5} 本実施形態における各周波数成分と量子化ステップとの
関係を図3に示す。同図に示すように、低周波成分(L
L等)よりも高周波成分(HL1,LH1,HH1等)
の方が量子化ステップを大きくしている。これにより、
視覚的に劣化の目立ちにくい高周波成分の情報をより削
減するようにし、圧縮率の向上を図っている。
Q (X) = floor {(X / q) +0.5} FIG. 3 shows the relationship between each frequency component and the quantization step in the present embodiment. As shown in FIG.
L, etc.) (HL1, LH1, HH1, etc.)
Has a larger quantization step. This allows
The compression ratio is improved by reducing the information of high frequency components that are hardly noticeable in deterioration.

【0028】上記量子化値は、符号化パラメータ選択部
105で評価され、後段の可変長符号化部106でこの
量子化値を符号化する際に必要となるkパラメータが決
定されるまで、バッファ108に保持される。
The above-mentioned quantization value is evaluated by the encoding parameter selection unit 105, and the buffer is used until the variable parameter encoding unit 106 at the subsequent stage determines the k parameter necessary for encoding this quantization value. 108.

【0029】符号化パラメータ選択部105では、上記
量子化値に基づいて後段の可変長符号化部106で使用
されるkパラメータを選択する。
The coding parameter selection unit 105 selects a k parameter to be used in the subsequent variable length coding unit 106 based on the quantization value.

【0030】このkパラメータとは、ゴロムライス(Go
lomb Rice)符号化という可変長符号化を行なう際の固
定長部の符号長を示す値である。説明の都合上、符号化
パラメータ選択部105について説明する前に、可変長
符号化部106におけるゴロムライス符号化処理につい
て説明する。
The k parameter refers to Goromice (Go
lomb Rice) is a value indicating the code length of the fixed-length part when performing variable-length encoding called encoding. For the sake of explanation, before describing the encoding parameter selection unit 105, the Golomb-Rice encoding process in the variable length encoding unit 106 will be described.

【0031】この可変長符号化部106で行なうゴロム
ライス符号化処理の基本的な方法は周知ではあるが、以
下に、この符号化の基本的な動作及び本発明の特徴的な
部分について説明する。
Although the basic method of the Golomb-Rice encoding process performed by the variable length encoding unit 106 is well known, the basic operation of the encoding and the characteristic parts of the present invention will be described below.

【0032】まず、量子化値を格納したバッファ108
から1サブブロック分のデータを順次読み出す。次に、
可変長符号化部106において、該サブブロックに対応
するkパラメータに基づき、以下に説明する前処理及び
ゴロムライス符号化処理を行なう。
First, the buffer 108 storing the quantized value
, One sub-block of data is sequentially read. next,
The variable-length coding unit 106 performs the following preprocessing and Golomb-Rice coding based on the k parameter corresponding to the sub-block.

【0033】可変長符号化部106は、入力した各量子
化値の正/負を調べ、負号ビットを出力する。具体的に
は、量子化値が0または正である場合には「0」を、負
である場合には「1」を出力した後、該量子化値を絶対
値に変換する。尚、この処理は厳密にはゴロムライス符
号化処理には含まれないが、本実施形態ではこれをゴロ
ムライス符号化の前処理として、可変長符号化部106
内で行なうものとする。
The variable length coding unit 106 checks the positive / negative of each input quantized value and outputs a negative sign bit. Specifically, when the quantization value is 0 or positive, “0” is output, and when the quantization value is negative, “1” is output, and then the quantization value is converted into an absolute value. Note that, although this processing is not strictly included in the Golomb-Rice encoding processing, in the present embodiment, this processing is performed as
Within

【0034】次に、該絶対値をゴロムライス符号化す
る。符号化対象となる量子化値の絶対値をV、処理対象
のサブブロックに適用されるkパラメータの値がkであ
る場合のゴロムライス符号化処理は次の手順にて行な
う。
Next, the absolute value is subjected to Golomb-Rice encoding. The Golomb-Rice encoding process when the absolute value of the quantization value to be encoded is V and the value of the k parameter applied to the sub-block to be processed is k is performed in the following procedure.

【0035】まず、2進表現したVをkビット右シフト
した後に、得られた値の個数だけ「0」を連続して配置
し、その次に区切りのビットとして「1」を配置し、そ
の次に元のVの下位kビットを配置することにより、可
変長符号(ゴロムライス符号)を生成する。
First, after binary-shifted V is shifted to the right by k bits, “0” s are successively arranged by the number of obtained values, and then “1” is arranged as a delimiter bit. Next, by arranging the lower k bits of the original V, a variable length code (Golomb-Rice code) is generated.

【0036】図4に、V=0〜7,k=0,1,2に対
するゴロムライス符号の例を示す。同図から分かるよう
に、絶対値V及びパラメータkから得られる各可変長符
号の符号長は、V>>k(Vをkビット右シフトした
値)+1(区切りビット)+k(パラメータの値)ビッ
ト、であることが容易に推測できる。また、正/負を表
わす負号ビットを加えれば、さらに1ビット増える。
FIG. 4 shows an example of a Golomb-Rice code for V = 0 to 7, k = 0, 1, 2. As can be seen from the figure, the code length of each variable-length code obtained from the absolute value V and the parameter k is V >> k (value obtained by shifting V right by k bits) +1 (delimiter bit) + k (parameter value) It can be easily guessed that it is a bit. Further, if a negative sign bit indicating positive / negative is added, the bit is further increased by one bit.

【0037】また、同図からも分かるように、k=0の
時のV=0に対するゴロムライス符号長が、k=1,2
の時よりも特に短くなっている。これは、符号化される
量子化値群が0に偏っているため、kパラメータを小さ
くして符号化する方が適していることを示している。
As can be seen from the figure, the Golomb-Rice code length with respect to V = 0 when k = 0 is k = 1, 2
It is especially shorter than at the time. This indicates that since the group of quantized values to be coded is biased toward 0, it is more suitable to perform coding with a small k parameter.

【0038】また、ここで用いるゴロムライス符号化
は、図4に示すような符号表を実際に保持することな
く、簡単な演算によって符号化及び復号が実行可能であ
るという効果がある。尚、通常のハフマン符号化等の可
変長符号化では、符号化対象値に対する可変長符号を示
すテーブルを保持しなければならない。特に、関連する
状態に応じて、符号化対象値に対して複数の可変長符号
を適宜切り換える場合には、上記テーブルを複数持つ必
要がある。
The Golomb-Rice coding used here has the effect that the coding and decoding can be executed by simple calculations without actually holding the code table as shown in FIG. In a variable length coding such as a normal Huffman coding, a table indicating a variable length code for a value to be coded must be held. In particular, when a plurality of variable length codes are appropriately switched for a value to be encoded in accordance with a related state, it is necessary to have a plurality of the above tables.

【0039】以上のようにして、入力される量子化値に
対する負号ビット(+/−を表わす)と可変長符号(ゴ
ロムライス符号)からなる符号化データを生成し、後段
のビットプレーン走査部107へ出力する。
As described above, encoded data composed of a negative sign bit (representing +/-) and a variable length code (Golomb-Rice code) for the input quantized value is generated, and the bit plane scanning unit 107 at the subsequent stage is generated. Output to

【0040】次に、上述した可変長符号化部106で必
要となるkパラメータを生成する、符号化パラメータ選
択部105における処理について説明する。
Next, the processing in the coding parameter selection unit 105 for generating the k parameter required in the above-described variable length coding unit 106 will be described.

【0041】符号化するサブブロックの全符号量Tは、
kパラメータの値をpとすると Tp = Σ(Vi>>p(Viをpビット右シフトした値) +2(負号ビットと区切りビット)+p) ・・・(1) となる。
The total code amount T of the sub-block to be coded is
Assuming that the value of the k parameter is p, T p = Σ (Vi >> p (value of Vi shifted right by p bits) +2 (negative bit and delimiter bit) + p) (1)

【0042】符号化するサブブロック内の量子化値の数
をN個とすると、上記(1)式は下式のようになる。
Assuming that the number of quantization values in the sub-block to be encoded is N, the above equation (1) becomes as follows.

【0043】 Tp = (p+2)×N+ΣVi>>p ・・・(2) 上記(2)式の第1項:(p+2)×N が固定長符号部
分による符号量を示し、第2項:ΣVi>>p が可変長
符号部分による符号量を示す。ここで第2項のみ、即ち
可変長符号量を以下の(3)式のようにSpと表すとす
る。
T p = (p + 2) × N + ΣVi >> p (2) The first term of the above equation (2): (p + 2) × N indicates the code amount by the fixed-length code part, and the second term: ΣVi >> p indicates the code amount of the variable length code portion. Here only the second term, and expressed as S p in other words the following variable length code amount (3) as equation.

【0044】 Sp=ΣVi>>p ・・・(3) このSpは、pの値が小さい程大きくなる。一方、固定
長符号部分の符号量はpの値に比例して大きくなり、p
が1つ大きくなると該符号量はNビット増える。
S p = ΣVi >> p (3) This S p increases as the value of p decreases. On the other hand, the code amount of the fixed-length code portion increases in proportion to the value of p, and p
Is increased by one, the code amount increases by N bits.

【0045】次に、Viを2進表現したときの各ビット
プレーンにおける「1」の個数について考える。Vi>
>pの最下位ビットのプレーン中に存在する「1」の数
をBp +1とし、以下の(4)式で示す。
Next, consider the number of "1" in each bit plane when Vi is represented in binary. Vi>
The number of “1” existing in the plane of the least significant bit of> p is B p +1 and is represented by the following equation (4).

【0046】 Bp+1=Σ(Vi>>p)&1 ・・・(4) 即ち、B1はViの最下位ビットプレーン中の「1」の個
数を表わし、B2はViの最下位ビットから2番目のプレ
ーン中の「1」の個数を表わす。以上により、 ΣVi>>p = (2×ΣVi>>(p+1)) +(Σ(Vi>>p)&1) ・・・(5) という関係と、(3),(4)式から、 Sp = 2×Sp+1+Bp+1 ・・・(6) という関係式が得られる。
B p + 1 = Σ (Vi >> p) & 1 (4) That is, B 1 represents the number of “1” in the least significant bit plane of Vi, and B 2 represents the least significant bit of Vi. Represents the number of "1" in the second plane from the bit. From the above, from the relationship ΣVi >> p = (2 × ΣVi >> (p + 1)) + (Σ (Vi >> p) & 1) (5) and from the expressions (3) and (4) , S p = 2 × S p + 1 + B p + 1 (6)

【0047】ここで、kパラメータの値が1つだけ異な
るSp-1とSp間の差分をDpとすると、 Dp=Sp-1−Sp=(2×Sp+Bp)−Sp =Sp+Bp(p≧1) ・・・(7) このDpは、kパラメータの値がpからp−1に変わる
ことで、可変長符号量がどれだけ増えるかを表わすもの
である。この値がNより小さいなら、全体の符号量は
N−Dp だけ減るので、kパラメータの値はpよりもp
−1にする方が効率的である。逆に、Dp≧N ならばk
パラメータの値はpとする方がよい。
Here, assuming that the difference between S p-1 and S p in which the value of the k parameter differs by one is D p , D p = S p-1 −S p = (2 × S p + B p ) −S p = S p + B p (p ≧ 1) (7) This D p indicates how much the variable-length code amount increases as the value of the k parameter changes from p to p−1. Things. If this value is smaller than N, the total code amount is
Since reduced by N-D p, the value of k parameters than p p
It is more efficient to set it to -1. Conversely, if D p ≧ N, k
It is better to set the value of the parameter to p.

【0048】上記(7)式をさらに変形すると、 Dp-1=Sp-1+Bp-1 =(2×Sp+Bp)+Bp-1 =(Sp+Bp)+Sp+Bp-1 =Dp+Sp+Bp-1 ここで、Sp,Bp-1≧0 であるから Dp-1≧Dp ・・・(8) 上記(8)式の関係と、上述した説明から次のことが言
える。
When the above equation (7) is further modified, D p-1 = S p-1 + B p-1 = (2 × S p + B p ) + B p-1 = (S p + B p ) + S p + B p-1 = D p + S p + B p-1 , where, S p, B because it is p-1 ≧ 0 D p- 1 ≧ D p ··· (8) (8) The following can be said from the relationship between the expressions and the above description.

【0049】「数列:D1,D2,D3,…,Dp-1
p,Dp+1,…,Dm には、D1≧D2≧D3≧…≧Dp-1
≧Dp≧Dp+1≧…≧Dm という関係があり、Dq≧N≧
q+1 となるqが存在するとき、このqはkパラメータ
の最適値の内の1つである(Nはサブブロック内の量子
化値の数)。」ここでいう最適値とは、ゴロムライス符
号化したときの全体の符号量が最小になる値を意味す
る。また、mはゼロでないBpの中で最も大きなpの値
であり、このmに対応するSmはゼロある。これは、一
番大きな量子化絶対値をmビット右シフトすると0にな
るためである。よって、Dm=Bm≦N である。
"Numerical sequence: D 1 , D 2 , D 3 ,..., D p-1 ,
D p, D p + 1, ..., the D m, D 1 ≧ D 2 ≧ D 3 ≧ ... ≧ D p-1
≧ D p ≧ D p + 1 ≧... ≧ D m , and D q ≧ N ≧
When there is q that satisfies D q + 1 , q is one of the optimal values of the k parameter (N is the number of quantized values in the sub-block). Here, the optimal value means a value that minimizes the entire code amount when Golomb-Rice encoding is performed. In addition, m is the largest value of p in B p that is not zero, and S m corresponding to this m is zero. This is because when the largest quantized absolute value is shifted right by m bits, it becomes zero. Therefore, D m = B m ≦ N.

【0050】即ち、kパラメータがqからq+1になる
と符号量がN−Dq+1だけ増加し、kパラメータがqか
らq−1になると符号量がDq−Nだけ増加することが
分かる。但し、Dq+1=NまたはDq=Nの時は符号量は
増えず、最小のままである。尚、Dq+1=Nの時はq+
1も最適値となり、Dq=Nの時はq−1も最適値とな
る。
That is, when the k parameter changes from q to q + 1, the code amount increases by ND q + 1, and when the k parameter changes from q to q-1, the code amount increases by D q -N. However, when D q + 1 = N or D q = N, the code amount does not increase and remains at the minimum. When D q + 1 = N, q +
1 is also an optimal value, and when Dq = N, q-1 is also an optimal value.

【0051】kパラメータの最適値は、最大3個存在し
うる。その条件はDq=N=Dq+1が成立する時であり、
言い替えると、Sq-1=0,Sq=N,Sq+1=2Nとな
る時である。即ち、q−1,q,q+1がkパラメータ
の最適値となり、全符号量Tは極値(最小値)をとる。
よって、kパラメータが上記最適値から遠ざかる程、全
符号量は増加する。
There can be up to three optimum values of the k parameter. The condition is when D q = N = D q + 1 holds,
In other words, this is the time when Sq -1 = 0, Sq = N, Sq + 1 = 2N. That is, q-1, q, and q + 1 are optimal values of the k parameter, and the total code amount T takes an extreme value (minimum value).
Therefore, as the k parameter moves away from the optimum value, the total code amount increases.

【0052】一方、上記qが存在しない場合は、N>D
1 となる時であり、この場合kパラメータの値が0で全
符号量が最小となる。そして、全符号量はkの値の変化
(増加)に対して単調増加となる。
On the other hand, when q does not exist, N> D
It is the time when it becomes 1 , and in this case, the value of the k parameter is 0 and the total code amount becomes the minimum. Then, the total code amount monotonically increases with a change (increase) in the value of k.

【0053】ここで、前記数列と最適値に関する関係を
一般化するために、D0=D1+2Nと定義する。する
と、次のことが言える。
Here, in order to generalize the relationship between the sequence and the optimum value, it is defined as D 0 = D 1 + 2N. Then, the following can be said.

【0054】「数列:D0,D1,D2,D3,…,
p-1,Dp,Dp+1,…,Dm には、D0≧D1≧D2≧D
3≧…≧Dp-1≧Dp≧Dp+1≧…≧Dm という関係があ
り、Dq≧N≧Dq+1 となるqが存在するとき、このq
はkパラメータの最適値の内の1つである。」これによ
り、最適値qの存在が明確なものとなる。
"Numerical sequence: D 0 , D 1 , D 2 , D 3 ,...
D p-1, D p, D p + 1, ..., the D m, D 0 ≧ D 1 ≧ D 2 ≧ D
3 ≧... ≧ D p−1 ≧ D p ≧ D p + 1 ≧... ≧ D m , and when there exists q satisfying D q ≧ N ≧ D q + 1 , this q
Is one of the optimal values of the k parameter. As a result, the existence of the optimum value q becomes clear.

【0055】ここで、DpとNとの比較結果Cpを次式の
ように定義すると Cp=1 :Dp>Nの時 Cp=0 :Dp≦Nの時 ・・・(9) 前述の D0≧D1≧D2≧D3≧…≧Dp-1≧Dp≧Dp+1
…≧Dm という開係から、C0≧C1≧C2≧C3≧…≧C
p-1≧Cp≧Cp+1≧…≧Cm という関係が得られる。こ
れは、C0,C1,C2,C3,…,Cp-1,Cp,Cp+1
…,Cm という数列が、C0=1から始まってCm=0で
終わり、途中1から0への変化点が一個所あるが、0か
ら1への変化点はないことを示している。
Here, if the comparison result C p between D p and N is defined as follows: C p = 1: when D p > N C p = 0: when D p ≦ N 9) in the above D 0 ≧ D 1 ≧ D 2 ≧ D 3 ≧ ... ≧ D p-1 ≧ D p ≧ D p + 1 ≧
.. ≧ D m , C 0 ≧ C 1 ≧ C 2 ≧ C 3 ≧.
relationship of p-1 ≧ C p ≧ C p + 1 ≧ ... ≧ C m is obtained. This means that C 0 , C 1 , C 2 , C 3 ,..., C p−1 , C p , C p + 1 ,
.., C m indicate that the sequence starts from C 0 = 1 and ends at C m = 0, and there is one transition point from 1 to 0 on the way, but there is no transition point from 0 to 1. .

【0056】上記数列(C0,C1,C2,…)中におい
て、その値が1から0に変化する箇所は、DpとNの大
小関係が逆転する箇所である。
In the above sequence (C 0 , C 1 , C 2 ,...), The point where the value changes from 1 to 0 is where the magnitude relationship between D p and N is reversed.

【0057】先頭のC0=1を除いた、C1から始まる1
の個数がq個ある時、即ち、Cq=1,Cq+1=0である
時、Dq≧N>Dq+1となるので、qがkパラメータの最
適値となる。
[0057] except for the top C 0 = 1, and 1 starting from C 1
When q is q, that is, when C q = 1 and C q + 1 = 0, D q ≧ N> D q + 1 holds, so q is the optimal value of the k parameter.

【0058】以上の原理を利用して、本実施形態は符号
化パラメータ選択部105を構成する。符号化パラメー
タ選択部105のブロック構成を図7A,Bに示す。
In the present embodiment, the encoding parameter selection unit 105 is configured using the above principle. 7A and 7B show a block configuration of the encoding parameter selection unit 105.

【0059】図7Aにおいて、701は係数量子化部1
04から送られる量子化値を入力する端子であり、ここ
では、該端子701から入力されるデータの最大有効ビ
ット数を11ビットと仮定する。
In FIG. 7A, reference numeral 701 denotes a coefficient quantization unit 1
This terminal is a terminal for inputting the quantized value sent from the terminal 04. Here, it is assumed that the maximum number of effective bits of data input from the terminal 701 is 11 bits.

【0060】702a,702b,702c,・・・7
02jは、入力された量子化値データを順次1ビットず
つ右へシフトするビットシフタ、703a,703b,
703c,・・・,703kは、各々に入力されるN個
のデータを累算する累算器、704a,704b,70
4c,・・・,704jは、隣接する2つの累算器の出
力の差を求める減算器である。
702a, 702b, 702c,... 7
02j is a bit shifter for sequentially shifting the input quantized value data to the right by one bit, 703a, 703b,
, 703k are accumulators for accumulating N data input to each of them, 704a, 704b, 70
Reference numerals 4c,..., 704j denote subtracters for calculating the difference between the outputs of two adjacent accumulators.

【0061】図7Bにおいて、705,706は、上記
減算器704a〜704jの出力D 1〜D10のいずれか
を選択する第1及び第2のセレクタである。
In FIG. 7B, 705 and 706 are
Output D of subtracters 704a to 704j 1~ DTenAny of
Are first and second selectors for selecting.

【0062】707は、第1のセレクタ705の出力値
と所定値Nとを比較する第1の比較器、708は、第2
のセレクタ706の出力値と所定値Nとを比較する第2
の比較器、709は、所定値Nを入力する端子である。
707 is a first comparator for comparing the output value of the first selector 705 with a predetermined value N, and 708 is a second comparator
Comparing the output value of the selector 706 with the predetermined value N
Is a terminal for inputting a predetermined value N.

【0063】尚、上述したように所定値Nはサブブロッ
ク内の量子化値の数に相当する。従って、このNの値と
しては、係数量子化部104における量子化時に、予め
カウントしておけば良い。
As described above, the predetermined value N corresponds to the number of quantization values in the sub-block. Therefore, the value of N may be counted in advance at the time of quantization in coefficient quantization section 104.

【0064】711は、第1の比較器707の出力信号
を反転するインバータ、713は、第1及び第2の比較
器707,708の比較結果に基づいてカウントアップ
又はカウントダウンを行なうアップダウンカウンタ、7
17は、符号化パラメータ選択部105の処理が終了し
たことを検出する検出器、719は、検出器717の信
号を出力する端子、721は、求められたkパラメータ
の最適値を出力する端子である。
711 is an inverter for inverting the output signal of the first comparator 707, 713 is an up / down counter for counting up or down based on the comparison result of the first and second comparators 707 and 708, 7
Reference numeral 17 denotes a detector that detects that the processing of the encoding parameter selection unit 105 has been completed, 719 denotes a terminal that outputs a signal of the detector 717, and 721 denotes a terminal that outputs the obtained optimal value of the k parameter. is there.

【0065】各累算器703a〜703kで得られる累
算値S0〜S10は、各々kパラメータを0,1,2,・
・・,9,10とした際の可変長符号部分の符号量を示
す。即ち、サブブロック内の量子化値をすべて入力し終
わった後には、各累算器703a〜703kから、それ
ぞれS0〜S10が出力される。
The accumulated values S 0 to S 10 obtained by the accumulators 703a to 703k respectively have k parameters of 0, 1, 2,.
Indicates the code amount of the variable-length code portion when. That is, after all the quantized values in the sub-block have been input, S 0 to S 10 are output from the accumulators 703a to 703k, respectively.

【0066】これら累算器の出力値S0〜S10を減算器
704a〜704jに通すことにより、上述した(7)
式で定義された可変長符号量の差分値Dpが得られ(p
=1,2,・・・,9,10)、これらは第1及び第2
のセレクタ705,706に入力される。
By passing the output values S 0 to S 10 of these accumulators through subtractors 704a to 704j, (7)
The difference value D p of the variable length code amount defined by the equation is obtained (p
= 1,2, ..., 9,10), these are the first and second
Are input to the selectors 705 and 706 of FIG.

【0067】一方、端子709から入力された所定値N
は、D0として第1のセレクタ705に入力される。
尚、このD0については上述した定義と異なるが、D0
Nを満たす値であれば、本実施形態の符号化パラメータ
選択部105を正常に機能させることができる。
On the other hand, the predetermined value N input from the terminal 709
Is input to the first selector 705 as D 0 .
Note that D 0 is different from the definition described above, but D 0
If the value satisfies N, the encoding parameter selection unit 105 of the present embodiment can function normally.

【0068】まず始めに、アップダウンカウンタ713
の初期値が“0”の時の動作について説明する。
First, the up / down counter 713
The operation when the initial value of is "0" will be described.

【0069】該カウンタ713は、不図示の制御信号に
よって、量子化値の全てが入力されるまで初期値“0”
に保持されており、量子化値の全てが入力し終わると保
持が解除され、以下のように動作する。
The counter 713 has an initial value “0” until all the quantized values are input by a control signal (not shown).
And when all the quantized values have been input, the holding is released and the operation is performed as follows.

【0070】該カウンタ713の値は、第1及び第2の
セレクタ705,706に送られ、カウント値がSの
時、第1のセレクタ705はDsを、第2のセレクタ7
06はDs+1を選択して出力する。従って、該カウンタ
713が初期値である場合、そのカウント値Sは“0”
であるため、第1のセレクタ705はD0を、第2のセ
レクタ706はD1を選択する。
[0070] The value of the counter 713 is sent to the first and second selectors 705 and 706, when the count value is S, a first selector 705 D s, the second selector 7
06 selects and outputs Ds + 1 . Therefore, when the counter 713 is an initial value, the count value S is “0”.
Therefore, the first selector 705 selects D 0 and the second selector 706 selects D 1 .

【0071】D0,D1はそれぞれ、第1及び第2の比較
器707,708に送られ、所定値Nと比較される。上
述したように、所定値NはD0≧Nを満たす。更にここ
では、D0≧D1≧D2≧D3≧N>D4≧D5≧・・・と仮
定する。よってこの場合、D 0,D1共にN以上であるた
め、第1及び第2の比較器707,708から、共に
“1”が出力される。
D0, D1Are the first and second comparisons, respectively.
Are sent to the devices 707 and 708 and compared with a predetermined value N. Up
As described above, the predetermined value N is D0Satisfies ≧ N. Further here
Then D0≧ D1≧ DTwo≧ DThree≧ N> DFour≧ DFive≧ ・ ・ ・ and provisional
Set. So in this case D 0, D1Both are more than N
From the first and second comparators 707 and 708,
“1” is output.

【0072】第1の比較器707の出力は、インバータ
711にて“0”に反転され、アップダウンカウンタ7
13のカウントダウン制御端子に入力される。一方、第
2の比較器708の出力“1”は、そのままアップダウ
ンカウンタ713のカウントアップ制御端子に入力され
る。よって、アップダウンカウンタ713はカウントア
ップモードとなり、不図示のクロック入力に基づいてカ
ウント値が“0”から“1”へとアップする。
The output of the first comparator 707 is inverted to “0” by the inverter 711 and
13 is input to the countdown control terminal. On the other hand, the output “1” of the second comparator 708 is directly input to the count-up control terminal of the up-down counter 713. Therefore, the up / down counter 713 enters the count-up mode, and the count value increases from “0” to “1” based on a clock input (not shown).

【0073】カウント値=1においては、第1のセレク
タ705からD1が出力され、第2のセレクタ706か
らD2が出力される。D1,D2≧Nであるため、上述し
たカウント値=0の場合と同様に、アップダウンカウン
タ713においてカウント値が1から2へとアップす
る。カウント値=2の場合も同様に、カウント値が
“2”から“3”へとアップする。
When the count value is 1, D 1 is output from the first selector 705 and D 2 is output from the second selector 706. Since D 1 and D 2 ≧ N, the count value of the up / down counter 713 is increased from 1 to 2 as in the case of the above-described count value = 0. Similarly, when the count value is 2, the count value is increased from "2" to "3".

【0074】しかし、カウント値が3になると、第1及
び第2の比較器707,708における比較結果がこれ
までとは異なるため、アップダウンカウンタ713の動
作が異なってくる。この場合、第1のセレクタ705か
らD3が出力され、第2のセレクタ706からD4が出力
され、対応する比較器707,708の出力はそれぞれ
“1”,“0”となる。即ち、第2の比較器708の出
力が変化し、アップダウンカウンタ713のカウントア
ップ端子に対してこれまで“1”が入力されていたもの
が、“0”が入力されるようになる。これにより、アッ
プダウンカウンタ713ではカウントアップ/カウント
ダウンのいずれの動作も行なわれず、カウント値“3”
が保持される。
However, when the count value becomes 3, the operation of the up / down counter 713 differs because the comparison results in the first and second comparators 707 and 708 are different from those before. In this case, D 3 is output from the first selector 705, D 4 from the second selector 706 are output, each output of the corresponding comparator 707, 708 "1", it becomes "0". That is, the output of the second comparator 708 changes, and “0” is input to the count-up terminal of the up / down counter 713, which has been input “1”. Thus, the up / down counter 713 does not perform any of the count-up / count-down operations, and the count value “3”
Is held.

【0075】アップダウンカウンタ713におけるカウ
ント値は、端子721から出力される。この時、検出器
717は第1及び第2の比較器707,708の出力が
それぞれ“1”,“0”になったことを検出し、端子7
19に“1”を出力する。これにより即ち、kパラメー
タの最適値の選択処理が終了したことが外部に報知され
る。
The count value of the up / down counter 713 is output from a terminal 721. At this time, the detector 717 detects that the outputs of the first and second comparators 707 and 708 have become “1” and “0”, respectively,
19 is output as "1". That is, the completion of the selection process of the optimum value of the k parameter is notified to the outside.

【0076】以上、アップダウンカウンタ713の初期
値が“0”である場合について説明を行なった。次に、
該初期値が“10”の場合について説明する。
The case where the initial value of the up / down counter 713 is "0" has been described above. next,
The case where the initial value is "10" will be described.

【0077】アップダウンカウンタ713のカウント値
が“10”である場合、第1のセレクタ705はD
10を、第2のセレクタ706はD11として“0”を選択
する。ここで、D10及び“0”はNより小さいので、第
1及び第2の比較器707,708共に“0”を出力す
る。第1の比較器707の出力はインバータ711にて
“1”に反転され、アップダウンカウンタ713のカウ
ントダウン制御端子に与えられる。これにより、不図示
のクロックが1クロック入力されることによって、カウ
ンタ値が“10”から“9”へダウンする。
When the count value of the up / down counter 713 is “10”, the first selector 705
10, the second selector 706 selects "0" as the D 11. Here, D 10 and "0" is smaller than N, the first and second comparators 707 and 708 together to output a "0". The output of the first comparator 707 is inverted to “1” by the inverter 711 and supplied to the countdown control terminal of the up / down counter 713. Thus, the counter value is reduced from “10” to “9” by inputting one clock (not shown).

【0078】また、アップダウンカウンタ713がカウ
ント値=9である場合は、第1のセレクタ705からD
9が出力され、第2のセレクタ706からD10が出力さ
れる。すると、D9,D10<Nであるため、上述したカ
ウント値=“10”の場合と同様に、アップダウンカウ
ンタ713においてカウント値が“9”から“8”へと
ダウンする。カウント値=8,7,6,5,4において
も同様に、カウント値は“8”から“3”までカウント
ダウンされる。
When the count value of the up / down counter 713 is 9, the first selector
9 is outputted, D 10 is outputted from the second selector 706. Then, since D9 and D10 <N, the count value of the up / down counter 713 is reduced from "9" to "8" as in the case where the count value = "10" described above. Similarly, when the count value is 8, 7, 6, 5, 4, the count value is counted down from "8" to "3".

【0079】そしてカウント値が“3”になると、第1
及び第2の比較器707,708における比較結果がこ
れまでとは異なるため、アップダウンカウンタ713の
動作が異なってくる。この場合、第1のセレクタ705
からD3が出力され、第2のセレクタ706からD4が出
力され、対応する比較器707,708の出力はそれぞ
れ“1”,“0”となる。即ち、第1の比較器707の
出力が変化し、アップダウンカウンタ713のカウント
ダウン端子に対してこれまで“1”が入力されていたも
のが、“0”が入力されるようになる。これにより、ア
ップダウンカウンタ713ではカウントアップ/カウン
トダウンのいずれの動作も行なわれず、カウント値
“3”が保持される。
When the count value becomes "3", the first
Since the comparison results in the second and third comparators 707 and 708 are different from those before, the operation of the up / down counter 713 differs. In this case, the first selector 705
From D 3 is output, D 4 from the second selector 706 are output, each output of the corresponding comparator 707, 708 "1", it becomes "0". That is, the output of the first comparator 707 changes, and “0” is input to the count-down terminal of the up / down counter 713, which has been input “1”. Thus, the up / down counter 713 does not perform any of the count-up / count-down operations, and holds the count value “3”.

【0080】アップダウンカウンタ713におけるカウ
ント値は、端子721から出力される。この時、検出器
717は第1及び第2の比較器707,708の出力が
それぞれ“1”,“0”になったことを検出し、端子7
19に“1”を出力する。これにより即ち、kパラメー
タの最適値の選択処理が終了したことが外部に報知され
る。
The count value of the up / down counter 713 is output from a terminal 721. At this time, the detector 717 detects that the outputs of the first and second comparators 707 and 708 have become “1” and “0”, respectively,
19 is output as "1". That is, the completion of the selection process of the optimum value of the k parameter is notified to the outside.

【0081】以上説明したようにアップダウンカウンタ
713においては、その初期値として“0”,“10”
のいずれを設定した場合でも、最終的に同じカウント値
に収束するため、最適なkパラメータとして同じ結果が
得られることが分かる。もちろん、“0”,“10”以
外の初期値を設定した場合でも、同様の結果になる。
As described above, in the up / down counter 713, "0", "10"
In any case, it is understood that the same result is obtained as the optimum k parameter because the count value finally converges to the same count value. Of course, the same result is obtained even when an initial value other than “0” and “10” is set.

【0082】また、アップダウンカウンタ713は、初
期値が“0”に限定されていればカウントダウン動作は
必要ないため、単純なアップカウンタで代用できる。同
様に、初期値が“10”に限定されていればカウントア
ップ動作が必要ないため、ダウンかンタで代用できる。
If the initial value is limited to "0", the up / down counter 713 does not require a countdown operation, and can be replaced with a simple up counter. Similarly, if the initial value is limited to "10", the count-up operation is not required, and can be replaced with a down-counter.

【0083】符号化パラメータ選択部105では、以上
説明したような処理を行なうことによって最適なkパラ
メータを導出し、既に説明した可変長符号化部106で
は、該kパラメータに基づいて符号化処理を実行する。
符号化されたデータは、次段のビットプレーン走査部1
07に出力される。
The encoding parameter selection unit 105 derives an optimal k parameter by performing the above-described processing, and the variable-length encoding unit 106, which has already been described, performs an encoding process based on the k parameter. Execute.
The encoded data is transmitted to the next bit plane scanning unit 1
07.

【0084】ビットプレーン走査部107においては、
量子化値毎に符号化・出力された符号化データを受け取
り、それをビットプレーン単位に並び替えて出力するも
のである。これを、上述した周波数成分(サブブロッ
ク)単位で行なう。
In the bit plane scanning unit 107,
It receives coded data that has been coded and output for each quantization value, rearranges the coded data on a bit-plane basis, and outputs it. This is performed for each frequency component (sub-block) described above.

【0085】まず、可変長符号化部106で生成された
符号化データを、kパラメータの値で決まる固定長符号
部分と可変長符号部分とに分離する。尚、符号にはその
外に1ビット固定の負号ビットが含まれている。
First, the coded data generated by the variable length coding section 106 is separated into a fixed length code portion and a variable length code portion determined by the value of the k parameter. In addition, the sign includes a negative sign bit fixed at 1 bit.

【0086】そして重要な情報から走査を開始するが、
まず最初に負号ビットをサブブロック内の全量子化値に
対して走査する。次に、量子化値の上位ビットの情報を
有する可変長符号部分を上位ビットプレーンから順に走
査する。最後に、固定長符号部分を上位ビットプレーン
から順に走査する。
Then, scanning is started from important information.
First, the negative bit is scanned for all the quantized values in the sub-block. Next, a variable length code portion having information on upper bits of the quantized value is sequentially scanned from the upper bit plane. Finally, the fixed length code portion is scanned in order from the upper bit plane.

【0087】図5に、本実施形態においてkパラメータ
が2である場合に生成される、各量子化値に対するゴロ
ムライス符号(但し、可変長符号部分と固定長符号部分
とを分離したもの)及びその走査順序の一例を示す。以
下、図5を参照して、可変長符号部分の走査についても
う少し詳しく説明する。可変長符号は符号長が一定でな
いため、短い符号と長い符号をどのようにそろえて並べ
るかが一意に定まらない。そこで本実施形態において
は、可変長符号の先頭ビットが同じプレーンになるよう
に並べるとする。即ち、可変長符号は図5に示す可変長
符号領域の上から順に埋めるようにして並べる。上記ビ
ットプレーン情報を上位ビットから順に走査すると、短
い符号では途中のプレーンから情報(符号ビット)が無
くなるので、情報の無い符号は走査をスキップする。よ
って、下位のビットプレーンへ行くにつれ、走査する情
報(符号ビット)が少なくなる。
FIG. 5 shows a Golomb-Rice code (in which the variable-length code portion and the fixed-length code portion are separated) for each quantized value generated when the k parameter is 2 in this embodiment, and its 4 shows an example of a scanning order. Hereinafter, the scanning of the variable-length code portion will be described in more detail with reference to FIG. Since the code length of the variable length code is not constant, it is not uniquely determined how the short code and the long code are aligned. Therefore, in the present embodiment, it is assumed that the first bits of the variable length codes are arranged in the same plane. That is, the variable length codes are arranged so as to be filled in order from the top of the variable length code area shown in FIG. When the bit plane information is scanned in order from the upper bits, information (code bits) is lost from an intermediate plane in a short code, so that a scan with a code without information is skipped. Therefore, the information (code bits) to be scanned decreases as going to lower bit planes.

【0088】図6に、図5に示す符号に対して上記順序
(負号ビット,可変長符号,固定長符号)での走査を行
うことによって得られるビット情報の並びを示す。
FIG. 6 shows an arrangement of bit information obtained by scanning the code shown in FIG. 5 in the above order (negative bit, variable length code, fixed length code).

【0089】ビットプレーン走査部107においては、
このようなビットプレーン走査をサブブロック単位でL
L,HL3,LH3,HH3,HL2,LH2,HH
2,HL1,LH1,HH1の順に行なう。
In the bit plane scanning unit 107,
Such a bit plane scan is performed in L
L, HL3, LH3, HH3, HL2, LH2, HH
2, HL1, LH1, and HH1.

【0090】ビットプレーン走査部107から出力され
たビット列は、次段の符号出力部109において順次転
送される。転送先は、ハードディスクやDVD等の記録
メディアであっても良いし、インターネット、一般公衆
回線、無線回線等のインターフェースであっても良い。
The bit string output from the bit plane scanning unit 107 is sequentially transferred to the code output unit 109 at the next stage. The transfer destination may be a recording medium such as a hard disk or a DVD, or may be an interface such as the Internet, a general public line, or a wireless line.

【0091】尚、本実施形態において生成された符号化
データには、復号時に必要となる各種情報、すなわち、
画像サイズ、1画素あたりのビット数、各周波数成分に
対する量子化ステップ、kパラメータの値等が、付属情
報として適宜付加される。
The coded data generated in this embodiment includes various information required at the time of decoding, that is,
The image size, the number of bits per pixel, the quantization step for each frequency component, the value of the k parameter, and the like are appropriately added as additional information.

【0092】以上説明したように本実施形態によれば、
パラメータkに基づいて画像データ列をゴロムライス符
号化する際に、簡易な構成で、k毎の可変長符号量の差
分値を順次、所定値と比較していくことによって、kの
最適値を高速に決定することができる。
As described above, according to the present embodiment,
When the image data sequence is subjected to Golomb-Rice encoding based on the parameter k, the optimal value of k can be increased at a high speed by sequentially comparing the difference value of the variable length code amount for each k with a predetermined value with a simple configuration. Can be determined.

【0093】[第1実施形態の変形例]第1実施形態に
おいて示した符号化パラメータ選択部105の構成とし
て、図8に示す構成も考えられる。この構成は、第1実
施形態において図7A,Bに示した減算器群(704a
〜704j)とセレクタ群(705,706)の配置を
入れ換えることにより、10個備えていた減算器704
a〜704jを、2個(804,805)まで減じたも
のである。
[Modification of First Embodiment] As a configuration of the encoding parameter selection unit 105 shown in the first embodiment, a configuration shown in FIG. 8 can be considered. This configuration corresponds to the subtractor group (704a) shown in FIGS. 7A and 7B in the first embodiment.
704 j) and the arrangement of the selector groups (705, 706) are interchanged, so that ten subtractors 704
a to 704j are reduced to two (804, 805).

【0094】即ち、図8に示すセレクタ801〜803
には、累算器703a〜703kの出力S0〜S10が直
接入力される。そして、各セレクタからは、アップダウ
ンカウンタ713のカウント値Pに対して、それぞれS
p-1,Sp、Sp+1が出力される。これらが減算器80
4,805に入力されることにより、減算器804から
はSp-1−SpとしてDpが得られ、減算器805からは
p−Sp+1としてDp+1が得られる。
That is, the selectors 801 to 803 shown in FIG.
, The output S 0 to S 10 of accumulator 703a~703k directly inputted. Then, from each selector, the count value P of the up / down counter 713 is given by S
p-1 , Sp , and Sp + 1 are output. These are subtractors 80
By being input to 4,805, from the subtractor 804 D p is obtained as S p-1 -S p, D p + 1 is obtained as S p -S p + 1 from the subtractor 805.

【0095】以降は第1実施形態と同様に動作すること
によって、kパラメータの最適値が得られる。
Thereafter, by operating in the same manner as in the first embodiment, the optimum value of the k parameter can be obtained.

【0096】<第2実施形態>以下、本発明に係る第2
実施形態について説明する。第2実施形態における符号
化装置の構成は、上述した図1と同様である。
<Second Embodiment> Hereinafter, a second embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the second embodiment is the same as that of FIG. 1 described above.

【0097】図9に、第2実施形態における符号化パラ
メータ選択部105の詳細構成を示す。同図において、
上述した第1実施形態で示した図7A,Bにおける構成
と同様の動作を行うものには同一番号を付し、説明を省
略する。
FIG. 9 shows a detailed configuration of the coding parameter selection unit 105 in the second embodiment. In the figure,
Components performing the same operations as those in the first embodiment described above with reference to FIGS. 7A and 7B are denoted by the same reference numerals, and description thereof will be omitted.

【0098】上述した第1実施形態においては、可変長
符号量の差分値であるDpやDp+1を求めるために、減算
器(704a〜704j)を使用する構成を示したが、
第2実施形態においては加算器を用いることを特徴とす
る。加算演算によってDp,Dp+1を求める方法は、上述
した式(7)に示される。
[0098] In the first embodiment described above, to determine the D p and D p + 1, which is a difference value of the variable-length code amount, although the configuration using a subtractor (704a~704j),
The second embodiment is characterized in that an adder is used. The method of obtaining D p and D p + 1 by the addition operation is shown in the above-mentioned equation (7).

【0099】 Dp=Sp-1−Sp=(2×Sp+Bp)−Sp =Sp+Bp(p≧1) ・・・(7) この式(7)を適用するためには、入力量子化値の各ビ
ットプレーンにおける“1”の数(B1,B2,B3,・
・・B10,B11)を計数するカウンタが必要となる。
D p = S p−1 −S p = (2 × S p + B p ) −S p = S p + B p (p ≧ 1) (7) In order to apply this equation (7) Is the number of “1” s in each bit plane of the input quantization value (B 1 , B 2 , B 3 ,.
·· B 10, B 11) is a counter for counting the need.

【0100】図9において、901a,901b,90
1c,・・・、901jが、入力量子化値の各ビットプ
レーンにおける“1”の数を計数するカウンタ群であ
る。また、902,903は、アップダウンカウンタ7
13のカウント値Pに対応してSp,Sp+1を選択して出
力するセレクタであり、904,905は、アップダウ
ンカウンタ713のカウント値Pに対応してBp,Bp+1
を選択して出力するセレクタである。906,907
は、SpとBp、及びSp+1とBp+1をそれぞれ加算する加
算器である。
In FIG. 9, 901a, 901b, 90
, 901j are a group of counters for counting the number of "1" in each bit plane of the input quantization value. Reference numerals 902 and 903 denote the up-down counter 7
13 is a selector for selecting and outputting S p and S p + 1 in accordance with the count value P of the counter 13, and 904 and 905 are B p and B p + 1 corresponding to the count value P of the up / down counter 713.
This is a selector for selecting and outputting. 906,907
It is an adder which adds S p and B p, and S p + 1 and B p + 1, respectively.

【0101】図9に示す構成によって、Dp、Dp+1を求
めた後は、第1実施形態における図7Bに示すセレクタ
705,706以降と同様の構成によって処理を行な
う。
After D p and D p + 1 are obtained by the configuration shown in FIG. 9, the processing is performed by the same configuration as the selectors 705 and 706 shown in FIG. 7B in the first embodiment.

【0102】サブブロック内の全ての量子化値が入力し
終わると、累算器703a〜703k,カウンタ901
a〜901jからそれぞれS0〜S10,B1〜B10が出力
され、セレクタ902〜905に入力される。尚、セレ
クタ904には、P=0に対応するB0の値の代わりと
して、“0”が入力されている。
When all the quantized values in the sub-block have been input, the accumulators 703a to 703k, the counter 901
is S 0 ~S 10, B 1 ~B 10 respectively output from A~901j, is input to the selector 902 to 905. Note that “0” is input to the selector 904 instead of the value of B 0 corresponding to P = 0.

【0103】アップダウンカウンタ713のカウント値
Pに対応して、セレクタ902はS pを、セレクタ90
3はSp+1を、セレクタ904はBpを、セレクタ905
はBp +1を選択して出力する。
Count value of up / down counter 713
In response to P, selector 902 pTo the selector 90
3 is Sp + 1And the selector 904 sets BpTo the selector 905
Is Bp +1Select and output.

【0104】それらは、加算器906,907にて加算
され、加算器906からはSp+Bp(=Dp)が、加算
器907からはSp+1+Bp+1(=Dp+1)が出力され
る。尚、P=0の時は、D0としてS0+0=S0(≧
N)が出力される。
These are added by adders 906 and 907, and S p + B p (= D p ) from adder 906 and S p + 1 + B p + 1 (= D p + ) from adder 907. 1 ) is output. When P = 0, D 0 is set as S 0 + 0 = S 0 (≧
N) is output.

【0105】このように、比較器707,708に入力
される可変長符号量の差分値Dp及びDp+1が、第1実施
形態の図7Bに示す構成と全く同様であるため、以降は
第1実施形態と同様の動作によって、最終的にkパラメ
ータの最適値を出力することができる。
As described above, since the difference values D p and D p + 1 of the variable length code amounts input to the comparators 707 and 708 are completely the same as the configuration shown in FIG. 7B of the first embodiment, By the same operation as in the first embodiment, the optimum value of the k parameter can be finally output.

【0106】尚、図9に示す構成において、S0を求め
るための累算器703aを省略して、セレクタ902に
対してS0の替わりに所定値Nを入力しても良い。
In the configuration shown in FIG. 9, accumulator 703a for obtaining S 0 may be omitted, and predetermined value N may be input to selector 902 instead of S 0 .

【0107】以上説明したように第2実施形態によれ
ば、図9に示す様な簡易な構成によっても、パラメータ
kの最適値を高速に決定することができる。
As described above, according to the second embodiment, the optimum value of the parameter k can be determined at high speed even with a simple configuration as shown in FIG.

【0108】<第3実施形態>以下、本発明に係る第3
実施形態について説明する。第3実施形態における符号
化装置の構成は、上述した図1と同様である。
<Third Embodiment> Hereinafter, a third embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the third embodiment is the same as that of FIG. 1 described above.

【0109】上述した第1及び第2実施形態において
は、サブブロック内の全ての量子化値を入力し終えてか
ら、kパラメータの最適値を求める処理を開始する構成
について説明した。そのため、kパラメータの最適値を
得るまでに数クロックを要し、次のサブブロックの処理
を速やかに開始することはできなかった。
In the above-described first and second embodiments, the description has been given of the configuration in which the processing for obtaining the optimum value of the k parameter is started after all the quantization values in the sub-block have been input. Therefore, it takes several clocks to obtain the optimal value of the k parameter, and the processing of the next sub-block cannot be started immediately.

【0110】そこで第3実施形態においては、サブブロ
ック内の全ての量子化値を入力し終える以前に、kパラ
メータの最適値を求める処理を開始することを特徴とす
る。
Therefore, the third embodiment is characterized in that a process for obtaining the optimum value of the k parameter is started before all the quantization values in the sub-block have been input.

【0111】第3実施形態においては、kパラメータに
関する次のような性質を利用する。
In the third embodiment, the following property regarding the k parameter is used.

【0112】「最適なkパラメータは、入力した量子化
値の数が少ないうちは次の入力量子化値の影響を大きく
受けるが、入力した量子化値の数が多くなってくると、
次の入力量子化値の影響をあまり受けなくなる」例え
ば、サブブロック内の全量子化値の個数を50個とする
と、本来、kパラメータの値は50個の量子化値を全て
入力した後に求められるべきである。ここで第3実施形
態においては、例えば40個の量子化値を入力した時点
で、全ての量子化値を入力し終えたものと解釈して、k
パラメータの最適値を求める処理を開始する。従って、
該処理の間にも、次々と量子化値が入力されてくること
になる。しかしながら、kパラメータの最適値を求める
処理は、常に更新された最新の情報に基づいて行なわれ
るため、該最新情報に向かってkパラメータの値は収束
して行く。
"The optimal k parameter is greatly affected by the next input quantization value while the number of input quantization values is small, but when the number of input quantization values increases,
For example, assuming that the number of all quantized values in a sub-block is 50, the value of the k parameter is originally obtained after all 50 quantized values are input. Should be done. In the third embodiment, for example, when 40 quantized values are input, it is interpreted that all the quantized values have been input, and k
The processing for obtaining the optimum value of the parameter is started. Therefore,
During this process, the quantization values are input one after another. However, since the process of obtaining the optimum value of the k parameter is always performed based on the updated latest information, the value of the k parameter converges toward the latest information.

【0113】たとえ、49個の量子化値入力に対するk
パラメータの最適値と、50個の量子化値入力に対する
最適値との間に差が1つあったとしても、1クロックで
追随できるため、実質的に、全量子化値の入力終了と同
時に、kパラメータの最適値が得られる。
For example, k for 49 quantized value inputs
Even if there is one difference between the optimal value of the parameter and the optimal value for the input of 50 quantized values, it can be followed in one clock, so that virtually all the quantized values have been input at the same time. The optimal value of the k parameter is obtained.

【0114】図7A及び図7Cに、第3実施形態におけ
る符号化パラメータ選択部105の詳細構成を示す。図
7Cにおいて、上述した第1実施形態で示した図7Bに
おける構成と同様の動作を行うものには同一番号を付
し、説明を省略する。
FIGS. 7A and 7C show a detailed configuration of the coding parameter selection unit 105 in the third embodiment. In FIG. 7C, components that perform the same operations as those in the configuration in FIG. 7B described in the first embodiment described above are given the same reference numerals, and descriptions thereof will be omitted.

【0115】第3実施形態の符号化パラメータ選択部1
05においては、上述した処理を実現するために、図7
A,Bに示す構成に加えて、入力量子化値の数をカウン
トする第2のカウンタ750を備えることを特徴とす
る。そして、第2のカウンタ750の値を、”N”に代
えて端子709に入力してアップダウンカウンタ713
へフィードバックすることにより、量子化値が入力され
る度に、アップダウンカウンタ713におけるカウント
値がその時点におけるkパラメータの最適値へ近づくよ
うに制御される。
Coding Parameter Selection Unit 1 of Third Embodiment
In FIG. 05, in order to realize the processing described above, FIG.
In addition to the configurations shown in A and B, a second counter 750 for counting the number of input quantization values is provided. Then, the value of the second counter 750 is input to the terminal 709 instead of “N”, and the value of the
Each time a quantization value is input, the count value of the up / down counter 713 is controlled so as to approach the optimum value of the k parameter at that time.

【0116】アップダウンカウンタ713の初期値の保
持を解除して、上記処理へ移るタイミングとしては、種
々考えられる。上述した例では、50個の全量子化値の
入力に対して40個の入力があった時点で初期値の保持
を解除した。これを例えば、32個の入力があった時点
で初期値の保持を解除することにすれば、追加した第2
のカウンタの6ビット目の信号が“1”になったタイミ
ングで初期値の保持を解除すれば良く、より簡単な制御
が可能となる。
There are various possible timings for releasing the holding of the initial value of the up / down counter 713 and proceeding to the above processing. In the example described above, the holding of the initial value is released when there are 40 inputs for all 50 quantized values. For example, if the holding of the initial value is released when there are 32 inputs, the added second
The holding of the initial value may be released at the timing when the signal of the 6th bit of the counter becomes "1", and simpler control becomes possible.

【0117】また、より単純に、初期値の保持を一切行
わず、1つ目の量子化値が入力されたタイミングで、k
パラメータの最適値を求める処理を開始してもよい。ま
た、初期値の設定を省くことも可能である。
More simply, the initial value is not held at all, and at the timing when the first quantized value is input, k
The processing for obtaining the optimum value of the parameter may be started. It is also possible to omit the setting of the initial value.

【0118】以上説明したように第3実施形態によれ
ば、次のサブブロックの処理への移行が速やかに行われ
るため、パラメータkの最適値をより高速に決定するこ
とができる。
As described above, according to the third embodiment, since the transition to the processing of the next sub-block is performed promptly, the optimum value of the parameter k can be determined more quickly.

【0119】尚、第3実施形態で説明した制御は図7C
に示す構成のみならず、後述する各実施形態において
も、アップダウンカウンタを用いた構成であれば適用可
能である。
The control described in the third embodiment is similar to the control shown in FIG.
Not only the configuration shown in FIG. 1 but also each embodiment described later can be applied as long as the configuration uses an up-down counter.

【0120】<第4実施形態>以下、本発明に係る第4
実施形態について説明する。第4実施形態における符号
化装置の構成は、上述した図1と同様である。
<Fourth Embodiment> Hereinafter, a fourth embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the fourth embodiment is the same as that of FIG. 1 described above.

【0121】図7A及び図10に、第4実施形態におけ
る符号化パラメータ選択部105の詳細構成を示す。図
10において、上述した第1実施形態で示した図7Bに
おける構成と同様の動作を行うものには同一番号を付
し、説明を省略する。
FIGS. 7A and 10 show the detailed configuration of the coding parameter selection unit 105 in the fourth embodiment. In FIG. 10, the same operations as those in the configuration in FIG. 7B described in the first embodiment described above are denoted by the same reference numerals, and description thereof will be omitted.

【0122】上述した第1乃至第3実施形態において
は、符号化パラメータ選択部105において2つの比較
器(707,708)を使用する構成を示したが、第4
実施形態では、比較器707のみを備えることを特徴と
する。またそれに応じて、1つのセレクタ705のみを
備える。
In the first to third embodiments described above, the configuration in which two comparators (707, 708) are used in the encoding parameter selection unit 105 has been described.
The embodiment is characterized in that only the comparator 707 is provided. Accordingly, only one selector 705 is provided.

【0123】比較器を2つ備える構成においては、第1
実施形態で詳述したように、kパラメータが最適値に収
束するまでは2つの比較器は同じ値を出力しており、収
束すると、該比較器の一方の出力が“1”、他方の出力
が“0”になる。よって、収束する直前までは、1つの
比較器のみで十分に機能を果たすことが判る。
In the configuration having two comparators, the first
As described in detail in the embodiment, the two comparators output the same value until the k parameter converges to the optimum value. When the two parameters converge, one output of the comparator is “1” and the other output is “1”. Becomes “0”. Therefore, it can be seen that just before the convergence, only one comparator sufficiently functions.

【0124】しかし、比較器を1つとした場合、第1乃
至第3実施形態と同様の方法では収束状態を維持するこ
とはできない。そこで第4実施形態における最適値の決
定方法について、以下に説明する。
However, when one comparator is used, a convergence state cannot be maintained by the same method as in the first to third embodiments. Therefore, a method for determining the optimum value in the fourth embodiment will be described below.

【0125】図10において、1001はカウントアッ
プ用の制御端子とダウンカウント用の制御端子を同一と
するアップダウンカウンタ、1003は1ビットのD型
フリップフロップ(以下、D−FFと称する)、100
5は排他的論理和素子(以下、EXORと称する)、1
007はレジスタである。
In FIG. 10, reference numeral 1001 denotes an up / down counter having the same count-up control terminal and down-count control terminal; 1003, a 1-bit D-type flip-flop (hereinafter, referred to as D-FF);
5 is an exclusive OR element (hereinafter, referred to as EXOR), 1
007 is a register.

【0126】第4実施形態においては、端子709には
サブブロック内の量子化値の個数Nを入力し、アップダ
ウンカウンタ1001の初期値を0とする。そして、N
個の量子化値を全て入力した後に、kパラメータの最適
値を求める処理を開始する。また、第1実施形態での説
明と同様、D1≧D2≧D3≧N>D4≧D5≧・・・と仮
定する。
In the fourth embodiment, the number N of quantized values in the sub-block is input to the terminal 709, and the initial value of the up / down counter 1001 is set to 0. And N
After inputting all the quantized values, the process of obtaining the optimum value of the k parameter is started. Also, as in the description of the first embodiment, it is assumed that D 1 ≧ D 2 ≧ D 3 ≧ N> D 4 ≧ D 5 ≧.

【0127】アップダウンカウンタ1001の値はセレ
クタ705に送られる。セレクタ705では、カウント
値“0”に対応して、端子709から入力されているN
をD 0として出力する。
The value of the up / down counter 1001 is
705. In the selector 705, the count
In response to the value “0”, N
To D 0Output as

【0128】セレクタ705からの出力値D0は、比較
器707において所定値Nと比較され、ここでD0=N
であるため、比較器707は“1”を出力する。
The output value D 0 from the selector 705 is compared with a predetermined value N in a comparator 707, where D 0 = N
Therefore, the comparator 707 outputs “1”.

【0129】比較器707の出力は、1ビットのD−F
F1003に送られると共に、アップダウンカウンタ1
001のカウント制御端子に入力される。アップダウン
カウンタ1001は、制御信号“1”によりカウントア
ップモードとなり、不図示のクロック入力に基づいてカ
ウント値Sが“0”から“1”へとアップする。
The output of the comparator 707 is a 1-bit DF
F1003 and up-down counter 1
001 is input to the count control terminal. The up / down counter 1001 enters a count-up mode by a control signal “1”, and the count value S increases from “0” to “1” based on a clock input (not shown).

【0130】カウント値=1においては、前記セレクタ
705からD1が出力される。ここでD1≧Nであるた
め、上述したD0の場合と同様に、カウント値が“1”
から“2”へとアップする。また、カウント値=2,3
についても同様に、さらにカウント値は“2”から
“3”、“3”から“4”へとアップする。
[0130] In the count value = 1, D 1 is output from the selector 705. Here, since D 1 ≧ N, the count value is “1” as in the case of D 0 described above.
To "2". Also, the count value = 2,3
Similarly, the count value further increases from "2" to "3" and from "3" to "4".

【0131】一方、レジスタ1007にもカウント値S
が入力されており、クロック入力に同期して、カウント
値を取り込んで出力する。例えば、カウント値が“4”
になった時点で、レジスタ1007は端子721へ
“3”を出力し、“4”が入力されている。
On the other hand, the count value S is also stored in the register 1007.
Is input, and the count value is captured and output in synchronization with the clock input. For example, when the count value is “4”
At this point, the register 1007 outputs “3” to the terminal 721 and “4” has been input.

【0132】この時(カウント値S=4)、セレクタ7
05から出力されているD4は、D4<Nであるため、こ
れまで“1”であった比較器707の出力が“0”に変
わる。するとEXOR1005はこの変化を検出し、レ
ジスタ1007に対して出力データを保持し続けるため
の制御信号“1”を送る。
At this time (count value S = 4), the selector 7
Since D 4 output from 05 satisfies D 4 <N, the output of the comparator 707 which has been “1” is changed to “0”. Then, the EXOR 1005 detects this change and sends a control signal “1” to the register 1007 to keep the output data.

【0133】また、比較器707の出力が“0”に変化
することにより、アップダウンカウンタ1001はカウ
ントダウンモードに変わり、不図示のクロック入力に基
づいて、“4”から“3”へとカウントダウンする。ま
た、D−FF1003の出力は“0”になる。
When the output of the comparator 707 changes to "0", the up / down counter 1001 changes to a countdown mode, and counts down from "4" to "3" based on a clock input (not shown). . Further, the output of the D-FF 1003 becomes “0”.

【0134】アップダウンカウンタ1001のカウント
値が“3”へ戻ると、比較器707の出力も“1”へ戻
る。しかし、EXOR1005の出力は変わらず“1”
のままである。これにより、レジスタ1007の出力も
“3”に保持され続ける。
When the count value of the up / down counter 1001 returns to “3”, the output of the comparator 707 also returns to “1”. However, the output of EXOR 1005 remains unchanged at "1".
Remains. As a result, the output of the register 1007 is also kept at “3”.

【0135】するとアップダウンカウンタ1001は、
再度カウントアップモードに変わり、クロック入力によ
って“3”から“4”へとカウントアップする。そして
以降のカウント値は、“3”と“4”が交互に変化す
る。
Then, the up / down counter 1001
The mode changes to the count-up mode again, and counts up from "3" to "4" by the clock input. In the subsequent count values, “3” and “4” alternately change.

【0136】図11に、上述した図10に示す構成にお
けるタイミングチャートを示す。同図において、(a)
はカウント値S、(b)は比較器707出力、(c)は
EXOR1005出力、(d)はレジスタ1007出力
を示す。
FIG. 11 is a timing chart for the configuration shown in FIG. 10 described above. In FIG.
Indicates the count value S, (b) indicates the output of the comparator 707, (c) indicates the output of the EXOR 1005, and (d) indicates the output of the register 1007.

【0137】図11によれば、比較器707の出力が最
初に“0”になったサイクル以降、EXOR1005の
出力が“1”になり、レジスタ1007の出力値が
“3”に保持されることが判る。
According to FIG. 11, after the cycle in which the output of the comparator 707 first becomes "0", the output of the EXOR 1005 becomes "1" and the output value of the register 1007 is held at "3". I understand.

【0138】以上説明したように、図10に示す構成に
よれば、EXOR1005の出力である端子719が
“1”になった時点で、kパラメータの最適値が確定
し、その値はレジスタ1007の出力である端子721
より得られる。
As described above, according to the configuration shown in FIG. 10, when the terminal 719, which is the output of the EXOR 1005, becomes "1", the optimum value of the k parameter is determined. Output terminal 721
Is obtained.

【0139】以上説明したように第4実施形態によれ
ば、図10に示す様にセレクタ及び比較器を1つしか備
えない、より簡易な構成によっても、パラメータkの最
適値を高速に決定することができる。
As described above, according to the fourth embodiment, the optimum value of the parameter k is determined at high speed by a simpler configuration having only one selector and comparator as shown in FIG. be able to.

【0140】<第5実施形態>以下、本発明に係る第5
実施形態について説明する。第5実施形態における符号
化装置の構成は、上述した図1と同様である。
<Fifth Embodiment> Hereinafter, a fifth embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the fifth embodiment is the same as that of FIG. 1 described above.

【0141】上述した第4実施形態においては、アップ
ダウンカウンタ1001の初期値を“0”とする例につ
いて説明したが、第5実施形態においては、アップダウ
ンカウンタの初期値をkパラメータの最大候補値である
“10”に設定することを特徴とする。
In the above-described fourth embodiment, an example in which the initial value of the up / down counter 1001 is set to “0” has been described. However, in the fifth embodiment, the initial value of the up / down counter is set to the maximum candidate of the k parameter. It is characterized in that the value is set to "10".

【0142】図7A及び図12に、第5実施形態におけ
る符号化パラメータ選択部105の詳細構成を示す。図
12において、上述した第4実施形態で示した図10に
おける構成と同様の動作を行うものには同一番号を付
し、説明を省略する。
FIGS. 7A and 12 show a detailed configuration of the coding parameter selection unit 105 in the fifth embodiment. 12, the same operations as those in the configuration of FIG. 10 shown in the above-described fourth embodiment are denoted by the same reference numerals, and description thereof will be omitted.

【0143】図12において、1201はリセット機能
のある1ビットのD型フリップフロップ(以下、D−F
Fと称する)、1203は2入力の論理和素子(以下、
ORと称する)、1205は制御信号が“1”の時に入
力データを取り込み“0”の時には出力中のデータを保
持するレジスタである。
In FIG. 12, reference numeral 1201 denotes a 1-bit D-type flip-flop having a reset function (hereinafter referred to as DF).
F) 1203 is a two-input logical sum element (hereinafter, referred to as F).
A register 1205 receives input data when the control signal is "1" and holds data being output when the control signal is "0".

【0144】第5実施形態においても、端子709には
サブブロック内の量子化値の個数Nを入力し、量子化値
をN個全て入力した後で、kパラメータの最適値を求め
る処理を開始する。また、第4実施形態と同様、D1
2≧D3≧N>D4≧D5≧・・・と仮定する。
Also in the fifth embodiment, the number N of the quantized values in the sub-block is input to the terminal 709, and after all the N quantized values are input, the processing for obtaining the optimum value of the k parameter is started. I do. Further, as in the fourth embodiment, D 1
It is assumed that D 2 ≧ D 3 ≧ N> D 4 ≧ D 5 ≧.

【0145】図12に示す構成においては、上述したよ
うにアップダウンカウンタ1001は“10”に初期化
され、該初期化に応じて、D−FF1201は不図示の
制御信号により“0”にリセットされる。
In the configuration shown in FIG. 12, the up / down counter 1001 is initialized to "10" as described above, and in response to the initialization, the D-FF 1201 is reset to "0" by a control signal (not shown). Is done.

【0146】アップダウンカウンタ1001の初期値
“10”はセレクタ705に送られ、セレクタ705か
らは該初期値に対応してD10が出力される。
[0146] The initial value of the up-down counter 1001 "10" is sent to the selector 705, D 10 is outputted corresponding to the initial value from the selector 705.

【0147】セレクタ705の出力値D10は、比較器7
07にて所定値Nと比較され、ここでD10<Nであるた
め、比較器707は“0”を出力する。
The output value D 10 of the selector 705 is
At 07, the value is compared with a predetermined value N. Since D 10 <N, the comparator 707 outputs “0”.

【0148】比較器707の出力は、OR1203及び
アップダウンカウンタ1001に入力されると共に、レ
ジスタ1205に制御信号として与えられる。レジスタ
1205は、制御信号が“0”の時には、アップダウン
カウンタ1001から送られてくるカウント値S(入力
データ)を取り込まず、それ以前から保持している値を
そのまま保持し続ける。OR1203の出力も“0”の
ままであり、D−FF1201には自身の出力と同じ
“0”が入力され、次のサイクルでも“0”を出力し続
ける。
The output of the comparator 707 is input to the OR 1203 and the up / down counter 1001 and is also supplied to the register 1205 as a control signal. When the control signal is “0”, the register 1205 does not take in the count value S (input data) sent from the up / down counter 1001 and keeps holding the value held before that. The output of the OR 1203 remains "0", and the same "0" as its own output is input to the D-FF 1201, and the D-FF 1201 keeps outputting "0" even in the next cycle.

【0149】一方、アップダウンカウンタ1001は、
比較器707から入力される制御信号“0”によって、
カウントダウンモードとなり、不図示のクロック入力に
より、“10”から“9”へとカウントダウンする。
On the other hand, the up / down counter 1001
By the control signal “0” input from the comparator 707,
In the countdown mode, the countdown is performed from “10” to “9” by a clock input (not shown).

【0150】カウント値=9においては、セレクタ70
5からD9が出力される。ここで、D9<Nであるため、
上述したD10の場合と同様に、カウント値が“9”から
“8”へとダウンする。カウント値=8,7,6,5,
4においても同様に、カウント値が“3”になるまでカ
ウントダウンを続ける。その間、レジスタ1205、D
−FF1201の出力は変化しない。
When the count value = 9, the selector 70
5 outputs D 9 . Here, since D 9 <N,
As with the D 10 as described above, the count value is down to "8" to "9". Count value = 8, 7, 6, 5,
Similarly, in the case of No. 4, the countdown is continued until the count value becomes "3". Meanwhile, register 1205, D
-The output of the FF 1201 does not change.

【0151】アップダウンカウンタ1001のカウント
値が“3”になると、初めて比較器707の出力が
“1”になる。該比較結果は、OR1203、アップダ
ウンカウンタ1001に入力されると共に、レジスタ1
205に制御信号として与えられる。この結果、OR1
203の出力は“1”になり、アップダウンカウンタ1
001はカウントアップモードになる。そして、不図示
のクロック入力によって、D−FF1201の出力が
“0”から“1”に変わり、カウンタは“4”へとカウ
ントアップする。一方、レジスタ1205は、比較器7
07からの比較結果“1”を制御信号として、カウント
値“3”を取り込んで出力する。
When the count value of the up / down counter 1001 becomes "3", the output of the comparator 707 becomes "1" for the first time. The comparison result is input to the OR 1203 and the up / down counter 1001 and the register 1
205 is provided as a control signal. As a result, OR1
The output of 203 becomes “1” and the up / down counter 1
001 is a count-up mode. The output of the D-FF 1201 changes from “0” to “1” by a clock input (not shown), and the counter counts up to “4”. On the other hand, the register 1205 stores the value of the comparator 7
The count value “3” is fetched and output using the comparison result “1” from 07 as a control signal.

【0152】アップダウンカウンタ1001のカウント
値が“4”へ戻ると、比較器707の出力も“0”へ戻
る。これにより、アップダウンカウンタ1001はカウ
ントダウンモードに戻り、クロック入力によって“4”
から“3”へとカウントダウンする。一方、レジスタ1
205は保持状態になるので“3”を出力し続ける。ま
た、OR1203の出力は以前と変わらず“1”のまま
であり、D−FF1201の出力も“1”に保たれる。
When the count value of the up / down counter 1001 returns to "4", the output of the comparator 707 also returns to "0". As a result, the up / down counter 1001 returns to the countdown mode, and “4” is input by the clock input.
Counts down to "3". On the other hand, register 1
Since 205 is in the holding state, “3” is continuously output. The output of the OR 1203 remains “1” as before, and the output of the D-FF 1201 is also maintained at “1”.

【0153】アップダウンカウンタ1001のカウント
値が再び“3”になると、比較器707の出力も再び
“1”へと変わる。これにより、アップダウンカウンタ
1001は再度カウントアップモードとなり、クロック
入力によって“3”から“4”へとカウントアップす
る。このときレジスタ1205は、すでに保持している
値と同じ値を取り込むことになるため、その出力に変化
は無い。以降、アップダウンカウンタ1001のカウン
ト値は、“3”と“4”が交互に変化する。
When the count value of the up / down counter 1001 becomes "3" again, the output of the comparator 707 also changes to "1" again. As a result, the up / down counter 1001 enters the count-up mode again, and counts up from “3” to “4” by the clock input. At this time, since the register 1205 takes in the same value as the value already held, there is no change in its output. Thereafter, the count value of the up / down counter 1001 alternates between “3” and “4”.

【0154】図13に、図12に示す構成におけるタイ
ミングチャートを示す。同図において、(a)はカウン
ト値、(b)は比較器707出力、(c)はD−FF1
201出力、(d)はレジスタ1205出力を示す。
FIG. 13 is a timing chart for the configuration shown in FIG. In the figure, (a) is the count value, (b) is the output of the comparator 707, and (c) is the D-FF1.
201 shows the output of the register 1205.

【0155】図13によれば、比較器707の出力が最
初に“1”になったサイクルの次のサイクルから、D−
FF1201の出力が“1”になり、レジスタ1205
の出力値が“3”に保持されることが判る。
According to FIG. 13, from the next cycle after the cycle in which the output of the comparator 707 first becomes "1", D-
The output of the FF 1201 becomes “1” and the register 1205
It can be seen that the output value of is maintained at "3".

【0156】以上説明したように、図12に示す構成に
よれば、D−FF1201の出力である端子719が
“1”になった時点で、kパラメータの最適値が確定
し、その値はレジスタ1205の出力である端子721
より得られる。
As described above, according to the configuration shown in FIG. 12, when the terminal 719, which is the output of the D-FF 1201, becomes "1", the optimum value of the k parameter is determined, and the value is stored in the register. Terminal 721 which is the output of 1205
Is obtained.

【0157】以上説明したように第5実施形態によれ
ば、アップダウンカウンタの初期値によってkパラメー
タの最大候補値を限定しつつ、パラメータkの最適値を
高速に決定することができる。
As described above, according to the fifth embodiment, the optimal value of the parameter k can be determined at high speed while limiting the maximum candidate value of the k parameter by the initial value of the up / down counter.

【0158】<第6実施形態>以下、本発明に係る第6
実施形態について説明する。第6実施形態における符号
化装置の構成は、上述した図1と同様である。
<Sixth Embodiment> Hereinafter, a sixth embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the sixth embodiment is the same as that of FIG. 1 described above.

【0159】上述した第1乃至第5実施形態において
は、全てアップダウンカウンタを使用する構成を示し
た。第6実施形態においては、カウントアップモードを
持たないダウンカウンタを使用することを特徴とする。
即ち、ダウンカウンタの初期値をkパラメータの最大候
補値“10”に設定して、これを“0”に向かってカウ
ントダウンする間に、kパラメータの最適値を検出す
る。
In the first to fifth embodiments described above, the configuration using the up / down counter is shown. The sixth embodiment is characterized in that a down counter having no count-up mode is used.
That is, the initial value of the down counter is set to the maximum candidate value “10” of the k parameter, and while counting down to “0”, the optimum value of the k parameter is detected.

【0160】図7A及び図14に、第6実施形態におけ
る符号化パラメータ選択部105の詳細構成を示す。図
14において、上述した第5実施形態で示した図12に
おける構成と同様の動作を行うものには同一番号を付
し、説明を省略する。
FIGS. 7A and 14 show the detailed configuration of the coding parameter selection unit 105 in the sixth embodiment. 14, the same operations as those in the configuration in FIG. 12 described in the fifth embodiment described above are denoted by the same reference numerals, and description thereof will be omitted.

【0161】図14において、1401はカウントダウ
ンのみを行なうダウンカウンタ、1403はレジスタ1
205にダウンカウンタ1401のカウント値を取り込
ませるための制御信号を生成する検出器である。
In FIG. 14, reference numeral 1401 denotes a down counter for performing only countdown, and 1403 denotes a register 1
This is a detector that generates a control signal for causing the count value of the down counter 1401 to be taken into the 205.

【0162】第6実施形態においても、端子709には
サブブロック内の量子化値の個数Nを入力し、量子化値
をN個全て入力した後で、kパラメータの最適値を求め
る処理を開始する。また、第5実施形態と同様、D1
2≧D3≧N>D4≧D5≧・・・と仮定する。
Also in the sixth embodiment, the number N of the quantized values in the sub-block is input to the terminal 709, and after all the N quantized values are input, the processing for obtaining the optimum value of the k parameter is started. I do. Further, as in the fifth embodiment, D 1
It is assumed that D 2 ≧ D 3 ≧ N> D 4 ≧ D 5 ≧.

【0163】上述した第5実施形態と同様に、ダウンカ
ウンタ1401はまず“10”に初期化され、カウント
値が“3”になるまでダウンカウントを続ける。
As in the fifth embodiment, the down counter 1401 is first initialized to "10" and continues to count down until the count value becomes "3".

【0164】ダウンカウンタ1401のカウント値が
“3”になると、初めて比較器707の出力が“1”に
なる。すると、該比較結果“1”とD−FF1201の
出力“0”とが、検出器1403にて検出され、検出結
果“1”が制御信号としてレジスタ1205へ与えられ
る。
When the count value of down counter 1401 becomes "3", the output of comparator 707 becomes "1" for the first time. Then, the comparison result “1” and the output “0” of the D-FF 1201 are detected by the detector 1403, and the detection result “1” is provided to the register 1205 as a control signal.

【0165】レジスタ1205は、制御信号“1”をロ
ード(レジスタ取り込み)信号として受け取り、カウン
ト値“3”を取り込んで出力する。
The register 1205 receives the control signal “1” as a load (register fetch) signal, fetches the count value “3”, and outputs it.

【0166】ダウンカウンタ1401は、比較器707
からの制御信号が“0”の間はカウントダウン動作を行
うが、カウント値が“3”になった時点で、比較器70
7の出力が“1”に変わり、カウント動作を停止する。
よって、カウント値が“3”に固定される。
The down counter 1401 includes a comparator 707
While the control signal is "0", the countdown operation is performed, but when the count value becomes "3", the comparator 70
The output of 7 changes to "1" and the counting operation is stopped.
Therefore, the count value is fixed at “3”.

【0167】カウント値が“3”になった最初のサイク
ルでは、検出器1403の出力は“1”になるが、次の
サイクルからは、D−FF1201の入出力信号(検出
器1403への2つの入力信号)が共に“1”になるた
め、これ以降検出器1403の出力は“0”となる。
In the first cycle in which the count value becomes "3", the output of the detector 1403 becomes "1", but from the next cycle, the input / output signal of the D-FF 1201 (2 to the detector 1403). Since both input signals are “1”, the output of the detector 1403 thereafter becomes “0”.

【0168】従って、レジスタ1205の出力も“3”
に固定され、kパラメータの最適値として端子721に
出力される。
Therefore, the output of the register 1205 is also "3".
And output to the terminal 721 as the optimum value of the k parameter.

【0169】図15に、図14に示す構成におけるタイ
ミングチャートを示す。同図において、(a)はカウン
ト値、(b)は比較器707出力、(c)はD−FF1
201出力、(d)はレジスタ1205への制御信号、
(e)はレジスタ1205出力を示す。
FIG. 15 is a timing chart for the configuration shown in FIG. In the figure, (a) is the count value, (b) is the output of the comparator 707, and (c) is the D-FF1.
201 output, (d) is a control signal to the register 1205,
(E) shows the output of the register 1205.

【0170】図15によれば、D−FF1201の出力
が“0”から“1”に変わるタイミングで、レジスタ1
205の出力が確定することが明らかである。
According to FIG. 15, when the output of the D-FF 1201 changes from “0” to “1”, the register 1
It is clear that the output of 205 is determined.

【0171】尚、上述した第5実施形態において図12
に示すように、比較器707の出力が一度でも“1”に
なったらそれをD−FF1201が保持するような構
成、即ち、D−FF1201の入力側に2入力の論理和
素子(図12におけるEXOR1203)を設けること
によって、ダウンカウンタ1401のカウント値を
“3”に保持しておく必要はなく、カウントダウンを続
行しても構わない。この場合、比較器707からダウン
カウンタ1401への制御信号は不要となる。
In the fifth embodiment described above, FIG.
As shown in FIG. 12, when the output of the comparator 707 becomes "1" even once, the D-FF 1201 holds the output, that is, a two-input OR element (see FIG. By providing the EXOR 1203), it is not necessary to keep the count value of the down counter 1401 at “3”, and the countdown may be continued. In this case, a control signal from the comparator 707 to the down counter 1401 becomes unnecessary.

【0172】以上説明したように第6実施形態によれ
ば、ダウンカウンタを用いた構成によっても、パラメー
タkの最適値を高速に決定することができる。
As described above, according to the sixth embodiment, the optimum value of the parameter k can be determined at high speed even with the configuration using the down counter.

【0173】<第7実施形態>以下、本発明に係る第7
実施形態について説明する。第7実施形態における符号
化装置の構成は、上述した図1と同様である。
<Seventh Embodiment> Hereinafter, a seventh embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the seventh embodiment is the same as that of FIG. 1 described above.

【0174】上述した第1乃至第6実施形態において
は、セレクタ及び該セレクタ出力を所定値と比較するた
めの比較器の組を、1組もしくは2組使用する構成を示
した。第7実施形態においては、このセレクタと比較器
の組を3組備えることを特徴とする。第7実施形態で
は、セレクタと比較器の組を増やすことで、kパラメー
タの最適値の探索をより高速に行なうことが可能とな
る。
In the first to sixth embodiments described above, one or two sets of selectors and comparators for comparing the selector output with a predetermined value are used. The seventh embodiment is characterized in that three sets of the selector and the comparator are provided. In the seventh embodiment, the search for the optimum value of the k parameter can be performed at higher speed by increasing the number of pairs of selectors and comparators.

【0175】図7A及び図16に、第7実施形態におけ
る符号化パラメータ選択部105の詳細構成を示す。図
16において、上述した第1実施形態で示した図7Bに
おける構成と同様の動作を行うものには同一番号を付
し、説明を省略する。
FIGS. 7A and 16 show a detailed configuration of the coding parameter selection unit 105 in the seventh embodiment. In FIG. 16, the same operations as those in the configuration in FIG. 7B described in the first embodiment described above are denoted by the same reference numerals, and description thereof will be omitted.

【0176】図16において、1603は第3のセレク
タ、1605は第3のセレクタ1603の出力値を所定
値Nと比較する第3の比較器、1607は図7Bに示し
たアップダウンカウンタ713から最下位1ビットを削
除したアップダウンカウンタである。
In FIG. 16, reference numeral 1603 denotes a third selector, 1605 denotes a third comparator for comparing the output value of the third selector 1603 with a predetermined value N, and 1607 denotes a signal from the up / down counter 713 shown in FIG. This is an up / down counter from which the lower one bit has been deleted.

【0177】第7実施形態においては、アップダウンカ
ウンタ1607のカウント値として、L=P×2という
関係にある、論理的な値Lと物理的な値Pとの2つを認
識する必要がある。即ち、論理的な値Lは偶数に限定さ
れる。アップダウンカウンタ1607におけるカウント
アップやカウントダウン動作では、物理的に+1,−1
が行われるが、これを論理的には+2,−2されたもの
と解釈する。その他の基本的な動作は、上述した第1実
施形態と同様である。
In the seventh embodiment, as the count values of the up / down counter 1607, it is necessary to recognize two logical values L and physical values P in a relationship of L = P × 2. . That is, the logical value L is limited to an even number. In the count-up or count-down operation of the up / down counter 1607, physically, +1, -1
Is logically interpreted as being +2, -2. Other basic operations are the same as those of the first embodiment.

【0178】第1乃至第3のセレクタ705,706,
1603はそれぞれ、アップダウンカウンタ1607の
論理的な値Lに対して、DL,DL+1,DL+2を選択して
出力する。
First to third selectors 705, 706,
1603 selects and outputs D L , D L + 1 , and D L + 2 for the logical value L of the up / down counter 1607.

【0179】第7実施形態では、第1の比較器707の
出力が“1”、第3の比較器1605の出力が“0”に
なった時、アップダウンカウンタ1607の動作が停止
し、kパラメータの最適値が確定する。この時のアップ
ダウンカウンタ1607の論理的な値がTであれば、k
パラメータの最適値は、TもしくはT+1である。
In the seventh embodiment, when the output of the first comparator 707 becomes "1" and the output of the third comparator 1605 becomes "0", the operation of the up / down counter 1607 stops, and k The optimal value of the parameter is determined. If the logical value of the up / down counter 1607 at this time is T, k
The optimum value of the parameter is T or T + 1.

【0180】第7実施形態においては、kパラメータの
最適値が確定する際、第2の比較器708の出力が
“0”である場合と“1”である場合との2つの状態が
考えられる。
In the seventh embodiment, when the optimum value of the k parameter is determined, two states are considered: the case where the output of the second comparator 708 is “0” and the case where the output is “1”. .

【0181】前者は、上述した第1実施形態と同様の状
態であり、アップダウンカウンタ1607の論理的な値
Tがkパラメータの最適値となる。この前者の状態にお
いては、kパラメータとして偶数しか取り得ない。しか
しながら、もう一方の状態である後者においては、kパ
ラメータとして奇数を取る。
The former is the same state as in the first embodiment described above, and the logical value T of the up / down counter 1607 is the optimum value of the k parameter. In this former state, only an even number can be taken as the k parameter. However, in the other case, the latter, it takes an odd number as the k parameter.

【0182】後者の場合、即ち第2の比較器708の出
力が“1”である場合、上述した第1実施形態において
はアップダウンカウンタ713をカウントアップするよ
うに制御される。これにより即ち、kパラメータの最適
値はアップダウンカウンタ713の論理的な値よりも大
きいことが判る。従って第7実施形態においては、アッ
プダウンカウンタ1607の論理的な値がTであれば、
kパラメータの最適値はT+1であると判断する。
In the latter case, that is, when the output of the second comparator 708 is “1”, control is performed so that the up / down counter 713 counts up in the first embodiment. This means that the optimum value of the k parameter is larger than the logical value of the up / down counter 713. Therefore, in the seventh embodiment, if the logical value of the up / down counter 1607 is T,
It is determined that the optimal value of the k parameter is T + 1.

【0183】第7実施形態においては、アップダウンカ
ウンタ1607から出力される物理的なカウント値Pの
最下位ビットへ、第2の比較器706の出力を付加する
ことによって、kパラメータの最適値であるT+1の値
を生成する。尚、この最適値の生成方法は、前者の場
合、即ち第2の比較器708の出力が“0”である場合
にも同様に適用される。
In the seventh embodiment, by adding the output of the second comparator 706 to the least significant bit of the physical count value P output from the up / down counter 1607, the optimum value of the k parameter can be obtained. Generate a T + 1 value. The method of generating the optimum value is similarly applied to the former case, that is, the case where the output of the second comparator 708 is “0”.

【0184】以上説明したように図16に示す構成にお
いては、上述した第1実施形態に示す図7Bの構成に比
べて、セレクタと比較器の組が増えているものの、セレ
クタからの出力値の種類が半減しているため、各セレク
タの回路規模を半分近くまで減らすことが可能である。
また、アップダウンカウンタ1607のビット数も1ビ
ット減っている。従って、構成要素が増えているために
回路規模が大きくなりそうに見えるが、実は各構成要素
の規模が小さくなり、かつ、kパラメータの最適値の探
索時間(サイクル数)も、半分近くまで短縮することが
できる。
As described above, in the configuration shown in FIG. 16, although the number of sets of selectors and comparators is increased as compared with the configuration of FIG. 7B shown in the first embodiment, the output value of the selector is Since the types are halved, the circuit scale of each selector can be reduced to nearly half.
Further, the number of bits of the up / down counter 1607 is also reduced by one bit. Therefore, although the circuit scale seems to increase due to the increase in the number of components, the size of each component is actually reduced, and the search time (number of cycles) for the optimum value of the k parameter is reduced to almost half. can do.

【0185】以上説明したように第7実施形態によれ
ば、総合的に回路規模を縮小しつつ、パラメータkの最
適値をより高速に決定することができる。
As described above, according to the seventh embodiment, it is possible to determine the optimum value of the parameter k more quickly while reducing the circuit scale comprehensively.

【0186】<第8実施形態>以下、本発明に係る第8
実施形態について説明する。第8実施形態における符号
化装置の構成は、上述した図1と同様である。
<Eighth Embodiment> Hereinafter, an eighth embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the eighth embodiment is the same as that of FIG. 1 described above.

【0187】上述した第7実施形態においては、セレク
タと比較器の組を3組備える構成を示したが、第8実施
形態では、これを5組に増やすことで、kパラメータの
最適値の探索をより高速に行なうことを特徴とする。
In the above-described seventh embodiment, a configuration in which three sets of selectors and comparators are provided has been described. In the eighth embodiment, the number of sets is increased to five to search for the optimum value of the k parameter. Is performed at a higher speed.

【0188】図7A及び図17に、第8実施形態におけ
る符号化パラメータ選択部105の詳細構成を示す。図
17において、上述した第7実施形態で示した図16に
おける構成と同様の動作を行うものには同一番号を付
し、説明を省略する。
FIGS. 7A and 17 show a detailed configuration of the coding parameter selection unit 105 in the eighth embodiment. In FIG. 17, the same operations as those in the configuration of FIG. 16 described in the seventh embodiment described above are denoted by the same reference numerals, and description thereof will be omitted.

【0189】図17において、1704は第4のセレク
タ、1705は第5のセレクタ、1707は第4のセレ
クタ1704の出力値を所定値Nと比較する第4の比較
器、1708は第5のセレクタ1705の出力値を所定
値Nと比較する第5の比較器である。1711は、図1
6に示したアップダウンカウンタ1607から更に最下
位1ビットを削除したアップダウンカウンタであり、即
ち、第1実施形態で図7Bに示したアップダウンカウン
タ713よりも2ビット少ない。1713は、第2,第
3,第4の比較器708,1605,1707の出力を
2ビットの信号にエンコードするエンコーダである。
In FIG. 17, reference numeral 1704 denotes a fourth selector, 1705 denotes a fifth selector, 1707 denotes a fourth comparator for comparing the output value of the fourth selector 1704 with a predetermined value N, and 1708 denotes a fifth selector. A fifth comparator for comparing the output value of 1705 with a predetermined value N. FIG.
This is an up / down counter obtained by further removing the least significant bit from the up / down counter 1607 shown in FIG. 6, that is, two bits less than the up / down counter 713 shown in FIG. 7B in the first embodiment. Reference numeral 1713 denotes an encoder that encodes the outputs of the second, third, and fourth comparators 708, 1605, and 1707 into 2-bit signals.

【0190】第8実施形態においても、アップダウンカ
ウンタ1711のカウント値として、L=P×4という
関係にある、論理的な値Lと物理的な値Pとの2つを認
識する必要がある。即ち、論理的な値Lは4の倍数に限
定される。アップダウンカウンタ1711におけるカウ
ントアップやカウントダウン動作では、物理的に+1,
−1が行われるが、これを論理的には+4,−4された
ものと解釈する。その他の基本的な動作は、上述した第
7実施形態と同様である。
Also in the eighth embodiment, as the count values of the up / down counter 1711, it is necessary to recognize two logical values L and physical values P in a relationship of L = P × 4. . That is, the logical value L is limited to a multiple of four. In the count-up or count-down operation of the up / down counter 1711, physically +1,
Although -1 is performed, this is logically interpreted as being +4, -4. Other basic operations are the same as in the above-described seventh embodiment.

【0191】第1乃至第5のセレクタ705,706,
1603,1704,1705はそれぞれ、アップダウ
ンカウンタ1711の論理的な値Lに対して、DL,D
L+1,DL+2,DL+3,DL+4を選択して出力する。
The first to fifth selectors 705, 706,
Reference numerals 1603, 1704, and 1705 denote D L and D with respect to the logical value L of the up / down counter 1711, respectively.
L + 1 , DL + 2 , DL + 3 and DL + 4 are selected and output.

【0192】第8実施形態では、第1の比較器707の
出力が“1”、第5の比較器1708の出力が“0”に
なった時、アップダウンカウンタ1711の動作が停止
し、kパラメータの最適値が確定する。この時のアップ
ダウンカウンタ1711の論理的な値がTであれば、k
パラメータの最適値は、T,T+1,T+2もしくはT
+3である。
In the eighth embodiment, when the output of the first comparator 707 becomes "1" and the output of the fifth comparator 1708 becomes "0", the operation of the up / down counter 1711 stops, and k The optimal value of the parameter is determined. If the logical value of the up / down counter 1711 at this time is T, k
The optimal value of the parameter is T, T + 1, T + 2 or T
+3.

【0193】第8実施形態においては、kパラメータの
最適値が確定する際、第2乃至第4の比較器708,1
605,1707の出力の組み合わせとして、“00
0”,“100”,“110”,“111”となる4つ
の状態が考えられる。ここで“ABC”は、第2乃至第
4の比較器708,1605,1707の出力がそれぞ
れ“A”,“B”,“C”である場合を示している。
In the eighth embodiment, when the optimum value of the k parameter is determined, the second to fourth comparators 708, 1
As a combination of the outputs of 605 and 1707, "00"
There are four possible states of “0”, “100”, “110”, and “111”, where “ABC” indicates that the outputs of the second to fourth comparators 708, 1605, and 1707 are “A”, respectively. , “B”, and “C”.

【0194】これら4つの状態に、上述した4つのkパ
ラメータ値(T,T+1,T+2,T+3)が対応す
る。従ってエンコーダ1713において、上記4つの状
態をそれぞれ“00”,“01”,“10”,“11”
なる2ビットコードにエンコードし、アップダウンカウ
ンタ1711から出力される物理的なカウント値Pに下
位2ビットとして付加することにより、kパラメータの
最適値を生成することができる。
The above four states correspond to the four k parameter values (T, T + 1, T + 2, T + 3) described above. Therefore, in the encoder 1713, the above four states are respectively set to “00”, “01”, “10”, “11”.
An optimal value of the k parameter can be generated by encoding into a 2-bit code and adding the lower 2 bits to the physical count value P output from the up / down counter 1711.

【0195】以上説明したように第8実施形態によれ
ば、第7実施形態に対して約2倍、第1実施形態に対し
ては約4倍の速さで、パラメータkの最適値を探索する
ことができる。尚、セレクタと比較器の数を更に増やせ
ば、更に高速な探索が可能となる。
As described above, according to the eighth embodiment, the optimum value of the parameter k is searched for twice as fast as in the seventh embodiment and about four times as fast as in the first embodiment. can do. If the number of selectors and comparators is further increased, a higher-speed search can be performed.

【0196】<第9実施形態>以下、本発明に係る第9
実施形態について説明する。第9実施形態における符号
化装置の構成は、上述した図1と同様である。
<Ninth Embodiment> Hereinafter, a ninth embodiment according to the present invention will be described.
An embodiment will be described. The configuration of the encoding device according to the ninth embodiment is the same as that of FIG. 1 described above.

【0197】図7A及び図18に、第9実施形態におけ
る符号化パラメータ選択部105の詳細構成を示す。図
18において、上述した第1実施形態で示した図7Bに
おける構成と同様の動作を行うものには同一番号を付
し、説明を省略する。
FIGS. 7A and 18 show the detailed configuration of the coding parameter selection unit 105 in the ninth embodiment. In FIG. 18, the same operations as those in the configuration in FIG. 7B described in the first embodiment described above are denoted by the same reference numerals, and description thereof will be omitted.

【0198】上述した第7及び第8実施形態において
は、セレクタから出力されるDパラメータ(可変長符号
量の差分値)の添字が連続する構成について示した。第
9実施形態においては、Dパラメータの添字が連続しな
い構成について説明する。第9実施形態においてはセレ
クタと比較器の組を4組使用するが、特に第3及び第4
のセレクタから出力されるDパラメータが特徴的であ
る。
In the seventh and eighth embodiments described above, the configuration in which the suffix of the D parameter (the difference value of the variable length code amount) output from the selector is continuous has been described. In the ninth embodiment, a configuration in which the subscripts of the D parameter are not continuous will be described. In the ninth embodiment, four sets of selectors and comparators are used.
Are characteristic.

【0199】図18において、1803は第3のセレク
タ、1804は第4のセレクタ、1805は第3のセレ
クタ1803の出力値を所定値Nと比較する第3の比較
器、1806は第4のセレクタの出力値を所定値Nと比
較する第4の比較器である。1807は第3の比較器1
805の出力信号を反転するインバータ、1809は複
数のカウントモードを有するマルチモードのアップダウ
ンカウンタである。
In FIG. 18, reference numeral 1803 denotes a third selector, 1804 denotes a fourth selector, 1805 denotes a third comparator for comparing the output value of the third selector 1803 with a predetermined value N, and 1806 denotes a fourth selector. Is a fourth comparator for comparing the output value of the second comparator with a predetermined value N. 1807 is the third comparator 1
An inverter 805 inverts the output signal, and 1809 is a multi-mode up / down counter having a plurality of count modes.

【0200】第3及び第4のセレクタ1803,180
4はそれぞれ、アップダウンカウンタ1809のカウン
ト値Tに対して、DT-2,DT+3を選択して出力する。第
1及び第2のセレクタ705,706は、上述した第1
実施形態と同様に、DT,DT +1を選択して出力する。ま
た、第1及び第2の比較器707,708の出力による
アップダウンカウンタ1809の制御も、上述した第1
実施形態と同様である。
Third and fourth selectors 1803, 180
4 selects and outputs D T−2 and D T + 3 with respect to the count value T of the up / down counter 1809. The first and second selectors 705 and 706 correspond to the first selector 705 described above.
As in the embodiment, DT and DT + 1 are selected and output. The control of the up / down counter 1809 based on the outputs of the first and second comparators 707 and 708 is also performed by the first control described above.
This is the same as the embodiment.

【0201】第9実施形態では、第1の比較器707の
出力が“1”、第2の比較器708の出力が“0”にな
った時点におけるアップダウンカウンタ1809のカウ
ント値が、kパラメータの最適値として確定する。
In the ninth embodiment, the count value of the up / down counter 1809 at the time when the output of the first comparator 707 becomes “1” and the output of the second comparator 708 becomes “0” is the k parameter Is determined as the optimal value of.

【0202】ここで、第3の比較器1805の出力が
“0”の時、DT-2<Nであるため、kパラメータの最
適値はアップダウンカウンタ1809における現在のカ
ウント値Tよりも3つ以上小さいことが分かる。
Here, when the output of the third comparator 1805 is “0”, since D T−2 <N, the optimal value of the k parameter is 3 times larger than the current count value T of the up / down counter 1809. It turns out that it is smaller than one.

【0203】一方、第4の比較器1806の出力が
“1”の時、DT+3≧Nであるため、kパラメータの最
適値はアップダウンカウンタ1809における現在のカ
ウント値Tよりも3つ以上大きいことが分かる。
On the other hand, when the output of the fourth comparator 1806 is “1”, since D T + 3 ≧ N, the optimal value of the k parameter is three more than the current count value T of the up / down counter 1809. It turns out that it is large above.

【0204】そこで第9実施形態においては、第3の比
較器1805の出力が“0”の時は、アップダウンカウ
ンタ1809のカウント値から−4とし、第4の比較器
1806の出力が“1”の時は、アップダウンカウンタ
1809のカウント値に+4とするように制御する。こ
のように、カウント値を±4として制御すると、1つ余
分にアップあるいはダウンしてしまうことが考えられる
が、その場合には、第1及び第2の比較器707,70
8の出力に基づいてアップダウンカウンタ1809のカ
ウントを1つ戻すように制御して、カウント値を確定す
る。
Therefore, in the ninth embodiment, when the output of the third comparator 1805 is “0”, the count value of the up / down counter 1809 is set to −4, and the output of the fourth comparator 1806 is set to “1”. "", The count value of the up / down counter 1809 is controlled to be +4. As described above, when the count value is controlled to be ± 4, it is conceivable that the count value may be increased or decreased by one extra. In such a case, the first and second comparators 707 and 70 may be used.
The count value of the up-down counter 1809 is controlled to be returned by one based on the output of No. 8 to determine the count value.

【0205】第9実施形態においては即ち、まずアップ
ダウンカウンタ1809を±4で制御し、それより細か
い部分については更に±1で制御することによって、カ
ウント値をkパラメータの最適値に高速に収束させる。
In the ninth embodiment, first, the up / down counter 1809 is controlled by ± 4, and the finer parts are further controlled by ± 1, so that the count value converges to the optimum value of the k parameter at high speed. Let it.

【0206】図19に、図18に示す4つの比較器18
05,707,708,1806の出力信号(a)〜
(d)に対する、アップダウンカウンタ1809のカウ
ント量(e)を示す。同図に示す様に、各比較器の出力
に応じてアップダウンカウンタ1809のカウント量を
制御する。尚、図19はカウンタ制御の一例を示してい
るに過ぎず、例えばカウント量として+4、−4に代え
て、+3、−3あるいは+5、−5とすることも有効で
ある。
FIG. 19 shows four comparators 18 shown in FIG.
05, 707, 708, 1806 output signals (a) to
The count amount (e) of the up / down counter 1809 with respect to (d) is shown. As shown in the figure, the count amount of the up / down counter 1809 is controlled according to the output of each comparator. FIG. 19 shows only an example of the counter control. For example, it is also effective to set the count amount to +3, -3 or +5, -5 instead of +4, -4.

【0207】尚、第9実施形態において図18に示した
構成は、4組のセレクタと比較器に限定されるものでは
なく、3組あるいは5組以上のセレクタと比較器を使用
する場合にも、容易に応用できる。
The configuration shown in FIG. 18 in the ninth embodiment is not limited to the four pairs of selectors and comparators, but is applicable to the case where three or five or more pairs of selectors and comparators are used. Easy to apply.

【0208】以上説明したように第9実施形態によれ
ば、アップダウンカウンタのカウント量を制御すること
によって、パラメータkの最適値をより高速に決定する
ことができる。
As described above, according to the ninth embodiment, the optimum value of the parameter k can be determined more quickly by controlling the count amount of the up / down counter.

【0209】[0209]

【他の実施形態】なお、本発明は、複数の機器(例えば
ホストコンピュータ、インタフェイス機器、リーダ、プ
リンタなど)から構成されるシステムに適用しても、一
つの機器からなる装置(例えば、複写機、ファクシミリ
装置など)に適用してもよい。
[Other Embodiments] Even if the present invention is applied to a system including a plurality of devices (for example, a host computer, an interface device, a reader, a printer, etc.), an apparatus (for example, a copying machine) Machine, facsimile machine, etc.).

【0210】また、本発明の目的は、前述した実施形態
の機能を実現するソフトウェアのプログラムコードを記
録した記憶媒体(または記録媒体)を、システムあるい
は装置に供給し、そのシステムあるいは装置のコンピュ
ータ(またはCPUやMPU)が記憶媒体に格納されたプログ
ラムコードを読み出し実行することによっても、達成さ
れることは言うまでもない。この場合、記憶媒体から読
み出されたプログラムコード自体が前述した実施形態の
機能を実現することになり、そのプログラムコードを記
憶した記憶媒体は本発明を構成することになる。また、
コンピュータが読み出したプログラムコードを実行する
ことにより、前述した実施形態の機能が実現されるだけ
でなく、そのプログラムコードの指示に基づき、コンピ
ュータ上で稼働しているオペレーティングシステム(OS)
などが実際の処理の一部または全部を行い、その処理に
よって前述した実施形態の機能が実現される場合も含ま
れることは言うまでもない。
Further, an object of the present invention is to supply a storage medium (or a recording medium) on which a program code of software for realizing the functions of the above-described embodiments is recorded to a system or an apparatus, and to provide a computer (a computer) of the system or the apparatus. It is needless to say that the present invention can also be achieved by a CPU or an MPU) reading and executing the program code stored in the storage medium. In this case, the program code itself read from the storage medium implements the functions of the above-described embodiment, and the storage medium storing the program code constitutes the present invention. Also,
When the computer executes the readout program code, not only the functions of the above-described embodiments are realized, but also the operating system (OS) running on the computer based on the instructions of the program code.
It goes without saying that a case where the functions of the above-described embodiments are implemented by performing some or all of the actual processing, and the processing performs the functions of the above-described embodiments.

【0211】さらに、記憶媒体から読み出されたプログ
ラムコードが、コンピュータに挿入された機能拡張カー
ドやコンピュータに接続された機能拡張ユニットに備わ
るメモリに書込まれた後、そのプログラムコードの指示
に基づき、その機能拡張カードや機能拡張ユニットに備
わるCPUなどが実際の処理の一部または全部を行い、そ
の処理によって前述した実施形態の機能が実現される場
合も含まれることは言うまでもない。
Further, after the program code read from the storage medium is written in the memory provided in the function expansion card inserted into the computer or the function expansion unit connected to the computer, the program code is read based on the instruction of the program code. Needless to say, the CPU included in the function expansion card or the function expansion unit performs part or all of the actual processing, and the processing realizes the functions of the above-described embodiments.

【0212】[0212]

【発明の効果】以上説明したように本発明によれば、多
値画像を簡易かつ高速に可変長符号化することが可能と
なる。
As described above, according to the present invention, a multi-valued image can be subjected to simple and high-speed variable-length coding.

【図面の簡単な説明】[Brief description of the drawings]

【図1】本発明に係る一実施形態における符号化装置の
構成を示すブロック図である。
FIG. 1 is a block diagram illustrating a configuration of an encoding device according to an embodiment of the present invention.

【図2】離散ウェーブレット変換の様子を示す図であ
る。
FIG. 2 is a diagram illustrating a state of a discrete wavelet transform.

【図3】周波数成分(サブブロック)に用いる量子化ス
テップの一例を示す図である。
FIG. 3 is a diagram illustrating an example of a quantization step used for a frequency component (sub-block).

【図4】ゴロムライス符号化によって得られる符号の一
例を示す図である。
FIG. 4 is a diagram illustrating an example of a code obtained by Golomb-Rice encoding.

【図5】本実施形態におけるビットプレーン毎のゴロム
ライス符号例を示す図である。
FIG. 5 is a diagram illustrating an example of a Golomb-Rice code for each bit plane in the embodiment.

【図6】本実施形態において最終的に出力されるビット
ストリーム例を示す図である。
FIG. 6 is a diagram illustrating an example of a bit stream that is finally output in the present embodiment.

【図7A】本実施形態における符号化パラメータ選択部
の詳細構成を示すブロック図である。
FIG. 7A is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to the present embodiment.

【図7B】本実施形態における符号化パラメータ選択部
の詳細構成を示すブロック図である。
FIG. 7B is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to the present embodiment.

【図7C】第3実施形態における符号化パラメータ選択
部の詳細構成を示すブロック図である。
FIG. 7C is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to the third embodiment.

【図8】本実施形態の変形例における符号化パラメータ
選択部の詳細構成を示すブロック図である。
FIG. 8 is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to a modification of the present embodiment.

【図9】第2実施形態における符号化パラメータ選択部
の詳細構成を示すブロック図である。
FIG. 9 is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to the second embodiment.

【図10】第4実施形態における符号化パラメータ選択
部の詳細構成を示すブロック図である。
FIG. 10 is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to a fourth embodiment.

【図11】図10に示す構成におけるタイミングチャー
トである。
FIG. 11 is a timing chart in the configuration shown in FIG. 10;

【図12】第5実施形態における符号化パラメータ選択
部の詳細構成を示すブロック図である。
FIG. 12 is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to a fifth embodiment.

【図13】図12に示す構成におけるタイミングチャー
トである。
13 is a timing chart in the configuration shown in FIG.

【図14】第6実施形態における符号化パラメータ選択
部の詳細構成を示すブロック図である。
FIG. 14 is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to a sixth embodiment.

【図15】図14に示す構成におけるタイミングチャー
トである。
FIG. 15 is a timing chart in the configuration shown in FIG. 14;

【図16】第7実施形態における符号化パラメータ選択
部の詳細構成を示すブロック図である。
FIG. 16 is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to a seventh embodiment.

【図17】第8実施形態における符号化パラメータ選択
部の詳細構成を示すブロック図である。
FIG. 17 is a block diagram illustrating a detailed configuration of a coding parameter selection unit according to an eighth embodiment.

【図18】第9実施形態における符号化パラメータ選択
部の詳細構成を示すブロック図である。
FIG. 18 is a block diagram illustrating a detailed configuration of an encoding parameter selection unit according to a ninth embodiment.

【図19】第9実施形態におけるアップダウンカウンタ
の制御例を示す図である。
FIG. 19 is a diagram illustrating a control example of an up-down counter according to the ninth embodiment.

【符号の説明】[Explanation of symbols]

101 画像入力部 102 データ格納部 103 離散ウェーブレット変換部 104 係数量子化部 105 符号化パラメータ選択部 106 可変長符号化部 107 ビットプレーン走査部 108 バッファ 109 符号出力部 702 ビットシフタ群 703 累算器群 704 減算器群 705,706,902,903,904,905,1
603,1704,1705,1803,1804 セ
レクタ 707,708,1605,1707,1708,18
05,1806 比較器 713,1001,1607,1711 アップダウン
カウンタ 901 カウンタ群 906,907 加算器 1205 レジスタ 1401 ダウンカウンタ 1809 マルチモードのアップダウンカウンタ
Reference Signs List 101 Image input unit 102 Data storage unit 103 Discrete wavelet transform unit 104 Coefficient quantization unit 105 Coding parameter selection unit 106 Variable length coding unit 107 Bit plane scanning unit 108 Buffer 109 Code output unit 702 Bit shifter group 703 Accumulator group 704 Subtractor group 705, 706, 902, 903, 904, 905, 1
603, 1704, 1705, 1803, 1804 Selectors 707, 708, 1605, 1707, 1708, 18
05, 1806 Comparators 713, 1001, 1607, 1711 Up / down counter 901 Counter group 906, 907 Adder 1205 Register 1401 Down counter 1809 Multi mode up / down counter

───────────────────────────────────────────────────── フロントページの続き Fターム(参考) 5C059 KK03 KK11 MA24 ME01 ME13 PP01 UA02 UA39 5C078 AA04 BA21 CA31 DA01 DA02 DA06 DB00 5J064 AA03 BA09 BA16 BC01 BC03 BC05 BC08 BC14 BD02 9A001 EE04 GG17 HH27  ──────────────────────────────────────────────────続 き Continued on the front page F term (reference) 5C059 KK03 KK11 MA24 ME01 ME13 PP01 UA02 UA39 5C078 AA04 BA21 CA31 DA01 DA02 DA06 DB00 5J064 AA03 BA09 BA16 BC01 BC03 BC05 BC08 BC14 BD02 9A001 EE04 GG17 HH27

Claims (18)

【特許請求の範囲】[Claims] 【請求項1】 パラメータに基づいて、シンボル群を可
変長符号部分と固定長符号部分とにそれぞれ符号化する
符号化手段を有する符号化装置であって、 隣接するパラメータ間における前記可変長符号部分の符
号量の差分値を算出する差分手段と、 前記差分値を所定値と比較する比較手段と、 該比較結果に基づくカウントを行うことによって、前記
符号化手段における符号化に適用するパラメータを生成
する生成手段と、 を有することを特徴とする符号化装置。
1. An encoding apparatus comprising encoding means for encoding a symbol group into a variable-length code portion and a fixed-length code portion based on parameters, wherein the variable-length code portion between adjacent parameters is encoded. A difference means for calculating a difference value of the code amount, a comparing means for comparing the difference value with a predetermined value, and generating a parameter to be applied to the encoding in the encoding means by performing a count based on the comparison result. An encoding device, comprising:
【請求項2】 前記パラメータは、前記固定長符号部分
の符号長を示すことを特徴とする請求項1記載の符号化
装置。
2. The encoding apparatus according to claim 1, wherein the parameter indicates a code length of the fixed-length code portion.
【請求項3】 前記符号化手段は、ゴロムライス符号化
を行うことを特徴とする請求項2記載の符号化装置。
3. The encoding apparatus according to claim 2, wherein said encoding means performs Golomb-Rice encoding.
【請求項4】 前記シンボル群は、多値画像データに対
してウェーブレット変換を施して得られたサブブロック
に相当することを特徴とする請求項1記載の符号化装
置。
4. The encoding apparatus according to claim 1, wherein the symbol group corresponds to a sub-block obtained by performing a wavelet transform on multi-valued image data.
【請求項5】 前記比較手段における所定値は、前記シ
ンボル群における符号化対象シンボルの個数であること
を特徴とする前記請求項1記載の符号化装置。
5. The encoding apparatus according to claim 1, wherein the predetermined value in the comparing means is the number of encoding target symbols in the symbol group.
【請求項6】 前記生成手段は、前記比較手段における
比較結果に基づいてカウントアップまたはカウントダウ
ンを行うカウンタであることを特徴とする請求項1記載
の符号化装置。
6. The encoding apparatus according to claim 1, wherein the generation unit is a counter that counts up or down based on a comparison result of the comparison unit.
【請求項7】 前記差分手段は、 シンボル群をビットプレーン毎に並列に累積して複数の
累積値を得る累積手段と、 該複数の累積値間における減算を並列に行って前記差分
値を複数出力する減算手段と、 を備えることを特徴とする請求項1記載の符号化装置。
7. An accumulator for accumulating symbol groups in parallel for each bit plane to obtain a plurality of accumulated values, and performing subtraction in parallel between the plurality of accumulated values to obtain a plurality of the difference values. 2. The encoding device according to claim 1, further comprising: a subtraction unit that outputs.
【請求項8】 更に、前記生成手段におけるカウント値
に基づいて前記複数の差分値から特定の差分値を選択す
る選択手段を有し、 前記比較手段は、該選択手段によって選択された差分値
を前記所定値と比較することを特徴とする前記請求項7
記載の符号化装置。
8. The image processing apparatus according to claim 1, further comprising a selection unit that selects a specific difference value from the plurality of difference values based on the count value in the generation unit, wherein the comparison unit determines the difference value selected by the selection unit. 8. The method according to claim 7, wherein the predetermined value is compared with the predetermined value.
An encoding device according to claim 1.
【請求項9】 前記差分手段は、 シンボル群をビットプレーン毎に並列に累積して複数の
累積値を得る累積手段と、 前記生成手段におけるカウント値に基づいて前記複数の
累積値から所定数の特定累積値を選択する選択手段と、 該選択された特定累積値間における減算を行って前記差
分値を出力する減算手段と、を備えることを特徴とする
請求項1記載の符号化装置。
9. The accumulating means for accumulating a plurality of symbol values in parallel for each bit plane to obtain a plurality of accumulated values, and a predetermined number of accumulative values from the plurality of accumulated values based on the count value in the generating means. 2. The encoding apparatus according to claim 1, further comprising: selecting means for selecting a specific accumulated value; and subtracting means for performing subtraction between the selected specific accumulated values and outputting the difference value.
【請求項10】 前記差分手段は、 シンボル群をビットプレーン毎に累積する累積手段と、 シンボル群のビットプレーン毎に1の個数をカウントす
るカウント手段と、 前記累積手段における累積値と前記カウント手段におけ
るカウント値とを加算することによって、前記差分値を
出力する加算手段と、を有することを特徴とする前記請
求項1記載の符号化装置
10. The accumulation means for accumulating a symbol group for each bit plane, a counting means for counting the number of 1s for each bit plane of the symbol group, an accumulation value in the accumulation means and the counting means. 2. The encoding apparatus according to claim 1, further comprising: an adding unit that outputs the difference value by adding the count value of the encoding unit.
【請求項11】 更に、前記差分手段に入力されたシン
ボル数をカウントするカウント手段を備え、 前記比較手段は、前記カウント手段におけるカウント値
を前記所定値とすることを特徴とする請求項1記載の符
号化装置。
11. The apparatus according to claim 1, further comprising counting means for counting the number of symbols input to said difference means, wherein said comparison means sets the count value of said counting means to said predetermined value. Encoding device.
【請求項12】 更に、前記比較手段における比較結果
に基づいて前記生成手段によって生成された前記パラメ
ータを保持する保持手段を備え、 前記比較手段は1つの比較器からなることを特徴とする
請求項1記載の符号化装置。
12. The apparatus according to claim 11, further comprising a storage unit configured to store the parameter generated by the generation unit based on a comparison result of the comparison unit, wherein the comparison unit includes a single comparator. 2. The encoding device according to 1.
【請求項13】 前記生成手段は、前記比較結果に基づ
くカウントの初期値を前記パラメータの最大候補値に設
定することを特徴とする請求項12記載の符号化装置。
13. The encoding apparatus according to claim 12, wherein the generation unit sets an initial value of a count based on the comparison result to a maximum candidate value of the parameter.
【請求項14】 前記生成手段は、前記比較手段におけ
る比較結果に基づいてカウントダウンを行うダウンカウ
ンタであることを特徴とする請求項13記載の符号化装
置。
14. The encoding apparatus according to claim 13, wherein said generating means is a down counter that counts down based on a comparison result of said comparing means.
【請求項15】 前記選択手段及び前記比較手段の組を
少なくとも3組備え、 前記生成手段は前記パラメータの下位ビットを削除して
生成し、該生成されたパラメータの下位ビットに前記比
較手段による比較結果を付加して出力することを特徴と
する請求項8記載の符号化装置。
15. At least three sets of said selecting means and said comparing means are provided, wherein said generating means generates by deleting lower bits of said parameter, and compares said lower bits of said generated parameter with said comparing means. 9. The encoding apparatus according to claim 8, wherein a result is added and output.
【請求項16】 前記生成手段は、前記比較手段におけ
る比較結果に基づいてカウントアップ又はカウントダウ
ンのカウント量を制御するアップダウンカウンタである
ことを特徴とする請求項1記載の符号化装置。
16. The encoding apparatus according to claim 1, wherein said generation means is an up / down counter for controlling a count up or count down based on a comparison result of said comparison means.
【請求項17】 パラメータに基づいて、シンボル群を
可変長符号部分と固定長符号部分とにそれぞれ符号化す
る符号化方法であって、 隣接するパラメータ間における前記可変長符号部分の符
号量の差分値を算出する差分工程と、 前記差分値を所定値と比較する比較工程と、 該比較結果に基づくカウントを行うことによって、前記
符号化に適用するパラメータを生成する生成工程と、を
有することを特徴とする符号化方法。
17. An encoding method for encoding a symbol group into a variable length code portion and a fixed length code portion based on parameters, wherein a difference in code amount of the variable length code portion between adjacent parameters is provided. A difference step of calculating a value, a comparison step of comparing the difference value with a predetermined value, and a generation step of generating a parameter applied to the encoding by performing a count based on the comparison result. Characteristic encoding method.
【請求項18】 パラメータに基づいて、シンボル群を
可変長符号部分と固定長符号部分とにそれぞれ符号化す
る符号化方法のプログラムを記録した記録媒体であっ
て、該プログラムは少なくとも、 隣接するパラメータ間における前記可変長符号部分の符
号量の差分値を算出する差分工程のコードと、 前記差分値を所定値と比較する比較工程のコードと、 該比較結果に基づくカウントを行うことによって、前記
符号化に適用するパラメータを生成する生成工程のコー
ドと、を有することを特徴とする記録媒体。
18. A recording medium recording an encoding method program for encoding a symbol group into a variable-length code portion and a fixed-length code portion based on parameters, the program comprising at least an adjacent parameter A code of a difference step for calculating a difference value of the code amount of the variable-length code portion between the codes; a code of a comparison step of comparing the difference value with a predetermined value; and And a code for a generation step of generating a parameter to be applied to the conversion.
JP2000114178A 1999-07-27 2000-04-14 Coder and its method Withdrawn JP2001298739A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP2000114178A JP2001298739A (en) 2000-04-14 2000-04-14 Coder and its method
US09/618,461 US6865299B1 (en) 1999-07-27 2000-07-18 Coding apparatus and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2000114178A JP2001298739A (en) 2000-04-14 2000-04-14 Coder and its method

Publications (1)

Publication Number Publication Date
JP2001298739A true JP2001298739A (en) 2001-10-26

Family

ID=18626022

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2000114178A Withdrawn JP2001298739A (en) 1999-07-27 2000-04-14 Coder and its method

Country Status (1)

Country Link
JP (1) JP2001298739A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006325130A (en) * 2005-05-20 2006-11-30 Olympus Imaging Corp Data encoding device, data decoding device, data encoding method, data decoding method, and program
JP2008072562A (en) * 2006-09-15 2008-03-27 Nec Corp Encoding device and method therefor, decoding device and method therefor, and encoding and decoding programs
JP2017184239A (en) * 2013-04-08 2017-10-05 ソニー株式会社 Encoding and decoding data

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006325130A (en) * 2005-05-20 2006-11-30 Olympus Imaging Corp Data encoding device, data decoding device, data encoding method, data decoding method, and program
US7715639B2 (en) 2005-05-20 2010-05-11 Olympus Imaging Corp. Data encoding apparatus, data decoding apparatus, data encoding method, data decoding method, and recording medium recorded with program
JP4500213B2 (en) * 2005-05-20 2010-07-14 オリンパスイメージング株式会社 Data encoding apparatus, data decoding apparatus, data encoding method, data decoding method, and program
JP2008072562A (en) * 2006-09-15 2008-03-27 Nec Corp Encoding device and method therefor, decoding device and method therefor, and encoding and decoding programs
JP4655013B2 (en) * 2006-09-15 2011-03-23 日本電気株式会社 Encoding apparatus and method thereof, decoding apparatus and method thereof, and encoding and decoding program
JP2017184239A (en) * 2013-04-08 2017-10-05 ソニー株式会社 Encoding and decoding data

Similar Documents

Publication Publication Date Title
US7898445B2 (en) Entropy coding apparatus
JP4700491B2 (en) Adaptive coefficient scan ordering
US8126062B2 (en) Per multi-block partition breakpoint determining for hybrid variable length coding
US7486212B2 (en) Variable length coding for sparse coefficients
JP4365957B2 (en) Image processing method and apparatus and storage medium
US20080165036A1 (en) System and Method for Video Coding Having Reduced Computational Intensity
JP2000115782A (en) Coder, coding method and storage medium
JP2000115770A (en) Coder and its method
EP1946246A2 (en) Extended amplitude coding for clustered transform coefficients
JP2007166039A (en) Image coding equipment
JP5520122B2 (en) Data converter
US7528749B2 (en) Decoding apparatus and decoding method
CN103918272A (en) Data encoding and decoding
JP6727011B2 (en) Image coding apparatus and control method thereof
US6865299B1 (en) Coding apparatus and method
JP4181887B2 (en) Variable length coding apparatus and method
JPWO2009050766A1 (en) Video compression encoding / restoration device, video compression encoding / restoration program, and video generation / output device
JP6946671B2 (en) Image processing device and image processing method
KR100717002B1 (en) Apparatus for encoding and decoding image, and method thereof, and a recording medium storing program to implement the method
AU2002230101A2 (en) Moving picture information compressing method and its system
JP2001298739A (en) Coder and its method
JP2001298623A (en) Encoder and encoding method
JP4181699B2 (en) Encoding apparatus and method, and storage medium
JP2001077699A (en) Encoder
US20110091119A1 (en) Coding apparatus and coding method

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 20070703