[go: up one dir, main page]

JPH0621827A - Data compressor and its method - Google Patents

Data compressor and its method

Info

Publication number
JPH0621827A
JPH0621827A JP19646492A JP19646492A JPH0621827A JP H0621827 A JPH0621827 A JP H0621827A JP 19646492 A JP19646492 A JP 19646492A JP 19646492 A JP19646492 A JP 19646492A JP H0621827 A JPH0621827 A JP H0621827A
Authority
JP
Japan
Prior art keywords
data
character
compression
continuous
characters
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
JP19646492A
Other languages
Japanese (ja)
Inventor
Yoshihisa Aotani
嘉久 青谷
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 JP19646492A priority Critical patent/JPH0621827A/en
Publication of JPH0621827A publication Critical patent/JPH0621827A/en
Pending legal-status Critical Current

Links

Landscapes

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

Abstract

PURPOSE:To compress efficiently data of consecutive same characters such as consecutive characters of Japanese data in 2-byte codes. CONSTITUTION:A compression pre-processing section 12 converts and processes data with same consecutive characters into a sum/subtraction modulo of adjacent data or exclusive OR data as the compression preprocessing and converts it into data consecutive in the unit of bytes. Compression data 14 comprising a special character representing the compression degree, repetitive character data and repetitive number of times of the characters are obtained from a compression post-processing section 13 when some characters are consecutive by taking one-byte character of the consecutive data from the compression pre-processing section 12 as one unit.

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 apparatus and method for compressing repeated characters of data consisting of 2 bytes and having consecutive identical characters such as Japanese data.

【0002】[0002]

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

【0003】図5は従来のデータ圧縮装置の構成を示
し、図5において、被圧縮データ1は圧縮処理部2に供
給されて圧縮処理じ施されて圧縮データ3を得ている。
図6は、図5における変換の処理手順を示している。図
6において、先ず、文字カウンタCcと繰り返しカウン
タCrが0に設定される(ステップ(図中、Sで示す)
60,61)。原データから1文字を読み出す(ステッ
プ62)。その後、文字カウンタCcが1だけ加算され
る(ステップ63)。文字カウンタCcの値はこの読み
出した文字と比較される(ステップ64)。最初のサイ
クルではこの比較は必ず真となり、原データが4個以上
の繰り返し文字から構成されているかを調べるために読
み出された文字が、バッファに格納される(ステップ6
5)。2回目以降のサイクルでは、原データから読み出
された文字がバッファに格納されている文字と比較され
る(ステップ66)。原文字が格納されている文字と等
しければ、4個以上の同じ文字が繰り返されているので
圧縮が行われる。文字が格納されている文字と等しい場
合に繰り返しカウンタCrが1つ加算される(ステップ
67)、そして他の文字が原データから読み出される。
現文字が格納されている文字と等しくなければ、繰り返
しカウンタCcは4と比較される(ステップ68)。そ
して、より少なければ、3文字しか同じ文字が繰り返さ
れていないので圧縮は行われない(ステップ69)。こ
のようにして繰り返しカウンタが4以上の時に、圧縮形
式が作成され、図7に示す圧縮データ列が得られる。
FIG. 5 shows the configuration of a conventional data compression apparatus. In FIG. 5, compressed data 1 is supplied to a compression processing section 2 and subjected to compression processing to obtain compressed data 3.
FIG. 6 shows the conversion processing procedure in FIG. In FIG. 6, first, the character counter Cc and the repeat counter Cr are set to 0 (step (indicated by S in the drawing)).
60, 61). One character is read from the original data (step 62). Thereafter, the character counter Cc is incremented by 1 (step 63). The value of the character counter Cc is compared with the read character (step 64). In the first cycle, this comparison is always true, and the read character is stored in the buffer to see if the original data consists of four or more repeated characters (step 6).
5). In the second and subsequent cycles, the character read from the original data is compared with the character stored in the buffer (step 66). If the original character is equal to the stored character, four or more same characters are repeated, so compression is performed. When the character is equal to the stored character, the repeat counter Cr is incremented by 1 (step 67), and another character is read from the original data.
If the current character is not equal to the stored character, the repeat counter Cc is compared with 4 (step 68). If the number is less, the compression is not performed because only three characters are repeated (step 69). In this way, when the repetition counter is 4 or more, the compression format is created and the compressed data string shown in FIG. 7 is obtained.

【0004】[0004]

【発明が解決しようとする課題】この従来のデータ圧縮
方式では、ASCIIコード等の1バイトコード文字か
らなるデータ列において、連続して同じキャラクタが出
現する場合にデータサイズの縮小を図ることができる
が、シフトJISコード等の2バイトコード文字からな
るデータ列においては、たとえ同じキャラクタが連続し
て出現しても、隣合う1バイトデータは等しくないため
データサイズの縮小ができないという問題点があった。
With 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 composed of 2-byte code characters such as a shift JIS code, even if the same character appears consecutively, the adjacent 1-byte data is not equal, so there is a problem that the data size cannot be reduced. It was

【0005】本発明は、このような従来の技術における
問題を解決するものであり、同一キャラクタが連続する
データ、例えば、2バイトコードの日本語データの連続
文字を効率良く圧縮できるデータ圧縮装置及びその方法
の提供を目的とする。
The present invention solves the problems in the prior art as described above, and a data compression apparatus and a data compression apparatus capable of efficiently compressing data in which the same character continues, for example, consecutive characters of Japanese data of 2-byte code. The purpose is to provide the method.

【0006】[0006]

【課題を解決するための手段】上記目的を達成するため
に、請求項1の本発明のデータ圧縮装置は、同一キャラ
クタが連続するデータの圧縮前処理として隣り合うデー
タの加減算モジュロ又は排他論理和データに変換処理し
てバイト単位で連続したデータに変換する前圧縮処理手
段と、前圧縮処理手段からの連続したデータの1バイト
キャラクタを一つの単位としてキャラクタがいくつか連
続している場合に、これの圧縮を示す特殊文字と、繰り
返し文字データと、繰り返し回数とに変換した圧縮デー
タを得る後圧縮処理手段とを備える構成としてある。
In order to achieve the above object, the data compression apparatus according to the present invention of claim 1 is a pre-compression process for data in which the same character is continuous. In the case where the pre-compression processing means for converting into data and converting it into continuous data in byte units, and a case where several characters are continuous with one byte character of continuous data from the pre-compression processing means as one unit, The special character indicating the compression, the repeated character data, and the post-compression processing means for obtaining the compressed data converted into the number of repetitions are provided.

【0007】また、請求項2の発明のデータ圧縮方法
は、同一キャラクタが連続するデータの圧縮を示す特殊
文字と繰り返し文字データと繰り返し回数に変換して同
一キャラクタを繰り返す際よりデータサイズを縮小する
データ圧縮方法であって、データ圧縮の前処理として、
隣り合うバイトの加減算モジュロ又は排他論理和をと
り、同一キャラクタが連続するデータの繰り返し文字を
バイト単位で繰り返して文字と判別している。
Further, in the data compression method according to the present invention, the data size is reduced as compared with the case of repeating the same character by converting the special character indicating the compression of data in which the same character is continuous, the repeated character data, and the number of repetitions. It is a data compression method, and as a pre-processing of data compression,
The addition / subtraction modulo or exclusive OR of the adjacent bytes is taken, and the repeated character of the data in which the same character continues is repeated in byte units to be determined as a character.

【0008】そして、この請求項1又は2記載中、同一
キャラクタが連続するデータの繰り返し文字を、2バイ
トコードの日本語データの連続文字としている。
In the first or second aspect of the present invention, the repeated character of the data in which the same character is continuous is the continuous character of the Japanese data of 2-byte code.

【0009】[0009]

【作用】上記構成からなる、本発明のデータ圧縮装置及
びその方法は、同一キャラクタが連続するデータの圧縮
前処理として隣り合うデータの加減算モジュロ又は排他
論理和データに変換処理して、バイト単位で連続したデ
ータに一度変換し、同一キャラクタが連続するデータ、
例えば、2バイトコードの日本語データの連続文字が効
率良く圧縮される。
According to the data compression apparatus and method of the present invention having the above-mentioned structure, the data is converted into addition / subtraction modulo of adjacent data or exclusive OR data as pre-compression processing of data in which the same character continues, and in byte units. Data that is converted into continuous data once and the same character is continuous,
For example, consecutive characters of 2-byte code Japanese data are efficiently compressed.

【0010】[0010]

【実施例】次に、本発明のデータ圧縮装置及びその方法
の実施例を図面にもとづいて説明する。図1は実施例の
構成を示している。図1において、シフトJISコード
のように2バイトコードの日本語データの被圧縮データ
10が入力される圧縮前処理部12と、この後、1バイ
トキャラクタを一つの単位としてキャラクタがいくつか
連続している場合に、これの圧縮を示す特殊文字と、繰
り返し文字データと、繰り返し回数とに変換する圧縮後
処理部13とを有し、この圧縮後処理部13から特殊文
字と、繰り返し文字データと、繰り返し回数とに変換し
た圧縮データ14が得られる。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENT An embodiment of a data compression apparatus and method of the present invention will be described below with reference to the drawings. FIG. 1 shows the configuration of the embodiment. In FIG. 1, a pre-compression processing unit 12 to which compressed data 10 of Japanese data of 2-byte code such as shift JIS code is input, and thereafter, several characters are consecutive with one byte character as one unit. In this case, the special character indicating the compression of the special character, the repeated character data, and the post-compression processing unit 13 for converting into the number of repetitions are included. , The number of repetitions and the compressed data 14 are obtained.

【0011】次に、この実施例の構成の動作について説
明する。被圧縮データ10は、例えば、シフトJISコ
ードのように2バイトコードの日本語データである。こ
の日本語データを圧縮前処理部12で変換した後、圧縮
後処理部13で変換して圧縮データ14が得られる。
Next, the operation of the configuration of this embodiment will be described. The compressed data 10 is 2-byte code Japanese data such as shift JIS code, for example. The Japanese data is converted by the pre-compression processing unit 12 and then converted by the post-compression processing unit 13 to obtain compressed data 14.

【0012】図2は圧縮前処理部12での詳細な処理手
順を示している。図2において、初めに文字データを格
納する2つのメモリを初期化する(ステップ20)。被
圧縮データから1バイト読み出しメモリ2へ格納する
(ステップ21)。この読み出しを判断し(ステップ2
2)、所定時間経過の後未終了の場合は処理を終了す
る。終了完了のYesの場合、メモリ1とメモリ2の排
他論理和を実行して、その演算結果を出力する(ステッ
プ23,24)。その後、メモリ2の内容でメモリ1を
更新して再び被圧縮データの読み込みを行なうループを
繰り返す(ステップ25)。以上の変換処理によりバイ
ト単位で連続しなかったデータを連続データに変換され
る。
FIG. 2 shows a detailed processing procedure in the pre-compression processing unit 12. In FIG. 2, first, two memories for storing character data are initialized (step 20). One byte is read from the compressed data and stored in the memory 2 (step 21). This reading is judged (step 2
2) If the processing has not ended after the elapse of a predetermined time, the processing ends. If the end is Yes, the exclusive OR of the memory 1 and the memory 2 is executed, and the operation result is output (steps 23 and 24). After that, the memory 1 is updated with the contents of the memory 2 and the loop for reading the compressed data again is repeated (step 25). Through the above conversion processing, data that is not continuous in byte units is converted into continuous data.

【0013】次に、圧縮データを復元した場合は、図2
の処理に続いて後処理を行う。図3は、この圧縮データ
を復元の処理手順を示している。図3において、初めに
文字データを格納する2つのメモリを初期化する(ステ
ップ30)。被圧縮データから1バイト読み出しメモリ
2へ格納する(ステップ31)。この読み出しを判断し
(ステップ32)、所定時間経過の後未終了の場合は処
理を終了する。終了完了のYesの場合、メモリ1とメ
モリ2の排他論理和を実行して、その演算結果を出力す
る(ステップ33,34)。その後、計算結果をメモリ
1に移す(ステップ35)。
Next, when the compressed data is restored, as shown in FIG.
The post-processing is performed subsequent to the above processing. FIG. 3 shows a processing procedure for restoring this compressed data. In FIG. 3, first, two memories for storing character data are initialized (step 30). One byte is read from the compressed data and stored in the memory 2 (step 31). This reading is judged (step 32), and if it is not completed after the elapse of a predetermined time, the process is ended. If the end is Yes, the exclusive OR of the memory 1 and the memory 2 is executed, and the operation result is output (steps 33 and 34). Then, the calculation result is transferred to the memory 1 (step 35).

【0014】以上の変換をすることによって図4に示す
ようにバイト単位で連続しなかったデータを連続データ
に変換できる。図4(a)は圧縮前処理部12に入力さ
れる被圧縮データ10であり、図4(b)は圧縮前処理
部12から出力される圧縮前処理の後のデータ列であ
る。図4(c)は圧縮後処理部13から出力され、目的
の圧縮データ14を示し、圧縮を示す特殊文字と、連続
している繰り返し文字データと、繰り返し回数とに変換
されている。
By performing the above conversion, it is possible to convert data that is not continuous in byte units into continuous data as shown in FIG. 4A is the compressed data 10 input to the pre-compression processing unit 12, and FIG. 4B is the data string output from the pre-compression processing unit 12 after the pre-compression processing. FIG. 4C shows the target compressed data 14 output from the post-compression processing unit 13, which is converted into special characters indicating compression, continuous repeated character data, and the number of repetitions.

【0015】[0015]

【発明の効果】以上のように、本発明のデータ圧縮装置
及びその方法は、同一キャラクタが連続するデータの圧
縮前処理として隣り合うデータの加減算モジュロ又は排
他論理和データに変換処理して、バイト単位で連続した
データに一度変換しているため、同一キャラクタが連続
するデータ、例えば、2バイトコードの日本語データの
連続文字が効率良く圧縮できるという効果を有する。
As described above, according to the data compression apparatus and method of the present invention, as a pre-compression process of data in which the same character is continuous, conversion processing of adjacent data into addition / subtraction modulo or exclusive OR data is performed, and the data is converted into bytes. Since the data is once converted into continuous data in units, it is possible to efficiently compress data in which the same character is continuous, for example, continuous characters of 2-byte code Japanese data.

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

【図1】本発明のデータ圧縮装置及びその方法の実施例
における構成を示すブロック図である。
FIG. 1 is a block diagram showing the configuration of an embodiment of a data compression apparatus and method according to the present invention.

【図2】図1に示す圧縮前処理部における処理手順を示
すフローチャートである。
FIG. 2 is a flowchart showing a processing procedure in a pre-compression processing unit shown in FIG.

【図3】実施例における圧縮データの復元の処理手順を
示すフローチャートである。
FIG. 3 is a flowchart showing a processing procedure for decompressing compressed data in the embodiment.

【図4】実施例の動作説明に供され、目的とする圧縮デ
ータ内容を示す図である。
FIG. 4 is a diagram for explaining the operation of the embodiment and showing a target compressed data content.

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

【図6】図5の構成における変換の処理手順を示すフロ
ーチャートである。
FIG. 6 is a flowchart showing a conversion processing procedure in the configuration of FIG.

【図7】従来の処理による圧縮データ列を示す図であ
る。
FIG. 7 is a diagram showing a compressed data string by conventional processing.

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

10 被圧縮データ 12 圧縮前処理部 13 圧縮後処理部 14 圧縮データ 10 compressed data 12 pre-compression processing unit 13 post-compression processing unit 14 compressed data

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】 同一キャラクタが連続するデータの圧縮
前処理として隣り合うデータの加減算モジュロ又は排他
論理和データに変換処理してバイト単位で連続したデー
タに変換する前圧縮処理手段と、 上記前圧縮処理手段からの連続したデータの1バイトキ
ャラクタを一つの単位としてキャラクタがいくつか連続
している場合に、これの圧縮を示す特殊文字と、繰り返
し文字データと、繰り返し回数とに変換した圧縮データ
を得る後圧縮処理手段と、 を備えることを特徴としたデータ圧縮装置。
1. Pre-compression processing means for converting data to add / subtract modulo or exclusive OR data of adjacent data and converting into continuous data in byte units as pre-compression processing for data in which the same character continues, and said pre-compression. When several characters are continuous with one byte character of continuous data from the processing means as one unit, special characters indicating compression of the characters, repeated character data, and compressed data converted into the number of repetitions are generated. A data compression apparatus comprising: post-compression processing means for obtaining.
【請求項2】 同一キャラクタが連続するデータの圧縮
を示す特殊文字と、繰り返し文字データと、繰り返し回
数とに変換して、同一キャラクタを繰り返す際よりデー
タサイズを縮小するデータ圧縮方法であって、 上記データ圧縮の前処理として、隣り合うバイトの加減
算モジュロ又は排他論理和をとり、同一キャラクタが連
続するデータの繰り返し文字をバイト単位で繰り返して
文字と判別することを特徴とするデータ圧縮方法。
2. A data compression method for converting a special character indicating the compression of data in which the same character is continuous, repeated character data, and the number of repetitions to reduce the data size when repeating the same character. As a pre-processing of the data compression, an addition / subtraction modulo or exclusive OR of adjacent bytes is taken, and a repeated character of data in which the same character is continuous is repeated in byte units to be determined as a character.
【請求項3】 同一キャラクタが連続するデータの繰り
返し文字は、2バイトコードの日本語データの連続文字
であることを特徴とする請求項1記載のデータ圧縮装置
又は請求項2記載のデータ圧縮方法。
3. The data compression apparatus according to claim 1, or the data compression method according to claim 2, wherein the repeated character of data in which the same character is continuous is a continuous character of Japanese data of 2-byte code. .
JP19646492A 1992-06-30 1992-06-30 Data compressor and its method Pending JPH0621827A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP19646492A JPH0621827A (en) 1992-06-30 1992-06-30 Data compressor and its method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP19646492A JPH0621827A (en) 1992-06-30 1992-06-30 Data compressor and its method

Publications (1)

Publication Number Publication Date
JPH0621827A true JPH0621827A (en) 1994-01-28

Family

ID=16358244

Family Applications (1)

Application Number Title Priority Date Filing Date
JP19646492A Pending JPH0621827A (en) 1992-06-30 1992-06-30 Data compressor and its method

Country Status (1)

Country Link
JP (1) JPH0621827A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7083225B2 (en) 2003-03-20 2006-08-01 Mitsubishi Jidosha Kogyo Kabushiki Kaisha Vehicle body structure of periphery of rear suspension
CN111064471A (en) * 2018-10-16 2020-04-24 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN117118456A (en) * 2023-10-25 2023-11-24 山东德源电力科技股份有限公司 Magnetic control switch control data processing method based on depth fusion

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7083225B2 (en) 2003-03-20 2006-08-01 Mitsubishi Jidosha Kogyo Kabushiki Kaisha Vehicle body structure of periphery of rear suspension
CN111064471A (en) * 2018-10-16 2020-04-24 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN111064471B (en) * 2018-10-16 2023-04-11 阿里巴巴集团控股有限公司 Data processing method and device and electronic equipment
CN117118456A (en) * 2023-10-25 2023-11-24 山东德源电力科技股份有限公司 Magnetic control switch control data processing method based on depth fusion
CN117118456B (en) * 2023-10-25 2024-01-26 山东德源电力科技股份有限公司 Magnetic control switch control data processing method based on depth fusion

Similar Documents

Publication Publication Date Title
US4316222A (en) Method and apparatus for compression and decompression of digital image data
EP0439569B1 (en) Apparatus for run and string data compression
JP4814999B2 (en) Data compression / decompression method and compression / decompression program
US6748520B1 (en) System and method for compressing and decompressing a binary code image
US6798914B1 (en) Neural-network-based method of image compression
CN107911570B (en) The method that a kind of pair of picture feature is compressed and decompressed
JPH0879719A (en) Compressing and expanding method for data file
JPH0621827A (en) Data compressor and its method
JP2885235B1 (en) Data compression method and machine readable recording medium recording compression program
US7020340B2 (en) Methods for compressing and decompressing data
CN116471337A (en) Message compression and decompression method and device based on BWT and LZW
JPH03247167A (en) Data compression method
JPH08130652A (en) Two-dimensional image data compression method and decompression method
US6819272B2 (en) System, method and computer readable medium for compressing a data sequence for partial decompressing
JP3104302B2 (en) Data compression device
JPH0884260A (en) Two-dimensional image data compression method and decompression method
JP2002044461A (en) Image processing method and image processor
JPH05244015A (en) Data compression system
JP2003318739A (en) System and method for compressing data sequence, and computer readable medium
JPH056260A (en) Japanese data compressing system
JP3212393B2 (en) Encoding device
JP3143029B2 (en) Data compression method and device, and data decompression method and device
JP2689020B2 (en) Code decompression method and drawing device
CN112200301A (en) Convolution calculation device and method
JP3143030B2 (en) Data compression method and device, and data decompression method and device