JP3323615B2 - Image data compression apparatus and method - Google Patents

Image data compression apparatus and method

Info

Publication number
JP3323615B2
JP3323615B2 JP33206493A JP33206493A JP3323615B2 JP 3323615 B2 JP3323615 B2 JP 3323615B2 JP 33206493 A JP33206493 A JP 33206493A JP 33206493 A JP33206493 A JP 33206493A JP 3323615 B2 JP3323615 B2 JP 3323615B2
Authority
JP
Japan
Prior art keywords
data
diff
difference
output
code
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
JP33206493A
Other languages
Japanese (ja)
Other versions
JPH07193816A (en
Inventor
ゆかり 戸田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP33206493A priority Critical patent/JP3323615B2/en
Priority to US08/362,916 priority patent/US5903671A/en
Publication of JPH07193816A publication Critical patent/JPH07193816A/en
Application granted granted Critical
Publication of JP3323615B2 publication Critical patent/JP3323615B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】本発明は画像データ圧縮方法およ
び装置に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a method and apparatus for compressing image data.

【0002】[0002]

【従来の技術】近年、DTPなどによりコンピュータ上
で作成される画像は、より高画質な画像が要求されてお
り、カラー化、多階調化が進んでいる。この種の画像に
おける情報量は、例えば、A4サイズ400dpi25
6階調3色カラーの場合で約46Mbyteにもなる。
画像データをページ記述言語(Page Discri
ption Language)などのコード情報とし
て扱えば情報量は少なくな。しかしながら、コード情
報から画像データへの展開に時間がかかる上に、展開さ
れた画像から元のコード情報を再現できないという問題
点がある。
2. Description of the Related Art In recent years, images created on a computer by DTP or the like are required to have higher image quality, and colorization and multi-gradation are being promoted. The information amount in this type of image is, for example, A4 size 400 dpi 25
In the case of 6 gradations and 3 colors, it is about 46 Mbytes.
Image data is written in a page description language (Page Discri
If handled as ption Language) code information such as the amount of information that a few. However, there is a problem that it takes time to develop the code information into the image data and that the original code information cannot be reproduced from the developed image.

【0003】カラー多値画像の一般的な圧縮方法として
は、JPEG(Joint Photographic
Expent Group)が推奨するADCT(A
daptive Discrete Cosine T
ransform)方式による圧縮法がある。ADCT
圧縮法について以下に説明する。
As a general compression method of a color multi-valued image, JPEG (Joint Photographic) is used.
ADCT (A) recommended by the Expendable Group
Adaptive Discrete Cosine T
(transform) method. ADCT
The compression method will be described below.

【0004】図13はADCT圧縮装置の機能構成を表
わすブロック図である。3101は色空間変換部であ
り、NTSC方式の各色毎の信号(赤(R)、緑
(G)、青(B))による色空間(NTSC−RGB)
を、輝度信号Yと2つの色差信号Cr、Cbとで表わさ
れる色空間(YCrCb)に変換する。3102はサブ
サンプリング部であり、人間の眼が輝度に敏感で色差に
鈍感であるという特性を利用して、色差データの減少を
行う。具体的には、サブサンプリング部3102はとな
りあう2つの色差データの平均値をとり、色差データの
量を1/2に減少させている。3103はDCT変換部
であり、サブサンプリング部3102を経て入力された
画像データを水平および垂直方向にとなり合う8×8の
ブロックに分割し、DCT変換をかけ、周波数空間に変
換する。3104は量子化部であり、64個の各DCT
係数をステップ幅の異なった量子化値で割る。3105
はハフマン符号化部であり、量子化された64個のDC
T係数を1つのDC係数と63個のAC係数に分け、そ
れぞれの係数をJPEGが推奨しているハフマンテーブ
ルに従って符号化する。符号化されたデータは量子化テ
ーブルデータ、ハフマンテーブルデータなどのヘッダを
添付してメモリに蓄積されるかまたは他の装置等へ送信
される。
FIG. 13 is a block diagram showing a functional configuration of the ADCT compression apparatus. Reference numeral 3101 denotes a color space conversion unit, which is a color space (NTSC-RGB) using signals (red (R), green (G), and blue (B)) for each color in the NTSC system.
Is converted into a color space (YCrCb) represented by a luminance signal Y and two color difference signals Cr and Cb. Reference numeral 3102 denotes a sub-sampling unit, which reduces the color difference data by using the characteristic that the human eye is sensitive to luminance and insensitive to color difference. Specifically, the sub-sampling unit 3102 takes the average value of two adjacent color difference data, and reduces the amount of the color difference data to half. Reference numeral 3103 denotes a DCT conversion unit which divides the image data input via the sub-sampling unit 3102 into 8 × 8 blocks that are adjacent in the horizontal and vertical directions, performs DCT conversion, and converts the data into a frequency space. Reference numeral 3104 denotes a quantization unit, and each of the 64 DCTs
The coefficients are divided by different quantization values of the step size. 3105
Is a Huffman encoding unit, and 64 quantized DCs
The T coefficient is divided into one DC coefficient and 63 AC coefficients, and each coefficient is encoded according to a Huffman table recommended by JPEG. The encoded data is stored in a memory with a header such as quantization table data and Huffman table data attached thereto, or transmitted to another device or the like.

【0005】図14はADCT伸長装置の機能構成を表
わすブロック図である。3205はハフマン複合化部で
あり、入力された符号化データを複合し、量子化データ
を生成する。3204は逆量子化部であり、ハフマン複
合化部3205にて生成された量子化データをCDT係
数データに変換する。これは、量子化部3104で量子
化する際に使用した量子化テーブルデータを用いて、6
4個の係数に量子化値を乗ずることにより得られる。3
203は逆DCT変換部であり、逆量子化部3204に
て得られたDCT係数データを実画像データに逆DCT
変換する。3202は補間部であり、データ圧縮時にお
けるサブサンプリング部3102により欠落したCrお
よびCbのデータを単純に繰り返し法により補間する。
3201は色空間変換部であり、YCrCbのデータを
NTSC−RGBのデータまたはそのデバイスの色空間
データに変換する。
FIG. 14 is a block diagram showing a functional configuration of the ADCT decompression device. Reference numeral 3205 denotes a Huffman demultiplexing unit that demultiplexes the input coded data to generate quantized data. An inverse quantization unit 3204 converts the quantized data generated by the Huffman decompression unit 3205 into CDT coefficient data. This is based on the quantization table data used for quantization in the quantization unit
It is obtained by multiplying the four coefficients by the quantization value. 3
An inverse DCT transform unit 203 converts the DCT coefficient data obtained by the inverse quantization unit 3204 into real image data by inverse DCT.
Convert. An interpolation unit 3202 interpolates the data of Cr and Cb missing by the sub-sampling unit 3102 at the time of data compression by a simple repetition method.
A color space conversion unit 3201 converts YCrCb data into NTSC-RGB data or color space data of the device.

【0006】次に、実際のデータを示して本データ圧縮
および伸長装置の処理の流れを説明する。
Next, the flow of processing of the present data compression and decompression device will be described with reference to actual data.

【0007】図15はコンピュータにより作成されたカ
ラー多値画像のイメージデータの1部分を示す。図15
に示されているのは、NTSC−RGBのデータであ
り、カラー多値画像の文字部分の展開されたイメージデ
ータの1部分(16画素×16画素)である。3301
は赤(R)データ、3302は緑(G)データ、330
3は青(B)データを示す。各画素のデータはレンジが
8bit(0〜255)のデータであり、(R、G、
B)=(225、225、225)というやや暗い白の
下地に(R、G、B)=(30、30、225)という
青色の文字が書いてある画像の一部である。
FIG. 15 shows a part of image data of a color multi-valued image created by a computer. FIG.
Is NTSC-RGB data, which is one portion (16 pixels × 16 pixels) of image data in which a character portion of a color multi-valued image is developed. 3301
Is red (R) data, 3302 is green (G) data, 330
3 indicates blue (B) data. The data of each pixel is data having a range of 8 bits (0 to 255), and (R, G,
B) = (225, 225, 225) is a part of an image in which blue characters (R, G, B) = (30, 30, 225) are written on a slightly darker white background.

【0008】色空間変換部3101で行われるNTSC
−RGBからYCrCbへの変換は以下に示される式に
より実行される。
[0008] NTSC performed by the color space conversion unit 3101
-Conversion from RGB to YCrCb is performed by the following equation.

【0009】 Y=0.299×R+0.587×G+0.114×B Cr=0.713(R−Y) Cb=0.564(B−Y)Y = 0.299 × R + 0.587 × G + 0.114 × B Cr = 0.713 (RY) Cb = 0.564 (BY)

【0010】さらにCCIRの勧告により、YCrCb
色空間での演算時のオーバーシュート、アンダーシュー
トを許容するため、以下のデータの丸めを行う。
Further, according to CCIR's recommendation, YCrCb
The following data is rounded to allow overshoot and undershoot at the time of calculation in the color space.

【0011】Y=219.0×Y+16.5 Cr=224.0×Cr+128.5 Cb=224.0×Cb+128.5Y = 219.0 × Y + 16.5 Cr = 224.0 × Cr + 12.5 Cb = 224.0 × Cb + 128.5

【0012】上述の各式により得られたYCrCbの各
データをサブサンプリング部3102で色差データCr
およびCbに対してサブサンプリングを行う。サブサン
プリング法としては単純間引き、MAXデータ選択、M
INデータ選択などがあるが、ここでは平均値法を使用
する。すなわち、連接した2画素分のデータの平均値を
とり、1つのデータとする方法である。以上の色空間変
換部3101およびサブサンプリング部3102を経て
得られたデータを図16に示す。図16において、34
01はYデータ(輝度データ)、3402はCrデータ
(色差データ)、3403はCbデータ(色差データ)
である。Cr、Cbの各データはサブサンプリング部3
102の処理により1/2に減少しているのがわかる。
Each of the YCrCb data obtained by the above equations is converted by the sub-sampling unit 3102 into the color difference data Cr.
And Cb are sub-sampled. As the sub-sampling method, simple thinning, MAX data selection, M
Although there is IN data selection, here, the average value method is used. That is, this method is a method in which an average value of data of two connected pixels is taken as one data. FIG. 16 shows data obtained through the above color space conversion unit 3101 and subsampling unit 3102. In FIG.
01 is Y data (luminance data), 3402 is Cr data (color difference data), 3403 is Cb data (color difference data)
It is. Each data of Cr and Cb is stored in the sub-sampling unit 3.
It can be seen that the value is reduced to 処理 by the processing of 102.

【0013】次に図16に示されたYデータ3401、
Crデータ3402、Cbデータ3403はDCT変換
部3103へ入力される。DCT変換部3103におい
て、まず、水平および垂直にとなり合う8×8データを
1ブロックとして各データのブロック分けを行う。ブロ
ック分けの結果、Yデータ3401は3401aから3
401dの4つのブロックに分割される。同様にして、
Crデータ3402は3402a、3402bの2つの
ブロックに分割され、Cbデータ3403は3403
a、3403bの2つのブロックに分割される。そし
て、これら8個の各ブロックに対してDCT変換が実行
される。
Next, the Y data 3401 shown in FIG.
Cr data 3402 and Cb data 3403 are input to DCT transform section 3103. First, the DCT transform unit 3103 divides each data into blocks each of which is 8 × 8 data that is horizontally and vertically. As a result of the block division, the Y data 3401 is changed from 3401a to 3
It is divided into four blocks 401d. Similarly,
The Cr data 3402 is divided into two blocks 3402a and 3402b, and the Cb data 3403 is divided into 3403
a, 3403b are divided into two blocks. Then, DCT transform is performed on each of these eight blocks.

【0014】図17に、図16の8個のブロックをDC
T変換した様子を示す。3501はYデータ3401の
DCT変換後のデータを示す。4つのブロック3401
aから3401dにそれぞれ3501aから3501d
のブロックが対応する。同様に、3502はCrデータ
3402のDCT変換後のデータ、3503はCbデー
タ3403のDCT変換後のデータを示している。DC
T変換後の各ブロックの64個の係数は、1つのDC成
分(左上すみ)と63個のAC成分で構成されている。
FIG. 17 shows that the eight blocks shown in FIG.
The state after the T conversion is shown. Reference numeral 3501 denotes data after the DCT conversion of the Y data 3401. Four blocks 3401
3501a to 3501d for a to 3401d respectively
Corresponds to the block. Similarly, reference numeral 3502 denotes data after DCT conversion of the Cr data 3402, and reference numeral 3503 denotes data after DCT conversion of the Cb data 3403. DC
The 64 coefficients of each block after the T conversion are composed of one DC component (upper left corner) and 63 AC components.

【0015】次に、図17のDCT変換後データ350
1〜3503は量子化部3104において量子化され
る。
Next, the DCT transformed data 350 shown in FIG.
1 to 3503 are quantized by a quantization unit 3104.

【0016】ここで量子化に用いる量子化テーブルはJ
PEGが推奨する量子化テーブルを使用する。図22に
量子化テーブルを示す。4001はY成分用、4002
はCrおよびCb成分用である。量子化処理後のデータ
を図18に示す。3601はYデータの量子化後デー
タ、3602はCrデータの量子化後データ、3603
はCbデータの量子化後データである。
The quantization table used for quantization is J
Use the quantization table recommended by PEG. FIG. 22 shows a quantization table. 4001 is for the Y component, 4002
Is for Cr and Cb components. FIG. 18 shows the data after the quantization processing. 3601 is the quantized data of Y data, 3602 is the quantized data of Cr data, 3603
Is the quantized data of the Cb data.

【0017】ハフマン符号化部3105で、各量子化後
データ3601〜3603は、DC成分、AC成分に分
けられる。DC成分は前のブロックのDC成分との差分
のヒストグラムを取り、最適ハフマン符号化テーブルが
作成され、そのテーブルに従って符号化が行われる。A
C成分は図23に示すようなジグザグ順に並び変えが行
われる。そしてAC成分に対しては、0ではない値Xが
はいるまでの0のランレングスとその値Xの組み合わせ
のヒストグラムを取り、最適ハフマンテーブルを作成す
る。この生成された最適ハフマンテーブルに従って符号
化が行われる。
In the Huffman encoding unit 3105, each of the quantized data 3601 to 3603 is divided into a DC component and an AC component. For the DC component, a histogram of the difference from the DC component of the previous block is obtained, an optimal Huffman encoding table is created, and encoding is performed according to the table. A
The C component is rearranged in a zigzag order as shown in FIG. Then, for the AC component, a histogram of a combination of a run length of 0 and a value X until a value X other than 0 enters, and an optimum Huffman table is created. Encoding is performed according to the generated optimal Huffman table.

【0018】この時点で、このNTSC−RGBにおけ
る16×16画素のデータは、795bitになる。原
画像は1画素が8bitなので、16×16×3色=7
86byte=6144bitである。従って、1/
7.7の圧縮がなされたことになる。実際は、この符号
化データに画像サイズ、量子化テーブル、符号化テーブ
ル等が添付されて、メモリに格納、あるいは送信され
る。
At this point, the data of 16 × 16 pixels in NTSC-RGB becomes 795 bits. Since the original image has 8 bits per pixel, 16 × 16 × 3 colors = 7
86 bytes = 6144 bits. Therefore, 1 /
7.7 compression has been achieved. Actually, an image size, a quantization table, an encoding table, and the like are attached to the encoded data, and are stored in a memory or transmitted.

【0019】次にデータ伸長時の処理について説明す
る。
Next, the processing at the time of data expansion will be described.

【0020】ADCT圧縮法により処理された画像デー
タはハフマン複合化部3205に入力され、複合化され
る。逆量子化部3204は、ハフマン複合化部3205
にて複合化されたデータに対して図22に示される量子
化テーブルの係数を乗算することにより逆量子化の処理
を実行する。以上の処理により図19に示すようなデー
タが得られる。図19は前述のADCT圧縮法により得
られたデータに対してハフマン複合化処理及び逆量子化
処理を実行して得られるデータである。図19のデータ
を圧縮前のデータ図17と比較すれば、明らかに異なる
ことがわかる。
The image data processed by the ADCT compression method is input to a Huffman decomposing unit 3205 and decomposed. The inverse quantization unit 3204 includes a Huffman combining unit 3205
The multiplication data is multiplied by the coefficient of the quantization table shown in FIG. With the above processing, data as shown in FIG. 19 is obtained. FIG. 19 shows data obtained by executing the Huffman compounding process and the inverse quantization process on the data obtained by the above-mentioned ADCT compression method. When the data in FIG. 19 is compared with the data before compression in FIG.

【0021】次に、図19のデータを逆DCT変換部3
202でYCrCbデータに変換する。そのYCrCb
データを図20に示す。そして、図20のYCrCbデ
ータは、色空間変換部3201において、NTSC−R
GBデータに変換される。そして、データ伸長処理によ
り最終的に得られたデータを図21に示す。
Next, the data of FIG.
At 202, it is converted into YCrCb data. The YCrCb
The data is shown in FIG. Then, the YCrCb data in FIG.
It is converted to GB data. FIG. 21 shows data finally obtained by the data decompression process.

【0022】[0022]

【発明が解決しようとする課題】以上説明したように、
上記ADCT圧縮法は、サブサンプリング部3102及
び量子化部3104において、量子化時にデータの損失
を伴う不可逆圧縮法である。従って、伸長されたデータ
は圧縮前のデータとは異なるものとなる。これは、上述
の圧縮処理前のNTSC−RGBデータを表わす図15
と、図15のデータに対して圧縮伸長処理を実行した結
果得られるNTSC−RGBデータを表わす図21とを
比較すれば明らかである。そして、これは画質劣化が発
生するとを意味する。
As described above,
The ADCT compression method is an irreversible compression method involving data loss at the time of quantization in the sub-sampling unit 3102 and the quantization unit 3104. Therefore, the decompressed data is different from the data before compression. FIG. 15 shows NTSC-RGB data before the above-described compression processing.
This is apparent from a comparison of FIG. 21 with NTSC-RGB data obtained as a result of performing the compression / decompression processing on the data in FIG. And, this means that the image quality degradation occurs.

【0023】DCPデータ等のコンピュータ上で作成し
た画像(コンピュータ作成画像)は、アウトラインのき
れいさ、1図形(または1文字)単一色によるノイズの
ない色塗りがその長所である。ところが、ADCT圧縮
法により画像データを処理すると、図形のアウトライン
のみだれ、疑似エッジ(モスキートノイズと呼ばれる)
の発生、量子化による色の変化等が発生し、コンピュー
タ作成画像の長所が発揮されない。特に上述の圧縮法は
8×8ブロック処理であるため、境界域では大幅に色が
変化してしまう。圧縮率を上げると最終的に交流成分は
失われてブロック歪が発生し、解像度が1/8になった
ような画像となる。
An image (computer-generated image) created on a computer, such as DCP data, has the advantage of clear outlines and noise-free coloring with a single color of one figure (or one character). However, when the image data is processed by the ADCT compression method, only the outline of the figure is blurred and a pseudo edge (called mosquito noise) is generated.
And the change in color due to quantization occurs, and the advantages of computer-generated images are not exhibited. In particular, since the above-described compression method is an 8 × 8 block process, the color greatly changes in the boundary area. When the compression ratio is increased, the AC component is finally lost, block distortion occurs, and an image having a resolution of 1/8 is obtained.

【0024】このため、画質の劣化が目に見えない程度
の量子化におさえて圧縮することも考えられるが、もと
もと高周波数データが多いことを特徴とするコンピュー
タ作成画像であるため、圧縮率において実用的でない。
従って、DTPで作成した画像のようなコンピュータ作
成画像は可逆で高圧縮率の得られる圧縮法を圧縮するこ
とが必要である。
[0024] For this reason, it is conceivable to compress the image by quantization so that the deterioration of the image quality is not visible. However, since the image is originally a computer-generated image characterized by a large amount of high-frequency data, the compression ratio is low. Not practical.
Therefore, it is necessary to compress a computer-created image such as an image created by DTP by a compression method capable of obtaining a reversible and high compression ratio.

【0025】本発明は上記の問題点に鑑みてなされても
のであり、コンピュータなどにより作成された多値画像
を劣化なく高い圧縮率で圧縮する画像データ圧縮方法及
び装置を提供することを目的とする。具体的には、1画
素単位で多値画像を差分符号化する際に、符号化対象画
素の値が「前画素と同じ値になりやすい」こと、及び、
符号化対象画素の値は「2つ前に出現した画素値へ1つ
前に出現した画素値から戻る傾向がある」ことに着目し
た効率良い差分符号化を行うことを目的とする。
The present invention has been made in view of the above problems, and has as its object to provide an image data compression method and apparatus for compressing a multi-valued image created by a computer or the like at a high compression ratio without deterioration. I do. Specifically, when differentially encoding a multi-valued image on a pixel-by-pixel basis, the value of the encoding target pixel "is likely to be the same value as the previous pixel"; and
An object of the present invention is to perform efficient differential encoding focusing on the fact that the value of a pixel to be encoded is “there is a tendency to return from the pixel value that appeared two times before to the pixel value that appeared immediately before”.

【0026】[0026]

【課題を解決するための手段】上記目的を達成するため
に本発明の画像データ圧縮方法によれば、1画素単位で
画素データd[i]を入力する入力ステップと、前記画
素データd[i]と、該データの前画素データd[i−
1]との差分diffを出力する差分出力ステップと、
前記差分diffが0であるか否かを判定する第1判定
ステップと、前記差分diffがx[k]であるか否か
を判定する第2判定ステップと、前記第1、第2判定ス
テップによる判定での一致/不一致に基づき、前記d
[i]を示す符号を出力する符号出力ステップとを備
え、前記第1判定ステップにて前記差分diffが0以
外の時、x[k+1]=−diffの更新を行い、次の
画素データd[i+1]の符号化に適用することを特徴
とする。
According to the present invention, there is provided an image data compression method comprising the steps of: inputting pixel data d [i] in units of one pixel; ] And preceding pixel data d [i−
1], a difference output step of outputting a difference diff with respect to
A first determining step of determining whether the difference diff is 0, a second determining step of determining whether the difference diff is x [k], and a first and a second determining steps. Based on the match / mismatch in the judgment, the d
And a code output step of outputting a code indicating [i]. When the difference diff is not 0 in the first determination step, x [k + 1] = − diff is updated, and the next pixel data d [ i + 1].

【0027】[0027]

【実施例】始めにコンピュータ作成画像の特徴を示す図
を図24(a)に示す。図24(a)の縦軸はデータの
値を示し、横軸は空間軸である。コンピュータ作成画像
は第1の特徴として同じデータ値が続く傾向があり、第
2の特徴としてデータが変化しても元のデータに戻る傾
向がある。
FIG. 24A is a diagram showing the characteristics of an image created by a computer. The vertical axis of FIG. 24A indicates the value of the data, and the horizontal axis is the spatial axis. Computer-generated images tend to have the same data value as the first feature, and return to the original data even if the data changes as the second feature.

【0028】そこで、出現確率の高さとしては、 1)前の画素と同じデータ(差分が0) 2)画素値変化時のベクトルと逆のベクトル が、起こりやすいことになる。Therefore, as the height of the appearance probability, 1) the same data as the previous pixel (the difference is 0) 2) The vector opposite to the vector at the time of the pixel value change is likely to occur.

【0029】すなわち、差分がプラス2の変化が発生し
たらマイナス2の変化が起こりやすい。これを、図24
(b)を使用して説明する。
That is, if the difference has a change of plus 2, a change of minus 2 tends to occur. This is shown in FIG.
This will be described with reference to FIG.

【0030】1101でプラス64のベクトルが発生し
たら差分<0>の次に起こりやすいベクトルは<−64
>である。図24(b)の例では実際に次の1102で
マイナス64のベクトルが発生している。1102のマ
イナス64のベクトルから次に起こりやすいベクトルは
<+64>である。1103でプラス64のベクトルが
発生している。次の1104ではプラス191のベクト
ルが発生した。この際、<0>の次に起こりやすい事象
は<−191>、その次は、−191−64で計算され
る<−255>である。
If a vector of plus 64 is generated at 1101, the vector that is likely to occur next to the difference <0> is <−64.
>. In the example of FIG. 24B, a minus 64 vector is actually generated in the next 1102. The next most likely vector from the minus 64 vector of 1102 is <+64>. At step 1103, a plus 64 vector is generated. In the next 1104, a plus 191 vector was generated. At this time, the event that is likely to occur next to <0> is <-191>, and the next is <-255> calculated by -191-64.

【0031】以上の特徴から起こりやすい事象は計算式
で以下のように表わすことができる。空間的変化をi、
そのときの画素値をd[i](0〜255の8bi
t)、同じ色を一塊としてインクリメントされるk(図
24参照)、<0>の次に起こりやすいベクトルをx
[k]、<0>、x[k]の次に起こりやすいベクトル
をy[k]で表わすとして、diff=d[i]−d
[i−1]とすると、diffが0の時、x[k]、y
[k]は変化なし。diffが0以外の時、x[k]、
y[k]が次のように更新される。
The events that are likely to occur from the above characteristics can be expressed by the following formulas using a calculation formula. The spatial change is i,
The pixel value at that time is represented by d [i] (8 bi of 0 to 255).
t), k is incremented by the same color as a lump (see FIG. 24), and the next most likely vector after <0> is x
Assuming that the next most likely vector after [k], <0> and x [k] is represented by y [k], diff = d [i] −d
Assuming that [i-1], when diff is 0, x [k], y
[K] has no change. When diff is other than 0, x [k],
y [k] is updated as follows.

【0032】x[k+1]=−diff,y[k+1]
=diff+A[k] A[k]は発生ベクトルがx[k]と一致したときy
[k]であり、それ以外の時x[k]である。
X [k + 1] =-diff, y [k + 1]
= Diff + A [k] A [k] is y when the generation vector matches x [k]
[K], otherwise x [k].

【0033】i[0]、x[0]、y[0]は初期値と
して決まった値を代入しておく。例えばi[0]=0、
x[0]=255、y[0]=100のように代入して
おく。
For i [0], x [0] and y [0], predetermined values are substituted as initial values. For example, i [0] = 0,
It is substituted as x [0] = 255 and y [0] = 100.

【0034】そして、起こりやすい事象に短い符号を割
り当てることにより、データを圧縮することができる。
The data can be compressed by assigning a short code to an easily occurring event.

【0035】例えば、差分が0だったときの符号を
“0”、差分がx[k]と一致したときの符号を“1
0”、差分がy[k]と一致したときの符号を“11
0”とし、どれとも一致しなかったときにどれとも一致
しなかったことを示す符号“111”に値を示すデータ
を添付する。この値を示すデータは差分であってもよい
し、色データであってもよいが、この例では色データを
添付する。このような符号で図24(b)のように値が
変化する画像を処理してみる。
For example, the code when the difference is 0 is “0”, and the code when the difference matches x [k] is “1”.
0 ”and the code when the difference matches y [k] is“ 11 ”.
0, and data indicating a value is attached to a code “111” indicating that when none of them match, the data indicating this value may be a difference or color data. However, in this example, color data is attached, and an image whose value changes as shown in FIG.

【0036】d[1]−d[0]は0であるので<0>
が出力される。
Since d [1] -d [0] is 0, <0>
Is output.

【0037】d[2]−d[0]も0であるので<0>
が出力される。
Since d [2] -d [0] is also 0, <0>
Is output.

【0038】d[3]−d[2]は64であり、x
[0]=10、y[0]=5とも異なるので<111+
64>すなわち<11101000000>が出力され
る。
D [3] -d [2] is 64 and x
[0] = 10, y [0] = 5, so <111+
64>, that is, <1111000000>.

【0039】この変化によってx[1]に−64(−d
iff)が代入されy[1]には191(−diff+
x[0])が代入される。
This change causes x [1] to be -64 (-d
iff) is substituted and 191 (−diff +
x [0]).

【0040】d[4]−d[3]は0であるので<0>
が出力される。
Since d [4] -d [3] is 0, <0>
Is output.

【0041】d[5]−d[4]も0であるので<0>
が出力される。
Since d [5] -d [4] is also 0, <0>
Is output.

【0042】d[6]−d[5]は−64でありx
[1]と一致するので<10>が出力される。
D [6] -d [5] is -64 and x
Since it matches [1], <10> is output.

【0043】この変化によってx[2]に+64(−d
iff)が代入されy[2]には255(−diff+
y[1])が代入される。
By this change, x [2] is changed to +64 (−d
iff) is substituted and 255 (−diff +
y [1]) is substituted.

【0044】d[7]−d[6]は0であるので<0>
が出力される。
Since d [7] -d [6] is 0, <0>
Is output.

【0045】d[8]−d[7]は64でありx[2]
と一致するので<10>が出力される。
D [8] -d [7] is 64 and x [2]
And <10> is output.

【0046】この変化によってx[3]に−64(−d
iff)が代入されy[3]には191(−diff+
y[2])が代入される。
This change causes x [3] to be -64 (-d
iff) is substituted and 191 (−diff +
y [2]) is substituted.

【0047】d[9]−d[8]は0であるので<0>
が出力される。
Since d [9] -d [8] is 0, <0>
Is output.

【0048】d[10]−d[9]は+191でありy
[3]と一致するので<110>が出力される。
D [10] -d [9] is +191 and y
Since it matches [3], <110> is output.

【0049】この変化によってx[4]に−191(−
diff)が代入されy[4]には−255(−dif
f+x[3])代入される。
This change causes x [4] to be -191 (-
diff) is substituted and −255 (−dif) is substituted for y [4].
f + x [3]).

【0050】d[11]−d[10]は0であるので<
0>が出力される。
Since d [11] -d [10] is 0, <
0> is output.

【0051】d[12]−d[11]も0であるので<
0>が出力される。
Since d [12] -d [11] is also 0, <
0> is output.

【0052】d[13]−d[12]も0であるので<
0>が出力される。
Since d [13] -d [12] is also 0, <
0> is output.

【0053】d[14]−d[13]も0であるので<
0>が出力される。
Since d [14] -d [13] is also 0, <
0> is output.

【0054】d[15]−d[14]も0であるので<
0>が出力される。
Since d [15] -d [14] is also 0, <
0> is output.

【0055】d[16]−d[15]も0であるので<
0>が出力される。
Since d [16] -d [15] is also 0, <
0> is output.

【0056】d[17]−d[16]は−191であり
x[4]と一致するので<10>が出力される。
Since d [17] -d [16] is -191 and coincides with x [4], <10> is output.

【0057】この変化によってx[5]に+191(−
diff)が代入されy[5]には−64(−diff
+y[4])が代入される。
By this change, x [5] is added to +191 (−
diff) is substituted and y [5] is −64 (−diff
+ Y [4]).

【0058】このような処理によってx[k]、y
[k]の値は図24(c)のように変化する。また、符
号データ図24(d)のように59bitになり、この
例では元のデータは8bitであるので36画素×8=
288bit必要だったものが約5分の1の59bit
に圧縮できる。何bit画像にも応用可能である。
By such processing, x [k], y
The value of [k] changes as shown in FIG. Also, the code data is 59 bits as shown in FIG. 24 (d). In this example, since the original data is 8 bits, 36 pixels × 8 =
What needed 288 bits is about 1/5 of 59 bits
Can be compressed. It can be applied to any bit image.

【0059】図24(d)のデータを伸長処理する際の
様子を以下に示す。
The situation when the data of FIG. 24D is expanded is shown below.

【0060】伸長処理のときもd[0]=0、x[0]
=255、y[0]=100という圧縮処理のときと同
じ初期値を与える。
In the decompression process, d [0] = 0 and x [0]
= 255 and y [0] = 100, the same initial values as in the compression processing.

【0061】まず最初の符号は<0>であるのでd
[1]=d[0]=0が導ける。
First, since the first code is <0>, d
[1] = d [0] = 0 can be derived.

【0062】次の符号も<0>であるのでd[2]=0
が導ける。
Since the next code is also <0>, d [2] = 0
Can lead.

【0063】次の符号は<111>であり、これはx
[0]、y[0]とも異なる差分のデータが発生したこ
とを示すので次の8bit(この場合8bitだが元デ
ータ24bitなら24bit)を読みだし、64とい
う数値が得られるのでd[3]に代入し、d[3]=6
4となる。この際x[1]には−(d[3]−d
[2])=−64が代入され、y[1]には−64+x
[0]=191が代入される。この例では色データを添
付したのでd[3]=(読み出された数値)、x[1]
=−((読み出された数値)−d[2])になったが差
分を添付した場合はd[3]=d[2]+(読み出され
た数値)で、x[1]=(読み出された数値)となる。
The next code is <111>, which is x
[0] and y [0] indicate that different data has been generated, so the next 8 bits (8 bits in this case, but 24 bits if the original data is 24 bits) are read out, and a numerical value of 64 is obtained. Substituting, d [3] = 6
It becomes 4. At this time, x [1] has-(d [3] -d
[2]) = − 64 is substituted, and y [1] is −64 + x
[0] = 191 is substituted. In this example, since color data is attached, d [3] = (read-out numerical value), x [1]
= − ((Read numerical value) −d [2]), but when a difference is attached, d [3] = d [2] + (read numerical value), and x [1] = (Read numerical value).

【0064】次の符号は<0>であるのでd[4]=6
4が導ける。
Since the next code is <0>, d [4] = 6
4 leads.

【0065】次の符号も<0>であるのでd[5]=6
4が導ける。
Since the next code is also <0>, d [5] = 6
4 leads.

【0066】次の符号は<10>であり、これは差分が
x[1]と等しいことを示しているのでd[6]=d
[5]+x[1]=0が導ける。この際x[2]は−
(d[6]−d[5])=64が代入され、y[2]に
は64+y[1]=255が代入される。
The next code is <10>, which indicates that the difference is equal to x [1], so that d [6] = d
[5] + x [1] = 0 can be derived. At this time, x [2] is-
(D [6] −d [5]) = 64 is assigned, and 64 + y [1] = 255 is assigned to y [2].

【0067】次の符号は<0>であるのでd[7]=0
が導ける。
Since the next code is <0>, d [7] = 0
Can lead.

【0068】次の符号は<10>であり、これは差分が
x[2]と等しいことを示しているのでd[8]=d
[7]+x[2]=64が導ける。この際x[3]は−
(d[8]−d[7])=−64が代入され、y[3]
には−64+y[2]=191が代入される。
The next code is <10>, which indicates that the difference is equal to x [2], so that d [8] = d
[7] + x [2] = 64 is derived. At this time, x [3] is-
(D [8] −d [7]) = − 64 is substituted, and y [3]
Is assigned to −64 + y [2] = 191.

【0069】次の符号は<0>であるのでd[9]=6
4が導ける。
Since the next code is <0>, d [9] = 6
4 leads.

【0070】次の符号は<110>であり、これは差分
がy[3]と等しいことを示しているのでd[10]=
d[9]+y[3]=255が導ける。この際x[4]
は−(d[10]−d[9])=191が代入され、y
[4]には−191+x[3]=−255が代入され
る。
The next code is <110>, which indicates that the difference is equal to y [3], so that d [10] =
d [9] + y [3] = 255 is derived. At this time, x [4]
Is substituted with-(d [10] -d [9]) = 191, and y
-191 + x [3] =-255 is substituted for [4].

【0071】以上の処理によって図24(d)の符号か
ら図24(a)の画像データがデータの損失なく復元で
きる。
With the above processing, the image data of FIG. 24A can be restored from the code of FIG. 24D without data loss.

【0072】以下に本発明による好適な実施例について
添付の図面を参照して説明する。
Hereinafter, preferred embodiments of the present invention will be described with reference to the accompanying drawings.

【0073】〔実施例1〕実施例1によるデータ圧縮装
置について以下に説明する。
[Embodiment 1] A data compression apparatus according to Embodiment 1 will be described below.

【0074】図1は実施例1によるデータ圧縮装置の機
能構成を表すブロック図である。
FIG. 1 is a block diagram showing a functional configuration of the data compression device according to the first embodiment.

【0075】101は画素データ並び変え部で入力され
たラスター画像データを並び変えて1画素づつクロック
に同期して出力する。ここは何の処理がなくても(ラス
ターのままスルーで出力されても)構わないし、スキャ
ン順次を図26に示したように替えて出力してもよい。
たとえば、図26(a)の様に並び変えるには画素デー
タ並び変え部はメモリで構成され垂直方向8ライン分の
画素データを保持しアドレス制御で並び変えたデータを
順次出力していく。102は圧縮部で画素データ並び変
え部101から出力された画素データを圧縮処理して符
号を出力する。103はデータパック部で圧縮部102
から出力された符号を入力し、メモリ、または通信イン
ターフェースのデータ深さ(depth)に合わせて符
号をパッキングし、パッキングされたデータを出力す
る。104はメモリまたは通信インターフェース部でパ
ッキングされたデータを格納または送信する。
Reference numeral 101 denotes a unit for rearranging the raster image data input by the pixel data rearranging unit, and outputting the raster image data one pixel at a time in synchronization with the clock. Here, there is no problem even if there is no processing (the data may be output as a raster as it is), or the scan sequence may be changed and output as shown in FIG.
For example, in order to rearrange the pixel data as shown in FIG. 26A, the pixel data rearranging section is constituted by a memory, holds pixel data for eight lines in the vertical direction, and sequentially outputs data rearranged by address control. A compression unit 102 performs compression processing on the pixel data output from the pixel data rearranging unit 101 and outputs a code. 103, a data pack unit;
And outputs the packed data according to the data output from the memory interface or the communication interface. 104 stores or transmits data packed in a memory or a communication interface unit.

【0076】圧縮部102について図2を用いて説明す
る。201は24bitのフリップフロップでクロック
に同期して入力された画素データ値を格納する。初期値
が必要でここでは例として、白(255、255、25
5)を初期値として格納する。
The compression section 102 will be described with reference to FIG. Reference numeral 201 denotes a 24-bit flip-flop that stores a pixel data value input in synchronization with a clock. An initial value is required. Here, as an example, white (255, 255, 25
5) is stored as an initial value.

【0077】202は減算器で入力された画素データd
[i]とフリップフロップ部201からの出力である一
画素前の画素データd[i−1]を入力し、d[i]−
d[i−1]を演算して25bitの差分データdif
fを出力する。
Reference numeral 202 denotes pixel data d input by the subtractor
[I] and pixel data d [i−1] one pixel before, which is an output from the flip-flop unit 201, are input, and d [i] −
d [i-1] is calculated and 25-bit difference data dif
Output f.

【0078】203はOR回路部で減算器202からの
出力であるdiffの下位24bitを入力しORをと
って1bitのデータcode0を出力する。code
0はdiffが0のとき0となり、diffが0以外の
とき1となる。
An OR circuit 203 inputs the lower 24 bits of the diff output from the subtracter 202, performs an OR operation, and outputs 1-bit data code0. code
0 is 0 when diff is 0, and 1 when diff is other than 0.

【0079】204は加算器で減算器202の出力であ
るdiffのNOTを入力して1と加算して−diff
を出力する。
Reference numeral 204 denotes an adder, which inputs the NOT of the diff output from the subtractor 202 and adds 1 to -diff.
Is output.

【0080】205は25bitのフリップフロップで
加算器204の出力である−diffを入力し、NOT
回路203の出力であるcode0をハイイネーブル信
号としてcode0が1のとき−diffを格納する。
初期値が必要でここでは例として、白から黒に変わった
ときの差分(−255、−255、−255)を初期値
として格納する。206は比較器で減算器202の出力
であるdiffとフリップフロップ205の出力である
Xを入力して一致したら0、不一致ならば1という1b
itのデータcode1を出力する。
Reference numeral 205 denotes a 25-bit flip-flop to which -diff which is the output of the adder 204 is input, and NOT
When code0, which is the output of the circuit 203, is 1, the signal "-diff" is stored.
An initial value is necessary. Here, as an example, the difference (−255, −255, −255) when white changes to black is stored as the initial value. Reference numeral 206 denotes a comparator which receives the diff output from the subtracter 202 and the X output from the flip-flop 205 and outputs 0 if they match and 1 if they do not match.
It outputs data code1 of it.

【0081】207はセレクタでフリップフロップ20
5の出力であるXと後述のYを入力し比較器206から
出力されるcode1の制御で、codeが1のときは
Xをcode1が0のときはYを選択して出力する。
A selector 207 is a flip-flop 20
Under the control of code1, which is input from the output X of 5 and Y described later and output from the comparator 206, X is selected when code is 1 and Y is selected when code1 is 0 and output.

【0082】208は加算器で加算器204の出力であ
る−diffとセレクタ207の出力を入力し25bi
tの加算結果を出力する。
Reference numeral 208 denotes an adder which receives the output of -diff of the adder 204 and the output of the selector 207, and
The addition result of t is output.

【0083】209は25bitのフリップフロップで
加算器208の出力を入力し、NOT回路203の出力
であるcode0をハイイネーブル信号としてcode
0が1のときデータを格納する。初期値が必要でここで
は例として、白から赤に変わったときの差分(0、−2
55、−255)を初期値として格納する。
Reference numeral 209 denotes a 25-bit flip-flop to which the output of the adder 208 is input, and that code 0, which is the output of the NOT circuit 203, is used as a high enable signal.
When 0 is 1, data is stored. An initial value is required. Here, as an example, the difference (0, -2) when the color changes from white to red.
55, -255) are stored as initial values.

【0084】201は比較部で減算器202の出力であ
るdiffとフリップフロップ209の出力であるYを
入力して一致したら0、不一致ならば1という1bit
のデータcode2を出力する。
Reference numeral 201 denotes a comparison unit, which is a 1-bit value of 0 if the output diff of the subtractor 202 and Y the output of the flip-flop 209 match, and 1 if they do not match.
Is output.

【0085】211は符号割り当て部でcode0、c
ode1、code2を入力し符号を割り当てて出力す
る。
Reference numeral 211 denotes a code allocating unit for code 0, c
mode1 and code2 are input, assigned codes, and output.

【0086】この圧縮装置では 1)差分diffが0 2)差分diffがXと一致 3)差分diffがYと一致 4)1)2)3)のどれでもない の4つのケースが存在するが、例えば、1)にたいして
<0>、2)にたいして<10>、3にたいして<11
0>、4)にたいして<111>としう符号を固定で与
えるならば211の符号割り当て部は必要なく、1)の
とき<code0>を、2)のとき<code1、co
de1>を、3)と4)のとき<code0、code
1、code2>を出力すればよい。211の符号割り
当て部が必要なのは符号を状況によって変化させたい時
などである。
In this compression apparatus, there are four cases: 1) the difference diff is 0, 2) the difference diff matches X, 3) the difference diff matches Y, 4) none of 1), 2) and 3). For example, <0> for 1), <10> for 2), <11> for 3
If a code to be <111> is fixedly given to 0> and 4), the code allocating unit 211 is not necessary, and <code0> is used in 1) and <code1, cod is used in 2).
de1> in case of 3) and 4) <code0, code
1, code2> may be output. The code assignment unit 211 is necessary when it is desired to change the code according to the situation.

【0087】図6に本圧縮装置の動作を示すフローチャ
ートを示す。
FIG. 6 is a flowchart showing the operation of the compression apparatus.

【0088】本圧縮装置で圧縮されたデータを伸長する
伸装置の一例を図3に示す。
FIG. 3 shows an example of a decompression device for decompressing data compressed by the present compression device.

【0089】301はメモリまたは通信インタフェース
で、読み出されたデータまたは受信したデータを出力す
る。302はデータアンパック部でマルチプレクサなど
で構成され、受け取った圧縮データを荷ほどきして出力
する。303は伸長部で荷ほどきされたデータを入力し
画素データに伸長して出力する。304は画素データ並
び変え部で伸長されたデータを画像空間水平垂直に直し
て出力する。これは、圧縮処理時に画素データを並び変
え部101がなかった場合は必要ない。たとえば、図2
6のように並び変えられている場合に、元のラスター順
に戻すために必要である。
A memory or communication interface 301 outputs read data or received data. Reference numeral 302 denotes a data unpacking unit which is configured by a multiplexer or the like and unpacks and outputs the received compressed data. Reference numeral 303 denotes input of the data unpacked by the expansion unit, expansion to pixel data, and output. 304, the data expanded by the pixel data rearranging unit is output in the horizontal and vertical directions in the image space. This is not necessary if there is no pixel data rearranging unit 101 during the compression process. For example, FIG.
It is necessary to return to the original raster order when rearranged as shown in FIG.

【0090】伸長部303について図4を用いて説明す
る。401は符号戻し部で圧縮処理時に符号割り当て部
で符号変換を行った場合に必要であるが、それ以外は必
要ない。code0とcode1とcode2と添付さ
れた24bitの色データnewを出力する。
The extension section 303 will be described with reference to FIG. Reference numeral 401 denotes a code return unit that is necessary when code conversion is performed by the code allocation unit during compression processing, but other than that is not necessary. It outputs 24-bit color data new attached to code0, code1, and code2.

【0091】402は24bitフリップフロップで画
素データd[i]を格納する。圧縮処理時に201に格
納した初期値と同じ初期値が必要で(255、255、
255)を格納する。
Reference numeral 402 denotes a 24-bit flip-flop which stores pixel data d [i]. The same initial value as the initial value stored in 201 during the compression processing is required (255, 255,
255) is stored.

【0092】403は減算器で画素データd[i−1]
からd[i]を減算した値である25bitの−dif
fを出力する。
Reference numeral 403 denotes a subtractor for pixel data d [i-1].
-Dif of 25 bits which is a value obtained by subtracting d [i] from the
Output f.

【0093】404は25bitのフリップフロップで
減算器403の出力である−diffを入力しcode
1をハイイネーブル信号としてcode1が1のときに
−diffを格納する。圧縮処理時に205に格納した
初期値と同じ初期値が必要で(−255、−255、−
255)を格納する。
Reference numeral 404 denotes a 25-bit flip-flop to which -diff output from the subtractor 403 is input and code
When "1" is 1 and "code1" is "1", "-diff" is stored. The same initial value as the initial value stored in 205 during the compression processing is required (−255, −255, −255).
255) is stored.

【0094】405はセレクタで後述するXとYを入力
しcode1の制御で、code1が1のときXを、c
ode1が0のときYを選択し、出力する。
Reference numeral 405 denotes a selector for inputting X and Y, which will be described later, and controlling code1. When code1 is 1, X is set to c.
When mode1 is 0, Y is selected and output.

【0095】406は加算器でセレクタ405の出力と
減算器403の出力である−diffを入力し、加算し
て出力する。
Reference numeral 406 denotes an adder which receives the output of the selector 405 and the output of the subtractor 403, ie, -diff, adds and outputs the result.

【0096】407は25bitのフリップフロップで
加算器406の出力を入力し、code1をハイイネー
ブル信号としてcode1が1のときにデータを格納す
る。圧縮処理時に209に格納した初期値と同じ初期値
が必要で(0、−255、−255)を格納する。
Reference numeral 407 denotes a 25-bit flip-flop which inputs the output of the adder 406, stores data when code1 is 1 with code1 as a high enable signal. The same initial value as the initial value stored in 209 at the time of the compression processing is required, and (0, -255, -255) is stored.

【0097】408はセレクタでフリップフロップ40
4の出力であるXとフリップフロップ407の出力であ
るYを入力しcode1の制御で、code1が0のと
きXを、code1が1のときYを選択し、出力する。
A selector 408 is a flip-flop 40.
X which is the output of 4 and Y which is the output of the flip-flop 407 are input, and under the control of code1, X is selected when code1 is 0, and Y is selected when code1 is 1, and output.

【0098】409は加算器でフリップフロップ402
の出力であるd[i−1]とセレクタ408の出力を入
力し加算して24bitデータAを出力する。
An adder 409 is a flip-flop 402.
, And the output of the selector 408 is input and added to output 24-bit data A.

【0099】410はAND回路でcode0、cod
e1、code2を入力してすべてが1のときのみ1を
出力する。
Reference numeral 410 denotes an AND circuit for code 0, code
e1 and code2 are input and 1 is output only when all are 1.

【0100】411はセレクタで色データnewとフリ
ップフロップ402の出力であるd[i−1]と加算器
409の出力Aを入力しcode0とAND回路410
の出力bを制御として(code0、b)とすると
(0、X)のとき、d[i−1]、(1、0)のとき
A、(1、1)のときnewを選択して色データd
[i]を出力する。
A selector 411 receives the color data new, the output d [i-1] of the flip-flop 402 and the output A of the adder 409, and inputs code0 and an AND circuit 410.
If (code0, b) is used as the control of output b, (0, X), d [i-1], (1, 0) A, (1, 1) new, and color Data d
[I] is output.

【0101】図7に本伸長装置の動作を示すフローチャ
ートを示す。
FIG. 7 is a flowchart showing the operation of the present decompression device.

【0102】〔実施例2〕上述の実施例においては出現
確率が高いとして符号を与えるベクトルをx、yの2つ
としたがこれに限るものではなく、論理的にいくつでも
よい。ベクトルの計算式は以下のようになる。上述の実
施例ではx[k]、y[k]で表現したベクトルを本実
施例ではvect[m][k]と表現する。m=0〜n
で、m=0のとき上述の実施例でのxにあたり、m=1
のとき上述の実施例でのyにあたる。kは同じ色を一塊
としてインクリメントされる値(図24(a)参照)で
ある。色変化をdiff=d[i]−d[i−1](i
は画素の空間的変化、d[i]はiの位置の画素値)と
定義し、ベクトルvect[m][k]はdiff1=
0のとき(色の変化が起こったとき)に次のように更新
される。
[Embodiment 2] In the above-described embodiment, two vectors x and y are given as signs with a high appearance probability. However, the present invention is not limited to this. The formula for calculating the vector is as follows. In the above-described embodiment, the vector represented by x [k] and y [k] is represented as vector [m] [k] in the present embodiment. m = 0 to n
When m = 0, it corresponds to x in the above embodiment, and m = 1
At this time, it corresponds to y in the above embodiment. k is a value that increments the same color as one lump (see FIG. 24A). The color change is diff = d [i] -d [i-1] (i
Is the spatial change of the pixel, d [i] is the pixel value at the position of i), and the vector vect [m] [k] is diff1 =
When it is 0 (when a color change occurs), it is updated as follows.

【0103】vect[0][k+1]=−diff; vect[1][k+1]=−diff+A; ここで、Aはif(diff==vect[0]
[k])A=vect[1][k]; else A=vect[0][k]; vect[2][k+1]=−diff+B: ここで、Bはif((diff==vect[0]
[k])::(diff==vect[1][k]))
B=vect[2][k]; else A=vect[1][k]; vect[n][k+1]=−diff+P; ここで、Pはif((diff==vect[0]
[k])::(diff==vect[1]
[k])::…::(diff==vect[n−1]
[k]) P=vect[n][k]; else P=vect[n−1][k]; 本実施例の動作を実現する装置例は図5のようになる。
Vector [0] [k + 1] = − diff; vector [1] [k + 1] = − diff + A; where A is if (diff == vect [0]
[K]) A = vect [1] [k]; else A = vect [0] [k]; vect [2] [k + 1] = − diff + B: where B is if ((diff == vect [0 ]
[K]): :( diff == vector [1] [k]))
B = vector [2] [k]; else A = vector [1] [k]; vector [n] [k + 1] = − diff + P; where P is if ((diff == vect [0]
[K]): :( diff == vect [1]
[K]) :::: :( diff == vect [n-1]
[K]) P = vector [n] [k]; else P = vector [n−1] [k]; FIG. 5 shows an example of an apparatus for realizing the operation of the present embodiment.

【0104】なお、上述の各実施例においてはハードウ
ェアによりその圧縮法を実現しているが、コンピュータ
のソフトウェアによりこれを実現しても良い。
In each of the embodiments described above, the compression method is realized by hardware, but this may be realized by software of a computer.

【0105】〔実施例3〕以上説明した実施例において
どのベクトルとも一致しなかったとき、どのベクトルと
も一致しないコードのあとに色データを添付したがその
限りではなく、色を表わす情報なら何でも構わない。
[Embodiment 3] In the above-described embodiment, when data does not match any vector, color data is attached after a code which does not match any vector. However, the present invention is not limited to this, and any information representing a color may be used. Absent.

【0106】たとえば、差分データを添付してもよい
し、パレットコードを添付してもよい。以下、パレット
コードについて簡単に説明する。
For example, difference data may be attached, or a pallet code may be attached. Hereinafter, the pallet code will be briefly described.

【0107】固定bitパレット情報を添付する場合に
はたとえば8bit固定パレットであれば256色に限
定されてしまうが、24bitの色データを添付するの
に比べて8bitですむ利点がある。パレットは存在す
る色がわかっていれば初めに決めておいてもいいし、圧
縮中に出現した新色を登録してもよい。その場合、どの
ベクトルとも一致しなかった場合、パレット内の登録色
と添付するべき色データを比較し、一致していたらその
パレット番号を、不一致だったら新たなパレット番号を
あたえ、そのパレット番号を出力する。
When the fixed-bit palette information is attached, for example, if the 8-bit fixed palette is used, the number of colors is limited to 256. However, there is an advantage that only 8-bit data is required as compared with the case where 24-bit color data is attached. The palette may be determined first if the existing colors are known, or a new color that has appeared during compression may be registered. In this case, if it does not match any of the vectors, the registered colors in the palette are compared with the color data to be attached.If they match, the palette number is given.If they do not match, the new palette number is given, and the palette number is given. Output.

【0108】〔実施例4〕上述の実施例において圧縮部
から出力された圧縮コードをさらに他の可逆圧縮法で圧
縮してもよい。他の圧縮法とはランレングス圧縮法のM
Hやハフマン符号化などである。通常のMHより数値1
の前に0が続いた数を1つの単位(たとえば、0000
1、00000000001)としてハフマン符号化す
ると効果的である。図8に本実施例の装置を示す。
[Embodiment 4] In the above-described embodiment, the compression code output from the compression section may be further compressed by another lossless compression method. The other compression method is M of run-length compression method.
H or Huffman coding. Numerical value 1 from normal MH
Is preceded by 0 and the number is counted as one unit (for example, 0000
It is effective to perform Huffman coding as (100000000001). FIG. 8 shows the device of this embodiment.

【0109】〔実施例5〕上述の実施例において圧縮デ
ータはシリアルに並べて1つにパッキングしたが、別々
にパッキングしても構わない。
[Embodiment 5] In the above embodiment, the compressed data are serially arranged and packed into one, but they may be packed separately.

【0110】たとえば第1の実施例を例にして説明する
とcode0に当たる情報とcode1に当たる情報と
code2に当たる情報と添付する色を表わす情報は別
々にメモリに格納してもよい(図9−901)。
For example, taking the first embodiment as an example, the information corresponding to code 0, the information corresponding to code 1, the information corresponding to code 2, and the information indicating the color to be attached may be separately stored in the memory (FIG. 9-901).

【0111】1つにパッキングする場合には符号データ
を格納する場所が常に不定なため(例として32bit
深さで1つにパッキングする場合符号データを格納する
のはcode0、code1、code2のコードが可
変長なので1bit目からになるかもしれないし、5b
it目になるかもしれない)、バレルシフタが必要にな
ってパッキング回路が大きくなってしまう。この点が別
々にパッキングすることにより解決される。特に24b
it色のデータのパッキングが困難なのでcode0、
code1、code2は一緒に格納して24bit色
データだけ別にしてもよい(図9−902)。
In the case of packing into one, since the place where the code data is stored is always undefined (for example, 32 bits
In the case where packing is performed at one depth, the code data may be stored from the first bit because the codes of code0, code1, and code2 are of variable length, and 5b.
(It may be an it-th time), a barrel shifter is required, and the packing circuit becomes large. This is solved by packing separately. Especially 24b
It is difficult to pack it color data, so code 0,
code1 and code2 may be stored together to separate only 24-bit color data (FIG. 9-902).

【0112】また、code0、code1、code
2もそれぞれ別々にパッキングすることにより、さらに
この符号データをランレングス圧縮をかける場合に0に
続くことが多くなりランレングス圧縮の効果が大きくな
る。
Also, code0, code1, code
2 are also separately packed, so that when the code data is further subjected to run-length compression, it often follows 0, and the effect of run-length compression is increased.

【0113】〔実施例6〕上述の第4の実施例におい
て、メモリをcode0、code1、code2、色
データに分けた場合、符号データをランレングス圧縮を
かける場合0でも1でも同じデータが続いたほうが圧縮
効果が高いので、code0、code1、code2
を表わす符号は符号割り当て部211を使用してトグル
にしてもよい。
[Embodiment 6] In the above-described fourth embodiment, when the memory is divided into code 0, code 1, code 2, and color data, when the code data is subjected to run-length compression, the same data continues whether 0 or 1. Since the compression effect is higher, code0, code1, code2
May be toggled using the code assignment unit 211.

【0114】図10(a)は第1実施例に則した符号で
ある。これを、トグル符号にすると図10(b)のよう
になる。つまり、図10(a)で1が発生したのをきっ
かけに次の符号は反転させる。これによって0、1が続
くことが多くなり、特にcode0において後にランレ
ングスかける際に効果的である。
FIG. 10A shows reference numerals in accordance with the first embodiment. If this is converted into a toggle code, it becomes as shown in FIG. That is, the occurrence of 1 in FIG. 10A triggers the next sign to be inverted. As a result, 0s and 1s often follow, which is particularly effective when the code 0 is run-length later.

【0115】上述の実施例においてフリップフロップ2
06、210に格納するのは出現可能性の高いベクトル
そのものの値であったが、図11の様な構成にすること
も可能である。図2に対して対応するものは図2の20
6に対して1000番をつけて1206で示してある。
ここで、フリップフロップ1206と1210は出現可
能性の高いベクトルそのものではなく、その情報を用い
て後の演算部1204、1208などによって出現可能
性の高いベクトルを演算することのできる情報を格納す
る。
In the above embodiment, the flip-flop 2
Although the values stored in the vectors 06 and 210 are the values of the vectors that are highly likely to appear, a configuration as shown in FIG. 11 can be used. The counterpart to FIG. 2 is 20 in FIG.
6 is indicated by 1206 with the number 1000 added.
Here, the flip-flops 1206 and 1210 store not the vectors that are likely to appear, but information that can be used to calculate the vectors that are likely to appear by the operation units 1204 and 1208 using the information.

【0116】図2に順次格納されるX、Yにたいして
(図25(c))図11の装置例が格納するX′、Y′
を比較した表を図12に示す。図12−(a)が図2の
装置のフリップフロップに格納されるX、Yの変異の様
子で、図12−(b)が図11の装置フリップフロップ
に格納されるX′、Y′の変異の様子である。
With respect to X and Y sequentially stored in FIG. 2 (FIG. 25 (c)), X 'and Y' stored in the apparatus example of FIG.
Is shown in FIG. FIG. 12- (a) shows the variation of X and Y stored in the flip-flop of the device of FIG. 2, and FIG. 12- (b) shows the variation of X 'and Y' stored in the device of FIG. It is a state of the mutation.

【0117】図11では出現可能性の高いベクトル(図
2のXに対比)を後の演算器1204によってX=−
X′を算出している。また、次に出現可能性の高いベク
トル(図2のYに対応)を後の1208と1212の演
算器によってY=−(X′+Y′)を演算している。し
たがってフリップフロップに格納するデータは出現可能
性の高いベクトルそのものではなくても構わなく、出現
可能性の高いベクトルを演算して得ることが可能な情報
でも良い。
In FIG. 11, a vector having a high probability of occurrence (compared to X in FIG. 2) is calculated by the following computing unit 1204 so that X = −
X 'is calculated. Further, the vector having the next highest appearance (corresponding to Y in FIG. 2) is calculated as Y = − (X ′ + Y ′) by the calculators 1208 and 1212 to be described later. Therefore, the data stored in the flip-flop does not have to be the vector that has a high possibility of occurrence, and may be information that can be obtained by calculating a vector that has a high possibility of occurrence.

【0118】[0118]

【発明の効果】以上説明したように本発明によれば、コ
ンピュータなどにより作成された多値画像を劣化なく高
い圧縮率で圧縮することができる。特に、1画素単位で
多値画像を差分符号化する際に、符号化対象画素の値が
「前画素と同じ値になりやすい」こと、及び、符号化対
象画素の値は「2つ前に出現した画素値へ1つ前に出現
した画素値から戻る傾向がある」ことに着目して、差分
値diffとの比較の対象として上記夫々に相当する
0、x[k]を適用したことにより、効率良い差分符号
化を行うことが可能となる。
As described above, according to the present invention, a multi-valued image created by a computer or the like can be compressed at a high compression ratio without deterioration. In particular, when differentially encoding a multi-valued image on a pixel-by-pixel basis, the value of the encoding target pixel is “it is likely to be the same value as the previous pixel”, and the value of the encoding target pixel is “two before. Paying attention to "there is a tendency to return from the pixel value appearing immediately before to the appearing pixel value", and applying 0 and x [k] corresponding to the above as targets of comparison with the difference value diff. Thus, efficient differential encoding can be performed.

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

【図1】本実施例の圧縮装置の全体システム例を示す図
である。
FIG. 1 is a diagram illustrating an example of an overall system of a compression apparatus according to an embodiment.

【図2】圧縮装置例を示す詳細図である。FIG. 2 is a detailed view showing an example of a compression device.

【図3】本実施例の伸長装置の全体システム例を示す図
である。
FIG. 3 is a diagram illustrating an example of an entire system of a decompression device according to the embodiment.

【図4】伸長装置例を示す詳細図である。FIG. 4 is a detailed view showing an example of a decompression device.

【図5】他の実施例(1)の圧縮装置例を示す詳細図で
ある。
FIG. 5 is a detailed view showing an example of a compression apparatus according to another embodiment (1).

【図6】図2の圧縮装置の動作を示すフローチャートで
ある。
FIG. 6 is a flowchart showing the operation of the compression device of FIG. 2;

【図7】図4の伸長装置の動作を示すフローチヤートで
ある。
FIG. 7 is a flowchart showing the operation of the decompression device of FIG.

【図8】他の実施例(3)の圧縮装置システム例を示す
図である。
FIG. 8 is a diagram illustrating an example of a compression device system according to another embodiment (3).

【図9】他の実施例(4)の圧縮装置システム例を示す
図である。
FIG. 9 is a diagram illustrating an example of a compression device system according to another embodiment (4).

【図10】他の実施例(5)の圧縮装置システム例を示
す図である。
FIG. 10 is a diagram illustrating an example of a compression device system according to another embodiment (5).

【図11】他の実施例(6)の圧縮装置例を示す詳細図
である。
FIG. 11 is a detailed view showing an example of a compression apparatus according to another embodiment (6).

【図12】他の実施例(7)の情報X′、Y′の変化を
示す図である。
FIG. 12 is a diagram showing changes in information X ′ and Y ′ in another embodiment (7).

【図13】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 13 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図14】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 14 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図15】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 15 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図16】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 16 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図17】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 17 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図18】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 18 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図19】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 19 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図20】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 20 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図21】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 21 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図22】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 22 is an explanatory diagram of an ADCT compression method which is a conventional technique.

【図23】従来の手法であるADCT圧縮法の説明図で
ある。
FIG. 23 is an explanatory diagram of an ADCT compression method which is a conventional method.

【図24】典型的なコンピュータ作成画像、ベクトル
X、Yの変化の様子、圧縮データを示す図である。
FIG. 24 is a diagram showing a typical computer-generated image, a state of change of vectors X and Y, and compressed data.

【図25】画素データ並び変え部で行われる並び変えの
例を示す図である。
FIG. 25 is a diagram illustrating an example of rearrangement performed by a pixel data rearrangement unit.

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

102 圧縮部 103 データパック部 102 Compression unit 103 Data pack unit

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 1画素単位で画素データd[i]を入力
する入力ステップと、 前記画素データd[i]と、該データの前画素データd
[i−1]との差分diffを出力する差分出力ステッ
プと、 前記差分diffが0であるか否かを判定する第1判定
ステップと、 前記差分diffがx[k]であるか否かを判定する第
2判定ステップと、 前記第1、第2判定ステップによる判定での一致/不一
致に基づき、前記d[i]を示す符号を出力する符号出
力ステップとを備え、 前記第1判定ステップにて前記差分diffが0以外の
時、x[k+1]=−diffの更新を行い、次の画素
データd[i+1]の符号化に適用することを特徴とす
る画像データ圧縮方法。
An input step of inputting pixel data d [i] in units of one pixel, the pixel data d [i], and pixel data d before the data
A difference output step of outputting a difference diff from [i-1]; a first determination step of determining whether the difference diff is 0; and determining whether the difference diff is x [k]. A second determining step of determining; and a code output step of outputting a code indicating the d [i] based on a match / mismatch in the determination by the first and second determining steps. An image data compression method, wherein when the difference diff is other than 0, x [k + 1] =-diff is updated and applied to the encoding of the next pixel data d [i + 1].
【請求項2】 1画素単位で画素データd[i]を入力
する入力ステップと、 前記画素データd[i]と、該データの前画素データd
[i−1]との差分diffを出力する差分出力ステッ
プと、 前記差分diffが0であるか否かを判定する第1判定
ステップと、 前記差分diffがx[k]であるか否かを判定する第
2判定ステップと、 前記差分diffがy[k]であるか否かを判定する第
3判定ステップと、 前記第1〜第3判定ステップによる判定での一致/不一
致に基づき、前記d[i]を示す符号を出力する符号出
力ステップとを備え、 前記第1判定ステップにて前記差分diffが0以外の
時、x[k+1]=−diff、y[k+1]=dif
f+A[k](A[k]は、前記差分diffがx
[k]と一致した時y[k]とし、それ以外の時x
[k]とする)の更新を行い、次の画素データd[i+
1]の符号化に適用することを特徴とする画像データ圧
縮方法。
2. An input step of inputting pixel data d [i] in units of one pixel, said pixel data d [i], and pixel data d before said data.
A difference output step of outputting a difference diff from [i-1]; a first determination step of determining whether the difference diff is 0; and determining whether the difference diff is x [k]. A second determination step of determining; a third determination step of determining whether the difference diff is y [k]; and a determination of the d based on a match / mismatch in the determination in the first to third determination steps A code output step of outputting a code indicating [i], wherein when the difference diff is not 0 in the first determination step, x [k + 1] = − diff, y [k + 1] = dif
f + A [k] (A [k] is the difference diff is x
Y [k] when matched with [k], x otherwise
[K]), and the next pixel data d [i +
An image data compression method, which is applied to the encoding of [1].
【請求項3】 1画素単位で画素データd[i]を入力
する入力手段と、 前記画素データd[i]と、該データの前画素データd
[i−1]との差分diffを出力する差分出力手段
と、 前記差分diffが0であるか否かを判定する第1判定
手段と、 前記差分diffがx[k]であるか否かを判定する第
2判定手段と、 前記第1〜第3判定手段による判定での一致/不一致に
基づき、前記d[i]を示す符号を出力する符号出力手
段とを備え、 前記第1判定手段にて前記差分diffが0以外の時、
x[k+1]=−diffの更新を行い、次の画素デー
タd[i+1]の符号化に適用することを特徴とする画
像データ圧縮装置。
3. An input means for inputting pixel data d [i] in units of one pixel, said pixel data d [i], and pixel data d preceding said data.
A difference output unit that outputs a difference diff from [i−1], a first determination unit that determines whether the difference diff is 0, and whether the difference diff is x [k]. A second determining means for determining; and a code output means for outputting a code indicating the d [i] based on a match / mismatch in the determination by the first to third determining means. When the difference diff is other than 0,
An image data compression apparatus for updating x [k + 1] =-diff and applying the update to the encoding of the next pixel data d [i + 1].
【請求項4】 1画素単位で画素データd[i]を入力
する入力手段と、 前記画素データd[i]と、該データの前画素データd
[i−1]との差分diffを出力する差分出力手段
と、 前記差分diffが0であるか否かを判定する第1判定
手段と、 前記差分diffがx[k]であるか否かを判定する第
2判定手段と、 前記差分diffがy[k]であるか否かを判定する第
3判定手段と、 前記第1〜第3判定手段による判定での一致/不一致に
基づき、前記d[i]を示す符号を出力する符号出力手
段とを備え、 前記第1判定手段にて前記差分diffが0以外の時、
x[k+1]=−diff、y[k+1]=diff+
A[k](A[k]は、前記差分diffがx[k]と
一致した時y[k]とし、それ以外の時x[k]とす
る)の更新を行い、次の画素データd[i+1]の符号
化に適用することを特徴とする画像データ圧縮装置。
4. An input means for inputting pixel data d [i] in units of one pixel, said pixel data d [i], and pixel data d preceding said data.
A difference output unit that outputs a difference diff from [i−1], a first determination unit that determines whether the difference diff is 0, and whether the difference diff is x [k]. A second determining means for determining, a third determining means for determining whether or not the difference diff is y [k], and a d based on a match / mismatch determined by the first to third determining means. Code output means for outputting a code indicating [i], and when the difference diff is other than 0 in the first determination means,
x [k + 1] = − diff, y [k + 1] = diff +
A [k] (A [k] is set to y [k] when the difference diff matches x [k] and x [k] otherwise), and the next pixel data d is updated. An image data compression apparatus, which is applied to encoding of [i + 1].
JP33206493A 1993-12-27 1993-12-27 Image data compression apparatus and method Expired - Fee Related JP3323615B2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP33206493A JP3323615B2 (en) 1993-12-27 1993-12-27 Image data compression apparatus and method
US08/362,916 US5903671A (en) 1993-12-27 1994-12-23 Data compression method and apparatus therefor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33206493A JP3323615B2 (en) 1993-12-27 1993-12-27 Image data compression apparatus and method

Publications (2)

Publication Number Publication Date
JPH07193816A JPH07193816A (en) 1995-07-28
JP3323615B2 true JP3323615B2 (en) 2002-09-09

Family

ID=18250748

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33206493A Expired - Fee Related JP3323615B2 (en) 1993-12-27 1993-12-27 Image data compression apparatus and method

Country Status (1)

Country Link
JP (1) JP3323615B2 (en)

Also Published As

Publication number Publication date
JPH07193816A (en) 1995-07-28

Similar Documents

Publication Publication Date Title
US5818970A (en) Image encoding apparatus
US6008847A (en) Temporal compression and decompression for video
US5724450A (en) Method and system for color image compression in conjunction with color transformation techniques
JPH10191074A (en) Color correction method for compressed image
WO2000002381A1 (en) Image processing circuit and method for modifying a pixel value
US6829385B2 (en) Apparatus and method for processing images, and a computer-readable medium
JPH1175183A (en) Image signal processing method and device and storage medium
JP3323615B2 (en) Image data compression apparatus and method
US5903671A (en) Data compression method and apparatus therefor
JPH07240845A (en) Image data compression and expansion
JPH0654208A (en) Image processing method/device
JP2619759B2 (en) Image data compression method
JP2809552B2 (en) Image encoding method and image decoding method
JP2810585B2 (en) Image encoding method and image decoding method
JP2698675B2 (en) Method for encoding and reproducing color image information
JP2619758B2 (en) Image data compression method
JP2698641B2 (en) Color image data encoding method and decoding method
JP2950134B2 (en) Color image information data and color image information data processing method
JP2984332B2 (en) Image processing device
JP2000106680A (en) Image compressing and expanding device
JP3083084B2 (en) Image processing device
JP3087790B2 (en) Image data compression / decompression method and apparatus
JP2002290744A (en) Image compression scheme
JPH08161507A (en) Processor and method for image processing
JPH0896141A (en) Image processor

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20020618

LAPS Cancellation because of no payment of annual fees