JPS61236224A - Method for compressing data - Google Patents

Method for compressing data

Info

Publication number
JPS61236224A
JPS61236224A JP7640285A JP7640285A JPS61236224A JP S61236224 A JPS61236224 A JP S61236224A JP 7640285 A JP7640285 A JP 7640285A JP 7640285 A JP7640285 A JP 7640285A JP S61236224 A JPS61236224 A JP S61236224A
Authority
JP
Japan
Prior art keywords
code
string
data
compression
representing
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
JP7640285A
Other languages
Japanese (ja)
Inventor
Naoko Yoshihara
吉原 尚子
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.)
Hitachi Ltd
Original Assignee
Hitachi 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 Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP7640285A priority Critical patent/JPS61236224A/en
Publication of JPS61236224A publication Critical patent/JPS61236224A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To restore a compression data in a short time by replacing a code string being compression object into a 1-byte control code and adding a 1-byte control code before a code representing non-compression object so as to record the result. CONSTITUTION:In taking 0s or spaces only consecutive for >=3bytes as a compression object, a control code 17 comprising 00 representing a non-compression object and a figure 2 representing a byte number are added to head 2-byte AB of a digital code string 11 and the result is recorded. Since the next code string 13 is a compression object, the string is replaced into a control code 19 comprised of 10 representing the compression of consecutive 0s and a figure 3 representing its byte number and the result is recorded. The final code string 15 is replaced into a control code 22 consisting of 01 representing the compression of consecutive spaces and of figure 4 representing the byte number and the result is recorded. The data compressed in this way is restored very easily in a short time.

Description

【発明の詳細な説明】 〔発明の利用分野〕 本発明はデータ圧縮方法に係り、特に、短時間で復元す
るのに好適なデータ圧縮方法に関する。
DETAILED DESCRIPTION OF THE INVENTION [Field of Application of the Invention] The present invention relates to a data compression method, and particularly to a data compression method suitable for restoration in a short time.

〔発明の背景〕[Background of the invention]

情報量が増大すると、これを記憶させるためのメモリ装
置が大容量化する。これを避ける為にデータ圧縮を行な
う必要が生じ、従来から種々のデータ圧縮方法が提案さ
れている(例えば特開昭58−75244 )。しかし
、データ圧縮を行なうと、この圧縮データを元のデータ
に復元するのに時間がかかりてしまうという問題が生じ
る。
As the amount of information increases, the capacity of memory devices for storing it increases. In order to avoid this, it is necessary to perform data compression, and various data compression methods have been proposed in the past (for example, Japanese Patent Laid-Open No. 75244/1983). However, when data is compressed, a problem arises in that it takes time to restore the compressed data to the original data.

〔発明の目的〕[Purpose of the invention]

本発明の目的は、圧縮データを短時間で復元できるデー
タ圧縮方法を提供することにある。
An object of the present invention is to provide a data compression method that can restore compressed data in a short time.

〔発明の概要〕[Summary of the invention]

データのうちには、例えばプログラムデータのように、
データの多くの部分(プログラムデータの場合、1/2
〜1/3)が0又はスペースで占められているものがあ
る。斯かるデータにおいて、本発明では、0またはスペ
ースが3バイト以上連続したときこれを第1の制御符号
に変換して圧縮し、圧縮対象とし危いデータにはその連
続するデータ列の前に第2の制御符号を付加する。そし
て、第1の制御符号は、0またはスペースの識別符号と
圧縮対象データのバイト数表示符号とで構成し、第2の
制御符号は、非圧縮対象を示す符号と当該データ列のバ
イト数表示符号とで構成する。 ゛ 〔発明の実施例〕 以下、本発明の一実施例を図面を参照して説明する。
Some data, such as program data,
Many parts of the data (in the case of program data, 1/2
~1/3) is occupied by 0 or space. In such data, in the present invention, when there are three or more consecutive 0 or space bytes, this is converted into a first control code and compressed, and if the data is at risk of being compressed, a first control code is added before the consecutive data string. 2 control codes are added. The first control code consists of an identification code of 0 or space and a code indicating the number of bytes of the data to be compressed, and the second control code consists of a code indicating the object to be compressed and an indication of the number of bytes of the data string. It consists of a symbol. [Embodiment of the Invention] Hereinafter, an embodiment of the present invention will be described with reference to the drawings.

第1図は本実施例によるデータ圧縮方法の原理説明図で
あシ、11は圧縮前のデジタル符号列、16は圧縮後の
デジタル符号列を示している。この圧縮方法では、3バ
イト以上連続する0又はスペースのみを圧縮対象としそ
れ以外のデジタル符号列を非圧縮対象とし、圧縮対象の
デジタル符号列は1バイトの制御符号に置き換え、非圧
縮対象のデジタル符号列は、デジタル符号列の前に1バ
イトの制御符号を付加して記録するものでおる。デジタ
ル符号列11の先頭2バイト″′AB′a12は非圧縮
対象であるため、文字識別符号が非圧縮対象であること
を示す00で長さ符号がデジタル符号夕II′″AB″
の長さくバイト数)を示す数2の制御符号17を付加し
て記録する(18)。
FIG. 1 is an explanatory diagram of the principle of the data compression method according to this embodiment, where 11 indicates a digital code string before compression, and 16 indicates a digital code string after compression. In this compression method, only consecutive zeros or spaces of 3 or more bytes are subject to compression, and the other digital code strings are not compressed.The digital code string to be compressed is replaced with a 1-byte control code, and the digital code string to be The code string is recorded by adding a 1-byte control code to the front of the digital code string. The first 2 bytes "''AB'a12 of digital code string 11 are to be uncompressed, so the character identification code is 00 indicating that it is to be uncompressed, and the length code is digital code II'''AB''.
A control code 17 of number 2 indicating the number of bytes) is added and recorded (18).

次のデジタル符号列”ooo”13は圧縮対象符号″′
0′″が3バイト以上連続した圧縮対象であるため、文
字識別符号が連続する0を圧縮したことを示す”10″
で長さ符号が連続する0の長さくバイト数)を示す数3
の制御符号19に置き換えて記録する。次のデジタル符
号列”CDE″14は非圧縮対象であるため、″”CD
E”の前に制御符号20を付加して記録する(21)。
The next digital code string "ooo" 13 is the compression target code "'
Since the compression target consists of 3 or more consecutive 0''' characters, the character identification code is "10" which indicates that consecutive 0's have been compressed.
The number 3 indicates the number of bytes with consecutive 0 length codes.
The control code 19 is replaced with the control code 19 and recorded. The next digital code string "CDE" 14 is to be uncompressed, so ""CD
A control code 20 is added in front of "E" and recorded (21).

最後のデジタル符号列6スペース・スペース・スペース
・スペース″14は圧縮対象符号スペースが4バイト以
上連続した圧縮対象であるため、文字識別符号が連続す
るスペースを圧縮したことを示す01″で長さ符号が連
続するスペースの長さくバイト数)を示す数4の制御符
号器に置き換えて記録する。
The last digital code string 6 space space space space "14" indicates that the code space to be compressed is 4 or more consecutive bytes, so the length is 01" indicating that the character identification code has compressed a continuous space. The code is recorded by replacing it with a control encoder of number 4, which indicates the length of the space (the number of bytes).

第2図はデータ圧縮及び圧縮データ記録を行なう装置の
機能構成図であシ、1,3はデジタル符号を記録する記
録媒体である。2は、記録媒体lのデジタル符号を圧縮
して記録媒体3に記録し、記録媒体3の圧縮されたデジ
タル符号を元のデジタル符号に復元して記録する処理手
段である。
FIG. 2 is a functional block diagram of an apparatus for compressing data and recording compressed data, and 1 and 3 are recording media for recording digital codes. 2 is a processing means for compressing the digital code on the recording medium 1 and recording it on the recording medium 3, and for restoring the compressed digital code on the recording medium 3 to the original digital code and recording it.

第3図は第1図に示す処理手段2で実行されるデータ圧
縮方法のフローチャートであシ、この第3図に従って第
1図に示したデータ圧縮の圧縮手順を説明する。
FIG. 3 is a flowchart of a data compression method executed by the processing means 2 shown in FIG. 1, and the compression procedure of the data compression shown in FIG. 1 will be explained according to this FIG.

まず、デジタル符号列11の先頭3バイトのデジタル符
号列@ABO”を読み込み(ステップ1O1)、長さ符
号を1とする(ステップ102 )。そして、非圧縮対
象のデジタル符号列″”ABO”の次のデジタル符号列
@BOO”を読み込む(ステップ103゜114.13
4〜135)。このデジタル符号列は非圧縮対象なので
、長さ符号に1を加え2としくステップ136,137
  )、次のデジタル符号列”000” 13を読み込
む(ステップ134,135  )。このデジタル符号
列は圧縮対象なので、その前の非圧縮対象となっている
デジタル符号列@AB”の前に、文字識別符号が’oo
″で長さ符号が2の制御符号17を付加し、データ18
を記録する(ステップ134〜136.141,142
)。
First, the first 3-byte digital code string @ABO'' of the digital code string 11 is read (step 1O1), and the length code is set to 1 (step 102).Then, the digital code string ``ABO'' to be uncompressed is read. Read the next digital code string @BOO” (step 103゜114.13
4-135). Since this digital code string is not to be compressed, 1 is added to the length code to make it 2, and steps 136 and 137
), the next digital code string "000" 13 is read (steps 134, 135). Since this digital code string is to be compressed, the character identification code 'oo
'', a control code 17 with a length code of 2 is added, and the data 18
(Steps 134 to 136, 141, 142
).

次に、デジタル符号列″’ooo”の処理を行なう。Next, the digital code string "'ooo" is processed.

長さ符号を1としくステップ102)次のデジタル符号
列″”ooc”を読み込む(ステップ103〜105)
Set the length code to 1 and read the next digital code string "ooc" (Step 102) (Steps 103 to 105)
.

このデジタル符号列は非圧縮対象なので、文字識別符号
を′0”を示す10″としくステップ111)、長さ符
号に連続する0の長さの未加算分の2を加え(ステップ
112)て3とした制御符号19を記録する(ステップ
113)。
Since this digital code string is not to be compressed, the character identification code is set to 10'' indicating '0'' (step 111), and 2, the unadded length of consecutive 0s, is added to the length code (step 112). A control code 19 of 3 is recorded (step 113).

次に、2バイト先のデジタル符号列″”CDE″14を
読み込み(ステップ125〜126)、長さ符号を1と
する(ステップ102)。非圧縮対象のデジタル符号列
″CDE”の次のデジタル符号列″’DEスペース”を
読み込む(ステップ103,114,134〜135蒐
このデジタル符号列は非圧縮対象なので、長さ符号に1
を加え2としくステップ136〜137)、次のデジタ
ル符号列″Eスペーススペース”を読み込む(134〜
135)。このデジタル符号列も非圧縮対象なので、長
さ符号に1を加え3としくステップ136〜137)、
次のデジタル符号列”スペース スペース スペース”
を読み込む(134〜135)。このデジタル符号は圧
縮対象なので(ステップ136)、非圧縮対象のデジタ
ル符号列”CDE”の前に文字識別符号が非圧縮対象文
字を示す“00”で長さ符号が3の制御符号20を付加
し、データ21を記録する(ステップ141〜142)
Next, read the digital code string "CDE" 14 2 bytes ahead (steps 125-126), and set the length code to 1 (step 102).The next digital code string "CDE" to be uncompressed Read the code string "'DE space" (steps 103, 114, 134-135) Since this digital code string is to be uncompressed, the length code is set to 1.
is added to 2 (steps 136-137), and the next digital code string "E space space" is read (134-137).
135). Since this digital code string is also to be uncompressed, add 1 to the length code to make it 3 (steps 136-137),
Next digital code string “Space Space Space”
(134-135). Since this digital code is to be compressed (step 136), a control code 20 with a character identification code of "00" indicating a character to be uncompressed and a length code of 3 is added before the digital code string "CDE" to be uncompressed. and record data 21 (steps 141-142)
.

次に、デジタル符号列”スペース・スペース・スペース
”の処理を行なう。長さ符号を1としくステップ102
)、次のデジタル符号列1スペース・スペース・スペー
ス”を読み込み(ステップ103,114〜116)、
長さ符号に1を加えて2とする(ステップ119)。次
に読み込むデジタル符号がないので(ステップ115)
、文字識別符号が1スペース”を示す加1”で(ステッ
プ119 )、長さ符号に連続するスペースの長さの未
加算分の2を加え(ステップ120)て4とした制御符
号22を記録しくステップ121)、処理を終了する。
Next, the digital code string "space space space" is processed. Set the length code to 1 and step 102
), reads the next digital code string "1 space space space" (steps 103, 114 to 116),
Add 1 to the length code to make it 2 (step 119). Since there is no digital code to read next (step 115)
, the character identification code is "+1" indicating 1 space (step 119), and the control code 22, which is 4 by adding 2, the unadded length of the length of the consecutive spaces to the length code (step 120), is recorded. At step 121), the process ends.

次に、第4図を用いて、圧縮して記録されたデジタル符
号列16をデジタル符号列11に復元する手順を説明す
る。
Next, a procedure for restoring the compressed and recorded digital code string 16 to the digital code string 11 will be explained using FIG.

まず、1バイト目の制御符号17を読み込む(ステップ
401)。この制御符号17の文字識別符号は″”oo
”で(ステップ402,404 )、長さ符号は2なの
で、これから非圧縮対象文字であることを識別し、制御
符号17に続く2バイトのデジタル符号″”AB”″を
記録する(ステップ407)。次に、デジタル符号夕じ
AE”の後の制御符号19を読み込む(ステップ401
)。この制御符号19の文字識別符号は”10″で(ス
テップ402)長さ符号   ′は3なので、デジタル
符号″′ONが3バイト連続することを識別し、”AE
″の後に0を3バイト記録する(ステップ402〜40
3)。
First, the first byte of control code 17 is read (step 401). The character identification code of this control code 17 is ""oo
” (steps 402, 404), and since the length code is 2, it is identified as a non-compressible character, and a 2-byte digital code “AB” following the control code 17 is recorded (step 407). Next, the control code 19 after the digital code AE'' is read (step 401).
). The character identification code of this control code 19 is "10" (step 402) and the length code ' is 3, so it is identified that the digital code "'ON" is 3 consecutive bytes, and "AE
Record 3 bytes of 0 after “” (steps 402 to 40
3).

次の制御符号20は、文字識別符号が00″で(ステッ
プ402,404  )長さ符号が6なので、制御符号
2Gに続く3バイトのデジタル符号列@CDE”を記録
する。次に、デジタル符号列″CDE ’の後の制御符
号nを読み込む(ステップ408,401 )。
The next control code 20 has a character identification code of 00'' (steps 402, 404) and a length code of 6, so a 3-byte digital code string @CDE'' following the control code 2G is recorded. Next, the control code n after the digital code string "CDE" is read (steps 408, 401).

この制御符号nは文字識別符号が01”で(ステップ4
02,404  )長さ符号が4なので、9スペース1
が4バイト連続することを識別し、”CDE”の後にス
ペースを4バイト記録する(ステップ405)。この制
御符号nに続く制御符号はないので(ステップ406)
、処理を終了する。
This control code n has a character identification code of 01” (step 4
02,404) Since the length code is 4, 9 spaces 1
It is recognized that 4 bytes are continuous, and 4 bytes of space are recorded after "CDE" (step 405). Since there is no control code following this control code n (step 406)
, ends the process.

〔発明の効果〕〔Effect of the invention〕

本発明によれば、圧縮データを連続した0及びスペース
に限定したので制御符号を1バイトに短縮でき、また、
非圧縮データの前に制御符号を付加したのでデータの復
元時間が短かくなるという効果がある。
According to the present invention, since the compressed data is limited to consecutive 0's and spaces, the control code can be shortened to 1 byte, and
Since the control code is added before the uncompressed data, the data restoration time is shortened.

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

第1図は本発明方法の一実施例の原理説明図、第2図は
データ圧縮記録装置の機能構成図、第3図はデータ圧縮
手順を示すフローチャート、第4図はデータ復元手順を
示すフローチャートである。 1・・・非圧縮形式デジタル符号記録媒体2・・・デジ
タル符号の圧縮・復元処理手段3・・・圧縮形式デジタ
ル符号記録媒体11・・・非圧縮形式デジタル符号列 16・・・圧縮形式デジタル符号列 −ど
Fig. 1 is a diagram explaining the principle of an embodiment of the method of the present invention, Fig. 2 is a functional block diagram of a data compression recording device, Fig. 3 is a flowchart showing the data compression procedure, and Fig. 4 is a flowchart showing the data restoration procedure. It is. 1... Uncompressed format digital code recording medium 2... Digital code compression/decompression processing means 3... Compressed format digital code recording medium 11... Uncompressed format digital code string 16... Compressed format digital code string

Claims (1)

【特許請求の範囲】[Claims] 1、3バイト以上連続する0またはスペースのデータ列
を圧縮対象として該データ列を0またはスペースの識別
符号と前記データ列のバイト数を表わす符号とで成る制
御符号に変換し、非圧縮対象のデータの前に、非圧縮対
象を表わす符号と該データのバイト数を表わす符号とで
なる制御符号を付加することを特徴とするデータ圧縮方
法。
A data string of 1 or 3 consecutive bytes or more of 0 or space is to be compressed, and the data string is converted into a control code consisting of an identification code of 0 or space and a code representing the number of bytes of the data string, and A data compression method characterized in that a control code consisting of a code representing an object to be compressed and a code representing the number of bytes of the data is added in front of the data.
JP7640285A 1985-04-12 1985-04-12 Method for compressing data Pending JPS61236224A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP7640285A JPS61236224A (en) 1985-04-12 1985-04-12 Method for compressing data

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP7640285A JPS61236224A (en) 1985-04-12 1985-04-12 Method for compressing data

Publications (1)

Publication Number Publication Date
JPS61236224A true JPS61236224A (en) 1986-10-21

Family

ID=13604276

Family Applications (1)

Application Number Title Priority Date Filing Date
JP7640285A Pending JPS61236224A (en) 1985-04-12 1985-04-12 Method for compressing data

Country Status (1)

Country Link
JP (1) JPS61236224A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63148466A (en) * 1986-12-12 1988-06-21 Hitachi Ltd Data compressing/restoring method
JP2012146329A (en) * 2006-07-31 2012-08-02 Seiko Epson Corp Update data transmission method, firmware update system, and host device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS63148466A (en) * 1986-12-12 1988-06-21 Hitachi Ltd Data compressing/restoring method
JP2012146329A (en) * 2006-07-31 2012-08-02 Seiko Epson Corp Update data transmission method, firmware update system, and host device

Similar Documents

Publication Publication Date Title
JP2915568B2 (en) Adaptive data compression system for tape drive systems.
US4872009A (en) Method and apparatus for data compression and restoration
JPH0828053B2 (en) Data recording method
KR960005588A (en) Image data editing device
JPH0888568A (en) Reversible code encoding method for data
EP0731420A3 (en) System for optically recording/reproducing multimedia information using code data
JPH1091393A (en) Data buffering device
JPH04359315A (en) Data compression controller and data restoration controller
JPS61236224A (en) Method for compressing data
JPH0828052B2 (en) Frame generation method for PCM data
JPS63232626A (en) Data compression restoration system
JP2000039969A5 (en)
JPH03104421A (en) System and device for data compression and data decoder
JPS5953579B2 (en) character compression device
JP3152772B2 (en) Image data restoration device
JPH04180413A (en) Binary floating point data compression and expansion system
JPH0264770A (en) Data compression-restoring system with dictionary
JPH02218225A (en) Data compressing method
JP2002051302A (en) Electronic still camera
JP2534095B2 (en) Digital data storage and playback system
JPH03266524A (en) Data recorder
JPH10133700A (en) Recording method of compression coded data
JPS60101588A (en) Character string data compression apparatus
JPH05108304A (en) Data compression system
KR930014150A (en) Apparatus and Method for Compression / Recoding of Still Image Data