JPH05316359A - Picture data coder - Google Patents

Picture data coder

Info

Publication number
JPH05316359A
JPH05316359A JP12157692A JP12157692A JPH05316359A JP H05316359 A JPH05316359 A JP H05316359A JP 12157692 A JP12157692 A JP 12157692A JP 12157692 A JP12157692 A JP 12157692A JP H05316359 A JPH05316359 A JP H05316359A
Authority
JP
Japan
Prior art keywords
counting
block
blocks
coefficient
effective
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
JP12157692A
Other languages
Japanese (ja)
Inventor
Takashi Morihara
隆 森原
Masayoshi Shimizu
雅芳 清水
Tsuguo Noda
嗣男 野田
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP12157692A priority Critical patent/JPH05316359A/en
Publication of JPH05316359A publication Critical patent/JPH05316359A/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)
  • Image Processing (AREA)

Abstract

PURPOSE:To control the coding condition in response to kinds of pictures. CONSTITUTION:A linear quantization section 140 quantizes a 2-dimension DCT coefficient of each block outputted from a 2-dimension DC transformation section 120 based on a quantization matrix for valid coefficient count, and a variable length coding section 150 codes the quantization coefficient obtained by quantization by using a code table, for valid coefficient count. A valid coefficient count section 240 reads the coded data from a code buffer 230 to count frequencies of appearance of the valid coefficients of each block, and a slow change area discrimination section 250 obtains a ratio of a slow change area occupied in the entire picture based on the count result. A control section 260 selects a coding quantization matrix and a code table based on the ratio and the frequencies of appearance of the valid coefficients in the entire picture counted by the valid coefficient count section 240.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は多値画像を高能率に符号
化する画像データ符号化装置に係わり、特に、多値画像
を複数の画素から成る複数のブロックに分割し、その分
割により得られた各ブロック毎に、そのブロック内の複
数の画素の多値データを直交変換した後、符号化を行う
画像データ符号化装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to an image data coding apparatus for coding a multivalued image with high efficiency, and in particular, dividing a multivalued image into a plurality of blocks each composed of a plurality of pixels, The present invention relates to an image data encoding device that performs, after each block, multi-valued data of a plurality of pixels in that block by orthogonal transformation and then performs encoding.

【0002】[0002]

【従来の技術】カラー静止画の高能率符号化の国際標準
化を進めているCCITT(国際電信電話諮問委員会)
とISO(国際標準化機関)の合同機関であるJPEG
(Joi-nt Phtographic Experts Groug)は、その勧告案
として2次元DCT(2次元離散コサイン変換)を使っ
た高能率符号化を発表している。
2. Description of the Related Art CCITT (International Telegraph and Telephone Advisory Committee) is promoting international standardization of high-efficiency color still image coding.
Which is a joint organization of ISO and ISO (International Standards Organization)
(Joi-nt Phtographic Experts Groug) has announced high efficiency coding using two-dimensional DCT (two-dimensional discrete cosine transform) as its recommendation.

【0003】このJPEGにより勧告されたカラー静止
画の高能率符号化方式(以下、JPEG方式と称する)
は、入力多値画像を8×8画素から成るブロックに分割
し、各ブロックの8×8画素の画信号(多値データ)を
2次元離散コサイン変換(以下、2次元DCTと称す
る)により空間周波数分布の8×8個の2次元DCT係
数に変換し、次にそれらの2次元DCT係数を視覚に適
応した閾値で量子化し、その量子化により得られた量子
化係数を統計的に求めたハフマン・テーブルにより可変
長符号化するものである。
A high-efficiency coding system for color still images recommended by JPEG (hereinafter referred to as JPEG system)
Divides the input multi-valued image into blocks of 8 × 8 pixels, and the image signal (multi-valued data) of 8 × 8 pixels in each block is spatially transformed by two-dimensional discrete cosine transform (hereinafter referred to as two-dimensional DCT) Converted to 8 × 8 two-dimensional DCT coefficients of frequency distribution, then quantized these two-dimensional DCT coefficients with a threshold value adapted to the visual sense, and statistically obtained the quantized coefficients obtained by the quantization. Variable length coding is performed by the Huffman table.

【0004】図16は、このJPEG方式により多値画
像を符号化する従来の画像データ符号化装置の基本ブロ
ック図である。同図に示す画像データ符号化装置におい
て、多値画像は、8×8画素の複数のブロックに分割さ
れ、ブロック単位で端子110から2次元DCT変換部
120に入力される。2次元DCT変換部120は、入
力される8×8画素の画信号を2次元DCT変換により
直交変換して、空間周波数分布の8×8個の2次元DC
T係数に変換し、線形量子化部130に出力する。
FIG. 16 is a basic block diagram of a conventional image data coding apparatus for coding a multivalued image by the JPEG system. In the image data encoding device shown in the figure, a multi-valued image is divided into a plurality of blocks of 8 × 8 pixels, and is input from the terminal 110 to the two-dimensional DCT conversion unit 120 in block units. The two-dimensional DCT transform unit 120 orthogonally transforms an input image signal of 8 × 8 pixels by a two-dimensional DCT transform to obtain 8 × 8 two-dimensional DC of spatial frequency distribution.
It is converted into a T coefficient and output to the linear quantization unit 130.

【0005】線形量子化部130は、入力される8×8
個の各2次元DCT係数を、量子化マトリクス140内
の対応する量子化閾値を用いて線形量子化する。この量
子化の結果、量子化マトリクス140内の対応する量子
化閾値より小さい値の2次元DCT係数は「0」とな
り、DC成分(直流係数)とわずかのAC成分(交流係
数)のみが「0」以外の値を持つ量子化係数が生成され
る。
The linear quantizer 130 receives the input 8 × 8.
Each of the two-dimensional DCT coefficients is linearly quantized using the corresponding quantization threshold in the quantization matrix 140. As a result of this quantization, the two-dimensional DCT coefficient having a value smaller than the corresponding quantization threshold in the quantization matrix 140 becomes “0”, and only the DC component (DC coefficient) and a few AC component (AC coefficient) are “0”. A quantized coefficient having a value other than “” is generated.

【0006】上述のようにして線形量子化部130で量
子化された量子化係数は、可変長符号化部150に入力
される。可変長符号化部150は、DC成分、AC成分
毎に別々に設けられたハフマン・テーブルで構成される
可変長符号表160を参照して、入力される量子化係数
の列を可変長符号化する。すなわち、DC成分について
は、1次元のハフマン・テーブルを参照して各ブロック
先頭のDC成分と前ブロックのDC成分との差分値を可
変長符号化する。また、AC成分については、値が
「0」でない有効係数の値(インデックス)と、その有
効係数までの値が「0」である無効係数のランの長さ
(ランレングス)との組み合わせを可変長符号化する。
可変長符号化部150は、このようにしてDC成分、A
C成分のそれぞれを、ハフマン・テーブルで構成された
符号表160を用いて可変長符号化し、その符号化によ
り得られた符号データを端子170から出力する。
The quantized coefficient quantized by the linear quantizer 130 as described above is input to the variable length encoder 150. The variable length coding unit 150 refers to the variable length coding table 160 configured by the Huffman table separately provided for each of the DC component and the AC component, and performs variable length coding on the sequence of the input quantization coefficient. To do. That is, for the DC component, the difference value between the DC component at the beginning of each block and the DC component of the preceding block is variable length coded by referring to the one-dimensional Huffman table. For the AC component, the combination of the value (index) of the effective coefficient whose value is not “0” and the run length (run length) of the invalid coefficient whose value up to the effective coefficient is “0” is variable. Long code.
In this way, the variable-length coding unit 150 receives the DC component, A
Each of the C components is subjected to variable length coding using a code table 160 composed of a Huffman table, and code data obtained by the coding is output from a terminal 170.

【0007】このような、JPEG方式による多値画像
の符号化においては、量子化係数は2次元DCT係数の
値と量子化マトリクス140内の対応する量子化閾値に
よって決定される。そして、以上のような処理を、ブロ
ック単位に1画面の全ブロックについて施すことによ
り、1画面分の2次元DCT係数が量子化される。
In such encoding of a multi-valued image by the JPEG method, the quantization coefficient is determined by the value of the two-dimensional DCT coefficient and the corresponding quantization threshold value in the quantization matrix 140. Then, the above-described processing is performed on all blocks of one screen in block units, so that the two-dimensional DCT coefficient for one screen is quantized.

【0008】[0008]

【発明が解決しようとする課題】上述したように、従来
のJPEG方式では、各ブロックの2次元DCT係数を
ブロック単位で量子化する際、全てのブロックの2次元
DCT係数を、一種類の量子化マトリクスにより量子化
している。すなわち、各ブロック内の各空間周波数の2
次元DCT係数は、全てのブロックで同一の量子化閾値
で量子化している。
As described above, in the conventional JPEG system, when the two-dimensional DCT coefficients of each block are quantized in block units, the two-dimensional DCT coefficients of all blocks are quantized by one type of quantum. It is quantized by the quantization matrix. That is, 2 of each spatial frequency in each block
The dimensional DCT coefficient is quantized with the same quantization threshold in all blocks.

【0009】ところで、一般に人間の視覚は、階調変化
が激しく変化する画像(例えば、風景画等)に対して
は、復元画像に原画像と多少の近似誤差があっても、画
質の劣化を比較的認識しにくい傾向がある。逆に、階調
変化が緩やかに変化する画像(例えば、人物画等)に対
しては、人間の視覚は、復元画像の原画像に対する近似
誤差を識別しやすく、画質劣化を認識しやすい傾向があ
る。
By the way, in general, for human vision, with respect to an image (for example, a landscape image) whose gradation changes drastically, even if the restored image has some approximation error with the original image, the image quality is deteriorated. It tends to be difficult to recognize. On the other hand, for an image (for example, a portrait) in which gradation changes gently, human vision tends to recognize the approximation error of the restored image with respect to the original image, and easily recognize image quality deterioration. is there.

【0010】さらに、人間の視覚においては、画像全体
の画質の評価が、一部分の画質(最悪の画質の部分)に
支配される傾向がある。すなわち、例えば、風景画の木
立のように階調変化が激しい画像でも、人間の視覚は、
緩やかに階調が変化する青空の部分が、例えば、画像全
体の約 1/3を占めるような場合には、その青空の画質で
画像全体の画質を評価する傾向がある。
Further, in human vision, the evaluation of the image quality of the entire image tends to be dominated by a part of the image quality (the worst image quality part). That is, for example, even in an image with a sharp gradation change like a grove of landscape paintings, human vision is
For example, when the blue sky portion where the gradation gradually changes occupies about 1/3 of the entire image, the image quality of the entire image tends to be evaluated by the image quality of the blue sky.

【0011】尚、上記近似誤差は、2次元DCT係数を
量子化する際に、一部の2次元DCT係数が失われるこ
とにより生じる。したがって、ブロック内の2次元DC
T係数を一種類の量子化閾値(量子化マトリクス)で量
子化した場合、例えば、階調が緩やかに変化している画
像で画質劣化が目立つという問題があった。一方、これ
を防止するために、量子化マトリクス内の各量子化閾値
を低い値に設定すると、階調変化の激しい画像を符号す
る際、符号量が増加し、効率的なデータ圧縮ができない
という新たな問題が生じるという欠点があった。
The approximation error is caused by the loss of some of the two-dimensional DCT coefficients when quantizing the two-dimensional DCT coefficients. Therefore, the two-dimensional DC in the block
When the T coefficient is quantized with one kind of quantization threshold value (quantization matrix), for example, there is a problem that image quality deterioration is conspicuous in an image in which gradation is gradually changed. On the other hand, in order to prevent this, if each of the quantization thresholds in the quantization matrix is set to a low value, the amount of code increases when encoding an image with sharp gradation changes, and efficient data compression cannot be achieved. It had the drawback of creating new problems.

【0012】本発明は、上記のような従来の問題点を解
決するために、階調変化の異なる全ての画像を、復元画
像の高画質を保証して符号化を行うことが可能な画像デ
ータ符号化装置を提供することを目的とする。
In order to solve the above-mentioned conventional problems, the present invention is capable of encoding all images having different gradation changes while ensuring high image quality of a restored image. It is an object to provide an encoding device.

【0013】[0013]

【課題を解決するための手段】図1は、本発明(第1の
発明)の原理ブロック図(その1)である。本発明は、
原画像を複数の画素から成る複数のブロックに分割した
後、それらの複数のブロック内の複数の画素の階調値を
各ブロック毎に直交変換し、その直交変換により得られ
た直交変換係数を量子化し、その量子化により得られた
量子化係数を符号化する画像データ符号化装置を前提に
する。
FIG. 1 is a principle block diagram (No. 1) of the present invention (first invention). The present invention is
After dividing the original image into multiple blocks consisting of multiple pixels, the tone values of multiple pixels in these multiple blocks are orthogonally transformed for each block, and the orthogonal transformation coefficients obtained by the orthogonal transformation are calculated. It is premised on an image data encoding device that quantizes and encodes the quantized coefficient obtained by the quantization.

【0014】有効係数計数手段1は、上記複数の各ブロ
ックについて、上記量子化後の有効係数の出現数を計数
する。尚、有効係数とは、AC成分の直交変換係数の
内、“0”でない直交変換係数のことである。
The effective coefficient counting means 1 counts the number of appearances of the quantized effective coefficient for each of the plurality of blocks. The effective coefficient is an orthogonal transform coefficient that is not "0" among the orthogonal transform coefficients of the AC component.

【0015】符号化条件設定手段2は、有効係数計数手
段1によって計数された上記複数の各ブロック別の有効
係数の出現数を基に符号化条件を設定する。符号化手段
3は、符号化条件設定手段2により設定された符号化条
件を用いて、上記原画像を上記方式(直交変換・量子化
・符号化)により符号化する。
The coding condition setting means 2 sets a coding condition based on the number of appearances of the effective coefficients for each of the blocks counted by the effective coefficient counting means 1. The encoding unit 3 encodes the original image by the above method (orthogonal transformation / quantization / encoding) using the encoding condition set by the encoding condition setting unit 2.

【0016】上記第1の発明において、上記符号化条件
設定手段2は、例えば、請求項2記載のように、前記有
効係数の出現数が所定値よりも少ないブロックを検出す
る検出手段2aと、その検出手段2aの検出結果が予め
定められた条件を満足するか否かを判定する判定手段2
bと、その判定手段2bの判定結果に基づいて前記符号
化条件を設定する設定手段2cとから成るような構成と
してもよい(図2参照)。
In the first invention, the coding condition setting means 2 includes, for example, as described in claim 2, a detection means 2a for detecting a block in which the number of appearances of the effective coefficient is smaller than a predetermined value. Judgment means 2 for judging whether or not the detection result of the detection means 2a satisfies a predetermined condition.
b and a setting means 2c for setting the above-mentioned coding condition based on the judgment result of the judgment means 2b (see FIG. 2).

【0017】また、上記第1の発明において、前記有効
係数計数手段1を、例えば、請求項3記載のように、前
記有効係数の出現数が所定値よりも少ないブロックの数
を計数する第1の計数手段1aと、前記原画像の全ブロ
ックにおける前記有効係数の出現数を計数する第2の計
数手段1bとを有するような構成として、前記符号化条
件設定手段2は、第1の計数手段1aの計数結果と第2
の計数手段1bの計数結果とに基づいて符号化条件を設
定するようにしてもよい(図3参照)。
In the first aspect of the invention, the effective coefficient counting means 1 may be configured to count the number of blocks in which the number of appearances of the effective coefficient is smaller than a predetermined value. Of the original image, and the second counting means 1b that counts the number of appearances of the effective coefficient in all blocks of the original image, the encoding condition setting means 2 includes the first counting means 1a. 1a counting result and second
The encoding condition may be set based on the counting result of the counting means 1b (see FIG. 3).

【0018】次に、図4は、請求項4記載の第2の発明
の原理ブロック図である。この第2の発明も、上記第1
の発明と同様に原画像を複数の画素から成る複数のブロ
ックに分割した後、それらの複数のブロック内の複数の
画素の階調値を各ブロック毎に直交変換し、次にその直
交変換により得られた直交変換係数を量子化し、その量
子化により得られた量子化係数を符号化する画像データ
符号化装置を前提にする。
Next, FIG. 4 is a principle block diagram of a second invention according to claim 4. This second invention is also the first invention described above.
The original image is divided into a plurality of blocks composed of a plurality of pixels in the same manner as in the above invention, the gradation values of a plurality of pixels in the plurality of blocks are orthogonally transformed for each block, and then the orthogonal transformation is performed. It is premised on an image data encoding device that quantizes the obtained orthogonal transform coefficient and encodes the quantized coefficient obtained by the quantization.

【0019】有効係数計数手段11は、上記複数の各ブ
ロックについて、上記量子化後の有効係数の出現数を計
数する。ブロック数計数手段12は、有効係数計数手段
11の計数結果に基づいて、有効係数の出現数が所定値
よりも少ないブロックの連続数を計数する。
The effective coefficient counting means 11 counts the number of appearances of the quantized effective coefficient for each of the plurality of blocks. The block number counting unit 12 counts the number of consecutive blocks in which the number of appearances of the effective coefficient is smaller than a predetermined value, based on the counting result of the effective coefficient counting unit 11.

【0020】符号化条件設定手段13は、ブロック数計
数手段12の計数結果に基づいて、符号化条件を設定す
る。符号化手段14は、符号化条件設定手段13により
設定された符号化条件を用いて、上記原画像を上記方式
(直交変換・量子化・符号化)により符号化する。
The coding condition setting means 13 sets a coding condition based on the counting result of the block number counting means 12. The encoding means 14 encodes the original image by the above method (orthogonal transformation / quantization / encoding) using the encoding condition set by the encoding condition setting means 13.

【0021】上記第2の発明において、例えば、請求項
5記載のように、有効計数手段11を、前記有効係数の
出現数が所定値よりも少ないブロックの数を計数する第
1の計数手段11aと、前記原画像全体での前記有効係
数の出現数を計数する第2の計数手段11bとを有する
ような構成として、前記ブロック数計数手段12は、第
1の計数手段11aの計数結果に基づいて前記有効係数
の出現数が所定値よりも少ないブロック数を計数し、前
記符号化条件設定手段13は、ブロック数計数手段12
の計数結果と第2の計数手段11bの計数結果とに基づ
いて符号化条件を設定するようにしてもよい。
In the second aspect of the invention, for example, as described in claim 5, the effective counting means 11 is the first counting means 11a for counting the number of blocks in which the number of appearances of the effective coefficient is smaller than a predetermined value. And a second counting means 11b for counting the number of appearances of the effective coefficient in the entire original image, the block number counting means 12 is based on the counting result of the first counting means 11a. Then, the number of blocks in which the number of appearances of the effective coefficient is smaller than a predetermined value is counted, and the coding condition setting means 13 causes the block number counting means 12
The coding condition may be set based on the counting result of 1) and the counting result of the second counting means 11b.

【0022】[0022]

【作用】第1の発明においては、原画像は、複数の画素
(例えば、8×8画素)から成る複数のブロックに分割
され、各ブロック内の各画素の階調値はブロック単位で
直交変換される。そして、その直交変換により得られた
各ブロックの直交変換係数は、有効係数計数手段1に入
力される。
According to the first aspect of the invention, the original image is divided into a plurality of blocks composed of a plurality of pixels (for example, 8 × 8 pixels), and the gradation value of each pixel in each block is orthogonally transformed in block units. To be done. Then, the orthogonal transformation coefficient of each block obtained by the orthogonal transformation is input to the effective coefficient counting means 1.

【0023】有効係数計数手段1は、入力される各ブロ
ック内の直交変換係数の内の有効係数(“0”でないA
C成分の直交変換係数)の個数を各ブロック別に計数す
る。符号化条件設定手段2は、例えば、請求項2記載の
ように、有効係数計数手段1から入力される各ブロック
の有効係数を所定値と比較し、有効係数がその所定値よ
りも少ないブロック数を検出する。
The effective coefficient counting means 1 is an effective coefficient (A which is not "0") out of the orthogonal transformation coefficients in each input block.
The number of C component orthogonal transform coefficients) is counted for each block. The encoding condition setting means 2 compares the effective coefficient of each block input from the effective coefficient counting means 1 with a predetermined value, and the number of effective coefficient is less than the predetermined value. To detect.

【0024】次に、符号化条件設定手段2は、その検出
されたブロック数が予め定められた所定の閾値以上であ
るか否かを判定し、その判定結果に基づいて符号化条件
(量子化する際に使用する量子化マトリクス及び可変長
符号化用の符号表)を設定する。
Next, the coding condition setting means 2 judges whether or not the detected number of blocks is equal to or larger than a predetermined threshold value, and based on the judgment result, the coding condition (quantization) is determined. The quantization matrix and the code table for variable-length coding used when performing the setting are set.

【0025】符号化手段3は、再び原画像の各ブロック
の直交変換係数を入力し、それらの各ブロックの直交変
換係数を上記設定された符号化条件により、例えばJP
EG方式に準拠して可変長符号化し、原画像の符号デー
タを作成する。
The encoding means 3 inputs the orthogonal transformation coefficient of each block of the original image again, and the orthogonal transformation coefficient of each block is, for example, JP according to the above-mentioned encoding condition.
Variable length coding is performed in accordance with the EG method to create coded data of the original image.

【0026】有効係数の出現数が少ないブロックは、階
調変化が緩やかな領域を示すので、このような符号化を
行った場合、有効係数の出現数が少ないブロック数を計
数することにより、階調変化が緩やかな領域が原画像全
体において占める割合を判断できる。したがって、画像
の種類に応じて、符号化条件を制御することにより、符
号量の増加を、抑えつつ、原画像を高画質で復元可能な
符号化を行うことができる。
A block in which the number of appearances of the effective coefficient is small indicates a region in which the gradation change is gradual. Therefore, when such coding is performed, the number of blocks in which the number of the appearances of the effective coefficient is small is counted, It is possible to determine the ratio of the region in which the tonal change is gentle to the entire original image. Therefore, by controlling the encoding condition according to the type of the image, it is possible to perform encoding capable of restoring the original image with high image quality while suppressing an increase in the code amount.

【0027】また、請求項3記載のように、階調変化の
緩やかなブロックの検出に加え、有効係数計数手段1に
より原画像全体での有効係数の出現数も計数することに
より、符号化条件設定手段2は、画像全体の複雑さも判
断することが可能となり、この判断もさらに加味して符
号化条件を制御することにより、さらに有効な高能率符
号化が可能になる。
Further, as described in claim 3, in addition to the detection of the block in which the gradation changes gradually, the effective coefficient counting means 1 also counts the number of appearances of the effective coefficient in the entire original image, so that the encoding condition is satisfied. The setting means 2 can also judge the complexity of the entire image, and by controlling the coding condition by further considering this judgment, more effective high efficiency coding becomes possible.

【0028】次に、第2の発明においては、有効係数計
数手段11が、各ブロック毎の有効係数の出現数を計数
し、ブロック数計数手段12は、例えば、請求項5記載
のようにその有効係数計数手段11の計数結果を順次入
力し、有効係数の出現数が所定値よりも少ないブロック
の連続数を計数する。
Next, in the second invention, the effective coefficient counting means 11 counts the number of appearances of the effective coefficient for each block, and the block number counting means 12 determines the number of appearances of the effective coefficient, for example. The counting result of the effective coefficient counting means 11 is sequentially input, and the number of consecutive blocks in which the number of appearances of the effective coefficient is smaller than a predetermined value is counted.

【0029】符号化条件設定手段13は、そのブロック
数計数手段12の計数結果に基づき、符号化手段14が
原画像を符号化する際の符号化条件(量子化用の量子化
マトリクス及び可変長符号化のための符号表)を設定す
る。
The coding condition setting means 13 is based on the counting result of the block number counting means 12, and the coding conditions when the coding means 14 codes the original image (quantization matrix for quantization and variable length). Code table for encoding) is set.

【0030】この場合、ブロック数計数手段12の計数
結果は、階調変化の小さい平坦な部分の大きさを知る目
安となる。したがって、符号条件設定手段13は、ブロ
ック数計数手段12の計数結果から原画像における階調
変化の緩やかな平坦な領域の大きさを判断して、符号化
手段14が原画像を可変長符号化する際に用いる符号化
条件を制御できる。
In this case, the counting result of the block number counting means 12 serves as a standard for knowing the size of the flat portion where the gradation change is small. Therefore, the coding condition setting means 13 judges the size of the flat area in the original image in which the gradation change is gentle from the counting result of the block number counting means 12, and the coding means 14 variable-length codes the original image. It is possible to control the coding condition used when performing.

【0031】したがって、第2の発明においても、原画
像における階調変化の緩やかな領域の割合を基に符号化
条件を制御して、符号量の増加を抑えつつ、原画像を高
画質で復元可能な符号化を行うことができる。
Therefore, also in the second aspect of the invention, the encoding condition is controlled on the basis of the ratio of the region of the original image in which the gradation change is gentle to suppress the increase in the code amount and restore the original image with high image quality. Possible encoding can be done.

【0032】また、請求項5記載のように、有効係数計
数手段11が、第2の計数手段11bにより原画像全体
での有効係数の出現数を計数することにより、符号化条
件設定手段13が上記ブロック数に加え、さらに原画像
全体での有効係数の出現数に基づき画像全体の複雑さも
考慮して符号化条件を設定するようにすれば、さらに効
果的な原画像の符号化を行うことができる。
Further, as described in claim 5, the effective coefficient counting means 11 counts the number of appearances of effective coefficients in the entire original image by the second counting means 11b, so that the encoding condition setting means 13 In addition to the number of blocks described above, if the coding conditions are set in consideration of the complexity of the entire image based on the number of appearances of effective coefficients in the entire original image, more effective encoding of the original image can be performed. You can

【0033】[0033]

【実施例】以下、図面を参照しながら、本発明の実施例
を説明する。上記JPEG方式等のような2次元DCT
を用いた画像データの符号化方式では、2次元DCT変
換後に、各ブロック内の全ての2次元DCT係数を、画
像の種類によらず一定の量子化閾値で量子化した場合、
有効係数(係数値が「0」以外の領域係数)として残る
2次元DCT係数の個数は、ブロック内での階調変化の
激しさに(画素の階調値の変化の大きさや階調値変化の
周期の大小等)応じて変化する。
Embodiments of the present invention will be described below with reference to the drawings. Two-dimensional DCT such as the above JPEG method
In the image data encoding method using, when all the two-dimensional DCT coefficients in each block are quantized with a constant quantization threshold value regardless of the image type after the two-dimensional DCT conversion,
The number of two-dimensional DCT coefficients that remain as effective coefficients (area coefficients having a coefficient value other than “0”) depends on the intensity of the gradation change within the block (the magnitude of the change in the gradation value of the pixel or the change in the gradation value). The size of the cycle, etc.) changes.

【0034】本実施例では、このように一定の量子化閾
値でブロック内の全ての2次元DCT係数を量子化した
場合に得られる有効係数の個数と、ブロック内での階調
変化の激しさとの対応関係を利用する。すなわち、有効
係数の出現回数を計数し、その計数結果に基づいて、画
像全体での複雑さと共に、階調変化の緩やかな領域が画
像全体において占める割合をも判断することで、画像全
体が階調変化の激しい画像であるか、または階調が平坦
な部分が多く含まれる画像であるかを判定し、その判定
結果に基づいて画像データの符号化条件を制御して、符
号量の増加を抑えつつ、復元画像の高い画像を確保す
る。
In this embodiment, the number of effective coefficients obtained when all the two-dimensional DCT coefficients in a block are quantized with a constant quantization threshold value and the intensity of gradation change in the block. Use the correspondence relationship with. That is, the number of appearances of the effective coefficient is counted, and the complexity of the entire image is determined based on the counting result, and the ratio of the region in which the gradation change is gentle to the entire image is determined. It is determined whether the image has a sharp tone change or an image that includes many flat gradations, and the encoding condition of the image data is controlled based on the determination result to increase the code amount. While suppressing, secure a high restored image.

【0035】図6は、本発明の一実施例の画像データ符
号化装置の基本ブロック図である。尚、同図において、
前述した図16に示す画像データ符号化装置内のブロッ
クと同一のブロックについては、同一の名称及び同一の
符号を寄与し、詳しい説明は省略する。
FIG. 6 is a basic block diagram of an image data coding apparatus according to an embodiment of the present invention. In the figure,
With respect to the same block as the block in the image data encoding device shown in FIG. 16 described above, the same name and the same code contribute, and detailed description thereof will be omitted.

【0036】量子化マトリクス格納部210は、特に図
示していないが、線型量子化部140が有効係数計数用
の量子化係数を作成するために使用する量子化マトリク
スA及び同じく線型量子化部140が2次元DCT変換
120から入力される各ブロックの2次元DCT係数を
線型量子化するために使用する画像データの符号化用の
複数の量子化マトリクスBを格納している。
The quantization matrix storage unit 210, which is not particularly shown, is a quantization matrix A used by the linear quantization unit 140 to create a quantized coefficient for effective coefficient counting, and also the linear quantization unit 140. Stores a plurality of quantization matrices B for encoding image data used for linearly quantizing the two-dimensional DCT coefficients of each block input from the two-dimensional DCT transform 120.

【0037】符号表格納部220は、特に図示していな
いが、可変長符号化部150が有効係数の計数用のデー
タを作成するために使用する符号表A及び同じく可変長
符号化部150が線型量子化部140から入力する各ブ
ロックの量子化係数を圧縮して可変長符号化する際に用
いる可変長符号表(ハフマン符号表)を格納する。
Although not shown in the figure, the code table storage unit 220 includes a code table A used by the variable length coding unit 150 to create data for counting effective coefficients, and a variable length coding unit 150. A variable-length code table (Huffman code table) used when variable-length coding is performed by compressing the quantized coefficient of each block input from the linear quantization unit 140 is stored.

【0038】符号バッファ230は、可変長符号化部1
50が出力する一画像分の有効係数計数用の符号データ
または同じく可変長符号化部150が出力する原画像の
可変長符号データを格納するバッファである。
The code buffer 230 includes a variable length coding unit 1.
This is a buffer for storing code data for counting effective coefficients for one image output by 50 or variable length code data for the original image output by the variable length coding unit 150.

【0039】有効係数計数部240は、上記符号バッフ
ァ230から上記有効係数計数用の符号データを読み出
し、画像全体での有効係数の出現数Cを制御部260へ
出力する。また、有効係数計数部240は、上記有効係
数計数用の符号データから各ブロック毎の有効係数の出
現数を求め、その有効係数の出現数に基づいて各ブロッ
ク毎に階調変化の緩やかな領域(以下、便宜上、緩やか
な領域と記述する)であるかを判定し、その判定結果を
緩やかな領域判定ブロック250へ出力する。
The effective coefficient counting section 240 reads the code data for counting the effective coefficient from the code buffer 230, and outputs the appearance number C of the effective coefficient in the entire image to the control section 260. Further, the effective coefficient counting unit 240 obtains the number of appearances of the effective coefficient for each block from the coded data for counting the effective coefficient, and based on the number of appearances of the effective coefficient, a region where the gradation change is gentle for each block. (Hereinafter, referred to as a gradual region for convenience), and the determination result is output to the gradual region determination block 250.

【0040】緩やかな領域判定部250は、有効係数計
数部240から入力する上記判定結果に基づいて、原画
像における階調変化の緩やかなブロックの個数である平
坦部ブロック数Bを制御部260へ出力する。
The gradual area determination unit 250 sends the number of flat portion blocks B, which is the number of blocks with gradual gradation change in the original image, to the control unit 260 based on the determination result input from the effective coefficient counting unit 240. Output.

【0041】制御部260は、有効係数計数部240か
ら入力する原画像全体での有効係数の出現数Cと緩やか
な領域判定部250から入力する平坦部ブロック数Bと
に基づき、量子化マトリクス格納部210に格納されて
いる複数の可変長符号化用の量子化マトリクスBの中か
ら最適な量子化マトリクスを線型量子化部140に出力
させると共に、符号表格納部220から可変長符号化用
のハフマン符号表を可変長符号可変長部150に出力さ
せる。
The control unit 260 stores the quantization matrix on the basis of the appearance number C of the effective coefficients in the entire original image input from the effective coefficient counting unit 240 and the flat portion block number B input from the gradual area determination unit 250. The optimum quantization matrix is output from the plurality of variable-length coding quantization matrices B stored in the unit 210 to the linear quantization unit 140, and the code-table storage unit 220 outputs the variable-length coding quantization matrix B for variable-length coding. The Huffman code table is output to the variable length code variable length unit 150.

【0042】続いて、上記構成の画像データ符号化装置
の基本動作を、図7のフローチャートを参照しながら説
明する。まず、制御部260は、緩やかな領域判定部2
50の初期化を行った後(SA1)、量子化マトリクス
格納部210から有効係数計数用の量子化マトリクスA
を線型量子化部140に出力させると共に、符号表格納
部220から有効係数計数用の符号データ作成のための
符号表Aを可変長符号化部150へ出力させる(SA
2)。
Next, the basic operation of the image data coding apparatus having the above configuration will be described with reference to the flowchart of FIG. First, the control unit 260 controls the gradual area determination unit 2
After initializing 50 (SA1), the quantization matrix A for quantization of the effective coefficient is calculated from the quantization matrix storage unit 210.
Is output to the linear quantization unit 140, and at the same time, the code table storage unit 220 outputs the code table A for creating code data for counting effective coefficients to the variable length coding unit 150 (SA.
2).

【0043】続いて、2次元DCT変換部120は、原
画像の先頭ブロックから、ブロック単位で2次元DCT
変換を行い、線型量子化部140は、その2次元DCT
変換により得られた各ブロック内の2次元DCT係数を
量子化マトリクスAを用いて線型量子化する。そして、
次に可変長符号化部150は、その線型量子化により得
られた量子化係数から上記符号表Aを参照して有効係数
計数用の符号データを作成し、その各ブロックの有効係
数計数用の符号データを符号バッファ230に格納する
処理を、全ブロックについて行う(SA1,SA2)。
Subsequently, the two-dimensional DCT transforming unit 120 starts a two-dimensional DCT in block units from the head block of the original image.
The linear quantization unit 140 performs the transformation, and the two-dimensional DCT
The two-dimensional DCT coefficient in each block obtained by the transform is linearly quantized using the quantization matrix A. And
Next, the variable length coding unit 150 creates code data for counting effective coefficients from the quantized coefficients obtained by the linear quantization with reference to the above code table A, and calculates code data for counting effective coefficients of each block. The process of storing the code data in the code buffer 230 is performed for all blocks (SA1, SA2).

【0044】続いて、有効係数計数部240が、符号バ
ッファ230から全ブロックの上記有効係数計数用の符
号データを、所定の順番にブロック単位で読み出し、全
ブロック全体での有効係数の出現数Cを計数すると共
に、各ブロック毎にそのブロック内での有効係数の出現
数NBに基づきそのブロックが階調変化が緩やかなブロ
ックであるか否かを判定し、その判定結果を緩やかな領
域判定部250に出力する(SC1)。
Subsequently, the effective coefficient counting unit 240 reads out the code data for counting the effective coefficients of all the blocks from the code buffer 230 in a predetermined order in block units, and the number of appearances C of the effective coefficients in all the blocks is C. In addition, it is determined for each block, based on the number of appearances NB of effective coefficients in the block, whether or not the block is a block with a gradual gradation change, and the determination result is a gradual area determination unit. It is output to 250 (SC1).

【0045】緩やかな領域判定部250は、有効係数計
数部240から入力する各ブロック毎の上記緩やか領域
の判定結果を基に、階調変化の緩やかなブロック(平坦
部ブロック)の個数B(平坦部ブロック数B)を計数
し、その平坦部ブロック数Bを制御部260に出力す
る。
The gradual area determination unit 250 determines the number B (flat portion blocks) of the blocks (flat portion blocks) whose gradation changes gently based on the determination result of the gradual area for each block input from the effective coefficient counting unit 240. The number of partial blocks B) is counted and the number of flat portion blocks B is output to the control unit 260.

【0046】制御部260は、有効係数計数部240か
ら入力する全ブロック全体での有効係数の出現数Cと緩
やかな領域判定部250から入力する平坦部ブロック数
Bとに基づき画像の性質(種類)を判別し(SC2)、
量子化マトリクス格納部210から、可変長符号化過程
での線型量子化において使用すべき量子化マトリクスB
を線型量子化部140に出力させると共に、符号表格納
部220から量子化係数を可変長符号化する際に使用さ
れる可変長符号表(ハフマン符号表)を可変長符号化部
150に出力させる(SC3)。
The control unit 260 determines the property (type) of the image based on the number C of appearances of effective coefficients in all the blocks input from the effective coefficient counting unit 240 and the number B of flat portion blocks input from the gradual area determination unit 250. ) Is determined (SC2),
From the quantization matrix storage unit 210, the quantization matrix B to be used in the linear quantization in the variable length coding process.
To the linear quantization unit 140, and also to the variable length coding unit 150 from the code table storage unit 220 to output the variable length coding table (Huffman coding table) used when variable length coding the quantized coefficient. (SC3).

【0047】以上のようにして、線型量子化のための量
子化マトリクス及び量子化係数を可変長符号化するため
の可変長符号表を選択した後、それらの量子化マトリク
スと可変長符号表を用いて、前述した従来の画像データ
符号化装置と同様にして、2次元DCT変換部120、
線型量子化部140、及び可変長符号化部150によ
り、原画像の可変長符号化を行い、その可変長符号化に
より得た可変長符号データを、符号バッファ230を介
して、端子170から外部出力する(SD1,SD2
2)。
As described above, after selecting the quantization matrix for linear quantization and the variable length code table for variable length coding the quantized coefficient, the quantization matrix and variable length code table are selected. The two-dimensional DCT transform unit 120 is used in the same manner as the conventional image data coding device described above.
The linear-quantization unit 140 and the variable-length coding unit 150 perform variable-length coding on the original image, and the variable-length code data obtained by the variable-length coding is output from the terminal 170 to the outside via the code buffer 230. Output (SD1, SD2
2).

【0048】続いて、上記有効係数計数部240の一構
成例を図8(a)に示す。同図(a)において、ブロッ
ク内有効計数部241は、図6に示す上記符号バッファ
230から、図9に示す形式の有効係数計数用の符号デ
ータを先頭から読み出し、各ブロック毎の有効計数の出
現数NBを比較部243に出力する。
Next, FIG. 8A shows a configuration example of the effective coefficient counting section 240. In FIG. 9A, the intra-block effective counter 241 reads the effective coefficient counting code data of the format shown in FIG. 9 from the beginning from the code buffer 230 shown in FIG. 6, and calculates the effective count of each block. The number of appearances NB is output to the comparison unit 243.

【0049】上記有効係数計数用の符号データは、
“0”のビットがブロックの終了を示すEOB(End Of
Blook) 信号となっており、EOB信号間の“1”のビ
ット列の各1ビットが当該ブロック内での1つの有効係
数に対応している。したがって“0”のビット(EOB
信号)間の“1”のビット数があるブロック内での有効
係数の出現数NBに等しい。また、“0”のビット(E
OB信号)が、j個(j=2,3,・・・)連続する場
合には、連続する(i−1)個のブロックに有効係数が
1個も無いことを示す。このように、この有効係数計数
用の符号データは、非常にコンパクトな符号となってい
る。
The code data for counting the effective coefficient is:
A bit of "0" indicates the end of the block EOB (End Of
Blook) signal, and each 1 bit of the bit string of "1" between EOB signals corresponds to one effective coefficient in the block. Therefore, the bit of "0" (EOB
The number of bits of "1" between signals is equal to the number NB of appearance of effective coefficients in a block. In addition, the bit of "0" (E
When j (j = 2, 3, ...) Consecutive OB signals are present, it means that there are no effective coefficients in consecutive (i−1) blocks. Thus, the code data for counting the effective coefficient is a very compact code.

【0050】上記ブロック内有効係計数部241の一構
成例を、同図(b)に示す。同図において、“1”計数
部241aは、符号バッファ230内の図9に示す形式
の有効係数計数用の符号データを先頭ビットから順に読
み出し、“0”のビット(EOB信号)を検出するま
で、1のビットの連続数NB1 を計数する。そして、
“1”計数部241aは、EOB信号(“0”のビッ
ト)を検出すると、それまでの計数値NB1 (最初のブ
ロックの有効係数の出現数に等しい)を、累積加算格納
部241aに格納すると共に、図8(a) に示す比較部2
43へも出力する。“1”計数部241aは、上記有効
係数計数用の符号データの上記EOB信号の次のビット
(第2ブロックの先頭)から、再び、EOB信号
(“0”のビット)を検出するまで“1”のビットの連
続数NB2 を計数し、EOB信号(“0”のビット)を
検出すると、それまでの“1”のビットの連続個数(第
2ブロックの有効係数の出現数)NB2 を、累積加算格
納部241bに格納されている個数NB1 に加算し、そ
の加算結果(NB1 +NB2 )を累積加算格納部241
bに格納すると共に、その計数結果NB2 を上記比較部
243へ出力する。以後、同様にして、“1”計数部2
41aは、有効係数計数用データの読み出しを行い、第
3ブロック以降についても有効係数の個数NB3 ,NB
4 ,・・・を計数して、その計数結果を比較部243へ
出力すると共に、累積加算格納部241bに有効係数の
累計値を格納していく。したがって、“1”計数部24
1aが有効係数計数用の符号データを全て読み出した時
点で、累積加算部格納部241bには、原画像全体での
有効係数の出現数Cが格納されている。そして、この原
画像全体での有効係数の出現数Cは、制御部260によ
り読み出される。
An example of the structure of the intra-block effective coefficient counting unit 241 is shown in FIG. In the figure, the "1" counting unit 241a sequentially reads the code data for valid coefficient counting in the format shown in FIG. 9 in the code buffer 230 from the first bit until the bit "0" (EOB signal) is detected. The number of consecutive 1 bits NB 1 is counted. And
When the "1" counting unit 241a detects the EOB signal (bit "0"), the counting value NB 1 (equal to the number of appearance of the effective coefficient of the first block) up to that point is stored in the cumulative addition storage unit 241a. In addition, the comparison unit 2 shown in FIG.
It also outputs to 43. The "1" counting unit 241a continues to "1" until the EOB signal (bit "0") is detected again from the next bit (head of the second block) of the EOB signal of the code data for counting the effective coefficient. When the EOB signal (“0” bit) is detected by counting the number of consecutive “NB 2 ” bits, the number of consecutive “1” bits (the number of appearance of effective coefficients in the second block) NB 2 until then is calculated. , The number NB 1 stored in the cumulative addition storage unit 241b, and the addition result (NB 1 + NB 2 ) is added to the cumulative addition storage unit 241.
In addition to storing in b, the counting result NB 2 is output to the comparing section 243. Thereafter, in the same manner, the “1” counting unit 2
The reference numeral 41a reads the effective coefficient counting data, and the effective coefficient numbers NB 3 and NB are also applied to the third and subsequent blocks.
4, by counting the ..., and outputs the count result to the comparator unit 243, will store the accumulated value of the effective coefficient accumulating storage unit 241b. Therefore, the “1” counting unit 24
When 1a has read out all the code data for counting effective coefficients, the cumulative addition section storage section 241b stores the number C of appearances of effective coefficients in the entire original image. Then, the appearance number C of the effective coefficient in the entire original image is read by the control unit 260.

【0051】再び、同図(a)に戻って説明を行うと、
比較部243は、ブロック内有効係数計数部241から
各ブロックの有効係数の個数NBi (i=1,2,3・
・・)を先頭ブロックから順に入力し、その個数NBi
(i=1,2,3・・・)を順次、有効係数個数閾値格
納部242に格納されている閾値Thn (例えば、
“1”)と比較し、NB≦Thn であれば“0”の判定
結果を、NB>Thn であれば“1”の判定結果を緩や
かな領域判定部250へ出力する。
Returning to FIG. 9A again, the explanation will be made as follows.
The comparison unit 243 receives the number of effective coefficients NB i (i = 1, 2, 3, ...) Of each block from the in-block effective coefficient counting unit 241.
..) are input in order from the first block, and the number NB i
(I = 1, 2, 3 ...) are sequentially stored in the threshold value Th n (eg,
"1") as compared to the determination result of the if NB ≦ Th n "0", and outputs a determination result if NB> Th n "1" to the gentle area determination unit 250.

【0052】ここで、上記緩やかな領域判定部250の
一構成例を図10に示す。同図において、ブロック比較
結果格納部251は、有効係数計数部240から送られ
てくる原画像の全てのブロックについての有効係数の出
現数が少ない(“0”)か否か(“1”)の判定結果を
格納する。
Here, FIG. 10 shows an example of the configuration of the gradual area determination section 250. In the figure, the block comparison result storage unit 251 determines whether or not the number of appearances of effective coefficients for all blocks of the original image sent from the effective coefficient counting unit 240 is small (“0”) (“1”). The judgment result of is stored.

【0053】加減算部252は、そのブロック比較結果
格納251から、先頭ブロックから順に各ブロックの上
記判定結果を読み出し、連続する2つのブロックの判定
結果について加算と減算を行い、それらの加算結果と減
算結果が共に等しいときにのみ、連続数加算格納部25
3の値を“1”加算する。
The adder / subtractor 252 reads the determination results of each block from the block comparison result storage 251 in order from the first block, performs addition and subtraction on the determination results of two consecutive blocks, and adds and subtracts them. Only when the results are the same, the continuous number addition storage unit 25
The value of 3 is added by "1".

【0054】上記加算結果と上記減算結果が共に等しく
なるのは、その連続する2つのブロックの判定結果が共
に“0”、すなわちその連続する2つのブロックが共に
階調変化の少ない平坦なブロックである場合のときのみ
である。
Both the addition result and the subtraction result are equal to each other when the determination results of the two consecutive blocks are both "0", that is, the two consecutive blocks are flat blocks with little gradation change. Only in some cases.

【0055】加減算部252は、このように上記加算結
果と減算結果が一致するときは、ブロック比較結果格納
部252から上記判定結果を読み出した最新のブロック
を前ブロックとし、続いて、その前ブロックの次のブロ
ックの判定結果をブロック比較結果格納部252から読
み出し、それらのブロックの判定結果についても再び、
上記加算・減算の処理を行う。そして、加算・減算の両
結果が一致する間、上記連続数加算格納部253を
“1”づつ加算する処理を繰り返す。そして、上記加算
・減算の両結果が一致しなくなった時点で、比較部25
4を起動する。
When the addition result and the subtraction result match in this way, the addition / subtraction unit 252 sets the latest block from which the determination result is read from the block comparison result storage unit 252 as the previous block, and then the previous block. The determination result of the block next to the block is read from the block comparison result storage unit 252, and the determination results of those blocks are again read.
The above addition / subtraction processing is performed. Then, while the addition and subtraction results match, the process of adding "1" to the continuous number addition storage unit 253 is repeated. Then, when the results of the addition and the subtraction do not match, the comparison unit 25
Start 4.

【0056】比較部254は、連続数加算格納部253
に格納されている値(これは、平坦ブロックの連続数に
等しい)NCと連続数閾値格納部255に格納されてい
る閾値Thc とを比較し、NC≧Thc であるときの
み、平坦部検出部256の内部のレジスタの値にその平
坦ブロック連続数NCを加算する。以下、同様の処理
が、ブロック比較結果格納部251から全ブロックの上
記判定結果(有効係数の個数が少ないか否かを示すデー
タ)が読み出されるまで繰り返し行われる。
The comparison unit 254 has a continuous number addition storage unit 253.
The value NC (which is equal to the number of consecutive flat blocks) is compared with the threshold value Th c stored in the consecutive number threshold storage unit 255, and the flat portion is calculated only when NC ≧ Th c. The number of consecutive flat blocks NC is added to the value of the register inside the detection unit 256. Hereinafter, the same process is repeated until the above-mentioned determination results (data indicating whether the number of effective coefficients is small) of all blocks are read from the block comparison result storage unit 251.

【0057】平坦検出部256は、原画像の全ブロック
について上記判定結果に対する処理が終了すると、内部
レジスタに格納されている値Bを図6に示す制御部26
0に出力する。この値Bは、有効係数が少ない(階調変
化が小さい)平坦なブロックが所定数Thc 以上続いて
いる領域に属しているブロックの個数、すなわち上記平
坦部ブロック数Bに等しい。
When the flatness detecting section 256 has finished processing the above judgment results for all blocks of the original image, the flatness detecting section 256 sets the value B stored in the internal register to the control section 26 shown in FIG.
Output to 0. This value B is equal to the number of blocks belonging to a region where the number of flat blocks having a small number of effective coefficients (gradation change is small) continues for a predetermined number Th c or more, that is, the number B of flat portion blocks.

【0058】次に上記構成の画像データ符号化装置の動
作を、図6、図8、図10及び図11のフローチャート
を参照しながら説明する。まず、図6に示す制御部26
0が初期化され、さらに有効係数部240内のブロック
内部有効係数計数部241内の“1”計数部241a並
びに累積加算格納部241bが“0”に初期設定され
(図8参照)、さらに緩やかな領域判定部250内のブ
ロック比較結果格納部251、連続数加算格納部25
3、並びに平坦部検出部256内のレジスタが“0”に
初期設定される(図10参照)。
Next, the operation of the image data encoding apparatus having the above configuration will be described with reference to the flow charts of FIGS. 6, 8, 10 and 11. First, the control unit 26 shown in FIG.
0 is initialized, and the "1" counting unit 241a and the cumulative addition storage unit 241b in the block internal effective coefficient counting unit 241 in the effective coefficient unit 240 are initialized to "0" (see FIG. 8). Block comparison result storage unit 251 and continuous number addition storage unit 25 in the region determination unit 250
3, and the registers in the flat portion detection unit 256 are initialized to "0" (see FIG. 10).

【0059】上記制御部260は、初期化されると、量
子化マトリクス格納部210内に格納されている3組の
量子化マトリクス(有効係数計数用の量子化マトリクス
A、線型量子化用の2つの量子化マトリクスB1
2 )の中から有効係数計数用の量子化マトリクスAを
線型量子化部140に選択出力すると共に、符号表格納
部220に格納されている3組の符号表(有効係数計数
用の符号表A、可変長符号表B1 ,B2 )の中から有効
係数計数用の符号表Aを可変長符号化部150に選択出
力する。
When the control unit 260 is initialized, the three sets of quantization matrices (quantization matrix A for effective coefficient counting, 2 for linear quantization) stored in the quantization matrix storage unit 210 are initialized. Two quantization matrices B 1 ,
B 2 ), the quantization matrix A for effective coefficient counting is selectively output to the linear quantization unit 140, and three sets of code tables (code table for effective coefficient counting) stored in the code table storage unit 220 are selected. A and A, variable length code tables B 1 , B 2 ) are used to selectively output the code table A for counting effective coefficients to the variable length coding unit 150.

【0060】上記有効係数計数用の量子化マトリクスA
の一構成例を、図12に示す。この量子化マトリクスA
の原画像のブロック内の8×8画素の各画素に対応する
量子化閾値は、全て一様に「16」に設定されている。
Quantization matrix A for counting the effective coefficients
An example of the configuration is shown in FIG. This quantization matrix A
The quantization thresholds corresponding to the 8 × 8 pixels in the block of the original image are all set to “16” uniformly.

【0061】また、上記有効係数計数用の符号表Aの一
構成例を図13に示す。この符号表Aは、ランの値(ラ
ンレングス)に係わらず、1つの有効係数に対して1ビ
ットの“1”を割り当てて符号化する構成になってい
る。
FIG. 13 shows a structural example of the code table A for counting the effective coefficients. The code table A has a configuration in which 1-bit "1" is assigned to one effective coefficient for encoding regardless of the run value (run length).

【0062】尚、可変長符号化部150が上記符号表A
を参照して符号化を行うのはブロック内の階調変化の状
態を表すAC成分(有効係数)についてのみであり、D
C成分は無視する。このような方法を採用することによ
り、ブロック内の全ての2次元DCT係数を符号化する
場合と比較して、作成される有効係数計数用の符号デー
タの量を著しく減らすことができる。また、可変長符号
化部150は、各ブロックについて上記の方法による有
効係数の符号化が終了する毎に、ブロックの終了を示す
EOB(End Of Blook) 信号を付加する。本実施例で
は、このEOB信号として1ビットの“0”を割り当て
る。この結果、可変長符号化部150により作成され、
符号バッファ250に格納される符号データは、例え
ば、前述した図9に示すような形式となる。
The variable length coding unit 150 uses the code table A
The encoding is performed only with respect to the AC component (effective coefficient) representing the state of gradation change in the block by referring to
Ignore the C component. By adopting such a method, it is possible to significantly reduce the amount of coded data for counting effective coefficients to be created, as compared with the case where all two-dimensional DCT coefficients in a block are coded. Also, the variable-length coding unit 150 adds an EOB (End Of Blook) signal indicating the end of a block each time the coding of the effective coefficient by the above method is completed for each block. In this embodiment, 1-bit "0" is assigned as the EOB signal. As a result, the variable length coding unit 150 creates
The code data stored in the code buffer 250 has, for example, the format shown in FIG. 9 described above.

【0063】続いて、上述のようにして、2次元DCT
変換部120、線型量子化部140、及び可変長符号化
部150により、有効係数計数用の符号化処理が行わ
れ、符号バッファ230内に原画像の全ブロックの上記
有効係数計数用の符号データが格納された後の動作を、
図8、図10、及び図11のフローチャートを参照しな
がら説明する。
Then, as described above, the two-dimensional DCT
The conversion unit 120, the linear quantization unit 140, and the variable-length coding unit 150 perform coding processing for counting effective coefficients, and code data for counting effective coefficients of all blocks of the original image are stored in the code buffer 230. After the is stored,
This will be described with reference to the flowcharts of FIGS. 8, 10 and 11.

【0064】まず、有効係数計数部240のブロック内
有効係数計数部241は、符号バッファ230内に格納
されている上記有効係数計数用の符号データを先頭から
順に1ビットづつ読み出しながら、そのビット値が
“1”すなわち有効係数を示すビットであるかを検出し
(SE1)、“0”のビットすなわちEOB信号が検出
されるまで、“1”のビットを検出する毎に“1”計数
部241aで計数を行い、まず、先頭ブロック(第1ブ
ロック)の有効係数の出現数NB1 を計数する(SE
2)。
First, the in-block effective coefficient counting unit 241 of the effective coefficient counting unit 240 reads the above-mentioned effective coefficient counting code data stored in the code buffer 230 one bit at a time from the beginning, and outputs the bit value. Is a bit indicating a valid coefficient (SE1), and a "1" counter 241a is detected each time a "1" bit is detected until a "0" bit, that is, an EOB signal is detected. First, the number of appearances of the effective coefficient NB 1 of the first block (first block) is counted (SE
2).

【0065】そして、“1”計数部241aは、その第
1ブロックの有効係数の出現数NB 1 を比較部243に
出力すると共に、累積加算格納部241bに格納されて
いる全有効係数C(前記初期化により「0」となってい
る)にその出現数NB1 を加算する(SE3)。
The "1" counting section 241a has its first
Number of appearances of effective coefficient of one block NB 1To the comparison unit 243
It is output and stored in the cumulative addition storage unit 241b.
All effective coefficients C ("0" due to the above initialization
The number of occurrences NB1Is added (SE3).

【0066】比較部243は、入力される第一ブロック
の有効係数の個数NB1 を有効係数個数閾値格納部24
2に格納されている閾値Thn と比較し、NB1 >Th
n であれば(SE4,YES)、緩やかな領域判定部2
50の当該アドレスに“1”を格納し(SE5)、一
方、NB1 ≦Thn であれば(SE4,NO)、緩やか
な領域判定部250内のブロック比較結果格納部251
の上記当該アドレスに“0”を格納する(SE6)。
The comparing unit 243 determines the number of effective coefficients NB 1 of the input first block as the effective coefficient number threshold storage unit 24.
2 is compared with the threshold value Th n stored in 2, and NB 1 > Th
If n (SE4, YES), the gradual area determination unit 2
"1" is stored in the relevant address of 50 (SE5), while if NB 1 ≦ Th n (SE4, NO), the block comparison result storage unit 251 in the gradual area determination unit 250
"0" is stored in the address concerned (SE6).

【0067】有効係数計数部240は、上記処理SE1
〜SE6を、符号バッファ230に格納されている有効
係数計数用の符号データの第2ブロック以降の符号につ
いても同様に繰り返し、累積加算格納部241bに格納
されている原画像全体での全有効係数Cに第2ブロック
以降の各ブロック内の有効係数の出現数NB2 ,N
3 ,・・・を順次累積加算していくと共に(SE
3)、それらの第2ブロック以降の各ブロック内の有効
係数の出現数NB2 ,NB3 ,・・・を前記有効係数個
数閾値Thn と比較し(SE4)、その比較結果に応じ
て“0”または“1”を緩やかな領域判定部250内の
ブロック比較結果格納部251の当該アドレスへ順次格
納していく(SE5,SE6)。
The effective coefficient counting section 240 uses the process SE1.
~ SE6 is valid stored in the code buffer 230
For codes after the second block of code data for coefficient counting
Repeatedly, even if it is stored in the cumulative addition storage unit 241b
The second block for all effective coefficients C in the entire original image
Number of effective coefficients NB in each subsequent block NB2, N
B 3, ... are sequentially added cumulatively (SE
3), valid in each block after the second block
Number of appearances of coefficient NB2, NB3, ... are the effective coefficient pieces
Number threshold Thn(SE4) and depending on the comparison result
“0” or “1” in the gradual area determination unit 250
The addresses are sequentially sorted to the corresponding addresses in the block comparison result storage unit 251.
Pay (SE5, SE6).

【0068】そして、有効係数計数部240は、符号バ
ッファ230から有効係数計数用の符号データを全ブロ
ック分読み出し、全ブロックについて上記SE1〜SE
6の処理を終了したと判別すると(SE7,YES)、
累積加算格納部241bに格納されている原画像の全ブ
ロックに含まれる有効係数の個数(出現数)Cを制御部
260へ出力する(SE8)。
Then, the effective coefficient counting section 240 reads out the code data for counting the effective coefficients from the code buffer 230 for all the blocks, and the above SE1 to SE for all the blocks.
If it is determined that the process of 6 is completed (SE7, YES),
The number (appearing number) C of effective coefficients included in all blocks of the original image stored in the cumulative addition storage unit 241b is output to the control unit 260 (SE8).

【0069】続いて、緩やかな領域判定部250は、ブ
ロック比較結果格納部251から原画像の全ブロックの
判定結果(有効計数の個数が少ない場合は“0”、多い
場合は“1”)を、第1ブロックから順に、ブロック順
に読み出し、加減算部252により、まず第1ブロック
と第2ブロックのそれぞれの判定結果を加算及び減算す
る(SF1)。
Subsequently, the gradual area determination unit 250 outputs the determination results (“0” when the number of effective counts is small, “1” when the number of effective counts is small) from the block comparison result storage unit 251. , Sequentially from the first block, in the order of blocks, and the addition / subtraction unit 252 first adds and subtracts the respective determination results of the first block and the second block (SF1).

【0070】そして、緩やかな領域判定部250は、上
記加算値と上記減算値が共に「0」、すなわち、第1ブ
ロックと第2ブロックが共に判定結果が「0」の階調変
化が緩やかな平坦なブロックであるか否かを判別し(S
F2)、共に平坦なブロックであれば、連続数加算格納
部253を“1”加算する(SF3)。そして、緩やか
な領域判定部250は、再び前記処理SF1に戻って、
今度は第2のブロックを前ブロックとし、ブロック比較
結果格納ブロック251から第3ブロックの判定結果を
読み出し、第2ブロックと第3ブロックの判定結果につ
いて加減算を行い、その加算結果と減算結果が共に
“0”であるか否かを判別し(SF2)、再び共に
“0”であれば、今度は第3ブロックを前ブロックとし
て、再び前記処理SF1に戻る。
Then, the gradual area determination section 250 has a gradual change in gradation when both the addition value and the subtraction value are "0", that is, the determination results of both the first block and the second block are "0". It is determined whether the block is a flat block (S
F2), if both blocks are flat, the continuous number addition storage unit 253 is incremented by "1" (SF3). Then, the gentle area determination unit 250 returns to the processing SF1 again,
This time, the second block is set as the previous block, the determination result of the third block is read from the block comparison result storage block 251, and the determination results of the second block and the third block are added and subtracted, and the addition result and the subtraction result are both It is determined whether or not it is "0" (SF2), and if both are "0" again, this time the third block is set as the previous block and the process returns to the process SF1 again.

【0071】このようにして、連続数加算格納部253
には、階調変化の緩やかな平坦なブロックの連続数が格
納されていく。そして、緩やかな領域判定250は、前
記判別処理SF2において、加算結果と減算結果が一致
しない、すなわち有効係数の多い階調変化の激しいブロ
ックを読み出すと(SF2,NO)、比較部254を起
動し、比較部254は、連続数加算格納部253に格納
されている平坦ブロックの連続数が連続数閾値格納部2
55に格納されている連続数閾値Thc 以上であるか否
かを比較し、連続数≧Thc であれば(SF4,YE
S)、その連続数を平坦部検出部256内のレジスタに
加算する(SF5)。一方、比較部254が連続数<T
c であると判別すると、緩やかな領域判定部250
は、前ブロックの判定結果について上記処理SF1を行
ったか否か判別し、まだ全ブロックの判定結果について
上記SF1が終了していなければ(SF6,NO)、残
りのブロックの判定結果をブロック比較結果格納部25
1から読み出し、再び前記処理SF1以降の処理を繰り
返す。
In this way, the continuous number addition storage unit 253
In, is stored the number of consecutive flat blocks with a gradual change in gradation. Then, the gradual area determination 250 activates the comparison unit 254 when the addition result and the subtraction result do not match in the determination processing SF2, that is, when a block having a large gradation change with many effective coefficients is read (SF2, NO). The comparison unit 254 determines that the number of consecutive flat blocks stored in the consecutive number addition storage unit 253 is the consecutive number threshold storage unit 2
The number of consecutive thresholds Th c stored in 55 is compared, and if the number of consecutive ≧ Th c (SF4, YE
S), the continuous number is added to the register in the flat part detection unit 256 (SF5). On the other hand, the comparison unit 254 determines that the number of consecutive times <T
If h c is determined, the gradual area determination unit 250
Determines whether or not the process SF1 has been performed for the determination result of the previous block, and if the above SF1 has not been completed for the determination results of all blocks (SF6, NO), the determination results of the remaining blocks are compared with the block comparison result. Storage unit 25
The process is read from 1, and the processes after the process SF1 are repeated again.

【0072】そして、ブロック比較結果格納部251に
格納されている原画像の全ブロックの判定結果につい
て、上記処理SF1〜SF5が終了すると(SF6,Y
ES)、平坦検出部256は、内部のレジスタに格納さ
れている平坦部ブロック数Bを制御部260へ出力する
(SF7)。
Then, with respect to the determination results of all the blocks of the original image stored in the block comparison result storage unit 251, when the above processing SF1 to SF5 is completed (SF6, Y
ES), the flatness detecting unit 256 outputs the flat part block number B stored in the internal register to the control unit 260 (SF7).

【0073】制御部260は、緩やかな領域判定部25
0から上記平坦部ブロック数Bを入力すると、まず、上
記処理SE8で有効係数計数部240から入力した原画
像全体での有効係数の出現数Cを予め定めた閾値T2と
比較し、C≧閾値T2であれば(SG1,YES)、次
に平坦部ブロック数Bを予め定めた閾値T1と比較し、
B≧閾値T1であるか否か判別する(SG2)。
The control section 260 uses the gentle area determination section 25.
When the number B of flat portion blocks is input from 0, first, the number C of appearance of effective coefficients in the entire original image, which is input from the effective coefficient counting unit 240 in the process SE8, is compared with a predetermined threshold value T2, and C ≧ threshold value. If T2 (SG1, YES), then compare the number of flat portion blocks B with a predetermined threshold value T1,
It is determined whether B ≧ threshold value T1 (SG2).

【0074】そして、制御部260は、B<閾値T1で
あれば(SG2,NO)、量子化マトリクス格納部21
0から量子化閾値の大きい粗い量子化マトリクス(量子
化条件)B1を線型量子化部140に選択出力させると
共に(SG3)、符号表格納部220から符号表B1
可変長符号化部150に選択出力させる(SE4)。
Then, if B <threshold value T1 (SG2, NO), the control unit 260 controls the quantization matrix storage unit 21.
A coarse quantization matrix (quantization condition) B1 having a large quantization threshold from 0 is selectively output to the linear quantization unit 140 (SG3), and the code table storage unit 220 sends the code table B 1 to the variable length coding unit 150. Selective output (SE4).

【0075】一方、制御部260は、上記判別処理SG
1において、C<閾値T2であった場合には(SG1,
NO)、量子化マトリクス格納部210から量子化閾値
の小さい細かい量子化条件B2を線型量子化部140に
選択出力させると共に(SG5)、符号表格納部220
から符号表B2を可変長符号化部150へ選択出力させ
る(SG6)。
On the other hand, the control unit 260 controls the discrimination processing SG.
If C <threshold value T2 in (1) (SG1,
NO), the quantization matrix storage unit 210 is caused to selectively output the fine quantization condition B2 having a small quantization threshold to the linear quantization unit 140 (SG5), and the code table storage unit 220 is also provided.
To output the code table B2 to the variable length coding unit 150 (SG6).

【0076】また、制御部260は、上記判別処理SG
2でB≧閾値T1であった場合(SG2,YES)、す
なわちC≧閾値T2かつB≧閾値T1である場合には、
C<閾値T2の場合と同様に、量子化条件B2、符号表
B2をそれぞれ線型量子化部140、可変長符号化部1
50に選択出力させる(SG5,SG6)。
Further, the control unit 260 controls the discrimination processing SG described above.
2 and B ≧ threshold T1 (SG2, YES), that is, C ≧ threshold T2 and B ≧ threshold T1,
As in the case of C <threshold value T2, the quantization condition B2 and the code table B2 are set to the linear quantization unit 140 and the variable length coding unit 1, respectively.
Selectively output to 50 (SG5, SG6).

【0077】以上のようにして、可変長符号化用の量子
化マトリクスと符号表(ハフマン符号表)が選択された
後、2次元DCT変換部120、線型量子化部140、
及び可変長符号化部150は、それらを用いて原画像の
可変長符号化を行う。この可変長符号化処理は、前述し
た従来の画像データ符号化装置と同様にして行う。
As described above, after the quantization matrix for variable length coding and the code table (Huffman code table) are selected, the two-dimensional DCT conversion section 120, the linear quantization section 140,
Also, the variable length coding unit 150 performs variable length coding of the original image using them. This variable length coding process is performed in the same manner as the conventional image data coding device described above.

【0078】このように、まず、画像全体の複雑さと深
い関わりがある画像全体での有効係数の出現数Cが予め
定めた閾値T2より少ない場合には、画像全体が階調変
化が緩やかな画像であると推測されるので、復元画像の
画質劣化が認識されやすいと判断し、量子化閾値の小さ
い量子化マトリクスB2を選択して、復元画像が高画像
で復元されるように細かい量子化を行う。この場合、こ
のように細かい量子化を行っても、有効係数の出現数が
少ないので、符号量もそれ程多くはならない。
As described above, first, when the number C of appearance of effective coefficients in the entire image, which is closely related to the complexity of the entire image, is smaller than a predetermined threshold value T2, the entire image is an image in which the gradation change is gentle. Therefore, it is judged that the image quality deterioration of the restored image is easily recognized, and the quantization matrix B2 having a small quantization threshold is selected, and fine quantization is performed so that the restored image is restored with a high image. To do. In this case, even if such fine quantization is performed, the number of appearances of effective coefficients is small, and the code amount is not so large.

【0079】また、画像全体の有効係数の出現数Cが上
記閾値T2以上であった場合には、さらに、階調変化の
緩やかな平坦領域の大きさを示す平坦部ブロック数Bも
考慮して、量子化マトリクスを選択する。すなわち、平
坦部ブロック数Bを予め定められた閾値T1と比較し
て、B≧T1であれば原画像が画像全体の階調変化が激
しいと共に、階調変化の緩やかな領域が画像全体に占め
る割合も高いものと判断し、画質の劣化が目立ちやすい
階調変化の緩やか平坦領域の復元画像の画質を高めるた
めに、量子化閾値の小さい量子化マトリクスB2を選択
して、復元画像において、階調変化の緩やかな領域の画
質の劣化が目立たないように細かい量子化を行う。この
場合、原画像全体での有効個数の出現数Cが多いもの
の、階調変化の緩やかな平坦領域も大きいので、細かい
量子化を行っても、それほど符号量は多くはならない。
When the number C of appearance of effective coefficients in the entire image is equal to or more than the threshold value T2, the number B of flat portion blocks indicating the size of a flat region in which gradation change is gentle is further considered. , Select the quantization matrix. That is, the number B of blocks in the flat portion is compared with a predetermined threshold value T1, and if B ≧ T1, the gradation of the original image is drastically changed over the entire image and the area of the gradation is gradually occupied over the entire image. It is determined that the ratio is also high, and in order to improve the image quality of the restored image in the gradual flat region where the gradation change is apt to be noticeable, the quantization matrix B2 having a small quantization threshold is selected, and Fine quantization is performed so that the deterioration of the image quality in the region where the tone change is gentle is not noticeable. In this case, although the number C of appearances of the effective number is large in the entire original image, since the flat region where the gradation change is large is also large, even if fine quantization is performed, the code amount does not increase so much.

【0080】また、C≧T2かつB<T1、すなわち、
原画像が画像全体での階調変化が激しくかつ階調変化の
緩やかな平坦領域が小さい画像であれば、平坦領域の復
元画像の画質の劣化はそれほど目立たないので、符号量
の増加を抑えるために、量子化閾値の大きい量子化マト
リクスB1により粗い量子化を行う。
Further, C ≧ T2 and B <T1, that is,
If the original image is an image in which the flat area where the gradation change is large in the entire image and the gradation change is gradual is small, the deterioration of the image quality of the restored image of the flat area is not so noticeable. Then, coarse quantization is performed by the quantization matrix B1 having a large quantization threshold.

【0081】このように、本実施例は、原画像の画質の
種類にかかわらず、復元画像の高画質を維持したまま原
画像を高能率に符号化する。次に、緩やかな領域判定部
250の他の構成例を図14に示す。
As described above, in the present embodiment, the original image is highly efficiently encoded while maintaining the high image quality of the restored image regardless of the type of the image quality of the original image. Next, another configuration example of the gradual area determination unit 250 is shown in FIG.

【0082】この緩やかな領域判定部250は、原画像
全体での連続する平坦なブロック数を順次累算して、原
画像全体における連続する平坦ブロック数の総数Bを制
御部260へ出力する。
The gradual area determination unit 250 sequentially accumulates the number of continuous flat blocks in the entire original image, and outputs the total number B of continuous flat blocks in the entire original image to the control unit 260.

【0083】したがって、前記図10に示す緩やかな領
域判定部250と同様に、ブロック比較結果格納部25
1と加減算部252を備えており、それらのブロックに
加えて加減算部252により連続する平坦ブロックが検
出される毎に“1”が加算される平坦ブロック数加算格
納部259を備えている。
Therefore, similar to the gradual area determination section 250 shown in FIG. 10, the block comparison result storage section 25 is used.
1 and an addition / subtraction unit 252 are provided, and in addition to these blocks, a flat block number addition storage unit 259 is added in which “1” is added each time a continuous flat block is detected by the addition / subtraction unit 252.

【0084】この緩やかな領域判定部250を用いた画
像データ符号化装置の本発明に係わる要部の動作を、図
15のフローチャートに示す。この画像データ符号化装
置の動作は、上述した第1の実施例の画像データ符号化
装置と緩やかな領域判定部250の動作が異なるのみ
で、有効係数計数部240及び制御部260の動作は、
上述した画像データ符号化装置と同様である。
FIG. 15 is a flow chart showing the operation of the main part of the image data encoding apparatus using the gradual area determination section 250 according to the present invention. The operation of this image data encoding apparatus is different from the operation of the image data encoding apparatus of the first embodiment described above only in the operation of the gradual area determination unit 250, and the operations of the effective coefficient counting unit 240 and the control unit 260 are
This is similar to the image data encoding device described above.

【0085】すなわち、この画像データ符号化装置の緩
やかな領域判定部250は、連続する2つのブロックが
共に平坦ブロックであることを、それらの2つのブロッ
クの判定結果の加算値と減算値が共に“0”となること
により検出し(SF2,YES)、その検出毎に平坦ブ
ロック数加算格納部259の値を“1”づつ加算してい
き(SF26)、これらの処理をブロック比較結果格納
部251に格納されている全ブロックの判定結果につい
て行うことにより、原画像全体での連続する平坦ブロッ
クの総数Bを計数し、全ブロックの判定結果について上
記処理が終了した時点で平坦ブロック数格納部259に
格納されている上記原画像全体での連続する平坦ブロッ
クの総数Bを制御部260に出力する(SF7)。
That is, the gradual area determination unit 250 of this image data encoding apparatus determines that two continuous blocks are both flat blocks, and that the addition value and the subtraction value of the determination results of these two blocks are both It is detected when it becomes "0" (SF2, YES), and the value of the flat block number addition storage unit 259 is incremented by "1" for each detection (SF26), and these processes are performed by the block comparison result storage unit. The total number B of consecutive flat blocks in the entire original image is counted by performing the determination results of all blocks stored in the block 251 and the flat block number storage unit stores the determination result of all blocks when the above process is completed. The total number B of continuous flat blocks in the entire original image stored in 259 is output to the control unit 260 (SF7).

【0086】尚、上記実施例では、画像全体での有効係
数の出現数Cも量子化マトリクス(量子化条件)を選択
する際の判断に用いているが、緩やかな領域判定部25
0の結果(画像全体での平坦ブロック数B)だけを用い
て量子化マトリクス(量子化条件)を選択するようにし
てもよい。
In the above embodiment, the number C of appearance of effective coefficients in the entire image is also used for the determination when selecting the quantization matrix (quantization condition), but the gradual area determination unit 25
The quantization matrix (quantization condition) may be selected using only the result of 0 (the number B of flat blocks in the entire image).

【0087】また、上記2つの実施例において平坦ブロ
ックの連続性は、横方向、縦方向、さらには、縦・横の
双方の連続性を考慮した面積(ブロック数)により検出
するようにしてもよい。これらは、緩やかな領域判定部
250でブロックの判定結果を読み出す順序を変えるこ
とにより容易に実現できる。
Further, in the above two embodiments, the continuity of the flat blocks may be detected by the area (the number of blocks) considering the continuity in the horizontal direction, the vertical direction, and both the vertical and horizontal directions. Good. These can be easily realized by changing the order of reading the block determination result by the gradual region determination unit 250.

【0088】さらに、上記2つの実施例では、いずれも
原画像全体での平坦ブロック数(変化の緩やかな領域と
なるブロック数)を基に、可変長符号化用の量子化マト
リクス(量子化条件)の選択を行うようにしているが、
上記平坦ブロック数Bの原画像の全ブロックに対する割
合により、上記量子化マトリクス(量子化条件)の選択
を行うようにしてもよい。
Further, in both of the above-mentioned two embodiments, the quantization matrix (quantization condition) for variable-length coding is based on the number of flat blocks (the number of blocks forming a region where the change is gentle) in the entire original image. ) Is selected, but
The quantization matrix (quantization condition) may be selected according to the ratio of the number B of flat blocks to all blocks of the original image.

【0089】また、さらに上記実施例では2種類の量子
化マトリクス(量子化閾値)からいずれか一方を選択す
るようにしているが、画像全体での変化の度合い(画像
の複雑さ)をよりきめ細かく判断するようにして、3種
類以上の量子化マトリクスの中から、最も最適な量子化
マトリクスを、可変長符号化用の量子化マトリクスとし
て選択するようにしてもよい。
Further, in the above embodiment, one of the two types of quantization matrices (quantization threshold values) is selected, but the degree of change in the entire image (complexity of the image) is made more detailed. By making a determination, the most optimal quantization matrix may be selected from the three or more types of quantization matrices as the quantization matrix for variable length coding.

【0090】尚、上記実施例では、画像データの直交変
換を離散コサイン変換(DCT)によって行っている
が、本発明は、離散コサイン変換(DST)、カルーネ
ン・レーベ変換、離散ルジャンドル(Legendre) 変換、
アダマール(Hadamard) 変換、ハール(Harr) 変換等の
他の直交変換を用いて画像データの符号化を行う画像デ
ータ符号化装置にも適用可能である。
In the above embodiment, the orthogonal transform of the image data is performed by the discrete cosine transform (DCT), but in the present invention, the discrete cosine transform (DST), the Karhunen-Loeve transform, the discrete Legendre transform. ,
The present invention can also be applied to an image data encoding device that encodes image data by using other orthogonal transforms such as Hadamard transform and Harr transform.

【0091】[0091]

【発明の効果】以上説明したように、本発明によれば、
原画像を複数の画素から成る複数のブロックに分割した
後、それらの複数のブロック内の複数の画素の階調値を
各ブロック毎に直交変換し、その直交変換により得られ
た各ブロックの直交変換係数をある特定の量子化条件で
量子化して、その量子化により得られた各ブロックの有
効係数の出現数を計数する。そして、それら各ブロック
の有効係数の出現数を基に、原画像を可変長符号化する
際に用いる符号化条件を制御して原画像の可変長符号化
を行うので、画像全体での階調変化の度合や階調変化の
緩やかな領域が画像全体において占める割合等が異なる
多種の画像について、符号量の増加を抑えつつ、原画像
を高画質で復元できるように符号化することができる。
As described above, according to the present invention,
After dividing the original image into multiple blocks consisting of multiple pixels, the gradation values of multiple pixels in these multiple blocks are orthogonally transformed for each block, and the orthogonality of each block obtained by the orthogonal transformation The transform coefficient is quantized under a specific quantization condition, and the number of appearance of effective coefficients of each block obtained by the quantization is counted. Then, the variable length coding of the original image is performed by controlling the coding condition used when the variable length coding of the original image is performed based on the number of appearances of the effective coefficient of each block. It is possible to encode various types of images in which the degree of change and the ratio of a region having a gradual change in gradation occupy the entire image are different so that the original image can be restored with high image quality while suppressing an increase in the code amount.

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

【図1】本発明の原理ブロック図(その1)である。FIG. 1 is a block diagram (1) of the principle of the present invention.

【図2】本発明の原理ブロック図(その2)である。FIG. 2 is a block diagram (No. 2) of the principle of the present invention.

【図3】本発明の原理ブロック図(その3)である。FIG. 3 is a principle block diagram (No. 3) of the present invention.

【図4】本発明の原理ブロック図(その4)である。FIG. 4 is a principle block diagram (No. 4) of the present invention.

【図5】本発明の原理ブロック図(その5)である。FIG. 5 is a principle block diagram (5) of the present invention.

【図6】本発明の一実施例の画像データ符号化装置の基
本ブロック図である。
FIG. 6 is a basic block diagram of an image data encoding device according to an embodiment of the present invention.

【図7】上記一実施例の画像データ符号化装置の基本動
作を説明するフローチャートである。
FIG. 7 is a flowchart illustrating a basic operation of the image data encoding device according to the one embodiment.

【図8】有効係数計数部の一構成例を示す図である。FIG. 8 is a diagram illustrating a configuration example of an effective coefficient counting unit.

【図9】有効係数計数用の符号データの形式を示す図で
ある。
FIG. 9 is a diagram showing a format of code data for counting effective coefficients.

【図10】緩やかな領域判定部の一構成例を示す図であ
る。
FIG. 10 is a diagram illustrating a configuration example of a gradual area determination unit.

【図11】上記一実施例の画像データ符号化装置の本発
明の要部に係わる動作を説明するフローチャートであ
る。
FIG. 11 is a flowchart illustrating the operation of the main part of the present invention of the image data encoding device according to the above-described embodiment.

【図12】有効係数用の量子化マトリクスAの一構成例
を示す図である。
FIG. 12 is a diagram showing a configuration example of a quantization matrix A for effective coefficients.

【図13】有効係数計数用の符号表Aの一構成例を示す
図である。
FIG. 13 is a diagram showing a configuration example of a code table A for counting effective coefficients.

【図14】緩やかな領域判定部の他の構成例を示す図で
ある。
FIG. 14 is a diagram illustrating another configuration example of a gradual area determination unit.

【図15】本発明の他の実施例の画像データ符号化装置
の本発明の要部に係わる動作を説明するフローチャート
である。
FIG. 15 is a flowchart illustrating an operation relating to a main part of the present invention of an image data encoding device according to another embodiment of the present invention.

【図16】従来の画像データ符号化装置の基本ブロック
図である。
FIG. 16 is a basic block diagram of a conventional image data encoding device.

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

1,11 有効係数計数手段 1a,11a 第1の計数手段 1b,11b 第2の計数手段 2,13 符号化条件設定手段 2a 検出手段 2b 判定手段 2c 設定手段 3,14 符号化手段 12 ブロック数計数手段 1,11 Effective coefficient counting means 1a, 11a First counting means 1b, 11b Second counting means 2,13 Coding condition setting means 2a Detecting means 2b Judging means 2c setting means 3,14 Coding means 12 Block number counting means

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 原画像を複数の画素から成る複数のブロ
ックに分割した後、それらの複数のブロック内の複数の
画素の階調値を各ブロック毎に直交変換し、次にその直
交変換により得られた直交変換係数を量子化し、その量
子化により得られた量子化係数を符号化する画像データ
符号化装置であって、 上記複数の各ブロックについて、上記量子化後の有効係
数の出現数を計数する有効係数計数手段(1)と、 該有効係数計数手段(1)によって計数された上記複数
の各ブロック別の有効係数の出現数を基に符号化条件を
設定する符号化条件設定手段(2)と、 該符号化条件設定手段(2)により設定された符号化条
件を用いて、上記原画像を符号化する符号化手段(3)
と、 を有することを特徴とする画像データ符号化装置。
1. An original image is divided into a plurality of blocks composed of a plurality of pixels, the gradation values of a plurality of pixels in the plurality of blocks are orthogonally transformed for each block, and then the orthogonal transformation is performed. An image data encoding device that quantizes the obtained orthogonal transform coefficient, and encodes the quantized coefficient obtained by the quantization, wherein the number of appearances of the quantized effective coefficient is the plurality of blocks. Coefficient counting means (1) for counting, and coding condition setting means for setting a coding condition based on the number of appearances of the effective coefficients for each of the plurality of blocks counted by the effective coefficient counting means (1). (2) and an encoding means (3) for encoding the original image using the encoding conditions set by the encoding condition setting means (2)
An image data encoding device comprising:
【請求項2】 前記符号化条件設定手段(2)は、 前記有効係数の出現数が所定値よりも少ないブロックを
検出する検出手段(2a)と、 該検出手段(2a)の検出結果が予め定められた条件を
満足するか否かを判定する判定手段(2b)と、 該判定手段(2b)の判定結果に基づいて前記符号化条
件を設定する設定手段(2c)と、 を有することを特徴とする請求項1記載の画像データ符
号化装置。
2. The encoding condition setting means (2) includes a detection means (2a) for detecting a block in which the number of appearances of the effective coefficient is smaller than a predetermined value, and a detection result of the detection means (2a) in advance. A determination means (2b) for determining whether or not a predetermined condition is satisfied, and a setting means (2c) for setting the coding condition based on the determination result of the determination means (2b). The image data encoding device according to claim 1, characterized in that
【請求項3】 前記有効係数計数手段(1)は、 前記有効係数の出現数が所定値よりも少ないブロックの
数を計数する第1の計数手段(1a)と、 前記原画像の全ブロックにおける前記有効係数の出現数
を計数する第2の計数手段(1b)とを有し、 前記符号化条件設定手段(2)は、前記第1の計数手段
(1a)の計数結果と前記第2の計数手段(1b)の計
数結果とに基づいて符号化条件を設定することを特徴と
する請求項1記載の画像データ符号化装置。
3. The effective coefficient counting means (1) includes first counting means (1a) for counting the number of blocks in which the number of appearances of the effective coefficient is less than a predetermined value, and all the blocks of the original image. A second counting means (1b) for counting the number of appearances of the effective coefficient, and the encoding condition setting means (2) and the counting result of the first counting means (1a) and the second counting means. The image data coding apparatus according to claim 1, wherein the coding condition is set based on the counting result of the counting means (1b).
【請求項4】 原画像を複数の画素から成る複数のブロ
ックに分割した後、それらの複数のブロック内の複数の
画素の階調値を各ブロック毎に直交変換し、次にその直
交変換により得られた直交変換係数を量子化し、その量
子化により得られた量子化係数を符号化する画像データ
符号化装置であって、 上記複数の各ブロックについて、上記量子化後の有効係
数の出現数を計数する有効係数計数手段(11)と、 該有効係数計数手段(11)の計数結果に基づいて、有
効係数の出現数が所定値よりも少ないブロックの連続数
を計数するブロック数計数手段(12)と、 該ブロック数計数手段(12)の計数結果に基づいて、
符号化条件を設定する符号化条件設定手段(13)と、 該符号化条件設定手段(13)により設定された符号化
条件を用いて、上記原画像を符号化する符号化手段(1
4)と、 を有することを特徴とする画像データ符号化装置。
4. The original image is divided into a plurality of blocks composed of a plurality of pixels, the gradation values of a plurality of pixels in the plurality of blocks are orthogonally transformed for each block, and then the orthogonal transformation is performed. An image data encoding device that quantizes the obtained orthogonal transform coefficient and encodes the quantized coefficient obtained by the quantization, wherein the number of appearances of the quantized effective coefficient for each of the plurality of blocks. And an effective coefficient counting means (11) for counting, and a block number counting means (11) for counting the number of consecutive blocks in which the number of appearances of the effective coefficient is less than a predetermined value based on the counting result of the effective coefficient counting means (11). 12) and based on the counting result of the block number counting means (12),
A coding condition setting means (13) for setting a coding condition and a coding means (1) for coding the original image using the coding condition set by the coding condition setting means (13).
4) An image data encoding device comprising:
【請求項5】 前記有効計数手段(11)は、 前記有効係数の出現数が所定値よりも少ないブロックの
数を計数する第1の計数手段(11a)と、 前記原画像全体での前記有効係数の出現数を計数する第
2の計数手段(11b)とを有し、 前記ブロック数計数手段(12)は、前記第1の計数手
段(11a)の計数結果に基づいて前記有効係数の出現
数が所定値よりも少ないブロック数を計数し、 前記符号化条件設定手段(13)は、前記ブロック数計
数手段(12)の計数結果と前記第2の計数手段(11
b)の計数結果とに基づいて符号化条件を設定すること
を特徴とする請求項4記載の画像データ符号化装置。
5. The effective counting means (11) includes a first counting means (11a) for counting the number of blocks in which the number of appearances of the effective coefficient is smaller than a predetermined value, and the effective number in the entire original image. A second counting means (11b) for counting the number of appearances of the coefficient, wherein the block number counting means (12) appears the effective coefficient based on the counting result of the first counting means (11a). The number of blocks whose number is smaller than a predetermined value is counted, and the coding condition setting means (13) and the counting result of the block number counting means (12) and the second counting means (11).
The image data encoding apparatus according to claim 4, wherein the encoding condition is set based on the counting result of b).
JP12157692A 1992-05-14 1992-05-14 Picture data coder Withdrawn JPH05316359A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP12157692A JPH05316359A (en) 1992-05-14 1992-05-14 Picture data coder

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP12157692A JPH05316359A (en) 1992-05-14 1992-05-14 Picture data coder

Publications (1)

Publication Number Publication Date
JPH05316359A true JPH05316359A (en) 1993-11-26

Family

ID=14814661

Family Applications (1)

Application Number Title Priority Date Filing Date
JP12157692A Withdrawn JPH05316359A (en) 1992-05-14 1992-05-14 Picture data coder

Country Status (1)

Country Link
JP (1) JPH05316359A (en)

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0663773A2 (en) * 1994-01-18 1995-07-19 Daewoo Electronics Co., Ltd Variable length coder using two VLC tables
JP2008067395A (en) * 2002-01-22 2008-03-21 Nokia Corp Adaptive variable length coding
JP2009200871A (en) * 2008-02-22 2009-09-03 Canon Inc Encoding apparatus
JP2009239969A (en) * 2009-07-17 2009-10-15 Fujitsu Ltd Image coder
WO2012077349A1 (en) * 2010-12-09 2012-06-14 パナソニック株式会社 Image encoding method and image decoding method
JP2015170932A (en) * 2014-03-05 2015-09-28 株式会社リコー Image compression apparatus and image compression method

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0663773A2 (en) * 1994-01-18 1995-07-19 Daewoo Electronics Co., Ltd Variable length coder using two VLC tables
EP0663773A3 (en) * 1994-01-18 1996-01-24 Daewoo Electronics Co Ltd Variable length coder using two VLC tables.
JP2008067395A (en) * 2002-01-22 2008-03-21 Nokia Corp Adaptive variable length coding
JP2009200871A (en) * 2008-02-22 2009-09-03 Canon Inc Encoding apparatus
JP2009239969A (en) * 2009-07-17 2009-10-15 Fujitsu Ltd Image coder
WO2012077349A1 (en) * 2010-12-09 2012-06-14 パナソニック株式会社 Image encoding method and image decoding method
JP2015170932A (en) * 2014-03-05 2015-09-28 株式会社リコー Image compression apparatus and image compression method

Similar Documents

Publication Publication Date Title
US6304606B1 (en) Image data coding and restoring method and apparatus for coding and restoring the same
JP2891772B2 (en) Digital image coding method using random scanning of image frames
JP5107495B2 (en) Quality-based image compression
US6912318B2 (en) Method and system for compressing motion image information
US20090046939A1 (en) Apparatus and method for processing image data based on object movement speed with a frame
JPH0775105A (en) Method and device for encoding and decoding image data
JP2005517316A (en) Configurable pattern optimizer
JPH05219385A (en) Picture compression expansion method and device
JP3087835B2 (en) Image encoding method and apparatus and image decoding method and apparatus
JPH1098731A (en) Device and method for decoding digital image
US7551788B2 (en) Digital image coding device and method for noise removal using wavelet transforms
US6157327A (en) Encoding/decoding device
JPH05316359A (en) Picture data coder
US6631161B1 (en) Method and system for compressing motion image information
JPH0487460A (en) Picture processor
JPH05284368A (en) Method and device for encoding/restoring image data
JP2901656B2 (en) Image coding device
KR0132895B1 (en) Image compression and expansion method and apparatus for adaptable function
JPH06217273A (en) Method and device for encoding image data
JP3230336B2 (en) Recompression device and recompression system
JPH05284369A (en) Method and device for encoding/restoring image data
KR100209411B1 (en) Method for processing image signals using contour information
JP2856268B2 (en) Image data restoration device
JPH0556270A (en) Reverse quantizing method and image data restoring device
JP2000165877A (en) Image coder and image decoder

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: 19990803