JPH04261226A - Data compressor - Google Patents

Data compressor

Info

Publication number
JPH04261226A
JPH04261226A JP4225191A JP4225191A JPH04261226A JP H04261226 A JPH04261226 A JP H04261226A JP 4225191 A JP4225191 A JP 4225191A JP 4225191 A JP4225191 A JP 4225191A JP H04261226 A JPH04261226 A JP H04261226A
Authority
JP
Japan
Prior art keywords
register
code
value
character
outputs
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
JP4225191A
Other languages
Japanese (ja)
Inventor
Toshiyuki Watabe
俊幸 渡部
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.)
NEC Corp
Original Assignee
NEC 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 NEC Corp filed Critical NEC Corp
Priority to JP4225191A priority Critical patent/JPH04261226A/en
Publication of JPH04261226A publication Critical patent/JPH04261226A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To reduce the time required for data compression considerably. CONSTITUTION:A map section 1 is provided with a register latching a value representing the order of codes for each kind of the inputted codes, that is, the sequential number. A comparison section 2 detects whether or not a code string is the same as the code string already inputted based on the sequential number of the code latched in the register. Then a generating section 3 detects whether or not the same code strings are consecutive based on the sequential number and outputs a prescribed compression code when the consecution of the same code strings is detected. An output section 4 applies synchronization processing to the code string after data compression as required and outputs the result as an output data.

Description

【発明の詳細な説明】[Detailed description of the invention]

【0001】0001

【産業上の利用分野】本発明はデータ圧縮装置に関し、
特に同一の符号列が連続するとき効果的にデータ圧縮を
行う装置に関するものである。
[Industrial Application Field] The present invention relates to a data compression device.
In particular, the present invention relates to a device that effectively compresses data when the same code string is consecutive.

【0002】0002

【従来の技術】従来のこの種のデータ圧縮装置を図5に
示す。この装置は、1バイトで1文字を表す符号の列を
入力とし、同一の符号列が連続して入力された場合には
、文字列の繰り返しを表す予め決められた圧縮符号を出
力するものである。参照領域レジスタ501と比較領域
レジスタ502とは、いずれも1バイト単位で符号をシ
フトするシフトレジスタであり、データ圧縮すべき符号
列は入力データとしてレジスタ501に入力され、1バ
イトずつシフトされてレジスタ501からレジスタ50
2へと移動する。比較回路503はレジスタ501,5
02に保持された符号を1つずつ(1バイトずつ)順次
比較し、同一の文字列が連続していることを検出するた
めのものである。制御回路504は以上の各部を制御し
、比較回路503の検出結果にもとづいて圧縮符号を出
力する。
2. Description of the Related Art A conventional data compression device of this type is shown in FIG. This device receives a string of codes representing one character per byte as input, and when the same code string is input consecutively, it outputs a predetermined compression code that represents the repetition of the string. be. The reference area register 501 and the comparison area register 502 are both shift registers that shift codes in 1-byte units, and the code string to be data compressed is input to the register 501 as input data, shifted 1 byte at a time, and then stored in the register. 501 to register 50
Move to 2. Comparison circuit 503 includes registers 501 and 5
This is to sequentially compare the codes held in 02 one by one (one byte at a time) and detect whether the same character string is consecutive. The control circuit 504 controls each of the above sections and outputs a compressed code based on the detection result of the comparison circuit 503.

【0003】動作を説明すると、制御回路504は比較
回路503を制御してまず、レジスタ501の先頭の符
号と同じ符号をレジスタ502より捜し出し、もし同じ
符号が見つかったときは、その符号以降のレジスタ50
2に保持された符号列と、レジスタ501の先頭からの
符号列とを1符号ずつ比較する。そして、レジスタ50
2の上記最初に捜し出した符号の1つ前の符号まですべ
て一致したなら、同一の符号列が連続していると判断し
、圧縮符号を出力する。
To explain the operation, the control circuit 504 controls the comparison circuit 503 to first search the register 502 for the same code as the first code of the register 501, and if the same code is found, the registers after that code are searched for. 50
The code string held in the register 501 is compared one code at a time with the code string from the beginning of the register 501. And register 50
If all the codes up to the code immediately preceding the first code found in step 2 match, it is determined that the same code string is continuous, and a compressed code is output.

【0004】レジスタ501の先頭の符号と同じ符号が
レジスタ502に保持されていなかった場合には、1符
号分だけ文字列をレジスタ502側にシフトし、新たに
レジスタ501の先頭となった符号について上述の比較
処理を行う。図6はこのような場合の例を示しており、
レジスタ501の先頭の文字“a”は、レジスタ502
には保持されていないので、文字列をレジスタ502側
に1文字分だけシフトする。
[0004] If the same code as the first code in register 501 is not held in register 502, the character string is shifted by one code to the register 502 side, and the new first code in register 501 is stored in register 502. Perform the comparison process described above. Figure 6 shows an example of such a case.
The first character “a” in register 501 is the first character “a” in register 502.
Since the character string is not held in the register 502, the character string is shifted by one character to the register 502 side.

【0005】また、レジスタ501の先頭の符号と同じ
符号がレジスタ502に保持されていても、以降の比較
処理で不一致となった場合にも、1符号分だけ文字列を
レジスタ502側にシフトし、新たにレジスタ501の
先頭となった符号について上述の比較処理を行う。図7
はこのような場合の例を示しており、レジスタ501の
先頭の文字“a”は、レジスタ502に保持されている
が、4番目の文字、すなわちeとdとを比較するとき、
不一致となるので、この場合にも文字列をレジスタ50
2側に1文字分だけシフトする。
[0005] Furthermore, even if the same code as the first code in register 501 is held in register 502, if a mismatch occurs in the subsequent comparison process, the character string is shifted by one code to register 502. , the above-described comparison process is performed on the code that has newly become the head of the register 501. Figure 7
shows an example of such a case, where the first character "a" of register 501 is held in register 502, but when comparing the fourth character, that is, e and d,
Since there will be a mismatch, the character string will be stored in register 50 in this case as well.
Shift one character to the 2nd side.

【0006】このような操作を繰り返すことにより、連
続する同一の文字列を検出し、後続の文字列を圧縮符号
で表すことによってデータ圧縮が行われる。
[0006] By repeating such operations, consecutive identical character strings are detected, and data compression is performed by representing the subsequent character strings with compression codes.

【0007】[0007]

【発明が解決しようとする課題】しかしこのような従来
のデータ圧縮装置では、2つのレジスタ501,502
に符号列を入力して符号の比較を行うので、レジスタに
符号を満たすための時間が必要であり、また、レジスタ
502で符号の検索を行うのでそのためにも時間がかか
るという問題がある。
However, in such a conventional data compression device, two registers 501 and 502
Since the code strings are input into the register 502 and the codes are compared, time is required to fill the register with the codes.Furthermore, since the register 502 is used to search for codes, it also takes time.

【0008】本発明の目的は、このような問題を解決し
、データ圧縮に要する時間を大幅に短縮したデータ圧縮
装置を提供することにある。
SUMMARY OF THE INVENTION An object of the present invention is to provide a data compression device that solves these problems and significantly reduces the time required for data compression.

【0009】[0009]

【課題を解決するための手段】本発明は、同一の符号列
が連続して入力されたとき所定の圧縮符号を出力するデ
ータ圧縮装置において、符号が入力されるごとに1ずつ
増加するカウンタと、前記符号の種類とそれぞれ対応し
、対応する種類の符号が入力されたとき、前記カウンタ
の計数値を保持する複数の対応レジスタと、入力された
前記符号の種類に対応する前記対応レジスタが保持して
いる値と、一つ前に入力された前記符号の種類に対応す
る前記対応レジスタが保持していた値に1を加えた値と
が一致したとき一致検出信号を出力し、一致しないとき
不一致検出信号を出力する比較手段と、前記比較手段が
前記不一致検出信号を出力したとき、前記カウンタの計
数値を保持する開始レジスタと、前記符号が入力され、
前記比較手段が前記一致検出信号を出力したとき、一つ
前に入力された前記符号に対応する前記対応レジスタが
保持していた値に2を加えた値と、前記開始レジスタが
保持している値とが一致したとき、前記圧縮符号を出力
する圧縮符号生成手段とを備えたことを特徴とする。
[Means for Solving the Problems] The present invention provides a data compression device that outputs a predetermined compression code when the same code string is continuously input, and a counter that increases by one each time a code is input. , a plurality of corresponding registers each corresponding to the type of code and holding the count value of the counter when a code of the corresponding type is input, and a plurality of corresponding registers corresponding to the type of the input code held. A match detection signal is output when the current value and the value obtained by adding 1 to the value held in the corresponding register corresponding to the previously input code type, and when they do not match. a comparison means for outputting a mismatch detection signal; a start register for holding a counted value of the counter when the comparison means outputs the mismatch detection signal; the code is input;
When the comparison means outputs the coincidence detection signal, a value obtained by adding 2 to the value held in the corresponding register corresponding to the previously input code and a value held in the start register. and compressed code generating means that outputs the compressed code when the values match.

【0010】0010

【実施例】次に本発明の実施例について説明する。図1
に本発明によるデータ圧縮装置の一例を示す。この装置
は、1バイトで1文字を表す符号の列を入力とし、同一
の符号列が連続して入力された場合には、文字列の繰り
返しを表す予め決められた圧縮符号を挿入するものであ
る。そして、入力データとして入力された符号の順番を
表す値、すなわち順番値を保持するレジスタを備えたマ
ップ部1と、符号の順番値にもとづいてすでに入力され
た符号列と同一の符号列を検出する比較部2と、符号列
が連続していることを検出して、所定の圧縮符号を符号
列に挿入する生成部3と、データ圧縮後の符号列を、必
要に応じて同期処理などを行い、出力データとして出力
する出力部4とにより構成されている。
[Example] Next, an example of the present invention will be described. Figure 1
An example of a data compression device according to the present invention is shown in FIG. This device accepts a string of codes representing one character per byte as input, and if the same code string is input consecutively, it inserts a predetermined compression code that represents the repetition of the string. be. Then, a map unit 1 equipped with a register that holds a value representing the order of codes input as input data, that is, an order value, detects a code string that is the same as a code string that has already been input based on the order value of the codes. A comparison unit 2 detects that the code string is continuous and inserts a predetermined compression code into the code string, and a generation unit 3 inserts a predetermined compressed code into the code string, and performs synchronization processing etc. on the code string after data compression as necessary. and an output section 4 that outputs the data as output data.

【0011】マップ部1は図2に示すような構成となっ
ている。入力ポート101は入力データとして1つの符
号が入力されると、そのことをカウンタ104に通知し
、また入力された符号をデコーダ102とセレクタ10
3とに出力する。カウンタ104は入力ポート101か
ら通知があるごとに1ずつ増加するものであり、初期値
は0で、511まで計数した後、次に入力通知では1か
ら計数を開始する。対応レジスタ群105は、符号の種
類にそれぞれ対応する複数のレジスタからなり、各レジ
スタは9ビットで、初期値は0となっている。デコーダ
102は、入力ポート101から符号を受け取ると、そ
の符号に対応する対応レジスタ群105のレジスタを選
出し、駆動する。そして、保持している値をセレクタ1
03に出力させ、セレクタ103の後述する選択動作の
後、カウンタ104の計数値を取り込ませ、保持させる
。有効レジスタ106は比較部2の後述するSレジスタ
201からの順番値を保持する9ビットのレジスタであ
る。セレクタ103は、対応レジスタ群105が出力す
る値が、有効レジスタの値以上で、かつカウンタの計数
値未満のとき、入力ポート101からの符号およびカウ
ンタ104の計数値を生成部3に出力し、また対応レジ
スタからの値を比較部2に出力する。一方、対応レジス
タ群105が出力する値が上記の範囲外のときは、入力
ポート101からの符号を直接、出力部4に出力する。
The map section 1 has a configuration as shown in FIG. When input port 101 receives one code as input data, it notifies counter 104 of this fact, and also sends the input code to decoder 102 and selector 10.
Output to 3. The counter 104 is incremented by 1 every time there is a notification from the input port 101, and its initial value is 0, and after counting up to 511, it starts counting from 1 for the next input notification. The corresponding register group 105 consists of a plurality of registers each corresponding to the type of code, and each register has 9 bits and has an initial value of 0. When the decoder 102 receives a code from the input port 101, it selects and drives the register of the corresponding register group 105 that corresponds to the code. Then, select the value held by selector 1
03, and after the selection operation of the selector 103, which will be described later, the counted value of the counter 104 is taken in and held. The valid register 106 is a 9-bit register that holds the order value from the S register 201 of the comparator 2, which will be described later. The selector 103 outputs the code from the input port 101 and the count value of the counter 104 to the generation unit 3 when the value output by the corresponding register group 105 is greater than or equal to the value of the valid register and less than the count value of the counter, It also outputs the value from the corresponding register to the comparator 2. On the other hand, when the value output by the corresponding register group 105 is outside the above range, the code from the input port 101 is directly output to the output unit 4.

【0012】比較部2は図3に示すような構成となって
いる。Sレジスタ201は9ビットのレジスタであり、
セレクタ103から順番値が送られてきたとき、それを
保持し、比較器204とマップ部1の有効レジスタ10
6に出力する。加算器202はSレジスタ201が出力
する順番値に1を加えて出力する。Tレジスタ203は
9ビットのレジスタであり、加算器202が出力する値
を保持し、またそれを比較器204と、生成部3の後述
する比較器302とに出力する。比較器204はレジス
タ201,203が保持する値を比較し、それらが一致
したときは0を、一致しなかったときは1を生成部3の
後述する制御回路303に出力する。
The comparison section 2 has a configuration as shown in FIG. The S register 201 is a 9-bit register,
When the order value is sent from the selector 103, it is held and sent to the comparator 204 and the valid register 10 of the map unit 1.
Output to 6. Adder 202 adds 1 to the order value output by S register 201 and outputs the result. The T register 203 is a 9-bit register, holds the value output by the adder 202, and outputs it to the comparator 204 and a comparator 302 of the generation unit 3, which will be described later. Comparator 204 compares the values held by registers 201 and 203, and outputs 0 when they match, and outputs 1 when they do not match to control circuit 303 of generation unit 3, which will be described later.

【0013】生成部3は図4に示すような構成となって
いる。開始レジスタ301は比較器204が1を出力し
たとき、そのときのカウンタ104の計数値、すなわち
符号の順番値を、後述する制御回路303の制御にもと
づいて保持する。なお、開始レジスタ301の初期値は
1である。比較器302は、開始レジスタ301が保持
する順番値とTレジスタ203が保持する値に1を加え
た値とを比較し、それらが一致したときは0を、一致し
ないときは1を出力する。8ビットレジスタ304はセ
レクタ103からの符号を保持するためのレジスタであ
る。バッファ305はセレクタ103からの符号をレジ
スタ304を通じて受け取り、連続する同一の符号列、
あるいはその候補を保持する。
The generating section 3 has a configuration as shown in FIG. When the comparator 204 outputs 1, the start register 301 holds the count value of the counter 104 at that time, that is, the order value of the sign, under the control of the control circuit 303 described later. Note that the initial value of the start register 301 is 1. Comparator 302 compares the order value held by start register 301 and the value held by T register 203 plus 1, and outputs 0 if they match, and 1 if they do not match. The 8-bit register 304 is a register for holding the code from the selector 103. The buffer 305 receives the code from the selector 103 through the register 304, and stores the same consecutive code string,
Or keep that candidate.

【0014】制御回路303は、比較器204が0を出
力する間、セレクタ103からの符号をレジスタ304
を通じてバッファ305に取り込ませ、保持させる。ま
た、比較器204が1を出力したときは、セレクタ10
3からの符号はバッファ305の手前のレジスタ304
にとどめておく。開始レジスタ301が保持する値と、
Tレジスタ203からの値に1を加えた値とが等しいと
き、すなわち比較器302が0を出力したとき、連続す
る同一の文字列が検索されたことになり、制御回路30
3は所定の圧縮符号を出力部4に出力する。その後、制
御回路303は、開始レジスタ301の値を有効レジス
タ106に送り、また、開始レジスタにはカウンタの値
に1を加えた値を格納させ、バッファ305を初期化す
る。制御回路303は、Tレジスタ203が初期状態で
はなく、その値が0以外のとき、比較器204が1を出
力した場合には、バッファ305が保持する符号列は繰
り返し符号列ではないことになるので、バッファ305
内の符号を順次、出力部4に出力させ、その後、レジス
タ304にとどめておいた最後の符号をバッファ305
に格納させる。そして、開始レジスタにはカウンタ10
4の計数値を保持させ、有効レジスタにはSレジスタ2
01の値を保持させる。比較器204が1を出力した場
合でも、Tレジスタ203からの値が0のときは、開始
レジスタ301にカウンタ104の計数値を格納させた
後、次の符号の入力に移る。
The control circuit 303 stores the sign from the selector 103 in the register 304 while the comparator 204 outputs 0.
The data is taken into the buffer 305 and held there. Further, when the comparator 204 outputs 1, the selector 10
The code from 3 is stored in the register 304 before the buffer 305.
I'll keep it to that. The value held by the start register 301 and
When the value obtained by adding 1 to the value from the T register 203 is equal, that is, when the comparator 302 outputs 0, it means that the same consecutive character string has been searched, and the control circuit 30
3 outputs a predetermined compression code to the output section 4. Thereafter, the control circuit 303 sends the value of the start register 301 to the valid register 106, stores a value obtained by adding 1 to the value of the counter in the start register, and initializes the buffer 305. The control circuit 303 determines that when the T register 203 is not in its initial state and its value is other than 0, and the comparator 204 outputs 1, the code string held by the buffer 305 is not a repeated code string. So buffer 305
The codes within are sequentially output to the output unit 4, and then the last code retained in the register 304 is output to the buffer 305.
be stored in And the start register has a counter 10.
The count value of 4 is held, and the effective register is S register 2.
The value of 01 is held. Even if the comparator 204 outputs 1, if the value from the T register 203 is 0, the count value of the counter 104 is stored in the start register 301, and then the process moves to input the next code.

【0015】次に、具体的な文字列を例にとり、動作を
説明する。まず、初期状態ではカウンタ104の計数値
、対応レジスタ群105およびTレジスタ203が保持
する値はすべて0であり、有効レジスタ106、開始レ
ジスタ301が保持する値は1となっている。レジスタ
201,304およびバッファ305については初期値
は任意である。
Next, the operation will be explained using a specific character string as an example. First, in the initial state, the count value of the counter 104, the values held by the corresponding register group 105 and the T register 203 are all 0, and the values held by the valid register 106 and the start register 301 are 1. The initial values for registers 201, 304 and buffer 305 are arbitrary.

【0016】文字列として“abcdefabcabc
…”が入力されたとする。第1番目の文字“a”の符号
が入力されると、入力ポート101がそのことをカウン
タ104に通知し、その結果カウンタ104はその計数
値を1だけ増加させ、第1番目の文字“a”の順番値1
を出力する。一方、入力ポート101は上記符号をデコ
ーダ102に与え、デコーダ102はその符号に対応す
る、すなわち文字“a”に対応する対応レジスタ群10
5の対応レジスタを駆動する。対応レジスタ群105の
レジスタはすべて初期化され、0を保持しているので、
駆動されたレジスタは0をセレクタ103に出力する。 そして、その値は有効レジスタ106が保持する値以上
、カウンタ104の計数値未満の範囲外であるため、セ
レクタ103は文字“a”を直接、出力部4に出力する
。その後、駆動された対応レジスタはカウンタ104の
計数値、すなわち第1番目の文字“a”の順番値1を保
持する。一方、出力部4は文字“a”を受け取ると、同
期処理などを行って出力する。第6番目の文字“f”ま
での各文字についてマップ部1および出力部4は同様に
動作し、各文字の対応レジスタにはその順番値が保持さ
れ、また各文字は出力部4から出力される。
"abcdefabcabc" as a character string
..." is input. When the sign of the first character "a" is input, the input port 101 notifies the counter 104 of this fact, and as a result, the counter 104 increases its count value by 1. , the order value of the first character “a” is 1
Output. On the other hand, the input port 101 supplies the above code to the decoder 102, and the decoder 102 sends the corresponding register group 10 corresponding to the code, that is, corresponding to the character "a"
5 corresponding registers are driven. All registers in the corresponding register group 105 are initialized and hold 0, so
The driven register outputs 0 to the selector 103. Since the value is outside the range of greater than or equal to the value held by the valid register 106 and less than the counted value of the counter 104, the selector 103 directly outputs the character "a" to the output unit 4. Thereafter, the driven corresponding register holds the count value of the counter 104, that is, the order value 1 of the first character "a". On the other hand, when the output unit 4 receives the character "a", it performs a synchronization process and outputs it. The map section 1 and the output section 4 operate in the same manner for each character up to the sixth character "f", and the corresponding register for each character holds its order value, and each character is output from the output section 4. Ru.

【0017】次に第7番目の文字“a”が入力されると
、カウンタ104は計数値として7を出力し、また、対
応レジスタ群105の文字“a”に対応するレジスタが
再び駆動される。この場合には駆動されたレジスタの値
は第1番目の文字“a”の順番値1となっており、有効
レジスタ106の値1以上でカウンタの計数値7未満の
範囲に入っているので、セレクタ103は文字“a”お
よびカウンタ104の計数値7を生成部3に、また文字
“a”の対応レジスタの値を比較部2にそれぞれ出力す
る。
Next, when the seventh character "a" is input, the counter 104 outputs 7 as the count value, and the register corresponding to the character "a" in the corresponding register group 105 is driven again. . In this case, the value of the driven register is the order value 1 of the first character "a", and the value of the valid register 106 is in the range of 1 or more and less than the count value of the counter 7, so The selector 103 outputs the character "a" and the count value 7 of the counter 104 to the generating section 3, and outputs the value of the register corresponding to the character "a" to the comparing section 2.

【0018】比較部2では、セレクタ103からの文字
“a”の対応レジスタの値1はSレジスタ201に保持
され、比較器204はこのSレジスタ201の値1と、
このときTレジスタ203が保持している値0(初期値
)とを比較し、それらは一致しないので1を生成部3に
出力する。その後、Tレジスタ203は、加算器202
が出力するSレジスタ201の値1に1を加えた値2を
保持する。この値は第2番目の文字“b”の順番値とな
っている。
In the comparator 2, the value 1 of the register corresponding to the character "a" from the selector 103 is held in the S register 201, and the comparator 204 stores the value 1 of the S register 201 and
At this time, it is compared with the value 0 (initial value) held in the T register 203, and since they do not match, 1 is output to the generation unit 3. After that, the T register 203 is added to the adder 202.
The value 2 obtained by adding 1 to the value 1 of the S register 201 output by the S register 201 is held. This value is the ordinal value of the second character "b".

【0019】生成部3では、制御回路303は比較器2
04からの出力値1を受け取るので、このときセレクタ
103が出力しているカウンタ104の計数値7を開始
レジスタ301に保持させる。すなわち比較器204が
1を出力したので、マップ部1からの文字“a”は連続
する文字列の先頭の文字である可能性があり、開始レジ
スタ301はその順番値7を保持したことになる。制御
回路303はまた、マップ部1のセレクタ103からの
文字“a”をレジスタ304に格納させる。
In the generating section 3, the control circuit 303 controls the comparator 2.
Since the output value 1 from 04 is received, the count value 7 of the counter 104 output by the selector 103 at this time is held in the start register 301. In other words, since the comparator 204 outputs 1, there is a possibility that the character "a" from the map unit 1 is the first character of a continuous character string, and the start register 301 holds its order value 7. . The control circuit 303 also causes the character “a” from the selector 103 of the map section 1 to be stored in the register 304.

【0020】次に第8番目の文字“b”が入力されると
、カウンタ104は計数値として8を出力し、また、対
応レジスタ群105の文字“b”に対応するレジスタが
再び駆動される。この場合には駆動されたレジスタの値
は第2番目の文字“b”の順番値2となっており、有効
レジスタ106の値1以上でカウンタの計数値8未満の
範囲に入っているので、セレクタ103は文字“b”お
よびカウンタ104の計数値8を生成部3に、また文字
“b”の対応レジスタの値2を比較部2にそれぞれ出力
する。
Next, when the eighth character "b" is input, the counter 104 outputs 8 as the count value, and the register corresponding to the character "b" in the corresponding register group 105 is driven again. . In this case, the value of the driven register is the order value 2 of the second character "b", and the value of the valid register 106 is in the range of 1 or more and less than the count value of the counter 8, so The selector 103 outputs the character "b" and the count value 8 of the counter 104 to the generating section 3, and outputs the value 2 of the register corresponding to the character "b" to the comparing section 2.

【0021】比較部2では、セレクタ103からの文字
“b”の対応レジスタの値2はSレジスタ201に保持
され、比較器204はこのSレジスタ201の値2と、
このときTレジスタ203が保持している値2とを比較
し、この場合にはそれらが一致するので0を生成部3に
出力する。その後、Tレジスタ203は、加算器202
が出力するSレジスタ201の値2に1を加えた3を保
持する。この値は第3番目の文字“c”の順番値となっ
ている。
In the comparator 2, the value 2 of the register corresponding to the character "b" from the selector 103 is held in the S register 201, and the comparator 204 stores the value 2 of the S register 201 and
At this time, it is compared with the value 2 held in the T register 203, and in this case, since they match, 0 is output to the generation unit 3. After that, the T register 203 is added to the adder 202.
The S register 201 outputs the value 2 plus 1, which is 3. This value is the ordinal value of the third character "c".

【0022】生成部3では、制御回路303は比較器2
04からの出力値0を受け取るので、この第8番目の文
字は連続する文字列を構成する文字である可能性があり
、そのため、開始レジスタ301はそのままとし(順番
値7を保持)、マップ部1のセレクタ103からの文字
“b”をレジスタ304を通じて、レジスタ304に保
持されていた文字“a”と共にバッファ305に格納さ
せる。その結果、バッファ305に格納された文字は“
ab”となる。また、比較器302は開始レジスタ30
1の値7とTレジスタ203の値2(更新前の値)に1
を加えた値3とを比較するが,それらは一致しないので
1を出力し、その結果、制御回路303はバッファ30
5に格納されている文字列“ab”は連続する文字列と
はまだ判断できないとして、圧縮符号の送出は行わない
In the generation section 3, the control circuit 303 controls the comparator 2.
Since we receive the output value 0 from 04, this 8th character may be a character that forms a continuous string, so we leave the start register 301 as is (holds the order value 7) and change the map part to The character "b" from the selector 103 of No. 1 is stored in the buffer 305 along with the character "a" held in the register 304 through the register 304. As a result, the characters stored in the buffer 305 are “
ab”. Also, the comparator 302 inputs the start register 30
1 value 7 and T register 203 value 2 (value before update) is 1
However, since they do not match, the control circuit 303 outputs 1, and as a result, the control circuit 303 outputs the buffer 30.
Since the character string "ab" stored in No. 5 cannot yet be determined to be a continuous character string, the compressed code is not transmitted.

【0023】次に第9番目の文字“c”がマップ部1に
入力された場合も、各部は第8番目の文字“b”の場合
と同様に動作し、Tレジスタ203の値は第4番目の文
字“d”の順番値である4、バッファ305の文字列は
“abc”となり、圧縮符号の送出は行われない。
Next, when the 9th character "c" is input to the map section 1, each section operates in the same way as in the case of the 8th character "b", and the value of the T register 203 is set to the 4th character. The order value of the th character "d" is 4, the character string in the buffer 305 is "abc", and no compression code is sent.

【0024】次に第10番目の文字“a”が入力される
と、カウンタは計数値として10を出力し、また、対応
レジスタ群105の文字“a”に対応するレジスタが再
び駆動される。この場合には駆動されたレジスタの値は
第7番目の文字“a”の順番値7となっており、有効レ
ジスタ106の値1以上でカウンタの計数値10未満の
範囲に入っているので、セレクタ103は文字“a”お
よびカウンタ104の計数値10を生成部3に、また文
字“a”の対応レジスタの値7を比較部2にそれぞれ出
力する。
Next, when the tenth character "a" is input, the counter outputs 10 as a count value, and the register corresponding to the character "a" in the corresponding register group 105 is driven again. In this case, the value of the driven register is the order value 7 of the seventh character "a", and the value of the valid register 106 is in the range of 1 or more and less than the count value of the counter 10, so The selector 103 outputs the character "a" and the count value 10 of the counter 104 to the generating section 3, and outputs the value 7 of the register corresponding to the character "a" to the comparing section 2.

【0025】比較部2では、セレクタ103からの文字
“a”の対応レジスタの値7はSレジスタ201に保持
され、比較器204はこのSレジスタ201の値7と、
このときTレジスタ203が保持している値4とを比較
し、この場合にはそれらが一致しないので1を生成部3
に出力する。その後、Tレジスタ203は、加算器20
2が出力するSレジスタ201の値7に1を加えた値8
を保持する。この値は第8番目の文字“b”の順番値と
なっている。
In the comparator 2, the value 7 of the register corresponding to the character "a" from the selector 103 is held in the S register 201, and the comparator 204 stores the value 7 of the S register 201 and
At this time, the value 4 held in the T register 203 is compared with the value 4 held by the T register 203, and in this case, since they do not match, the generation unit 3
Output to. After that, the T register 203 is added to the adder 20
The value 8 is the sum of 1 and the value 7 of the S register 201 output by 2.
hold. This value is the ordinal value of the eighth character "b".

【0026】生成部3では、制御回路303は比較器2
04からの出力値1を受け取るので、このときセレクタ
103が出力しているカウンタ104の計数値10を開
始レジスタ301に保持させる。すなわち比較器204
が1を出力したので、マップ部1からの文字“a”は新
たな連続する文字列の先頭の文字である可能性があり、
開始レジスタ301はその順番値10を保持したことに
なる。制御回路303はまた、マップ部1のセレクタ1
03からの文字“a”をレジスタ304に格納させ、バ
ッファ305が保持する文字列“abc”を出力部4に
出力させる。制御部303はまたこのとき有効レジスタ
106に、Sレジスタ201が保持している第7番目の
文字“a”の順番値7を保持させる。出力部4は生成部
3から文字列“abc”を受け取ると、それを出力する
。すなわち、この場合には開始レジスタ301の値と、
Tレジスタ203の値に1を加えた値が一致する前に、
比較器204が1を出力したので、連続する文字列の可
能性があるとしてバッファ305に格納していた文字列
“abc”はそうでないことが判明し、文字列“abc
”をそのまま出力したことになる。
In the generation section 3, the control circuit 303 controls the comparator 2.
Since the output value 1 from 04 is received, the count value 10 of the counter 104 output by the selector 103 at this time is held in the start register 301. That is, comparator 204
outputs 1, so the character "a" from map part 1 may be the first character of a new continuous string,
The start register 301 holds its order value 10. The control circuit 303 also controls the selector 1 of the map section 1.
The character "a" from 03 is stored in the register 304, and the character string "abc" held in the buffer 305 is outputted to the output unit 4. At this time, the control unit 303 also causes the valid register 106 to hold the order value 7 of the seventh character "a" held in the S register 201. When the output section 4 receives the character string "abc" from the generation section 3, it outputs it. That is, in this case, the value of the start register 301 and
Before the value of T register 203 plus 1 matches,
Since the comparator 204 outputs 1, it turns out that the character string “abc”, which was stored in the buffer 305 with the possibility of being a continuous character string, is not, and the character string “abc
” is output as is.

【0027】第11番目の文字“b”および第12番目
の文字“c”に対しては、第8番目および第9番目の文
字の場合と同様の処理が行われるが、ただし第12番目
の文字“c”の場合には、Tレジスタ203からの値が
9となるので、それに1を加えた値10は開始レジスタ
301の値に一致し、比較器302は0を出力する。従
って制御回路303はそのときバッファ305に格納さ
れている文字列“abc”はそれに先行する第7番目の
文字からの文字列に連続して繰り返された文字列である
と判断し、圧縮符号を送出する。ただし、最後の文字列
の後、さらに文字列“abc”が連続する可能性がある
ので、制御部303が実際に圧縮符号を送出するのは、
この文字列が連続しないことが確認された後となる。
The 11th character "b" and the 12th character "c" are processed in the same way as the 8th and 9th characters, except that the 12th character In the case of the letter "c", the value from the T register 203 is 9, so the value 10 obtained by adding 1 to it matches the value of the start register 301, and the comparator 302 outputs 0. Therefore, the control circuit 303 determines that the character string "abc" stored in the buffer 305 at that time is a character string continuously repeated from the seventh character preceding it, and applies the compression code to the character string "abc". Send. However, since there is a possibility that the character string "abc" continues after the last character string, the control unit 303 actually sends the compression code as follows.
This occurs after it has been confirmed that this string is not consecutive.

【0028】その後、制御回路303は、有効レジスタ
106に開始レジスタ301の値10を保持させ、続く
処理において先行する同一の文字を第10番目の文字以
降で見つけるようにする。
Thereafter, the control circuit 303 causes the valid register 106 to hold the value 10 of the start register 301, so that in subsequent processing, the same preceding character is found from the 10th character onward.

【0029】以上の動作により、入力データ“abcd
efabcabc…”に対して、このデータ圧縮装置か
らは“abcdefabc(圧縮符号)…”が圧縮され
たデータとして出力されることになる。
By the above operation, the input data "abcd
efabcabc...", this data compression device outputs "abcdefabc (compression code)..." as compressed data.

【0030】[0030]

【発明の効果】以上説明したように本発明のデータ圧縮
装置では、符号の種類ごとに、その種類の符号の順番値
を格納するレジスタを設け、これらレジスタに格納され
た符号類の符号の順番値を格納するレジスタを設け、こ
れらレジスタに格納された符号の順番値にもとづいて連
続する繰り返し符号列を検出するようにしている。従っ
て、従来のように符号自体の比較は行わないので、符号
をシフトレジスタに入力する必要はなく、符号の検索も
不要である。その結果、データ圧縮に要する時間を大幅
に短縮することが可能となる。
As explained above, in the data compression device of the present invention, for each type of code, a register is provided to store the order value of the code of that type, and the order of the codes of the code classes stored in these registers is stored. Registers are provided to store values, and consecutive repeated code strings are detected based on the order values of the codes stored in these registers. Therefore, unlike the conventional method, the codes themselves are not compared, so there is no need to input the codes into the shift register, and there is no need to search for codes. As a result, it becomes possible to significantly reduce the time required for data compression.

【図面の簡単な説明】[Brief explanation of the drawing]

【図1】本発明のデータ圧縮装置の一例を示すブロック
図である。
FIG. 1 is a block diagram showing an example of a data compression device of the present invention.

【図2】図1のデータ圧縮装置を構成するマップ部を詳
しく示すブロック図である。
FIG. 2 is a block diagram showing in detail a map section configuring the data compression device of FIG. 1;

【図3】図1のデータ圧縮装置を構成する比較部を詳し
く示すブロック図である。
FIG. 3 is a block diagram illustrating in detail a comparison section that constitutes the data compression device of FIG. 1;

【図4】図1のデータ圧縮装置を構成する生成部を詳し
く示すブロック図である。
FIG. 4 is a block diagram showing in detail a generation unit that constitutes the data compression device of FIG. 1;

【図5】従来のデータ圧縮装置の一例を示すブロック図
である。
FIG. 5 is a block diagram showing an example of a conventional data compression device.

【図6】従来のデータ圧縮装置の動作を説明するための
図である。
FIG. 6 is a diagram for explaining the operation of a conventional data compression device.

【図7】従来のデータ圧縮装置の動作を説明するための
図である。
FIG. 7 is a diagram for explaining the operation of a conventional data compression device.

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

1  マップ部 2  比較部 3  生成部 4  出力部 101  入力ポート 102  デコーダ 103  セレクタ 104  カウンタ 105  対応レジスタ群 106  有効レジスタ 201  Sレジスタ 202  加算器 203  Tレジスタ 204,302  比較器 301  開始レジスタ 303  制御回路 304  8ビットレジスタ 305  バッファ 1 Map section 2 Comparison section 3 Generation part 4 Output section 101 Input port 102 Decoder 103 Selector 104 Counter 105 Corresponding register group 106 Valid register 201 S register 202 Adder 203 T register 204,302 Comparator 301 Start register 303 Control circuit 304 8-bit register 305 Buffer

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】同一の符号列が連続して入力されたとき所
定の圧縮符号を出力するデータ圧縮装置において、符号
が入力されるごとに1ずつ増加するカウンタと、前記符
号の種類とそれぞれ対応し、対応する種類の符号が入力
されたとき、前記カウンタの計数値を保持する複数の対
応レジスタと、入力された前記符号の種類に対応する前
記対応レジスタが保持している値と、一つ前に入力され
た前記符号の種類に対応する前記対応レジスタが保持し
ていた値に1を加えた値とが一致したとき一致検出信号
を出力し、一致しないとき不一致検出信号を出力する比
較手段と、前記比較手段が前記不一致検出信号を出力し
たとき、前記カウンタの計数値を保持する開始レジスタ
と、前記符号が入力され、前記比較手段が前記一致検出
信号を出力したとき、一つ前に入力された前記符号に対
応する前記対応レジスタが保持していた値に2を加えた
値と、前記開始レジスタが保持している値とが一致した
とき、前記圧縮符号を出力する圧縮符号生成手段とを備
えたことを特徴とするデータ圧縮装置。
Claim 1: A data compression device that outputs a predetermined compression code when the same code string is continuously input, comprising: a counter that increases by 1 each time a code is input, and a counter corresponding to each type of code; When a corresponding type of code is input, a plurality of corresponding registers that hold the count values of the counter, and one value held by the corresponding register corresponding to the input type of code. Comparing means outputs a coincidence detection signal when a value obtained by adding 1 to the value held in the corresponding register corresponding to the previously input code type matches, and outputs a mismatch detection signal when they do not match. When the comparison means outputs the coincidence detection signal, the start register for holding the counted value of the counter, and the code are input, and when the comparison means outputs the coincidence detection signal, the start register holds the count value of the counter, and when the comparison means outputs the coincidence detection signal, Compressed code generating means that outputs the compressed code when a value obtained by adding 2 to the value held in the corresponding register corresponding to the input code matches the value held in the start register. A data compression device comprising:
JP4225191A 1991-02-15 1991-02-15 Data compressor Pending JPH04261226A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4225191A JPH04261226A (en) 1991-02-15 1991-02-15 Data compressor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4225191A JPH04261226A (en) 1991-02-15 1991-02-15 Data compressor

Publications (1)

Publication Number Publication Date
JPH04261226A true JPH04261226A (en) 1992-09-17

Family

ID=12630810

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4225191A Pending JPH04261226A (en) 1991-02-15 1991-02-15 Data compressor

Country Status (1)

Country Link
JP (1) JPH04261226A (en)

Similar Documents

Publication Publication Date Title
US6215906B1 (en) Data compression and restoration system for encoding an input character on the basis of a conditional appearance rate obtained in relation to an immediately preceding character string
JP3285354B2 (en) Maximum value search circuit
US5229768A (en) Adaptive data compression system
US5406278A (en) Method and apparatus for data compression having an improved matching algorithm which utilizes a parallel hashing technique
US5936560A (en) Data compression method and apparatus performing high-speed comparison between data stored in a dictionary window and data to be compressed
US4314356A (en) High-speed term searcher
WO1993017503A1 (en) Data compression using hashing
US5353024A (en) Method for data compression having an improved encoding algorithm which utilizes a token stacking technique
US20060114136A1 (en) Method and apparatus for selecting particular decoder based on bitstream format detection
US6301389B1 (en) Video image color encoding
JPS6068729A (en) Method and device for compressing digital data
US7109895B1 (en) High performance Lempel Ziv compression architecture
US9372887B2 (en) Compression ratio improvement by lazy match evaluation on the string search CAM
US4866440A (en) Method for compressing and restoring data series and apparatus for realizing same
US8248279B2 (en) History buffer apparatus and method for adaptive lossless data compression
JPH04261226A (en) Data compressor
US9344113B1 (en) Lempel Ziv compression architecture
JPH0764765A (en) Data compressing device and data restoring device
KR100481204B1 (en) Data compression method and apparatus with embedded run-length encoding
US6658026B1 (en) Method in connection with serial data transfer to recognize a fixed pattern
EP0977152A2 (en) Data compression apparatus using matching string
JPH06202844A (en) Data compression/restoration processing device
JPH0650478B2 (en) Data compression storage system
JP3409549B2 (en) Parallel signal conversion circuit and parallel signal synchronization circuit
JPH04332035A (en) Data compressing device