[go: up one dir, main page]

JPH0884260A - Two-dimensional image data compression method and decompression method - Google Patents

Two-dimensional image data compression method and decompression method

Info

Publication number
JPH0884260A
JPH0884260A JP6244741A JP24474194A JPH0884260A JP H0884260 A JPH0884260 A JP H0884260A JP 6244741 A JP6244741 A JP 6244741A JP 24474194 A JP24474194 A JP 24474194A JP H0884260 A JPH0884260 A JP H0884260A
Authority
JP
Japan
Prior art keywords
data
pixel
length
line
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.)
Pending
Application number
JP6244741A
Other languages
Japanese (ja)
Inventor
Yoshinori Narita
喜則 成田
Kazunori Matsuura
一教 松浦
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.)
Nippon Steel Corp
Original Assignee
Nippon Steel Corp
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 Nippon Steel Corp filed Critical Nippon Steel Corp
Priority to JP6244741A priority Critical patent/JPH0884260A/en
Priority to US08/526,663 priority patent/US5883975A/en
Publication of JPH0884260A publication Critical patent/JPH0884260A/en
Pending legal-status Critical Current

Links

Landscapes

  • Image Processing (AREA)
  • Compression Of Band Width Or Redundancy In Fax (AREA)

Abstract

(57)【要約】 【目的】 画像データのデータ圧縮率を高め且つ高速に
圧縮、伸長するデータ圧縮方式、伸長方式を提供する。 【構成】 直前ラインのデータを保持する辞書バッファ
6と、最大検出列長Nの範囲内で現ラインから圧縮対象
部分列を抽出するバッファ16と、辞書バッファ6から
圧縮対象部分列と同じデータ列を検出する比較器7と、
同じデータ列を検出した場合に、1ラインの画素数を
H、注目画素の現ライン上の位置をx、x=0のときは
T=0、1≦x≦H−NのときはT=1、H−N+1≦
x≦H−1のときはT=x−H+N+1とし、Tの各値
に応じたテーブルをテーブル群70の中から選択・参照
し、直前ライン上でのデータ列の位置と長さに応じたコ
ードを出力する符号生成器8を備える。
(57) [Summary] [Object] To provide a data compression method and an expansion method for increasing the data compression rate of image data and for high-speed compression and expansion. [Structure] A dictionary buffer 6 for holding the data of the immediately preceding line, a buffer 16 for extracting a compression target subsequence from the current line within a range of the maximum detection sequence length N, and a data sequence same as the compression target subsequence from the dictionary buffer 6 A comparator 7 for detecting
When the same data string is detected, the number of pixels in one line is H, the position of the target pixel on the current line is x, T = 0 when x = 0, and T = when 1 ≦ x ≦ H−N 1, H-N + 1 ≤
When x ≦ H−1, T = x−H + N + 1 is set, a table corresponding to each value of T is selected / referenced from the table group 70, and according to the position and length of the data string on the immediately preceding line. A code generator 8 for outputting a code is provided.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、2次元画像データにお
けるデータ圧縮方式及び伸長方式に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data compression system and a decompression system for two-dimensional image data.

【0002】[0002]

【従来の技術】従来の画像圧縮方式としては、非可逆性
のデータ圧縮方式と可逆性のデータ圧縮方式がある。前
者の例として挙げることのできる離散コサイン変換(DC
T )を用いたJPEGやMPEGなどの非可逆性のデータ圧縮方
式では、カラーコード(カラーパレットの呼び出し符
号)を使用した画像データを圧縮する場合に情報落ちが
生じるため使用することができない。後者の可逆性のデ
ータ圧縮方式の代表的な方式が、情報のランレングス
(run length)を用いてデータ圧縮を行う方式(ランレ
ングス圧縮)、頻繁に現れる情報を辞書に登録しデータ
圧縮を行う方式(辞書圧縮)である。後者の方式は、IE
EE Transactions on Information Theory IT-24 、pp.5
30〜536 に掲載されたZiv 及びLempelによる論文"Compr
ession of Individual Sequenes via Variable Rate Co
ding" に開示されている。
2. Description of the Related Art Conventional image compression methods include an irreversible data compression method and a reversible data compression method. The discrete cosine transform (DC
The lossy data compression method such as JPEG or MPEG using T) cannot be used because information loss occurs when compressing image data using a color code (call code of color palette). A typical method of the latter reversible data compression method is a method of performing data compression using run length of information (run length compression), and performing frequent data registration in a dictionary to perform data compression. It is a method (dictionary compression). The latter method is IE
EE Transactions on Information Theory IT-24, pp.5
Ziv and Lempel's article "Compr.
ession of Individual Sequenes via Variable Rate Co
ding ".

【0003】[0003]

【発明が解決しようとする課題】上記圧縮方式には、そ
れぞれ下記のような問題点がある。ランレングス圧縮
は、連続した同じ情報が多く含まれる画像データには効
果を発揮するが、そうでない画像データに対しては効果
が無く、圧縮の効果が全く現れない場合もある。
Each of the above compression methods has the following problems. The run-length compression is effective for image data that contains a large amount of the same continuous information, but is ineffective for image data that is not so, and the compression effect may not appear at all.

【0004】辞書圧縮は、辞書に対するヒット率が高い
画像データには効果を発揮するが、そうでない画像デー
タに対しては効果が無い。また、ヒット率は辞書を記憶
するための記憶容量に依存するため、高いヒット率を得
たいならば容量の大きな格納場所が必要となる。更に、
容量の大きな辞書を持つことで辞書参照回数が増大し、
圧縮速度が低下する。そこで、本発明は、上記圧縮方式
の問題点を補い、画像データのデータ圧縮率を高め情報
量を低減し且つ高速に圧縮することができるデータ圧縮
方式及びその圧縮されたデータを高速に伸長することが
できる伸長方式を提供することを目的とする。
The dictionary compression is effective for image data having a high hit ratio to the dictionary, but is not effective for image data which is not so. Further, since the hit rate depends on the storage capacity for storing the dictionary, if a high hit rate is desired, a large-capacity storage location is required. Furthermore,
Having a large-capacity dictionary increases the number of dictionary lookups,
The compression speed decreases. Therefore, the present invention compensates for the problems of the above-described compression method, increases the data compression rate of image data, reduces the amount of information, and enables high-speed compression, and expands the compressed data at high speed. It is an object of the present invention to provide a decompression method that can be performed.

【0005】[0005]

【課題を解決するための手段】上記目的を達成するため
に本発明のデータ圧縮方式では、順次スキャンされる2
次元画像データに対して直前ラインのデータを参照し、
現ラインに直前ラインと少なくとも1画素分以上同じ部
分データ列を検出した場合に圧縮処理を行う2次元画像
データの圧縮方式において、前記2次元画像データの1
ラインの画素数をH、前記部分データ列の最大検出列長
をN(1≦N≦H)、注目画素の現ライン上での先頭画
素からの位置をx(0≦x≦H−1)とすると共に、x
=0のときはT=0、1≦x≦H−NのときはT=1、
H−N+1≦x≦H−1のときはT=x−H+N+1、
とし、前記Tの各値毎に、直前ライン上での前記部分デ
ータ列の先頭画素と前記注目画素との相対位置と、前記
部分データ列の長さとに応じて異なるコードが割り当て
られたテーブルを用意し、現ラインに直前ラインと少な
くとも1画素分以上同じ部分データ列を検出した場合
に、前記注目画素の現ライン上での先頭画素からの位置
xに基づいて前記Tの値を求め、このTの値に基づき対
応する前記テーブルを選択し、直前ライン上での部分デ
ータ列の先頭位置と長さとに応じたコードを出力する。
In order to achieve the above object, in the data compression method of the present invention, two scans are sequentially performed.
Refer to the data of the previous line for 3D image data,
In the compression method of the two-dimensional image data, the compression process is performed when the same partial data string as at least one pixel is detected in the current line for at least one pixel.
The number of pixels in a line is H, the maximum detection column length of the partial data string is N (1 ≦ N ≦ H), and the position of the pixel of interest from the first pixel on the current line is x (0 ≦ x ≦ H−1). And x
= 0, T = 0, 1 ≦ x ≦ H−N, T = 1,
When H−N + 1 ≦ x ≦ H−1, T = x−H + N + 1,
And a table in which a different code is assigned to each value of T according to the relative position of the leading pixel of the partial data string and the target pixel on the immediately preceding line and the length of the partial data string. When a partial data string which is prepared and is the same as the immediately preceding line for at least one pixel is detected, the value of T is obtained based on the position x of the pixel of interest from the first pixel on the current line, and The corresponding table is selected based on the value of T, and a code corresponding to the head position and length of the partial data string on the immediately preceding line is output.

【0006】また本発明のデータ伸長方式では、順次ス
キャンされる2次元画像データに対して直前ラインのデ
ータを参照し、現ラインに直前ラインと少なくとも1画
素分以上同じ部分データ列を検出した場合に、重複する
部分の圧縮データとして、前記2次元画像データの1ラ
インの画素数をH、前記部分データ列の最大検出列長を
N(1≦N≦H)、注目画素の現ライン上での先頭画素
からの位置をx(0≦x≦H−1)とすると共に、x=
0のときはT=0、1≦x≦H−NのときはT=1、H
−N+1≦x≦H−1のときはT=x−H+N+1と
し、前記Tの各値毎に、直前ライン上での前記部分デー
タ列の先頭画素と前記注目画素との相対位置と、長さと
に応じて異なるコードが割り当てられて順次入力される
2次元画像圧縮データの伸長方式であって、少なくとも
直前ラインの伸長されたデータをバッファに保持し、伸
長しようとする前記注目画素の現ライン上での位置xに
基づいて前記Tの値を求め、このTの値に基づき、前記
Tの各値毎に用意された、前記相対位置と前記長さとに
応じて異なるコードが割り当てられたテーブルから対応
するテーブルを選択し、入力された圧縮データから前記
コードを抽出し、このコードに基づいて選択されたテー
ブルを参照し、入力された現ラインのデータに対して、
前記バッファから前記部分データ列の先頭位置に対応す
るビットに続く前記部分データ列の長さ分のデータを抽
出し、伸長データとして出力する。
In the data decompression method of the present invention, when the data of the immediately preceding line is referred to for the sequentially scanned two-dimensional image data, and the same partial data string as at least one pixel is detected in the current line for at least one pixel. As the compressed data of the overlapping portion, the number of pixels in one line of the two-dimensional image data is H, the maximum detection column length of the partial data sequence is N (1 ≦ N ≦ H), The position from the first pixel of x is set to x (0 ≦ x ≦ H−1), and x =
0 = 0, T = 0, 1 ≦ x ≦ H−N, T = 1, H
When −N + 1 ≦ x ≦ H−1, T = x−H + N + 1, and for each value of T, the relative position between the leading pixel of the partial data string and the target pixel on the immediately preceding line, and the length. Is a decompression method for two-dimensional image compression data that is sequentially input with different codes assigned according to the above. At least the decompressed data of the immediately preceding line is held in a buffer, and on the current line of the pixel of interest to be decompressed. The value of T is obtained based on the position x at, and based on the value of T, a table prepared for each value of T and assigned different codes according to the relative position and the length is selected. Select the corresponding table, extract the code from the input compressed data, refer to the table selected based on this code, for the data of the input current line,
Data of the length of the partial data string following the bit corresponding to the head position of the partial data string is extracted from the buffer and output as decompressed data.

【0007】また、上記データ圧縮方式を実現するデー
タ圧縮装置は、順次入力される2次元画像データに対し
て1ライン前のデータを保持する参照メモリ手段と、入
力された現ラインの信号から、所定の長さの範囲内で連
続する複数のデータ列を抽出し圧縮対象部分データ列と
して記憶するバッファ手段と、前記参照メモリ手段に記
憶されたデータに、前記圧縮対象部分データ列の注目画
素に続く部分データ列と同じ部分データ列が存在するか
否かを検出する走査比較手段と、前記走査比較手段が同
じ部分データ列を検出した場合に、前記参照メモリ手段
に記憶された1ライン前のデータ上での前記部分データ
列の先頭画素と前記注目画素との相対位置と、前記部分
データ列の長さとを求め、前記2次元画像データの1ラ
インの画素数をH、前記部分データ列の最大検出列長を
N(1≦N≦H)、注目画素の現ライン上での先頭画素
からの位置をx(0≦x≦H−1)とすると共に、x=
0のときはT=0、1≦x≦H−NのときはT=1、H
−N+1≦x≦H−1のときはT=x−H+N+1、と
し、前記Tの値毎に用意された、前記相対位置と前記部
分データ列の長さとに応じて異なるコードが割り当てら
れたテーブルを参照し、対応するコードを現ラインのそ
の部分データ列の圧縮データとして出力する符号生成手
段と、を備える。
Further, a data compression apparatus for realizing the above-mentioned data compression method is provided with a reference memory means for holding data of one line before for sequentially input two-dimensional image data and an input current line signal. Buffer means for extracting a plurality of continuous data strings within a predetermined length range and storing them as compression target partial data strings, and data stored in the reference memory means for the target pixel of the compression target partial data strings. Scan comparing means for detecting whether or not the same partial data string as the subsequent partial data string exists, and when the scan comparing means detects the same partial data string, the previous one line stored in the reference memory means is detected. The relative position between the first pixel of the partial data string and the target pixel on the data and the length of the partial data string are obtained, and the number of pixels of one line of the two-dimensional image data is set to H. The maximum detection sequence length of the partial data string N (1 ≦ N ≦ H), the position of the head pixel on the current line of the pixel of interest with the x (0 ≦ x ≦ H-1), x =
0 = 0, T = 0, 1 ≦ x ≦ H−N, T = 1, H
When -N + 1 ≤ x ≤ H-1, T = x-H + N + 1, and a table prepared for each value of T, to which different codes are assigned according to the relative position and the length of the partial data string. Code generation means for outputting the corresponding code as compressed data of the partial data string of the current line.

【0008】さらに、上記データ伸長方式を実現するデ
ータ伸長装置は、順次入力される2次元画像データに対
して直前データを参照し、現ラインに直前ラインと少な
くとも1画素分以上同じ部分データ列を検出した場合
に、重複する部分の圧縮データとして、前記2次元画像
データの1ラインの画素数をH、前記部分データ列の最
大検出列長をN(1≦N≦H)、注目画素の現ライン上
での先頭画素からの位置をx(0≦x≦H−1)とする
と共に、x=0のときはT=0、1≦x≦H−Nのとき
はT=1、H−N+1≦x≦H−1のときはT=x−H
+N+1とし、前記Tの各値毎に、直前ライン上での前
記部分データ列の先頭画素と前記注目画素との相対位置
と、長さとに応じて異なるコードが順次入力される2次
元画像圧縮データの伸長装置であって、1ライン前の伸
長されたデータを保持するバッファメモリ手段と、前記
Tの各値毎に用意された、前記コードに応じて直前ライ
ン上での前記部分データ列の先頭画素と前記注目画素と
の相対位置と、前記部分データ列の長さとが割り当てら
れた逆変換テーブルと、伸長しようとする圧縮データの
注目画素の現ライン上における先頭画素からの位置xに
基づいて前記Tの値を求め、このTの値に対応する前記
逆変換テーブルを選択し、入力されたデータから前記コ
ードを抽出し、前記コードに基づいて選択された前記逆
変換テーブルを参照し、前記逆変換テーブルから直前ラ
イン上での前記部分データ列の先頭位置と長さとのデー
タを取り出し、前記バッファメモリ手段から前記部分デ
ータ列の先頭位置に対応するビットに続く前記部分デー
タ列の長さ分のデータを抽出し、伸長データとして出力
する復号手段と、を備える。
Further, a data decompression device for realizing the above-mentioned data decompression method refers to immediately preceding data with respect to sequentially input two-dimensional image data, and presents a partial data string which is the same as the immediately preceding line for at least one pixel or more to the current line. When detected, the number of pixels in one line of the two-dimensional image data is H, the maximum detection column length of the partial data sequence is N (1 ≦ N ≦ H), and the current pixel of interest is present as the compressed data of the overlapping portion. The position on the line from the first pixel is set to x (0 ≦ x ≦ H−1), and when x = 0, T = 0, and when 1 ≦ x ≦ H−N, T = 1, H−. When N + 1 ≦ x ≦ H−1, T = x−H
+ N + 1, and for each value of T, two-dimensional image compression data in which different codes are sequentially input according to the relative position between the leading pixel of the partial data string and the target pixel on the immediately preceding line and the length. Of the decompressing device, buffer memory means for holding decompressed data of one line before, and the head of the partial data string on the immediately preceding line prepared for each value of T according to the code. Based on the inverse conversion table to which the relative position of the pixel and the pixel of interest and the length of the partial data string are assigned, and the position x of the pixel of interest of the compressed data to be expanded from the first pixel on the current line Obtain the value of T, select the inverse conversion table corresponding to the value of T, extract the code from the input data, and refer to the inverse conversion table selected based on the code. Then, the data of the starting position and the length of the partial data string on the immediately preceding line is taken out from the inverse conversion table, and the partial data string following the bit corresponding to the starting position of the partial data string is extracted from the buffer memory means. Decoding means for extracting data for the length and outputting it as decompressed data.

【0009】[0009]

【作用】本発明の理解を容易にするため、本発明の原理
を図面を用いて説明する。本発明では画像データのある
画素は近傍の画素群に類似するという性質を利用し、順
次スキャンされる2次元画像データ(図1に示す)にお
いて、直前ラインのデータを参照データ(これを記憶す
るバッファを「辞書」1と言う事にする。)として保持
する。そして、直前ラインの辞書1を参照し、辞書1に
圧縮対象とするラインデータ上の部分列2と少なくとも
1画素分以上同じ部分列があるか否かを検出する。
In order to facilitate understanding of the present invention, the principle of the present invention will be described with reference to the drawings. In the present invention, the property that a pixel having image data is similar to a pixel group in the vicinity is used, and in the two-dimensional image data (shown in FIG. 1) that is sequentially scanned, the data of the immediately preceding line is stored as reference data (which is stored). The buffer is called "dictionary" 1.). Then, the dictionary 1 of the immediately preceding line is referred to, and it is detected whether or not the dictionary 1 has the same partial column as the partial column 2 on the line data to be compressed for at least one pixel.

【0010】辞書1に圧縮対象部分列2と一致する部分
列を検出した場合、予め設定された最大検出列長N(こ
こではN=8とする)の範囲内でできるだけ長く圧縮対
象部分列2と一致する部分列3を検出する。次に、2次
元画像データの1ラインの画素数をH、注目画素(圧縮
対象部分列の先頭画素)の現ライン上での位置をx(0
≦x≦H−1)とすると共に、x=0のときはT=0、
1≦x≦H−NのときはT=1、H−N+1≦x≦H−
1のときはT=x−H+N+1、とし、Tの値毎に用意
された、直前ライン上での部分列の先頭画素と注目画素
との相対位置と、直前ライン上での部分列の長さに応じ
て異なるコードが割り当てられたテーブルから、注目画
素5の現ライン上での先頭画素からの位置x(ここでは
x=0である)に基づいて求めたTの値(ここではT=
0である)に対応するテーブルを選択して参照する。そ
して、辞書1上の部分列3の先頭位置4と、部分列3の
長さ(ここでは5ドット)に応じたコードを出力するこ
とによりデータ圧縮を行う。この際、辞書1に対する参
照範囲は、圧縮対象部分列2と辞書1上の部分列との類
似度が高い範囲内に限定するのが望ましい。また、最大
検出列長Nは、圧縮・伸長速度を向上させるため、2次
元画像データにおいて隣接するライン上に存在する同じ
部分列が比較的長い場合は大きめに、また、短いときは
小さめに設定するのが望ましい。但し、Nを極端に大き
めに設定すると、テーブルの数が増加し、却って圧縮・
伸長速度が低下する。一方、Nを極端に小さめに設定す
ると、テーブルの数は減少するが、参照する部分列の長
さが短いので、圧縮率が低下する。尚、図1では1ライ
ンの画素数Hが16ドットの2次元画像データを示した
が、 最大検出列長N<1ラインの画素数H であれば、Tの採りうる値の範囲は1ラインの画素数H
の値にかかわらず一定である。すなわち、Tの採りうる
値は0≦T≦x−H+N+1であるが、注目画素の現ラ
イン上での位置xの採りうる最大値はH−1であるの
で、結局、0≦T≦Nとなる。したがって、2次元画像
データの1ラインの画素数Hを増加したときでも、テー
ブルの数は常にN+1(ここではN=8としたので、テ
ーブルの数は常に9)となる。
When a subsequence matching the compression target subsequence 2 is detected in the dictionary 1, the compression target subsequence 2 is as long as possible within a preset maximum detection sequence length N (here, N = 8). The subsequence 3 that matches with is detected. Next, the number of pixels in one line of the two-dimensional image data is H, and the position of the pixel of interest (the leading pixel of the compression target partial sequence) on the current line is x (0
≦ x ≦ H−1), and when x = 0, T = 0,
When 1 ≦ x ≦ H−N, T = 1, H−N + 1 ≦ x ≦ H−
When 1 is set, T = x−H + N + 1, and the relative position between the head pixel and the target pixel of the partial row on the immediately preceding line, which is prepared for each value of T, and the length of the partial row on the immediately preceding line. From the table to which different codes are assigned in accordance with the above, the value of T obtained based on the position x (here, x = 0) of the target pixel 5 from the first pixel on the current line (here, T =
The table corresponding to (0) is selected and referred to. Then, data compression is performed by outputting a code corresponding to the head position 4 of the partial string 3 on the dictionary 1 and the length of the partial string 3 (here, 5 dots). At this time, it is desirable to limit the reference range for the dictionary 1 to a range in which the degree of similarity between the compression target subsequence 2 and the subsequence on the dictionary 1 is high. Further, the maximum detection row length N is set to a large value when the same partial row existing on an adjacent line in the two-dimensional image data is relatively long and a small value when it is short in order to improve the compression / decompression speed. It is desirable to do. However, if N is set to an extremely large value, the number of tables will increase, and rather compression
The extension speed decreases. On the other hand, if N is set to an extremely small value, the number of tables decreases, but the length of the subsequence to be referred to is short, so the compression rate decreases. Although FIG. 1 shows two-dimensional image data in which the number of pixels H in one line is 16 dots, if the maximum detection column length N <the number of pixels H in one line, the range of possible values of T is one line. Number of pixels H
It is constant regardless of the value of. That is, the possible values of T are 0 ≦ T ≦ x−H + N + 1, but the maximum possible value of the position x on the current line of the pixel of interest is H−1, so that 0 ≦ T ≦ N after all. Become. Therefore, even when the number of pixels H of one line of the two-dimensional image data is increased, the number of tables is always N + 1 (here, N = 8, so the number of tables is always 9).

【0011】辞書1に圧縮対象部分列2と一致する部分
列を検出できなかった場合、圧縮対象部分列2にランレ
ングス圧縮などを適用する。尚、ランレングス圧縮を適
用する場合は、前述したTの各値毎に用意された、連続
する同一データの長さに応じて異なるコードが割り当て
られたランレングステーブルから、注目画素の現ライン
上での先頭画素からの位置xに基づいて求めたTの値に
対応するランレングステーブルを選択して参照し、対応
するコードを出力することによりデータ圧縮を行うのが
望ましい。この際、ランレングステーブルに記憶された
コードは、前述のテーブルに記憶されたコードと異なる
ものでなければならない。また、テーブル及びランレン
グステーブルに記憶されたコードは、固定長符号とはせ
ず生起確立の高いデータに短い符号を割当て圧縮率を上
げるために可変長符号とする事が望ましい。
If the dictionary 1 cannot detect a subsequence that matches the compression subsequence 2, run length compression or the like is applied to the compression subsequence 2. When the run length compression is applied, the run length table, which is prepared for each value of T described above and to which different codes are assigned according to the length of the same continuous data, is used on the current line of the pixel of interest. It is desirable to perform the data compression by selecting and referring to the run length table corresponding to the value of T obtained based on the position x from the first pixel in (3) and outputting the corresponding code. At this time, the code stored in the run length table must be different from the code stored in the above table. Further, the codes stored in the table and the run length table are not fixed length codes, but are preferably variable length codes in order to allocate a short code to data with a high probability of occurrence and to increase the compression rate.

【0012】本発明は、上記のように、辞書の容量は直
前ラインのみを格納すれば良いので非常に小さい。ま
た、類似度の高い範囲内で辞書を参照すると共に、最大
検出列長Nの範囲内でできるだけ長い部分列を参照する
ので、圧縮率が高く且つ圧縮及び伸長を高速に処理する
ことが可能である。さらに、用意するテーブルは2次元
画像データの1ラインの画素数にかかわらず常に最大検
出列長N+1個なので、2次元画像データの1ラインの
画素数を増加した際、テーブルの容量の増大に伴う処理
速度の低下を防止できる。また、画像データの1ライン
目や辞書参照が不可能な部分列にランレングス圧縮など
を適用することで、更に、高い圧縮率が得られる。
According to the present invention, as described above, the capacity of the dictionary is very small because it is sufficient to store only the immediately preceding line. Further, since the dictionary is referred to within the range of high similarity and the substring as long as possible within the range of the maximum detected column length N is used, the compression rate is high and the compression and decompression can be processed at high speed. is there. Further, since the prepared table is always the maximum detection column length N + 1 regardless of the number of pixels in one line of the two-dimensional image data, when the number of pixels in one line of the two-dimensional image data is increased, the capacity of the table increases. It is possible to prevent a decrease in processing speed. Further, by applying run length compression or the like to the first line of the image data or the partial sequence that cannot be referred to the dictionary, a higher compression rate can be obtained.

【0013】[0013]

【実施例】以下に、本発明の実施例を図2乃至図14に
したがって詳述する。図2は本発明のデータ圧縮回路の
構成例である。図3は本発明のデータ圧縮アルゴリズム
のフローチャートである。図2において、5はラインバ
ッファ、6は1ライン前のデータを保持する辞書バッフ
ァ、7は比較器、8は符号生成器、9は加算器、10は
ポインタ、11は相対位置カウンタ、12はポインタバ
ッファ、13は長さカウンタ、14は相対位置・長さバ
ッファ、15はセレクタ、16は部分列バッファ、70
は図6乃至図14に示すテーブルが用意されたテーブル
群、17はラインバッファへの入力信号線、18は辞書
バッファへの入力信号線、19は符号出力線を示す。図
6乃至図14に示すテーブルは、注目画素(圧縮対象部
分列の先頭画素をこう定義する)の現ライン上での先頭
画素からの位置に基づいて決定されるT(Tの値につい
ては後述する)の各値毎に用意されている。各テーブル
には、ラインバッファへの入力信号線17を通して順次
入力される2次元画像データにおいて、直前ライン上で
の圧縮対象部分列と同じ部分データ列の先頭画素と注目
画素との相対位置と、圧縮対象部分列の長さとに応じて
異なるコードが割り当てられ、記憶されている。
Embodiments of the present invention will be described below in detail with reference to FIGS. FIG. 2 is a configuration example of the data compression circuit of the present invention. FIG. 3 is a flow chart of the data compression algorithm of the present invention. In FIG. 2, 5 is a line buffer, 6 is a dictionary buffer for holding data of one line before, 7 is a comparator, 8 is a code generator, 9 is an adder, 10 is a pointer, 11 is a relative position counter, and 12 is Pointer buffer, 13 length counter, 14 relative position / length buffer, 15 selector, 16 partial column buffer, 70
Is a table group in which the tables shown in FIGS. 6 to 14 are prepared, 17 is an input signal line to the line buffer, 18 is an input signal line to the dictionary buffer, and 19 is a code output line. In the tables shown in FIGS. 6 to 14, T is determined based on the position of the pixel of interest (the start pixel of the compression target partial sequence is defined) on the current line from the start pixel (the value of T will be described later. Yes) is prepared for each value. In each table, in the two-dimensional image data sequentially input through the input signal line 17 to the line buffer, the relative position between the head pixel and the target pixel of the same partial data string as the compression target partial string on the immediately preceding line, Different codes are assigned and stored according to the length of the compression target subsequence.

【0014】次に、図3のフローに基づいて上記のよう
に構成されたデータ圧縮回路の動作の概要を示す。先
ず、処理20で符号生成器8に2次元画像データの1ラ
インの画素数Hを入力する。次に、処理21でポインタ
10を初期化し、辞書バッファ入力信号線18を通して
ラインバッファ5から押し出されるデータを辞書バッフ
ァ6に格納した後、順次入力される2次元画像データを
ラインバッファ入力信号線17を通してラインバッファ
5へ格納する(処理22)。
Next, an outline of the operation of the data compression circuit configured as described above will be described based on the flow of FIG. First, in process 20, the number of pixels H of one line of two-dimensional image data is input to the code generator 8. Next, in process 21, the pointer 10 is initialized, the data pushed out from the line buffer 5 through the dictionary buffer input signal line 18 is stored in the dictionary buffer 6, and then the sequentially input two-dimensional image data is input into the line buffer input signal line 17. Through the line buffer 5 (process 22).

【0015】次に、予め設定された最大検出列長N(1
≦N≦H)の範囲内で検索対象部分列(ラインバッファ
5に格納された現ラインのデータから選択された連続す
る画素のデータをこう定義する)にできるだけ長く一致
する辞書上の最長部分列の検索を行う(処理23)。
尚、最大検出列長Nは、圧縮・伸長速度を向上させるた
め、ラインバッファ入力信号線17を通して順次入力さ
れる2次元画像データにおいて、隣接するライン上に存
在する同じ部分列が比較的長い場合は大きめに、また、
短いときは小さめに設定するのが望ましい。但し、Nを
極端に大きめに設定すると、テーブルの数が増加し、却
って圧縮・伸長速度が低下する。一方、Nを極端に小さ
めに設定すると、テーブルの数は減少するが、参照する
部分列の長さが短くなるので、圧縮率が低下する。本実
施例では、N=8とした。この最長部分列の検索は図3
には処理23として1つのフローで示して有るが、以下
の手順で行われる。最長部分列の検索の概念を16×8
の画像データを示す図4を例として説明する。本実施例
では、検索対象部分列に対して1ライン前のラインにそ
の検索対象部分列と同じ部分列が存在するか否かを、検
索対象部分列の先頭画素位置から−1戻った位置(相対
位置−1と定義する)から+1進んだ位置(相対位置+
1と定義する)において、検索対象部分列の先頭画素と
同じ画素が存在するか否かを検索する事によって判定し
ている。そして、1ライン前に左右1画素分ずれた範囲
内に同じ画素列が存在する場合に処理23の圧縮が行わ
れる。
Next, a preset maximum detection column length N (1
The longest substring in the dictionary that matches the search target subsequence (defining the data of consecutive pixels selected from the data of the current line stored in the line buffer 5 in this way) within the range of ≦ N ≦ H) Is searched (process 23).
It should be noted that the maximum detection row length N is used when the same partial row existing on an adjacent line is relatively long in the two-dimensional image data sequentially input through the line buffer input signal line 17 in order to improve the compression / expansion speed. Is larger,
When it is short, it is desirable to set it small. However, if N is set to an extremely large value, the number of tables increases, and the compression / decompression speed decreases on the contrary. On the other hand, if N is set to an extremely small value, the number of tables decreases, but the length of the subsequence to be referred to becomes short, so the compression rate decreases. In this embodiment, N = 8. This longest subsequence search is shown in Figure 3.
Although a single flow is shown as process 23 in FIG. The concept of searching the longest subsequence is 16 × 8
An example will be described with reference to FIG. In the present embodiment, it is determined whether or not the same subsequence as the search target subsequence exists in the line one line before the search target subsequence by -1 from the head pixel position of the search target subsequence ( Position +1 advanced from relative position -1) (relative position +
(Defined as 1), it is determined by searching whether or not the same pixel as the leading pixel of the search target partial sequence exists. Then, when the same pixel row exists within the range shifted by one pixel on the left and right one line before, the compression of the process 23 is performed.

【0016】図4(a)で言えば、(1)相対位置−1
の例としては、3行1列目の「5」に続く部分列「55
4」がある。この部分列「554」は2行の0列目の
「5」に続く部分列「554」と同じデータ列であるの
で左に1画素ずれた位置に同一部分列が存在すると判定
される。(2)相対位置0の例としては、1行4列目の
「3」に続く部分列「34」がある。この部分列「3
4」は0行の4列目の「3」に続く部分列「34」と同
じデータ列であるので0画素ずれた位置に同一部分列が
存在すると判定される。(3)相対位置+1の例として
は、2行0列目の「5」に続く部分列「55434」が
ある。この部分列「55434」は1行1列目の「5」
に続く部分列「55434」と同じデータ列であるので
右に1画素ずれた位置に同一部分列が存在すると判定さ
れる。
In terms of FIG. 4A, (1) relative position -1
For example, the partial column “55” following “5” in the third row and first column
There is 4 ". Since this partial string "554" is the same data string as the partial string "554" following "0" in the 0th column of the second row, it is determined that the same partial string exists at a position shifted by one pixel to the left. (2) As an example of the relative position 0, there is a partial column "34" following "3" in the first row and fourth column. This subsequence “3
Since “4” is the same data string as the partial string “34” that follows “3” in the fourth column of the 0th row, it is determined that the same partial string exists at a position shifted by 0 pixel. (3) As an example of the relative position + 1, there is a partial column "55434" following "5" in the second row and the 0th column. This partial column “55434” is the first row and first column “5”
Since it is the same data string as the partial string "55434" that follows, it is determined that the same partial string exists at the position shifted by one pixel to the right.

【0017】処理23では先ず、ポインタ10のデータ
をポインタバッファ12に格納し、相対位置カウンタ1
1を初期化する。次に、ポインタ10の指すラインバッ
ファ5から1画素分のデータが部分列バッファ16に取
り込まれる。ラインバッファ5から部分列バッファ16
に取り込まれた現ラインの1画素のデータについて辞書
バッファに記憶された1ライン前の相対位置−1の画
素、相対位置0の画素、相対位置+1の画素について一
致する画素が有るか無いかを検索し、無い場合は、相対
位置・長さバッファ14にそれぞれの相対位置毎に長さ
「0」を書き込んで処理24に進む。図4(a)では1
行3列の「4」は、0行2列、0行3列は「2」であ
り、0行4列は「3」であるので、相対位置・長さバッ
ファ14にポイント(1、3)の長さデータとして相対
位置−1、0、+1ともに「0」が書き込まれる。一致
する画素が存在する場合は、ポインタ10と長さカウン
タ15をインクリメントし、隣の画素のデータを部分列
バッファ16に取り込む。このときポインタバッファ1
2には今回の検索で検索中の検索対象部分列の先頭番地
が残されている。
In the process 23, first, the data of the pointer 10 is stored in the pointer buffer 12, and the relative position counter 1
Initialize 1. Next, the data for one pixel is fetched from the line buffer 5 pointed by the pointer 10 into the partial column buffer 16. Line buffer 5 to partial column buffer 16
Whether or not there is a matching pixel for the pixel at the relative position −1, the pixel at the relative position 0, and the pixel at the relative position +1 stored in the dictionary buffer for the pixel data of the current line captured in If no search is made, a length “0” is written in the relative position / length buffer 14 for each relative position, and the process proceeds to step 24. In FIG. 4A, 1
Since “4” in row 3 column is 0 row 2 column, 0 row 3 column is “2”, and 0 row 4 column is “3”, the relative position / length buffer 14 has a point (1, 3). ), "0" is written as the length data for all the relative positions -1, 0, and +1. If there is a matching pixel, the pointer 10 and the length counter 15 are incremented, and the data of the adjacent pixel is fetched into the partial column buffer 16. At this time, pointer buffer 1
In 2, there is left the start address of the search target subsequence being searched in this search.

【0018】検索対象部分列の先頭画素が相対位置−1
に一致を発見した場合は、隣の画素については1ライン
前のデータの相対位置−1の画素のデータと部分列バッ
ファ16に取り込まれた画素との比較が行われ、相対位
置0に一致を発見した場合は、隣の画素については1ラ
イン前のデータの相対位置0の画素のデータと部分列バ
ッファ16に取り込まれた画素との比較が行われ、相対
位置+1に一致を発見した場合は、隣の画素については
1ライン前のデータの相対位置+1の画素のデータと部
分列バッファ16に取り込まれた画素との比較が行われ
る。上記それぞれの比較結果が一致を示す場合には、更
に隣の画素ポインタ10をインクリメントし、隣の画素
のデータを部分列バッファ16に取り込み、長さカウン
タ15をインクリメントし、上記それぞれの比較結果が
一致しなくなるか、または、長さカウンタ15のカウン
ト値が最大検出列長N(本実施例ではN=8)になるま
で繰り返す。これにより、比較結果が一致しなくなった
場合は、一致しなくなった時点で長さカウンタ15に計
数されている値が1ライン前のデータに同じデータ列を
持つ部分データ列の長さLとして計測され、また、長さ
カウンタ15のカウント値が最大検出列長Nになった場
合は、最大検出列長Nの値が1ライン前のデータに同じ
データ列を持つ部分データ列の長さLとして計測され
る。この長さ情報は相対位置−1、相対位置0、相対位
置+1のそれぞれについて計数される。即ち、相対位置
−1について上記のようにして長さLを計数した後、そ
の長さLを相対位置−1についての長さ情報として相対
位置・長さバッファ14の相対位置−1の欄に記憶す
る。次に、相対位置0についての検索を行う為、ポイン
タバッファ12に一時保存しておいた検索対象部分列の
先頭番地を画素ポインタ10に戻し、相対位置カウンタ
11をインクリメントし、検索対象部分列の先頭番地の
右隣のデータについて同様に相対位置0のデータが一致
しなくなるか、または、長さカウンタ15のカウント値
が最大検出列長Nになるまでポインタ10をインクリメ
ントしながら比較を行い、長さ情報Lを求める。続いて
相対位置+1について同様の検索を行う。
The first pixel of the search target subsequence has a relative position of -1.
If a match is found with respect to the next pixel, the data of the pixel at the relative position -1 of the data one line before is compared with the pixel fetched into the partial column buffer 16, and the match with the relative position 0 is found. If found, the data of the pixel at the relative position 0 of the data one line before is compared with the pixel fetched in the sub-sequence buffer 16 for the adjacent pixel, and if a match is found at the relative position +1 For the adjacent pixel, the data of the pixel at the relative position +1 of the data one line before is compared with the pixel fetched in the partial column buffer 16. If the respective comparison results show a match, the adjacent pixel pointer 10 is further incremented, the data of the adjacent pixel is fetched into the partial column buffer 16, the length counter 15 is incremented, and the respective comparison results are The process is repeated until they do not match or the count value of the length counter 15 reaches the maximum detection column length N (N = 8 in this embodiment). As a result, when the comparison results do not match, the value counted by the length counter 15 at the time when they do not match is measured as the length L of the partial data string having the same data string in the data one line before. Further, when the count value of the length counter 15 reaches the maximum detection column length N, the value of the maximum detection column length N is set as the length L of the partial data sequence having the same data sequence in the data one line before. To be measured. This length information is counted for each of relative position-1, relative position 0, and relative position + 1. That is, after the length L is counted for the relative position −1 as described above, the length L is stored as length information for the relative position −1 in the column of the relative position −1 of the relative position / length buffer 14. Remember. Next, in order to perform a search for the relative position 0, the start address of the search target partial string temporarily stored in the pointer buffer 12 is returned to the pixel pointer 10, the relative position counter 11 is incremented, and the search target partial string Similarly, the data at the relative position 0 does not match the data on the right of the start address, or the comparison is performed while incrementing the pointer 10 until the count value of the length counter 15 reaches the maximum detection column length N. Information L is obtained. Then, the same search is performed for the relative position +1.

【0019】図4(a)の2行0列の「5」を先頭画素
とする部分列を考えると、この画素はライン先頭なので
前のラインの相対位置−1にデータが存在しない。した
がって相対位置−1については、長さLは0となる。相
対位置0については、1行0列に「5」が存在するの
で、長さカウンタ13をインクリメントして2行0列の
「5」に隣接する2行1列のデータ「5」が部分列バッ
ファ16に取り込まれ1行1列の「5」と比較される。
これも一致するので、長さカウンタ13をインクリメン
トするとともに2行1列の「5」に隣接する2行2列の
データ「4」が部分列バッファ16に取り込まれ1行2
列の「5」と比較される。これは一致しない。このとき
の長さカウンタ13の値は「2」であり、最大部分列長
N=8に達していない。したがって、2行0列の「5」
を先頭画素とする部分列の相対位置0についての長さL
は2となる。
Considering a partial column having "5" in the 2nd row and 0th column as the leading pixel in FIG. 4A, since this pixel is the beginning of the line, there is no data at the relative position -1 of the previous line. Therefore, for the relative position -1, the length L becomes 0. As for the relative position 0, since "5" exists in the 1st row and 0th column, the length counter 13 is incremented and the 2nd row and 1st column data "5" adjacent to the 2nd row and 0th column "5" is a partial column. It is fetched in the buffer 16 and compared with "5" in 1 row and 1 column.
Since this also matches, the length counter 13 is incremented, and the data “4” of 2 rows and 2 columns adjacent to “5” of 2 rows and 1 column is fetched into the partial column buffer 16 and 1 row and 2
Compared to column "5". This does not match. At this time, the value of the length counter 13 is "2", and the maximum partial column length N = 8 has not been reached. Therefore, "5" in row 2 and column 0
The length L with respect to the relative position 0 of the partial sequence having
Is 2.

【0020】2行0列の「5」を先頭画素とする部分列
については、1行1列に「5」が存在し先頭画素と一致
するので相対位置+1についても隣接画素の比較を行
う。2行0列の「5」の隣接する2行1列のデータ
「5」が部分列バッファ16に取り込まれ、相対位置+
1の1行2列の「5」と比較される。一致するので順次
右側の画素を取り込み比較を続けると、2行5列の
「3」と1行6列の「1」の比較を行った時に不一致に
なる。このときの長さカウンタ13の値は「5」であ
り、最大部分列長N=8に達していない。したがって、
2行0列の「5」を先頭画素とする部分列の相対位置1
についての長さLは5となる。
For a partial column having "5" in the 2nd row and 0th column as the leading pixel, "5" exists in the 1st row and 1st column and coincides with the leading pixel. Therefore, the adjacent pixel is also compared at the relative position +1. The adjacent data “5” of 2 rows and 1 column of “5” of 2 rows and 0 column is fetched into the partial column buffer 16 and the relative position +
1 is compared with “5” in the 1st row and the 2nd column. Since they coincide with each other, if the pixels on the right side are sequentially fetched and the comparison is continued, there is a disagreement when the comparison of “3” at 2 rows and 5 columns and “1” at 1 row and 6 columns is performed. The value of the length counter 13 at this time is "5", and the maximum partial column length N = 8 has not been reached. Therefore,
Relative position 1 of the partial column with "5" in the 2nd row and 0th column as the first pixel
Has a length L of 5.

【0021】以上により、2行0列の「5」を先頭画素
とする部分列の長さLとしては、L(相対位置−1)=
0,L(相対位置0)=2,L(相対位置+1)=5の
3つが相対位置・長さバッファ14に記憶されることに
なる。この中で最長の5を長さLとする部分列を選択す
る。図4(a)の場合、同図(b)に示すように部分列
a(55)は相対位置0の同一部分列を示し、部分列b
(55434)は相対位置+1の同一部分列を示す。部
分列aは長さ2、部分列bは長さ5であるので圧縮効率
の高い部分列bを選択する。
As described above, as the length L of the partial column having "5" in the 2nd row and 0th column as the leading pixel, L (relative position -1) =
Three of 0, L (relative position 0) = 2, L (relative position + 1) = 5 will be stored in the relative position / length buffer 14. Of these, the longest substring whose length L is 5 is selected. In the case of FIG. 4A, as shown in FIG. 4B, the subsequence a (55) indicates the same subsequence at relative position 0, and the subsequence b
(55434) indicates the same partial sequence at relative position +1. Since the subsequence a has a length of 2 and the subsequence b has a length of 5, the subsequence b having high compression efficiency is selected.

【0022】すなわち、処理24を介して処理25に移
行し、ポインタバッファ12の中に格納されている注目
画素の現ライン上での位置をx、相対位置・長さバッフ
ァ14の中に格納されているデータの中で最長データの
長さをy、最長データの相対位置に2を加えた値をzと
し、このx、y、zを符号生成器8に入力する。
That is, the process shifts from the process 24 to the process 25, and the position of the pixel of interest stored in the pointer buffer 12 on the current line is stored in the relative position / length buffer 14 as x. The length of the longest data is y and the value obtained by adding 2 to the relative position of the longest data is z, and these x, y and z are input to the code generator 8.

【0023】処理28では、符号生成器8は注目画素の
現ライン上での位置xからTの値を求める。Tの値は、
x=0のときはT=0、1≦x≦H−NのときはT=
1、H−N+1≦x≦H−1のときはT=x−H+N+
1である。ここで、Hは処理20で符号生成器8に入力
された2次元画像データの1ラインの画素数、Nは予め
設定された最大検出列長である。前述したように、本実
施例ではH=16であり、また、予めN=8に設定した
ので、Tの値は、x=0のときはT=0(処理29)、
1≦x≦8のときはT=1(処理30)、9≦x≦15
のときはT=x−7(処理31)となる。
In step 28, the code generator 8 obtains the value of T from the position x of the target pixel on the current line. The value of T is
When x = 0, T = 0, and when 1 ≦ x ≦ H−N, T =
1, when H−N + 1 ≦ x ≦ H−1, T = x−H + N +
It is 1. Here, H is the number of pixels of one line of the two-dimensional image data input to the code generator 8 in process 20, and N is the preset maximum detection column length. As described above, in this embodiment, H = 16, and since N = 8 was set in advance, the value of T is T = 0 when x = 0 (process 29),
When 1 ≦ x ≦ 8, T = 1 (processing 30), 9 ≦ x ≦ 15
In case of, T = x−7 (process 31).

【0024】処理32では、符号生成器8は、注目画素
の現ライン上での位置xから求めたTの値に基づき、テ
ーブル群70の中から対応したテーブルを選択して参照
し、データの長さyとそれに対する相対位置に2を加え
た値zに応じたコードを、符号出力線19を通して出力
する。
In process 32, the code generator 8 selects and refers to the corresponding table from the table group 70 based on the value of T obtained from the position x of the target pixel on the current line, and refers to the data. A code corresponding to the length y and the value z obtained by adding 2 to the relative position to the length y is output through the code output line 19.

【0025】また、処理24で、相対位置・長さバッフ
ァ14に格納されている長さが全て0の場合、つまり辞
書の中に一致する部分列が見つからなかった場合は、処
理24を介して処理26に移行し、ランレングス圧縮を
行う。すなわち、現ライン上に同一画素が前述した最大
検出列長N(本実施例ではN=8)の範囲内でできるだ
け長く連続する部分列を検索する。先ず、ポインタ10
の指すラインバッファ5のデータを部分列バッファ16
に格納し、ポインタ10を1つ進め、ラインバッファ5
のデータをセレクタ15を通して、比較器7に入力し、
部分列バッファ16のデータと比較する。比較の結果一
致するならば、長さカウンタ13をインクリメントし、
次のポインタ10の指すデータをセレクタ15を通して
比較器7に入力し部分列バッファ16のデータと比較す
る。そして、比較の結果が一致しなくなるか、または、
長さカウンタ15のカウント値が最大検出列長Nになる
までポインタ10を1つずつ進め部分列バッファ16の
データとの比較を繰り返す。これにより、比較結果が一
致しなくなった場合は、一致しなくなった時点で長さカ
ウンタ15に計数されている値が現ライン上の同一画素
が連続した部分データ列の長さLとして計測され、ま
た、長さカウンタ15のカウント値が最大検出列長Nに
なった場合は、最大検出列長Nの値が現ライン上の同一
画素が連続した部分データ列の長さLとして計測され
る。
If all the lengths stored in the relative position / length buffer 14 are 0 in the process 24, that is, if no matching subsequence is found in the dictionary, the process 24 is performed. The process moves to step 26, and run length compression is performed. That is, a partial column in which the same pixel on the current line is continuous as long as possible within the range of the maximum detection column length N (N = 8 in this embodiment) is searched. First, the pointer 10
The data in the line buffer 5 pointed to by the partial column buffer 16
To the line buffer 5
The data of is input to the comparator 7 through the selector 15,
The data is compared with the data in the partial column buffer 16. If they match as a result of the comparison, the length counter 13 is incremented,
The data pointed to by the next pointer 10 is input to the comparator 7 through the selector 15 and compared with the data in the partial column buffer 16. And the result of comparison becomes inconsistent, or
Until the count value of the length counter 15 reaches the maximum detected column length N, the pointer 10 is advanced one by one and the comparison with the data of the partial column buffer 16 is repeated. As a result, when the comparison results do not match, the value counted by the length counter 15 at the time when they do not match is measured as the length L of the partial data string in which the same pixel on the current line is continuous, When the count value of the length counter 15 reaches the maximum detection column length N, the value of the maximum detection column length N is measured as the length L of the partial data sequence in which the same pixel on the current line is continuous.

【0026】次に、処理27で、ポインタバッファ12
の中に格納されている注目画素の現ライン上での位置を
x、長さカウンタ13に計数されている同一画素が連続
した部分データ列の長さをy、zを0とし、このx、
y、zの値と共に、部分列バッファ16に格納されてい
るデータを符号生成器8に入力する。
Next, in process 27, the pointer buffer 12
Where x is the position of the pixel of interest stored in the current line on the current line, and y and z are the lengths of the partial data strings in which the same pixel counted by the length counter 13 is 0.
The data stored in the subsequence buffer 16 is input to the code generator 8 together with the values of y and z.

【0027】次に、注目画素の現ライン上での位置xか
ら求めたTの値に基づき、テーブル群70の中から対応
するテーブルを選択して参照し、データの長さyとz=
0とに応じたコードと、その繰り返すべき生データを、
符号出力線19を通して出力する(処理32)。
Next, based on the value of T obtained from the position x of the target pixel on the current line, the corresponding table is selected from the table group 70 and referred to, and the data lengths y and z =
Code corresponding to 0 and raw data to be repeated,
It is output through the code output line 19 (process 32).

【0028】処理33及び処理34を介して上記操作を
2次元画像データの最終ラインまで繰り返し、データ圧
縮を行い符号化する。
The above operations are repeated up to the final line of the two-dimensional image data through the process 33 and the process 34 to compress and encode the data.

【0029】次に、図4に示す16×8の画像データの
データ圧縮過程を説明する。各データは4ビットで表現
されるものとする。以下では、便宜的に、画像データの
座標を(列,行)、符号化されたコードを、{T,相対
位置,長さ}あるいは[T,データの種類,長さ]で表
すことにする。即ち、中括弧{ }で囲まれている部分
は本発明による圧縮がおこなわれている部分であり、鍵
括弧[ ]で囲まれている部分はランレングス圧縮が行
われている部分を示す。ここで、Tは処理28で注目画
素の現ライン上での位置xから求めた値である。すなわ
ち、本実施例では、注目画素が0列に位置する場合はT
=0、1列〜8列に位置する場合はT=1、9列に位置
する場合はT=2,A列に位置する場合はT=3,B列
に位置する場合はT=4,C列に位置する場合はT=
5,D列に位置する場合はT=6,E列に位置する場合
はT=7,F列に位置する場合はT=8となる。
Next, the data compression process of the 16 × 8 image data shown in FIG. 4 will be described. Each data shall be represented by 4 bits. Hereinafter, for convenience, the coordinates of the image data will be represented by (column, row), and the encoded code will be represented by {T, relative position, length} or [T, data type, length]. . That is, the portion enclosed by curly brackets {} is the portion where compression according to the present invention is performed, and the portion enclosed by key brackets [] indicates the portion where run length compression is performed. Here, T is a value obtained from the position x of the target pixel on the current line in the process 28. That is, in the present embodiment, when the pixel of interest is located in the 0th column, T
= 0, T = 1 when located in the 1st to 8th columns, T = 2 when located in the 9th column, T = 3 when located in the A column, T = 4 when located in the B column If it is located in column C, T =
When located in the 5, D column, T = 6; when located in the E column, T = 7; and when located in the F column, T = 8.

【0030】たとえば、注目画素の列が0、相対位置が
1、長さが3の符号コードは{0,1,3}、注目画素
の列が1、データの種類が5、長さが2の符号コードは
[1,5,2]となる。また、注目画素の座標を(x, y)
とすると、辞書参照範囲を相対位置で(x-1, y-1)、(x,
y-1)、(x+1, y-1)とする。先ず、図4(a)の場合、0
行目は参照する辞書が存在しないのでランレングス圧縮
を行う。画像データ(0,0)から(3,0)のデータ
は2で同じなので、符号は[0,2,4]となる。
(4,0)の3は1つだけなので符号は[1,3,1]
となる。(5,0)から(7,0)のデータは4で同じ
なので符号は[1,4,3]となる。(8,0)の6は
1つだけなので符号は[1,6,1]となる。(9,
0)及び(A,0)のデータはCで同じなので符号は
[2,C,2]となる。(B,0)及び(C,0)のデ
ータは6で同じなので符号は[4,6,2]となる。
(D,0)から(F,0)のデータは3で同じなので符
号は[6,3,3]となる。したがって、0行目の符号
は、図5の0行目に示すように、[0,2,4][1,
3,1][1,4,3][1,6,1][2,C,2]
[4,6,2][6,3,3]となる。
For example, the code column of the pixel of interest is 0, the relative position is 1, and the length is 3, the code code is {0, 1, 3}, the column of the pixel of interest is 1, the type of data is 5, and the length is 2. The code code of is [1, 5, 2]. In addition, the coordinates of the pixel of interest are (x, y)
Then, the dictionary reference range is relative position (x-1, y-1), (x, y
y-1) and (x + 1, y-1). First, in the case of FIG.
Since there is no dictionary to refer to in the line, run length compression is performed. Since the data of the image data (0,0) to (3,0) is the same as 2, the code is [0,2,4].
Since there is only one 3 in (4, 0), the code is [1, 3, 1]
Becomes Since the data from (5,0) to (7,0) is the same as 4, the code is [1,4,3]. Since there is only one 6 in (8,0), the code is [1,6,1]. (9,
Since the data of 0) and (A, 0) are the same in C, the code is [2, C, 2]. Since the data of (B, 0) and (C, 0) is the same as 6, the code is [4,6,2].
Since the data from (D, 0) to (F, 0) is the same as 3, the code is [6, 3, 3]. Therefore, the code of the 0th line is [0, 2, 4] [1, as shown in the 0th line of FIG.
3,1] [1,4,3] [1,6,1] [2, C, 2]
[4, 6, 2] [6, 3, 3].

【0031】図4(a)の1行目の処理は、0行目を辞
書として扱う。(0,1)と(0,0)を比較し一致し
ないので、次に(0,1)と(1,0)と比較し、これ
も一致しないので、辞書には一致する部分列がないと判
断し、ランレングス圧縮を適用する。(0,1)から
(2,1) のデータは5で同じであるので符号は[0,
5,3]となる。(3,1)の4は(2,0)、(3,
0)、(4,0)のいずれとも一致しないので、ランレ
ングス圧縮を適用し、符号は[1,4,1]となる。
(4,1)の3は(3,0)、(4,0)、(5,0)
の中の(4,0)と一致し、(4,1)から(5,1)
と辞書の(4,0)から(5,0)が一致するので、符
号は{1,0,2}となる。(6,1)と(7,1)は
それぞれ辞書のデータと一致しないので符号は、それぞ
れ[1,1,1]、[1,3,1]となる。(8,1)
のCは(7,0)、(8,0)、(9,0)の中の
(9,0)と一致し、(8,1)から(9,1)と辞書
の(9,0)から(A,0)が一致するので、符号は
{1,1,2}となる。(A,1)のCは(9,0)、
(A,0)、(B,0)の中の(9,0)及び(A,
0)と一致する。ここで、(B,1)と(A,0)は一
致しないが、(A,1)から(C,1)と辞書の(A,
0)から(C,0)は一致するので、符号は{3,0,
3}となる。(D,1)の6は(C,0)、(D,
0)、(E,0)の中の(C,0)と一致し、(D,
1)から(F,1)と辞書の(C,0)から(E,0)
は一致するので、符号は{6,−1,3}となる。した
がって、1行目の符号は、図5の1行目に示すように、
[0,5,3][3,4,1]{4,0,2}[6,
1,1][7,3,1]となる。
In the processing of the first line in FIG. 4A, the 0th line is treated as a dictionary. Since (0,1) and (0,0) are compared and do not match, the next comparison is made with (0,1) and (1,0), which also does not match, so there is no matching subsequence in the dictionary. Then, run length compression is applied. Since the data from (0,1) to (2,1) is the same as 5, the code is [0,
5, 3]. 4 in (3,1) is (2,0), (3,1)
Since it does not match either 0) or (4,0), run length compression is applied and the code becomes [1,4,1].
3 in (4,1) is (3,0), (4,0), (5,0)
Matches (4,0) in (4,1) to (5,1)
Since (4,0) to (5,0) in the dictionary match, the code is {1,0,2}. Since (6,1) and (7,1) do not match with the dictionary data, the codes are [1,1,1] and [1,3,1], respectively. (8,1)
C of (7,0), (8,0), matches (9,0) in (9,0), and (8,1) to (9,1) and (9,0) in the dictionary. ) To (A, 0) match, the code is {1,1,2}. C of (A, 1) is (9,0),
(A, 0), (9,0) in (B, 0) and (A,
0). Here, (B, 1) and (A, 0) do not match, but (A, 1) to (C, 1) and (A,
Since 0) to (C, 0) match, the code is {3, 0,
3}. 6 of (D, 1) is (C, 0), (D,
0), (E, 0) in (C, 0), and (D,
1) to (F, 1) and dictionary (C, 0) to (E, 0)
Match, so the code is {6, -1, 3}. Therefore, the code in the first line is as shown in the first line in FIG.
[0,5,3] [3,4,1] {4,0,2} [6
1,1] [7,3,1].

【0032】図4(a)の2行目の処理は、1行目を辞
書として扱う。(0,2)は相対位置0の辞書(0,
1)と相対位置1の辞書(1,1)と一致するが、相対
位置0の場合は一致する辞書の部分列の長さが(0,
1)から(1,1)と2であるが、相対位置1の場合は
一致する辞書の部分列の長さが(1,1)から(5,
1)と5であり、相対位置1の辞書の部分列の方が長い
ので、符号は{0,1,5}となり、上記の処理を最終
行まで繰り返すと図4の画像データに対して図5の符号
列が得られる。
In the process of the second line in FIG. 4A, the first line is treated as a dictionary. (0,2) is the dictionary (0,
1) matches the dictionary (1, 1) at the relative position 1, but if the relative position is 0, the length of the matching substring is (0,
1) to (1, 1) and 2, but in the case of the relative position 1, the lengths of the matching substrings of the dictionary are (1, 1) to (5.
1) and 5, and the subsequence of the dictionary at relative position 1 is longer, the code is {0, 1, 5}, and if the above process is repeated until the last line, the image data of FIG. A code string of 5 is obtained.

【0033】次に、図5の符号列を図6乃至図14に示
すテーブルを用いて実際のコードに割り当ててみる。図
6乃至図14は、Tの値毎に用意された、yの値及びz
の値に応じて異なるコードが割り当てられたテーブルを
示す。ここで、Tは処理28で注目画素の現ライン上で
の位置xから求めた値、y及びzは処理25又は処理2
7で符号生成器8に入力された値であり、yは圧縮対象
部分列の長さ、zは、符号列が鍵括弧[ ]で囲まれて
いる場合、すなわちランレングス圧縮の場合は0、符号
列が中括弧{ }で囲まれている場合、すなわち本発明
による辞書圧縮の場合は、相対位置に2を加えた値であ
る。
Next, the code strings in FIG. 5 will be assigned to actual codes using the tables shown in FIGS. 6 to 14. 6 to 14 show values of y and z prepared for each value of T.
9 shows a table in which different codes are assigned depending on the value of. Here, T is a value obtained from the position x of the target pixel on the current line in process 28, and y and z are process 25 or process 2.
7 is a value input to the code generator 8 in y, y is the length of the substring to be compressed, z is 0 when the code string is enclosed in key brackets [], that is, 0 in the case of run length compression, When the code string is enclosed in braces {}, that is, in the case of dictionary compression according to the present invention, it is a value obtained by adding 2 to the relative position.

【0034】各テーブルに記憶されたコードは、生起確
立の高いデータに短い符号を割当てて圧縮率を上げるた
め、固定長符号とはせずに可変長符号としている。尚、
テーブルをTの値毎に用意したのは以下の理由による。
原理的には用意するテーブルは1つでもよい。しかし、
テーブルを1つにまとめると、y及びzが採りうる全て
の値に応じて異なる符号を割り当てなければならない。
ところで、y及びzが採りうる値は、注目画素の現ライ
ン上での先頭画素からの位置xによって異なる。たとえ
ば、各テーブルにおけるyの最大値は、注目画素から現
ラインの最終端に位置する画素までのビット列長とな
る。また、x=0ではz=1(相対位置が−1の場合)
に符号を割り当てる必要はない。したがって、テーブル
を1つにまとめると、符号の冗長性が大きくなる。一
方、注目画素の現ライン上での先頭画素からの位置x毎
にテーブルを用意した場合、各テーブルにおけるyの最
大値を、注目画素から現ラインの最終端に位置する画素
までのビット列長に制限することにより、符号の冗長性
を改善することができる。しかし、2次元画像データの
1ラインの画素数Hを増やした場合、新たにテーブルを
追加しなければならず、テーブルの容量が増大し、この
ため、圧縮・伸長速度が低下する。そこで、本実施例で
は、予め圧縮対象部分列の最大検出列長Nを設定した。
そして、x=0ではz=1に符号を割り当てる必要がな
いので専用のテーブルを用意し、1≦x≦H−Nではy
の採りうる最大値は全てNとなり、また、zの採りうる
値は全て0〜3となるのでまとめて1つのテーブルを用
意し、H−N+1≦x≦H−1ではzの採りうる値は全
て0〜3であるが、yの採りうる最大値は注目画素から
現ラインの最終端に位置する画素までのビット列長とな
るので、xの各値毎に専用のテーブルを用意した。すな
わち、x=0のときはT=0、1≦x≦H−Nのときは
T=1、H−N+1≦x≦H−1のときはT=x−H+
N+1、とし、Tの各値毎にテーブルを用意した。この
ようにTの値を設定することにより、Tの採りうる値の
範囲は、 最大検出列長N<1ラインの画素数H であれば1ラインの画素数Hの値にかかわらず一定とな
る。すなわち、Tの採りうる値は0≦T≦x−H+N+
1であるが、注目画素の現ライン上での位置xの採りう
る最大値はH−1であるので、結局、0≦T≦Nとな
る。したがって、2次元画像データの1ラインの画素数
Hを増加したときでも、テーブルの数は常にN+1とな
るので、テーブルの容量が増大して、圧縮・伸長速度が
低下するのを防止することができる。
The code stored in each table is not a fixed length code but a variable length code in order to assign a short code to data with a high probability of occurrence to increase the compression rate. still,
The reason why the table is prepared for each value of T is as follows.
In principle, only one table may be prepared. But,
When the tables are put together, different codes must be assigned according to all possible values of y and z.
By the way, the values that can be taken by y and z differ depending on the position x from the first pixel on the current line of the pixel of interest. For example, the maximum value of y in each table is the bit string length from the pixel of interest to the pixel located at the end of the current line. When x = 0, z = 1 (when the relative position is -1)
There is no need to assign a code to. Therefore, if the tables are combined into one, the code redundancy increases. On the other hand, when a table is prepared for each position x from the first pixel on the current line of the target pixel, the maximum value of y in each table is set to the bit string length from the target pixel to the pixel located at the last end of the current line. By limiting, code redundancy can be improved. However, when the number of pixels H of one line of the two-dimensional image data is increased, a new table has to be added, and the capacity of the table increases, so that the compression / expansion speed decreases. Therefore, in the present embodiment, the maximum detection sequence length N of the compression target partial sequence is set in advance.
When x = 0, it is not necessary to assign a code to z = 1. Therefore, a dedicated table is prepared, and if 1 ≦ x ≦ H−N, y is set.
Since all the maximum values that can be taken are N and the values that z can take are all 0 to 3, one table is prepared collectively, and the possible values of z are H-N + 1 ≦ x ≦ H−1. Although all are 0 to 3, the maximum possible value of y is the bit string length from the pixel of interest to the pixel located at the final end of the current line, so a dedicated table was prepared for each value of x. That is, T = 0 when x = 0, T = 1 when 1 ≦ x ≦ H−N, and T = x−H + when H−N + 1 ≦ x ≦ H−1.
N + 1, and a table was prepared for each value of T. By setting the value of T in this way, the range of possible values of T becomes constant regardless of the value of the number of pixels H of one line if the maximum detection column length N <the number of pixels H of one line. . That is, the possible values of T are 0 ≦ T ≦ x−H + N +
Although it is 1, the maximum possible value of the position x on the current line of the target pixel is H−1, so that 0 ≦ T ≦ N is satisfied. Therefore, even when the number of pixels H of one line of the two-dimensional image data is increased, the number of tables is always N + 1, so that it is possible to prevent the table capacity from increasing and the compression / decompression speed to decrease. it can.

【0035】また、本実施例では、画像データの圧縮を
対象としているので、辞書圧縮の場合において、注目画
素のあるラインの直前ラインであって注目画素に隣接す
るデータ(相対位置が−1,0,+1のデータ)のみに
ついて辞書圧縮を行うことにより、テーブルのサイズを
小さくしている。これにより、高い圧縮率を期待でき
る。テーブル群70に用意されているテーブルは、予め
圧縮伸長するデータに合わせて構成されたハフマン符号
のテーブル、あるいは、圧縮伸長に伴い、冗長性が少な
くなるように最適化されていくテーブルであることが望
ましい。尚、図6乃至図14において、ハイフン「─」
で示すものは可変長符号が割り当てられていないことを
示す。
Further, in the present embodiment, since the image data is compressed, in the case of the dictionary compression, the data immediately before the line having the pixel of interest and adjacent to the pixel of interest (relative position is -1, The size of the table is reduced by performing dictionary compression only on (0, +1 data). Thereby, a high compression rate can be expected. The table prepared in the table group 70 must be a table of Huffman code configured in advance for data to be compressed / decompressed, or a table that is optimized to reduce redundancy with compression / decompression. Is desirable. 6 to 14, the hyphen "-"
The ones indicated by means that variable length codes are not assigned.

【0036】先ず、Tの値に基づき、図6乃至図14に
示すテーブルの中からいずれかのテーブルを選択する。
たとえば、[0,2,4]を符号化する場合は図6に示
すT=0のテーブルを選択し、{1,−1,1}を符号
化する場合は図7に示すT=1のテーブルを選択する。
次に、選択したテーブルの中からy及びzの値に応じた
コードを選択する。たとえば、[0,2,4]を符号化
する場合は図6に示すT=0のテーブルからy=4、z
=0に応じたコード0110110111を選択し、{1,−1,
1}を符号化する場合は図7に示すT=1のテーブルか
らy=1、z=1に応じたコード0111を選択する。尚、
z=0の場合、すなわちランレングス圧縮が行われてい
る場合は、テーブルから選択されたコードの後に繰り返
すべき生データ(本実施例では4ビット固定のカラーコ
ード情報である。画像によっては各色毎の輝度データの
場合もあり得る。)が加えられる。たとえば、[0,
2,4]を符号化する場合は図6に示すT=0のテーブ
ルから選択されたy=4、z=0に応じたコード011011
0111の後に、0010が加えられる。したがって、[0,
2,4]のコードは01101101110010となる。
First, based on the value of T, one of the tables shown in FIGS. 6 to 14 is selected.
For example, when encoding [0,2,4], the table of T = 0 shown in FIG. 6 is selected, and when encoding {1, -1,1,}, the table of T = 1 shown in FIG. 7 is selected. Select a table.
Next, a code corresponding to the values of y and z is selected from the selected table. For example, when encoding [0,2,4], y = 4, z is obtained from the table of T = 0 shown in FIG.
Select the code 0110110111 according to = 0, {1, -1,
1} is coded, the code 0111 corresponding to y = 1 and z = 1 is selected from the T = 1 table shown in FIG. still,
When z = 0, that is, when run-length compression is performed, raw data to be repeated after the code selected from the table (in the present embodiment, 4-bit fixed color code information. In some cases, it may be the luminance data of). For example, [0,
[2, 4] is encoded, the code 011011 corresponding to y = 4 and z = 0 selected from the table of T = 0 shown in FIG.
After 0111, 0010 is added. Therefore, [0,
The code of [2, 4] is 01101101110010.

【0037】図5の符号列を実際の符号に変換した結果
が図15になり、図4の画像データの容量が512ビッ
トであるのに対し、図15のデータ容量は、404ビッ
トであり、本発明のアルゴリズムを用いてもとの画像デ
ータの78.9%に圧縮できたことになる。
The result of converting the code string of FIG. 5 into an actual code is shown in FIG. 15. The image data capacity of FIG. 4 is 512 bits, whereas the data capacity of FIG. 15 is 404 bits. The algorithm of the present invention can be used to compress the original image data to 78.9%.

【0038】次に、図16乃至図18を用いて上記の手
法で圧縮した符号を伸長する手順を示す。図16は伸長
回路の構成例、図17及び図18はデータ伸長アルゴリ
ズムのフローチャートである。図16において、29は
入力バッファ、30はデコーダ、32はモードレジス
タ、33はデータレジスタ、34は相対位置レジスタ、
35は辞書アドレス計算部、36はセレクタ、37は長
さカウンタ、38は伸長するデータの2次元空間上の位
置を特定するX,Yカウンタ、39は辞書コピーの際に
参照すべきデータが記憶された辞書バッファ、71はT
の各値毎に用意されたテーブル群、43は入力バッファ
29への入力信号線、44は出力信号線を示す。尚、テ
ーブル群71におけるTの値は、X,Yカウンタ38に
よって特定される注目画素(伸長しようとしている部分
列の先頭画素)のX座標上の位置をxとしたときに、図
3に示すフローの処理28と同じ手法によって求められ
る。各テーブルには、注目画素のX座標上の位置xに基
づいて求めたTの各値毎に、図6乃至図14に示すテー
ブルと同じ情報が記憶されている。また、X,Yカウン
タ38が採りうるY座標上の値に制限はないが、X座標
上の値は伸長しようとする2次元画像データの1ライン
の画素数をHとした場合、0〜H−1に制限される。本
実施例では、2次元画像データの1ラインの画素数Hを
16としたので、X,Yカウンタ38が採りうるX座標
上の値は0〜15となる。
Next, the procedure for decompressing the code compressed by the above method will be described with reference to FIGS. FIG. 16 is a configuration example of the decompression circuit, and FIGS. 17 and 18 are flowcharts of the data decompression algorithm. In FIG. 16, 29 is an input buffer, 30 is a decoder, 32 is a mode register, 33 is a data register, 34 is a relative position register,
Reference numeral 35 is a dictionary address calculation unit, 36 is a selector, 37 is a length counter, 38 is an X and Y counter for specifying the position of the data to be expanded in the two-dimensional space, and 39 is data to be referred when the dictionary is copied. Created dictionary buffer, 71 is T
Table 43 is prepared for each value of, 43 is an input signal line to the input buffer 29, and 44 is an output signal line. The value of T in the table group 71 is shown in FIG. 3 when the position on the X coordinate of the pixel of interest specified by the X, Y counter 38 (the leading pixel of the partial string to be expanded) is x. It is obtained by the same method as the process 28 of the flow. In each table, the same information as the table shown in FIGS. 6 to 14 is stored for each value of T obtained based on the position x on the X coordinate of the pixel of interest. Also, there is no limitation on the value on the Y coordinate that the X, Y counter 38 can take, but the value on the X coordinate is 0 to H when the number of pixels of one line of the two-dimensional image data to be expanded is H. Limited to -1. In the present embodiment, since the number of pixels H of one line of the two-dimensional image data is 16, the value on the X coordinate that the X, Y counter 38 can take is 0 to 15.

【0039】次に、上記のように構成された伸長回路の
動作の概要を示す。先ず、処理44で伸長しようとする
2次元画像データの1ラインの画素数HをX,Yカウン
タ38及びデコーダ30に入力する。次に、処理45で
X,Yカウンタ38を初期化した後、入力信号線43を
通して、入力バッファ29に圧縮されたデータを取り込
む(処理46)。尚、2回目以降の伸長処理において
は、入力バッファ29に貯えられたデータのうち未処理
のビット列の後に圧縮されたデータが取り込まれる。入
力バッファ29は、FIFO、シフトレジスタ等で構成
される。処理47では、入力バッファ29に貯えられた
ビット列長が15ビット以上であるか否かを判断する。
これは、入力バッファ29からデコーダ11に渡される
ビット列長が、データ圧縮回路で圧縮されたデータの最
長ビット列長以上でなければならないからである。本実
施例による圧縮方式では、ランレングス圧縮を行った場
合において、図6乃至図14に示すテーブルから選択さ
れたコードが11ビットのときに、これに生データ(4
ビット固定)が加えられることにより、ビット列長が最
長の15ビットとなる。入力バッファ29に貯えられた
ビット列長が15ビット以上のときは処理48に移行
し、15ビット未満のときは処理46に戻る。
Next, an outline of the operation of the decompression circuit configured as described above will be shown. First, the number of pixels H of one line of the two-dimensional image data to be expanded in the process 44 is input to the X, Y counter 38 and the decoder 30. Next, after the X and Y counter 38 is initialized in the process 45, the compressed data is fetched into the input buffer 29 through the input signal line 43 (process 46). In the second and subsequent expansion processes, the compressed data is fetched after the unprocessed bit string of the data stored in the input buffer 29. The input buffer 29 is composed of a FIFO, a shift register and the like. In the process 47, it is determined whether or not the bit string length stored in the input buffer 29 is 15 bits or more.
This is because the bit string length passed from the input buffer 29 to the decoder 11 must be equal to or longer than the longest bit string length of the data compressed by the data compression circuit. In the compression method according to the present embodiment, when the run length compression is performed and the code selected from the tables shown in FIGS. 6 to 14 is 11 bits, the raw data (4
By adding (fixed bit), the bit string length becomes the longest 15 bits. When the length of the bit string stored in the input buffer 29 is 15 bits or more, the process proceeds to step 48, and when it is less than 15 bits, the process returns to step 46.

【0040】処理48では、入力バッファ29に貯えら
れたビット列の先頭から15ビット部分をデコーダ30
に渡す。デコーダ30は、X,Yカウンタ38によって
特定される注目画素のX座標上での位置x、処理44で
入力された伸長しようとする2次元画像データの1ライ
ンの画素数H(本実施例ではH=16)、および、圧縮
回路で用いた最大検出列長N(本実施例ではN=8)に
基づき、図3に示すフローの処理28と同じ手法によっ
てTの値を求め、その後、テーブル群71の中からTの
値に応じたテーブルを選択する。そして、選択したテー
ブルの中から受け取ったビット列と先頭位置からのビッ
ト列長が最も長く一致する可変長符号を検索する。たと
えば、図15に示す符号列の0行目において、先頭位置
から15ビットまでのデータ011011011100101 が入力バ
ッフア29からデコーダ30に渡された場合、X,Yカ
ウンタ38によって特定される注目画素のX座標上での
位置xから求めたTの値(この場合x=0なので、T=
0である)に基づき、テーブル群71の中から図6に示
すテーブルと同じ情報が記憶されたテーブルを選択す
る。そして、選択したテーブルに保持された全ての可変
長符号と入力データ011011011100101 を先頭ビットから
1ビットずつ比較していき、どの可変長符号も一致しな
くなる直前まで一致していた可変長符号をこの15ビッ
トの入力データに隠された求める可変長符号とする。す
なわち、入力データの先頭位置からのビット列長が最も
長く一致する可変長符号をテーブル内から検索する。こ
の場合、図6から推測できるように、伸長モードがラン
レングスモード、長さが4の可変長符号0110110111が検
索される。また、図15に示す符号列の2行目におい
て、先頭位置から15ビットまでのデータ011011100111
100 が、入力バッフア29からデコーダ30に渡された
場合、X,Yカウンタ38によって特定される注目画素
のX座標上での位置xから求めたTの値(この場合x=
0なので、T=0である)に基づき、テーブル群71の
中から図6に示すテーブルと同じ情報が記憶されたテー
ブルを選択する。そして、選択したテーブルの中からデ
ータ011011100111100 と先頭位置からのビット列長が最
も長く一致する可変長符号を検索する。この場合、図6
から推測できるように、伸長モードが辞書コピーモー
ド、相対位置1、長さが5の可変長符号01101110が検索
される。
In the process 48, the 15-bit portion from the beginning of the bit string stored in the input buffer 29 is decoded by the decoder 30.
Pass to. The decoder 30 determines the position x on the X coordinate of the pixel of interest specified by the X, Y counter 38, and the number of pixels H of one line of the two-dimensional image data to be expanded input in the process 44 (in this embodiment, H). H = 16) and the maximum detection column length N (N = 8 in this embodiment) used in the compression circuit, the value of T is obtained by the same method as the process 28 of the flow shown in FIG. A table corresponding to the value of T is selected from the group 71. Then, a variable length code having the longest matching bit string length from the head position with the received bit string is searched from the selected table. For example, in the 0th row of the code string shown in FIG. 15, when data 011011011100101 from the first position to the 15th bit is passed from the input buffer 29 to the decoder 30, the X coordinate of the pixel of interest specified by the X, Y counter 38. The value of T obtained from the position x above (in this case, x = 0, so T =
On the basis of (0), a table in which the same information as the table shown in FIG. 6 is stored is selected from the table group 71. Then, all the variable length codes held in the selected table are compared with the input data 011011011100101 bit by bit from the first bit, and the variable length codes which have been matched until just before any variable length code does not match are The desired variable length code hidden in the bit input data. That is, the variable length code having the longest matching bit string length from the head position of the input data is searched from the table. In this case, as can be inferred from FIG. 6, a variable length code 0110110111 having a run length mode as the decompression mode and a length of 4 is searched. Also, in the second row of the code string shown in FIG. 15, data 011011100111 from the start position to the 15th bit.
When 100 is passed from the input buffer 29 to the decoder 30, the value of T obtained from the position x on the X coordinate of the pixel of interest specified by the X, Y counter 38 (in this case, x =
On the basis of (T = 0, T = 0), a table in which the same information as the table shown in FIG. 6 is stored is selected from the table group 71. Then, the variable length code having the longest matching bit string length from the start position with the data 011011100111100 is searched from the selected table. In this case,
As can be inferred from the above, the variable length code 01101110 having the expansion mode as the dictionary copy mode, the relative position 1 and the length 5 is searched.

【0041】処理49では、デコーダ30は、選択され
たテーブルの中から検索された可変長符号に基づき、ラ
ンレングスモードであるか又は辞書コピーモードである
かを識別するモードフラグをモードレジスタ32に、長
さデータを長さカウンタ37に、そして、モードフラグ
が辞書コピーモードの場合は相対位置データを相対位置
レジスタ34に出力する。また、デコーダ30は、デコ
ードしたビット列長を入力バッファ29に、そして、モ
ードフラグがランレングスモードの場合は生データをデ
ータレジスタ33に出力する。たとえば、図15に示す
符号列の0行目において、先頭位置から15ビットまで
のデータ011011011100101 が、入力バッフア29からデ
コーダ30に渡された場合、処理48で検索された可変
長符号0110110111のパラメータは、伸長モードがランレ
ングスモード、長さが4である。したがって、デコーダ
30は、ランレングスモードのモードフラグをモードレ
ジスタ32に、長さデータの値4を長さカウンタ37
に、処理48で検索された可変長符号0110110111に続く
4ビット部分0010(生データ)をデータレジスタ33
に、そして、検索された可変長符号のビット列長(10
ビット)に生データのビット列長(4ビット固定)を加
えた14ビット(デコードしたビット列長)を入力バッ
ファ29に出力する。また、図15に示す符号列の2行
目において、先頭位置から15ビットまでのデータ0110
11100111100 が、入力バッフア29からデコーダ30に
渡された場合、処理48で検索された可変長符号011011
10の各パラメータは、伸長モードが辞書コピーモード、
相対位置が1、長さが5である。したがって、デコーダ
30は、辞書コピーモードのモードフラグをモードレジ
スタ32に、長さデータの値5を長さカウンタ37に、
相対位置データの値1を相対位置レジスタ34に、そし
て、検索された可変長符号01101110のビット列長である
8ビット(デコードしたビット列長)を入力バッファ2
9に出力する。尚、デコードしたビット列長を入力バッ
ファ29に出力するのは、入力バッファ29に貯えられ
たデータのうち未処理のビット列の後に、デコーダ30
でデコードされたビット列長と同じビット列長のデータ
を追加するためである。
In process 49, the decoder 30 sets a mode flag in the mode register 32 for identifying the run length mode or the dictionary copy mode based on the variable length code retrieved from the selected table. , The length data is output to the length counter 37, and the relative position data is output to the relative position register 34 when the mode flag is the dictionary copy mode. Also, the decoder 30 outputs the decoded bit string length to the input buffer 29, and outputs the raw data to the data register 33 when the mode flag is the run length mode. For example, in the 0th row of the code string shown in FIG. 15, when the data 011011011100101 from the first position to the 15th bit is passed from the input buffer 29 to the decoder 30, the parameter of the variable length code 0110110111 found in the process 48 is The extension mode is the run length mode and the length is 4. Therefore, the decoder 30 sets the mode flag of the run length mode in the mode register 32, and the value 4 of the length data in the length counter 37.
In addition, the 4-bit part 0010 (raw data) following the variable length code 0110110111 retrieved in the process 48 is stored in the data register 33.
And the bit string length (10
14 bits (decoded bit string length) obtained by adding the bit string length of raw data (fixed to 4 bits) to (bit) are output to the input buffer 29. Further, in the second row of the code string shown in FIG.
When 11100111100 is passed from the input buffer 29 to the decoder 30, the variable length code 011011 searched in the process 48 is obtained.
For each of the 10 parameters, the expansion mode is the dictionary copy mode,
The relative position is 1 and the length is 5. Therefore, the decoder 30 sets the mode flag of the dictionary copy mode in the mode register 32, the value 5 of the length data in the length counter 37,
The value 1 of the relative position data is stored in the relative position register 34, and the retrieved bit string length of the variable length code 01101110, 8 bits (decoded bit string length), is input to the input buffer 2.
Output to 9. It should be noted that the decoded bit string length is output to the input buffer 29 because the unprocessed bit string in the data stored in the input buffer 29 is output after the decoder 30
This is to add data having the same bit string length as the bit string length decoded in.

【0042】デコーダ30から出力されたモードフラグ
がランレングスモードの場合は処理50を介して処理5
1に移行し、辞書コピーモードの場合は処理50を介し
て処理53に移行する。尚、デコーダ30から出力され
たモードフラグは、1つの伸長動作が完了するまでモー
ドレジスタ32に保持される。そして、1つの伸長動作
が完了したときに、デコーダ30から出力された新たな
モードフラグがモードレジスタ32に保持されて、次の
伸長動作が開始される。
When the mode flag output from the decoder 30 is the run length mode, the process 5 is executed through the process 50.
If the dictionary copy mode is selected, the process proceeds to step 53 through step 50. The mode flag output from the decoder 30 is held in the mode register 32 until one expansion operation is completed. Then, when one decompression operation is completed, the new mode flag output from the decoder 30 is held in the mode register 32, and the next decompression operation is started.

【0043】処理51では、ランレングスモードの伸長
処理を行う。尚、ランレングスモードの伸長処理では、
図20に示すように、相対位置レジスタ34及び辞書ア
ドレス計算部35は作動しない。先ず、データレジスタ
33がデコーダ30から出力された生データを保持する
と共に、長さカウンタ37がデコーダ30から出力され
た長さデータを初期値としてロードする。次に、モード
レジスタ32に保持されたランレングスのモードフラグ
に基づき、データレジスタ33に保持された生データを
セレクタ36を介して出力信号線44に出力する(動作
1)。次に、次のラインデータの伸長処理を行う際に参
照すべき辞書を作成するため、出力したデータと同じも
のを、辞書バッファ39のX,Yカウンタ38が特定す
るX,Y座標値に相当するアドレスに登録し(動作
2)、長さカウンタ37をディクリメントし(動作
3)、X,Yカウンタ38のX座標値を1つ更新する
(動作4)。尚、本実施例の場合、上述したように、
X,Yカウンタ38のX座標値の採りうる範囲は0〜1
5である。したがって、X,Yカウンタ38のX座標値
が15の場合、X座標値を1つ更新するとX座標値は0
になり、Y座標値が1つ更新される。処理52では、上
記の動作1〜動作4を、長さカウンタ37の値が0にな
るまで繰り返す。これにより、デコーダ30から出力さ
れた生データがデコーダ30から出力された長さデータ
分連続した伸長データが生成される。
In the process 51, the run length mode expansion process is performed. In the extension processing of run length mode,
As shown in FIG. 20, the relative position register 34 and the dictionary address calculator 35 do not operate. First, the data register 33 holds the raw data output from the decoder 30, and the length counter 37 loads the length data output from the decoder 30 as an initial value. Next, based on the run-length mode flag held in the mode register 32, the raw data held in the data register 33 is output to the output signal line 44 via the selector 36 (operation 1). Next, in order to create a dictionary to be referred to when the next line data is expanded, the same data as the output data corresponds to the X, Y coordinate values specified by the X, Y counter 38 of the dictionary buffer 39. The address is registered (operation 2), the length counter 37 is decremented (operation 3), and the X coordinate value of the X, Y counter 38 is updated by 1 (operation 4). In the case of this embodiment, as described above,
The possible range of the X coordinate value of the X, Y counter 38 is 0 to 1.
It is 5. Therefore, when the X coordinate value of the X, Y counter 38 is 15, the X coordinate value becomes 0 when one X coordinate value is updated.
And the Y coordinate value is updated by one. In the process 52, the above operations 1 to 4 are repeated until the value of the length counter 37 becomes zero. As a result, decompressed data in which the raw data output from the decoder 30 is continuous by the length data output from the decoder 30 is generated.

【0044】処理53では、辞書コピーモードの伸長処
理を行う。尚、辞書コピーモードの伸長処理では、図2
0に示すように、データレジスタ33は作動しない。先
ず、相対位置レジスタ53がデコーダ30から出力され
た相対位置データを保持すると共に、長さカウンタ37
がデコーダ30から出力された長さデータを初期値とし
てロードする。次に、辞書アドレス計算部35により、
X,Yカウンタ38が特定するX座標値と相対位置レジ
スタ53に保持された相対位置データに基づき、辞書バ
ッファ39に記憶されたデータのうち参照すべきデータ
のアドレスを求める(動作5)。そして、モードレジス
タ32に保持された辞書コピーのモードフラグに基づ
き、辞書バッファ39に記憶されたデータのうち辞書ア
ドレス計算部35により特定されたアドレスのデータを
セレクタ36を介して出力信号線44に出力する(動作
6)。次に、次のラインデータの伸長処理を行う際に参
照すべき辞書を作成するため、出力したデータと同じも
のを、辞書バッファ39のX,Yカウンタ38が特定す
るX,Y座標値に相当するアドレスに登録し(動作
7)、長さカウンタ37をディクリメントし(動作
8)、X,Yカウンタ38のX座標値を1つ更新する
(動作9)。処理54では、上記の動作5〜動作9を、
長さカウンタ37の値が0になるまで繰り返す。これに
より、辞書バッファ39からコピーされたデータがデコ
ーダ30から出力された長さデータ分連続した伸長デー
タが生成される。
In process 53, the dictionary copy mode expansion process is performed. It should be noted that in the expansion processing in the dictionary copy mode, as shown in FIG.
As shown at 0, the data register 33 does not work. First, the relative position register 53 holds the relative position data output from the decoder 30, and the length counter 37
Loads the length data output from the decoder 30 as an initial value. Next, the dictionary address calculation unit 35
Based on the X coordinate value specified by the X, Y counter 38 and the relative position data held in the relative position register 53, the address of the data to be referred to among the data stored in the dictionary buffer 39 is obtained (operation 5). Then, based on the dictionary copy mode flag held in the mode register 32, the data of the address specified by the dictionary address calculation unit 35 among the data stored in the dictionary buffer 39 is output to the output signal line 44 via the selector 36. Output (operation 6). Next, in order to create a dictionary to be referred to when the next line data is expanded, the same data as the output data corresponds to the X, Y coordinate values specified by the X, Y counter 38 of the dictionary buffer 39. The address is registered (operation 7), the length counter 37 is decremented (operation 8), and the X coordinate value of the X, Y counter 38 is updated by 1 (operation 9). In process 54, the above operations 5 to 9 are performed.
Repeat until the value of the length counter 37 becomes zero. As a result, decompressed data in which the data copied from the dictionary buffer 39 is continuous by the length data output from the decoder 30 is generated.

【0045】処理55では、入力バッファ29に貯えら
れたビット列の先頭からデコーダ30でデコードされた
ビット列を捨てる。そして、伸長すべきデータが未だあ
る場合は処理47に戻り、ない場合はこのフローを終了
する(処理56)。
In the process 55, the bit string decoded by the decoder 30 from the head of the bit string stored in the input buffer 29 is discarded. Then, if there is still data to be decompressed, the process returns to the process 47, and if not, the flow ends (process 56).

【0046】上記圧縮の実施例では、最大検出列長Nの
範囲内で辞書上に存在する最長部分列を辞書参照範囲内
から検索し、符号化しているが、その他にも、辞書上に
存在する最長部分列を複数の部分列に分割した後、他の
部分列と合成することにより、最大検出列長Nの範囲内
で部分列を作成し、これを圧縮する場合や、最長ではな
い部分列を組み合わせることにより、最大検出列長Nの
範囲内で部分列を作成し、これを圧縮する場合などが考
えられる。
In the above-described embodiment of compression, the longest subsequence existing in the dictionary within the range of the maximum detected sequence length N is searched from the dictionary reference range and coded, but in addition, it exists in the dictionary. When the longest subsequence is divided into a plurality of subsequences and then combined with other subsequences to create a subsequence within the range of the maximum detected sequence length N, and when compressing this, a non-longest subsequence A case may be considered in which, by combining columns, a partial column is created within the range of the maximum detected column length N and this is compressed.

【0047】前者の場合、例えば、図4(b)の部分列
bを図4(c)の2つの部分列c「5543」と部分列
d「4」に分割し、部分列d「4」と2行5列の「3」
を合成し部分列e「43」とする。部分列cの符号は
{0,1,4}、部分列e「43」は1ライン前の1行
4列に続く「43」と一致しているので、符号は{1,
−1,2}となる。従って、2行目の符号は{0,1,
4}{1,−1,2}[1,5,1][1,4,1]
{1,0,3}[4,5,2][6,A,3](この符
号を符号aとする)となる。後者の場合は、例えば、2
行0列では相対位置0の部分列「55」を選択し、2行
2列では相対位置+1の部分列「434」を選択する。
これにより、2行目の符号は、{0,0,2}{1,
1,3}{1,−1,1}[1,5,1][1,4,
1]{1,0,3}[4,5,2][6,A,3](こ
の符号を符号bとする)となる。
In the former case, for example, the partial sequence b in FIG. 4B is divided into two partial sequences c "5543" and partial sequence d "4" in FIG. 4C, and the partial sequence d "4" is obtained. And "3" in 2 rows and 5 columns
Are combined to form a subsequence e “43”. The code of the subsequence c is {0, 1, 4}, and the subsequence e "43" is the same as "43" following one row and four columns one line before, so the code is {1,
-1,2}. Therefore, the codes in the second line are {0, 1,
4} {1, -1,2} [1,5,1] [1,4,1]
{1,0,3} [4,5,2] [6, A, 3] (this code is code a). In the latter case, for example, 2
In the row 0 column, the partial column “55” at the relative position 0 is selected, and in the 2nd row 2 column, the partial column “434” at the relative position +1 is selected.
As a result, the code in the second line is {0,0,2} {1,
1,3} {1, -1,1} [1,5,1] [1,4
1] {1,0,3} [4,5,2] [6, A, 3] (this code is code b).

【0048】ここで、上記圧縮の実施例で示した図4
(a)の2行目に対する符号が実施例を含め3パターン
できたことになる。図5の2行目の符号を符号cとす
る。これらの符号a、b、cを図6乃至図14に示した
実際の符号に割り当ててみると、符号aが49ビット、
符号bが50ビット、符号cが48ビットとなり、符号
cの効率が良い。しかし、図6乃至図14のテーブルに
示した以外の符号を符号a、b、cに割り当てた場合
は、また違った結果になり、符号aや符号bが最短の符
号になる場合も考えられる。従って、最大検出列長Nの
範囲内で最長部分列を検索し、符号化することが必ずし
も最良ではなく、実際の符号を割り当てた時に最短にな
る辞書上の部分列の組み合わせを最大検出列長Nの範囲
内で作成し、選択したほうが好ましい。
Here, FIG. 4 shown in the above-mentioned compression embodiment.
The code for the second line in (a) has three patterns including the embodiment. The code on the second line in FIG. 5 is code c. When these codes a, b, and c are assigned to the actual codes shown in FIGS. 6 to 14, the code a is 49 bits,
Since the code b is 50 bits and the code c is 48 bits, the efficiency of the code c is good. However, when codes other than those shown in the tables of FIGS. 6 to 14 are assigned to the codes a, b, and c, different results are obtained, and the code a or the code b may be the shortest code. . Therefore, it is not always best to search for and encode the longest subsequence within the range of the maximum detection sequence length N, and the combination of subsequences in the dictionary that is the shortest when the actual code is assigned is the maximum detection sequence length. It is preferable to make it within the range of N and select it.

【0049】上記のように符号が最短になるように辞書
上の部分列の組み合わせ方を変更しても、符号化のルー
ル(注目画素の現ライン上での位置xから求めたTの値
と、直前ラインでの同一部分列の先頭位置と、長さとを
用いる)が変わらないのであれば、データ伸長方式に影
響を及ぼすことはない。
Even if the way of combining the partial strings in the dictionary is changed so that the code becomes the shortest as described above, the coding rule (the value of T obtained from the position x of the target pixel on the current line and , The head position of the same subsequence on the immediately preceding line and the length are not changed), the data decompression method is not affected.

【0050】[0050]

【発明の効果】以上詳細に説明したように、本発明によ
れば、辞書の容量は直前ラインのみを格納すれば良いの
で非常に小さく、類似度の高い範囲内で辞書を参照し、
最大検出列長の範囲内でできるだけ長い部分列を参照す
るので、圧縮率が高く且つ圧縮及び伸長を高速に処理す
ることが可能である。また、2次元画像データの1ライ
ンの画素数をH、最大検出列長をN(1≦N≦H)、注
目画素の現ライン上での先頭画素からの位置をx(0≦
x≦H−1)とすると共に、x=0のときはT=0、1
≦x≦H−NのときはT=1、H−N+1≦x≦H−1
のときはT=x−H+N+1、とし、Tの各値毎に、直
前ライン上での部分列の先頭画素と注目画素との相対位
置と、直前ライン上での部分列の長さとに応じて異なる
コードが割り当てられたテーブルを用意し、注目画素の
現ライン上での先頭画素からの位置xに基づいてTの値
を求め、このTの値に応じて選択したテーブルから、相
対位置と部分列の長さに応じたコードを出力することに
よりデータ圧縮を行うので、各テーブルを予め圧縮伸長
するデータに合わせて構成されたハフマン符号のテーブ
ル、あるいは、圧縮伸長に伴い、冗長性が少なくなるよ
うに最適化されていくテーブルとすることにより、更
に、高い圧縮率が得られる。さらに、画像データの1ラ
イン目や辞書参照が不可能な部分列にランレングス圧縮
などを適用することで、更に、より高い圧縮率が得られ
る。加えて、Tの採りうる値は常に0≦T≦最大検出列
長Nとなるので、2次元画像データの1ラインの画素数
Hを増加したときに、テーブルの容量が増大して圧縮・
伸長速度が低下するのを防止することができる。
As described above in detail, according to the present invention, the capacity of the dictionary is very small because it is necessary to store only the immediately preceding line, and the dictionary is referred to within a range of high similarity.
Since a subsequence as long as possible within the range of the maximum detection sequence length is referred to, the compression rate is high and the compression and decompression can be processed at high speed. Further, the number of pixels in one line of the two-dimensional image data is H, the maximum detection column length is N (1 ≦ N ≦ H), and the position of the target pixel on the current line from the first pixel is x (0 ≦
x ≦ H−1), and when x = 0, T = 0, 1
When ≦ x ≦ H−N, T = 1, H−N + 1 ≦ x ≦ H−1
In the case of, T = x−H + N + 1, and for each value of T, the relative position between the leading pixel of the subsequence on the immediately preceding line and the target pixel and the length of the subsequence on the immediately preceding line are determined. A table to which different codes are assigned is prepared, the value of T is obtained based on the position x of the pixel of interest from the head pixel on the current line, and the relative position and the portion are selected from the table selected according to this value of T. Data compression is performed by outputting a code according to the length of the column, so that each table has a Huffman code table configured in advance according to the data to be compressed / decompressed, or redundancy is reduced with compression / decompression. By using a table that is optimized as described above, a higher compression rate can be obtained. Furthermore, by applying run-length compression or the like to the first line of the image data or the partial sequence that cannot be referred to the dictionary, a higher compression rate can be obtained. In addition, since the value that T can take is always 0 ≦ T ≦ maximum detection column length N, when the number H of pixels in one line of the two-dimensional image data is increased, the capacity of the table increases and compression / compression occurs.
It is possible to prevent the extension speed from decreasing.

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

【図1】2次元画像データ示す説明図である。FIG. 1 is an explanatory diagram showing two-dimensional image data.

【図2】データ圧縮回路の構成例を示す図である。FIG. 2 is a diagram illustrating a configuration example of a data compression circuit.

【図3】データ圧縮の動作の流れを説明するための図で
ある。
FIG. 3 is a diagram for explaining a flow of a data compression operation.

【図4】圧縮前の画像データを示す説明図である。FIG. 4 is an explanatory diagram showing image data before compression.

【図5】圧縮後の画像データを示す説明図である。FIG. 5 is an explanatory diagram showing image data after compression.

【図6】T=0のテーブルを表した図である。FIG. 6 is a diagram showing a table of T = 0.

【図7】T=1のテーブルを表した図である。FIG. 7 is a diagram showing a table of T = 1.

【図8】T=2のテーブルを表した図である。FIG. 8 is a diagram showing a table of T = 2.

【図9】T=3のテーブルを表した図である。FIG. 9 is a diagram showing a table of T = 3.

【図10】T=4のテーブルを表した図である。FIG. 10 is a diagram showing a table of T = 4.

【図11】T=5のテーブルを表した図である。FIG. 11 is a diagram showing a table of T = 5.

【図12】T=6のテーブルを表した図である。FIG. 12 is a diagram showing a table of T = 6.

【図13】T=7のテーブルを表した図である。FIG. 13 is a diagram showing a table of T = 7.

【図14】T=8のテーブルを表した図である。FIG. 14 is a diagram showing a table of T = 8.

【図15】実際の符号を割り当てた圧縮後の画像データ
示す説明図である。
FIG. 15 is an explanatory diagram showing compressed image data to which actual codes are assigned.

【図16】データ伸長回路の構成例を示す図である。FIG. 16 is a diagram showing a configuration example of a data expansion circuit.

【図17】データ伸長の動作の流れを説明するための図
である。
FIG. 17 is a diagram for explaining the flow of a data decompression operation.

【図18】データ伸長の動作の流れを説明するための図
である。
FIG. 18 is a diagram for explaining the flow of a data decompression operation.

【図19】ランレングスモードにおけるデータ伸長回路
の動作を説明するための図である。
FIG. 19 is a diagram for explaining the operation of the data decompression circuit in the run length mode.

【図20】辞書コピーモードにおけるデータ伸長回路の
動作を説明するための図である。
FIG. 20 is a diagram for explaining the operation of the data expansion circuit in the dictionary copy mode.

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

1 辞書 2 圧縮対象部分列 3 辞書上の部分列 4 先頭位置 5 注目画素 17 ラインバッファ入力信号線 18 辞書バッファ入力信号線 19 符号出力信号線 43 入力信号線 44 出力信号線 1 dictionary 2 compression target partial sequence 3 partial sequence on dictionary 4 start position 5 target pixel 17 line buffer input signal line 18 dictionary buffer input signal line 19 code output signal line 43 input signal line 44 output signal line

─────────────────────────────────────────────────────
─────────────────────────────────────────────────── ───

【手続補正書】[Procedure amendment]

【提出日】平成6年11月25日[Submission date] November 25, 1994

【手続補正1】[Procedure Amendment 1]

【補正対象書類名】明細書[Document name to be amended] Statement

【補正対象項目名】0031[Correction target item name] 0031

【補正方法】変更[Correction method] Change

【補正内容】[Correction content]

【0031】図4(a)の1行目の処理は、0行目を辞
書として扱う。(0,1)と(0,0)を比較し一致し
ないので、次に(0,1)と(1,0)と比較し、これ
も一致しないので、辞書には一致する部分列がないと判
断し、ランレングス圧縮を適用する。(0,1)から
(2,1) のデータは5で同じであるので符号は[0,
5,3]となる。(3,1)の4は(2,0)、(3,
0)、(4,0)のいずれとも一致しないので、ランレ
ングス圧縮を適用し、符号は[1,4,1]となる。
(4,1)の3は(3,0)、(4,0)、(5,0)
の中の(4,0)と一致し、(4,1)から(5,1)
と辞書の(4,0)から(5,0)が一致するので、符
号は{1,0,2}となる。(6,1)と(7,1)は
それぞれ辞書のデータと一致しないので符号は、それぞ
れ[1,1,1]、[1,3,1]となる。(8,1)
のCは(7,0)、(8,0)、(9,0)の中の
(9,0)と一致し、(8,1)から(9,1)と辞書
の(9,0)から(A,0)が一致するので、符号は
{1,1,2}となる。(A,1)のCは(9,0)、
(A,0)、(B,0)の中の(9,0)及び(A,
0)と一致する。ここで、(B,1)と(A,0)は一
致しないが、(A,1)から(C,1)と辞書の(A,
0)から(C,0)は一致するので、符号は{3,0,
3}となる。(D,1)の6は(C,0)、(D,
0)、(E,0)の中の(C,0)と一致し、(D,
1)から(F,1)と辞書の(C,0)から(E,0)
は一致するので、符号は{6,−1,3}となる。した
がって、1行目の符号は、図5の1行目に示すように、
[0,5,3][1,4,1]{1,0,2}[1,
1,1][1,3,1]{1,1,2}{3,0,3}
{6,−1,3}となる。
In the processing of the first line in FIG. 4A, the 0th line is treated as a dictionary. Since (0,1) and (0,0) are compared and do not match, the next comparison is made with (0,1) and (1,0), which also does not match, so there is no matching subsequence in the dictionary. Then, run length compression is applied. Since the data from (0,1) to (2,1) is the same as 5, the code is [0,
5, 3]. 4 in (3,1) is (2,0), (3,1)
Since it does not match either 0) or (4,0), run length compression is applied and the code becomes [1,4,1].
3 in (4,1) is (3,0), (4,0), (5,0)
Matches (4,0) in (4,1) to (5,1)
Since (4,0) to (5,0) in the dictionary match, the code is {1,0,2}. Since (6,1) and (7,1) do not match with the dictionary data, the codes are [1,1,1] and [1,3,1], respectively. (8,1)
C of (7,0), (8,0), matches (9,0) in (9,0), and (8,1) to (9,1) and (9,0) in the dictionary. ) To (A, 0) match, the code is {1,1,2}. C of (A, 1) is (9,0),
(A, 0), (9,0) in (B, 0) and (A,
0). Here, (B, 1) and (A, 0) do not match, but (A, 1) to (C, 1) and (A,
Since 0) to (C, 0) match, the code is {3, 0,
3}. 6 of (D, 1) is (C, 0), (D,
0), (E, 0) in (C, 0), and (D,
1) to (F, 1) and dictionary (C, 0) to (E, 0)
Match, so the code is {6, -1, 3}. Therefore, the code in the first line is as shown in the first line in FIG.
[0,5,3] [1,4,1] {1,0,2} [1,
1,1] [1,3,1] {1,1,2} {3,0,3}
It becomes {6, -1,3} .

Claims (14)

【特許請求の範囲】[Claims] 【請求項1】 順次スキャンされる2次元画像データに
対して直前ラインのデータを参照し、現ラインに直前ラ
インと少なくとも1画素分以上同じ部分データ列を検出
した場合に圧縮処理を行う2次元画像データの圧縮方式
において、 前記2次元画像データの1ラインの画素数をH、前記部
分データ列の最大検出列長をN(1≦N≦H)、注目画
素の現ライン上での先頭画素からの位置をx(0≦x≦
H−1)とすると共に、x=0のときはT=0、1≦x
≦H−NのときはT=1、H−N+1≦x≦H−1のと
きはT=x−H+N+1、とし、 前記Tの各値毎に、直前ライン上での前記部分データ列
の先頭画素と前記注目画素との相対位置と、前記部分デ
ータ列の長さとに応じて異なるコードが割り当てられた
テーブルを用意し、 現ラインに直前ラインと少なくとも1画素分以上同じ部
分データ列を検出した場合に、前記注目画素の現ライン
上での位置xに基づいて前記Tの値を求め、このTの値
に基づき対応する前記テーブルを選択し、直前ライン上
での部分データ列の先頭位置と長さとに応じたコードを
出力することを特徴とするデータ圧縮方式。
1. A two-dimensional compression process is performed when the data of the immediately preceding line is referred to for sequentially scanned two-dimensional image data and a partial data string which is the same as the immediately preceding line by at least one pixel is detected in the current line. In the image data compression method, the number of pixels in one line of the two-dimensional image data is H, the maximum detection column length of the partial data sequence is N (1 ≦ N ≦ H), and the first pixel of the target pixel on the current line From x to x (0 ≦ x ≦
H-1), and when x = 0, T = 0, 1 ≦ x
When ≦ H−N, T = 1, and when H−N + 1 ≦ x ≦ H−1, T = x−H + N + 1. For each value of T, the beginning of the partial data string on the immediately preceding line. A table to which different codes are assigned according to the relative position of the pixel and the pixel of interest and the length of the partial data string is prepared, and the same partial data string is detected in the current line as at least one pixel or more from the immediately preceding line. In this case, the value of T is obtained based on the position x of the pixel of interest on the current line, the corresponding table is selected based on the value of T, and the start position of the partial data string on the immediately previous line is selected. A data compression method that outputs a code according to the length.
【請求項2】 請求項1記載の発明において、前記テー
ブルは、現ラインの入力データの注目画素と1ライン前
の同一部分データ列の先頭画素との相対位置として、少
なくとも同一画素位置の場合、一画素左にずれた場合、
および一画素右にずれた場合の異なる3つの場合のコー
ドが可変長符号で記憶されていることを特徴とするデー
タ圧縮方式。
2. The invention according to claim 1, wherein the table is at least the same pixel position as a relative position between the target pixel of the input data of the current line and the head pixel of the same partial data string one line before, If it shifts to the left by one pixel,
And a code for three different cases in which one pixel is shifted to the right, are stored as variable-length codes.
【請求項3】 請求項1又は2記載の発明において、現
ラインに直前ラインと同じ部分データ列を検出できなか
った場合に、前記Tの各値毎に用意された、連続する同
一データの長さに応じて異なるコードが割り当てられた
ランレングステーブルを参照し、対応するコードを出力
することを特徴とするデータ圧縮方式。
3. The invention according to claim 1 or 2, wherein if the same partial data string as the immediately preceding line cannot be detected in the current line, the length of continuous identical data prepared for each value of T A data compression method characterized in that a corresponding code is output by referring to a run length table to which a different code is assigned according to the size.
【請求項4】 請求項3記載の発明において、前記ラン
レングステーブルに記憶されたコードは、前記テーブル
に記憶されたコードと異なるコードが割り当てられてい
ることを特徴とするデータ圧縮方式。
4. The data compression method according to claim 3, wherein a code different from the code stored in the run length table is assigned to the code stored in the run length table.
【請求項5】 請求項4記載の発明において、前記テー
ブルと前記ランレングステーブルとを一体とし、相対位
置として同一画素位置の場合、一画素左にずれた場合、
一画素右にずれた場合の異なる3つの場合の同一部分デ
ータ列の長さのコードと、ランレングスの場合の連続す
る同一データの長さのコードとが互いに異なる可変長符
号で記憶されていることを特徴とするデータ圧縮方式。
5. The invention according to claim 4, wherein the table and the run-length table are integrated and the relative position is the same pixel position, or the pixel is shifted to the left by one pixel,
Codes of the same partial data string length in three different cases when shifted to the right by one pixel and codes of the same continuous data length in the case of run length are stored as different variable length codes. A data compression method characterized in that
【請求項6】 順次スキャンされる2次元画像データに
対して直前ラインのデータを参照し、現ラインに直前ラ
インと少なくとも1画素分以上同じ部分データ列を検出
した場合に、重複する部分の圧縮データとして、前記2
次元画像データの1ラインの画素数をH、前記部分デー
タ列の最大検出列長をN(1≦N≦H)、注目画素の現
ライン上での先頭画素からの位置をx(0≦x≦H−
1)とすると共に、x=0のときはT=0、1≦x≦H
−NのときはT=1、H−N+1≦x≦H−1のときは
T=x−H+N+1とし、前記Tの各値毎に、直前ライ
ン上での前記部分データ列の先頭画素と前記注目画素と
の相対位置と、長さとに応じて異なるコードが順次入力
される2次元画像圧縮データの伸長方式であって、 少なくとも直前ラインの伸長されたデータをバッファに
保持し、 伸長しようとする前記注目画素の現ライン上での位置x
に基づいて前記Tの値を求め、このTの値に基づき、前
記Tの各値毎に用意された、前記相対位置と前記長さと
に応じて異なるコードが割り当てられたテーブルから対
応するテーブルを選択し、 入力された圧縮データから前記コードを抽出し、このコ
ードに基づいて選択されたテーブルを参照し、入力され
た現ラインのデータに対して、前記バッファから前記部
分データ列の先頭位置に対応するビットに続く前記部分
データ列の長さ分のデータを抽出し、伸長データとして
出力することを特徴とするデータ伸長方式。
6. When the data of the immediately preceding line is referred to for sequentially scanned two-dimensional image data and a partial data string that is the same as the immediately preceding line for at least one pixel or more is detected in the current line, compression of the overlapping part is performed. As data, 2
The number of pixels in one line of the dimensional image data is H, the maximum detection column length of the partial data column is N (1 ≦ N ≦ H), and the position of the target pixel on the current line from the first pixel is x (0 ≦ x ≤H-
1), and when x = 0, T = 0, 1 ≦ x ≦ H
In the case of −N, T = 1, and in the case of H−N + 1 ≦ x ≦ H−1, T = x−H + N + 1, and for each value of T, the head pixel of the partial data string on the immediately preceding line and the above This is a decompression method for two-dimensional image compression data in which different codes are sequentially input according to the relative position with respect to the pixel of interest and the length, and at least the decompressed data of the immediately preceding line is held in a buffer to try to decompress Position x of the target pixel on the current line
The value of T is obtained based on the value of T, and based on the value of T, a corresponding table is prepared from a table prepared for each value of T and to which different codes are assigned according to the relative position and the length. Select and extract the code from the input compressed data, refer to the table selected based on this code, and input the current line data from the buffer to the beginning position of the partial data string. A data decompression method, wherein data corresponding to the length of the partial data string following the corresponding bit is extracted and output as decompression data.
【請求項7】 送信側において、順次スキャンされる2
次元画像データに対して直前ラインのデータを参照し、
現ラインに直前ラインと少なくとも1画素分以上同じ部
分データ列を検出した場合に、直前ライン上にある前記
部分データ列の先頭画素と現ライン上にある注目画素と
の相対位置と、前記部分データ列の長さとを求め、前記
2次元画像データの1ラインの画素数をH、前記部分デ
ータ列の最大検出列長をN(1≦N≦H)、注目画素の
現ライン上での位置をx(0≦x≦H−1)とすると共
に、x=0のときはT=0、1≦x≦H−NのときはT
=1、H−N+1≦x≦H−1のときはT=x−H+N
+1とし、前記Tの各値毎に用意された、前記相対位置
と前記長さとに応じて異なるコードが割り当てられたテ
ーブルを参照し、対応するコードを圧縮データとして出
力し、 受信側において、少なくとも直前ラインの伸長されたデ
ータをバッファに保持し、 伸長しようとする圧縮データの注目画素の現ライン上で
の先頭画素からの位置xに基づいて前記Tの値を求め、
このTの値に対応する前記テーブルを選択し、 入力された圧縮データから前記コードを抽出し、このコ
ードに基づいて選択されたテーブルを参照し、入力され
た現ラインのデータに対して、前記バッファから前記部
分データ列の先頭位置に対応するビットに続く前記部分
データ列の長さ分のデータを抽出し、伸長データとして
出力することを特徴とするデータ圧縮・伸長方式。
7. The transmission side sequentially scans 2
Refer to the data of the previous line for 3D image data,
When a partial data string that is the same as the previous line and at least one pixel is detected in the current line, the relative position between the leading pixel of the partial data string on the previous line and the target pixel on the current line, and the partial data The column length is obtained, the number of pixels in one line of the two-dimensional image data is H, the maximum detected column length of the partial data column is N (1 ≦ N ≦ H), and the position of the target pixel on the current line is x (0 ≦ x ≦ H−1), and T = 0 when x = 0, and T when 1 ≦ x ≦ H−N.
= 1 and H-N + 1≤x≤H-1, T = x-H + N
+1 and refers to a table prepared for each value of T, to which different codes are assigned according to the relative position and the length, outputs the corresponding code as compressed data, and at least at the receiving side. The decompressed data of the immediately preceding line is held in the buffer, and the value of T is obtained based on the position x from the head pixel on the current line of the pixel of interest of the compressed data to be decompressed,
The table corresponding to the value of T is selected, the code is extracted from the input compressed data, the table selected based on this code is referred to, and the data of the input current line is extracted from the table. A data compression / decompression method, wherein data corresponding to the length of the partial data string following the bit corresponding to the head position of the partial data string is extracted from the buffer and output as decompressed data.
【請求項8】 請求項7において、前記テーブルは、現
ラインの入力データの注目画素と1ライン前の同一部分
データ列の先頭画素のと相対位置として、少なくとも同
一画素位置の場合、一画素左にずれた場合、および一画
素右にずれた場合の異なる3つの場合のコードが記憶さ
れていることを特徴とするデータ圧縮・伸長方式。
8. The table according to claim 7, wherein the table is at least one pixel left when the target pixel of the input data of the current line and the leading pixel of the same partial data string one line before are at least at the same pixel position. A data compression / decompression method characterized in that codes for three different cases are stored, which are different in the case of shifting to, and in the case of shifting to the right by one pixel.
【請求項9】 順次入力される2次元画像データに対し
て1ライン前のデータを保持する参照メモリ手段と、 入力された現ラインの信号から、所定の長さの範囲内で
連続する複数のデータ列を抽出し圧縮対象部分データ列
として記憶するバッファ手段と、 前記参照メモリ手段に記憶されたデータに、前記圧縮対
象部分データ列の注目画素に続く部分データ列と同じ部
分データ列が存在するか否かを検出する走査比較手段
と、 前記走査比較手段が同じ部分データ列を検出した場合
に、前記参照メモリ手段に記憶された1ライン前のデー
タ上での前記部分データ列の先頭画素と前記注目画素と
の相対位置と、前記部分データ列の長さとを求め、前記
2次元画像データの1ラインの画素数をH、前記部分デ
ータ列の最大検出列長をN(1≦N≦H)、注目画素の
現ライン上での先頭画素からの位置をx(0≦x≦H−
1)とすると共に、x=0のときはT=0、1≦x≦H
−NのときはT=1、H−N+1≦x≦H−1のときは
T=x−H+N+1、とし、前記Tの各値毎に用意され
た、前記相対位置と前記部分データ列の長さとに応じて
異なるコードが割り当てられたテーブルを参照し、対応
するコードを現ラインのその部分データ列の圧縮データ
として出力する符号生成手段と、 を備えたことを特徴とするデータ圧縮装置。
9. A reference memory means for holding data of one line before for sequentially input two-dimensional image data, and a plurality of consecutive memory devices within a predetermined length from the input current line signal. Buffer means for extracting a data string and storing it as a compression target partial data string, and data stored in the reference memory means has a partial data string that is the same as the partial data string following the pixel of interest of the compression target partial data string. And a first pixel of the partial data string on the data one line before stored in the reference memory means when the scanning and comparing means detects the same partial data string. The relative position with respect to the pixel of interest and the length of the partial data string are obtained, the number of pixels in one line of the two-dimensional image data is H, and the maximum detection string length of the partial data string is N (1 ≦ N ≦ H ) , The position of the pixel of interest from the first pixel on the current line is x (0 ≦ x ≦ H−
1), and when x = 0, T = 0, 1 ≦ x ≦ H
When N, T = 1, and when H−N + 1 ≦ x ≦ H−1, T = x−H + N + 1, and the relative position and the length of the partial data string prepared for each value of T. A data compression apparatus comprising: a code generation unit that refers to a table to which a different code is assigned in accordance with the above, and outputs the corresponding code as compressed data of the partial data string of the current line.
【請求項10】 請求項9において、前記テーブルは、
現ラインの入力データの注目画素と1ライン前の同一部
分データ列の先頭画素との相対位置として、少なくとも
同一画素位置の場合、一画素左にずれた場合、一画素右
にずれた場合の異なる3つの場合の可変長符号コードが
記憶されていることを特徴とするデータ圧縮装置。
10. The table according to claim 9, wherein the table is
The relative position between the pixel of interest of the input data of the current line and the leading pixel of the same partial data string one line before is at least the same pixel position, one pixel left, and one pixel right different. A data compression device in which variable-length code codes for three cases are stored.
【請求項11】 請求項9又は10において、現ライン
に直前ラインと同じ部分データ列を検出できなかった場
合に、前記Tの各値毎に用意された、連続する同一デー
タの長さに応じて異なる可変長符号コードが割り当てら
れたランレングステーブルを参照し、対応するコードを
出力することを特徴とするデータ圧縮装置。
11. The method according to claim 9 or 10, wherein when the same partial data string as that of the immediately preceding line cannot be detected in the current line, the length of continuous identical data prepared for each value of T is changed. The data compression device is characterized by referring to a run length table to which different variable-length code codes are assigned and outputting the corresponding code.
【請求項12】 請求項11において、前記ランレング
ステーブルに記憶された可変長符号コードは前記テーブ
ルの記憶された可変長符号コードとは異なる可変長符号
コードが割り当てられていることを特徴とするデータ圧
縮装置。
12. The variable length code code stored in the run length table is assigned a variable length code code different from the variable length code code stored in the table. Data compression device.
【請求項13】 順次入力される2次元画像データに対
して直前データを参照し、現ラインに直前ラインと少な
くとも1画素分以上同じ部分データ列を検出した場合
に、重複する部分の圧縮データとして、前記2次元画像
データの1ラインの画素数をH、前記部分データ列の最
大検出列長をN(1≦N≦H)、注目画素の現ライン上
での先頭画素からの位置をx(0≦x≦H−1)とする
と共に、x=0のときはT=0、1≦x≦H−Nのとき
はT=1、H−N+1≦x≦H−1のときはT=x−H
+N+1とし、前記Tの各値毎に、直前ライン上での前
記部分データ列の先頭画素と前記注目画素との相対位置
と、長さとに応じて異なるコードが順次入力される2次
元画像圧縮データの伸長装置であって、 1ライン前の伸長されたデータを保持するバッファメモ
リ手段と、 前記Tの各値毎に用意された、前記コードに応じて直前
ライン上での前記部分データ列の先頭画素と前記注目画
素との相対位置と、前記部分データ列の長さとが割り当
てられた逆変換テーブルと、 伸長しようとする圧縮データの注目画素の現ライン上に
おける先頭画素からの位置xに基づいて前記Tの値を求
め、このTの値に対応する前記逆変換テーブルを選択
し、入力されたデータから前記コードを抽出し、前記コ
ードに基づいて選択された前記逆変換テーブルを参照
し、前記逆変換テーブルから直前ライン上での前記部分
データ列の先頭位置と長さとのデータを取り出し、前記
バッファメモリ手段から前記部分データ列の先頭位置に
対応するビットに続く前記部分データ列の長さ分のデー
タを抽出し、伸長データとして出力する復号手段と、 を備えたことを特徴とするデータ伸長装置。
13. When the immediately preceding data is referred to for sequentially input two-dimensional image data and a partial data string that is the same as the immediately preceding line by at least one pixel or more is detected in the current line, the compressed data of the overlapping part is obtained. , The number of pixels in one line of the two-dimensional image data is H, the maximum detection column length of the partial data column is N (1 ≦ N ≦ H), and the position of the target pixel on the current line from the first pixel is x ( 0 ≦ x ≦ H−1), T = 0 when x = 0, T = 1 when 1 ≦ x ≦ H−N, and T = when H−N + 1 ≦ x ≦ H−1. x-H
+ N + 1, and for each value of T, two-dimensional image compression data in which different codes are sequentially input according to the relative position between the leading pixel of the partial data string and the target pixel on the immediately preceding line and the length. A buffer memory means for holding the decompressed data of one line before, and the head of the partial data string on the immediately preceding line prepared for each value of T according to the code. Based on the inverse conversion table to which the relative position between the pixel and the target pixel and the length of the partial data string are assigned, and the position x of the target pixel of the compressed data to be expanded from the first pixel on the current line The value of T is obtained, the inverse conversion table corresponding to the value of T is selected, the code is extracted from the input data, and the inverse conversion table selected based on the code is selected. The data of the starting position and the length of the partial data string on the immediately preceding line is taken out from the inverse conversion table, and the partial data string following the bit corresponding to the starting position of the partial data string from the buffer memory means. A data decompression device, comprising: a decoding unit that extracts data corresponding to the length and outputs the decompressed data as decompression data.
【請求項14】 順次入力される2次元画像データに対
して直前ラインのデータを参照し、現ラインに直前ライ
ンと少なくとも1画素分以上同じ部分データ列を検出し
た場合には、重複する部分の圧縮データとして、前記2
次元画像データの1ラインの画素数をH、前記部分デー
タ列の最大検出列長をN(1≦N≦H)、注目画素の現
ライン上での先頭画素からの位置をx(0≦x≦H−
1)とすると共に、x=0のときはT=0、1≦x≦H
−NのときはT=1、H−N+1≦x≦H−1のときは
T=x−H+N+1とし、前記Tの各値毎に、直前ライ
ン上での前記部分データ列の先頭画素と前記注目画素と
の相対位置と、長さとに応じて異なるコードが順次入力
され、また、現ラインに直前ラインと同じ部分データ列
を検出できなかった場合には、ランレングスの圧縮デー
タとして、前記Tの各値毎に、連続する同一データの長
さに応じて異なるコードとその同一データが順次入力さ
れる2次元画像圧縮データの伸長装置であって、 伸長しようとする圧縮データの注目画素の現ライン上に
おける先頭画素からの位置xを計数するカウンタと、 1ライン前の伸長されたデータを保持するバッファメモ
リ手段と、 前記Tの値毎に用意された、入力されるコードに応じ
て、直前ライン上での前記部分データ列の先頭画素と前
記注目画素との相対位置と、前記部分データ列の長さと
のデータ、またはランレングス長が割り当てられた逆変
換テーブルと、 前記カウンタの計数値によって計数された前記注目画素
の現ライン上での先頭画素からの位置xに基づいて前記
Tの値を求め、このTの値に対応する前記逆変換テーブ
ルを選択し、入力されたデータから前記コードを抽出
し、前記コードに基づいて選択された前記逆変換テーブ
ルを参照し、現ラインに直前ラインと同じ部分データ列
を検出したか否かを識別するモードフラグを出力すると
共に、前記逆変換テーブルから前記相対位置及び長さの
データ、又は連続する同一データの長さのデータを取り
出すデコーダと、 現ラインに直前ラインと同じ部分データ列を検出した場
合に、前記バッファメモリ手段から前記相対位置に対応
するビットに続く前記部分データ列の長さ分のデータを
抽出し、伸長データとして出力する第1の復号手段と、 現ラインに直前ラインと同じ部分データ列を検出できな
かった場合に、前記コードに続くデータを連続する同一
データの長さ分だけ連続して出力する第2の復号手段
と、 を備えたことを特徴とするデータ伸長装置。
14. When the data of the immediately preceding line is referred to for sequentially input two-dimensional image data and a partial data string which is the same as that of the immediately preceding line by at least one pixel or more is detected in the current line, an overlapping part is detected. 2 as the compressed data
The number of pixels in one line of the dimensional image data is H, the maximum detection column length of the partial data column is N (1 ≦ N ≦ H), and the position of the target pixel on the current line from the first pixel is x (0 ≦ x ≤H-
1), and when x = 0, T = 0, 1 ≦ x ≦ H
In the case of −N, T = 1, and in the case of H−N + 1 ≦ x ≦ H−1, T = x−H + N + 1, and for each value of T, the head pixel of the partial data string on the immediately preceding line and the above If different codes are sequentially input according to the relative position with respect to the pixel of interest and the length, and if the same partial data string as the previous line cannot be detected in the current line, the above-mentioned T A two-dimensional image compression data decompression device in which different codes and the same data are sequentially input according to the length of consecutive identical data for each value of, and the current pixel of interest of the compressed data to be decompressed. A counter for counting the position x from the first pixel on the line, a buffer memory means for holding the decompressed data one line before, and a previous code corresponding to the input code prepared for each value of T line At the relative position between the first pixel of the partial data string and the pixel of interest, and the data of the length of the partial data string, or an inverse conversion table to which the run length is assigned, and is counted by the count value of the counter. The value of T is obtained based on the position x of the pixel of interest from the first pixel on the current line, the inverse conversion table corresponding to the value of T is selected, and the code is extracted from the input data. Then, the inverse conversion table selected based on the code is referred to, and a mode flag for identifying whether or not the same partial data string as the immediately preceding line is detected in the current line is output from the inverse conversion table. When a decoder that retrieves data of relative position and length, or data of the same continuous data length, and the same partial data string as the previous line is detected on the current line First decoding means for extracting data of the length of the partial data string following the bit corresponding to the relative position from the buffer memory means and outputting it as decompressed data; A second decoding means for continuously outputting the data following the code by the length of the same continuous data when the data string cannot be detected;
JP6244741A 1994-09-12 1994-09-12 Two-dimensional image data compression method and decompression method Pending JPH0884260A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
JP6244741A JPH0884260A (en) 1994-09-12 1994-09-12 Two-dimensional image data compression method and decompression method
US08/526,663 US5883975A (en) 1994-09-12 1995-09-11 Compression and decompression methods on two-dimensional image data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP6244741A JPH0884260A (en) 1994-09-12 1994-09-12 Two-dimensional image data compression method and decompression method

Publications (1)

Publication Number Publication Date
JPH0884260A true JPH0884260A (en) 1996-03-26

Family

ID=17123208

Family Applications (1)

Application Number Title Priority Date Filing Date
JP6244741A Pending JPH0884260A (en) 1994-09-12 1994-09-12 Two-dimensional image data compression method and decompression method

Country Status (1)

Country Link
JP (1) JPH0884260A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH11168389A (en) * 1997-12-05 1999-06-22 Toshiba Corp Data compression device
DE19803277C2 (en) * 1997-01-31 2000-01-20 Kioritz Corp Mufflers for internal combustion engines
US9853566B2 (en) 2015-06-01 2017-12-26 Lsis Co., Ltd. System for driving inverters in parallel
CN117221414A (en) * 2023-11-09 2023-12-12 东莞中杰艾克森电子有限公司 Intelligent data transmission method for modem

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
DE19803277C2 (en) * 1997-01-31 2000-01-20 Kioritz Corp Mufflers for internal combustion engines
JPH11168389A (en) * 1997-12-05 1999-06-22 Toshiba Corp Data compression device
US9853566B2 (en) 2015-06-01 2017-12-26 Lsis Co., Ltd. System for driving inverters in parallel
CN117221414A (en) * 2023-11-09 2023-12-12 东莞中杰艾克森电子有限公司 Intelligent data transmission method for modem
CN117221414B (en) * 2023-11-09 2024-01-16 东莞中杰艾克森电子有限公司 Intelligent data transmission method for modem

Similar Documents

Publication Publication Date Title
JPH0564007A (en) Method and device for encoding and decoding
JP4000266B2 (en) Data encoding apparatus, data encoding method, and program thereof
JPH0884260A (en) Two-dimensional image data compression method and decompression method
JPH08130652A (en) Two-dimensional image data compression method and decompression method
JPH07336696A (en) Two-dimensional image data compression method and decompression method
JPH0846793A (en) Two-dimensional image data compression method and decompression method
JPH08130651A (en) Two-dimensional image data compression method and decompression method
JP3199292B2 (en) Run-length extraction method, Huffman code conversion method, and MH coding processing method in Huffman code coding
JPH0723238A (en) Image data compression and decompression device
JP3260925B2 (en) Image processing device
JPS6118387B2 (en)
JPH10215366A (en) Method and device for extracting compression image data
JPH0644038A (en) Data compression method, data decompression method, data compression / decompression method
JPH03209923A (en) Data compressing system
JP3105330B2 (en) Image data compression / decompression method
JPH06152988A (en) Decoder for variable length encoding
JP3321226B2 (en) Encoding / decoding method
JP6821184B2 (en) Image decoder
JPH10210273A (en) Comparison method of compressed image data and its device
JPH05127866A (en) Image data compression method
JP2594767B2 (en) How to decompress compressed data
JP2594770B2 (en) How to decompress compressed data
JP2881039B2 (en) Data compression device
JP3181996B2 (en) Image data compression / decompression method
JP3034016B2 (en) Data compression and decompression method