JPH056260A - Japanese data compressing system - Google Patents

Japanese data compressing system

Info

Publication number
JPH056260A
JPH056260A JP15658791A JP15658791A JPH056260A JP H056260 A JPH056260 A JP H056260A JP 15658791 A JP15658791 A JP 15658791A JP 15658791 A JP15658791 A JP 15658791A JP H056260 A JPH056260 A JP H056260A
Authority
JP
Japan
Prior art keywords
data
character
compression
byte
compressed
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
JP15658791A
Other languages
Japanese (ja)
Inventor
Yoshihisa Aotani
嘉久 青谷
Yoshifumi Okada
好史 岡田
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 Platforms Ltd
NEC Corp
Original Assignee
NEC Corp
NEC AccessTechnica 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 NEC Corp, NEC AccessTechnica Ltd filed Critical NEC Corp
Priority to JP15658791A priority Critical patent/JPH056260A/en
Publication of JPH056260A publication Critical patent/JPH056260A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To efficiently compress Japanese data composed of two byte codes according to a run length encoding system by executing the preprocessing of compression to compress continuous character strings at every two strings. CONSTITUTION:In the preprocessing of compression, a data train A to be compressed is successively read for each character (high-order byte) and compared, the codes of the continuous characters and the number of continuous characters are recorded together with a special character showing the compression, and preprocessing data B of compression are prepared. Next, compressed data C are prepared by compressing low-order bytes. Thus, compressibility can be improved in comparison with data C' compressed by normal run length encoding.

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 more particularly to a compression system for Japanese data composed of 2 bytes.

【0002】[0002]

【従来の技術】従来のこの種のデータ圧縮方式は、1バ
イトキャラクタを1つの単位としてキャラクタがいくつ
か連続している場合には、それを圧縮を示す特殊文字と
繰り返し文字データと繰り返し回数とに変換することに
よりデータの縮小を実現していた。
2. Description of the Related Art In the conventional data compression system of this type, when a character is a sequence of one byte character and several characters are consecutive, a special character indicating compression, repeated character data, and the number of repetitions are used. Data was reduced by converting to.

【0003】図2に、従来のデータ圧縮方式を示す。被
圧縮データ1は、通常のランレングス(un−leng
th)圧縮処理部2で圧縮され、圧縮データ2を得てい
る。
FIG. 2 shows a conventional data compression method. The compressed data 1 is a normal run length (un-length).
th) Compressed by the compression processing unit 2 to obtain compressed data 2.

【0004】図3に、圧縮処理部2での上記変換のアル
ゴリズムを示すフローチャートを示。以下図3に従って
説明する。初めに、文字カウンタCcと繰り返しカウン
タCrが0に設定される(ステップS1,S2)。原デ
ータから1文字を読み出した後(ステップS3)、文字
カウンタCcが1だけ加算される(ステップS4)。文
字カウンタの値はこの読み出した文字と比較される(ス
テップS5)。最初のサイクルではこの比較は必ず真と
なり、原データが4個以上の繰り返し文字から構成され
ているかを調べるために読み出された文字は、バッファ
に格納される(ステップS6)。2回目以降のサイクル
では、原データから読み出された文字がバッファに格納
されている文字と比較される(ステップS7)。原文字
が格納されている文字と等しければ、4個以上の同じ文
字が繰り返されているので圧縮される。文字が格納され
ている文字と等しいとき、繰り返しカウンタCrは1つ
加算され(ステップS8)、そして他の文字が原データ
から読み出される。原文字が格納されている文字と等し
くなければ、繰り返しカウンタCrは4と比較される
(ステップS9)。より少なければ、3文字しか同じ文
字が繰り返されていないので圧縮は行われない。このよ
うにして繰り返しカウンタCrが4以上の時に、圧縮形
式が作成される(ステップS10)。
FIG. 3 is a flowchart showing an algorithm of the above conversion in the compression processing section 2. This will be described below with reference to FIG. First, the character counter Cc and the repeat counter Cr are set to 0 (steps S1 and S2). After reading one character from the original data (step S3), the character counter Cc is incremented by 1 (step S4). The value of the character counter is compared with the read character (step S5). In the first cycle, this comparison is always true, and the character read to check whether the original data is composed of four or more repeated characters is stored in the buffer (step S6). In the second and subsequent cycles, the character read from the original data is compared with the character stored in the buffer (step S7). If the original character is the same as the stored character, it is compressed because four or more same characters are repeated. When the character is equal to the stored character, the repeat counter Cr is incremented by 1 (step S8), and another character is read from the original data. If the original character is not equal to the stored character, the repeat counter Cr is compared with 4 (step S9). If less, no compression is performed because only three characters are repeated. In this way, when the repeat counter Cr is 4 or more, a compression format is created (step S10).

【0005】[0005]

【発明が解決しようとする課題】この従来のデータ圧縮
方式では、ASCIIコード等の1バイトコード文字か
らなるデータ列において、連続して同じキャラクタが出
現する場合にデータサイの縮小をはかることが可能であ
るが、シフトJISコード等の2バイトコード文字から
なるデータ列においては、たとえ同じキャラクタが連続
して出現しても、隣合う1バイトデータは等しくないた
めデータサイズの縮小ができないという問題点があっ
た。
In this conventional data compression method, it is possible to reduce the data size when the same character appears consecutively in a data string consisting of 1-byte code characters such as ASCII code. However, in a data string consisting of 2-byte code characters such as shift JIS code, even if the same character appears consecutively, the adjacent 1-byte data is not equal, so the data size cannot be reduced. was there.

【0006】本発明の目的は、このような問題点を解決
した日本語データ圧縮方式を提供すとにある。
An object of the present invention is to provide a Japanese data compression method that solves such problems.

【0007】[0007]

【課題を解決するための手段】本発明の日本語データ圧
縮方式は、同じキャラクタが連続するデータの圧縮を示
す特殊文字と繰り返し文字データと繰り返し回数とに変
換することにより、データサイズを縮小するデータ圧縮
方式に、特に、上位・下位の2バイトからなる日本語デ
ータにおいて、その上位バイトについて着目し、1バイ
トおきに(上位バイト)同じキャクタが連続するデータ
列を上位バイトの繰り返しを示す特殊文字と繰り返す文
字と繰り返し回数と下位バイトのみのデータ列とに変換
する前処理を付加したことを特徴とする。
According to the Japanese data compression method of the present invention, the data size is reduced by converting into a special character indicating the compression of data in which the same character is continuous, repeated character data, and the number of repetitions. In the data compression method, especially in Japanese data consisting of upper and lower 2 bytes, paying attention to the upper byte, every other byte (upper byte) is a special character that indicates the repetition of the upper byte in a data string in which the same character continues. It is characterized by adding a pre-processing for converting a character, a character to be repeated, the number of repetitions, and a data string having only lower bytes.

【0008】また本発明の日本語データ圧縮方式は、連
続するデータが同じキャラクタである場合に、圧縮を示
す特殊文字と繰り返し文字データと繰り返し回数とに変
換することにより、データサイズを縮小するというデー
タ圧縮方式に、特に、上位・下位の2バイトからなる日
本語データにおいて、その上位バイトのみに着目し、そ
れが前もって定めたコードと一致しかつ連続する場合に
それを前記のデータ圧縮方式と同様に圧縮を示す特殊文
字と繰り返し文字データと繰り返し回数とに変換し、そ
の後に圧縮したキャラクタ分の下位バイトを連ねる前処
を付加したことを特徴とする。
Further, the Japanese data compression method of the present invention reduces the data size by converting special characters indicating compression, repeated character data, and the number of repetitions when consecutive data are the same character. Regarding the data compression method, particularly in Japanese data consisting of upper and lower 2 bytes, paying attention to only the upper byte, and when it matches and is continuous with the code defined in advance, it is referred to as the above data compression method. Similarly, it is characterized in that it is converted into a special character indicating compression, repeated character data, and the number of times of repetition, and then a front end for connecting the lower bytes of the compressed character is added.

【0009】[0009]

【実施例】次に本発明の実施例について図面を参照して
説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0010】図1は本発明の一実施例を示すブロック図
である。被圧縮データ1は、例えばシフトJISを用い
た2バイト1キャラクタの日本語データである。これを
本発の圧縮前処理部12で圧縮した後、従来技術でも述
べた通常のランレングス圧縮を圧縮処理部13で行う、
その結果できあがった圧縮されたデータが圧縮データ4
である。
FIG. 1 is a block diagram showing an embodiment of the present invention. The compressed data 1 is 2-byte 1-character Japanese data using shift JIS, for example. After compressing this by the compression pre-processing unit 12 of the present invention, the normal run-length compression described in the related art is performed by the compression processing unit 13.
The resulting compressed data is compressed data 4
Is.

【0011】圧縮前処理部2の詳細としてアリゴリズム
を図4に示す。圧縮前処理部の一実施例を図4に従って
説明する。初めに、圧縮動作中下位バイトを蓄えるため
のスタックをクリアするとともに(ステップS11)、
文字カウンウタCcおよび繰り返しカウンタCrを0に
リセットする(ステップS12,S13)。被圧縮デー
タ1から1文字(上位バイト)を読み出した後(ステッ
プS14)、さらにもう1文字(下位バイト)を読み込
み(ステップS15)、文字カウンタを1だけ加算する
(ステップS16)。次に文字カウンタの値が1の場合
は(ステップS17)、まず連続するキャラクタとして
比較用のレジスタに読み込んだ上位バイトがセットされ
(ステップS18)、次の文字を読み込む処理へ戻る。
FIG. 4 shows an algorithm as a detail of the pre-compression processing unit 2. An embodiment of the compression preprocessing unit will be described with reference to FIG. First, while clearing the stack for storing the lower byte during the compression operation (step S11),
The character counter Cc and the repeat counter Cr are reset to 0 (steps S12 and S13). After reading one character (upper byte) from the compressed data 1 (step S14), another character (lower byte) is read (step S15), and the character counter is incremented by 1 (step S16). Next, when the value of the character counter is 1 (step S17), the upper byte read in the register for comparison is set as a continuous character (step S18), and the process returns to the process of reading the next character.

【0012】2回目以降のサイクルでは、被圧縮データ
11から読み出された文字(上位バイト)がレジスタに
入っている文字と比較される(ステップS19)。この
比較で同じキャラクタの場合は、4個以上の同じ文字が
1つおきに連続しているので圧縮される。文字がレジス
タの文字と等しいとき、繰り返しカウンタは1つ加算さ
れ(ステップS20)、再びループを繰り返す。現読み
出し文字(上位)と等しくなければ(ステップS2
1)、繰り返しカウンタは4と比較され、より少なけ
ば、圧縮効果が得られないので圧縮処理は行わない。4
以上の時は、圧縮効果が得られるので圧縮形式に変換す
る(ステップS22)。ここで、圧縮形式は、圧縮を示
す特殊文字1バイトと、繰り返し文字1バイトと、繰り
返しカウンタの値(1バイト)と、スタックに蓄えられ
た下位バイト列とで構成される。下位バイト列長は繰り
返しカウンタの値に等しい。
In the second and subsequent cycles, the character (upper byte) read from the compressed data 11 is compared with the character stored in the register (step S19). In the case of the same character in this comparison, four or more same characters are consecutive and are therefore compressed. When the character is equal to the character in the register, the repeat counter is incremented by 1 (step S20) and the loop is repeated again. If not equal to the current read character (upper) (step S2
1), the repetition counter is compared with 4, and if the number is smaller, the compression effect cannot be obtained, so the compression processing is not performed. Four
In the above cases, the compression effect can be obtained, so the data is converted to the compression format (step S22). Here, the compression format is composed of a special character 1 byte indicating compression, a repeat character 1 byte, a value of a repeat counter (1 byte), and a lower byte string stored in the stack. The lower byte string length is equal to the repeat counter value.

【0013】図5に圧縮前後のデータ列の一例を示す。
被圧縮データ列Aは、圧縮前処理部2により、圧縮デー
タBに圧縮される。
FIG. 5 shows an example of a data string before and after compression.
The compressed data sequence A is compressed into compressed data B by the pre-compression processing unit 2.

【0014】圧縮前処理部12で前処理された圧縮デー
タBは、通常のランレングス圧縮処理部13で図5の圧
縮データCに圧縮して、図1の圧縮データ14を得る。
図5には、比較のために、図2の通常のランレングス圧
縮処理部2で、被圧縮データAを圧縮して得られた圧縮
データC′を示す。従来圧縮できなかった文字列が本実
施例により圧縮可能となることがわかる。
The compressed data B pre-processed by the compression pre-processing unit 12 is compressed into the compressed data C of FIG. 5 by the normal run-length compression processing unit 13 to obtain the compressed data 14 of FIG.
For comparison, FIG. 5 shows compressed data C ′ obtained by compressing the compressed data A by the normal run-length compression processing unit 2 of FIG. It can be seen that a character string that could not be compressed conventionally can be compressed by this embodiment.

【0015】ところで、復元処理は特殊文字を検出した
とき、特殊文字の後に続く連続文字と連続カウントを読
み込み、連続カウンタの値だけ連続文字を上位バイトと
して下位バイトを読み込むたびに上位バイトを付加して
2バイト文字を出力することによって実現する。
By the way, in the restoration process, when a special character is detected, the continuous character and the continuous count following the special character are read, and the upper byte is added every time the lower byte is read by setting the continuous character as the upper byte by the value of the continuous counter. It is realized by outputting a 2-byte character.

【0016】このようにして、圧縮前処理で1つおきに
連続するキャラクタ列を圧縮することで、連続する2バ
イト文字の日本語データを圧縮できる。
In this way, by compressing every other consecutive character string in the pre-compression processing, consecutive 2-byte character Japanese data can be compressed.

【0017】[0017]

【発明の効果】以上説明したように本発明は、圧縮前処
理として1つおきに連続するキャラクタを検出して上位
バイトの数を圧縮することで、シフトJISコードにお
けるひらがなや英数字の組合せの文章を圧縮できる効果
と、さらに圧縮前処理で下位バイトが連続することから
シフトJISコードの連続した2バイト文字も従来のラ
ンレングス符号化で圧縮できる効果がある。
As described above, the present invention detects every other consecutive characters as the pre-compression processing and compresses the number of high-order bytes, so that the combination of hiragana and alphanumeric characters in the shift JIS code can be changed. There is an effect that the sentence can be compressed, and further, since the lower byte is continuous in the pre-compression process, a continuous 2-byte character of the shift JIS code can be compressed by the conventional run length encoding.

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

【図1】本発明の一実施例のブロック図である。FIG. 1 is a block diagram of an embodiment of the present invention.

【図2】従来例のブロック図である。FIG. 2 is a block diagram of a conventional example.

【図3】ランレングス符号化のアルゴリズムのフローチ
ャートである。
FIG. 3 is a flowchart of an algorithm for run length encoding.

【図4】圧縮前処理のフローチャートである。FIG. 4 is a flowchart of pre-compression processing.

【図5】本発明の効果を説明するための図である。FIG. 5 is a diagram for explaining the effect of the present invention.

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

1,11 被圧縮データ 2,13 圧縮処理部 3,14 圧縮データ 12 圧縮前処理部 1,11 Compressed data 2, 13 Compression processing unit 3,14 Compressed data 12 Compression pre-processing unit

Claims (2)

【特許請求の範囲】[Claims] 【請求項1】同じキャラクタが連続するデータの圧縮を
示す特殊文字と繰り返し文字データと繰り返し回数とに
変換することにより、データサイズを縮小するデータ圧
縮方式に、特に、上位・下位の2バイトからなる日本語
データにおいて、その上位バイトについて着目し、1バ
イトおきに(上位バイト)同じキャクタが連続するデー
タ列を上位バイトの繰り返しを示す特殊文字と繰り返す
文字と繰り返し回数と下位バイトのみのデータ列とに変
換する前処理を付加した日本語データ圧縮方式。
1. A data compression method for reducing the data size by converting a special character indicating the compression of data in which the same character is continuous, repeated character data, and the number of repetitions, particularly from the upper and lower 2 bytes. In Japanese data, paying attention to the upper byte, every other byte (upper byte) a data string in which the same character continues, a special character that indicates the repetition of the upper byte, a repeating character, the number of repetitions, and a data string containing only the lower byte Japanese data compression method with pre-processing added for conversion to and.
【請求項2】連続するデータが同じキャラクタである場
合に、圧縮を示す特殊文字と繰り返し文字データと繰り
返し回数とに変換することにより、データサイズを縮小
するというデータ圧縮方式に、特に、上位・下位の2バ
イトからなる日本語データにおいて、その上位バイトの
みに着目し、それが前もって定めたコードと一致しかつ
連続する場合にそれを前記のデータ圧縮方式と同様に圧
縮を示す特殊文字と繰り返し文字データと繰り返し回数
とに変換し、その後に圧縮したキャラクタ分の下位バイ
トを連ねる前処を付加した日本語データ圧縮方式。
2. A data compression method of reducing the data size by converting special characters indicating compression, repeated character data, and the number of times of repetition when consecutive data are the same character, particularly in the upper order. In Japanese data consisting of the lower 2 bytes, pay attention to only the upper byte, and if it matches and continues with the code set in advance, repeat it with a special character indicating compression as in the above data compression method. A Japanese data compression method in which a character data and the number of repetitions are converted, and then a prefix is added to connect the lower bytes of the compressed character.
JP15658791A 1991-06-27 1991-06-27 Japanese data compressing system Pending JPH056260A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP15658791A JPH056260A (en) 1991-06-27 1991-06-27 Japanese data compressing system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP15658791A JPH056260A (en) 1991-06-27 1991-06-27 Japanese data compressing system

Publications (1)

Publication Number Publication Date
JPH056260A true JPH056260A (en) 1993-01-14

Family

ID=15631028

Family Applications (1)

Application Number Title Priority Date Filing Date
JP15658791A Pending JPH056260A (en) 1991-06-27 1991-06-27 Japanese data compressing system

Country Status (1)

Country Link
JP (1) JPH056260A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH06337762A (en) * 1993-05-28 1994-12-06 Hitachi Ltd Compressing method and restoring method for data base record
US5600621A (en) * 1993-04-26 1997-02-04 Nippon Conlux Co., Ltd. Laser output control device for an optical information recording and reproducing apparatus

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5600621A (en) * 1993-04-26 1997-02-04 Nippon Conlux Co., Ltd. Laser output control device for an optical information recording and reproducing apparatus
JPH06337762A (en) * 1993-05-28 1994-12-06 Hitachi Ltd Compressing method and restoring method for data base record

Similar Documents

Publication Publication Date Title
US5608396A (en) Efficient Ziv-Lempel LZI data compression system using variable code fields
JP3009727B2 (en) Improved data compression device
US5396595A (en) Method and system for compression and decompression of data
JP3688297B2 (en) Video image color encoding
US5594435A (en) Permutation-based data compression
US6225922B1 (en) System and method for compressing data using adaptive field encoding
TWI273779B (en) Method and apparatus for optimized lossless compression using a plurality of coders
US6748520B1 (en) System and method for compressing and decompressing a binary code image
JPS607300B2 (en) Japanese data compression method
JPS63148717A (en) Data compression and restoration processor
US4972497A (en) Image coding system
JPH056260A (en) Japanese data compressing system
JP2885235B1 (en) Data compression method and machine readable recording medium recording compression program
US6501395B1 (en) System, method and computer readable medium for compressing a data sequence
JP2940948B2 (en) Data compression method
JP3199292B2 (en) Run-length extraction method, Huffman code conversion method, and MH coding processing method in Huffman code coding
JP3104302B2 (en) Data compression device
US6819272B2 (en) System, method and computer readable medium for compressing a data sequence for partial decompressing
JPH05341955A (en) Data compression and restoration system
JPH03206533A (en) Data compression system
JPH0621827A (en) Data compressor and its method
JP3265268B2 (en) String compression method
JPH0264770A (en) Data compression-restoring system with dictionary
JPS62209948A (en) Data compressing and transmitting method
JPH06178124A (en) Image data compression and elongation device