JPH08214170A - Image compressor - Google Patents

Image compressor

Info

Publication number
JPH08214170A
JPH08214170A JP4133395A JP4133395A JPH08214170A JP H08214170 A JPH08214170 A JP H08214170A JP 4133395 A JP4133395 A JP 4133395A JP 4133395 A JP4133395 A JP 4133395A JP H08214170 A JPH08214170 A JP H08214170A
Authority
JP
Japan
Prior art keywords
category
blocks
spatial frequency
scan
coefficient
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.)
Granted
Application number
JP4133395A
Other languages
Japanese (ja)
Other versions
JP3421463B2 (en
Inventor
Nobusato Abe
紳聡 阿部
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.)
Pentax Corp
Original Assignee
Asahi Kogaku Kogyo Co 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 Asahi Kogaku Kogyo Co Ltd filed Critical Asahi Kogaku Kogyo Co Ltd
Priority to JP04133395A priority Critical patent/JP3421463B2/en
Priority to US08/598,207 priority patent/US5937098A/en
Publication of JPH08214170A publication Critical patent/JPH08214170A/en
Application granted granted Critical
Publication of JP3421463B2 publication Critical patent/JP3421463B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Compression Or Coding Systems Of Tv Signals (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

PURPOSE: To attain image compression in response to image quality of each image by deciding a quantization coefficient corresponding to a spatial frequency. CONSTITUTION: DCT data statistics obtained corresponding to the quantized DCT coefficients using a quantization table whose quantization coefficients are all 1 as a default and a set sum code quantity are input to a spatial frequency data quantity setting section 24. The spatial frequency data quantity setting section 24 sets set data quantity for each spatial frequency. A quantized table generating section 25 predicts a data quantity of coding data in the case of coding through the use of prescribed quantization coefficients. When the data quantity is less than the set data quantity set by the spatial frequency data quantity setting section 24, the quantization coefficients thus determined are adopted as the quantization table.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、カラー静止画像をJP
EGアルゴリズムに準拠して情報圧縮する画像圧縮装置
に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention
The present invention relates to an image compression device that compresses information based on the EG algorithm.

【0002】[0002]

【従来の技術】高解像度画像を符号化して通信伝送路を
介して情報の授受を行う標準化アルゴリズムが、JPE
G(Joint Photographic Expert Group)から勧告されて
いる。このJPEGから勧告されているアルゴリズム、
すなわちJPEGアルゴリズムのベースライン・プロセ
スでは、大幅な情報圧縮を行うため、初めに2次元DC
T変換によって原画像データを空間周波数軸上の成分に
分解し、そして、その空間周波数軸上で表された各デー
タを量子化テーブルを用いて量子化し、さらに量子化し
た各データを符号化する。JPEGでは、この符号化の
ため、所定のハフマンテーブルを推奨している。
2. Description of the Related Art A standardized algorithm for encoding high-resolution images and exchanging information via a communication transmission line is JPE.
Recommended by G (Joint Photographic Expert Group). Algorithm recommended by this JPEG,
That is, in the baseline process of the JPEG algorithm, since a large amount of information is compressed, first, the two-dimensional DC is
The original image data is decomposed into components on the spatial frequency axis by T conversion, each data represented on the spatial frequency axis is quantized using a quantization table, and each quantized data is encoded. . JPEG recommends a predetermined Huffman table for this encoding.

【0003】従来の画像圧縮装置では、通常、デフォル
トの量子化テーブルが使用され、必要に応じて、量子化
テーブルの各量子化係数に単一の係数を乗じることによ
って修正された量子化テーブルが作成されている。
In a conventional image compression apparatus, a default quantization table is usually used, and if necessary, a quantization table modified by multiplying each quantization coefficient of the quantization table by a single coefficient is used. Has been created.

【0004】[0004]

【発明が解決しようとする課題】このように修正量子化
テーブルは、各空間周波数に対して一律に係数を乗じる
ことによって得られているため、個々の画像の特質(例
えば、低周波数成分に比して高周波数成分が多い等の性
質)に応じた量子化を行うことができず、画質を落とす
ことなく画像データを圧縮しているとは言い難かった。
As described above, since the modified quantization table is obtained by uniformly multiplying each spatial frequency by a coefficient, the characteristics of each image (for example, a low frequency component Therefore, it is difficult to say that the image data is compressed without degrading the image quality because it is not possible to perform the quantization in accordance with the characteristics such as a lot of high frequency components.

【0005】本発明は、以上のような問題点に鑑み、個
々の画像の特質に応じた画像圧縮を達成することができ
る画像圧縮装置を提供することを目的としている。
In view of the above problems, it is an object of the present invention to provide an image compression apparatus capable of achieving image compression according to the characteristics of individual images.

【0006】[0006]

【課題を解決するための手段】本発明に係る画像圧縮装
置は、原画像データに直交変換を施して空間周波数毎に
直交変換係数を求める直交変換手段と、直交変換係数を
所定の量子化係数から成る量子化テーブルにより量子化
して量子化直交変換係数を求める量子化手段と、量子化
直交変換係数を空間周波数に関して所定の1次元配列デ
ータに並びかえた後、量子化直交変換係数に基づいて符
号化を行って符号化データを求める符号化手段と、空間
周波数毎に符号化データのデータ量の目標値を設定する
手段と、第1の空間周波数の符号化データの統計量に基
づいて第2の空間周波数の符号化データのデータ量を予
測する手段と、この予測された第2の空間周波数のデー
タ量が目標値以下になるように、その空間周波数に対応
した量子化係数を定める量子化係数演算手段とを備えた
ことを特徴としている。
An image compression apparatus according to the present invention comprises an orthogonal transform means for performing an orthogonal transform on original image data to obtain an orthogonal transform coefficient for each spatial frequency, and an orthogonal transform coefficient for a predetermined quantization coefficient. Quantizing means for quantizing a quantized orthogonal transform coefficient by a quantization table consisting of, and quantized orthogonal transform coefficients are rearranged in a predetermined one-dimensional array data with respect to spatial frequency, and then based on the quantized orthogonal transform coefficient. A coding unit that performs coding to obtain coded data, a unit that sets a target value of the data amount of the coded data for each spatial frequency, and a first unit based on the statistical amount of the coded data of the first spatial frequency A means for predicting the data amount of encoded data of the spatial frequency of 2 and a quantization coefficient corresponding to the spatial frequency so that the predicted data amount of the second spatial frequency is equal to or less than the target value. It is characterized in that a Mel quantization coefficient calculating means.

【0007】[0007]

【実施例】以下図示実施例に基づいて本発明を説明す
る。図1は本発明の一実施例に係る画像圧縮装置のブロ
ック図である。
DESCRIPTION OF THE PREFERRED EMBODIMENTS The present invention will be described below with reference to illustrated embodiments. FIG. 1 is a block diagram of an image compression apparatus according to an embodiment of the present invention.

【0008】被写体Sから到来した光は集光レンズ11
によって集光され、被写体像がCCD(固体撮像素子)
12の受光面上に結像される。CCD12の受光面には
多数の光電変換素子が配設され、また光電変換素子の上
面には、例えばR、G、Bの各色フィルタ要素から成る
カラーフィルタが設けられている。各光電変換素子はひ
とつの画素に対応している。被写体像は、各光電変換素
子によって所定の色に対応した電気信号に変換され、A
/D変換器13に入力される。なお、図1の構成ではC
CD12が1枚のみであるが、2枚以上のCCDが設け
られた構成でもよい。
The light coming from the subject S is collected by the condenser lens 11
The image of the subject is collected by the CCD (solid-state image sensor)
An image is formed on 12 light receiving surfaces. A large number of photoelectric conversion elements are arranged on the light receiving surface of the CCD 12, and color filters composed of, for example, R, G, and B color filter elements are provided on the upper surface of the photoelectric conversion elements. Each photoelectric conversion element corresponds to one pixel. The subject image is converted into an electric signal corresponding to a predetermined color by each photoelectric conversion element, and A
It is input to the / D converter 13. In the configuration of FIG. 1, C
Although there is only one CD 12, it is also possible to have a configuration in which two or more CCDs are provided.

【0009】A/D変換器13においてA/D変換され
た信号は、図示しない信号処理回路によって輝度信号Y
と色差信号Cb、Crとに変換され、画像メモリ14に
入力される。画像メモリ14は輝度信号Yおよび色差信
号Cb、Crをそれぞれ格納するために、相互に独立し
たメモリ領域に分割されており、各メモリ領域は1画像
分の記憶容量を有している。
The signal A / D converted by the A / D converter 13 is converted into a luminance signal Y by a signal processing circuit (not shown).
Is converted into color difference signals Cb and Cr and input to the image memory 14. The image memory 14 is divided into mutually independent memory areas for storing the luminance signal Y and the color difference signals Cb, Cr, and each memory area has a storage capacity for one image.

【0010】画像メモリ14から読み出された輝度信号
Yおよび色差信号Cb、Crは、データ圧縮処理のた
め、DCT処理回路21に入力される。DCT処理回路
21では、輝度信号Y等の原画像データが離散コサイン
変換(以下DCTという)される。すなわち本実施例で
は、原画像データの直交変換としてDCT変換が利用さ
れる。なお、図1ではDCT処理回路21が1つの処理
回路として示されているが、実際には輝度信号Yおよび
色差信号Cb、Cr毎に独立したDCT処理回路が設け
られている。
The luminance signal Y and the color difference signals Cb and Cr read from the image memory 14 are input to the DCT processing circuit 21 for data compression processing. In the DCT processing circuit 21, the original image data such as the luminance signal Y is discrete cosine transformed (hereinafter referred to as DCT). That is, in this embodiment, the DCT transform is used as the orthogonal transform of the original image data. Although the DCT processing circuit 21 is shown as one processing circuit in FIG. 1, an independent DCT processing circuit is actually provided for each of the luminance signal Y and the color difference signals Cb and Cr.

【0011】画像圧縮装置は、DCT処理回路21、量
子化処理回路22、ハフマン符号化処理回路23、空間
周波数データ量設定部24、量子化テーブル生成部25
等から成る。DCT処理回路21、量子化処理回路22
およびハフマン符号化処理回路23では、輝度信号Y等
の画像データは1画面に関して複数のブロックに分割さ
れ、ブロック単位で処理される。なお各ブロックは8×
8個の画素データから構成される。
The image compression apparatus includes a DCT processing circuit 21, a quantization processing circuit 22, a Huffman coding processing circuit 23, a spatial frequency data amount setting unit 24, and a quantization table generation unit 25.
Etc. DCT processing circuit 21, quantization processing circuit 22
In the Huffman coding processing circuit 23, the image data such as the luminance signal Y is divided into a plurality of blocks for one screen and processed in block units. Each block is 8x
It consists of 8 pixel data.

【0012】DCT処理回路21において求められた輝
度信号Yおよび色差信号Cb、CrのDCT係数は、そ
れぞれ量子化処理回路22に入力される。量子化処理回
路22も、DCT処理回路21と同様、各信号毎に設け
られている。量子化処理回路22に入力された輝度信号
Y、色差信号Cb、CrのDCT係数は、8×8個の量
子化係数により構成される量子化テーブルQ1によっ
て、それぞれ量子化される。この量子化は線形量子化で
あり、すなわち各DCT係数は対応する量子化係数によ
って割算される。
The DCT coefficients of the luminance signal Y and the color difference signals Cb and Cr obtained by the DCT processing circuit 21 are input to the quantization processing circuit 22, respectively. Similarly to the DCT processing circuit 21, the quantization processing circuit 22 is also provided for each signal. The DCT coefficients of the luminance signal Y and the color difference signals Cb and Cr input to the quantization processing circuit 22 are quantized by the quantization table Q1 composed of 8 × 8 quantization coefficients. This quantization is a linear quantization, ie each DCT coefficient is divided by the corresponding quantization coefficient.

【0013】なお本実施例においては、JPEGアルゴ
リズムに準拠して、輝度信号YのDCT係数を量子化す
る量子化テーブルQ1と、色差信号Cb、CrのDCT
係数を量子化する量子化テーブルQ1とは異なっている
が、各信号において同一の量子化テーブルQ1を用いて
もよい。これらの量子化テーブルQ1は、後述するよう
に、空間周波数データ量設定部24と量子化テーブル生
成部25により、原画像データの空間周波数分布等の性
質に応じた最適なものが生成される。
In this embodiment, the quantization table Q1 for quantizing the DCT coefficient of the luminance signal Y and the DCT of the color difference signals Cb and Cr are based on the JPEG algorithm.
Although different from the quantization table Q1 for quantizing the coefficients, the same quantization table Q1 may be used for each signal. As will be described later, these quantization tables Q1 are generated optimally by the spatial frequency data amount setting unit 24 and the quantization table generating unit 25 according to the characteristics such as the spatial frequency distribution of the original image data.

【0014】量子化処理回路22から出力された輝度信
号Y、色差信号Cb、Crの量子化DCT係数はハフマ
ン符号化処理回路23に入力され、ハフマンテーブルQ
2を用い、所定のアルゴリズムによってハフマン符号化
される。
The quantized DCT coefficients of the luminance signal Y and the color difference signals Cb and Cr output from the quantization processing circuit 22 are input to the Huffman coding processing circuit 23, and the Huffman table Q is supplied.
2 is used, and Huffman coding is performed by a predetermined algorithm.

【0015】ハフマン符号化により得られた画像信号
(圧縮画像データ)は、ICメモリカード等の記録媒体
に記録される。
The image signal (compressed image data) obtained by Huffman coding is recorded on a recording medium such as an IC memory card.

【0016】図2は、一例として、8×8画素のブロッ
クの画像データP(Y)xy と、DCT係数S(Y)uv と、量
子化DCT係数R(Y)uv と、量子化テーブルQ(Y)uv と
を示している。
FIG. 2 shows, as an example, image data P (Y) xy of a block of 8 × 8 pixels, DCT coefficient S (Y) uv, quantized DCT coefficient R (Y) uv, and quantization table Q. (Y) uv is shown.

【0017】図2(a)の画像データP(Y)xy は、2次
元DCT変換によって、図2(b)に示す8×8=64
個のDCT係数S(Y)uv に変換される。これらのDCT
係数のうち、位置(0,0)にあるDCT係数S(Y)00
はDC成分であり、残り63個のDCT係数S(Y)uv は
AC成分である。AC成分は、係数S(Y)01 若しくは係
数S(Y)10 から係数S(Y)77 に向かって、より高い空間
周波数成分が8×8画素ブロックの画像データ中にどの
くらいあるかを示している。DC成分は8×8画素のブ
ロック全体の画素値の平均値(直流成分)を表してい
る。すなわち、各DCT係数S(Y)uv はそれぞれ所定の
空間周波数に対応している。
The image data P (Y) xy in FIG. 2 (a) is subjected to a two-dimensional DCT transformation to obtain 8 × 8 = 64 shown in FIG. 2 (b).
Are converted into individual DCT coefficients S (Y) uv. These DCT
Of the coefficients, the DCT coefficient S (Y) 00 at the position (0,0)
Is a DC component, and the remaining 63 DCT coefficients S (Y) uv are AC components. The AC component indicates from the coefficient S (Y) 01 or the coefficient S (Y) 10 to the coefficient S (Y) 77 how much higher spatial frequency component is in the image data of the 8 × 8 pixel block. There is. The DC component represents the average value (DC component) of the pixel values of the entire 8 × 8 pixel block. That is, each DCT coefficient S (Y) uv corresponds to a predetermined spatial frequency.

【0018】図2(d)は量子化処理回路21で用いら
れる量子化テーブルQ(Y)uv の一例を示している。この
ような量子化テーブルQ(Y)uv としては、上述したよう
に、輝度信号Yと色差信号Cb、Crとで別のものでも
よい。量子化テーブルQ(Y)uv は、JPEGフォーマッ
トの画像データを記録媒体に記録する際に、各信号に対
応した位置に、その信号の量子化に使用された量子化テ
ーブルQ(Y)uv の内容が記録される。
FIG. 2D shows an example of the quantization table Q (Y) uv used in the quantization processing circuit 21. Such a quantization table Q (Y) uv may be different for the luminance signal Y and the color difference signals Cb and Cr as described above. The quantization table Q (Y) uv is the quantization table Q (Y) uv used at the position corresponding to each signal when the JPEG format image data is recorded on the recording medium. The contents are recorded.

【0019】量子化テーブルQ(Y)uv を用いてDCT係
数S(Y)uv を量子化する式は以下のように定義される。 R(Y)uv =round(S(Y)uv /Q(Y)uv) {0≦ u,v≦
7} この式における roundは最も近い整数への近似を意味す
る。すなわち、DCT係数S(Y)uv 及び量子化テーブル
Q(Y)uv の各要素同士の割算と四捨五入とによって、図
2(c)に示すような量子化DCT係数R(Y)uv が求め
られる。
The equation for quantizing the DCT coefficient S (Y) uv using the quantization table Q (Y) uv is defined as follows. R (Y) uv = round (S (Y) uv / Q (Y) uv) {0≤u, v≤
7} Round in this formula means an approximation to the nearest integer. That is, the quantized DCT coefficient R (Y) uv as shown in FIG. 2C is obtained by dividing and rounding off each element of the DCT coefficient S (Y) uv and the quantization table Q (Y) uv. To be

【0020】このようにして量子化処理回路22におい
て求められた量子化DCT係数R(Y)uv 、R(Cb)uv、R
(Cr)uvは、ハフマン符号化処理回路23に入力される。
The quantized DCT coefficients R (Y) uv, R (Cb) uv, R obtained in the quantization processing circuit 22 in this way.
(Cr) uv is input to the Huffman coding processing circuit 23.

【0021】次にハフマン符号化処理回路23における
ハフマン符号化について、図3〜図8を参照して説明す
る。なお以下の説明において、量子化DC係数とは量子
化されたDC成分をいい、量子化AC係数とは量子化さ
れたAC成分をいう。
Next, the Huffman coding in the Huffman coding processing circuit 23 will be described with reference to FIGS. In the following description, the quantized DC coefficient means a quantized DC component, and the quantized AC coefficient means a quantized AC component.

【0022】量子化DC係数R(Y)00 と量子化AC係数
(量子化DC係数R(Y)00 以外の量子化DCT係数R
(Y)uv )では符号化方法が異なっている。量子化DC係
数R(Y)00 の符号化は次のように行われる。
Quantized DC coefficient R (Y) 00 and quantized AC coefficient (quantized DCT coefficient R other than quantized DC coefficient R (Y) 00 )
(Y) uv) has a different encoding method. Encoding of the quantized DC coefficient R (Y) 00 is performed as follows.

【0023】まず、現在符号化しようとするブロックの
量子化DC係数R(Y)00 と一つ前に符号化されたブロッ
クの量子化DC係数R(Y)00 との差分が求められる。こ
の差分値が図3に示すカテゴリの何れに属するかが判断
され、そのカテゴリを表す符号語が、図4に示す符号表
(DC成分の符号化テーブル)から求められる。例え
ば、現在符号化しようとするブロックの量子化DC係数
R(Y)00 が「16」であり、一つ前に符号化されたブロ
ックの量子化DC係数R(Y)00 が「25」である時、差
分値は「−9」であるので、図3のカテゴリ表から、差
分値=−9の属するカテゴリは「4」と判別され、さら
にそのカテゴリの符号語が図4の符号表より「 101」と
判断される。
[0023] First, the difference between the current quantized DC coefficient of a block to be coded R (Y) 00 and one previously coded blocks quantized DC coefficient R (Y) 00 is obtained. It is determined which of the categories shown in FIG. 3 the difference value belongs to, and the code word representing the category is obtained from the code table (DC component coding table) shown in FIG. For example, the quantization DC coefficient R of a block to be currently coded (Y) 00 is "16", the quantization of the coded block before one DC coefficient R (Y) 00 is "25" At some time, the difference value is "-9", and therefore the category to which the difference value = -9 belongs is determined to be "4" from the category table of Fig. 3, and the codeword of that category is determined from the code table of Fig. 4. It is judged as "101".

【0024】次いで差分値が、図3のカテゴリ表におい
て、そのカテゴリ内において何番目の値であるかが、付
加ビットにより表される。例えば差分値=−9はカテゴ
リ=4のグループにおいて、小さい方から7番目にある
ので、付加ビットは「0110」となる。すなわち、現在符
号化しているブロックの量子化DC係数R(Y)00 のハフ
マン符号語は「 1010110」となる。
Next, in the category table of FIG. 3, the number of values in the category is shown by an additional bit. For example, since the difference value = −9 is the seventh smallest from the smallest in the group of category = 4, the additional bit is “0110”. That is, the Huffman code word of the quantized DC coefficient R (Y) 00 of the block currently being encoded is “1010110”.

【0025】一方、量子化AC係数の符号化は、図5に
示す処理ルーチンによって行われる。まずステップ12
0において、63個の量子化AC係数が図6に示す順序
でジグザグスキャンされ、1次元配列データに並びかえ
られる。量子化AC係数を、ジグザグスキャンの順序に
従って、スキャンAC1 、AC2 ・・・AC63と呼ぶこ
ととする。次に、ステップ122では、1次元に並べら
れた各量子化AC係数が「0」であるか否かかが判断さ
れる。量子化AC係数が「0」である時、ステップ12
4において、その「0」である量子化AC係数が連続す
る数がカウントされる。これにより「0」が連続する長
さ、すなわちラン長が求められる。
On the other hand, the coding of the quantized AC coefficient is performed by the processing routine shown in FIG. First step 12
At 0, 63 quantized AC coefficients are zigzag scanned in the order shown in FIG. 6 and rearranged into one-dimensional array data. The quantized AC coefficients will be referred to as scans AC 1 , AC 2, ... AC 63 in the order of zigzag scanning. Next, at step 122, it is judged whether or not each quantized AC coefficient arranged in one dimension is "0". When the quantized AC coefficient is “0”, step 12
In 4, the number of consecutive quantized AC coefficients that are “0” is counted. As a result, the length of continuous "0", that is, the run length is obtained.

【0026】これに対し、ステップ122において量子
化AC係数が「0」でないと判断された時、ステップ1
26において、量子化DC係数と同じようなグループ分
けが行われるとともに付加ビットが求められる。この量
子化AC係数のグループ分けは、量子化DC係数のグル
ープ分けとは異なり、その量子化AC係数そのものにつ
いて行われる。すなわち、量子化AC係数が例えば
「4」である時、図7に示す表を参照してカテゴリ
「3」が得られる。また、量子化AC係数「4」はカテ
ゴリ=3のグループにおいて小さい方から5番目にある
ので、付加ビットは「 100」となる。
On the other hand, when it is determined in step 122 that the quantized AC coefficient is not "0", step 1
At 26, the same grouping as the quantized DC coefficients is performed and additional bits are determined. Unlike the grouping of the quantized DC coefficient, the grouping of the quantized AC coefficient is performed for the quantized AC coefficient itself. That is, when the quantized AC coefficient is "4", for example, the category "3" is obtained by referring to the table shown in FIG. Further, since the quantized AC coefficient “4” is fifth from the smallest in the group of category = 3, the additional bit is “100”.

【0027】ステップ130では、ハフマンテーブルの
AC符号表(図8)を参照し、例えば量子化AC係数
「4」の直前のデータのラン長が「0」である場合、こ
のラン長とカテゴリ=3とに基づいて、符号語「 100」
が得られる。そして、この符号語「 100」とステップ1
26において得られた付加ビット「 100」を組み合わせ
ことにより2次元ハフマン符号語「100100」が求められ
る。
In step 130, the AC code table (FIG. 8) of the Huffman table is referred to. For example, when the run length of the data immediately before the quantized AC coefficient “4” is “0”, this run length and category = Based on 3 and 3, the codeword "100"
Is obtained. And this code word "100" and step 1
The two-dimensional Huffman code word “100100” is obtained by combining the additional bits “100” obtained in step 26.

【0028】図2(c)の量子化DCT係数をハフマン
符号化した結果を、図9の符号化データHFとして示
す。
The result of Huffman coding the quantized DCT coefficient shown in FIG. 2C is shown as coded data HF in FIG.

【0029】図10は図9に示す符号化データHFを再
び示している。このような符号化データHFは、各ブロ
ック毎に得られ、1画面が5400ブロックにより構成
される場合、符号化データHFは5400だけ得られ
る。上述したように、符号化データHFは、1つの量子
化DC係数に関する符号化データと、63個の量子化A
C係数に関する符号化データとから成る。
FIG. 10 shows the encoded data HF shown in FIG. 9 again. Such encoded data HF is obtained for each block, and when one screen is composed of 5400 blocks, only 5400 encoded data HF is obtained. As described above, the encoded data HF includes the encoded data for one quantized DC coefficient and 63 quantized A
And C coded data.

【0030】量子化DC係数に関する符号化データは、
カテゴリの符号語FA0と付加ビットFB0とから成
る。量子化AC係数に関する符号化データは、ラン長・
カテゴリの符号語と付加ビットから構成される。次に、
量子化AC係数に関する符号化データについてさらに詳
細に説明する。
The coded data relating to the quantized DC coefficient is
The code word FA0 of the category and the additional bit FB0. The encoded data relating to the quantized AC coefficient is the run length
It consists of a codeword of the category and additional bits. next,
The encoded data regarding the quantized AC coefficient will be described in more detail.

【0031】図9の例では、スキャンAC1 が4であ
り、かつラン長が0であることに基づく符号化データと
して、ラン長・カテゴリの符号語FA1と付加ビットF
B1が生成され、スキャンAC2 が−7であり、かつラ
ン長が0であることに基づく符号化データとして、ラン
長・カテゴリの符号語FA2と付加ビットFB2が生成
されている。スキャンAC3 が0であるので、付加ビッ
トFB2の後には、スキャンAC4 が3であり、かつラ
ン長が1であることに基づく符号化データとして、ラン
長・カテゴリの符号語FA4と付加ビットFB4が生成
されている。同様にして、ラン長・カテゴリの符号語F
A5と付加ビットFB5、ラン長・カテゴリの符号語F
A8と付加ビットFB8、ラン長・カテゴリの符号語F
A9と付加ビットFB9がそれぞれ生成されている。終
端データ(EOB)は、スキャンAC10以降は全て0が
続くことを示している。
In the example of FIG. 9, the code word FA1 of the run length / category and the additional bit F are coded data based on the scan AC 1 of 4 and the run length of 0.
B1 is generated, the scan AC 2 is -7, and the coded data based on the run length is 0, the additional bit FB2 is generated code word FA2 run length category. Since the scan AC 3 is 0, after the additional bit FB2, the code word FA4 of the run length / category and the additional bit are coded data based on the scan AC 4 being 3 and the run length being 1. FB4 has been generated. Similarly, the run length / category code word F
A5, additional bit FB5, code word F of run length / category
A8, additional bit FB8, run length / category code word F
A9 and additional bit FB9 are generated respectively. The end data (EOB) indicates that all 0s continue after the scan AC 10 .

【0032】次に、量子化テーブルQ1の生成について
説明する。図1に示すように量子化テーブルQ1は、設
定合計符号量とDCTデータ統計量とに基づいて生成さ
れる。設定合計符号量は、記録媒体に記録される1画面
分の符号化データHFの合計ビット数であり、例えば5
24288ビット(64Kbyte)である。DCTデータ
統計量はDCT処理回路21の出力データに基づいて得
られる。DCT処理回路21の出力データは原画像デー
タをDCT変換したものであり、8×8個の量子化係数
が全て「1」である量子化テーブルQ1(以下、デフォ
ルトの量子化テーブルという)を用いて量子化したもの
と等価である。この出力データをジグザグスキャンして
(図6参照)、ラン長とカテゴリを求めた(図5参照)
後、図24に示す表を参照して各空間周波数毎のビット
長を求めることにより、DCTデータ統計量が得られ
る。すなわち、このDCTデータ統計量は、次に述べる
ように、図11に示すようなカテゴリ分布と、図12に
示すようなスキャン毎の符号量の分布である。
Next, the generation of the quantization table Q1 will be described. As shown in FIG. 1, the quantization table Q1 is generated based on the set total code amount and the DCT data statistic. The set total code amount is the total number of bits of the encoded data HF for one screen recorded on the recording medium, for example, 5
It is 24288 bits (64 Kbytes). The DCT data statistic is obtained based on the output data of the DCT processing circuit 21. The output data of the DCT processing circuit 21 is obtained by performing DCT conversion on the original image data, and a quantization table Q1 (hereinafter, referred to as a default quantization table) in which all 8 × 8 quantization coefficients are “1” is used. It is equivalent to what is quantized. The output data was zigzag scanned (see FIG. 6) to obtain the run length and category (see FIG. 5).
Then, the DCT data statistic is obtained by referring to the table shown in FIG. 24 to obtain the bit length for each spatial frequency. That is, this DCT data statistic is a category distribution as shown in FIG. 11 and a code amount distribution for each scan as shown in FIG. 12, as described below.

【0033】図11は、デフォルトの量子化テーブルを
用いた時の所定の空間周波数(例えばスキャンAC1
でのカテゴリ分布、すなわち各カテゴリに分類されるブ
ロックの数の例を示している。この図に示すようなカテ
ゴリ分布は、1つの画像において、DC成分に関するも
のと、63個のAC成分に関するものとが生成され、す
なわちカテゴリ分布は全部で64だけ生成される。本実
施例において原画像データは5400ブロックに分割さ
れており、図11の例では、カテゴリが0であるブロッ
ク数は602であり、カテゴリが1であるブロック数は
1088である。
FIG. 11 shows a predetermined spatial frequency (for example, scan AC 1 ) when the default quantization table is used.
3 shows an example of the category distribution in, that is, the number of blocks classified into each category. The category distribution as shown in this figure is generated in one image for DC components and 63 AC components, that is, only 64 category distributions are generated in total. In the present embodiment, the original image data is divided into 5400 blocks, and in the example of FIG. 11, the number of blocks whose category is 0 is 602, and the number of blocks whose category is 1 is 1088.

【0034】図12は、デフォルトの量子化テーブルを
用いた時の各スキャンにおける符号化データHFのビッ
ト数の分布の例であり、これは1つの画像の全ブロック
に関して、各空間周波数毎の合計ビット数を示してい
る。例えばDC成分の場合、カテゴリの符号語FA0と
付加ビットFB0(図10参照)の合計ビット数は42
238(符号DB0)である。スキャンAC1 の場合、
ラン長・カテゴリの符号語FA1と付加ビットFB1の
合計ビット数は34009(符号DB1)、スキャンA
2 の場合、ラン長・カテゴリの符号語FA2と付加ビ
ットFB2の合計ビット数は33833(符号DB2)
である。図10の例では、スキャンAC3に関してラン
長・カテゴリの符号語と付加ビットは存在しないが、他
のブロックにおいてスキャンAC3 のデータが存在する
ため、合計ビット数は25920(符号DB3)となっ
ている。このようにして、スキャンAC63の合計ビット
数20909(符号DB63)までのデータが生成され
る。
FIG. 12 shows an example of the distribution of the number of bits of the coded data HF in each scan when the default quantization table is used. This is the total for each spatial frequency for all blocks of one image. Indicates the number of bits. For example, in the case of the DC component, the total number of bits of the code word FA0 of the category and the additional bit FB0 (see FIG. 10) is 42.
238 (reference DB0). For scan AC 1 ,
The total number of bits of the run length / category code word FA1 and additional bit FB1 is 34,090 (code DB1), scan A
In the case of C 2 , the total number of bits of the run length / category code word FA2 and the additional bit FB2 is 33833 (code DB2)
Is. In the example of FIG. 10, but not present code word and additional bit run length category in the scan AC 3, because of the presence data of the scan AC 3 is In another block, the total number of bits becomes 25 920 (reference numeral DB3) ing. In this way, data up to the total bit number 20909 (reference DB 63) of the scan AC 63 is generated.

【0035】設定合計符号量とDCTデータ統計量は、
空間周波数データ量設定部24に入力される。空間周波
数データ量設定部24では、例えば図13に示すよう
な、各空間周波数毎(すなわちスキャン毎)の符号量の
分布が設定される。すなわち、DC成分の符号量は44
240ビット(符号SB0)、スキャンAC1 の符号量
は33008ビット(符号SB1)、スキャンAC2
符号量は35629ビット(符号SB2)であり、スキ
ャンAC63の符号量まで設定される(符号SB63)。
これらの符号量の合計値すなわち設定合計符号量は所定
値(図13の例では524288ビット)に定められ
る。
The set total code amount and the DCT data statistic are
It is input to the spatial frequency data amount setting unit 24. The spatial frequency data amount setting unit 24 sets the distribution of the code amount for each spatial frequency (that is, for each scan) as shown in FIG. 13, for example. That is, the code amount of the DC component is 44
240 bits (code SB0), the code amount of scan AC 1 is 33008 bits (code SB1), the code amount of scan AC 2 is 35629 bits (code SB2), and the code amount of scan AC 63 is set (code SB63). ).
The total value of these code amounts, that is, the set total code amount is set to a predetermined value (524288 bits in the example of FIG. 13).

【0036】この符号量(データ量)は目標値であり、
この画像圧縮装置では、後述するように各空間周波数毎
の符号量がこの目標値になるように、量子化テーブルQ
1が生成される。すなわち、この符号量の分布は、最終
的に得られた量子化テーブルQ1を用いた場合のハフマ
ン符号化データにおける、各空間周波数毎の符号量の目
標値であり、例えば高周波数成分をカットしたい場合に
は、高周波数成分に関する符号量が相対的に小さくなる
ように定められる。なお各空間周波数における符号量
は、再生画像が原画像に近くなるように、例えば試行錯
誤によって求められる。
This code amount (data amount) is a target value,
In this image compression device, the quantization table Q is set so that the code amount for each spatial frequency becomes the target value as described later.
1 is generated. That is, the distribution of the code amount is the target value of the code amount for each spatial frequency in the Huffman encoded data when the finally obtained quantization table Q1 is used, and for example, it is desired to cut high frequency components. In this case, the code amount for the high frequency component is set to be relatively small. The code amount at each spatial frequency is obtained, for example, by trial and error so that the reproduced image becomes closer to the original image.

【0037】また空間周波数データ量設定部24では、
DCTデータ統計量のうちのスキャン毎の符号量の分布
(図12参照)を用いて、各空間周波数毎の符号量の上
限値を定めてもよい。例えば、図13においてスキャン
AC4 の合計ビット数は28844(符号SB4)に定
められているが、DCTデータ統計量の符号量分布に基
づいて、28461ビットに制限してもよい(図12の
符号DB4参照)。
In the spatial frequency data amount setting unit 24,
The upper limit of the code amount for each spatial frequency may be determined using the distribution of the code amount for each scan of the DCT data statistic (see FIG. 12). For example, although the total number of bits of scan AC 4 is set to 28844 (symbol SB4) in FIG. 13, it may be limited to 28461 bits based on the code amount distribution of DCT data statistics (the symbol of FIG. 12). See DB4).

【0038】量子化テーブル生成部25では、DCTデ
ータ統計量と空間周波数データ量設定部24からの入力
データとに基づいて、量子化テーブルQ1を構成する各
量子化係数が生成される。
The quantization table generation unit 25 generates each quantization coefficient that constitutes the quantization table Q1 based on the DCT data statistics and the input data from the spatial frequency data amount setting unit 24.

【0039】DC成分に関する量子化係数の求め方につ
いて説明する。まず、デフォルトの量子化テーブル(全
ての量子化係数が1である量子化テーブル)を用いて、
全てのブロックのDC成分が量子化される。そして、現
在量子化係数を求めようとしているブロックの量子化D
C係数と一つ前のブロックの量子化DC係数との差分値
が求められる。
A method of obtaining the quantization coefficient for the DC component will be described. First, using the default quantization table (quantization table in which all quantization coefficients are 1),
The DC components of all blocks are quantized. Then, the quantization D of the block for which the quantization coefficient is currently obtained
The difference value between the C coefficient and the quantized DC coefficient of the immediately preceding block is obtained.

【0040】この差分値が図3に示すカテゴリの何れに
属するかが判断され、そのカテゴリを表す符号語が、図
4に示す符号表(DC成分の符号化テーブル)から求め
られる。また図3のカテゴリ表から、その差分値に対応
した付加ビット数が求められる。例えば、差分値のカテ
ゴリが「2」であるとき、符号長は3ビットであり、付
加ビット数は2ビットである。したがって、差分値のカ
テゴリが「2」である量子化DC係数の符号量は5ビッ
トである。
It is determined which of the categories shown in FIG. 3 the difference value belongs to, and the code word representing the category is obtained from the code table (DC component coding table) shown in FIG. Further, the number of additional bits corresponding to the difference value is obtained from the category table of FIG. For example, when the category of the difference value is “2”, the code length is 3 bits and the number of additional bits is 2 bits. Therefore, the code amount of the quantized DC coefficient whose category of difference value is “2” is 5 bits.

【0041】このようにして、量子化DC係数の符号量
が各ブロック毎に求められ、これらの合計符号量(ビッ
ト数)が求められる。この合計符号量が図13に示すD
C成分の符号量(符号SB0)以下であれば、その時の
量子化係数が最終的なものとして決定される。もし、そ
の合計値が図13の符号量(符号SB0)よりも大きけ
れば、次に量子化係数は2に変更され、この量子化係数
を用いて、上述したような合計ビット数の検討が行われ
る。
In this way, the code amount of the quantized DC coefficient is obtained for each block, and the total code amount (the number of bits) of these is obtained. This total code amount is D shown in FIG.
If the code amount of the C component (code SB0) or less, the quantized coefficient at that time is determined as the final one. If the total value is larger than the code amount (code SB0) in FIG. 13, the quantization coefficient is changed to 2, and the total number of bits as described above is examined using this quantization coefficient. Be seen.

【0042】この新しい量子化係数を用いたときの合計
ビット数を求めるために、各カテゴリに該当するブロッ
クの数を予測しておくことが必要である。すなわち図1
5に示すようなカテゴリ分布の表を、予め求めておく必
要がある。このカテゴリ分布の表の求め方の一例を図3
を参照して次に説明する。
In order to obtain the total number of bits when this new quantized coefficient is used, it is necessary to predict the number of blocks corresponding to each category. That is, FIG.
It is necessary to obtain a category distribution table as shown in FIG. An example of how to obtain this category distribution table is shown in FIG.
Will be described next.

【0043】例えばカテゴリ「2」に属する差分値は、
−3、−2、2、3である。量子化係数が2になると、
差分値「2」は2/2=1となるため、カテゴリ「1」
に移る。差分値「−2」も同様である。これに対し、差
分値「3」は3/2=1.5≒2となるため、カテゴリ
「2」のままである。差分値「−3」も同様である。し
たがって、この例では、量子化係数が1であるときにカ
テゴリ「2」に属していた差分値のうち、半分がカテゴ
リ「1」に変化し、半分がカテゴリ「2」のままであ
る。このようにして、量子化係数が変化した場合のカテ
ゴリ分布が予想され、このカテゴリ分布の表を用いるこ
とにより、合計符号量が求められる。
For example, the difference value belonging to the category “2” is
-3, -2, 2, and 3. When the quantization coefficient becomes 2,
Since the difference value “2” is 2/2 = 1, the category “1”
Move on to. The same applies to the difference value "-2". On the other hand, since the difference value “3” is 3/2 = 1.5≈2, it remains the category “2”. The same applies to the difference value "-3". Therefore, in this example, of the difference values that belonged to the category “2” when the quantization coefficient was 1, half changed to the category “1” and half remained the category “2”. In this way, the category distribution when the quantization coefficient changes is predicted, and the total code amount is obtained by using the table of this category distribution.

【0044】次に、AC成分に関する量子化係数の求め
方について説明する。AC成分については、ハフマン符
号化データの中にラン長に関するデータが含まれており
(図10の例えば符号FA1、FA2、FA4等)、ま
た量子化係数を変化させるとラン長が変化する。したが
って、量子化係数を変化させたときの各スキャンのデー
タ量は、量子化係数を変化させる前のそのスキャンのデ
ータ量だけに基づいて予測することはできない。そこで
本実施例では、次に述べるように、カテゴリ分布の表を
用いて、量子化係数を変化させたときの各スキャンのデ
ータ量を予測し、この予測値に基づいて量子化係数を決
定している。
Next, how to obtain the quantized coefficient for the AC component will be described. Regarding the AC component, the Huffman-encoded data includes data relating to the run length (for example, symbols FA1, FA2, FA4 in FIG. 10), and the run length changes when the quantization coefficient is changed. Therefore, the data amount of each scan when the quantized coefficient is changed cannot be predicted based on only the data amount of the scan before the quantized coefficient is changed. Therefore, in the present embodiment, as will be described below, the data amount of each scan when the quantization coefficient is changed is predicted using the category distribution table, and the quantization coefficient is determined based on this prediction value. ing.

【0045】図14は、図11に示すカテゴリ分布を各
スキャンについて同時に示す表の一例である。すなわ
ち、このカテゴリ分布の表は、デフォルトの量子化テー
ブルを用いた時の各空間周波数における、各カテゴリに
分類されるブロックの数を示している。なお図14で
は、DC成分と、スキャンAC1 からスキャンAC11
で示され、スキャンAC12からスキャンAC63までは省
略されている。また図14において、最上段の数字はカ
テゴリを示している。例えばスキャンAC1 において、
カテゴリ「0」のブロック数は602、カテゴリ「1」
のブロック数は1088である。
FIG. 14 is an example of a table simultaneously showing the category distribution shown in FIG. 11 for each scan. That is, this category distribution table shows the number of blocks classified into each category at each spatial frequency when the default quantization table is used. In FIG. 14, the DC component and scan AC 1 to scan AC 11 are shown, and scan AC 12 to scan AC 63 are omitted. Also, in FIG. 14, the numbers at the top indicate categories. For example, in scan AC 1 ,
The number of blocks in category "0" is 602, and the category is "1"
The number of blocks is 1088.

【0046】図15は、図14と異なり、全ての量子化
係数が「16」である量子化テーブルを用いた時のカテ
ゴリ分布の表を示している。図7から理解されるよう
に、量子化係数「1」を用いた場合のカテゴリ「0」か
ら「3」までのAC成分値は、量子化係数「16」を用
いると0になるため、そのAC成分値のカテゴリは
「0」となる。すなわち、図15におけるスキャンAC
1 の3479個のカテゴリ「0」のブロックは、図14
における、カテゴリ「0」〜「3」の602、108
8、1184、605の各ブロックに対応している。
Unlike FIG. 14, FIG. 15 shows a category distribution table when a quantization table in which all the quantization coefficients are “16” is used. As can be seen from FIG. 7, the AC component values of the categories “0” to “3” when the quantized coefficient “1” is used become 0 when the quantized coefficient “16” is used. The category of the AC component value is “0”. That is, the scan AC in FIG.
Blocks of 3479 categories “0” of 1 are shown in FIG.
602 and 108 of categories “0” to “3” in
It corresponds to each block of 8, 1184, and 605.

【0047】同様に量子化係数「1」を用いた場合のカ
テゴリ「4」のAC成分値は、量子化係数「16」を用
いると−1または1になるため、そのAC成分値のカテ
ゴリは「1」となる。一方、量子化係数「1」を用いた
場合のカテゴリ「5」のAC成分値は、量子化係数「1
6」を用いると1になるものと2になるものとがある。
したがって、量子化係数「16」を用いた場合、一部の
ブロックのAC成分値のカテゴリは「1」となり、他の
ブロックのAC成分値のカテゴリは「2」となる。すな
わち、図15におけるスキャンAC1 の866個のカテ
ゴリ「1」のブロックは、図14における、カテゴリ
「4」の529のブロックと、カテゴリ「5」の一部の
ブロックに対応している。このように、量子化係数を変
化させると、あるカテゴリに属するブロックがそのまま
他のカテゴリに移行するとは限らず、異なるカテゴリに
移行することがある。
Similarly, the AC component value of the category "4" when the quantized coefficient "1" is used becomes -1 or 1 when the quantized coefficient "16" is used, so that the category of the AC component value is It becomes "1". On the other hand, when the quantization coefficient “1” is used, the AC component value of the category “5” is the quantization coefficient “1”.
When "6" is used, there are one that becomes 1 and one that becomes 2.
Therefore, when the quantization coefficient “16” is used, the AC component value category of some blocks is “1”, and the AC component value categories of other blocks are “2”. That is, the 866 blocks of category “1” of scan AC 1 in FIG. 15 correspond to the blocks of 529 of category “4” and some blocks of category “5” in FIG. 14. In this way, when the quantized coefficient is changed, a block belonging to a certain category does not necessarily move to another category as it is, but may move to a different category.

【0048】次に、スキャンACi-1 、ACi のカテゴ
リが共に「0」であるブロック数の予測について、図1
6〜図19を参照して説明する。
Next, the prediction of the number of blocks in which the categories of the scans AC i-1 and AC i are both "0" will be described with reference to FIG.
This will be described with reference to FIGS.

【0049】図16〜図19において、C16 to 19, C

〔0〕は、そ
のスキャンでのカテゴリ「0」のブロック数、C〔1
〜〕は、そのスキャンでのカテゴリ「1」以上のブロッ
ク数である。Z〔k〕は、ラン長がkであるブロック数
の予測値である。C’
[0] is the number of blocks of category “0” in the scan, C [1
~] Is the number of blocks of category “1” or more in the scan. Z [k] is a predicted value of the number of blocks whose run length is k. C '

〔0〕は1つ前のスキャンでのカ
テゴリ「0」のブロック数、Z’
[0] is the number of blocks of category “0” in the previous scan, Z ′

〔0〕は1つ前のスキ
ャンでのラン長が0であるブロック数である。
[0] is the number of blocks whose run length is 0 in the immediately preceding scan.

【0050】図16はスキャンAC1 のカテゴリ「0」
のブロック数と、カテゴリ「1」以上のブロック数を示
している。スキャンAC1 では、図15に示すように、
カテゴリ「0」のブロック数C
FIG. 16 shows the category "0" of scan AC 1 .
And the number of blocks of category “1” or more. In scan AC 1 , as shown in FIG.
Number of blocks in category "0" C

〔0〕は3479であ
り、カテゴリ「1」以上のブロック数C〔1〜〕は19
21(=5400−3479)である。したがって、ス
キャンAC1 において、ラン長が1であるブロック数Z
〔1〕は3479、ラン長が0であるブロック数Z
[0] is 3479, and the number of blocks C [1] of category “1” and above is 19
21 (= 5400-3479). Therefore, in scan AC 1 , the number Z of blocks having a run length of 1
[1] is 3479, and the number of blocks Z whose run length is 0

〔0〕は1921である。[0] is 1921.

【0051】図17は、スキャンAC2 までのラン長が
2、1、0であるブロック数を示している。スキャンA
2 では、図15に示すように、カテゴリ「0」のブロ
ック数C
FIG. 17 shows the number of blocks whose run lengths up to scan AC 2 are 2 , 1, 0. Scan A
In C 2 , as shown in FIG. 15, the number of blocks of category “0” C

〔0〕は3619であり、カテゴリ「1」以上
のブロック数C〔1〜〕は1781である。したがって
ラン長が0であるブロック数Z
[0] is 3619, and the number of blocks C [1] of category “1” or higher is 1781. Therefore, the number of blocks Z whose run length is 0

〔0〕が1781である
ことは明らかであるが、ラン長が2であるブロック数Z
〔2〕とラン長が1であるブロック数Z〔1〕について
は明らかではない。そこで本実施例では、ブロック数Z
〔2〕とブロック数Z〔1〕との比は、スキャンAC1
でのラン長が1であるブロック数Z〔1〕とラン長が0
であるブロック数Z’
Although it is clear that [0] is 1781, the number of blocks Z with a run length of 2
[2] and the number of blocks Z [1] having a run length of 1 are not clear. Therefore, in this embodiment, the number of blocks Z
The ratio of [2] and the number of blocks Z [1] is calculated by scanning AC 1
Number of blocks with run length 1 in Z [1] and run length 0
The number of blocks Z '

〔0〕との比に等しいと仮定し
て、ブロック数Z〔2〕とブロック数Z〔1〕のブロッ
ク数を予想している。すなわち本実施例では、スキャン
AC1 、AC2 において共にカテゴリが「0」であるブ
ロック数は、スキャンAC1 におけるカテゴリ「0」の
ブロック数に関連すると仮定している。
The number of blocks Z [2] and the number of blocks Z [1] are predicted on the assumption that they are equal to the ratio with [0]. That is, in the present embodiment, it is assumed that the number of blocks whose category is “0” in both scan AC 1 and AC 2 is related to the number of blocks of category “0” in scan AC 1 .

【0052】このようにして求められたブロック数Z
〔2〕は、スキャンAC1 、AC2 のカテゴリが共に
「0」である場合における、スキャンAC2 に対応して
いる。またブロック数Z〔1〕は、スキャンAC1 のカ
テゴリが「0」以外である場合における、カテゴリが
「0」であるスキャンAC2 に対応している。
The number of blocks Z thus obtained
[2] corresponds to the scan AC 2 when the categories of the scan AC 1 and AC 2 are both “0”. The number of blocks Z [1], when the scan AC 1 category is other than "0", corresponds to the scan AC 2 category is "0".

【0053】図18は、スキャンAC3 までのラン長が
3、2、1、0であるブロック数を示している。スキャ
ンAC3 では、図15に示すように、カテゴリ「0」の
ブロック数C
FIG. 18 shows the number of blocks whose run lengths up to the scan AC 3 are 3, 2, 1, 0. In the scan AC 3 , as shown in FIG. 15, the number of blocks C in the category “0” is C

〔0〕は4366であり、カテゴリ「1」
以上のブロック数C〔1〜〕は1034である。したが
ってブロック数Z
[0] is 4366, and the category is "1".
The above block number C [1] is 1034. Therefore, the number of blocks Z

〔0〕は1034である。ブロック数
Z〔1〕は、スキャンAC2 でのブロック数Z’
[0] is 1034. The block number Z [1] is the block number Z ′ in scan AC 2.

〔0〕
の割合に依存すると仮定し、 Z〔1〕=4366×1781/5400=1440 となる。一方、ブロック数Z〔2〕、〔3〕の比は、ス
キャンAC2 でのブロック数Z〔1〕、〔2〕の比に等
しいと仮定し、 Z〔2〕=4366×1287/5400=1041 Z〔3〕=4366×2332/5400=1885 となる。
[0]
It is assumed that Z [1] = 4366 × 1781/5400 = 1440, assuming that it depends on the ratio of On the other hand, assuming that the ratio of the block numbers Z [2] and [3] is equal to the ratio of the block numbers Z [1] and [2] in the scan AC 2 , Z [2] = 4366 × 1287/5400 = 1041 Z [3] = 4366 × 2332/5400 = 18885.

【0054】このブロック数Z〔3〕は、スキャンAC
1 、AC2 、AC3 のカテゴリが共に「0」である場合
における、スキャンAC3 に対応している。またブロッ
ク数Z〔2〕は、スキャンAC1 のカテゴリが「0」以
外であり、かつスキャンAC2 のカテゴリが「0」であ
る場合における、カテゴリが「0」であるスキャンAC
3 に対応している。ブロック数Z〔1〕は、スキャンA
2 のカテゴリが「0」以外である場合における、カテ
ゴリが「0」であるスキャンAC3 に対応している。
This block number Z [3] is the scan AC
It corresponds to scan AC 3 when the categories of 1 , AC 2 , and AC 3 are all “0”. Further, the number of blocks Z [2] is the scan AC whose category is “0” when the category of the scan AC 1 is other than “0” and the category of the scan AC 2 is “0”.
Corresponds to 3 . The number of blocks Z [1] is scan A
It corresponds to the scan AC 3 whose category is “0” when the category of C 2 is other than “0”.

【0055】図19はスキャンAC4 までのラン長が
4、3、2、1、0であるブロックを示している。スキ
ャンAC4 以降においても上述した処理が行われ、ラン
長がkであるブロック数Z〔k〕が求められる。
FIG. 19 shows a block in which the run length up to scan AC 4 is 4, 3 , 2, 1, 0. The above-described processing is performed even after the scan AC 4 , and the number of blocks Z [k] having a run length of k is obtained.

【0056】このようにしてスキャンAC63までのラン
長が求められると、次に、図20〜図23に示すような
ラン長・カテゴリの表が各カテゴリ毎に作成される。
When the run lengths up to the scan AC 63 are obtained in this manner, next, a run length / category table as shown in FIGS. 20 to 23 is created for each category.

【0057】図20は、スキャンAC1 のラン長・カテ
ゴリの表であり、この表は、ラン長が0であってカテゴ
リ「0」以外のカテゴリ分布を示している。スキャンA
1おいて、カテゴリ「0」以外のブロック数は、図1
6に示すように全部で1921(=Z
FIG. 20 is a table of run lengths / categories of scan AC 1 , and this table shows category distributions with run length 0 and categories other than category “0”. Scan A
In C 1 , the number of blocks other than the category “0” is shown in FIG.
As shown in Fig. 6, 1921 (= Z

〔0〕)ある。カ
テゴリ分布は、図15に示すように、カテゴリ「1」、
「2」・・・「5」の順に、866、519、300、
212、24であり、カテゴリ「6」以上のブロック数
は0である。この数値をそのまま転記することにより、
図20の表が作成される。
[0]) Yes. The category distribution is, as shown in FIG. 15, a category “1”,
"2" ... "5" in the order of 866, 519, 300,
212 and 24, and the number of blocks of category “6” and above is zero. By posting this number as it is,
The table of FIG. 20 is created.

【0058】図21は、スキャンAC2 のラン長・カテ
ゴリの表であり、この表は、ラン長が0と1であってカ
テゴリ「0」以外のカテゴリ分布を示している。スキャ
ンAC2 おいて、カテゴリ「0」以外のブロック数は、
図17に示すように全部で1781(=Z
FIG. 21 is a table of scan AC 2 run lengths / categories. This table shows category distributions for run lengths 0 and 1 other than category "0". In Scan AC 2 , the number of blocks other than category “0” is
As shown in FIG. 17, a total of 1781 (= Z

〔0〕)あ
る。カテゴリ分布は、図15に示すように、カテゴリ
「1」、「2」・・・「5」の順に、850、487、
315、119、10であり、カテゴリ「6」以上のブ
ロック数は0である。カテゴリ「1」の850のブロッ
クは、図17に示すZ〔1〕とZ〔2〕の比、すなわち
スキャンAC1 でのラン長が0であるブロック数Z’
[0]) Yes. As shown in FIG. 15, the category distributions are 850, 487, in the order of categories “1”, “2” ...
315, 119 and 10, and the number of blocks in the category “6” and above is 0. The block of 850 in the category “1” is the ratio of Z [1] and Z [2] shown in FIG. 17, that is, the number of blocks Z ′ having a run length of 0 in scan AC 1.

〔0〕とラン長が1であるブロック数Z〔1〕との比に
等しいと仮定して、ラン長が0のブロック数は302、
ラン長が1のブロック数は548に定められている。同
様に、カテゴリ「2」の487のブロックについては、
ラン長が0のブロック数は173、ラン長が1のブロッ
ク数は314に定められている。このようにして、図2
1の表が作成される。
Assuming that the ratio is [0] and the number of blocks Z [1] having a run length of 1, the number of blocks having a run length of 0 is 302,
The number of blocks having a run length of 1 is set to 548. Similarly, regarding the block of 487 in the category “2”,
The number of blocks with a run length of 0 is 173, and the number of blocks with a run length of 1 is 314. In this way, FIG.
A table of 1 is created.

【0059】図22は、スキャンAC3 のラン長・カテ
ゴリの表であり、この表は、ラン長が0と1と2であっ
てカテゴリ「0」以外のカテゴリ分布を示している。ス
キャンAC3 おいて、カテゴリ「0」以外のブロック数
は、図18に示すように全部で1034(=Z
FIG. 22 is a table of run lengths / categories of scan AC 3 , and this table shows category distributions of run lengths 0, 1 and 2 other than the category “0”. In the scan AC 3 , the number of blocks other than the category “0” is 1034 (= Z in total as shown in FIG.

〔0〕)
ある。カテゴリ分布は、図15に示すように、カテゴリ
「1」、「2」・・・「4」の順に、675、220、
121、18であり、カテゴリ「5」以上のブロック数
は0である。各カテゴリのブロック数は、図18に示す
Z〔1〕とZ〔2〕とZ〔3〕の比に従って、ラン長が
0と1と2のブロック数に分配されている。
[0])
is there. As shown in FIG. 15, the category distributions are 675, 220, in the order of categories “1”, “2” ... “4”.
121 and 18, and the number of blocks of category “5” or higher is 0. The number of blocks in each category is distributed to the number of blocks with run lengths 0, 1 and 2 according to the ratio of Z [1], Z [2] and Z [3] shown in FIG.

【0060】図23は、スキャンAC4 のラン長・カテ
ゴリの表である。この表も上述した処理により、図15
と図19を参照して作成される。このようにしてスキャ
ンAC63までのラン長・カテゴリの表が作成される。
FIG. 23 is a table of scan AC 4 run lengths / categories. This table is also shown in FIG.
It is created with reference to FIG. In this way, a table of run lengths and categories up to the scan AC 63 is created.

【0061】次に、図20〜図23に示すようなラン長
・カテゴリの表を参照して、各スキャンにおけるデータ
量(ビット数)が計算される。この計算のため、図24
に示す符号長の表が用いられる。この表中の各数値はJ
PEGにより推奨されたハフマンテーブルの各符号語の
符号長を示している。例えば、ラン長が1で、カテゴリ
が2である符号語の符号長は5である。
Next, the amount of data (the number of bits) in each scan is calculated with reference to the run length / category tables as shown in FIGS. For this calculation,
The code length table shown in is used. Each value in this table is J
The code length of each code word of the Huffman table recommended by PEG is shown. For example, the code length of a codeword having a run length of 1 and a category of 2 is 5.

【0062】スキャンAC1 については、図20と図2
4を参照して全ブロックにおけるラン長・カテゴリの符
号語のビット数は、 866 x 2 + 519 x 2 + 300 x 3 + 212 x 4 + 24 x 5 = 4638 となる。一方、付加ビットについては、カテゴリの数値
がそのままビット数に対応しているため、付加ビットの
ビット数は、 866 x 1 + 519 x 2+ 300 x 3 + 212 x 4 + 24 x 5 = 3772 となる。したがってスキャンAC1 の予想データ量は、 4638 + 3772 = 8410(ビット) である。
The scan AC 1 is shown in FIGS.
4, the number of bits of the codeword of the run length / category in all blocks is 866 x 2 + 519 x 2 + 300 x 3 + 212 x 4 + 24 x 5 = 4638. On the other hand, with regard to additional bits, the number of additional bits is 866 x 1 + 519 x 2 + 300 x 3 + 212 x 4 + 24 x 5 = 3772, as the number of the category corresponds directly to the number of bits. Become. Therefore, the expected data amount of scan AC 1 is 4638 + 3772 = 8410 (bits).

【0063】スキャンAC2 〜スキャンAC63について
も、スキャンAC1 と同様な計算によってデータ量が求
められる。
For scan AC 2 to scan AC 63 , the data amount is obtained by the same calculation as for scan AC 1 .

【0064】このようにして得られた各スキャンにおけ
るデータ量は、図13に示す設定符号量以下でなければ
ならない。例えば、スキャンAC1 については3300
8ビット以下に抑えられなければならない。上述の例で
は、実施例の説明のために量子化係数を「16」とした
ため、データ量は8410ビットであり設定符号量より
もかなり小さい。したがって実際には、量子化係数は
「16」よりも小さい数値が適当である。すなわち、量
子化係数が「1」である場合の予想データ量が3300
8ビットよりも大きければ、量子化係数を1だけ大きく
して予想データ量を計算し直し、このような操作を行い
ながら、設定符号量以下になるような量子化係数を求め
る。
The data amount in each scan thus obtained must be less than or equal to the set code amount shown in FIG. For example, for scan AC 1 3300
Must be kept below 8 bits. In the above example, since the quantization coefficient is set to "16" for the description of the embodiment, the data amount is 8410 bits, which is considerably smaller than the set code amount. Therefore, in practice, a value smaller than "16" is suitable for the quantization coefficient. That is, when the quantization coefficient is “1”, the expected data amount is 3300
If it is larger than 8 bits, the quantized coefficient is increased by 1 and the expected data amount is recalculated. While performing such an operation, the quantized coefficient that is equal to or less than the set code amount is obtained.

【0065】上述した量子化テーブルの生成を、図25
のフローチャートを用いて説明する。なお、このフロー
チャートはスキャンAC2 〜AC63に関する量子化係数
の生成を示しており、DC成分とスキャンAC1 の量子
化係数は既に求められているものとする。
The generation of the above quantization table is shown in FIG.
This will be described with reference to the flowchart of. Note that this flowchart shows the generation of the quantized coefficients for the scans AC 2 to AC 63 , and it is assumed that the DC component and the quantized coefficient of the scan AC 1 have already been obtained.

【0066】ステップ101では、パラメータiが2に
定められる。ステップ102では、量子化係数qが初期
値として1に定められる。
In step 101, the parameter i is set to 2. In step 102, the quantization coefficient q is set to 1 as an initial value.

【0067】ステップ103では、図14を用いて、図
15に示すようなスキャンACi のカテゴリ分布が生成
される。例えば、パラメータiが3であり量子化係数q
が16である時、このカテゴリ分布は、図15に示す例
では、 4366, 675, 220, 121, 18, 0, 0, 0, 0, 0, 0 である。
In step 103, the category distribution of the scan AC i as shown in FIG. 15 is generated using FIG. For example, the parameter i is 3 and the quantization coefficient q
Is 16, this category distribution is 4366, 675, 220, 121, 18, 0, 0, 0, 0, 0, 0 in the example shown in FIG.

【0068】なおステップ103が実行される前に、符
号P11で示すように、スキャンACi-1 のカテゴリ
「0」のブロック数が求められている。例えばパラメー
タiが3であり、スキャンAC2 の量子化係数qが16
であった場合、スキャンAC2のカテゴリ「0」のブロ
ック数は図15の例では3619である。また、符号P
12で示すように、スキャンACi-1 のカテゴリ「0」
のブロック数の分布が求められている。例えばパラメー
タiが3であり、スキャンAC2 の量子化係数qが16
であった場合、スキャンAC2 における図17の例で
は、ブロック数Z〔2〕は2332、ブロック数Z
〔1〕は1287、ブロック数Z
Before the step 103 is executed, the number of blocks in the category "0" of the scan AC i-1 is obtained, as indicated by the symbol P11. For example, the parameter i is 3 and the quantization coefficient q of the scan AC 2 is 16
, The number of blocks of category “0” of scan AC 2 is 3619 in the example of FIG. In addition, the symbol P
As shown in 12, the category of scan AC i-1 is “0”.
The distribution of the number of blocks of is required. For example, the parameter i is 3 and the quantization coefficient q of the scan AC 2 is 16
17 in the scan AC 2 , the number of blocks Z [2] is 2332, and the number of blocks Z is Z32.
[1] is 1287, the number of blocks is Z

〔0〕は1781であ
る。
[0] is 1781.

【0069】ステップ104では、ステップ103にお
いて求められたスキャンACi のカテゴリ分布と、スキ
ャンACi-1 のカテゴリ「0」のブロック数(符号P1
1)と、スキャンACi-1 のカテゴリ「0」のブロック
数の分布(符号P12)とに基づいて、スキャンACi
におけるカテゴリ「0」のブロック数の分布が予測され
る。例えばパラメータiが3であり、量子化係数qが1
6である時、スキャンAC3 における図18の例では、
図15と図17のデータに基づいて、ブロック数Z
〔3〕は1885、ブロック数Z〔2〕は1041、ブ
ロック数Z〔1〕は1440である。
[0069] At step 104, the category distribution of the scan AC i determined at step 103, the scan AC i-1 category number of blocks "0" (code P1
1) and the distribution of the number of blocks of category “0” of scan AC i−1 (reference P12), based on the scan AC i
The distribution of the number of blocks of category “0” in is predicted. For example, the parameter i is 3 and the quantization coefficient q is 1.
6, when the scan AC 3 in the example of FIG.
Based on the data of FIG. 15 and FIG. 17, the number of blocks Z
[3] is 1885, the number of blocks Z [2] is 1041, and the number of blocks Z [1] is 1440.

【0070】ステップ105では、スキャンACi にお
ける圧縮データの予測データ量が求められる。例えばパ
ラメータiが3であり、量子化係数qが16である時、
スキャンAC3 における予測データ量Di は、図22の
ラン長・カテゴリの表と図24の符号長の表とから、 223 x 2 + 73 x 2 + 40 x 3 + 6 x 4+ 161 x 4 + 52 x
5 + 29 x 7 + 4 x 9+ 291 x 5 + 95 x 8 + 52 x 10 + 8
x 12+ (223 + 161 + 291) + (73 + 52 + 95) x 2+ (40
+ 29 + 52) x 3 + (6 + 4 + 8) x 4= 6260(ビット) となる。
At step 105, the predicted data amount of the compressed data in the scan AC i is obtained. For example, when the parameter i is 3 and the quantization coefficient q is 16,
The predicted data amount D i in the scan AC 3 is 223 x 2 + 73 x 2 + 40 x 3 + 6 x 4 + 161 x 4 from the run length / category table of FIG. 22 and the code length table of FIG. + 52 x
5 + 29 x 7 + 4 x 9+ 291 x 5 + 95 x 8 + 52 x 10 + 8
x 12+ (223 + 161 + 291) + (73 + 52 + 95) x 2+ (40
+ 29 + 52) x 3 + (6 + 4 + 8) x 4 = 6260 (bits).

【0071】ステップ106では、ステップ105にお
いて計算された予測データ量Di が図13に示すような
設定符号量Si であるか否かが判定される。上述したス
テップ105の説明の例の場合、量子化係数qを16と
したため予測データ量Di は6260ビットとなり、図
13の設定符号量S3 =24042(符号SB3)より
もかなり小さい。しかし実際には、量子化係数qが1で
ある場合から始めるため、最初のうちは予測データ量D
i は設定符号量Si よりも大きい。したがって、ステッ
プ107において量子化係数qがまだ255に達してい
ないことが確認された後、ステップ108において量子
化係数qが1だけインクリメントされ、再びステップ1
03に戻る。
At step 106, it is judged if the predicted data amount D i calculated at step 105 is the set code amount S i as shown in FIG. In the example of the explanation of step 105 described above, since the quantization coefficient q is 16, the predicted data amount D i is 6260 bits, which is considerably smaller than the set code amount S 3 = 24042 (code SB3) in FIG. However, in reality, since the quantized coefficient q starts from 1, the predicted data amount D is initially set.
i is larger than the set code amount S i . Therefore, after it is confirmed in step 107 that the quantized coefficient q has not reached 255, the quantized coefficient q is incremented by 1 in step 108, and the step 1 is repeated.
Return to 03.

【0072】そしてステップ103〜105が再び実行
され、ステップ106において予測データ量Di が設定
符号量Si 以下であると判定されると、これにより量子
化係数qが確定する。すなわち、ステップ106からス
テップ110へ進み、パラメータiが63に達したか否
かが判定される。パラメータiが63に達していない
時、ステップ111において次のスキャンに関する設定
符号量Si+1 が設定符号量Si と予測データ量Di の差
だけ加算される。すなわち、次のスキャンの設定符号量
i+1 は、前のスキャン設定符号量Si において用いら
れなかった分が割り当てられる。
Then, steps 103 to 105 are executed again, and when it is determined in step 106 that the predicted data amount D i is less than or equal to the set code amount S i , the quantization coefficient q is fixed. That is, the routine proceeds from step 106 to step 110, and it is judged whether or not the parameter i has reached 63. When the parameter i has not reached 63, in step 111, the set code amount S i + 1 for the next scan is added by the difference between the set code amount S i and the predicted data amount D i . That is, the set code amount S i + 1 for the next scan is allocated to the amount not used in the previous scan set code amount S i .

【0073】次いでステップ112では、パラメータi
が1だけインクリメントされ、ステップ102へ戻り、
次のスキャンについてステップ102〜108が実行さ
れて量子化係数が求められる。
Next, at step 112, the parameter i
Is incremented by 1 and the process returns to step 102,
Steps 102 to 108 are executed for the next scan to obtain the quantized coefficient.

【0074】ステップ110においてパラメータiが6
3に達していると判定されると、ステップ113に進
み、量子化係数qに基づいて量子化係数が生成され、こ
のプログラムは終了する。
In step 110, the parameter i is 6
When it is determined that the number has reached 3, the process proceeds to step 113, a quantized coefficient is generated based on the quantized coefficient q, and this program ends.

【0075】図16〜図23を参照して説明した、各ス
キャンACi のデータ量の第1の予測方法は、比較的簡
単な例であって、必ずしも高精度な予測であるとは言え
ない。そこで次に、さらに高精度な第2の予測方法につ
いて、図26〜図28を参照して説明する。
The first method of predicting the data amount of each scan AC i described with reference to FIGS. 16 to 23 is a relatively simple example, and is not necessarily a highly accurate prediction. . Therefore, next, a more highly accurate second prediction method will be described with reference to FIGS. 26 to 28.

【0076】図26は「00」データの分布、すなわち
スキャンACi-1 とスキャンACiとが共にカテゴリ
「0」であるブロック数を示し、図14のカテゴリ分布
の表に対応している。例えば、スキャンAC1 、AC2
が共にカテゴリ「0」のブロック数は120(符号
12)、スキャンAC2 、AC3 が共にカテゴリ「0」
のブロック数は159(符号J23)、スキャンAC3
AC4 が共にカテゴリ「0」のブロック数は186(符
号J34)、スキャンAC62、AC63が共にカテゴリ
「0」のブロック数は327(符号J6263)である。
FIG. 26 shows the distribution of "00" data, that is, the number of blocks in which both scan AC i-1 and scan AC i are in category "0", and corresponds to the category distribution table of FIG. For example, scan AC 1 , AC 2
, The number of blocks in the category “0” is 120 (reference J 12 ), and the scans AC 2 and AC 3 are both in the category “0”.
Block number is 159 (reference numeral J 23 ), scan AC 3 ,
The number of blocks of category "0" for both AC 4 is 186 (reference J 34 ), and the number of blocks of category "0" for both scans AC 62 and AC 63 is 327 (reference J 6263 ).

【0077】スキャンACi-1 、ACi がそれぞれカテ
ゴリ「0」であるブロック数が変化すると、スキャンA
i-1 、ACi が共にカテゴリ「0」であるブロック数
はスキャンACi-1 のブロック数の変化率とスキャンA
i の変化率との積に比例すると仮定する。例えば、ス
キャンACi-1 、ACi のブロック数が共に2倍になっ
たとすると、スキャンACi-1 、ACi が共にカテゴリ
「0」であるブロック数は4倍になる。このような仮定
の下に、スキャンACi-1 とACi のカテゴリ「0」の
ブロック数に基づいて、量子化後のスキャンACi-1
量子化後のスキャンACi が共にカテゴリ「0」のブロ
ック数を予測する。
If the number of blocks in which the scans AC i-1 and AC i are in the category "0" respectively changes, scan A
The number of blocks in which both C i-1 and AC i are in the category “0” is the change rate of the number of blocks in scan AC i-1 and scan A.
It is assumed to be proportional to the product of C i and the rate of change. For example, if the number of blocks of the scans AC i−1 and AC i is doubled, the number of blocks of which the scans AC i−1 and AC i are both “0” is quadrupled. Under this assumption, based on the number of blocks of category "0" Scan AC i-1 and AC i, Scan AC i-1 after quantization,
The quantized scans AC i both predict the number of blocks of category “0”.

【0078】「00」データの分布は、ブロック数の基
準値を3500とすることによって正規化され、メモリ
に格納される。例えば、スキャンAC1 、AC2 が共に
カテゴリ「0」であるブロック数は、正規化によって、
図27に示すように3823に変換される。図28は、
正規化された「00」データの分布の表を示し、例え
ば、スキャンAC1 、AC2 の「00」データは382
3(符号K12)、スキャンAC2 、AC3 の「00」デ
ータは3577(符号K23)、スキャンAC3 、AC4
の「00」データは3280(符号K34)、スキャンA
62、AC63の「00」データは2262(符号KJ
6263)である。
The distribution of "00" data is normalized by setting the reference value of the number of blocks to 3500 and stored in the memory. For example, the number of blocks whose scans AC 1 and AC 2 are both in the category “0” is
It is converted to 3823 as shown in FIG. FIG. 28 shows
The table of the distribution of the normalized “00” data is shown. For example, the “00” data of the scan AC 1 and AC 2 is 382.
3 (reference K 12 ), scan AC 2 and AC 3 of “00” data is 3577 (reference K 23 ), scan AC 3 and AC 4
"00" data is 3280 (symbol K 34), scan A
The data of “00” of C 62 and AC 63 is 2262 (code KJ
6263 ).

【0079】図29は、カテゴリ「0」であるスキャン
ACi-1 のブロック数を横軸に、またスキャンA
i-1 、ACi が共にカテゴリ「0」であるブロック数
(すなわち「00」データ)を縦軸にとったグラフであ
る。このグラフにおいて、横座標の最大値は全ブロック
数(5400)であり、Slow は上述した基準値350
0、Smid は例えば4800、Shighは例えば5150
である。縦座標の最大値Omax は可変であり、最大値O
max が基準値3500である時、Ohighは例えば340
3、Omid は例えば3144、Olow は例えば2463
である。折れ点f、g、hは、再生画像の画質が原画像
に近くなるように、例えば試行錯誤によって求められる
が、折れ点bは、次に述べるようにスキャンACi-1
ACi のカテゴリ「0」のブロック数に応じて変化す
る。
In FIG. 29, the number of blocks of the scan AC i-1 of category "0" is plotted on the horizontal axis, and scan A
6 is a graph in which the vertical axis represents the number of blocks (that is, “00” data) in which both C i−1 and AC i are of category “0”. In this graph, the maximum value of the abscissa is the total number of blocks (5400), and S low is the reference value 350 described above.
0, S mid is 4800, S high is 5150, for example.
Is. The maximum value O max of the ordinate is variable, and the maximum value O max
When max is the reference value 3500, O high is 340, for example.
3, O mid is 3144, O low is 2463, for example.
Is. The break points f, g, and h are obtained by trial and error, for example, so that the quality of the reproduced image is close to that of the original image, but the break point b is scanned AC i−1 , as described below.
It changes according to the number of blocks of the category "0" of AC i .

【0080】折れ点bの求め方を、図15の場合を例に
とり説明する。例えば、スキャンAC3 のカテゴリ
「0」のブロック数は4366であり、スキャンAC4
のカテゴリ「0」のブロック数は4108である。
The method of obtaining the bending point b will be described by taking the case of FIG. 15 as an example. For example, the number of blocks of category “0” of scan AC 3 is 4366, and the number of blocks of scan AC 4 is
The number of blocks in the category “0” is 4108.

【0081】まず図28の表を参照し、スキャンA
3 、AC4 の「00」データとして、K34=3280
が得られる。次に、図29において、最大値Omax を基
準値3500に定めた状態で、Slow (3500)に対
応する縦座標を読むと、点cが得られる。原点aと点c
を結んだ直線L1と、Olow から横方向に延びる直線L
2との交点bを求めると、折れ線abfghが得られ
る。
First, referring to the table of FIG. 28, scan A
As C 3 and AC 4 “00” data, K 34 = 3280
Is obtained. Next, in FIG. 29, when the ordinate corresponding to S low (3500) is read in the state where the maximum value O max is set to the reference value 3500, the point c is obtained. Origin a and point c
A straight line L1 connecting the two and a straight line L extending laterally from O low
When the intersection b with 2 is obtained, a polygonal line abfgh is obtained.

【0082】次に、縦座標の最大値Omax をスキャンA
4 のブロック数4108に合わせると、Ohighは39
94、Omid は3690、Olow は2891となる。こ
の状態で、横座標においてスキャンAC3 のブロック数
4366に対応する折れ線bf上の点P3の縦座標を読
むと、3530がスキャンAC3 、AC4 の「00」デ
ータとして得られる。この数値は、図19においてZ
〔2〕とZ〔3〕とZ〔4〕の和(=3321)に相当
し、図19の例よりも大きい。すなわち第2の予測方法
によれば、スキャンAC3 、AC4 の「00」データは
第1の予測方法の場合よりも多い。
Next, the maximum value O max of the ordinate is scanned for scan A.
If the number of blocks in C 4 is 4,108, O high is 39.
94, O mid is 3690, and O low is 2891. In this state, when the ordinate of the point P3 on the polygonal line bf corresponding to the block number 4366 of the scan AC 3 in the abscissa is read, 3530 is obtained as “00” data of the scan AC 3 and AC 4 . This value is Z in FIG.
This corresponds to the sum of [2], Z [3], and Z [4] (= 3321), which is larger than the example of FIG. That is, according to the second prediction method, the number of “00” data of scans AC 3 and AC 4 is larger than that in the case of the first prediction method.

【0083】このようにして得られた「00」データ
は、次に述べる方法によって、Z〔2〕とZ〔3〕とZ
〔4〕に分配される。
The "00" data obtained in this way is converted into Z [2], Z [3] and Z by the method described below.
It is distributed to [4].

【0084】この分配のためには、図18に示すような
スキャンAC2 、AC3 の「00」データに関するZ
〔1〕、Z〔2〕、Z〔3〕の値が必要であり、また、
これらのZ〔1〕、Z〔2〕、Z〔3〕を求めるために
は、図17に示すようなスキャンAC1 、AC2 の「0
0」データに関するZ〔1〕、Z〔2〕の値が必要であ
る。
For this distribution, Z relating to "00" data of scans AC 2 and AC 3 as shown in FIG.
The values of [1], Z [2], Z [3] are required, and
In order to obtain these Z [1], Z [2], and Z [3], the scan AC 1 and AC 2 shown in FIG.
The values of Z [1] and Z [2] for "0" data are required.

【0085】スキャンAC1 、AC2 のZ〔1〕、Z
〔2〕は、図29と同様にして折れ線abfghを作成
し、この折れ線上の点を読むことによって求められる。
Z〔2〕は折れ線から直接求められ、Z〔1〕はC
Scan AC 1 , AC 2 Z [1], Z
[2] is obtained by creating a polygonal line abfgh in the same manner as in FIG. 29 and reading the points on this polygonal line.
Z [2] is calculated directly from the polygonal line, Z [1] is C

〔0〕とZ〔2〕の差として求められる。スキャンAC
2 、AC3 に関しては、Z〔2〕とZ〔3〕の和が、折
れ線abfghを作成してこの折れ線上の点を読むこと
によって求められ、Z〔1〕は、Z〔2〕とZ〔3〕の
和をC
It is obtained as the difference between [0] and Z [2]. Scan ac
2 and AC 3 , the sum of Z [2] and Z [3] is obtained by creating a polygonal line abfgh and reading the point on this polygonal line. Z [1] is the same as Z [2] and Z [2]. The sum of [3] is C

〔0〕から引くことにより求められる。Z〔2〕
とZ〔3〕の各値は、スキャンAC1 、AC2 のZ
〔1〕、Z〔2〕の比に従って分配される。すなわち、
スキャンAC2 、AC3 に関するZ〔1〕、Z〔2〕、
Z〔3〕の各値が得られる。
It is obtained by subtracting from [0]. Z [2]
And the values of Z [3] are Z of scan AC 1 , AC 2 .
It is distributed according to the ratio of [1] and Z [2]. That is,
Z [1], Z [2], for scan AC 2 , AC 3
Each value of Z [3] is obtained.

【0086】同様にして、スキャンAC3 、AC4 のZ
〔2〕、Z〔3〕、Z〔4〕の各値は、スキャンA
2 、AC3 のZ〔1〕、Z〔2〕、Z〔3〕の比に従
って分配される。これにより、図23に示すようなラン
長・カテゴリの表が得られ、スキャンAC4 における圧
縮データの予測データ量が計算される。他のスキャンに
ついても同様な計算が行われ、予測データ量が求められ
る。
Similarly, Z of scan AC 3 and scan AC 4
The values of [2], Z [3], and Z [4] are for the scan A
C 2 and AC 3 are distributed according to the ratio of Z [1], Z [2], Z [3]. As a result, a run length / category table as shown in FIG. 23 is obtained, and the predicted data amount of compressed data in scan AC 4 is calculated. Similar calculations are performed for other scans to obtain the predicted data amount.

【0087】次にスキャンACi のデータ量の第3の予
測方法について説明する。スキャンACi-1 においてラ
ン長がkであるブロック数をZ〔k〕、スキャンAC
i-1 におけるカテゴリ「0」である全ブロック数をZ
ALL 、スキャンACi-1 においてカテゴリ「0」であ
り、かつスキャンACi においてカテゴリ「j」である
ブロック数をCTj とする。また修正係数をZWとす
る。
Next, the third prediction method of the data amount of the scan AC i will be described. In scan AC i-1 , the number of blocks with run length k is Z [k], scan AC
Let Z be the total number of blocks that are in category "0" in i-1 .
Let ALL be CT j be the number of blocks that are in category “0” in scan AC i−1 and in category “j” in scan AC i . Further, the correction coefficient is ZW.

【0088】スキャンACi におけるラン長がkでカテ
ゴリがjであるブロック数B〔k,j〕は、 B〔k,j〕=CTj × Z〔k〕/ZALL +(1−CTj /ZALL )×Z〔k〕×ZW/1000 (1) により求められる。スキャンACi におけるラン長が
(k+1)であるブロック数Z〔k+1〕(すなわちラ
ン長がkでカテゴリが0であるブロック数)は、 Z〔k+1〕=CT0 × Z〔k〕/ZALL +(1−CT0 /ZALL )×Z〔k〕×ZW/1000 (2) により求められる。
The number of blocks B [k, j] having a run length k and a category j in scan AC i is B [k, j] = CT j × Z [k] / Z ALL + (1-CT j / Z ALL ) × Z [k] × ZW / 1000 (1) The number of blocks Z [k + 1] whose run length is (k + 1) in the scan AC i (that is, the number of blocks whose run length is k and whose category is 0) is: Z [k + 1] = CT 0 × Z [k] / Z ALL + (1-CT 0 / Z ALL ) × Z [k] × ZW / 1000 (2)

【0089】修正係数ZWは、0から1000までの値
をとりうる。例えばZW=0のとき、 Z〔k+1〕=CTj × Z〔k〕/ZALL となり、これは第2の予測方法と同じ結果になる。ZW
=1000とすると、 Z〔k+1〕=Z〔k〕 となり、これは、スキャンACi-1 のラン長kのブロッ
クが、スキャンACi において全てカテゴリ「0」とな
ることを示している。以下に説明する例では、ZW=5
0としている。
The correction coefficient ZW can take a value from 0 to 1000. For example, when ZW = 0, Z [k + 1] = CT j × Z [k] / Z ALL , which has the same result as the second prediction method. ZW
= 1000, Z [k + 1] = Z [k], which means that all the blocks of the scan AC i−1 having the run length k are in the category “0” in the scan AC i . In the example described below, ZW = 5
It is set to 0.

【0090】ここで、スキャンAC3 において、Z
Here, in scan AC 3 , Z

〔0〕=1034、Z〔1〕=1440、Z〔2〕=1
041、Z〔3〕=1885であり、またスキャンAC
4 におけるカテゴリ分布として、図30のような表が得
られているとする。すなわち、スキャンAC3 がカテゴ
リ「0」である4366ブロックにおいて、スキャンA
4 では、カテゴリ「0」のブロック数CT0 は332
1、カテゴリ「1」のブロック数CT1 は655、カテ
ゴリ「2」のブロック数CT2 は276、カテゴリ
「3」のブロック数CT3 は101、カテゴリ「4」の
ブロック数CT4 は13、カテゴリ「5」以上のブロッ
ク数は0であるとする。
[0] = 1034, Z [1] = 1440, Z [2] = 1
041, Z [3] = 1888, and scan AC
It is assumed that a table as shown in FIG. 30 is obtained as the category distribution in 4 . That is, in scan 4366 block in which scan AC 3 is category “0”, scan A
In C 4 , the number of blocks CT 0 of the category “0” is 332
1, the block number CT 1 of the category “1” is 655, the block number CT 2 of the category “2” is 276, the block number CT 3 of the category “3” is 101, the block number CT 4 of the category “4” is 13, It is assumed that the number of blocks in the category “5” and above is 0.

【0091】次に述べるように、ラン長が1であるデー
タからブロック数が求められ、図31に示すようなラン
長・カテゴリの分布表が求められる。
As described below, the number of blocks is obtained from the data having a run length of 1, and the run length / category distribution table as shown in FIG. 31 is obtained.

【0092】スキャンAC4 において、ラン長が1であ
り、かつカテゴリ「1」であるブロック数は、(1)式
より、 B〔1,1〕=CT1 ×Z〔1〕/ZALL+(1−CT
1 /ZALL )×Z〔1〕×ZW/1000=655 x 1440/436
6 + ( 1 - 655/4366 ) x 1440 x 50/1000= 216 + 61 =
277 となる。同様に、ラン長が1であり、かつカテゴリ
「2」であるブロック数は、(1)式より、 B〔1,2〕=CT2 ×Z〔1〕/ZALL+(1−CT
2 /ZALL )×Z〔1〕×ZW/1000=91 + 67 = 158 となる。
In scan AC 4 , the number of blocks having a run length of 1 and a category of “1” can be calculated from the equation (1) as follows: B [1,1] = CT 1 × Z [1] / Z ALL + (1-CT
1 / Z ALL ) × Z [1] × ZW / 1000 = 655 x 1440/436
6 + (1-655/4366) x 1440 x 50/1000 = 216 + 61 =
It becomes 277. Similarly, the number of blocks having a run length of 1 and a category “2” can be calculated from the equation (1) as follows: B [1,2] = CT 2 × Z [1] / Z ALL + (1-CT
2 / Z ALL ) × Z [1] × ZW / 1000 = 91 + 67 = 158.

【0093】ラン長が1であり、かつカテゴリ「3」で
あるブロック数については、(1)式より、 B〔1,3〕=CT3 ×Z〔1〕/ZALL+(1−CT
3 /ZALL )×Z〔1〕×ZW/1000=33 + 71 = 104 となるが、図30に示されるようにCT3 =C〔3〕=
101である。したがって、104ではなく、強制的に
101に定められる。
Regarding the number of blocks having a run length of 1 and a category of “3”, from the equation (1), B [1,3] = CT 3 × Z [1] / Z ALL + (1-CT
3 / Z ALL ) × Z [1] × ZW / 1000 = 33 + 71 = 104, but as shown in FIG. 30, CT 3 = C [3] =
101. Therefore, it is forcibly set to 101 instead of 104.

【0094】ラン長が1であり、かつカテゴリ「4」で
あるブロック数についても同様に、B〔1,4〕は強制
的に13に定められる。
Similarly, B [1,4] is forcibly set to 13 for the number of blocks having a run length of 1 and a category of "4".

【0095】スキャンAC4 においてラン長が2である
ブロック数Z〔2〕(すなわちラン長が1であり、かつ
カテゴリが0であるブロック数)は、 Z〔2〕=Z〔1〕−(277 + 158 + 101 + 13) = 89
1 となる。
In scan AC 4 , the number of blocks Z [2] having a run length of 2 (that is, the number of blocks having a run length of 1 and a category of 0) is Z [2] = Z [1]-( 277 + 158 + 101 + 13) = 89
Becomes 1.

【0096】ラン長が2であり、かつカテゴリ「1」で
あるブロック数については、 B〔2,1〕=CT1 ×Z〔2〕/ZALL+(1−CT
1 /ZALL )×Z〔2〕×ZW/1000=655 x 1041/436
6 + ( 1 - 655/4366 ) x 1041 x 50/1000= 156 + 44 =
200 となる。ラン長が2であり、かつカテゴリ「2」である
ブロック数については、 B〔2,2〕= 66 + 49 = 115 となる。
Regarding the number of blocks having a run length of 2 and a category of "1", B [2,1] = CT 1 × Z [2] / Z ALL + (1-CT
1 / Z ALL ) × Z [2] × ZW / 1000 = 655 x 1041/436
6 + (1-655/4366) x 1041 x 50/1000 = 156 + 44 =
It will be 200. For the number of blocks with run length 2 and category “2”, B [2,2] = 66 + 49 = 115.

【0097】ラン長が2であり、かつカテゴリ「3」で
あるブロック数B〔2,3〕は、B〔1,3〕の結果に
従って0であり、またラン長が2であり、かつカテゴリ
「4」であるブロック数B〔2,4〕は、B〔1,4〕
の結果に従って0である。
The number of blocks B [2,3] whose run length is 2 and category "3" is 0 according to the result of B [1,3], and whose run length is 2 and category The number of blocks B [2,4] that is "4" is B [1,4]
It is 0 according to the result of.

【0098】スキャンAC4 においてラン長が3である
ブロック数Z〔3〕(すなわちラン長が2であり、かつ
カテゴリが0であるブロック数)は、 Z〔3〕=Z〔2〕−(200 + 115 + 0 + 0)= 726 となる。
In scan AC 4 , the number of blocks Z [3] having a run length of 3 (that is, the number of blocks having a run length of 2 and a category of 0) is Z [3] = Z [2]-( 200 + 115 + 0 + 0) = 726.

【0099】ラン長が3であり、かつカテゴリ「1」で
あるブロック数については、 B〔3,1〕=CT1 ×Z〔3〕/ZALL+(1−CT
1 /ZALL )×Z〔3〕×ZW/1000=655 x 1885/436
6 + ( 1 - 655/4366 ) x 1885 x 50/1000= 283 + 80 =
363 となる。しかし、カテゴリ「1」であるブロック数CT
1 の総数が655であるため、 B〔3,1〕= 655 - 277 - 200= 178 となる。
For the number of blocks having a run length of 3 and a category "1", B [3,1] = CT 1 × Z [3] / Z ALL + (1-CT
1 / Z ALL ) × Z [3] × ZW / 1000 = 655 x 1885/436
6 + (1-655/4366) x 1885 x 50/1000 = 283 + 80 =
It becomes 363. However, the number of blocks CT in the category "1"
Since the total number of 1s is 655, B [3,1] = 655−277−200 = 178.

【0100】ラン長が3であり、かつカテゴリ「2」で
あるブロック数については、 B〔3,2〕=CT2 ×Z〔3〕/ZALL+(1−CT
2 /ZALL )×Z〔3〕×ZW/1000=119 + 88 = 207 となる。しかし、カテゴリ「2」であるブロック数CT
2 の総数が276であるため、 B〔3,2〕= 276 - 158 - 115= 3 となる。
For the number of blocks having a run length of 3 and a category "2", B [3,2] = CT 2 × Z [3] / Z ALL + (1-CT
2 / Z ALL ) × Z [3] × ZW / 1000 = 119 + 88 = 207. However, the number of blocks CT in the category “2”
Since the total number of 2 is 276, B [3,2] = 276−158−115 = 3.

【0101】ラン長が3であり、かつカテゴリ「3」で
あるブロック数は、B〔1,3〕、B〔2,3〕の結果
に従って0であり、またラン長が3であり、かつカテゴ
リ「4」であるブロック数は、B〔1,4〕、B〔2,
4〕の結果に従って0である。
The number of blocks having a run length of 3 and category "3" is 0 according to the results of B [1,3] and B [2,3], and the run length is 3 and The number of blocks in the category “4” is B [1,4], B [2,
It is 0 according to the result of [4].

【0102】スキャンAC4 においてラン長が4である
ブロック数Z〔4〕(すなわちラン長が3であり、かつ
カテゴリが0であるブロック数)は、 Z〔4〕=Z〔3〕−(178 + 3 + 0 + 0)= 1704 となる。
The number of blocks Z [4] having a run length of 4 in scan AC 4 (that is, the number of blocks having a run length of 3 and a category of 0) is Z [4] = Z [3]-( 178 + 3 + 0 + 0) = 1704.

【0103】ラン長が0であるブロック数において、カ
テゴリ「1」〜「4」のブロック数は、図30より、1
55、65、24、3となる。また、ラン長が1である
ブロック数Z〔1〕(すなわちラン長が0であり、かつ
カテゴリが0であるブロック数)は、図30より、 Z〔1〕=787 となる。
With respect to the number of blocks having a run length of 0, the number of blocks of categories "1" to "4" is 1 according to FIG.
55, 65, 24, and 3. Further, the number of blocks Z [1] having a run length of 1 (that is, the number of blocks having a run length of 0 and a category of 0) is Z [1] = 787 from FIG.

【0104】図32は、このようにして求められたラン
長・カテゴリの分布の表であり、第1の予測方法におけ
る図23に対応している。また図31に示されるよう
に、ラン長が4であるブロック数(ラン長が3であり、
かつカテゴリが0であるブロック数)は1704であ
り、これは第1の予測方法において得られたZ〔4〕=
1434よりも大きくなっている。すなわち第3の予測
方法によれば、ラン長が伸びることが理解される。
FIG. 32 is a table of run length / category distributions thus obtained, and corresponds to FIG. 23 in the first prediction method. Further, as shown in FIG. 31, the number of blocks having a run length of 4 (run length is 3,
And the number of blocks whose category is 0) is 1704, which is obtained by the first prediction method Z [4] =
It is larger than 1434. That is, it is understood that the run length is extended according to the third prediction method.

【0105】次に、図30に示されるようなカテゴリ分
布表において、スキャンACi-1 のカテゴリが「0」
で、かつスキャンACi のカテゴリが「1」以上のブロ
ック数を図29の折れ線abfghを用いて求める方法
を説明する。
Next, in the category distribution table as shown in FIG. 30, the category of scan AC i-1 is "0".
In addition, a method of obtaining the number of blocks whose scan AC i category is “1” or more using the polygonal line abfgh in FIG. 29 will be described.

【0106】この場合、図29において横軸はスキャン
ACi-1 のカテゴリ「0」のブロック数を示し、縦軸は
スキャンACi におけるカテゴリ「0」とカテゴリ
「1」のブロック数の和を示す。まず、縦軸のOmax
In this case, in FIG. 29, the horizontal axis represents the number of blocks of category “0” in scan AC i−1 , and the vertical axis represents the sum of the number of blocks of category “0” and category “1” in scan AC i . Show. First, let O max on the vertical axis be C

〔0〕とC〔1〕の和(=4108+810=491
8)に定め、これに伴いOhigh、Omid 、Olow を求め
る。次に、横座標の4366に対応した折れ線上の点
(例えばP3)を読み、この点に対応した縦座標を読む
と、この値はスキャンAC4 におけるカテゴリ「0」と
カテゴリ「1」のブロック数の和である。したがって、
この和から、既に求められているカテゴリ「0」の値を
引けば、スキャンACi-1 のカテゴリが「0」でかつス
キャンACi のカテゴリが「1」のブロック数が求めら
れる。以下、同様にして、スキャンACi-1 のカテゴリ
が「0」でかつスキャンACi のカテゴリが「2」以上
のブロック数が求められる。
Sum of [0] and C [1] (= 4108 + 810 = 491
8), and O high , O mid , and O low are calculated accordingly. Next, when a point (for example, P3) on the polygonal line corresponding to the abscissa 4366 is read and the ordinate corresponding to this point is read, this value is a block of category “0” and category “1” in the scan AC 4 . It is the sum of numbers. Therefore,
By subtracting the value of the already obtained category "0" from this sum, the number of blocks with the category of scan AC i-1 being "0" and the category of scan AC i being "1" can be obtained. Thereafter, in the same manner, the number of blocks in which the category of scan AC i-1 is “0” and the category of scan AC i is “2” or more is obtained.

【0107】[0107]

【発明の効果】以上のように本発明によれば、個々の画
像の画質に応じた画像圧縮を達成することができるとい
う効果が得られる。
As described above, according to the present invention, it is possible to obtain the effect that image compression can be achieved according to the image quality of each image.

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

【図1】本発明の一実施例の画像圧縮装置を示すブロッ
ク図である。
FIG. 1 is a block diagram showing an image compression apparatus according to an embodiment of the present invention.

【図2】画像データP(Y)xy 、DCT変換係数S(Y)uv
、量子化DCT係数R(Y)uv 、量子化テーブルQ(Y)uv
の例を示す図である。
FIG. 2 is image data P (Y) xy, DCT conversion coefficient S (Y) uv.
, Quantized DCT coefficient R (Y) uv, quantization table Q (Y) uv
It is a figure which shows the example of.

【図3】DC係数の差分値のカテゴリを示す図である。FIG. 3 is a diagram showing categories of difference values of DC coefficients.

【図4】DC係数の符号化テーブルを示す図である。FIG. 4 is a diagram showing a coding table of DC coefficients.

【図5】量子化AC係数の符号化を行う処理ルーチンを
示すフローチャートである。
FIG. 5 is a flowchart showing a processing routine for encoding quantized AC coefficients.

【図6】AC係数をハフマン符号化する際に行われるジ
グザグスキャンを示す図である。
FIG. 6 is a diagram showing zigzag scanning performed when Huffman encoding AC coefficients.

【図7】AC係数のカテゴリを示す図である。FIG. 7 is a diagram showing categories of AC coefficients.

【図8】JPEGにより推奨されたハフマンテーブルを
示す図である。
FIG. 8 is a diagram showing a Huffman table recommended by JPEG.

【図9】ハフマン符号化による符号化データの一例を示
す図である。
FIG. 9 is a diagram showing an example of encoded data by Huffman encoding.

【図10】符号化データの構成要素を示す図である。FIG. 10 is a diagram showing constituent elements of encoded data.

【図11】全ての量子化係数が「1」である量子化テー
ブルを用いた時の所定の空間周波数でのカテゴリ分布の
例を示す図である。
FIG. 11 is a diagram showing an example of category distribution at a predetermined spatial frequency when a quantization table in which all the quantization coefficients are “1” is used.

【図12】全ての量子化係数が「1」である量子化テー
ブルを用いた時の、各スキャンにおける符号化データの
ビット数の分布の例を示す図である。
FIG. 12 is a diagram showing an example of the distribution of the number of bits of encoded data in each scan when a quantization table in which all the quantization coefficients are “1” is used.

【図13】空間周波数データ量設定部において設定され
る各空間周波数毎(すなわちスキャン毎)の符号量の分
布の例を示す図である。
FIG. 13 is a diagram showing an example of a distribution of code amounts for each spatial frequency (that is, for each scan) set in the spatial frequency data amount setting unit.

【図14】図11に示すカテゴリ分布を各スキャンにつ
いて同時に示す図である。
FIG. 14 is a diagram showing the category distribution shown in FIG. 11 simultaneously for each scan.

【図15】全ての量子化係数が「16」である量子化テ
ーブルを用いた時のカテゴリ分布の表を示す図である。
FIG. 15 is a diagram showing a category distribution table when a quantization table in which all the quantization coefficients are “16” is used.

【図16】スキャンAC1 のカテゴリ「0」のブロック
数と、カテゴリ「1」以上のブロック数を示す図であ
る。
FIG. 16 is a diagram showing the number of blocks of category “0” and the number of blocks of category “1” or more in scan AC 1 .

【図17】スキャンAC2 までのラン長が2、1、0で
あるブロック数を示す図である。
FIG. 17 is a diagram showing the number of blocks whose run lengths up to scan AC 2 are 2 , 1, 0;

【図18】スキャンAC3 までのラン長が3、2、1、
0であるブロック数を示す図である。
FIG. 18 shows run lengths up to scan AC 3 of 3, 2, 1,
It is a figure which shows the number of blocks which is 0.

【図19】スキャンAC4 までのラン長が4、3、2、
1、0であるブロック数を示す図である。
FIG. 19 shows run lengths up to scan AC 4 of 4, 3, 2,
It is a figure which shows the number of blocks which are 1 and 0.

【図20】スキャンAC1 のラン長・カテゴリの表を示
す図である。
FIG. 20 is a diagram showing a table of run lengths / categories of scan AC 1 .

【図21】スキャンAC2 のラン長・カテゴリの表を示
す図である。
FIG. 21 is a diagram showing a table of run lengths / categories of scan AC 2 .

【図22】スキャンAC3 のラン長・カテゴリの表を示
す図である。
FIG. 22 is a diagram showing a table of run lengths / categories of scan AC 3 ;

【図23】スキャンAC4 のラン長・カテゴリの表を示
す図である。
FIG. 23 is a diagram showing a table of run lengths / categories of scan AC 4 ;

【図24】JPEGにより推奨されたハフマンテーブル
の各符号語の符号長を示す図である。
FIG. 24 is a diagram showing the code length of each codeword of the Huffman table recommended by JPEG.

【図25】量子化テーブルを生成するプログラムのフロ
ーチャートである。
FIG. 25 is a flowchart of a program for generating a quantization table.

【図26】「00」データの分布を示す図である。FIG. 26 is a diagram showing a distribution of “00” data.

【図27】スキャンAC1 とスキャンAC2 の「00」
データの正規化を示す図である。
[FIG. 27] “00” of scan AC 1 and scan AC 2
It is a figure which shows the normalization of data.

【図28】正規化された「00」データの分布の表を示
す図である。
FIG. 28 is a diagram showing a table of distribution of normalized “00” data.

【図29】スキャンACi-1 のカテゴリ「0」のブロッ
ク数とスキャンACi-1 とスキャンACi の「00」デ
ータとの関係を示す図である。
FIG. 29 is a diagram showing the relationship between the "00" data of the number of blocks of scan AC i-1 of the category "0" and the scan AC i-1 and Scan AC i.

【図30】スキャンAC4 におけるカテゴリ分布の例を
示す図である。
FIG. 30 is a diagram showing an example of category distribution in scan AC 4 .

【図31】第3の予測方法によって得られたラン長・カ
テゴリの分布の例を示す図である。
FIG. 31 is a diagram showing an example of the distribution of run lengths / categories obtained by the third prediction method.

【図32】図31のラン長・カテゴリの分布の表を図2
3に対応した形式で表した図である。
FIG. 32 shows a table of distribution of run lengths / categories of FIG.
It is the figure expressed in the format corresponding to 3.

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

M ICメモリカード Mic memory card

Claims (9)

【特許請求の範囲】[Claims] 【請求項1】 原画像データに直交変換を施して空間周
波数毎に直交変換係数を求める直交変換手段と、 前記直交変換係数を所定の量子化係数から成る量子化テ
ーブルにより量子化して量子化直交変換係数を求める量
子化手段と、 前記量子化直交変換係数を空間周波数に関して所定の1
次元配列データに並びかえた後、前記量子化直交変換係
数に基づいて符号化を行って符号化データを求める符号
化手段と、 前記空間周波数毎に符号化データのデータ量の目標値を
設定する手段と、 第1の空間周波数の符号化データの統計量に基づいて第
2の空間周波数の符号化データのデータ量を予測する手
段と、 この予測された第2の空間周波数のデータ量が前記目標
値以下になるように、その空間周波数に対応した量子化
係数を定める量子化係数演算手段とを備えたことを特徴
とする画像圧縮装置。
1. An orthogonal transform means for performing an orthogonal transform on original image data to obtain an orthogonal transform coefficient for each spatial frequency, and an orthogonal transform coefficient which is quantized orthogonally by quantizing the orthogonal transform coefficient by a quantization table composed of predetermined quantization coefficients. Quantization means for obtaining a transform coefficient, and the quantized orthogonal transform coefficient having a predetermined 1 with respect to a spatial frequency.
After rearranging into the dimensional array data, encoding means for obtaining encoded data by performing encoding based on the quantized orthogonal transform coefficient, and a target value of the amount of encoded data for each spatial frequency are set. Means, means for predicting the data amount of the encoded data of the second spatial frequency based on the statistic of the encoded data of the first spatial frequency, and the predicted data amount of the second spatial frequency is An image compression apparatus, comprising: a quantization coefficient calculation unit that determines a quantization coefficient corresponding to the spatial frequency so as to be equal to or less than a target value.
【請求項2】 前記第2の空間周波数に対応した量子化
直交変換係数は、前記1次元配列データにおいて、前記
第1の空間周波数に対応した量子化直交変換係数に隣接
していることを特徴とする請求項1に記載の画像圧縮装
置。
2. The quantized orthogonal transform coefficient corresponding to the second spatial frequency is adjacent to the quantized orthogonal transform coefficient corresponding to the first spatial frequency in the one-dimensional array data. The image compression apparatus according to claim 1.
【請求項3】 前記符号化手段は、前記量子化直交変換
係数の値に基づいてこの量子化直交変換係数を、所定の
データ量を有するカテゴリに分類するとともに、0の量
子化直交変換係数が連続する数に基づいてラン長を求
め、 前記予測手段は、前記カテゴリとラン長に基づいて、前
記第2の空間周波数の符号化データのデータ量を予測す
ることを特徴とする請求項1に記載の画像圧縮装置。
3. The encoding means classifies the quantized orthogonal transform coefficient into a category having a predetermined data amount based on the value of the quantized orthogonal transform coefficient, and The run length is obtained based on a continuous number, and the predicting unit predicts the data amount of the encoded data of the second spatial frequency based on the category and the run length. The image compression device described.
【請求項4】 前記直交変換手段は、前記原画像データ
を複数のブロックに分割して直交変換係数を求め、 前記予測手段は、前記第2の空間周波数のデータ量を予
測する際、第1の空間周波数における、0の量子化直交
変換係数に対応するカテゴリ「0」のブロック数を用い
ることを特徴とする請求項3に記載の画像圧縮装置。
4. The orthogonal transform means divides the original image data into a plurality of blocks to obtain orthogonal transform coefficients, and the predicting means predicts a data amount of the second spatial frequency by using a first 4. The image compression apparatus according to claim 3, wherein the number of blocks of category "0" corresponding to a quantized orthogonal transform coefficient of 0 at the spatial frequency of is used.
【請求項5】 前記予測手段は、前記第1の空間周波数
におけるカテゴリ「0」のブロック数に基づいて、前記
第1および第2の空間周波数において共にカテゴリ
「0」であるブロック数を予測することを特徴とする請
求項4に記載の画像圧縮装置。
5. The predicting means predicts the number of blocks that are both category “0” in the first and second spatial frequencies based on the number of blocks in category “0” in the first spatial frequency. The image compression apparatus according to claim 4, wherein
【請求項6】 前記予測手段は、前記第1の空間周波数
におけるカテゴリ「0」のブロック数に基づいて、前記
第1の空間周波数におけるカテゴリ「0」であり、かつ
前記第2の空間周波数におけるカテゴリ「j」(jは正
の整数)であるブロック数を予測することを特徴とする
請求項4に記載の画像圧縮装置。
6. The predicting means is a category “0” in the first spatial frequency and a category “0” in the second spatial frequency based on the number of blocks in the category “0” in the first spatial frequency. The image compression apparatus according to claim 4, which predicts the number of blocks of category "j" (j is a positive integer).
【請求項7】 前記直交変換手段は、前記原画像データ
を複数のブロックに分割して直交変換係数を求め、 前記予測手段は、量子化係数「1」を用いた時におけ
る、前記第1および第2の空間周波数が共にカテゴリ
「0」であるブロック数を示すカテゴリ分布表に基づい
て、所定の量子化係数を用いた時における、前記第1お
よび第2の空間周波数が共にカテゴリ「0」であるブロ
ック数を予測することを特徴とする請求項4に記載の画
像圧縮装置。
7. The orthogonal transforming unit divides the original image data into a plurality of blocks to obtain an orthogonal transform coefficient, and the predicting unit uses the quantized coefficient “1” for the first and second transforms. Based on a category distribution table indicating the number of blocks in which the second spatial frequencies are both category "0", both the first and second spatial frequencies when using a predetermined quantization coefficient are category "0". The image compression apparatus according to claim 4, which predicts the number of blocks that are
【請求項8】 前記直交変換手段は、前記原画像データ
を複数のブロックに分割して直交変換係数を求め、 前記予測手段は、量子化係数「1」を用いた時におけ
る、前記第1および第2の空間周波数が共にカテゴリ
「0」であるブロック数を示すカテゴリ分布表に基づい
て、所定の量子化係数を用いた時における、前記第1の
空間周波数がカテゴリ「0」であり、かつ前記第2の空
間周波数がカテゴリ「j」(jは正の整数)であるブロ
ック数を予測することを特徴とする請求項4に記載の画
像圧縮装置。
8. The orthogonal transforming unit divides the original image data into a plurality of blocks to obtain an orthogonal transform coefficient, and the predicting unit uses the quantized coefficient “1” for the first and second transforms. Based on a category distribution table showing the number of blocks in which the second spatial frequencies are both category "0", the first spatial frequency is category "0" when a predetermined quantization coefficient is used, and The image compression apparatus according to claim 4, wherein the number of blocks in which the second spatial frequency is category “j” (j is a positive integer) is predicted.
【請求項9】 前記直交変換手段は、前記原画像データ
を複数のブロックに分割して直交変換係数を求め、 前記予測手段は、量子化係数「1」を用いた時の各空間
周波数における、各カテゴリに分類されるブロックの数
に基づいて、所定の量子化係数を用いた時の各空間周波
数における、各カテゴリに分類されるブロックの数を求
めることを特徴とする請求項3に記載の画像圧縮装置。
9. The orthogonal transforming unit divides the original image data into a plurality of blocks to obtain orthogonal transform coefficients, and the predicting unit, at each spatial frequency when a quantized coefficient “1” is used, The number of blocks classified into each category at each spatial frequency when a predetermined quantization coefficient is used is determined based on the number of blocks classified into each category. Image compression device.
JP04133395A 1995-02-06 1995-02-06 Quantization table generation device for image compression device Expired - Fee Related JP3421463B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP04133395A JP3421463B2 (en) 1995-02-06 1995-02-06 Quantization table generation device for image compression device
US08/598,207 US5937098A (en) 1995-02-06 1996-02-06 Adaptive quantization of orthogonal transform coefficients for setting a target amount of compression

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04133395A JP3421463B2 (en) 1995-02-06 1995-02-06 Quantization table generation device for image compression device

Publications (2)

Publication Number Publication Date
JPH08214170A true JPH08214170A (en) 1996-08-20
JP3421463B2 JP3421463B2 (en) 2003-06-30

Family

ID=12605602

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04133395A Expired - Fee Related JP3421463B2 (en) 1995-02-06 1995-02-06 Quantization table generation device for image compression device

Country Status (1)

Country Link
JP (1) JP3421463B2 (en)

Also Published As

Publication number Publication date
JP3421463B2 (en) 2003-06-30

Similar Documents

Publication Publication Date Title
CA2130478C (en) A data compression system including successive approximation quantizer
US7792376B2 (en) Compression encoder, compression encoding method and program
US6876772B2 (en) Picture-encoding apparatus and picture-encoding method
JP4377088B2 (en) Method for generating a compressed digital image organized into a hierarchy having information relating to different viewing conditions and resolutions
JP3356663B2 (en) Image encoding device, image encoding method, and recording medium recording image encoding program
US5875039A (en) Image processing method and apparatus
US7133567B2 (en) Image coding apparatus and image coding method
EP0671852A1 (en) Device and method for encoding image data
JPH02305182A (en) Picture signal compressing and encoding device
JP2001136526A (en) Method for image processing, device thereof and storage medium
US5719961A (en) Adaptive technique for encoder and decoder signal transformation
CN1124045C (en) Runlength coding method for use in video signal encoding system
US5937098A (en) Adaptive quantization of orthogonal transform coefficients for setting a target amount of compression
US8611686B2 (en) Coding apparatus and method
JPH0832037B2 (en) Image data compression device
JP4514169B2 (en) Digital signal conversion apparatus and method
JP3532963B2 (en) Image compression device
JP3421463B2 (en) Quantization table generation device for image compression device
EP1629675B1 (en) Fixed bit rate, intraframe compression and decompression of video
EP1892965A2 (en) Fixed bit rate, intraframe compression and decompression of video
JP3746804B2 (en) Image compression device
JP3559314B2 (en) Image compression device
JPH02104180A (en) Compression processing method for image data compressor
JP3232160B2 (en) Encoding device and method
JPH0575867A (en) Image data coder

Legal Events

Date Code Title Description
FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090418

Year of fee payment: 6

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100418

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100418

Year of fee payment: 7

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110418

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20110418

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120418

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120418

Year of fee payment: 9

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120418

Year of fee payment: 9

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313111

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120418

Year of fee payment: 9

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20120418

Year of fee payment: 9

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20130418

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees