JP3392949B2 - Image compression device and image decompression device - Google Patents

Image compression device and image decompression device

Info

Publication number
JP3392949B2
JP3392949B2 JP18628794A JP18628794A JP3392949B2 JP 3392949 B2 JP3392949 B2 JP 3392949B2 JP 18628794 A JP18628794 A JP 18628794A JP 18628794 A JP18628794 A JP 18628794A JP 3392949 B2 JP3392949 B2 JP 3392949B2
Authority
JP
Japan
Prior art keywords
error data
quantization
quantized
data
bits
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.)
Expired - Fee Related
Application number
JP18628794A
Other languages
Japanese (ja)
Other versions
JPH0833001A (en
Inventor
紳聡 阿部
Original Assignee
ペンタックス株式会社
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 ペンタックス株式会社 filed Critical ペンタックス株式会社
Priority to JP18628794A priority Critical patent/JP3392949B2/en
Publication of JPH0833001A publication Critical patent/JPH0833001A/en
Application granted granted Critical
Publication of JP3392949B2 publication Critical patent/JP3392949B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

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

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 compressing device and an image decompressing device for recording and reproducing on a recording medium according to the EG algorithm.

【0002】[0002]

【従来の技術】高解像度画像を符号化して通信伝送路を
介して情報の授受を行う標準化アルゴリズムが、JPE
G(Joint Photographic Expert Group)から勧告されて
いる。このJPEGから勧告されているアルゴリズム、
すなわちJPEGアルゴリズムにおいて取り扱われるカ
ラー静止画像は、複数のコンポーネントで構成すること
ができるが、例えば輝度信号Yと色差信号Cr、Cbに
よりカラー静止画像を用いた場合には3つのコンポーネ
ントですみ、他のコンポーネントは使用されない。
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, the color still image handled in the JPEG algorithm can be composed of a plurality of components. For example, when a color still image is used by the luminance signal Y and the color difference signals Cr and Cb, only three components are needed. The component is not used.

【0003】[0003]

【発明が解決しようとする課題】一方、JPEGアルゴ
リズムのベースライン・プロセスでは、大幅な情報圧縮
を行うため、初めに2次元DCT変換によって原画像デ
ータを空間周波数軸上の成分に分解し、そして、その空
間周波数軸上で表された各データを量子化し、さらに量
子化した各データを符号化する。従って、2次元DCT
変換及び量子化による情報圧縮により原画像の持つ情報
の一部が欠落するため、受信側で完全な原画像を復元す
ることはできない。
On the other hand, in the baseline process of the JPEG algorithm, in order to perform a large amount of information compression, the original image data is first decomposed into the components on the spatial frequency axis by the two-dimensional DCT transform, and , Quantizes each data represented on the spatial frequency axis, and further encodes each quantized data. Therefore, the two-dimensional DCT
Since a part of the information contained in the original image is lost due to the information compression by the conversion and the quantization, the receiving side cannot restore the complete original image.

【0004】本発明は、できるだけ原画像に近い画像を
再生することを可能にする画像圧縮装置と、この画像圧
縮装置により得られたデータから静止画像を再生するた
めの画像伸張装置とを提供することを目的としている。
The present invention provides an image compression apparatus which makes it possible to reproduce an image as close to the original image as possible, and an image expansion apparatus for reproducing a still image from the data obtained by this image compression apparatus. Is intended.

【0005】[0005]

【課題を解決するための手段】本発明に係る画像圧縮装
置は、少なくとも1つの画像コンポーネントから成る原
画像データに直交変換を施し、各コンポーネント毎に、
所定の空間周波数に対応した直交変換係数を求める直交
変換手段と、直交変換係数を量子化テーブルによって量
子化し、量子化直交変換係数を求める量子化手段と、量
子化直交変換係数を逆量子化して復元直交変換係数を求
める逆量子化手段と、復元直交変換係数と直交変換係数
との差である量子化誤差データを、各コンポーネント毎
に求める第1誤差データ生成手段と、量子化誤差データ
と量子化直交変換係数を符号化して圧縮画像データを形
成する符号化手段と、圧縮画像データを記録媒体に記録
する記録手段とを備えたことを特徴としている。
An image compression apparatus according to the present invention performs an orthogonal transformation on original image data composed of at least one image component, and for each component,
Orthogonal transformation means for obtaining an orthogonal transformation coefficient corresponding to a predetermined spatial frequency, quantization means for quantizing the orthogonal transformation coefficient by a quantization table, and dequantization for the quantized orthogonal transformation coefficient Inverse quantization means for obtaining the restored orthogonal transform coefficient, first error data generation means for obtaining, for each component, quantized error data that is the difference between the restored orthogonal transform coefficient and the orthogonal transform coefficient, the quantized error data and the quantum It is characterized in that it is provided with an encoding means for encoding compressed orthogonal transform coefficients to form compressed image data and a recording means for recording the compressed image data on a recording medium.

【0006】本発明に係る画像伸張装置は、上記画像圧
縮装置によって記録された圧縮画像データを記録媒体か
ら読み出し、この圧縮画像データから量子化直交変換係
数と第4コンポーネントとを復号する復号化手段と、量
子化直交変換係数を逆量子化して直交変換係数を復元す
る逆量子化手段と、第4コンポーネントから、圧縮画像
データを構成する各コンポーネントの誤差データを分離
する誤差データ分離手段と、直交変換係数に誤差データ
を加算する加算手段と、この加算手段から出力される直
交変換係数に逆直交変換を施し、画像データを復元する
逆直交変換手段とを備えたことを特徴としている。
The image decompressing device according to the present invention reads the compressed image data recorded by the image compressing device from the recording medium, and decodes the quantized orthogonal transform coefficient and the fourth component from the compressed image data. Dequantizing means for dequantizing the quantized orthogonal transform coefficient to restore the orthogonal transform coefficient; error data separating means for separating the error data of each component forming the compressed image data from the fourth component; It is characterized in that it is provided with an adding means for adding the error data to the transform coefficient, and an inverse orthogonal transform means for performing an inverse orthogonal transform on the orthogonal transform coefficient output from the adding means to restore the image data.

【0007】[0007]

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

【0008】被写体Sから到来した光は集光レンズ11
によって集光され、被写体像がCCD(固体撮像素子)
12の受光面上に結像される。CCD12の受光面には
多数の光電変換素子が配設され、また光電変換素子の上
面には、例えばR、G、Bの各色フィルタ要素から成る
カラーフィルタが設けられている。各光電変換素子はひ
とつの画素データに対応している。被写体像は、各光電
変換素子によって所定の色に対応した電気信号に変換さ
れ、A/D変換器13に入力される。なお、図1の構成
ではCCD12が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 data. The subject image is converted into an electric signal corresponding to a predetermined color by each photoelectric conversion element and input to the A / D converter 13. In the configuration of FIG. 1, only one CCD 12 is provided, but two or more CCDs are used.
May be 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、量子化処理回路2
2、ハフマン符号化処理回路23、逆量子化回路24、
誤差データ合成部25等から成る画像圧縮装置では、輝
度信号Y等の画像データは1画面に関して複数のブロッ
クに分割され、ブロック単位で処理される。また各ブロ
ックは8×8個の画素データから構成される。
DCT processing circuit 21, quantization processing circuit 2
2, Huffman coding processing circuit 23, inverse quantization circuit 24,
In the image compression apparatus including the error data synthesizing unit 25 and the like, 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 composed of 8 × 8 pixel data.

【0012】DCT処理回路21において求められた輝
度信号Yおよび色差信号Cb、CrのDCT係数は、そ
れぞれ量子化処理回路22に入力される。量子化処理回
路22も、DCT処理回路21と同様、各信号毎に設け
られている。量子化処理回路22に入力された輝度信号
Y、色差信号Cb、CrのDCT係数は、8×8個の量
子化係数により構成される量子化テーブルによって、そ
れぞれ量子化される。この量子化は線形量子化であり、
すなわち各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 a quantization table composed of 8 × 8 quantization coefficients. This quantization is a linear quantization,
That is, each DCT coefficient is divided by the corresponding quantized coefficient.

【0013】なお本実施例においては、JPEGアルゴ
リズムに準拠して、輝度信号YのDCT係数を量子化す
る量子化テーブルと、色差信号Cb、CrのDCT係数
を量子化する量子化テーブルとは異なっているが、各信
号において同一の量子化テーブルを用いてもよい。
In this embodiment, the quantization table for quantizing the DCT coefficient of the luminance signal Y and the quantization table for quantizing the DCT coefficient of the color difference signals Cb and Cr are different in accordance with the JPEG algorithm. However, the same quantization table may be used for each signal.

【0014】量子化処理回路22から出力された輝度信
号Y、色差信号Cb、Crの量子化DCT係数はハフマ
ン符号化処理回路23に入力され、所定のアルゴリズム
によりハフマン符号化される。このハフマン符号化によ
り得られた画像信号(Y’,Cb’,Cr’)は、第1
〜第3コンポーネントのスキャンデータとして、ICメ
モリカード(記録媒体)Mに記録される。
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 Huffman coded by a predetermined algorithm. The image signal (Y ', Cb', Cr ') obtained by this Huffman coding is the first
~ It is recorded in the IC memory card (recording medium) M as the scan data of the third component.

【0015】量子化DCT係数は、ハフマン符号化処理
回路23に入力される一方、逆量子化処理回路24に入
力されて逆量子化される。すなわち量子化DCT係数
は、逆量子化処理回路24において量子化テーブルの量
子化係数を乗じられ、これにより復元DCT係数が得ら
れる。この復元DCT係数と、DCT処理回路21から
出力されるDCT係数とは、減算器26、27、28に
入力され、これらの係数の差、すなわち量子化誤差デー
タ(ΔY’、ΔCb’、ΔCr’)が演算される。この
量子化誤差データは、誤差データ合成部25において、
データの最大ビット数を制限すべく必要に応じて再び量
子化され、ハフマン符号化処理回路23においてハフマ
ン符号化された後、第4コンポーネントのスキャンデー
タとしてICメモリカードMに記録される。
The quantized DCT coefficient is input to the Huffman encoding processing circuit 23, and is also input to the inverse quantization processing circuit 24 and inversely quantized. That is, the quantized DCT coefficient is multiplied by the quantized coefficient of the quantization table in the inverse quantization processing circuit 24, and thereby the restored DCT coefficient is obtained. The restored DCT coefficient and the DCT coefficient output from the DCT processing circuit 21 are input to subtractors 26, 27 and 28, and the difference between these coefficients, that is, the quantization error data (ΔY ′, ΔCb ′, ΔCr ′). ) Is calculated. This quantized error data is stored in the error data synthesis unit 25 as
The data is quantized again as necessary to limit the maximum number of bits of data, Huffman-encoded in the Huffman-encoding processing circuit 23, and then recorded in the IC memory card M as scan data of the fourth component.

【0016】なお、画像データのICメモリカードMへ
の記録の際に、量子化処理回路22において使用された
量子化テーブルと、ハフマン符号化処理回路23のハフ
マン符号化テーブルの情報も画像データ内に組み込まれ
てICメモリカードMに記録される。
Information of the quantization table used in the quantization processing circuit 22 and the Huffman coding table of the Huffman coding processing circuit 23 when the image data is recorded in the IC memory card M is also included in the image data. And is recorded in the IC memory card M.

【0017】図2は、画像データを圧縮してICメモリ
カードMに記録する処理プログラムのフローチャートで
ある。ステップ100では、CCD12から読み出され
たアナログの色信号R、G、BがA/D変換器13によ
ってデジタルデータに変換され、信号処理回路によって
輝度信号Yと色差信号Cb、Crとに変換されて画像メ
モリ14に入力される。画像メモリ14に1画像分のデ
ータが格納されると、ステップ101において、輝度信
号Yと色差信号Cb、Crが8×8画素のブロックに分
割されて画像メモリ14から読み出され、ブロック画像
データP(Y)xy 、P(Cb)xy、P(Cr)xyとしてDCT処理
回路21に入力される。ステップ102では、DCT処
理回路21において、各ブロック毎に画像データP(Y)x
y 、P(Cb)xy、P(Cr)xyが(1)式に従って2次元DC
T変換される。
FIG. 2 is a flowchart of a processing program for compressing image data and recording it on the IC memory card M. In step 100, the analog color signals R, G, B read from the CCD 12 are converted into digital data by the A / D converter 13, and converted into a luminance signal Y and color difference signals Cb, Cr by a signal processing circuit. Are input to the image memory 14. When the data for one image is stored in the image memory 14, in step 101, the luminance signal Y and the color difference signals Cb and Cr are divided into blocks of 8 × 8 pixels and read from the image memory 14 to obtain the block image data. It is input to the DCT processing circuit 21 as P (Y) xy, P (Cb) xy, P (Cr) xy. In step 102, in the DCT processing circuit 21, image data P (Y) x is obtained for each block.
y, P (Cb) xy, P (Cr) xy are two-dimensional DC according to the equation (1)
T converted.

【数1】 [Equation 1]

【0018】なお、(1)式のP(Y)xy は原画像データ
の各画素に対応しており、例えば256階調(8ビット
精度)の輝度信号Y、色差信号Cb、Crを示す。ま
た、(1)式において各画素値P(Y)xy からLs を減算
するのは、DC係数の期待値がより0に近づく様にする
ためである。このような減算の結果、後述するハフマン
符号化の際により短い符号長でDC係数を符号化でき、
より高い情報圧縮率を期待できる。
Note that P (Y) xy in the equation (1) corresponds to each pixel of the original image data and represents, for example, a luminance signal Y of 256 gradations (8-bit precision) and color difference signals Cb, Cr. In addition, the reason why Ls is subtracted from each pixel value P (Y) xy in the equation (1) is to make the expected value of the DC coefficient closer to zero. As a result of such subtraction, the DC coefficient can be encoded with a shorter code length in Huffman encoding described later,
A higher information compression rate can be expected.

【0019】ステップ103では、DCT処理回路21
において求められた8×8個のDCT係数S(Y)uv 、S
(Cb)uv、S(Cr)uvが、量子化処理回路22に入力され、
量子化テーブルQ(Y)uv 、Q(Cb)uv、Q(Cr)uvを用いて
量子化される。
In step 103, the DCT processing circuit 21
8 × 8 DCT coefficients S (Y) uv, S obtained in
(Cb) uv and S (Cr) uv are input to the quantization processing circuit 22,
Quantization is performed using the quantization tables Q (Y) uv, Q (Cb) uv, Q (Cr) uv.

【0020】図3は、一例として、8×8画素のブロッ
クの画像データP(Y)xy と、DCT係数S(Y)uv と、量
子化DCT係数R(Y)uv と、量子化テーブルQ(Y)uv と
を示している。
As an example, FIG. 3 shows 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.

【0021】図3(a)の画像データP(Y)xy は、
(1)式による2次元DCT変換によって、図3(b)
に示す8×8=64個のDCT係数S(Y)uv に変換され
る。これらのDCT係数のうち、位置(0,0)にある
DCT係数S(Y)00 はDC係数であり、残り63個のD
CT係数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. 3A is
By the two-dimensional DCT transformation by the equation (1), FIG.
Are converted into 8 × 8 = 64 DCT coefficients S (Y) uv shown in FIG. Among these DCT coefficients, the DCT coefficient S (Y) 00 at the position (0,0) is a DC coefficient, and the remaining 63 DT coefficients.
The CT coefficient S (Y) uv is an AC coefficient. The AC coefficient 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 coefficient 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
Respectively correspond to predetermined spatial frequencies.

【0022】図3(d)は量子化処理回路21で用いら
れる量子化テーブルQ(Y)uv の一例を示している。この
ような量子化テーブルQ(Y)uv としては、例えば、輝度
信号Yと、色差信号Cb、Crとで別のものでもよく、
この場合、JPEGフォーマットの画像データをICメ
モリカードMに記録する際に、各コンポーネントを格納
するスキャンデータの前に、そのコンポーネントデータ
の量子化に使用された量子化テーブルQ(Y)uv の内容が
記録される。
FIG. 3D shows an example of the quantization table Q (Y) uv used in the quantization processing circuit 21. As such a quantization table Q (Y) uv, for example, the luminance signal Y and the color difference signals Cb and Cr may be different,
In this case, when the JPEG format image data is recorded in the IC memory card M, the contents of the quantization table Q (Y) uv used for quantizing the component data before the scan data for storing each component. Is recorded.

【0023】量子化テーブル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 の各要素同士の割算と四捨五入とによって、図
3(c)に示すような量子化DCT係数R(Y)uv が求め
られる。
An 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. 3C 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

【0024】このようにして量子化処理回路22におい
て求められた量子化DCT係数R(Y)uv 、R(Cb)uv、R
(Cr)uvは、ハフマン符号化処理回路23と逆量子化処理
回路24とに入力される。
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 and the inverse quantization processing circuit 24.

【0025】次にステップ104の処理、すなわちハフ
マン符号化処理回路23におけるハフマン符号化につい
て、図4〜図7を参照して説明する。量子化DC係数R
(Y)00 と量子化AC係数(量子化DC係数R(Y)00 以外
の量子化DCT係数R(Y)uv )では符号化方法が異なっ
ている。量子化DC係数R(Y)00 の符号化は次のように
行われる。
Next, the processing of step 104, that is, the Huffman coding in the Huffman coding processing circuit 23 will be described with reference to FIGS. Quantized DC coefficient R
The encoding method is different between (Y) 00 and the quantized AC coefficient (quantized DCT coefficient R (Y) uv other than the quantized DC coefficient R (Y) 00 ). Encoding of the quantized DC coefficient R (Y) 00 is performed as follows.

【0026】まず、現在符号化しようとするブロックの
量子化DC係数R(Y)00 と一つ前に符号化されたブロッ
クの量子化DC係数R(Y)00 との差分が求められる。こ
の差分値が図4に示すグループの何れに属するかが判断
され、そのグループの番号を表す符号語が、図5に示す
符号表(DC係数の符号化テーブル)から求められる。
例えば、現在符号化しようとするブロックの量子化DC
係数R(Y)00 が16であり、一つ前に符号化されたブロ
ックの量子化DC係数R(Y)00 が25である時、差分値
は−9であるので、図4のグループ番号表から、差分値
=−9の属するグループの番号(SSSS)は「4」と判別
され、さらにそのグループ番号(SSSS)の符号語が図5
の符号表より「 101」と判断される。
Firstly, 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 groups shown in FIG. 4 the difference value belongs to, and the code word representing the number of the group is obtained from the code table (coding table of DC coefficient) shown in FIG.
For example, the quantized DC of the block currently to be encoded
When the coefficient R (Y) 00 is 16 and the quantized DC coefficient R (Y) 00 of the previously encoded block is 25, the difference value is -9, so the group number of FIG. From the table, the number (SSSS) of the group to which the difference value = −9 belongs is determined to be “4”, and the code word of the group number (SSSS) is shown in FIG.
It is judged as "101" from the code table of.

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

【0028】一方、量子化AC係数の符号化は、図6に
示す処理ルーチンによって行われる。まずステップ12
0において、63個の量子化AC係数が図7に示す順序
でジクザクスキャンされ、1次元配列データに並びかえ
られる。次に、ステップ122では、1次元に並べられ
た各量子化AC係数値が「0」であるか否かかが判断さ
れる。量子化AC係数が「0」(無効係数という)であ
る時、ステップ124において、その「0」である量子
化AC係数が連続する数がカウントされる。これにより
「0」が連続する長さ、すなわちラン長(NNNN)が求め
られる。
On the other hand, encoding 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. 7 and rearranged into one-dimensional array data. Next, at step 122, it is judged whether or not the quantized AC coefficient values arranged one-dimensionally are "0". When the quantized AC coefficient is “0” (referred to as an invalid coefficient), in step 124, the number of consecutive “0” quantized AC coefficients is counted. Thereby, the length of continuous "0", that is, the run length (NNNN) is obtained.

【0029】これに対し、ステップ122において量子
化AC係数が「0」でない(有効係数という)と判断さ
れた時、ステップ126において、量子化DC係数と同
じようなグループ分けが行われるとともに付加ビットが
求められる。この量子化AC係数のグループ分けは、量
子化DC係数のグループ分けとは異なり、その量子化A
C係数そのものについて行われる。すなわち、量子化A
C係数が例えば「4」である時、図4と同様な表を参照
してグループ番号(SSSS)「3」が得られる。また、量
子化AC係数「4」はグループ番号(SSSS)=3のグル
ープにおいて小さい方から5番目にあるので、付加ビッ
トは「 100」となる。
On the other hand, when it is determined in step 122 that the quantized AC coefficient is not "0" (referred to as an effective coefficient), in step 126, the same grouping as that of the quantized DC coefficient is performed and the additional bits are added. Is required. The grouping of the quantized AC coefficients is different from the grouping of the quantized DC coefficients.
This is done for the C coefficient itself. That is, quantization A
When the C coefficient is, for example, "4", the group number (SSSS) "3" is obtained by referring to the table similar to FIG. Further, since the quantized AC coefficient “4” is the fifth from the smallest in the group having the group number (SSSS) = 3, the additional bit is “100”.

【0030】ステップ130では、AC符号テーブル
(図示せず)を参照し、例えば量子化AC係数「4」の
直前のデータのラン長が「0」である場合、このラン長
とグループ番号(SSSS) =3とに基づいて、符号語「 1
00」が得られる。そして、この符号語「 100」とステッ
プ126において得られた付加ビット「 100」を組み合
わせことにより2次元ハフマン符号語「100100」が求め
られる。
In step 130, an AC code table (not shown) is referred to. For example, if the run length of the data immediately before the quantized AC coefficient "4" is "0", this run length and group number (SSSS ) = 3 and the codeword "1
00 "is obtained. Then, the two-dimensional Huffman code word "100100" is obtained by combining the code word "100" and the additional bit "100" obtained in step 126.

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

【0032】再び図2を参照すると、ステップ110で
は、ステップ104において得られた符号化データに、
さらに所定のデータが付加され、JPEGフォーマット
のデータが生成される。ステップ111では、このデー
タと、後述する量子化誤差データからなる第4コンポー
ネントのスキャンデータとが、JPEGフォーマットに
従ってICメモリカードMに順次記録される。
Referring again to FIG. 2, in step 110, the encoded data obtained in step 104 is
Further, predetermined data is added to generate JPEG format data. In step 111, this data and the scan data of the fourth component composed of the quantization error data described later are sequentially recorded in the IC memory card M according to the JPEG format.

【0033】ここで、JPEGフォーマットを説明す
る。図9と図10は、JPEGフォーマットによって構
成された画像データ80の構造を示す。これらの図に示
すように、JPEGフォーマットで構成した画像データ
80において、1枚のカラー静止画像の符号化データが
少なくと1つのフレーム84内に収められる。フレーム
84は、符号化データの始まりを示すSOI(Start of
Image)マーカ82と、符号化データの終了を示すEOI
(End of Image) マーカとにより挟まれる。
Here, the JPEG format will be described. 9 and 10 show the structure of the image data 80 configured in the JPEG format. As shown in these drawings, in the image data 80 configured in the JPEG format, the encoded data of one color still image is contained in at least one frame 84. The frame 84 is an SOI (Start of Start) indicating the beginning of encoded data.
Image) marker 82 and EOI indicating the end of encoded data
(End of Image) It is sandwiched by the marker.

【0034】SOIマーカ82に続いてフレームヘッダ
86が挿入され、このフレームヘッダ86にはフレーム
情報に関連する種々のパラメータが含まれる。フレーム
ヘッダ86に含まれる「DHT」はハフマン符号テーブ
ルの内容を示し、「DQT」は量子化マトリックスの内
容を示す。このフレームヘッダ86に続いてスキャンの
開始を示すスキャンヘッダ94と、スキャン88とが設
けられる。このスキャン88内に符号化データが記録さ
れる。
A frame header 86 is inserted following the SOI marker 82, and the frame header 86 includes various parameters related to frame information. “DHT” included in the frame header 86 indicates the contents of the Huffman code table, and “DQT” indicates the contents of the quantization matrix. Following the frame header 86, a scan header 94 indicating the start of scanning and a scan 88 are provided. Encoded data is recorded in this scan 88.

【0035】なおスキャンとは、画像データをDCT変
換して得られた変換係数をハフマン符号化する際に行わ
れる、各変換係数の順序を並べ代えを意味する。このス
キャンには種々の方法があり、ノンインターリーブスキ
ャンとインターリーブスキャンとがある。例えばコンポ
ーネントAの各ブロックの変換係数An=A1,A2・
・・,Bn=B1,B2・・・,Cn=C1,C2・・
・の時、ノンインターリーブスキャンはコンポーネント
毎に独立して各変換係数を連続的に並べ代えて得られ、
A1,A2・・・,B1,B2・・・,C1,C2・・
・であり、この時、スキャンは3つである。一方、イン
ターリーブスキャンは、各コンポーネントにおけるそれ
ぞれ対応する画素位置の変換係数が連続する様に並べ代
えて得られ、A1,B1,C1,A2,B2,C2・・
・であり、この時スキャンは1つである。
The term "scan" means rearrangement of the order of the transform coefficients, which is performed when the transform coefficients obtained by DCT transforming the image data are Huffman-encoded. There are various methods for this scan, and there are non-interleaved scan and interleaved scan. For example, the conversion coefficients An = A1, A2 ... of each block of the component A
.., Bn = B1, B2 ..., Cn = C1, C2 ...
・ When, the non-interleaved scan is obtained by sequentially rearranging each transform coefficient independently for each component,
A1, A2 ..., B1, B2 ..., C1, C2 ...
-, And at this time, there are three scans. On the other hand, the interleaved scan is obtained by rearranging the conversion coefficients of corresponding pixel positions in each component so as to be continuous, and A1, B1, C1, A2, B2, C2 ...
・ There is one scan at this time.

【0036】さて、JPEGフォーマットの第1〜第3
スキャンデータ(第1〜第3コンポーネント)は、輝度
信号Y、色差信号Cb、Crの符号化データにスキャン
ヘッダ94(図10)が付加されたものであり、第4コ
ンポーネントには量子化誤差データがハフマン符号化さ
れて格納されている。この処理は、次に述べるように、
図2のステップ106〜111において実行される。
Now, the first to the third of the JPEG format
The scan data (first to third components) is encoded data of the luminance signal Y and the color difference signals Cb and Cr to which the scan header 94 (FIG. 10) is added, and the fourth component is quantized error data. Is Huffman-encoded and stored. This process is described below.
It is executed in steps 106 to 111 of FIG.

【0037】ステップ106では、逆量子化処理回路2
4において、量子化DCT係数R(Y)uv 、R(Cb)uv、R
(Cr)uvが量子化テーブルQ(Y)uv 、Q(Cb)uv、Q(Cr)uv
を用いて逆量子化され、復元DCT係数S'(Y)uv、S'
(Cb)uv 、S'(Cr)uv が得られる。図11(b)は、図
3(c)の量子化DCT係数R(Y)uv を図3(d)の量
子化テーブルQ(Y)uv によって逆量子化して得られた復
元DCT係数S'(Y)uvの例を示している。
In step 106, the inverse quantization processing circuit 2
4, the quantized DCT coefficients R (Y) uv, R (Cb) uv, R
(Cr) uv is the quantization table Q (Y) uv, Q (Cb) uv, Q (Cr) uv
Inversely quantized by using the restored DCT coefficient S '(Y) uv, S'
(Cb) uv and S '(Cr) uv are obtained. FIG. 11B shows a restored DCT coefficient S ′ obtained by dequantizing the quantized DCT coefficient R (Y) uv of FIG. 3C with the quantization table Q (Y) uv of FIG. 3D. An example of (Y) uv is shown.

【0038】ステップ107では、復元DCT係数S'
(Y)uv、S'(Cb)uv 、S'(Cr)uv が減算器26、27、
28に入力され、量子化前のDCT係数S(Y)uv 、S(C
b)uv、S(Cr)uv(図3(b)参照)との差、すなわち量
子化誤差データΔYuv、ΔCbuv、ΔCruvが下記(2)、
(3)、(4)式よって算出される。 ΔYuv=S(Y)uv −S'(Y)uv =S(Y)uv −R(Y)uv ・Q(Y)uv (2) ΔCbuv=S(Cb)uv−S'(Cb)uv =S(Cb)uv−R(Cb)uv・Q(Cb)uv (3) ΔCruv=S(Cr)uv−S'(Cr)uv =S(Cr)uv−R(Cr)uv・Q(Cr)uv (4)
In step 107, the restored DCT coefficient S '
(Y) uv, S '(Cb) uv, S' (Cr) uv are subtracters 26, 27,
DCT coefficients S (Y) uv, S (C
b) uv and S (Cr) uv (see FIG. 3B), that is, the quantization error data ΔYuv, ΔCbuv, and ΔCruv are the following (2),
It is calculated by the equations (3) and (4). ΔYuv = S (Y) uv-S '(Y) uv = S (Y) uv-R (Y) uv * Q (Y) uv (2) ΔCbuv = S (Cb) uv-S' (Cb) uv = S (Cb) uv-R (Cb) uv ・ Q (Cb) uv (3) ΔCruv = S (Cr) uv-S '(Cr) uv = S (Cr) uv-R (Cr) uv ・ Q (Cr ) uv (4)

【0039】ステップ108では、量子化誤差データΔ
Yuv、ΔCbuv、ΔCruvが誤差データ合成部25に入力さ
れ、それぞれジグザグスキャン(図7参照)された後、
次に述べるように、輝度信号Y、色差信号Cr、Cb毎
にビット配分が行われ、誤差データが得られる。
At step 108, the quantization error data Δ
After Yuv, ΔCbuv, and ΔCruv are input to the error data synthesizing unit 25 and zigzag scanned (see FIG. 7) respectively,
As described below, bit allocation is performed for each of the luminance signal Y and the color difference signals Cr, Cb, and error data is obtained.

【0040】JPEGアルゴリズムのベースラインプロ
セスにおけるハフマン符号化前の1単位データのビット
数は、最大12である。すなわち、ハフマン符号化処理
回路23に入力される量子化DCT係数の各値は最大1
2ビットの数値を取りうる。ただし、DC係数のみが最
大12ビットであり、AC係数は最大11ビットであ
る。
The maximum number of bits of one unit data before Huffman coding is 12 in the baseline process of the JPEG algorithm. That is, each value of the quantized DCT coefficient input to the Huffman coding processing circuit 23 is 1 at maximum.
It can be a 2-bit number. However, only the DC coefficient has a maximum of 12 bits, and the AC coefficient has a maximum of 11 bits.

【0041】一方、量子化誤差データΔYuv、ΔCbuv、
ΔCruvの取りうる数値は、次の(5)〜(10)式を満
足する整数である。
On the other hand, the quantization error data ΔYuv, ΔCbuv,
The numerical value that ΔCruv can take is an integer that satisfies the following expressions (5) to (10).

【0042】 −Q(Y)uv /2≦ΔYuv<Q(Y)uv /2 (S(Y)uv ≧0) (5) −Q(Y)uv /2<ΔYuv≦Q(Y)uv /2 (S(Y)uv <0) (6) −Q(Cb)uv/2≦ΔCbuv<Q(Cb)uv/2 (S(Cb)uv≧0) (7) −Q(Cb)uv/2<ΔCbuv≦Q(Cb)uv/2 (S(Cb)uv<0) (8) −Q(Cr)uv/2≦ΔCruv<Q(Cr)uv/2 (S(Cr)uv≧0) (9) −Q(Cr)uv/2<ΔCruv≦Q(Cr)uv/2 (S(Cr)uv<0) (10)[0042]   −Q (Y) uv / 2 ≦ ΔYuv <Q (Y) uv / 2 (S (Y) uv ≧ 0) (5)   -Q (Y) uv / 2 <ΔYuv ≦ Q (Y) uv / 2 (S (Y) uv <0) (6)   −Q (Cb) uv / 2 ≦ ΔCbuv <Q (Cb) uv / 2 (S (Cb) uv ≧ 0) (7)   -Q (Cb) uv / 2 <ΔCbuv ≦ Q (Cb) uv / 2 (S (Cb) uv <0) (8)   -Q (Cr) uv / 2 ≦ ΔCruv <Q (Cr) uv / 2 (S (Cr) uv ≧ 0) (9)   -Q (Cr) uv / 2 <ΔCruv ≦ Q (Cr) uv / 2 (S (Cr) uv <0) (10)

【0043】これら(5)〜(10)式から理解される
ように、量子化誤差データΔYuv、ΔCbuv、ΔCruvの数
値範囲は、量子化テーブルQ(Y)uv 、Q(Cb)uv、Q(Cr)
uvの値によって変化する。さらに、この量子化誤差デー
タΔYuv、ΔCbuv、ΔCruvの取りうる最大ビット数
Y 、BCb、BCrは次の(11)〜(13)式により定
められる。
As can be understood from these equations (5) to (10), the numerical ranges of the quantization error data ΔYuv, ΔCbuv, ΔCruv are the quantization tables Q (Y) uv, Q (Cb) uv, Q ( Cr)
It depends on the value of uv. Furthermore, the quantization error data ΔYuv, ΔCbuv, maximum number of bits B Y which can take ΔCruv, B Cb, B Cr is defined by the following (11) to (13) below.

【0044】 BY =round(log2(QY − 1) + 0.5) (11) BCb=round(log2(QCb− 1) + 0.5) (12) BCr=round(log2(QCr− 1) + 0.5) (13)B Y = round (log 2 (Q Y −1) +0.5) (11) B Cb = round (log 2 (Q Cb −1) +0.5) (12) B Cr = round (log 2 (Q Cr -1) + 0.5) (13)

【0045】これらの式におけるQY 、QCb、QCrは、
各量子化テーブルQ(Y)uv 、Q(Cb)uv、Q(Cr)uvにおけ
る最大値である。例えば、図3(d)の量子化テーブル
Q(Y)uv の場合、QY =121 である。したがって、BY
=round(6.90689+0.5)=7となり、量子化誤差データΔ
Yuvを2進数表記した場合、最大ビット数は7ビットに
なる。このように、各量子化誤差データΔYuv、ΔCbu
v、ΔCruvのビット数は量子化テーブルQ(Y)uv 、Q(C
b)uv、Q(Cr)uvの値で一義的に定められるので、量子化
誤差データΔYuv、ΔCbuv、ΔCruvのビット数の和、す
なわち(11)〜(13)式によって求まるBY
Cb、BCrの総和が11ビットを超過する場合があり得
る。
Q Y , Q Cb , and Q Cr in these equations are
It is the maximum value in each quantization table Q (Y) uv, Q (Cb) uv, Q (Cr) uv. For example, in the case of the quantization table Q (Y) uv in FIG. 3D, Q Y = 121. Therefore, B Y
= Round (6.90689 + 0.5) = 7, the quantization error data Δ
When Yuv is expressed in binary, the maximum number of bits is 7 bits. In this way, each quantization error data ΔYuv, ΔCbu
The number of bits of v and ΔCruv is the quantization table Q (Y) uv, Q (C
Since b) uv and Q (Cr) uv are uniquely determined, the sum of the bit numbers of the quantization error data ΔYuv, ΔCbuv, and ΔCruv, that is, B Y obtained by the equations (11) to (13),
The sum of B Cb and B Cr may exceed 11 bits.

【0046】そこで本実施例においては、(11)〜
(13)式によって求まるBY 、BCb、BCrの総和が1
1ビットを超過する場合、各量子化誤差データΔYuv、
ΔCbuv、ΔCruvを、下記の(14)〜(16)式によっ
て再量子化し、これらのビット数の総和が11ビット以
下に収まるよう各ビット数を制限している。
Therefore, in this embodiment, (11)-
The sum of B Y , B Cb , and B Cr obtained by the equation (13) is 1
If it exceeds 1 bit, each quantization error data ΔYuv,
ΔCbuv and ΔCruv are requantized by the following equations (14) to (16), and the number of bits is limited so that the total sum of these bits is 11 bits or less.

【0047】 ΔY'uv =rol(ΔYuv/2(BY-k)) (14) ΔCb'uv =rol(ΔCbuv/2(BCb-m) ) (15) ΔCr'uv =rol(ΔCruv/2(BCr-n) ) (16) ただし、k+m+n=11であり、例えばk=7、m=
n=2である。また、rolは小数点以下の切捨てを意味
する。
ΔY'uv = rol (ΔYuv / 2 (BY-k) ) (14) ΔCb'uv = rol (ΔCbuv / 2 (BCb-m) ) (15) ΔCr'uv = rol (ΔCruv / 2 (BCr -n) ) (16) However, k + m + n = 11, for example, k = 7, m =
n = 2. Also, rol means rounding down after the decimal point.

【0048】(14)〜(16)式は、各量子化誤差デ
ータΔYuv、ΔCbuv、ΔCruvの再量子化の最も単純な方
法を示している。
Expressions (14) to (16) show the simplest method of requantization of the quantization error data ΔYuv, ΔCbuv, and ΔCruv.

【0049】ステップ108では最初に、次に述べるよ
うに量子化誤差データΔYuv、ΔCbuv、ΔCruvを格納す
るビット数の割り当てが行われる。
In step 108, first, the number of bits for storing the quantization error data ΔYuv, ΔCbuv, ΔCruv is assigned as described below.

【0050】輝度信号Y、色差信号Cb、Crにおい
て、再生画像の視覚特性に最も影響を与えるのは輝度信
号Yである。したがって、輝度信号Yの誤差データΔY
uvに割り当てるビット数を、色差信号Cb、Crの誤差
データΔCbuv、ΔCruvに割り当てるビット数よりも多く
する。例えば、輝度信号Yの誤差データΔYuvに割り当
てるビット数を7ビットとし、色差信号Cb、Crの誤
差データΔCbuv、ΔCruvに割り当てるビット数をそれぞ
れ2ビットとする。
Of the luminance signal Y and the color difference signals Cb and Cr, it is the luminance signal Y that most affects the visual characteristics of the reproduced image. Therefore, the error data ΔY of the luminance signal Y
The number of bits assigned to uv is made larger than the number of bits assigned to the error data ΔCbuv and ΔCruv of the color difference signals Cb and Cr. For example, the number of bits assigned to the error data ΔYuv of the luminance signal Y is 7 bits, and the number of bits assigned to the error data ΔCbuv and ΔCruv of the color difference signals Cb and Cr is 2 bits, respectively.

【0051】図12は、ステップ108において実行さ
れる、ビット配分を行うとともに誤差データを合成する
サブルーチンのフローチャートである。
FIG. 12 is a flowchart of the subroutine executed in step 108 for allocating bits and synthesizing error data.

【0052】ステップ140では、各量子化誤差データ
ΔYuv、ΔCbuv、ΔCruvのビット数が(11)〜(1
3)式により算出される。これらのビット数の総和が1
1以下である時、またその総和が11よりも大きい場合
であっても輝度信号Yの量子化誤差データΔYuvのビッ
ト数が7以下である時、量子化誤差データΔYuvは再量
子化されない。これに対し、ビット数の総和が11より
も大きく、かつ量子化誤差データΔYuvのビット数が7
よりも大きい場合、量子化誤差データΔYuvは、(1
4)式によって再量子化される。すなわち、輝度信号Y
の量子化誤差データΔYuvに対するビット数が決定され
る。また、ビット数の総和が11よりも大きいが、量子
化誤差データΔYuvのビット数が7以下である場合、量
子化誤差データΔCbuv、ΔCruvのみが(15)、(1
6)式によって再量子化される。
In step 140, the number of bits of each quantization error data ΔYuv, ΔCbuv, ΔCruv is (11) to (1).
It is calculated by the equation 3). The sum of these bit numbers is 1
When it is 1 or less, and when the number of bits of the quantization error data ΔYuv of the luminance signal Y is 7 or less even if the total sum is greater than 11, the quantization error data ΔYuv is not requantized. On the other hand, the total number of bits is larger than 11, and the number of bits of the quantization error data ΔYuv is 7
If it is larger than, the quantization error data ΔYuv becomes (1
It is requantized by the equation 4). That is, the luminance signal Y
The number of bits for the quantized error data ΔYuv is determined. Further, when the total number of bits is larger than 11, but the number of bits of the quantization error data ΔYuv is 7 or less, only the quantization error data ΔCbuv and ΔCruv are (15), (1
It is requantized by the equation (6).

【0053】ステップ142では、ステップ140にお
いて決定された量子化誤差データΔYuvのビット数に基
づいて、色差信号Cb、Crの量子化誤差データΔCbu
v、ΔCruvに対するビット数が割り当てられる。例え
ば、量子化誤差データΔYuvのビット数がステップ14
0において7に定められた場合、ステップ142では、
(15)、(16)式によって量子化誤差データΔCbu
v、ΔCruvのビット数が(11−7)/2=2になるよ
う再量子化が行われる。
In step 142, the quantization error data ΔCbu of the color difference signals Cb and Cr is calculated based on the number of bits of the quantization error data ΔYuv determined in step 140.
The number of bits for v and ΔCruv is assigned. For example, if the number of bits of the quantization error data ΔYuv is 14
If 0 is set to 7, then in step 142,
Quantization error data ΔCbu according to equations (15) and (16)
Requantization is performed so that the number of bits of v and ΔCruv becomes (11−7) / 2 = 2.

【0054】ステップ144では、ステップ140、1
42において求められた量子化誤差データがジグザグス
キャン(図7参照)され、第4コンポーネントΔKuvが
生成される。
In step 144, steps 140, 1
The quantized error data obtained at 42 is zigzag scanned (see FIG. 7) to generate the fourth component ΔKuv.

【0055】この第4コンポーネントΔKuvは、図2の
ステップ109において、ハフマン符号化処理回路23
に入力され、第1〜第3コンポーネントのハフマン符号
化と同様にしてハフマン符号化される。ステップ110
では、ハフマン符号化された第4コンポーネントΔKuv
は第1〜第3コンポーネントの符号化データとともにJ
PEGフォーマットに従ったデータの形態で、ICメモ
リカードMに記録される。
This fourth component ΔKuv is processed by the Huffman coding processing circuit 23 in step 109 of FIG.
And is Huffman encoded in the same manner as the Huffman encoding of the first to third components. Step 110
Then, the Huffman-encoded fourth component ΔKuv
Is J together with the encoded data of the first to third components
The data is recorded on the IC memory card M in the form of data according to the PEG format.

【0056】図13は、ビット配分および誤差データの
合成のサブルーチンのフローチャートの他の例を示して
いる。
FIG. 13 shows another example of a flowchart of a subroutine of bit allocation and error data combination.

【0057】ステップ146では、図2のステップ10
7によって求められた各量子化誤差データΔYuv、ΔCb
uv、ΔCruvのビット数が(11)〜(13)式により算
出される。そして、これらのビット数に基づいて、図1
2のステップ140、142と同様な手法により、ビッ
ト数の総和が11以下であり、かつ輝度信号Yの量子化
誤差データΔYuvのビット数が最も大きくなるように、
各量子化誤差データΔYuv、ΔCbuv、ΔCruvのビット数
が定められる。
In step 146, step 10 in FIG.
Quantization error data ΔYuv, ΔCb obtained by 7.
The number of bits of uv and ΔCruv is calculated by the equations (11) to (13). Then, based on these bit numbers, FIG.
In the same manner as in steps 140 and 142 of step 2, the total number of bits is 11 or less, and the number of bits of the quantization error data ΔYuv of the luminance signal Y is the largest.
The number of bits of each quantization error data ΔYuv, ΔCbuv, ΔCruv is determined.

【0058】ステップ148では、図2のステップ10
9における量子化誤差データのハフマン符号化におい
て、情報圧縮がより効率的に行われるようにするため、
量子化誤差データの正負の符号が調整される。この調整
について、図14を参照して説明する。
In step 148, step 10 in FIG.
In the Huffman encoding of the quantized error data in 9, in order to perform the information compression more efficiently,
The positive and negative signs of the quantization error data are adjusted. This adjustment will be described with reference to FIG.

【0059】例えば原DCT係数S(Y)uv 「95」〜
「104」を量子化係数「10」により量子化する場
合、量子化DCT係数は「10」であり、量子化誤差デ
ータQ(Y)uv/2 は「−5」〜「4」となる。一方、原D
CT係数の各数値の発生頻度は、その数値が正負いずれ
であっても、その絶対値が小さい程大きい。したがって
量子化誤差データの発生頻度分布(ヒストグラム)は、
図14(a)に示すように、−Q(Y)uv/2 からQ(Y)uv/
2 へ漸次減少する。これに対し、例えば原DCT係数S
(Y)uv 「−104」〜「−95」を量子化係数「10」
により量子化する場合、量子化DCT係数は「−10」
であり、量子化誤差データQ(Y)uv/2 は「−4」〜
「4」となる。したがって量子化誤差データのヒストグ
ラムは、図14(b)に示すように、原DCT係数の絶
対値の大きい方から小さい方に向かって、すなわち−Q
(Y)uv/2 からQ(Y)uv/2 へ漸次増大する。
For example, the original DCT coefficient S (Y) uv "95"
When "104" is quantized by the quantization coefficient "10", the quantized DCT coefficient is "10", and the quantization error data Q (Y) uv / 2 is "-5" to "4". On the other hand, Hara D
The occurrence frequency of each numerical value of the CT coefficient is higher as the absolute value is smaller, regardless of whether the numerical value is positive or negative. Therefore, the occurrence frequency distribution (histogram) of quantization error data is
As shown in FIG. 14A, -Q (Y) uv / 2 to Q (Y) uv /
It gradually decreases to 2. On the other hand, for example, the original DCT coefficient S
(Y) uv “−104” to “−95” is quantized coefficient “10”
, The quantized DCT coefficient is "-10".
And the quantized error data Q (Y) uv / 2 is from "-4" to
It becomes "4". Therefore, the histogram of the quantization error data is, as shown in FIG. 14B, from the larger absolute value of the original DCT coefficient to the smaller absolute value, that is, -Q.
It gradually increases from (Y) uv / 2 to Q (Y) uv / 2.

【0060】このように量子化誤差データのヒストグラ
ムは、原DCT係数の各数値の正負の符号によって逆の
傾向を示し、したがって量子化誤差データをジグザグス
キャンして得られたデータをハフマン符号化すると、量
子化誤差データのエントロピーが大きいために情報圧縮
の効率は必ずしも良くない。
As described above, the histogram of the quantized error data shows the opposite tendency depending on the positive / negative sign of each numerical value of the original DCT coefficient. Therefore, when the data obtained by zigzag scanning the quantized error data is Huffman coded. Since the entropy of the quantization error data is large, the efficiency of information compression is not always good.

【0061】そこでステップ148では、量子化誤差デ
ータのヒストグラムが原DCT係数の正負の符号によっ
て逆転しないようにするため、原DCT係数が負の時
は、そのDCT係数の量子化誤差データに「−1」を乗
じている。この結果、量子化誤差データの各数値の発生
頻度は、原DCT係数の数値の正負に関係なく、その絶
対値が小さい程大きくなる。これにより、図2のステッ
プ109における量子化誤差データのハフマン符号化に
おいて、量子化誤差データのエントロピーが小さくな
り、情報圧縮がより効率的に行われる。
Therefore, in step 148, in order to prevent the histogram of the quantized error data from being reversed by the positive / negative sign of the original DCT coefficient, when the original DCT coefficient is negative, the quantization error data of the DCT coefficient has "-". It is multiplied by 1. As a result, the frequency of occurrence of each numerical value of the quantized error data increases as the absolute value decreases, regardless of whether the numerical value of the original DCT coefficient is positive or negative. As a result, in the Huffman coding of the quantized error data in step 109 of FIG. 2, the entropy of the quantized error data becomes small, and the information compression is performed more efficiently.

【0062】ステップ150では、ステップ148にお
いて符号調整された量子化誤差ΔYuv、ΔCbuv、ΔCruv
にスケーリングが施される。このスケーリングとは、符
号調整をした量子化誤差データの数値において、発生頻
度の高いものほど小さい符号値を割り当てるものであ
る。例えば図3(d) の量子化テーブルQ(Y)uv によりD
CT係数S(Y)uv を量子化した場合、量子化誤差データ
ΔYuvの数値範囲が−8〜7の範囲にあるとすると、−
8→「0000」、−7→「0001」、・・・6→「1110」、
7→「1111」と置き換える。
In step 150, the quantization errors ΔYuv, ΔCbuv, ΔCruv whose codes have been adjusted in step 148 have been adjusted.
Is scaled. In this scaling, a smaller code value is assigned to a numerical value of the quantization error data whose code has been adjusted, with a higher occurrence frequency. For example, the quantization table Q (Y) uv in FIG.
When the CT coefficient S (Y) uv is quantized, if the numerical range of the quantization error data ΔYuv is in the range of −8 to 7, −
8 → “0000”, −7 → “0001”, ... 6 → “1110”,
7 → Replace with "1111".

【0063】ステップ152では、ステップ146のビ
ット割り当てに応じて再量子化された量子化誤差データ
ΔY'uv 、ΔCb'uv 、ΔCr'uv の各ビットが次のように
並び換えられる。
In step 152, each bit of the requantized quantization error data ΔY'uv, ΔCb'uv, ΔCr'uv according to the bit allocation in step 146 is rearranged as follows.

【0064】例えば、量子化誤差データΔY'uv 、ΔC
b'uv 、ΔCr'uv のビット数がステップ146のビット
割り当てに基づく再量子化により、それぞれ6、3、2
ビットになり、また、量子化誤差データΔY'uv 、ΔC
b'uv 、ΔCr'uv の1つのデータが2進数で次の様に表
されたとする。 量子化誤差データΔY'uv =Y(5)Y(4)Y(3)Y(2)Y(1)Y(0) 量子化誤差データΔCb'uv =Cb(2)Cb(1)Cb(0) 量子化誤差データΔCr'uv =Cr(1)Cr(0)
For example, the quantization error data ΔY'uv, ΔC
The number of bits of b'uv and ΔCr'uv is respectively 6, 3, 2 by the requantization based on the bit allocation in step 146.
Quantized error data ΔY'uv, ΔC
It is assumed that one piece of data b'uv and ΔCr'uv is represented in binary as follows. Quantization error data ΔY'uv = Y (5) Y (4) Y (3) Y (2) Y (1) Y (0) Quantization error data ΔCb'uv = Cb (2) Cb (1) Cb ( 0) Quantization error data ΔCr'uv = Cr (1) Cr (0)

【0065】このような量子化誤差データΔY'uv 、Δ
Cb'uv 、ΔCr'uv に対して量子化誤差データの第4コン
ポーネントΔKuvが ΔKuv=Y(5)Y(4)Y(3)Y(2)Cb(2)Y(1)Cb(1)Cr(1)Y(0)Cb
(0)Cr(0) となるように、各量子化誤差データの各ビットが並び換
えられる。
Such quantization error data ΔY'uv, Δ
The fourth component ΔKuv of the quantization error data for Cb'uv and ΔCr'uv is ΔKuv = Y (5) Y (4) Y (3) Y (2) Cb (2) Y (1) Cb (1) Cr (1) Y (0) Cb
Each bit of each quantization error data is rearranged so that it becomes (0) Cr (0).

【0066】すなわち、量子化誤差データΔY'uv 、Δ
Cb'uv 、ΔCr'uv のビット数がそれぞれk、m、n(k
≧m≧n,k+m+n=11)であるとき、図15に示
すように、第4コンポーネントΔKuvの最上位ビットか
ら第(2m+n+1)ビットまでのビット列160中
に、ビット数が最も大きい量子化誤差データΔY'uv の
先頭部分のビット列166(最上位ビットから第(m+
1)ビットまで)が配置される。
That is, the quantization error data ΔY'uv, Δ
The number of bits of Cb'uv and ΔCr'uv is k, m, and n (k
When ≧ m ≧ n, k + m + n = 11), as shown in FIG. 15, the quantization error data having the largest number of bits in the bit string 160 from the most significant bit to the (2m + n + 1) th bit of the fourth component ΔKuv. Bit string 166 at the beginning of ΔY'uv (from the most significant bit to the (m +
1) up to bits) are placed.

【0067】ビット列160に続くビット列162(第
(2m+n)ビットから第(3n+1)ビットまで)に
は、量子化誤差データΔY'uv の第mビットから第(n
+1)ビットまでのビット列168と、量子化誤差デー
タΔCb'uv の最上位ビットから第(n+1)ビットまで
のビット列168とが、Y、Cbの順に交互に並べられ
る。そして、ΔKuvの最後のビット列164(第(3
n)ビットから最下位ビットまで)には、量子化誤差デ
ータΔY'uv の第nビットから最下位ビットまでのビッ
ト列170と、量子化誤差データΔCb'uv の第nビット
から最下位ビットまでのビット列170と、量子化誤差
データΔCr'uv の全てのビット列170とが、Y、C
b、Crの順にサイクリックに並べられる。
In the bit string 162 (from the (2m + n) th bit to the (3n + 1) th bit) following the bit string 160, the mth bit to the (nth) th bit of the quantization error data ΔY′uv.
The bit string 168 up to +1) bits and the bit string 168 from the most significant bit to the (n + 1) th bit of the quantized error data ΔCb′uv are alternately arranged in the order of Y and Cb. Then, the last bit string 164 of ΔKuv (the third (3
(n) to the least significant bit), the bit string 170 from the nth bit to the least significant bit of the quantization error data ΔY'uv and the nth bit to the least significant bit of the quantization error data ΔCb'uv. The bit string 170 and all the bit strings 170 of the quantization error data ΔCr'uv are Y, C
They are cyclically arranged in the order of b and Cr.

【0068】以上のように、ステップ150のスケーリ
ングでは、量子化誤差データΔY'uv 、ΔCb'uv 、ΔC
r'uv は発生頻度の高い数値ほど小さい符号値に置き換
えられるので、各量子化誤差データの先頭ビットが1に
なる確率が低くなる。またステップ152では、量子化
誤差データΔY'uv 、ΔCb'uv 、ΔCr'uv の同じ位にあ
るビットがY、Cb、Crの順に並べられたので、第4
コンポーネントの数値はより小さなものになる。したが
って、第4コンポーネントΔKuvである量子化誤差デー
タΔY'uv 、ΔCb'uv 、ΔCr'uv のエントロピーが小さ
くなり、情報圧縮が効率的に行われることとなる。
As described above, in the scaling in step 150, the quantization error data ΔY'uv, ΔCb'uv, ΔC
Since r'uv is replaced with a smaller code value as the frequency of occurrence is higher, the probability that the leading bit of each quantized error data will be 1 becomes lower. Further, in step 152, since the bits in the same place of the quantization error data ΔY'uv, ΔCb'uv, and ΔCr'uv are arranged in the order of Y, Cb, Cr,
The number of components will be smaller. Therefore, the entropy of the quantization error data ΔY′uv, ΔCb′uv, and ΔCr′uv, which are the fourth component ΔKuv, becomes small, and the information compression is efficiently performed.

【0069】なお、第4コンポーネントΔKuvの生成に
おけるビット並び換え順序は、必ずビット数の大きい誤
差データが先となるようにする。例えば図15の例の場
合、ΔKuvのビット列162、164において、量子化
誤差データΔY'uv 、ΔCb'uv 、ΔCr'uv のビット数が
k≧m≧nであるので、必ずΔY'uv 、ΔCb'uv 、ΔC
r'uv の順序になるようにする。また、ビット数が同一
の場合、例えば量子化誤差データΔY'uv 、ΔCb'uv 、
ΔCr'uv が同一ビット数である時、必ずΔY'uvを先に
配置し、その順序は全てのΔKuvの要素において同じと
する。
The bit rearrangement order in the generation of the fourth component ΔKuv is always such that error data having a large number of bits comes first. For example, in the case of the example of FIG. 15, in the bit strings 162 and 164 of ΔKuv, the number of bits of the quantization error data ΔY′uv, ΔCb′uv, and ΔCr′uv is k ≧ m ≧ n, so that ΔY′uv and ΔCb must be set. 'uv, ΔC
Make sure they are in r'uv order. If the number of bits is the same, for example, the quantization error data ΔY'uv, ΔCb'uv,
When ΔCr′uv has the same number of bits, ΔY′uv is always arranged first, and the order is the same for all elements of ΔKuv.

【0070】このようにして得られた第4コンポーネン
トΔKuvは、図2のステップ109において、ハフマン
符号化処理回路23によりハフマン符号化され、量子化
処理回路22から出力されてハフマン符号化された第1
〜第3スキャンデータとともに、JPEGフォーマット
のイメージデータ80(図10参照)に構築されてIC
メモリカードMに記録される(図2のステップ110、
111)。なお、第4コンポーネントΔKuvのイメージ
データ80への組み込みの際に、各量子化誤差データΔ
Y'uv 、ΔCb'uv 、ΔCr'uv に割り当てたビット数
(k,m,n)の情報も組み込むものとする。
The fourth component ΔKuv thus obtained is Huffman coded by the Huffman coding processing circuit 23 in step 109 of FIG. 2 and is output from the quantization processing circuit 22 to be Huffman coded. 1
~ With the third scan data, the JPEG format image data 80 (see FIG. 10) is used to build the IC
It is recorded in the memory card M (step 110 in FIG. 2,
111). When the fourth component ΔKuv is incorporated in the image data 80, each quantization error data Δ
Information on the number of bits (k, m, n) assigned to Y'uv, ΔCb'uv, and ΔCr'uv is also incorporated.

【0071】図16は、図1の画像圧縮装置によってI
CメモリカードMに記録されたイメージデータ80から
画像を再生する画像伸張装置のブロック図である。この
図と図10を用いて、画像伸張装置の構成と作用を説明
する。
FIG. 16 is a block diagram of the image compression apparatus of FIG.
3 is a block diagram of an image decompression device that reproduces an image from image data 80 recorded in a C memory card M. FIG. The configuration and operation of the image expansion apparatus will be described with reference to this figure and FIG.

【0072】ICメモリカードMから読み出されたイメ
ージデータ80はハフマン復号化処理回路31に入力さ
れる。ハフマン復号化処理回路31では、イメージデー
タ80から第1〜第4スキャンデータ88a〜88dが
抽出されるとともに、これらのスキャンデータの符号化
に用いられたハフマン符号化テーブルの情報も抽出され
る。このハフマン符号化テーブルを用いて、第1スキャ
ンデータ88a、第2スキャンデータ88bおよび第3
スキャンデータ88cの符号化データがそれぞれ復号さ
れて量子化DCT係数が求められ、また第4スキャンデ
ータ88dの符号化データが復号されて量子化誤差デー
タが求められる。
The image data 80 read from the IC memory card M is input to the Huffman decoding processing circuit 31. The Huffman decoding processing circuit 31 extracts the first to fourth scan data 88a to 88d from the image data 80, and also extracts the information on the Huffman coding table used for coding these scan data. Using this Huffman coding table, the first scan data 88a, the second scan data 88b, and the third scan data 88b
The encoded data of the scan data 88c is decoded to obtain the quantized DCT coefficient, and the encoded data of the fourth scan data 88d is decoded to obtain the quantized error data.

【0073】量子化DCT係数は逆量子化処理回路32
に入力される。逆量子化処理回路32では、輝度信号
Y、色差信号Cb、Cr毎に、イメージデータ80に組
み込まれている量子化テーブルを用いてDCT係数が復
元される。この復元DCT係数は加算器34〜36に入
力される。なお、量子化テーブルはイメージデータ80
内に記録されている。
The quantized DCT coefficient is the inverse quantization processing circuit 32.
Entered in. The inverse quantization processing circuit 32 restores the DCT coefficient for each of the luminance signal Y and the color difference signals Cb and Cr using the quantization table incorporated in the image data 80. The restored DCT coefficient is input to the adders 34 to 36. The quantization table is the image data 80
It is recorded in.

【0074】量子化誤差データは誤差データ分解部33
に入力され、輝度信号Y、色差信号Cb、Crの量子化
誤差データΔY' 、ΔCb' 、ΔCr' が相互に分解されて
加算器34〜36に入力される。加算器34〜36で
は、逆量子化処理回路32から入力される輝度信号Y、
色差信号Cb、Crの復元DCT係数に量子化誤差デー
タΔY' 、ΔCb' 、ΔCr' が加算される。この加算によ
り得られたデータは、IDCT処理回路37において8
×8画素のブロック毎に2次元逆DCT変換され、原画
像データの輝度信号Y、色差信号Cb、Crが復元され
る。
The quantized error data is stored in the error data decomposition unit 33.
Quantization error data ΔY ′, ΔCb ′, and ΔCr ′ of the luminance signal Y and the color difference signals Cb and Cr are decomposed into each other and input to the adders 34 to 36. In the adders 34 to 36, the luminance signal Y input from the inverse quantization processing circuit 32,
The quantized error data ΔY ′, ΔCb ′, and ΔCr ′ are added to the restored DCT coefficients of the color difference signals Cb and Cr. The data obtained by this addition is stored in the IDCT processing circuit 37 as 8
Two-dimensional inverse DCT conversion is performed for each block of × 8 pixels, and the luminance signal Y and the color difference signals Cb and Cr of the original image data are restored.

【0075】この原画像データの輝度信号Y、色差信号
Cb、Crは、8×8画素のブロック毎に分割されて画
像メモリ38に入力される。画像メモリ38に1画像分
のデータ蓄積が完了されると、通常の映像信号と同じス
キャン方法で輝度信号Yおよび色差信号Cb、Crのデ
ータが同時に読み出され、D/A変換器39に入力され
てアナログ信号の映像信号に変換される。このアナログ
の輝度信号Yおよび色差信号Cb、Crは、必要に応じ
て図示しない回路によりコンポジットビデオ信号等に変
換されてディスプレイ40に出力される。
The luminance signal Y and the color difference signals Cb, Cr of the original image data are divided into blocks of 8 × 8 pixels and input to the image memory 38. When the data storage for one image is completed in the image memory 38, the data of the luminance signal Y and the data of the color difference signals Cb and Cr are simultaneously read by the same scanning method as the normal video signal and input to the D / A converter 39. It is converted into an analog video signal. The analog luminance signal Y and the color difference signals Cb and Cr are converted into a composite video signal or the like by a circuit (not shown) as necessary and output to the display 40.

【0076】次に図16に示す画像伸張装置の動作を、
図17および図18のフローチャートと図11を用いて
説明する。
Next, the operation of the image decompression device shown in FIG.
This will be described with reference to the flowcharts of FIGS. 17 and 18 and FIG.

【0077】ステップ170では、イメージデータ80
がICメモリカードMから読み出される。このイメージ
データ80の第1〜第3コンポーネントは、ステップ1
72において、ハフマン復号化処理回路31に入力さ
れ、これにより8×8画素のブロックにより構成される
量子化DCT係数R'(Y)uv, R'(Cb)uv,R'(Cr)uv が復
号される(図11(a))。この量子化DCT係数R'
(Y)uv, R'(Cb)uv,R'(Cr)uv は、ステップ174にお
いて逆量子化処理回路32に入力され、イメージデータ
80に組み込まれている量子化テーブルを用いて逆量子
化される。これによりDCT係数S'(Y)uv、S'(Cb)uv
、S'(Cr)uv が復元される(図11(b))。
In step 170, the image data 80
Is read from the IC memory card M. The first to third components of this image data 80 are step 1
At 72, the quantized DCT coefficients R ′ (Y) uv, R ′ (Cb) uv, R ′ (Cr) uv, which are input to the Huffman decoding processing circuit 31 and are composed of blocks of 8 × 8 pixels, are input. It is decrypted (FIG. 11 (a)). This quantized DCT coefficient R '
(Y) uv, R '(Cb) uv, R' (Cr) uv are input to the inverse quantization processing circuit 32 in step 174 and inversely quantized using the quantization table incorporated in the image data 80. To be done. As a result, the DCT coefficients S '(Y) uv, S' (Cb) uv
, S ′ (Cr) uv are restored (FIG. 11 (b)).

【0078】一方、ハフマン復号化処理回路31によっ
て復号された第4コンポーネントΔKuvは、ステップ1
82において誤差データ分解部33に入力される。この
誤差データ分解部33では、量子化誤差データΔY'uv
、ΔCb'uv 、ΔCr'uv が求められる。またステップ1
82では、量子化誤差データが再量子化されている場合
には、逆量子化が行われて量子化誤差データΔY"uv 、
ΔCb"uv 、ΔCr"uv が復元される。
On the other hand, the fourth component ΔKuv decoded by the Huffman decoding processing circuit 31 is
At 82, it is input to the error data decomposition unit 33. In the error data decomposition unit 33, the quantized error data ΔY'uv
, ΔCb'uv, ΔCr'uv are obtained. Also step 1
At 82, if the quantized error data is requantized, dequantization is performed and the quantized error data ΔY ″ uv,
ΔCb "uv and ΔCr" uv are restored.

【0079】この量子化誤差データΔY"uv 、ΔCb"uv
、ΔCr"uv の復元を、図18に示す処理ルーチンのフ
ローチャートを用いて説明する。
The quantization error data ΔY "uv, ΔCb" uv
, ΔCr ″ uv will be described with reference to the flowchart of the processing routine shown in FIG.

【0080】ステップ184では、イメージデータ80
に組み込まれた各量子化誤差データの割り当てビット数
(k,m,n)に基づいて、図15に示すような形態を
有する第4コンポーネントΔKuvのビット列が輝度信号
Y、色差信号Cb、Cr毎に再配置され、量子化誤差デ
ータΔY"uv 、ΔCb"uv 、ΔCr"uv が抽出される。ステ
ップ186では、イメージデータ80に組み込まれてい
る量子化テーブルを用いて、図13のステップ150で
行われたスケーリングの修正が行われる。例えば、量子
化誤差データΔY'uv が(14)式による再量子化によ
って8ビットから6ビットに変更され、また復号したデ
ータが「000000」の場合を想定する。量子化係数QY
245 、量子化誤差ΔYuv>0の場合、「000000」は、再
量子化誤差が最小(負で絶対値が最も大きい)を意味
し、この再量子化誤差データは、ΔY"uv =−QY /2/2
2 =−30である。したがって再量子化される前の量子
化誤差データΔY'uv は、6ビットから8ビットに修正
するため「4」を「−30」に掛け、これにより−12
0となる。
In step 184, the image data 80
Based on the allocated bit number (k, m, n) of each quantized error data incorporated in, the bit string of the fourth component ΔKuv having the form as shown in FIG. 15 is obtained for each of the luminance signal Y, the color difference signals Cb, Cr. And the quantization error data ΔY "uv, ΔCb" uv, and ΔCr "uv are extracted.At step 186, at step 150 of FIG. The scaling corrections performed are performed, for example, suppose that the quantization error data ΔY′uv is changed from 8 bits to 6 bits by requantization according to equation (14), and the decoded data is “000000”. To do. Quantization coefficient Q Y =
245, when the quantization error ΔYuv> 0, “000000” means that the requantization error is the minimum (negative and the absolute value is the largest), and this requantization error data is ΔY ″ uv = −Q Y / 2/2
2 = −30. Therefore, the quantization error data ΔY'uv before being requantized is multiplied by "-4" by "-30" in order to correct it from 6 bits to 8 bits.
It becomes 0.

【0081】スケーリング修正の後、ステップ188で
は、(11)〜(13)式により求められるBY
Cb、BCrとビット数(k,m,n)とに基づいて、量
子化誤差データΔY"uv 、ΔCb"uv 、ΔCr"uv が求めら
れる。ここで、量子化誤差データΔYuv、ΔCbuv、ΔCr
uvの量子化が行われていた場合には、逆量子化が行われ
た後、量子化誤差データΔY"uv 、ΔCb"uv 、ΔCr"uv
が求められる。また、逆量子化処理回路32によって求
められたDCT変換係数S'(Y)uv、S'(Cb)uv 、S'(C
r)uv の正負の符号から、量子化誤差データΔY"uv 、
ΔCb"uv 、ΔCr"uv の符号が修正される。
After the scaling correction, in step 188, B Y obtained by the equations (11) to (13),
Based on B Cb and B Cr and the number of bits (k, m, n), the quantized error data ΔY ″ uv, ΔCb ”uv and ΔCr” uv are obtained, where the quantized error data ΔYuv and ΔCbuv, ΔCr
If the uv has been quantized, the quantization error data ΔY "uv, ΔCb" uv, ΔCr "uv after the inverse quantization is performed.
Is required. Further, the DCT transform coefficients S ′ (Y) uv, S ′ (Cb) uv, S ′ (C
r) From the positive and negative signs of uv, the quantization error data ΔY "uv,
The signs of ΔCb "uv and ΔCr" uv are corrected.

【0082】再び図17を参照する。ステップ176で
は、ステップ188において求められた量子化誤差デー
タΔY"uv 、ΔCb"uv 、ΔCr"uv が加算器34、35、
36に入力され、逆量子化処理回路32から入力された
復元DCT係数S'(Y)uv、S'(Cb)uv 、S'(Cr)uv に加
算される。この加算結果であるDCT係数S'(Y)uv,S'
(Cb)uv,S'(Cr)uv は、ステップ178において、8×
8画素のブロック毎に下記の(17)式で表される逆離
散コサイン変換が施され、これにより画像データP'(Y)
xy, P'(Cb)xy,P'(Cr)xy が復元される(図11
(c))。
Referring again to FIG. In step 176, the quantization error data ΔY ″ uv, ΔCb ”uv, and ΔCr” uv obtained in step 188 are added to the adders 34, 35,
The restored DCT coefficients S ′ (Y) uv, S ′ (Cb) uv, and S ′ (Cr) uv input to the inverse quantization processing circuit 32 are added to the input 36. The DCT coefficient S '(Y) uv, S' that is the result of this addition
(Cb) uv, S ′ (Cr) uv is 8 × in step 178.
The inverse discrete cosine transform represented by the following equation (17) is applied to each block of 8 pixels, and the image data P ′ (Y) is thereby obtained.
xy, P '(Cb) xy, P' (Cr) xy are restored (Fig. 11
(C)).

【0083】[0083]

【数2】 [Equation 2]

【0084】復元画像データP'(Y)xy、P'(Cb)xy 、
P'(Cr)xy はブロック毎に画像メモリ38に順次書き込
まれ、蓄積される。画像メモリ38に1画像分の画像デ
ータが蓄積されると、ステップ180では、図1の画像
メモリ14への原画像データ書き込みと同じ順序で、画
像データが画像メモリ38から読み出され、D/A変換
器39においてアナログ信号の映像信号に変換されて、
ディスプレイ40に表示される。
Restored image data P '(Y) xy, P' (Cb) xy,
P ′ (Cr) xy is sequentially written and accumulated in the image memory 38 for each block. When the image data for one image is stored in the image memory 38, in step 180, the image data is read from the image memory 38 in the same order as the original image data writing to the image memory 14 in FIG. After being converted into an analog video signal in the A converter 39,
It is displayed on the display 40.

【0085】以上のように本実施例は、量子化あるいは
DCT変換によって失われる原画像情報を誤差データと
してJPEGフォーマットの第4コンポーネント内に格
納し、ICメモリカードMに記録したものである。した
がって、第1〜第3コンポーネントのみを使用して画像
を再生する装置によっても画像を復元でき、また図16
に示す再生装置であれば、さらに高画質の画像を再生す
ることができる。
As described above, in this embodiment, the original image information lost by the quantization or DCT conversion is stored as error data in the fourth component of the JPEG format and recorded in the IC memory card M. Therefore, the image can be restored by a device that reproduces the image using only the first to third components, and FIG.
With the reproducing device shown in FIG. 1, it is possible to reproduce higher quality images.

【0086】また本実施例では、第4コンポーネントに
格納される誤差データは、再生画像の視覚特性に最も影
響を与えるのは輝度信号Yに関して、多くのビット数が
割り当てられているので、画像圧縮に伴う画質劣化をさ
らに低くすることができる。さらに第4コンポーネント
のエントロピーをより小さくする処理を施したので、第
4コンポーネントの増加に伴うICメモリカードMのメ
モリ占有量を最小限に抑えることができる。
In the present embodiment, the error data stored in the fourth component is assigned a large number of bits for the luminance signal Y that most affects the visual characteristics of the reproduced image. It is possible to further reduce the deterioration of image quality due to. Further, since the processing for reducing the entropy of the fourth component is performed, the memory occupation amount of the IC memory card M due to the increase of the fourth component can be minimized.

【0087】図19は、本発明の第2実施例に係る画像
圧縮装置のブロック図である。第2実施例においては、
図1の第1実施例と異なり、A/D変換器13から出力
される色信号R、G、Bをそのまま画像メモリ14に蓄
積し、DCT処理回路21、量子化処理回路22、逆量
子化処理回路24、ビット配分処理・誤差データ合成部
25およびハフマン符号化処理回路23では、各色信号
R、G、Bを符号化してICメモリカードMに記録して
いる。なお、DCT処理回路21、量子化処理回路2
2、逆量子化処理回路24、ビット配分処理・誤差デー
タ合成部25およびハフマン符号化処理回路23での処
理は、第1実施例と同様である。
FIG. 19 is a block diagram of an image compression apparatus according to the second embodiment of the present invention. In the second embodiment,
Unlike the first embodiment of FIG. 1, the color signals R, G and B output from the A / D converter 13 are directly stored in the image memory 14, and the DCT processing circuit 21, the quantization processing circuit 22 and the dequantization are performed. In the processing circuit 24, the bit allocation processing / error data synthesizing unit 25, and the Huffman coding processing circuit 23, each color signal R, G, B is coded and recorded in the IC memory card M. The DCT processing circuit 21 and the quantization processing circuit 2
2. The processing in the inverse quantization processing circuit 24, the bit allocation processing / error data synthesis unit 25, and the Huffman coding processing circuit 23 is the same as that in the first embodiment.

【0088】図20は第2実施例の画像伸張装置のブロ
ック図である。この画像伸張装置では、図19の画像圧
縮装置によってICメモリカードMに記録されたJPE
Gフォーマットのイメージデータ80から、色信号R、
G、Bによって構成される画像が再生される。なお、こ
の図において、図16の第1実施例の画像伸張装置の回
路に対応する回路には同一符号を付している。
FIG. 20 is a block diagram of the image expansion apparatus of the second embodiment. In this image decompression device, the JPE recorded in the IC memory card M by the image compression device of FIG.
From the G format image data 80, the color signal R,
The image composed of G and B is reproduced. In this figure, the circuits corresponding to those of the image expanding apparatus of the first embodiment of FIG. 16 are designated by the same reference numerals.

【0089】第2実施例の画像伸張装置は、色信号R、
G、Bが処理される点を除いて、第1実施例と同じであ
る。
The image expanding apparatus of the second embodiment is such that the color signals R,
This is the same as the first embodiment except that G and B are processed.

【0090】図21は、本発明の第3実施例に係る画像
圧縮装置のブロック図である。この図において、第1実
施例および第2実施例と同一回路には同一符号が付され
ている。
FIG. 21 is a block diagram of an image compression apparatus according to the third embodiment of the present invention. In this figure, the same circuits as those in the first and second embodiments are designated by the same reference numerals.

【0091】第3実施例では、JPEGフォーマットの
第4コンポーネントに格納される量子化誤差データは、
DCT変換前の原画像データと、DCT変換および量子
化後の量子化DCT係数から復元した画像データとの差
分から求められる。換言すると、DCT変換および量子
化によって失われる原画像データの情報が誤差データと
して第4コンポーネントに格納する。
In the third embodiment, the quantization error data stored in the fourth component of the JPEG format is
It is obtained from the difference between the original image data before the DCT transformation and the image data restored from the quantized DCT coefficient after the DCT transformation and the quantization. In other words, the information of the original image data lost by the DCT transform and the quantization is stored in the fourth component as error data.

【0092】すなわち、画像メモリ14から読み出され
た原画像の輝度信号Y、色差信号Cb、Crのデータ
は、DCT処理回路21と量子化処理回路22により処
理され、量子化DCT係数として逆量子化処理回路24
に入力される。この量子化DCT係数は、逆量子化処理
回路24とIDCT処理回路37により処理され、輝度
信号Y、色差信号Cb、Crの復元画像データとして減
算器26、27、28に入力される。一方、画像メモリ
14から読み出された原画像データである輝度信号Y、
色差信号Cb、Crは直接、減算器26、27、28に
入力され、したがって、原画像データと復元画像データ
の差である誤差データが1画素毎に求められる。
That is, the data of the luminance signal Y and the color difference signals Cb and Cr of the original image read out from the image memory 14 are processed by the DCT processing circuit 21 and the quantization processing circuit 22 and inverse quantized as quantized DCT coefficients. Conversion processing circuit 24
Entered in. The quantized DCT coefficient is processed by the inverse quantization processing circuit 24 and the IDCT processing circuit 37, and is input to the subtracters 26, 27 and 28 as restored image data of the luminance signal Y and the color difference signals Cb and Cr. On the other hand, the luminance signal Y, which is the original image data read from the image memory 14,
The color difference signals Cb, Cr are directly input to the subtractors 26, 27, 28, and therefore the error data which is the difference between the original image data and the restored image data is obtained for each pixel.

【0093】データ生成部41では、輝度信号Y、色差
信号Cb、Crの誤差データが、第1、第2実施例と同
様に、必要に応じて量子化されるとともに、再配置され
て11ビット固定長データの第4コンポーネントに変換
され、ハフマン符号化処理回路23に入力される。ハフ
マン符号化処理回路23においてハフマン符号化された
誤差データは、JPEGフォーマットの第4スキャンデ
ータとしてICメモリカードMに記録される。
In the data generator 41, the error data of the luminance signal Y and the color difference signals Cb and Cr are quantized as necessary and rearranged to 11 bits as in the first and second embodiments. It is converted into the fourth component of fixed length data and input to the Huffman coding processing circuit 23. The error data Huffman-encoded by the Huffman-encoding processing circuit 23 is recorded in the IC memory card M as the fourth scan data in the JPEG format.

【0094】図22は、第3実施例における画像伸張装
置のブロック図である。ICメモリカードMから読み出
されたJPEGフォーマットの各スキャンデータは、ハ
フマン復号化処理回路31において処理され、輝度信号
Y、色差信号Cb、Crの量子化DCT係数と誤差デー
タが復号される。量子化DCT係数は逆量子化処理回路
32において、イメージデータ80内に組み込まれてい
る量子化テーブル情報に基づいて復元され、復元DCT
係数としてIDCT処理回路37に入力される。復元D
CT係数は、IDCT処理回路37において逆DCT変
換を施され、これにより輝度信号Y、色差信号Cb、C
rが求められる。この輝度信号Y、色差信号Cb、Cr
は加算器34、35、36に入力される。一方ハフマン
復号化処理回路31から出力された誤差データは、デー
タ分離部42において、各画素位置毎に輝度信号Y、色
差信号Cb、Crの誤差データに分離され、加算器3
4、35、36に入力される。
FIG. 22 is a block diagram of an image expansion device in the third embodiment. Each scan data of the JPEG format read from the IC memory card M is processed by the Huffman decoding processing circuit 31, and the quantized DCT coefficient of the luminance signal Y and the color difference signals Cb, Cr and the error data are decoded. The quantized DCT coefficient is restored by the inverse quantization processing circuit 32 based on the quantization table information incorporated in the image data 80, and the restored DCT coefficient is restored.
The coefficient is input to the IDCT processing circuit 37. Restore D
The CT coefficient is subjected to inverse DCT conversion in the IDCT processing circuit 37, whereby the luminance signal Y and the color difference signals Cb and C are obtained.
r is required. The luminance signal Y and the color difference signals Cb and Cr
Is input to the adders 34, 35 and 36. On the other hand, the error data output from the Huffman decoding processing circuit 31 is separated into error data of the luminance signal Y and the color difference signals Cb and Cr for each pixel position in the data separation unit 42, and the adder 3
4, 35, 36 are input.

【0095】加算器34、35、36において、輝度信
号Y、色差信号Cb、Crと、これらに対応した誤差デ
ータが相互に加算され、画像メモリ38に順次書き込ま
れる。画像メモリ38に1画像分の輝度信号Yおよび色
差信号Cb、Crのデータが蓄積されると、第1、2実
施例と同じように、D/A変換器39においてアナログ
信号に変換され、ディスプレイ40に出力される。
In the adders 34, 35 and 36, the luminance signal Y, the color difference signals Cb and Cr and the error data corresponding to these are added to each other and written sequentially in the image memory 38. When the data of the luminance signal Y and the color difference signals Cb and Cr for one image is accumulated in the image memory 38, it is converted into an analog signal in the D / A converter 39 and displayed as in the first and second embodiments. 40 is output.

【0096】図23は、第1、第2、第3実施例の画像
圧縮装置によりICメモリカードMに記録されたイメー
ジデータ80の第1、第2、第3コンポーネントから量
子化誤差データ等を用いずに画像を再生する画像伸張装
置のブロック構成図を示している。
FIG. 23 shows the quantization error data and the like from the first, second and third components of the image data 80 recorded in the IC memory card M by the image compression apparatus of the first, second and third embodiments. The block block diagram of the image expansion apparatus which reproduces an image without using is shown.

【0097】図23の画像伸張装置では、ICメモリカ
ードMから読み出されたイメージデータ80の第1〜第
3スキャンデータ88a、88b、88cのみが分離さ
れてハフマン復号化処理回路31に入力される。ハフマ
ン復号化処理回路31では、スキャンデータ88a〜8
8cから、第1、第2、第3実施例と同じように量子化
DCT係数が復元され、逆量子化処理回路32に入力さ
れる。逆量子化処理回路32に入力された量子化DCT
係数は、量子化テーブルを用いてDCT係数に復元さ
れ、IDCT処理回路37に入力される。IDCT処理
回路37では、8×8画素のブロック毎にDCT係数が
逆DCT変換され、画像データの輝度信号Y、色差信号
Cb、Crが復元される。これらの信号は、画像メモリ
38に順次入力され、1画像分の信号が画像メモリ38
に蓄えられると、D/A変換器39においてアナログ信
号に変換され、ディスプレイ40に出力される。
23, only the first to third scan data 88a, 88b, 88c of the image data 80 read from the IC memory card M are separated and input to the Huffman decoding processing circuit 31. It In the Huffman decoding processing circuit 31, the scan data 88a-8
The quantized DCT coefficient is restored from 8c in the same manner as in the first, second and third embodiments, and is input to the inverse quantization processing circuit 32. Quantized DCT input to the inverse quantization processing circuit 32
The coefficient is restored to a DCT coefficient using the quantization table and input to the IDCT processing circuit 37. In the IDCT processing circuit 37, the DCT coefficient is inversely DCT-converted for each block of 8 × 8 pixels, and the luminance signal Y and the color difference signals Cb and Cr of the image data are restored. These signals are sequentially input to the image memory 38, and signals for one image are stored in the image memory 38.
When stored in, the D / A converter 39 converts the analog signal into an analog signal and outputs the analog signal to the display 40.

【0098】さて、第1〜第3実施例では、量子化誤差
データΔYuv、ΔCbuv、ΔCruvの取りうる最大ビット数
Y 、BCb、BCrの総和が、DC係数の量子化誤差デー
タに関しては12ビットを越えた場合、またAC係数の
量子化誤差データに関しては11ビットを越えた場合、
各量子化誤差データのビット数は(14)〜(16)式
に基づいて調整されていた。例えば図24(a)に示す
ように、輝度信号Yについては、量子化テーブルQ(Y)u
v の量子化係数の最大値は「 121」であり、量子化誤差
データΔYuvの全ての構成要素は、(11)式に基づい
て、ビット数が7ビットになるように再量子化されてい
た。
[0098] Now, in the first to third embodiment, the quantization error data ΔYuv, ΔCbuv, maximum number of bits B Y which can take ΔCruv, B Cb, the sum of B Cr, with respect to the quantization error data of the DC coefficients If it exceeds 12 bits, or if it exceeds 11 bits for the quantization error data of the AC coefficient,
The number of bits of each quantization error data was adjusted based on the equations (14) to (16). For example, as shown in FIG. 24A, for the luminance signal Y, the quantization table Q (Y) u
The maximum value of the quantized coefficient of v is "121", and all the constituent elements of the quantized error data ΔYuv have been re-quantized so that the number of bits becomes 7 based on the equation (11). .

【0099】一方、例えば量子化係数「16」について
は、量子化誤差データΔYuvのビット数は4ビットであ
り、これを格納するためには、7ビットも必要ない。す
なわち各量子化係数の数値は大きく異なり、数値の小さ
い量子化係数に関しては、さらに短いビット数になるよ
うに再量子化することができ、したがってJPEGフォ
ーマットの第4コンポーネントの利用効率を、第1〜第
3実施例よりもさらに向上させることが可能である。以
下に述べる第4および第5実施例は、第4コンポーネン
トをさらに効率的に利用するための構成を有している。
On the other hand, for the quantization coefficient "16", for example, the number of bits of the quantization error data ΔYuv is 4 bits, and 7 bits are not necessary to store this. That is, the numerical values of the quantized coefficients are greatly different, and the quantized coefficient having a small numerical value can be re-quantized so as to have a shorter bit number. -It is possible to improve further than the third embodiment. The fourth and fifth embodiments described below have a configuration for more efficiently using the fourth component.

【0100】図25および図26は、第4実施例におい
て量子化誤差データを生成する処理ルーチンを示すフロ
ーチャートである。ステップ201ではパラメータvが
「0」に定められ、ステップ202ではパラメータuが
「0」に定められる。パラメータu、vは、図24
(a)、(b)に示す量子化テーブルの横方向と縦方向
の画素位置をそれぞれ示し、また「0」〜「7」の値を
とる。量子化テーブルにおいてパラメータu、vがとも
に「0」である画素位置にはDC係数が格納され、それ
以外の画素位置にはAC係数が格納されている。
25 and 26 are flowcharts showing the processing routine for generating the quantized error data in the fourth embodiment. In step 201, the parameter v is set to "0", and in step 202, the parameter u is set to "0". The parameters u and v are as shown in FIG.
Pixel positions in the horizontal and vertical directions of the quantization tables shown in (a) and (b) are respectively shown, and the values are "0" to "7". In the quantization table, DC coefficients are stored at pixel positions where both parameters u and v are “0”, and AC coefficients are stored at other pixel positions.

【0101】ステップ203では、量子化誤差データΔ
Yuv、ΔCbuv、ΔCruvを格納するために必要なビット数
Y 、BCb、BCrが第1実施例と同様に、(11)〜
(13)式を用いて計算される。図24に示す量子化テ
ーブルのDC係数の場合、量子化係数Q(Y)00 =16、
Q(Cb)00=Q(Cr)00=17であるので、図28に示すよ
うに、必要ビット数はそれぞれBY =4、BCb=BCr
5となる。ステップ204では、これらの必要ビット数
Y 、BCb、BCrの総和Ball が計算され、図24のD
C係数の場合、必要ビット数の総和Ball は「14」で
ある。
At step 203, the quantization error data Δ
The number of bits B Y , B Cb , and B Cr required to store Yuv, ΔCbuv, and ΔCruv are (11) to
It is calculated using the equation (13). In the case of the DC coefficient of the quantization table shown in FIG. 24, the quantization coefficient Q (Y) 00 = 16,
Since Q (Cb) 00 = Q (Cr) 00 = 17, the required bit numbers are B Y = 4 and B Cb = B Cr =, respectively, as shown in FIG.
It becomes 5. In step 204, the total sum B all of these required number of bits B Y , B Cb , and B Cr is calculated, and D of FIG.
In the case of the C coefficient, the total number of required bits B all is “14”.

【0102】ステップ205では、総和Ball が、量子
化誤差データΔYuvに割り当てられる設定ビット数SY
と、量子化誤差データΔCbuvに割り当てられる設定ビッ
ト数SCbと、量子化誤差データΔCruvに割り当てられる
設定ビット数SCrとの総和Sall よりも大きいか否かが
判定される。設定ビット数の総和Sall は、AC係数の
場合「11」であり、DC係数の場合「12」である。
したがって図24のDC係数の場合、必要ビット数の総
和Ball が「14」であり、設定ビット数の総和Sall
よりも大きいので、ステップ206以下が実行され、必
要ビット数BY、BCb、BCrが、それぞれ設定ビット数
Y 、SCb、SCrよりも大きいか否かが判定される。
In step 205, the total sum B all is the set bit number S Y assigned to the quantization error data ΔYuv.
Then, it is determined whether or not it is larger than the sum S all of the setting bit number S Cb assigned to the quantization error data ΔCbuv and the setting bit number S Cr assigned to the quantization error data ΔCruv. The sum S all of the set number of bits is “11” for the AC coefficient and “12” for the DC coefficient.
Therefore, in the case of the DC coefficient in FIG. 24, the total sum B all of the required bits is “14”, and the total sum S all of the set bits is S all.
Therefore, step 206 and the following steps are executed, and it is determined whether or not the required bit numbers B Y , B Cb , and B Cr are larger than the set bit numbers S Y , S Cb , and S Cr , respectively.

【0103】なお各量子化誤差データのビット配分とし
て、DC係数に関しては、例えば、量子化誤差データΔ
Yuvの設定ビット数SY は「6」、量子化誤差データΔ
Cbuv、ΔCruvの設定ビット数SCb、SCrはそれぞれ
「3」に定められる。またAC係数に関しては、例え
ば、量子化誤差データΔYuvの設定ビット数SY
「5」、量子化誤差データΔCbuv、ΔCruvの設定ビット
数SCb、SCrはそれぞれ「3」に定められる。
As the bit distribution of each quantization error data, regarding the DC coefficient, for example, the quantization error data Δ
Yuv setting bit number S Y is “6”, quantization error data Δ
The set bit numbers S Cb and S Cr of Cbuv and ΔCruv are set to “3”, respectively. Regarding the AC coefficient, for example, the set bit number S Y of the quantized error data ΔYuv is set to “5”, and the set bit numbers S Cb and S Cr of the quantized error data ΔCbuv and ΔCruv are set to “3”, respectively.

【0104】ステップ206では、量子化誤差データΔ
Yuvの必要ビット数BY が設定ビット数SY よりも大き
いか否かが判定される。図24(a)のDC係数の場
合、BY =4、SY =6であり、必要ビット数の方が小
さく、再量子化を行う必要はない。
At step 206, the quantization error data Δ
It is determined whether the required bit number BY of Yuv is larger than the set bit number S Y. In the case of the DC coefficient in FIG. 24A, B Y = 4 and S Y = 6, the required number of bits is smaller, and it is not necessary to perform requantization.

【0105】したがってこの場合、ステップ208へ進
み、量子化誤差データΔCbuvの必要ビット数BCbが設定
ビット数SCbよりも大きいか否かが判定される。図24
(b)のDC係数の場合、BCb=5、SCb=3であり、
必要ビット数の方が大きい。したがってこの場合、ステ
ップ209において再量子化が行われる。すなわち、設
定ビット数SCbが量子化誤差データΔCbuvの最大ビット
数B'Cbとして定められ、量子化誤差データΔCbuvは再
量子化係数F(BCb, B'Cb) によって割算されて再量
子化される。再量子化係数F(BCb, B'Cb) は、量子
化誤差データΔCbuvのビット数をBCbからB'Cbへ変化
させるための量子化値を有し、図24(b)のDC係数
の場合、5ビットから3ビットへ変化させるため、図2
7において符号F1により示すように、再量子化係数F
(BCb, B'Cb) は「5」に定められる。
Therefore, in this case, the routine proceeds to step 208, where it is judged whether or not the required bit number B Cb of the quantized error data ΔCbuv is larger than the set bit number S Cb . Figure 24
In the case of the DC coefficient of (b), B Cb = 5 and S Cb = 3,
The required number of bits is larger. Therefore, in this case, requantization is performed in step 209. That is, the set bit number S Cb is defined as the maximum bit number B ′ Cb of the quantization error data ΔCbuv, and the quantization error data ΔCbuv is divided by the requantization coefficient F (B Cb , B ′ Cb ) to be requantized. Be converted. The requantization coefficient F (B Cb , B ′ Cb ) has a quantization value for changing the number of bits of the quantization error data ΔCbuv from B Cb to B ′ Cb, and the DC coefficient of FIG. In the case of, in order to change from 5 bits to 3 bits,
7, the requantization factor F
(B Cb , B ′ Cb ) is set to “5”.

【0106】ステップ210では、量子化誤差データΔ
Cruvの必要ビット数BCrが設定ビット数SCrよりも大き
いか否かが判定され、量子化誤差データΔCbuvと同様な
処理が行われる。すなわち図24(b)のDC係数の場
合、必要ビット数の方が大きいので、ステップ211に
おいて再量子化が行われ、再量子化係数F(BCr, B'
Cr) は「5」である。
At step 210, the quantization error data Δ
It is determined whether the required number of bits B Cr of Cruv is larger than the set number of bits S Cr , and the same processing as the quantization error data ΔCbuv is performed. That is, in the case of the DC coefficient of FIG. 24 (b), since the required number of bits is larger, requantization is performed in step 211, and the requantization coefficient F (B Cr , B '
Cr ) is "5".

【0107】そしてステップ212では、量子化誤差デ
ータΔYuv、ΔCbuv、ΔCruvの順に配列された固定長の
ビット列が生成される。この固定長は、DC係数では
「12」、AC係数では「11」である。なお、ステッ
プ212における配列に代えて、図15に示すようなサ
イクリックな配列にしてもよく、これによりエントロピ
ーを減少させることができる。ステップ213では、パ
ラメータuが「1」だけインクリメントされる。パラメ
ータuが7以下である場合、ステップ214からステッ
プ203へ戻り、ステップ203以下が実行される。
Then, in step 212, a fixed length bit string in which the quantized error data ΔYuv, ΔCbuv, and ΔCruv are arranged in this order is generated. This fixed length is "12" for the DC coefficient and "11" for the AC coefficient. Note that the arrangement in step 212 may be replaced by a cyclic arrangement as shown in FIG. 15, which can reduce entropy. In step 213, the parameter u is incremented by "1". If the parameter u is 7 or less, the process returns from step 214 to step 203, and steps 203 and subsequent steps are executed.

【0108】ステップ203では、上述と同じ処理が行
われる。図24に示す量子化テーブルにおいて、例えば
パラメータuが「4」であり、パラメータvが「0」で
ある場合、量子化係数Q(Y)40 =24、Q(Cb)40=Q(C
r)30=99であるので、図28に示すように、必要ビッ
ト数はそれぞれBY =5、BCb=BCr=7となる。また
ステップ204では、これらの必要ビット数BY
Cb、BCrの総和Ball が計算され、必要ビット数の総
和Ball は「24」である。
At step 203, the same processing as described above is performed. In the quantization table shown in FIG. 24, for example, when the parameter u is “4” and the parameter v is “0”, the quantization coefficient Q (Y) 40 = 24, Q (Cb) 40 = Q (C
Since r) 30 = 99, the required bit numbers are B Y = 5 and B Cb = B Cr = 7, respectively, as shown in FIG. In step 204, the required number of bits B Y ,
B Cb, sum B all of B Cr is calculated, the sum B all of the required number of bits is "24".

【0109】ステップ205では、総和Ball が設定ビ
ット数の総和Sall よりも大きいか否かが判定される。
設定ビット数の総和Sall は、AC係数の場合「11」
であるので、パラメータu、vがそれぞれ「4」、
「0」である場合は、必要ビット数の総和Ball は設定
ビット数の総和Sall よりも大きく、ステップ206以
下が実行される。
At step 205, it is judged whether the total sum B all is larger than the total sum S all of the set number of bits.
The sum S all of the number of set bits is “11” in the case of AC coefficient.
Therefore, the parameters u and v are “4”,
If it is “0”, the total sum B all of the required number of bits is larger than the total sum S all of the set number of bits, and step 206 and subsequent steps are executed.

【0110】ステップ206では、量子化誤差データΔ
Yuvの必要ビット数BY が設定ビット数SY よりも大き
いか否かが判定される。図24においてパラメータu、
vがそれぞれ「4」、「0」である場合、必要ビット数
Y =5、設定ビット数SY=5であり、必要ビット数
は設定ビット数に等しく、この場合は再量子化を行う必
要はないので、次にステップ208以下が実行される。
ステップ208〜211では、DC係数と同様に、量子
化誤差データΔCbuv、ΔCruvの再量子化が行われ、量子
化誤差データΔCbuv、ΔCruvのビット数はそれぞれ7ビ
ットから3ビットに変化する。
At step 206, the quantization error data Δ
It is determined whether or not the required number of bits BY of Yuv is larger than the set number of bits S Y. In FIG. 24, the parameter u,
When v is "4" and "0", respectively, the required number of bits B Y = 5 and the set number of bits S Y = 5, the required number of bits is equal to the set number of bits, and in this case, requantization is performed. Since it is not necessary, steps 208 et seq. Are executed next.
In steps 208 to 211, the quantization error data ΔCbuv and ΔCruv are requantized similarly to the DC coefficient, and the number of bits of the quantization error data ΔCbuv and ΔCruv is changed from 7 bits to 3 bits.

【0111】ステップ212においてビット列が生成さ
れた後、ステップ214においてパラメータuが「7」
よりも大きいと判定された場合、ステップ215におい
てパラメータvが「1」だけインクリメントされる。ス
テップ216ではパラメータvが「7」よりも大きいか
否かが判定され、パラメータvが「7」以下である場
合、ステップ202へ戻り、上述した処理が行われる。
After the bit string is generated in step 212, the parameter u is set to "7" in step 214.
If it is determined that the parameter v is larger than the value, the parameter v is incremented by “1” in step 215. In step 216, it is determined whether or not the parameter v is larger than “7”. If the parameter v is equal to or smaller than “7”, the process returns to step 202 and the above-mentioned processing is performed.

【0112】ステップ216においてパラメータvが
「7」よりも大きいと判定された場合、この処理ルーチ
ンは終了する。
When it is determined in step 216 that the parameter v is larger than "7", this processing routine ends.

【0113】以上のように第4実施例では、量子化誤差
データΔYuv、ΔCbuv、ΔCruvを格納するために必要な
ビット数の総和Ball が、AC係数の場合「11」、ま
たDC係数の場合「12」以下であるときには、量子化
誤差データを再量子化しない。また量子化誤差データの
再量子化を行う場合、量子化テーブルの各画素位置にお
いて、その量子化係数に対応した値を有する再量子化係
数F(BY , B'Y )、F(BCb, B'Cb) 、 F(BCr,
B'Cr) を用いている。したがって、量子化誤差データ
を有効にビット配分することができ、必要以上に量子化
誤差データを再量子化することを回避している。すなわ
ち本実施例によれば、JPEGフォーマットの第4コン
ポーネントの利用効率が、第1〜第3実施例よりもさら
に向上している。
As described above, in the fourth embodiment, when the sum B all of the number of bits required to store the quantized error data ΔYuv, ΔCbuv, ΔCruv is “11” for the AC coefficient, and also for the DC coefficient. When it is "12" or less, the quantization error data is not requantized. When requantizing the quantized error data, the requantized coefficients F (B Y , B ′ Y ), F (B Cb at each pixel position in the quantization table having a value corresponding to the quantized coefficient. , B'Cb ), F (B Cr ,
B'Cr ) is used. Therefore, the quantized error data can be effectively allocated to bits, and requantization of the quantized error data more than necessary is avoided. That is, according to this embodiment, the utilization efficiency of the fourth component of the JPEG format is further improved as compared with the first to third embodiments.

【0114】また第4実施例によれば、量子化誤差デー
タのビット配分は、量子化テーブル(図24)における
各量子化係数の値と再量子化係数(図27)だけに基づ
いて容易に決定され、複雑な計算式を用いる必要がな
い。
Further, according to the fourth embodiment, the bit allocation of the quantization error data can be easily performed based on only the value of each quantization coefficient in the quantization table (FIG. 24) and the requantization coefficient (FIG. 27). It is determined and there is no need to use complicated formulas.

【0115】図29〜図31は、第5実施例において量
子化誤差データを生成する処理ルーチンを示すフローチ
ャートである。ステップ301〜304の内容は、図2
5に示すステップ201〜204と同じである。なお第
4実施例と同様に、各量子化誤差データのビット配分と
して、DC係数に関しては、量子化誤差データΔYuvの
設定ビット数SY は「6」、量子化誤差データΔCbuv、
ΔCruvの設定ビット数SCb、SCrはそれぞれ「3」に定
められ、またAC係数に関しては、量子化誤差データΔ
Yuvの設定ビット数SYは「5」、量子化誤差データΔC
buv、ΔCruvの設定ビット数SCb、SCrはそれぞれ
「3」に定められるとする。
29 to 31 are flowcharts showing the processing routine for generating the quantized error data in the fifth embodiment. The contents of steps 301 to 304 are shown in FIG.
This is the same as steps 201 to 204 shown in FIG. As in the case of the fourth embodiment, as the bit distribution of each quantization error data, regarding the DC coefficient, the set bit number S Y of the quantization error data ΔYuv is “6”, the quantization error data ΔCbuv,
The set bit numbers S Cb and S Cr of ΔCruv are each set to “3”, and regarding the AC coefficient, the quantization error data Δ
Yuv setting bit number S Y is “5”, quantization error data ΔC
The set bit numbers S Cb and S Cr of buv and ΔCruv are each set to “3”.

【0116】ステップ305では、必要ビット数の総和
all が設定ビット数の総和Sallよりも大きいか否か
が判定される。必要ビット数の総和Ball が設定ビット
数の総和Sall 以下であるとき、量子化誤差データが再
量子化されることなくステップ312以下が実行され
る。ステップ312〜316の内容は、図26に示すス
テップ212〜216と同じである。
At step 305, it is judged whether the total sum B all of the required number of bits is larger than the total sum S all of the set number of bits. When the total sum B all of the required number of bits is less than or equal to the total sum S all of the set number of bits, steps 312 and below are executed without requantizing the quantization error data. The contents of steps 312 to 316 are the same as steps 212 to 216 shown in FIG.

【0117】必要ビット数の総和Ball が設定ビット数
の総和Sall よりも大きく、かつ各必要ビット数BY
Cb、BCrがそれぞれ設定ビット数SY 、SCb、SCb
りも大きい場合、ステップ305、306、308、3
10、320の順に実行される。すなわち、全ての量子
化誤差データΔYuv、ΔCbuv、ΔCruvが再量子化され、
その後、ステップ312において、量子化誤差データΔ
Yuv、ΔCbuv、ΔCruvの順に配列された固定長のビット
列が生成される。
The total sum B all of the required bits is larger than the total sum S all of the set bits, and each required bit number B Y ,
B Cb, B Cr number setting bits each S Y, if S Cb, greater than S Cb, step 305,306,308,3
It is executed in the order of 10 and 320. That is, all the quantization error data ΔYuv, ΔCbuv, ΔCruv are requantized,
Then, in step 312, the quantization error data Δ
A fixed-length bit string arranged in the order of Yuv, ΔCbuv, and ΔCruv is generated.

【0118】ここまで述べた作用は、結果的には第4実
施例と同じである。
The operation described so far is the same as that of the fourth embodiment.

【0119】図24に示す量子化テーブルのDC係数の
場合、上述したように、必要ビット数はそれぞれBY
4、BCb=BCr=5となる(図28参照)。ステップ3
04では、必要ビット数BY 、BCb、BCrの総和Ball
が計算され、「14」が得られる。ステップ305で
は、必要ビット数の総和Ball が設定ビット数の総和S
all よりも大きいと判断されるので、ステップ306が
実行される。ステップ306では、必要ビット数BY
設定ビット数SY よりも大きいか否かが判定される。図
24のDC係数の場合、必要ビット数BY 「4」は設定
ビット数SY 「6」よりも小さい。換言すれば、量子化
誤差データΔYuvを格納するために必要なビット数は設
定ビット数よりも小さく、この量子化誤差データΔYuv
の格納のためのビットを、他の量子化誤差データΔCbu
v、ΔCruvを格納するために用いることが可能である。
In the case of the DC coefficient of the quantization table shown in FIG. 24, the required number of bits is B Y =
4, B Cb = B Cr = 5 (see FIG. 28). Step 3
In 04, the total number B all of the required bits B Y , B Cb , and B Cr is B all.
Is calculated and “14” is obtained. In step 305, the total sum B all of the required bits is the total sum S of the set number of bits.
Since it is determined that it is larger than all , step 306 is executed. In step 306, it is determined whether the required bit number B Y is larger than the set bit number S Y. In the case of the DC coefficient in FIG. 24, the required bit number B Y “4” is smaller than the set bit number S Y “6”. In other words, the number of bits required to store the quantized error data ΔYuv is smaller than the set number of bits.
For storing the other quantization error data ΔCbu
It can be used to store v, ΔCruv.

【0120】そこで次に、ステップ321へ進み、必要
ビット数BCbが設定ビット数SCbよりも大きいか否かが
判定される。図24のDC係数の場合、必要ビット数B
Cb=BCr=5であり、設定ビット数SCb=SCr=3であ
るので、ステップ321、322、323の順に実行さ
れ、ステップ323において、量子化誤差データΔCbu
v、ΔCruvを格納するためのビットが拡大される。
Then, next, the routine proceeds to step 321, where it is judged if the required bit number B Cb is larger than the set bit number S Cb . In the case of the DC coefficient in FIG. 24, the required number of bits B
Since Cb = B Cr = 5 and the number of set bits S Cb = S Cr = 3, the steps 321, 322, 323 are executed in order, and at step 323, the quantization error data ΔCbu
The bits for storing v and ΔCruv are expanded.

【0121】すなわちステップ323では、(18)、
(19)式に従って、最大ビット数B"Cb、B"Crが拡大
される。 B"Cb=SCb+(SY −BY )/2 (18) B"Cr=Sall −BY −B"Cb (19) 図24のDC係数の場合、最大ビット数B"Cb=B"Cr
4となる(図28参照)。
That is, in step 323, (18),
The maximum bit numbers B ″ Cb and B ″ Cr are expanded according to the equation (19). B "Cb = S Cb + ( S Y -B Y) / 2 (18) B" Cr = S all -B Y -B "Cb (19) for DC coefficients of Figure 24, the maximum number of bits B" Cb = B " Cr =
4 (see FIG. 28).

【0122】ステップ323において拡大された最大ビ
ット数B"Cbが必要ビット数BCb以上である場合、すな
わち量子化誤差データΔCbuvを格納するためのビット数
Cbが拡大されたビット数B"Cbほど大きくはない場
合、ステップ324からステップ327へ進む。すなわ
ち量子化誤差データΔCruvについて、再量子化が行わ
れ、量子化誤差データΔCbuvについては再量子化は行わ
れない。これに対し、最大ビット数B"Cbが必要ビット
数BCbよりも小さい場合、ステップ324からステップ
325へ進み、量子化誤差データΔCbuvについて再量子
化が行われた後、ステップ326において最大ビット数
B"Crが必要ビット数BCrよりも小さいか否か判定され
る。最大ビット数B"Crが必要ビット数BCrよりも小さ
いとき、ステップ327において量子化誤差データΔCr
uvについて再量子化が行われ、最大ビット数B"Crが必
要ビット数BCr以上の場合、量子化誤差データΔCruvに
ついて再量子化を行う必要がないため、ステップ327
はスキップされる。
If the maximum number of bits B " Cb expanded in step 323 is equal to or larger than the required number of bits B Cb , that is, the number of bits B Cb for storing the quantization error data ΔCbuv is expanded B" Cb. If not so, go from step 324 to step 327. That is, the quantization error data ΔCruv is requantized, and the quantization error data ΔCbuv is not requantized. On the other hand, if the maximum number of bits B ″ Cb is smaller than the required number of bits B Cb , the process proceeds from step 324 to step 325, where the quantization error data ΔCbuv is requantized, and then the maximum number of bits is determined in step 326. It is determined whether B " Cr is smaller than the required number of bits B Cr . When the maximum number of bits B ″ Cr is smaller than the required number of bits B Cr , in step 327 the quantization error data ΔCr
If requantization is performed on uv and the maximum number of bits B ″ Cr is greater than or equal to the required number of bits B Cr , it is not necessary to requantize the quantization error data ΔCruv, and thus step 327.
Is skipped.

【0123】そしてステップ312以下が実行され、全
ての画素位置の量子化誤差データについてビット列が生
成されたとき、このルーチンは終了する。
Then, when the step 312 and subsequent steps are executed and the bit string is generated for the quantized error data of all the pixel positions, this routine ends.

【0124】図24に示す量子化テーブルにおいて、例
えばパラメータuが「4」であり、パラメータvが
「0」である場合、上述したように必要ビット数はそれ
ぞれBY=5、BCb=BCr=7となる(図28参照)。
すなわち、必要ビット数BY 、BCb、BCrの総和Ball
「19」は設定ビット数の総和Sall 「11」よりも大
きく、必要ビット数BY は設定ビット数SY 「5」と等
しく、必要ビット数BCb、BCrは設定ビット数SCb、S
Cr「3」よりも大きい。したがって、ステップ305、
306、321、322の順に実行され、ステップ32
3〜327が実行される。なおステップ323におい
て、最大ビット数B"Cb=B"Cr=3となり(図28参
照)、この場合は、DC係数の場合とは異なり、最大ビ
ット数B"Cb=B"Crは設定ビット数と同じ値になる。
In the quantization table shown in FIG. 24, for example, when the parameter u is "4" and the parameter v is "0", the required bit numbers are B Y = 5 and B Cb = B, respectively, as described above. Cr = 7 (see FIG. 28).
That is, the total number B all of the required number of bits B Y , B Cb , and B Cr
“19” is larger than the sum S of all set bits S all “11”, the required number of bits B Y is equal to the set number of bits S Y “5”, and the required number of bits B Cb and B Cr are the set number of bits S Cb , S
Cr Greater than "3". Therefore, in step 305,
Steps 306, 321, and 322 are performed in order, and step 32 is performed.
3 to 327 are executed. In step 323, the maximum number of bits B " Cb = B" Cr = 3 (see FIG. 28). In this case, unlike the case of the DC coefficient, the maximum number of bits B " Cb = B" Cr is the set number of bits. Same value as.

【0125】図28に示すように、量子化係数Q(Y)uv
=7、Q(Cb)uv=Q(Cr)uv=65である場合、必要ビッ
ト数はそれぞれBY =3、BCb=BCr=7であり、その
総数Ball は設定ビット数の総和Sall 「11」よりも
大きい。必要ビット数BY は設定ビット数SY 「5」よ
りも小さく、必要ビット数BCb、BCrは設定ビット数S
Cb、SCr「3」よりも大きい。したがって、ステップ3
05、306、321、322の順に実行され、ステッ
プ323〜327が実行される。なおステップ323に
おいて、最大ビット数B"Cb=B"Cr=4となり(図28
参照)、この場合は、DC係数の場合と同様に、最大ビ
ット数B"Cb=B"Crは設定ビット数よりも増加する。
As shown in FIG. 28, the quantization coefficient Q (Y) uv
= 7 and Q (Cb) uv = Q (Cr) uv = 65, the required number of bits is B Y = 3 and B Cb = B Cr = 7, respectively, and the total number B all is the sum of the set number of bits. It is larger than S all “11”. The required bit number B Y is smaller than the set bit number S Y “5”, and the required bit numbers B Cb and B Cr are the set bit number S
Cb and S Cr are larger than “3”. Therefore, step 3
05, 306, 321, and 322 are executed in this order, and steps 323 to 327 are executed. Note that in step 323, the maximum number of bits B ″ Cb = B ″ Cr = 4 (see FIG. 28).
In this case, as in the case of the DC coefficient, the maximum bit number B " Cb = B" Cr increases more than the set bit number.

【0126】図28に示すように、量子化係数Q(Y)uv
=129、Q(Cb)uv=Q(Cr)uv=3である場合、必要ビ
ット数はそれぞれBY =8、BCb=BCr=2であり、そ
の総数Ball は設定ビット数の総和Sall 「11」より
も大きい。必要ビット数BYは設定ビット数SY 「5」
よりも大きく、必要ビット数BCb、BCrは設定ビット数
Cb、SCr「3」よりも小さい。したがって、量子化誤
差データΔYuvを格納するためのビットを拡大するた
め、ステップ305、306、308、328の実行の
後、ステップ330において(20)式に従って最大ビ
ット数B"Y が求められる。
As shown in FIG. 28, the quantization coefficient Q (Y) uv
= 129, Q (Cb) uv = Q (Cr) uv = 3, the required bit numbers are B Y = 8 and B Cb = B Cr = 2, respectively, and the total number B all is the sum of the set bit numbers. It is larger than S all “11”. Required bit number B Y is set bit number S Y “5”
And the required bit numbers B Cb and B Cr are smaller than the set bit numbers S Cb and S Cr “3”. Therefore, in order to expand the bits for storing the quantized error data ΔYuv, after executing steps 305, 306, 308 and 328, the maximum number of bits B ″ Y is obtained in step 330 according to the equation (20).

【0127】 B"Y =Sall −BCb−BCr (20) この例において、最大ビット数B"Y =7となる(図2
8参照)。
B " Y = S all -B Cb -B Cr (20) In this example, the maximum number of bits B" Y = 7 (FIG. 2).
8).

【0128】ステップ331では、量子化誤差データΔ
Yuvについて再量子化が行われ、そしてステップ312
以下が実行される。
At step 331, the quantization error data Δ
Requantization is performed on Yuv, and step 312
The following is done:

【0129】ステップ343〜347、ステップ353
〜357における処理は、それぞれステップ323〜3
27と同様である。またステップ360および361、
ステップ370および371における処理は、それぞれ
ステップ330および331と同様である。
Steps 343 to 347 and step 353
~ 357, steps 323 to 3 respectively.
Similar to 27. Also steps 360 and 361,
The processes in steps 370 and 371 are similar to steps 330 and 331, respectively.

【0130】以上のように第5実施例によれば、量子化
誤差データのうちの1つまたは2つの必要ビット数が設
定ビット数よりも小さい場合、この量子化誤差データの
格納のために用いられないビットを、他の量子化誤差デ
ータを格納するために用いている。したがって、第4実
施例と比較して、さらに、JPEGフォーマットの第4
コンポーネントの利用効率が向上する。
As described above, according to the fifth embodiment, when the required bit number of one or two of the quantized error data is smaller than the set bit number, it is used for storing this quantized error data. The missing bits are used to store other quantized error data. Therefore, in comparison with the fourth embodiment, the fourth JPEG format is further added.
Use efficiency of components is improved.

【0131】なお、上記各実施例では、設定ビット数S
Y 、SCb、SCrが、ICメモリカードMに記録される。
In each of the above embodiments, the set bit number S
Y , S Cb and S Cr are recorded in the IC memory card M.

【0132】また上記各実施例において、原画像データ
の直交変換としてDCT変換が利用されていたが、本発
明はこれに限定されない。またイメージデータ80の記
録媒体もICメモリカードMに限定されない。
In each of the above embodiments, the DCT transform is used as the orthogonal transform of the original image data, but the present invention is not limited to this. Also, the recording medium for the image data 80 is not limited to the IC memory card M.

【0133】[0133]

【発明の効果】以上のように本発明の画像圧縮装置によ
れば、できるだけ原画像に近い画像を再生することがで
きる画像圧縮が可能となる。また本発明の画像伸張装置
によれば、本発明の画像圧縮装置により得られたデータ
から静止画像を再生し、原画像に近い画像を再生するこ
とができる。
As described above, according to the image compression apparatus of the present invention, it is possible to perform image compression capable of reproducing an image as close to the original image as possible. Further, according to the image expanding apparatus of the present invention, it is possible to reproduce a still image from the data obtained by the image compressing apparatus of the present invention and reproduce an image close to the original image.

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

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

【図2】第1実施例における画像圧縮処理を示すフロー
チャートである。
FIG. 2 is a flowchart showing an image compression process in the first embodiment.

【図3】第1実施例における画像データP(Y)xy 、DC
T変換係数S(Y)uv 、量子化DCT係数R(Y)uv の例を
示す図である。
FIG. 3 is image data P (Y) xy, DC in the first embodiment.
It is a figure which shows the example of T conversion coefficient S (Y) uv and quantized DCT coefficient R (Y) uv.

【図4】DC係数の差分値のグループ化を示す図であ
る。
FIG. 4 is a diagram showing grouping of difference values of DC coefficients.

【図5】DC係数の符号表を示す図である。FIG. 5 is a diagram showing a code table of DC coefficients.

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

【図7】AC係数のハフマン符号化におけるジグザグス
キャンを示す図である。
FIG. 7 is a diagram showing zigzag scanning in Huffman coding of AC coefficients.

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

【図9】JPEGフォーマットのイメージデータの構成
を示す図である。
FIG. 9 is a diagram showing the structure of image data in JPEG format.

【図10】JPEGフォーマットのイメージデータの構
成を示す図である。
FIG. 10 is a diagram showing the structure of image data in JPEG format.

【図11】量子化DCT係数、復元DCT係数および復
号された画像データの一例を示す図である。
FIG. 11 is a diagram showing an example of quantized DCT coefficients, restored DCT coefficients, and decoded image data.

【図12】ビット配分および誤差データの合成を行う第
1の例を示すフローチャートである。
FIG. 12 is a flowchart showing a first example of performing bit allocation and error data combination.

【図13】ビット配分および誤差データの合成を行う第
2の例を示すフローチャートである。
FIG. 13 is a flowchart showing a second example of performing bit allocation and error data combination.

【図14】量子化誤差データΔYuvのヒストグラムを示
す図である。
FIG. 14 is a diagram showing a histogram of quantized error data ΔYuv.

【図15】第4コンポーネントΔKuvの構成を示す図で
ある。
FIG. 15 is a diagram showing a configuration of a fourth component ΔKuv.

【図16】第1実施例の画像伸張装置を示すブロック図
である。
FIG. 16 is a block diagram showing an image expansion device of the first embodiment.

【図17】第1実施例における画像伸張処理を示すフロ
ーチャートである。
FIG. 17 is a flowchart showing an image expansion process in the first embodiment.

【図18】第1実施例の画像伸張処理において誤差デー
タを求める処理を示すフローチャートである。
FIG. 18 is a flowchart showing a process of obtaining error data in the image expansion process of the first embodiment.

【図19】第2実施例の画像圧縮装置を示すブロック図
である。
FIG. 19 is a block diagram showing an image compression apparatus according to a second embodiment.

【図20】第2実施例の画像伸張装置を示すブロック図
である。
FIG. 20 is a block diagram showing an image expansion device of a second embodiment.

【図21】第3実施例の画像圧縮装置を示すブロック図
である。
FIG. 21 is a block diagram showing an image compression apparatus according to a third embodiment.

【図22】第3実施例の画像伸張装置を示すブロック図
である。
FIG. 22 is a block diagram showing an image expansion device of a third embodiment.

【図23】第4コンポーネントΔKuvの誤差データを用
いないで画像を再生する装置のブロック図である。
FIG. 23 is a block diagram of an apparatus for reproducing an image without using error data of a fourth component ΔKuv.

【図24】輝度信号と色差信号の量子化テーブルの例を
示す図である。
FIG. 24 is a diagram showing an example of a quantization table of luminance signals and color difference signals.

【図25】第4実施例において量子化誤差データを生成
する処理ルーチンを示すフローチャートである。
FIG. 25 is a flowchart showing a processing routine for generating quantized error data in the fourth embodiment.

【図26】第4実施例において量子化誤差データを生成
する処理ルーチンを示すフローチャートである。
FIG. 26 is a flowchart showing a processing routine for generating quantized error data in the fourth embodiment.

【図27】再量子化係数を示す図である。FIG. 27 is a diagram showing requantization coefficients.

【図28】量子化誤差データを格納するために必要なビ
ット長とビット配分の例を示す図である。
FIG. 28 is a diagram showing an example of bit lengths and bit allocations required to store quantized error data.

【図29】第5実施例において量子化誤差データを生成
する処理ルーチンを示すフローチャートである。
FIG. 29 is a flowchart showing a processing routine for generating quantized error data in the fifth embodiment.

【図30】図29に示す処理ルーチンの一部のステップ
を示すフローチャートである。
FIG. 30 is a flowchart showing some steps of the processing routine shown in FIG. 29.

【図31】図29に示す処理ルーチンの一部のステップ
を示すフローチャートである。
FIG. 31 is a flowchart showing some steps of the processing routine shown in FIG. 29.

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

M ICメモリカード Mic memory card

Claims (11)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 第1〜第3コンポーネントから成る原画
像データに直交変換を施し、各コンポーネント毎に、所
定の空間周波数に対応した直交変換係数を求める直交変
換手段と、 前記直交変換係数を量子化テーブルによって量子化し、
量子化直交変換係数を求める量子化手段と、 前記量子化直交変換係数を逆量子化して復元直交変換係
数を求める逆量子化手段と、 前記復元直交変換係数と前記直交変換係数との差である
量子化誤差データを、前記各コンポーネント毎に求める
第1誤差データ生成手段と、前記量子化誤差データを、前記各コンポーネントの同一
空間周波数毎に固定長の1単位データ内に纏めて第4コ
ンポーネントを合成する誤差データ合成手段と、 前記第4コンポーネントと前記量子化直交変換係数を符
号化して圧縮画像データを形成する符号化手段と、 前記圧縮画像データを記録媒体に記録する記録手段とを
備えることを特徴とする画像圧縮装置。
1. An orthogonal transform unit for subjecting original image data composed of first to third components to orthogonal transform to obtain an orthogonal transform coefficient corresponding to a predetermined spatial frequency for each component, and the orthogonal transform coefficient being a quantum. Quantization by the conversion table,
Quantization means for obtaining a quantized orthogonal transformation coefficient, dequantization means for dequantizing the quantized orthogonal transformation coefficient to obtain a restored orthogonal transformation coefficient, and a difference between the restored orthogonal transformation coefficient and the orthogonal transformation coefficient. The first error data generating means for obtaining the quantized error data for each of the components and the quantized error data for the respective components are the same.
Collected in one unit data of fixed length for each spatial frequency.
Error data synthesizing means for synthesizing components, encoding means for encoding the fourth component and the quantized orthogonal transform coefficient to form compressed image data, and recording means for recording the compressed image data on a recording medium. An image compression device comprising.
【請求項2】 前記第4コンポーネントに格納される前
記量子化誤差データの各ビット数を、前記第1〜第3コ
ンポーネントにおいて再生画像の視覚特性に最も影響を
与える成分に対応したものが長くなるように、割り当て
るビット数割り当て手段を備えたことを特徴とする請求
項1に記載の画像圧縮装置。
2. The number of bits of the quantized error data stored in the fourth component corresponds to the component that most affects the visual characteristics of the reproduced image in the first to third components, which is longer. as, according to comprising the bit number allocation means for allocating
The image compression device according to Item 1 .
【請求項3】 前記ビット割り当て手段により割り当て
られたビット数に収まらない量子化誤差データを再量子
化する誤差データ量子化手段を備えたことを特徴とする
請求項2に記載の画像圧縮装置。
3. An error data quantization means for requantizing quantization error data that does not fit in the number of bits assigned by the bit assigning means.
The image compression device according to claim 2 .
【請求項4】 前記誤差データ量子化手段は、量子化テ
ーブルの量子化係数の最大値を用いて、量子化誤差デー
タの全ての構成要素を再量子化することを特徴とする
求項3に記載の画像圧縮装置。
Wherein said error data quantizing means, 請, characterized in that using the maximum value of the quantization coefficients of the quantization table, and re-quantizing all of the components of the quantization error data
The image compression device according to claim 3 .
【請求項5】 前記誤差データ量子化手段は、量子化テ
ーブルの各量子化係数を用いて、この量子化係数に対応
した量子化誤差データの構成要素を再量子化することを
特徴とする請求項3に記載の画像圧縮装置。
Wherein said error data quantization means, wherein by using the respective quantization coefficients of the quantization table, characterized by re-quantizing the components of the quantized error data corresponding to the quantized coefficients Item 4. The image compression device according to Item 3 .
【請求項6】 前記誤差データ量子化手段は、再量子化
された第1〜第3コンポーネントの量子化誤差データの
いずれのビット数が前記割り当てられたビット数よりも
小さい時、他のコンポーネントの量子化誤差データのビ
ット数を、前記固定長に応じた分だけ長くすることを特
徴とする請求項5に記載の画像圧縮装置。
6. The error data quantization means, when any number of bits of the requantized quantized error data of the first to third components is smaller than the assigned number of bits, the error data quantization means of the other component The image compression apparatus according to claim 5 , wherein the number of bits of the quantization error data is increased by an amount corresponding to the fixed length.
【請求項7】 前記直交変換手段から出力される直交変
換係数が負であるとき、その直交変換係数に対応する量
子化誤差データに「−1」を乗ずる符号調整手段を備え
たことを特徴とする請求項2に記載の画像圧縮装置。
7. When the orthogonal transform coefficient output from the orthogonal transform means is negative, a code adjusting means for multiplying the quantization error data corresponding to the orthogonal transform coefficient by “−1” is provided. The image compression apparatus according to claim 2 .
【請求項8】 前記符号調整手段によって符号調整され
た量子化誤差データに対し、発生頻度の高いものほど短
い符号語を割り当てることにより符号化誤差データを求
めるスケーリング手段を備えたことを特徴とする請求項
に記載の画像圧縮装置。
8. Scaling means for deriving the coding error data by assigning shorter code words to the quantized error data code-adjusted by the code adjusting means as the frequency of occurrence is higher. Claim
7. The image compression device according to 7 .
【請求項9】 前記符号化誤差データから前記第4コン
ポーネントを生成する誤差データ合成手段において、前
記符号化誤差データのビット数がk,m,n(k≧m≧
n)であるとき、ビット数kが割り当てられた量子化誤
差データの最上位ビットから第(m+1)ビットまで
を、前記第4コンポーネントの最上位ビットから第(2
m+n+1)ビットまでの第1領域に格納し、ビット数
kが割り当てられた量子化誤差データの第mビットから
第(n+1)ビットまでと、ビット数mが割り当てられ
た量子化誤差データ最上位ビットから第(n+1)ビッ
トまでとを、前記第4コンポーネントの第(2m+n)
ビットから第(3n+1)ビットまでの第2領域に交互
に格納し、ビット数kが割り当てられた量子化誤差デー
タの第nビットから最下位ビットまでと、ビット数mが
割り当てられた量子化誤差データの第nビットから最下
位ビットまでと、ビット数nが割り当てられた量子化誤
差データの全てのビットとを、前記第4コンポーネント
の第3nビットから最下位ビットまでの第3領域にサイ
クリックに格納することを特徴とする請求項5に記載の
画像圧縮装置。
9. The error data synthesizing means for generating the fourth component from the encoded error data, wherein the number of bits of the encoded error data is k, m, n (k ≧ m ≧).
n), the most significant bit to the (m + 1) th bit of the quantized error data to which the number of bits k has been allocated, and the most significant bit to the (2nd) bit of the fourth component
Stored in the first area up to (m + n + 1) bits, the m-th bit to (n + 1) th bit of the quantization error data to which the bit number k is assigned, and the most significant bit of the quantization error data to which the bit number m is assigned. To (n + 1) th bit to the (2m + n) th bit of the fourth component.
Bits to the (3n + 1) th bit are alternately stored in the second area, and the quantization error data to which the bit number k is assigned, from the nth bit to the least significant bit, and the quantization error to which the bit number m is assigned. The nth bit to the least significant bit of the data and all the bits of the quantized error data assigned the number of bits n are cyclically placed in the third region from the 3nth bit to the least significant bit of the fourth component. The image compression apparatus according to claim 5 , wherein the image compression apparatus stores the image compression apparatus.
【請求項10】 第1〜第3コンポーネントから成る原
画像データに直交変換を施し、各コンポーネント毎に直
交変換係数を求める直交変換手段と、前記直交変換係数
を量子化テーブルによって量子化し、量子化直交変換係
数を求める量子化手段と、前記量子化直交変換係数を逆
量子化するとともに逆直交変換して、復元直交変換係数
を求める逆量子化・逆直交変換手段と、前記復元逆直交
変換係数と前記原画像データとの差である誤差データ
を、前記各コンポーネント毎に求める第2誤差データ生
成手段と、前記誤差データを、前記各コンポーネントの
同一画像素位置毎に固定長の1単位データ内に纏めて第
4コンポーネントを合成する誤差データ合成手段と、こ
の第4コンポーネントと前記量子化直交変換係数と符号
化して圧縮画像データを形成する符号化手段と、圧縮画
像データを記録媒体に記録する記録手段とを備えたこと
を特徴とする画像圧縮装置。
10. An orthogonal transform means for subjecting original image data composed of first to third components to orthogonal transform to obtain an orthogonal transform coefficient for each component, and the orthogonal transform coefficient is quantized by a quantization table and quantized. Quantization means for obtaining an orthogonal transformation coefficient, dequantization / inverse orthogonal transformation means for dequantizing the quantized orthogonal transformation coefficient and inverse orthogonal transformation to obtain a restoration orthogonal transformation coefficient, and the restoration inverse orthogonal transformation coefficient Second error data generating means for obtaining error data which is a difference between the original image data and each of the components, and the error data in one unit data having a fixed length for each same image element position of each component. Error data synthesizing means for synthesizing the fourth component together, and compressed image data obtained by encoding the fourth component and the quantized orthogonal transform coefficient. An image compression apparatus, comprising: an encoding unit that forms a recording medium; and a recording unit that records compressed image data on a recording medium.
【請求項11】 請求項1〜請求項10のいずれかに記
載の圧縮画像装置によって記録された圧縮画像データを
前記記録媒体から読み出し、この圧縮画像データから前
記量子化直交変換係数と第4コンポーネントとを復号す
る復号化手段と、前記量子化直交変換係数を逆量子化し
て直交変換係数を復元する逆量子化手段と、前記第4コ
ンポーネントから、前記圧縮画像データを構成する各コ
ンポーネントの誤差データを分離する誤差データ分離手
段と、前記量子化直交変換係数に前記誤差データを加算
する誤差データ加算手段と、この加算手段から出力され
る直交変換係数に逆直交変換を施し、画像データを復元
する逆直交変換手段とを備えたことを特徴とする画像伸
張装置。
11. The compressed image data recorded by the compressed image device according to claim 1 is read from the recording medium, and the quantized orthogonal transform coefficient and the fourth component are read from the compressed image data. And a dequantization unit that dequantizes the quantized orthogonal transform coefficient to restore the orthogonal transform coefficient, and error data of each component that constitutes the compressed image data from the fourth component. Error data separating means for separating the quantized orthogonal transform coefficient, error data adding means for adding the error data to the quantized orthogonal transform coefficient, and inverse orthogonal transform for the orthogonal transform coefficient output from the adding means to restore the image data. An image decompression device comprising an inverse orthogonal transformation means.
JP18628794A 1993-07-15 1994-07-15 Image compression device and image decompression device Expired - Fee Related JP3392949B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP18628794A JP3392949B2 (en) 1993-07-15 1994-07-15 Image compression device and image decompression device

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP19799493 1993-07-15
JP6-123093 1994-05-12
JP5-197994 1994-05-12
JP12309394 1994-05-12
JP18628794A JP3392949B2 (en) 1993-07-15 1994-07-15 Image compression device and image decompression device

Publications (2)

Publication Number Publication Date
JPH0833001A JPH0833001A (en) 1996-02-02
JP3392949B2 true JP3392949B2 (en) 2003-03-31

Family

ID=27314627

Family Applications (1)

Application Number Title Priority Date Filing Date
JP18628794A Expired - Fee Related JP3392949B2 (en) 1993-07-15 1994-07-15 Image compression device and image decompression device

Country Status (1)

Country Link
JP (1) JP3392949B2 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US10091506B2 (en) * 2015-06-11 2018-10-02 Sony Corporation Data-charge phase data compression architecture
US10027968B2 (en) * 2015-06-12 2018-07-17 Sony Corporation Data-charge phase data compression tool

Also Published As

Publication number Publication date
JPH0833001A (en) 1996-02-02

Similar Documents

Publication Publication Date Title
US5497246A (en) Image signal processing device
JP4365957B2 (en) Image processing method and apparatus and storage medium
JP3392946B2 (en) Electronic still camera and image reproducing device
US6157741A (en) Image processing apparatus and image processing method
US6396955B1 (en) Image compression and expansion device
US7551788B2 (en) Digital image coding device and method for noise removal using wavelet transforms
US5805737A (en) Image signal compressing device
JP3222780B2 (en) Image compression device
JPH04229382A (en) Method and device for resolution conversion of digital image data
JP3375539B2 (en) Image compression device and image decompression device
JP3392949B2 (en) Image compression device and image decompression device
JPH0487460A (en) Picture processor
JP3559314B2 (en) Image compression device
JP3732900B2 (en) Image compression apparatus and image expansion apparatus
JP3709106B2 (en) Image compression and decompression device
JP2935320B2 (en) Image compression / decompression device
US20090074059A1 (en) Encoding method and device for image data
KR100530745B1 (en) Method of displaying a high-resolution digital image on a low-resolution display
JP3845206B2 (en) Image compression apparatus and image expansion apparatus
JPH1075426A (en) Image compressor and image expander
JP2993212B2 (en) How to combine images
JP3845208B2 (en) Image compression apparatus and image expansion apparatus
KR950008640B1 (en) Image compression coding method and decoding method for bit fixation
JPH08161506A (en) Image compressing device
KR20070099911A (en) Method for compressing digital image, and a medium having computer readable program executing the method

Legal Events

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

Free format text: PAYMENT UNTIL: 20080124

Year of fee payment: 5

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

Free format text: PAYMENT UNTIL: 20090124

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20090124

Year of fee payment: 6

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

Free format text: PAYMENT UNTIL: 20100124

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20100124

Year of fee payment: 7

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

Free format text: PAYMENT UNTIL: 20110124

Year of fee payment: 8

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

Free format text: PAYMENT UNTIL: 20120124

Year of fee payment: 9

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

Free format text: PAYMENT UNTIL: 20120124

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

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

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

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

Year of fee payment: 10

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

Free format text: PAYMENT UNTIL: 20140124

Year of fee payment: 11

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

LAPS Cancellation because of no payment of annual fees