[go: up one dir, main page]

JPH0511973A - Data compression method using universal code - Google Patents

Data compression method using universal code

Info

Publication number
JPH0511973A
JPH0511973A JP16554291A JP16554291A JPH0511973A JP H0511973 A JPH0511973 A JP H0511973A JP 16554291 A JP16554291 A JP 16554291A JP 16554291 A JP16554291 A JP 16554291A JP H0511973 A JPH0511973 A JP H0511973A
Authority
JP
Japan
Prior art keywords
character string
character
matching
length
encoding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
JP16554291A
Other languages
Japanese (ja)
Other versions
JP3078601B2 (en
Inventor
Shigeru Yoshida
茂 吉田
Yoshiyuki Okada
佳之 岡田
Yasuhiko Nakano
泰彦 中野
Hirotaka Chiba
広隆 千葉
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP16554291A priority Critical patent/JP3078601B2/en
Publication of JPH0511973A publication Critical patent/JPH0511973A/en
Application granted granted Critical
Publication of JP3078601B2 publication Critical patent/JP3078601B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Landscapes

  • Compression, Expansion, Code Conversion, And Decoders (AREA)

Abstract

(57)【要約】 【目的】ユニバーサル型アルゴリズムを用いて文字情報
等の入力文字列を圧縮符号化するユニバーサル符号を用
いたデータ圧縮方式に関し、文字間の相関を取り込むこ
とにより符号化済み文字列間の冗長性を削減した符号化
により高い圧縮率を得ることを目的とする。 【構成】符号化済み文字列を辞書12に保持しておき、
文字入力部10の入力文字列を辞書12の符号化済み文
字列と最大長一致する部分列を検索し、該最大長一致部
分列の開始位置と一致長の組で符号化するユニバーサル
符号を用いたデータ圧縮方式であって、文字入力部10
の入力文字列に対する直前文字18と同じ先頭文字から
始まる辞書12に保持された符号化済み文字列の一致部
分列S1,S2,S3,S4を検索すると共に最大長一
致する部分列S4を検索し、最大長一致する部分列S4
を符号化する際の開始位置として最大長一致部分列の直
前文字が現れる出現順番を用いて一致長との組で符号化
する。
(57) [Abstract] [Purpose] A data compression method using a universal code that compresses and encodes an input character string such as character information using a universal type algorithm. An encoded character string is obtained by incorporating the correlation between characters. The purpose is to obtain a high compression rate by encoding with reduced redundancy between. [Structure] An encoded character string is held in the dictionary 12,
A universal code that searches the input character string of the character input unit 10 for a substring whose maximum length matches the coded character string of the dictionary 12 and encodes it with a set of the start position and the matching length of the maximum length matching substring is used. The character input unit 10
Search the matching subsequences S1, S2, S3, S4 of the coded character strings held in the dictionary 12 starting from the same first character as the immediately preceding character 18 for the input character string of , Substring S4 with maximum length matching
Is encoded as a start position when encoding is performed in a pair with the matching length by using the appearance order in which the preceding character of the maximum length matching subsequence appears.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、ユニバーサル型アルゴ
リズムを用いて文字情報等の入力文字列を圧縮符号化す
るユニバーサル符号を用いたデータ圧縮方式に関する。
近年、文字コード、ベクトル情報、画像など様々な種類
のデータがコンピュータで扱われるようになっており、
扱われるデータ量も急速に増加してきている。大量のデ
ータを扱うときは、データの中の冗長な部分を省いてデ
ータ量を圧縮することで、記憶容量を減らしたり、速く
伝送したりできるようになる。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a data compression method using a universal code which compresses and encodes an input character string such as character information using a universal type algorithm.
In recent years, various types of data such as character codes, vector information, and images have been handled by computers,
The amount of data handled is also increasing rapidly. When handling a large amount of data, omitting redundant parts of the data and compressing the amount of data reduces the storage capacity and enables faster transmission.

【0002】このような様々なデータを1つの方式でデ
ータ圧縮できる方法としてユニバーサル符号化が提案さ
れている。ここで、本発明の分野は、文字コードの圧縮
に限らず、様々なデータに適用できるが、以下では、情
報理論で用いられている呼称を踏襲し、データの1ワー
ド単位を文字と呼び、データが任意ワードつながったも
のを文字列と呼ぶことにする。
Universal coding has been proposed as a method of compressing such various data by one method. Here, the field of the present invention is not limited to compression of character codes and can be applied to various data, but in the following, the word used in information theory is followed, and one word unit of data is called a character, A string in which data is connected to arbitrary words is called a character string.

【0003】ユニバーサル符号の代表的な方法として、
ジブ−レンペル(Ziv-Lempel)符号がある(詳しくは、
例えば、宗像『Ziv-Lempelのデータ圧縮法』、情報処
理、Vol.26,No.1,1985年を参照のこと)。ジブーレンペ
ル符号では (1)ユニバーサル型と、 (2)増分分解型(Incremental parsing ) の2つのアルゴリズムが提案されている。
As a typical method of the universal code,
There is a Ziv-Lempel code (for details,
For example, see Munakata "Ziv-Lempel Data Compression Method", Information Processing, Vol.26, No.1, 1985). Two algorithms of (1) universal type and (2) incremental decomposition type (Incremental parsing) have been proposed for the Jibulermpel code.

【0004】更に、ユニバーサル型アルゴリズムの改良
として、LZSS符号(T.C. Bell,“Better OPM/L Tex
t Compression ”,IEEE Trans. on Commun., Vol.COM-3
4, No.12, Dec. 1986 参照)や、1/4インチ・カート
リッジ磁気テープの標準圧縮方式であるQIC−122
符号がある。また、増分分解型アルゴリズムの改良とし
ては、LZW(Lempel-Ziv-Welch)符号がある(T.A. W
elch, “A Technique for High-Performance Data Comp
ression ”,Computer, June 1984参照)。
Further, as an improvement of the universal type algorithm, LZSS code (TC Bell, "Better OPM / L Tex
t Compression ”, IEEE Trans. on Commun., Vol.COM-3
4, No. 12, Dec. 1986), or QIC-122, which is the standard compression method for 1/4 inch cartridge magnetic tape.
There is a sign. Further, as an improvement of the incremental decomposition type algorithm, there is a LZW (Lempel-Ziv-Welch) code (TA W
elch, “A Technique for High-Performance Data Comp
ression ”, Computer, June 1984).

【0005】これらの改良符号は補助記憶装置のファイ
ル圧縮や、パソコン通信でのデータ伝送に利用されるよ
うになっている。
These improved codes have come to be used for file compression of an auxiliary storage device and data transmission in personal computer communication.

【0006】[0006]

【従来の技術】まず従来のユニバーサル型アルゴリズム
とその改良の1つであるQIC−122符号について説
明する。 [ユニバーサル型アルゴリズム]ユニバーサル型アルゴ
リズムは、演算量は多いが、高圧縮率が得られるデータ
圧縮方式である。
2. Description of the Related Art First, a conventional universal type algorithm and a QIC-122 code which is one of its improvements will be described. [Universal type algorithm] The universal type algorithm is a data compression method that can obtain a high compression rate although the amount of calculation is large.

【0007】即ち、ユニバーサル型アルゴリズムにあっ
ては、符号化しようとする文字列をを、符号化済みの文
字列の任意の位置から最大長一致する系列、所謂部分列
に区切り、入力文字列を過去の最大長一致する部分列の
複製として符号化する。図10にユニバーサル型ジブー
レンペル符号の符号化方式を示す。図10において、辞
書としての機能をもつPバッファ12には入力済みの文
字列が格納されており、文字入力部としてのQバッファ
10にはこれから符号化しようとする文字列が入力され
ている。パターンマッチング部14はQバッファ10の
文字列をPバッファ12の系列と照合し、Pバッファ1
2の中で一致する最大長の文字部分列を検索する。そし
て、Pバッファ12中で検索した最大長一致する部分列
を指定するため図11の情報の組 Pバッファ中の最大長一致系列の開始位置(開始アドレ
ス) 一致長(レングス) として符号化する。なお、一致系列がなければ不一致の
シンボルと共に生データを出力する。
That is, in the universal type algorithm, a character string to be encoded is divided into a sequence having a maximum length match from any position of the encoded character string, that is, a so-called substring, and the input character string is divided. Encode as a copy of a substring with the same maximum length in the past. FIG. 10 shows an encoding method of the universal Dibulenpel code. In FIG. 10, an already-input character string is stored in the P buffer 12 having a function as a dictionary, and a character string to be encoded is input to the Q buffer 10 as a character input unit. The pattern matching unit 14 matches the character string in the Q buffer 10 with the series in the P buffer 12,
Find the matching maximum length character substring in 2. Then, in order to specify a substring matching the maximum length searched in the P buffer 12, it is encoded as a start position (start address) matching length (length) of the maximum length matching sequence in the information set P buffer of FIG. If there is no matching sequence, raw data is output together with the mismatched symbol.

【0008】次にQバッファ10内の符号化した文字列
をPバッファ12に移して新たな符号化済み文字列を登
録する。以下、同様の操作を繰り返し、入力文字列を部
分列に分解して符号化する。このようにジブーレンペル
符号では現在の文字列を、符号化済みの過去の文字列か
らの複製として符号化するものである。ジブーレンペル
符号を用いた場合、文字コードの文書情報は1/2程度
に圧縮できる。
Next, the encoded character string in the Q buffer 10 is moved to the P buffer 12, and a new encoded character string is registered. Hereinafter, the same operation is repeated, and the input character string is decomposed into substrings and encoded. As described above, in the Gibble-Rempel code, the current character string is encoded as a duplicate of the encoded past character string. When the Gibulen-pelpel code is used, the document information of the character code can be compressed to about 1/2.

【0009】[QIC−122符号]3Mを中心とする
メーカの団体であるQIC(Quauter Inch Cartrrige S
tandard Inc.)が1/4インチ・カートリッジ磁気テー
プの標準圧縮方式として採用した符号である。QIC−
122符号のアルゴリズムでは、Pバッファとして20
48バイトの履歴をもち、Qバッファの符号化する文字
列をPバッファ中の文字列の複製として表すモードと、
生データを1バイトづつ符号化するモードの2つのモー
ドをもつ。そして、Pバッファ中の最大長一致文字列が
2文字以上の場合、複製モードで符号化し、それ以外の
ときは生データ・モードで符号化する。
[QIC-122 Code] QIC (Quauter Inch Cartrrige S), which is a group of manufacturers centering on 3M
tandard Inc.) adopted the standard compression method for 1/4 inch cartridge magnetic tape. QIC-
In the 122 code algorithm, 20 is used as the P buffer.
A mode which has a history of 48 bytes and represents a character string to be encoded in the Q buffer as a copy of the character string in the P buffer,
It has two modes of encoding raw data byte by byte. Then, when the maximum length matching character string in the P buffer is two characters or more, the encoding is performed in the duplication mode, and in other cases, the encoding is performed in the raw data mode.

【0010】図12はBNFメタ言語で表わされたQI
C−122符号の符号語フォーマットを示す。またBN
Fメタ言語に用いるメタ記号は図13に示す意味をも
つ。図12のQIC−122符号の符号語フォーマット
を詳細に説明すると次のようになる。 (1)圧縮系列(Compressed Stream )は、圧縮ストリ
ング(Compressed String)とエンドマーカで構成され
る。
FIG. 12 shows the QI expressed in the BNF meta language.
The codeword format of a C-122 code is shown. Also BN
The meta symbols used in the F metalanguage have the meanings shown in FIG. The code word format of the QIC-122 code in FIG. 12 will be described in detail as follows. (1) The compressed stream (Compressed Stream) is composed of a compressed string and an end marker.

【0011】(2)圧縮ストリングは、生データについ
ては識別ビット0に続くASCII生バイトで表現さ
れ、また圧縮データについては識別ビット1に続いて圧
縮バイトで表現される。 (3)ASCII生バイトは、8ビットを1バイトして
表現される。 (4)圧縮バイトは、オフセット(開始位置)とレング
ス(一致長)の組でなる。 (5)オフセット(開始位置)は、識別ビット1の場合
は7ビットで表現される。また識別ビット0のは場合は
11ビットで表現される。 (6)エンドマーカは、110000000であり、オ
フセットは0となる。 (7)ビットbは0又は1である。 (8)レングス(一致長)は、図12のように可変長符
号で表現される。
(2) The compressed string is represented by an ASCII raw byte following identification bit 0 for raw data, and an identification bit 1 followed by a compression byte for compressed data. (3) The ASCII raw byte is represented by 1 byte of 8 bits. (4) The compressed byte is a set of offset (start position) and length (match length). (5) The offset (start position) is represented by 7 bits when the identification bit is 1. When the identification bit is 0, it is represented by 11 bits. (6) The end marker is 110000000 and the offset is 0. (7) Bit b is 0 or 1. (8) Length (match length) is represented by a variable length code as shown in FIG.

【0012】図14にQIC−122符号の符号化の具
体例を示す。図14は文字列「ABAAAAAACAB
A」が入力した場合を例にとっている。まず最初の3文
字「ABA」に関してはPバッファ中の一致する文字数
が1文字以下であることからASCII生バイトのビッ
ト系列を出力する。4文字目から8文字目までの5つの
「A」については、Pバッファの直前文字「A」と一致
することから、 圧縮バイト識別ビット 7ビットオフセット識別ビット オフセット=1 レングス=5バイト でなるビット系列「1 1 0000001 110
0」として出力する。
FIG. 14 shows a specific example of encoding the QIC-122 code. FIG. 14 shows the character string "ABAAAAAACAB.
The case where "A" is input is taken as an example. First, since the number of matching characters in the P buffer for the first three characters "ABA" is one or less, the bit sequence of the ASCII raw byte is output. Since the 5th "A" from the 4th character to the 8th character matches the character "A" immediately before in the P buffer, the compressed byte identification bit 7-bit offset identification bit offset = 1 length = 5 bytes Series "1 100000001 110
It is output as "0".

【0013】ここで最大長一致の部分列の開始位置を示
すオフセットの値は、Pバッファの最新登録位置(アド
レス)から前に遡って何番目かを示している。9番目の
文字「C」はPバッファにないことからASCII生バ
イトを出力する。10〜12番目の文字「ABA」はP
バッファの先頭からの3文字として既に登録済みである
ので、 圧縮バイト識別ビット 7ビットオフセット識別ビット オフセット=9 レングス=3バイト でなるビット系列「1 1 0001001 01」を
出力する。
Here, the value of the offset indicating the starting position of the substring having the maximum length match indicates the number of the position starting from the latest registration position (address) of the P buffer. The ninth character "C" is not in the P buffer, so it outputs an ASCII raw byte. The 10th-12th character "ABA" is P
Since it has already been registered as three characters from the beginning of the buffer, a bit sequence "1 1 001 001 001" consisting of compressed byte identification bit 7 bit offset identification bit offset = 9 length = 3 bytes is output.

【0014】以上で全ての入力文字の符号化が済んだの
でエンドデータとして「1 1 0000000」を出
力して処理を終了する。
Since all the input characters have been encoded as described above, "1 1000000" is output as the end data and the process is terminated.

【0015】[0015]

【発明が解決しようとする課題】しかしながら、ジブー
レンペル符号やQIC−122符号等を用いた従来のユ
ニバーサル符号を用いたデータ圧縮方式にあっては、複
製すべき最大長一致する文字列を「一致開始位置」と
「一致長」の組で表わして符号化していたため、Pバッ
ファに保持する符号化済み文字列が増加してくると、一
致開始位置はPバッファを構成するメモリのアドレスで
表現されているために、長いビット数で表わさなければ
ならなくなり、符号化した文字列間に冗長性が残り、高
い圧縮率を得ることができなくなる問題があった。
However, in the conventional data compression method using the universal code such as the Dibulenpel code or the QIC-122 code, the maximum length matching character string to be copied is "match start". Since the encoding was performed by expressing the combination of the "position" and the "match length", when the coded character string held in the P buffer increases, the match start position is expressed by the address of the memory forming the P buffer. Therefore, there is a problem in that it has to be represented by a long number of bits, redundancy remains between encoded character strings, and a high compression rate cannot be obtained.

【0016】本発明はこのような従来の問題点に鑑みて
なされたもので、文字間の相関を取り込むことにより符
号化済み文字列間の冗長性を削減した符号化により高い
圧縮率を得ることのできるユニバーサル符号を用いたデ
ータ圧縮方式を提供することを目的とする。
The present invention has been made in view of the above conventional problems, and obtains a high compression rate by encoding by reducing the redundancy between encoded character strings by incorporating the correlation between characters. It is an object of the present invention to provide a data compression method using a universal code capable of performing.

【0017】[0017]

【課題を解決するための手段】図1は本発明の原理説明
図である。まず本発明は、符号化済み文字列を辞書(P
バッファ)12に保持しておき、辞書12の符号化済み
文字列の中の文字入力部(Qバッファ)10の入力文字
列に最大長一致する部分列を検索し、最大長一致部分列
の開始位置と一致長の組で符号化するユニバーサル符号
を用いたデータ圧縮方式を対象とする。
FIG. 1 is a diagram for explaining the principle of the present invention. First, the present invention converts an encoded character string into a dictionary (P
Buffer) 12 and searches for a substring having the maximum length that matches the input character string of the character input unit (Q buffer) 10 in the encoded character string of the dictionary 12 and starts the maximum length matching substring. The target is a data compression method using a universal code that is encoded by a set of position and matching length.

【0018】このようなユニバーサル符号を用いたデー
タ圧縮方式として本発明にあっては、文字入力部10の
入力文字列に対する直前文字18と同じ先頭文字から始
まる辞書12に保持された符号化済み文字列の一致部分
列S1,S2,S3,S4を検索すると共に最大長一致
する部分列S4を検索し、最大長一致する部分列S4を
符号化する際の開始位置として最大長一致部分列S4の
直前文字が現れる出現順番(4番)を用いて一致長との
組で符号化する符号化部14を設けたことを特徴とす
る。
In the present invention as a data compression method using such a universal code, the coded characters stored in the dictionary 12 starting from the same first character as the immediately preceding character 18 for the input character string of the character input unit 10 are used. The matching subsequences S1, S2, S3, S4 of the columns are searched, the subsequence S4 having the maximum length matching is searched, and the maximum length matching subsequence S4 of the maximum length matching subsequence S4 is set as a start position when the substring S4 having the maximum length matching is encoded. It is characterized in that an encoding unit 14 is provided which encodes in combination with the matching length by using the appearance order (4th) in which the immediately preceding character appears.

【0019】また符号化部10は、辞書12中から検索
した最大長一致する符号化済み文字列の部分列が先頭文
字18の連続文字列S2であった場合には、連続文字列
S2の先頭位置または終端位置に出現順番を割当てて一
致長との組で符号化することを特徴とする。この場合、
連続文字列S2の先頭位置と終端位置の2つの出現順番
を割当て、連続文字列の先頭位置と終端位置の両者の出
現順番を一致長との組で符号化するよいにしてもよい。
If the substring of the coded character string with the maximum length matching retrieved from the dictionary 12 is the continuous character string S2 of the first character 18, the coding section 10 starts the continuous character string S2. It is characterized in that the order of appearance is assigned to the position or the end position, and the position and the end position are encoded as a set with the matching length. in this case,
It is also possible to allocate two appearance orders of the start position and the end position of the continuous character string S2 and to code the appearance order of both the start position and the end position of the continuous character string as a set with the matching length.

【0020】符号化部14は、符号化する辞書12の符
号化済み文字列の最大一致長の部分列の文字数が所定文
字未満、例えば3文字未満の時は、入力文字列を符号化
せずにそのまま出力し、文字数が所定値、例えば3文字
以上の時には出現順番と一致長との組で符号化する。更
に符号化部14は、符号化する辞書12の符号化済み文
字列の最大一致長の部分列の文字数が少ない時には、部
分列の開始位置(従来方式)と一致長との組で符号化
し、文字数が多い時に出現順番(本発明の方式)と一致
長との組で符号化してもよい。
The encoding unit 14 does not encode the input character string when the number of characters of the substring having the maximum matching length of the encoded character string of the dictionary 12 to be encoded is less than a predetermined character, for example, less than three characters. Is output as it is, and when the number of characters is a predetermined value, for example, 3 characters or more, it is encoded by a combination of the appearance order and the matching length. Further, when the number of characters in the substring having the maximum matching length of the coded character string of the dictionary 12 to be encoded is small, the encoding unit 14 encodes with a set of the start position (conventional method) of the substring and the matching length, When the number of characters is large, encoding may be performed using a combination of the appearance order (method of the present invention) and the matching length.

【0021】更にまた符号化部14は、例えば入力文字
列を1/4インチ・カートリッジ磁気テープの標準圧縮
方式であるQIC−122符号の符号語を用いて符号化
する。
Further, the encoding unit 14 encodes the input character string, for example, using the code word of the QIC-122 code which is the standard compression system of the 1/4 inch cartridge magnetic tape.

【0022】[0022]

【作用】以上説明したように本発明によれば、Qバッフ
ァの符号化しようとする文字列に対する既に符号化済み
の直前文字(Pバッファの最新登録の一文字)を先頭文
字とする符号化済み文字決の中の一致部分列を全て検索
して出現順番を知り、一致部分列の中の最大長一致する
部分列の複製として符号化する際に、従来は最大一致長
部分列の開始位置と一致長の組で符号化していたもの
を、本発明は、最大一致長の部分列のPバッファでの出
現順番と一致長との組で表わして符号化するようにな
る。
As described above, according to the present invention, a coded character having the preceding character (the latest character registered in the P buffer) already coded for the character string to be coded in the Q buffer as the first character Conventionally, when matching all substrings in a decision, the appearance order is known, and when encoding as a copy of the substring with the maximum matching length in the matching substring, conventionally, the matching position matches the starting position of the maximum matching length substring. According to the present invention, what is encoded by a set of lengths is represented by a set of the order of appearance of the subsequence having the maximum match length in the P buffer and the match length and is encoded.

【0023】このため従来の開始位置(開始アドレス)
に比べ、部分列の出現順番の数の方が遙かに少なく、出
現順番を少ないビット数で表現できることによって圧縮
率を大幅に向上することができる。例えば本発明はQI
C−122符号の符号化に適用され、Qバッファの直前
の一文字としての直前文字から続けたPバッファの最大
長一致文字列を探索し、最大長一致文字列の開始位置を
Pバッファ内で直前文字が何番目に出現した順番で表す
ようにする。
Therefore, the conventional start position (start address)
Compared with the above, the number of appearance orders of the subsequence is much smaller, and the appearance order can be expressed by a smaller number of bits, so that the compression rate can be significantly improved. For example, the present invention uses QI
It is applied to the encoding of C-122 code, searches for the maximum length matching character string of the P buffer that continues from the immediately preceding character as the one character immediately before the Q buffer, and finds the start position of the maximum length matching character string immediately before in the P buffer. Express the characters in the order in which they appear.

【0024】[0024]

【実施例】図2は本発明の一実施例を示した実施例構成
図である。図2において、16はバッファメモリであ
り、符号化を行おうとする文字列を格納する文字列入力
部としてのQバッファ10と、符号化済み文字列を登録
した辞書として機能するPバッファ12に割当られる。
2 is a block diagram of an embodiment showing one embodiment of the present invention. In FIG. 2, reference numeral 16 denotes a buffer memory, which is assigned to a Q buffer 10 as a character string input unit for storing a character string to be encoded and a P buffer 12 functioning as a dictionary in which encoded character strings are registered. To be

【0025】14はCPUを用いた符号化部としてのパ
ターンマッチング部であり、ユニバーサル符号化アルゴ
リズムに従ってQバッファ10の文字列に最大長一致す
る部分列をPバッファ12から検索し、最大長一致する
部分列の複製としてその開始位置と一致長の組でなる符
号語を出力する。図3は図2のパタークマッチング部1
4による本発明の符号化処理を示した説明図である。
Reference numeral 14 denotes a pattern matching unit as a coding unit using a CPU, which searches the P buffer 12 for a substring having the maximum length matching the character string of the Q buffer 10 according to the universal coding algorithm, and matches the maximum length. A codeword consisting of a set of the start position and the matching length is output as a copy of the subsequence. FIG. 3 shows the pattern matching unit 1 of FIG.
FIG. 4 is an explanatory diagram showing an encoding process of the present invention according to No. 4;

【0026】図3において、まずQバッファ10にこれ
から符号化しようとする文字列「acba・・・」が格
納されていたとすると、既に符号化済みの直前の一文字
である直前文字「b」を含み、この直前文字「b」に続
いてQバッファ10の文字列に一致する文字列がPバッ
ファ12にあるか否かが探索される。この条件を満足す
る文字列として例えば文字列S1,S2,S3,S4が
検索できたとする。
In FIG. 3, first, assuming that the character string "acba ..." To be encoded is stored in the Q buffer 10, it includes the immediately preceding character "b" which is one character just before being encoded. Then, it is searched whether or not a character string matching the character string of the Q buffer 10 is present in the P buffer 12 following the immediately preceding character "b". It is assumed that, for example, the character strings S1, S2, S3, S4 can be retrieved as the character strings satisfying this condition.

【0027】文字列S1〜S4の出現番号は、Pバッフ
ァ12に右から登録を行っているため 文字列S1:1番目 文字列S2:2番目 文字列S3:3番目 文字列S4:4番目 の出現順番となり、順に出現番号1,2,3,4が割り
付けられる。
Since the appearance numbers of the character strings S1 to S4 are registered in the P buffer 12 from the right, the character string S1: the first character string S2: the second character string S3: the third character string S4: the fourth The appearance order is set, and the appearance numbers 1, 2, 3, and 4 are sequentially assigned.

【0028】次に文字列S1〜S4の中から入力文字列
に最大長一致する文字列S4を検索し、この文字列S4
の開始位置を出現番号4で表わし、一致長と組にした符
号語として出力する。一方、文字列S2のように直前文
字「b」が連続する文字列については、連続文字列S2
の開始点または終点のいずれか一方に出現番号を割り付
けて符号化する。また連続文字列Sの開始点と終点に2
つの出現番号を割り付け、2つの出現番号と一致長との
組の符号語として符号化してもよい。
Next, the character string S4 having the maximum length matching the input character string is searched from the character strings S1 to S4, and this character string S4 is searched.
The start position of is represented by appearance number 4, and is output as a codeword paired with the match length. On the other hand, for a character string such as the character string S2 in which the preceding character "b" is continuous, the continuous character string S2
The appearance number is assigned to either the start point or the end point of and encoded. 2 at the start and end of the continuous character string S
One appearance number may be assigned and encoded as a code word of a pair of two appearance numbers and a matching length.

【0029】図4はQICー122符号を例にとって本
発明によるユニバーサル符号化アルゴリズムの一実施例
を示したフローチャートである。図4において、まずス
テップS1でPバッファの内容を空にし、またQバッフ
ァに符号化しようとする入力データを詰める。次にステ
ップS2でQバッファの直前文字の位置からの文字列に
一致するPバッファの最長文字列Sを検索する。続いて
ステップS3で検索できた最長文字列Sが3文字以上か
否か判別する。
FIG. 4 is a flow chart showing an embodiment of the universal coding algorithm according to the present invention using the QIC-122 code as an example. In FIG. 4, first, in step S1, the contents of the P buffer are emptied, and the Q buffer is filled with input data to be encoded. Next, in step S2, the longest character string S in the P buffer that matches the character string from the position of the immediately preceding character in the Q buffer is searched. Subsequently, in step S3, it is determined whether or not the longest character string S that can be searched is three characters or more.

【0030】最長文字列Sが1文字或いは2文字の場合
はステップS4に進んで生データ・モードとなり、生デ
ータ・モードであることを示すフラクビット0とASC
IIコードでなる生データ1バイトを出力する。一方、
最長文字列Sが3文字以上であった場合には、ステップ
S5に進んで複製モードとし、圧縮データであることを
示すフラグビット1に続いて最長文字列の出現順番と一
致長の組を符号化する。
If the longest character string S is one character or two characters, the process proceeds to step S4 to enter the raw data mode, and the frac bit 0 and ASC indicating the raw data mode.
Outputs 1 byte of raw data consisting of II code. on the other hand,
If the longest character string S is 3 characters or more, the process proceeds to step S5, the duplication mode is set, and a set of the appearance order of the longest character string and the matching length is coded after the flag bit 1 indicating compressed data. Turn into.

【0031】ステップS6では符号化済みのQバッファ
の文字列又は文字をPバッファに移すと共に、同じ数の
新たな文字をQバッファに入力する。更にQIC−12
2符号のアルゴリズムではPバッファは2048バイト
と固定であるため、Pバッファに移した文字数分の最も
古い文字をPバッファから捨てる。以下同様な処理を繰
り返す。
In step S6, the encoded character string or character in the Q buffer is moved to the P buffer, and the same number of new characters is input to the Q buffer. Further QIC-12
Since the P buffer is fixed at 2048 bytes in the 2-code algorithm, the oldest characters corresponding to the number of characters moved to the P buffer are discarded from the P buffer. The same process is repeated thereafter.

【0032】図5は図4の複製モードで符号化されるQ
IC−122符号語を利用したフォーマット説明図であ
り、図12と比較してオフセットが出現番号を示す3ビ
ット表現となっている。従って、文字列開始位置を7箇
所まで符号化できる。ここで、出現番号0はENDマー
クに用いている。また、一致長には、直前文字を含め、
3文字以上の文字列を表わすので、 一致長=|S|−2 を用いるものとする。
FIG. 5 shows Q encoded in the replication mode of FIG.
FIG. 13 is an explanatory diagram of a format using an IC-122 code word, and an offset is a 3-bit expression indicating an appearance number as compared with FIG. 12. Therefore, up to 7 character string start positions can be encoded. Here, the appearance number 0 is used for the END mark. Also, the match length includes the previous character,
Since it represents a character string of three or more characters, match length = | S | −2 is used.

【0033】このように従来の開始位置を示していたオ
フセットが7ビット或いは11ビットであったものを本
発明では出現番号のオフセットを3ビットと少ないビッ
ト数で表現でき、これによって圧縮率を向上できる。図
6は図4の生データ・モードで出力されるデータ形式
と、複製モードで出力された符号語のデータ形式を示
す。
As described above, in the present invention, the offset of the appearance number can be expressed by a small number of bits of 3 bits instead of the conventional offset indicating the starting position of 7 bits or 11 bits, thereby improving the compression rate. it can. FIG. 6 shows the data format output in the raw data mode of FIG. 4 and the data format of the codeword output in the copy mode.

【0034】図7は本発明の他の実施例を示したQIC
−122符号を用いた符号化アルゴリズムを示したフロ
ーチャートであり、この実施例にあっては、図4の生デ
ータ・モードと、出現順番を用いた符号語を出力する複
製モードに加えて、従来の開始位置(開始アドレス)を
用いた符号語を出力する複製モードを組合せたことを特
徴とする。
FIG. 7 shows a QIC showing another embodiment of the present invention.
6 is a flowchart showing an encoding algorithm using -122 code, and in this embodiment, in addition to the raw data mode of FIG. 4 and the duplication mode for outputting code words using the appearance order, It is characterized in that a duplication mode for outputting a code word using the start position (start address) of is combined.

【0035】図7においては、ステップS1で初期処理
を行った後、ステップS2で図4のステップS2と同様
に直前文字列に続く最大一致長の最長文字列S1を検索
し、同時に出現順番及び一致長を求める。続いてステッ
プS3で直前文字とは無関係にPバッファの中の最長文
字列S2を検索し、開始位置および一致長を求める。
In FIG. 7, after the initial processing is performed in step S1, the longest character string S1 having the maximum matching length following the immediately preceding character string is searched for in step S2 as in step S2 of FIG. Find the match length. Then, in step S3, the longest character string S2 in the P buffer is searched irrespective of the immediately preceding character, and the start position and the matching length are obtained.

【0036】次にステップS2で検索した最長文字列S
2が3文字以上か否かチェックし、3文字以上であれ
ば、ステップS8に進んで図9(c)の複製モード
(2)の符号語を出力する。3文字未満の場合はステッ
プS5に進みステップS3で検索した最長文字列S2が
2文字以上か否かチェックし、2文字以上であればステ
ップS7に進み、図9(b)の複製モード(1)の符号
語、即ち、開始位置と一致長の組を符号化する。
Next, the longest character string S retrieved in step S2
It is checked whether 2 is 3 characters or more. If 3 characters or more, the process proceeds to step S8 to output the code word of the duplication mode (2) of FIG. 9C. If it is less than 3 characters, the process proceeds to step S5, and it is checked whether the longest character string S2 searched in step S3 is 2 characters or more. If it is 2 characters or more, the process proceeds to step S7, and the duplication mode (1 ) Codeword, that is, a set of the start position and the matching length is encoded.

【0037】更に最長文字列S2が1文字の場合はステ
ップS6に進み、図9(a)の生データ・モードの符号
語を出力する。これらステップS6,ステップS7又は
ステップS8のいずれかによる符号化が済むとステップ
S9に進んで次の符号化済みのQバッファの文字列又は
文字をPバッファに移すと共に、同じ数の新たな文字を
Qバッファに入力し、さらにPバッファの容量に制限が
あるので、Pバッファに移した文字数分の最も古い文字
をPバッファから捨て、以下同様な処理を繰り返す。
Further, when the longest character string S2 is one character, the process proceeds to step S6, and the code word in the raw data mode of FIG. 9A is output. When the encoding is completed in any of these steps S6, S7 or S8, the process proceeds to step S9, where the next encoded character string or character in the Q buffer is moved to the P buffer, and the same number of new characters is written. Since there is a limit to the capacity of the P buffer after inputting into the Q buffer, the oldest characters corresponding to the number of characters moved to the P buffer are discarded from the P buffer, and the same processing is repeated thereafter.

【0038】図8には図7の実施例における複製モード
(1)(2)で符号化されるQIC−122符号語を利
用したフォーマット構成を示す。尚、上記の実施例で
は、出現番号の大きさを例えば3ビットと制限している
が、制限を付けずに可変長符号で表しても良い。また、
出現順番をPバッファ中で登録の古い右から登録の新し
い左に数えたが、これは逆に左から右に数えてもよい。
FIG. 8 shows a format structure using QIC-122 codewords encoded in the duplication modes (1) and (2) in the embodiment of FIG. Although the size of the appearance number is limited to, for example, 3 bits in the above embodiment, it may be represented by a variable length code without limitation. Also,
Although the order of appearance is counted from the old right of registration to the new left of registration in the P-buffer, this may in turn be counted from left to right.

【0039】更に上記の実施例はQIC−122符号を
例にとるものであったが、ジブーレンペル符号等の適宜
のユニバーサル符号につきそのまま適用できる。
Further, although the above-mentioned embodiment has been described with the QIC-122 code as an example, it can be applied as it is to an appropriate universal code such as the Dibullenpel code.

【0040】[0040]

【発明の効果】以上説明したように本発明によれば、符
号化文字列を符号化済み文字列の複製として「一致開始
位置」と「一致長」の組で表すとき、従来は一致開始位
置をアドレスで表現するのに対して、直前文字が一致す
る文字列の内何番目のものか番号による相対的な順序と
して表現するため、従来より短いビット数で表すことが
でき、高い圧縮率を得ることができる。
As described above, according to the present invention, when a coded character string is represented by a set of "match start position" and "match length" as a copy of the coded character string, conventionally, the match start position is Is expressed as an address, whereas it is expressed as a relative order by the number of the character string in which the immediately preceding character matches, so it can be expressed with a shorter number of bits than before and a high compression rate can be achieved. Obtainable.

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

【図1】本発明の原理説明図FIG. 1 is an explanatory view of the principle of the present invention.

【図2】本発明の実施例構成図FIG. 2 is a block diagram of an embodiment of the present invention.

【図3】本発明の符号化処理の説明図FIG. 3 is an explanatory diagram of encoding processing of the present invention.

【図4】本発明を用いたQIC−122符号化アルゴリ
ズムを示したフローチャート
FIG. 4 is a flowchart showing a QIC-122 encoding algorithm using the present invention.

【図5】図4の複製モードの符号語フォーマット説明図FIG. 5 is an explanatory diagram of a codeword format in the copy mode of FIG.

【図6】図4の符号語のデータ形式説明図6 is an explanatory diagram of the data format of the code word in FIG. 4.

【図7】本発明を用いたQIC−122符号化アルゴリ
ズムの他の実施例を示したフローチャート
FIG. 7 is a flowchart showing another embodiment of the QIC-122 encoding algorithm using the present invention.

【図8】図7の複製モードの符号語フォーマット説明図8 is an explanatory diagram of a codeword format in the copy mode of FIG.

【図9】図7の符号語のデータ形式説明図9 is an explanatory diagram of a data format of the code word in FIG. 7.

【図10】ユニバーサル型ジブーレンペル符号の符号化
方式説明図
FIG. 10 is an explanatory diagram of a universal Dibulenpel code encoding method.

【図11】ユニバーサル符号語のデータ形式説明図FIG. 11 is an explanatory diagram of a universal codeword data format.

【図12】QIC122符号のフォーマット説明図FIG. 12 is an explanatory diagram of a format of QIC122 code.

【図13】図12に使用したBNFメタ言語の説明図13 is an explanatory diagram of the BNF meta language used in FIG.

【図14】QIC−122符号による符号化の具体例を
示した説明図
FIG. 14 is an explanatory diagram showing a specific example of encoding by QIC-122 code.

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

10:文字入力部(Qバッファ) 12:辞書(Pバッファ) 14:符号化部(パターンマッチング部) 16:バッファメモリ 18:直前文字 10: Character input section (Q buffer) 12: Dictionary (P buffer) 14: Encoding unit (pattern matching unit) 16: Buffer memory 18: last character

───────────────────────────────────────────────────── フロントページの続き (72)発明者 千葉 広隆 神奈川県川崎市中原区上小田中1015番地 富士通株式会社内   ─────────────────────────────────────────────────── ─── Continued front page    (72) Inventor Hirotaka Chiba             1015 Kamiodanaka, Nakahara-ku, Kawasaki City, Kanagawa Prefecture             Within Fujitsu Limited

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】符号化済み文字列を辞書12に保持してお
き、前記辞書12の符号化済み文字列の中の文字入力部
10の入力文字列に最大長一致する部分列を検索し、該
最大長一致部分列の開始位置と一致長の組で符号化する
ユニバーサル符号を用いたデータ圧縮方式に於いて、 前記文字入力部10の入力文字列に対する直前文字18
と同じ先頭文字から始まる前記辞書12に保持された符
号化済み文字列の一致部分列S1,S2,S3,S4を
検索すると共に最大長一致する部分列S4を検索し、該
最大長一致する部分列S4を符号化する際の前記開始位
置として該最大長一致部分列S4の直前文字が現れる出
現順番を用いて一致長との組で符号化する符号化部14
を設けたことを特徴とするユニバーサル符号を用いたデ
ータ圧縮方式。
1. A coded character string is held in a dictionary 12, and a substring in the coded character string of the dictionary 12 having a maximum length matching the input character string of a character input unit 10 is searched, In a data compression method using a universal code for encoding with a set of a start position and a match length of the maximum length matching subsequence, a character 18 immediately preceding the input character string of the character input unit 10
And the matching subsequences S1, S2, S3, S4 of the coded character strings held in the dictionary 12 starting from the same first character are searched, and the maximum length matching subsequence S4 is searched, and the maximum length matching part is searched. An encoding unit 14 that encodes in combination with a match length by using the appearance order in which the preceding character of the maximum length matching subsequence S4 appears as the starting position when encoding the string S4.
A data compression method using a universal code.
【請求項2】請求項1記載のユニバーサル符号を用いた
データ圧縮方式に於いて、 前記符号化部10は、前記辞書12中から検索した最大
長一致する符号化済み文字列の部分列が前記先頭文字1
8の連続文字列S2であった場合には、連続文字列S2
の先頭位置または終端位置の出現順番を割当てて一致長
との組で符号化することを特徴とするユニバーサル符号
を用いたデータ圧縮方式。
2. The data compression method using a universal code according to claim 1, wherein the encoding unit 10 searches the dictionary 12 for a substring of an encoded character string having a maximum length match. First character 1
If the continuous character string S2 is 8, the continuous character string S2
A data compression method using a universal code, characterized by assigning the order of appearance of the beginning position or the end position of and encoding in a set with the matching length.
【請求項3】請求項1記載のユニバーサル符号を用いた
データ圧縮方式に於いて、 前記符号化部10は、前記辞書12中から検索した最大
長一致する符号化済み文字列の部分列が前記先頭文字1
8の連続文字列S2であった場合には、該連続文字列S
2の先頭位置と終端位置の2つの出現順番を割当て、連
続文字列S2の先頭位置と終端位置の両者の出現順番を
一致長との組で符号化することを特徴とするユニバーサ
ル符号を用いたデータ圧縮方式。
3. The data compression method using a universal code according to claim 1, wherein the encoding unit 10 searches the dictionary 12 for a substring of an encoded character string having a maximum length match. First character 1
If the continuous character string S2 is 8, the continuous character string S
A universal code is used in which two appearance orders of the start position and the end position of 2 are assigned, and the appearance order of both the start position and the end position of the continuous character string S2 is encoded as a set with the matching length. Data compression method.
【請求項4】請求項1記載のユニバーサル符号を用いた
データ圧縮方式に於いて、 前記符号化部14は、符号化する辞書12の符号化済み
文字列の最大一致長の部分列の文字数が所定値未満の時
は、入力文字列を符号化せずにそのまま出力し、文字数
が所定値以上の時には出現順番と一致長との組で符号化
することを特徴とするユニバーサル符号を用いたデータ
圧縮方式。
4. The data compression method using the universal code according to claim 1, wherein the encoding unit 14 determines that the number of characters of the substring of the maximum matching length of the encoded character string of the dictionary 12 to be encoded is When the number of characters is less than a predetermined value, the input character string is output as it is without encoding, and when the number of characters is more than a predetermined value, it is encoded by a combination of the order of appearance and the matching length. Compression method.
【請求項5】請求項1又は請求項4記載のユニバーサル
符号を用いたデータ圧縮方式に於いて、 前記符号化部14は、符号化する辞書12の符号化済み
文字列の最大一致長の部分列の文字数が少ない時には、
該部分列の開始位置と一致長との組で符号化し、文字数
が多い時に出現順番と一致長との組で符号化することを
特徴とするユニバーサル符号を用いたデータ圧縮方式。
5. A data compression method using a universal code according to claim 1 or 4, wherein said encoding unit 14 has a maximum matching length portion of an encoded character string of a dictionary 12 for encoding. When the number of characters in the column is small,
A data compression method using a universal code, characterized in that encoding is performed with a combination of a start position of the subsequence and a matching length, and when there are a large number of characters, encoding is performed with a combination of an appearance order and a matching length.
【請求項6】請求項1乃至請求項5記載のユニバーサル
符号を用いたデータ圧縮方式に於いて、 前記符号化部14は、入力文字列を1/4インチ・カー
トリッジ磁気テープの標準圧縮方式であるQIC−12
2符号に符号化することを特徴とするユニバーサル符号
を用いたデータ圧縮方式。
6. A data compression method using a universal code according to any one of claims 1 to 5, wherein the encoding unit 14 uses a standard compression method of an input character string for a 1/4 inch cartridge magnetic tape. A certain QIC-12
A data compression method using a universal code, which is characterized by encoding into two codes.
JP16554291A 1991-07-05 1991-07-05 Data compression method Expired - Fee Related JP3078601B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16554291A JP3078601B2 (en) 1991-07-05 1991-07-05 Data compression method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16554291A JP3078601B2 (en) 1991-07-05 1991-07-05 Data compression method

Publications (2)

Publication Number Publication Date
JPH0511973A true JPH0511973A (en) 1993-01-22
JP3078601B2 JP3078601B2 (en) 2000-08-21

Family

ID=15814364

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16554291A Expired - Fee Related JP3078601B2 (en) 1991-07-05 1991-07-05 Data compression method

Country Status (1)

Country Link
JP (1) JP3078601B2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012205058A (en) * 2011-03-25 2012-10-22 Fuji Xerox Co Ltd Image processing apparatus and image processing program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2012205058A (en) * 2011-03-25 2012-10-22 Fuji Xerox Co Ltd Image processing apparatus and image processing program

Also Published As

Publication number Publication date
JP3078601B2 (en) 2000-08-21

Similar Documents

Publication Publication Date Title
JP3141001B2 (en) Encoding method, data compressor, and recording medium recording computer program
JP3241788B2 (en) Data compression method
JP3231105B2 (en) Data encoding method and data restoration method
JP3105598B2 (en) Data compression method using universal code
JP3038223B2 (en) Data compression method
JP3241787B2 (en) Data compression method
JP3078601B2 (en) Data compression method
JP3242795B2 (en) Data processing device and data processing method
JP2940948B2 (en) Data compression method
JPH05152971A (en) Data compressing/restoring method
JP3350118B2 (en) Data encoding method and data restoration method
JP3051501B2 (en) Data compression method
JP3130324B2 (en) Data compression method
JP2774350B2 (en) Data compression method and data restoration method of compressed data
JPH05134847A (en) Data compression method
JPH06161705A (en) Data coding method and data restoration method
JP2823917B2 (en) Data compression method
JP2823918B2 (en) Data compression method
JP2999587B2 (en) Data compression and decompression method
JP3100206B2 (en) Data compression method
JP3442105B2 (en) Data compression and decompression methods
JP3083329B2 (en) Data compression / decompression method
JP2999561B2 (en) Data compression and decompression device
JP2802135B2 (en) Image data compression method
JPH06149537A (en) Data compression method and restoration method

Legal Events

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

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000530

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

Free format text: PAYMENT UNTIL: 20090616

Year of fee payment: 9

LAPS Cancellation because of no payment of annual fees