Method and apparatus for data compression and restoration
First Claim
1. A method of transforming an input data string comprising a plurality of data bytes, said plurality including portions of a plurality of consecutive data bytes identical to one another, wherein said data bytes may be of a plurality of types, each type representing different information, said method comprising the steps of:
- selecting, in advance, a first subset of the plurality of types of data bytes which may occur, said subset including those data byte types which more frequently appear repetitively and consecutively than those data byte types not included in the first subset;
detecting a compressible portion of the data string when one of said data bytes types of said first subset appears consecutively in the string a certain minimum number of times up to a certain maximum number of times,compressing the compressible portion according to a first compression method, said compression method including encoding the data byte of the compressible portion and counting the number of data bytes of the portion to produce a compressed portion representative of the number and kind of data bytes in the compressible portion;
appending a compression mark byte, which indicates that compression has been affected, either at the front or rear of said compressed portion to generate a first compression information data;
when said input data string contains a third portion consisting of one or more consecutive data bytes the same as a first compression mark byte, said compression step further includes encoding and counting data bytes contained in said third portion to obtain a compressed third portion; and
connecting data bytes of said input data string that are not included in said first compressed information data and said compressed third portion, with said first compressed information data and said compressed third portion to produce a compressed output data string.
1 Assignment
0 Petitions
Accused Products
Abstract
A method of data compression for recording data on a recording medium such as a magentic tape, a method of data restoration for data which has been compressed for recording, and an apparatus of data compression and restoration prescribe the data to be compressed based on type or value and encode the compression object data, thereby reducing the number of bits necessary to indicate the compression object data. Compression is implemented only for consecutive data fewer in number of repeating consecutive bytes than a certain number, thereby reducing the number of bits necessary to indicate the number of bytes of the consecutive data. A compression mark indicative of compression is appended to the compressed data, consisting of data made by encoding the compression object consecutive data and data indicating the number of bytes of the data, either at the front or rear of the compressed data, whereby an input data string can be compressed drastically and compressed data, even including errors, can be restored.
-
Citations
9 Claims
-
1. A method of transforming an input data string comprising a plurality of data bytes, said plurality including portions of a plurality of consecutive data bytes identical to one another, wherein said data bytes may be of a plurality of types, each type representing different information, said method comprising the steps of:
-
selecting, in advance, a first subset of the plurality of types of data bytes which may occur, said subset including those data byte types which more frequently appear repetitively and consecutively than those data byte types not included in the first subset; detecting a compressible portion of the data string when one of said data bytes types of said first subset appears consecutively in the string a certain minimum number of times up to a certain maximum number of times, compressing the compressible portion according to a first compression method, said compression method including encoding the data byte of the compressible portion and counting the number of data bytes of the portion to produce a compressed portion representative of the number and kind of data bytes in the compressible portion; appending a compression mark byte, which indicates that compression has been affected, either at the front or rear of said compressed portion to generate a first compression information data; when said input data string contains a third portion consisting of one or more consecutive data bytes the same as a first compression mark byte, said compression step further includes encoding and counting data bytes contained in said third portion to obtain a compressed third portion; and connecting data bytes of said input data string that are not included in said first compressed information data and said compressed third portion, with said first compressed information data and said compressed third portion to produce a compressed output data string. - View Dependent Claims (2, 5, 7, 8, 9)
-
-
3. An apparatus for transforming an input data string comprising a plurality of data bytes, said plurality including a consecutive portion having a plurality of consecutive data bytes identical to one another and the input data string is formed as a combination of data bytes of a plurality of types, each type representing different information, said apparatus comprising:
-
means for detecting if a data byte is of a type that corresponds to one of a first subset of data bytes including a first predetermined number of types selected in advance among said plurality of data byte types where said first number of bytes predetermined more frequently occur consecutively and repetitively than other data byte types, means for encoding data bytes of said type corresponding to one of said first subset in accordance with a first transforming format when the data byte of that type appears consecutively a minimum number of times; means for counting the number of said data bytes constituting said consecutive portion within a certain range of maximum value and for encoding said number; means for generating a compression mark byte which includes the presence of said encoded data blocks and the encoded number; means for detecting if the data string includes a portion including one or more consecutive data bytes the same as said compression mark byte; means for encoding a portion detected to include one or more consecutive data bytes the same as the compression mark byte and for counting the number of bytes of said portion to produce a second compressed portion; and switching means for combining compression information data consisting of said encoded data bytes, the encoded number and compression mark byte with data bytes of said input data string which are not compressed, and with a compressed second portion to thereby produce a compressed output data string. - View Dependent Claims (4)
-
-
6. A compression/restoration apparatus for transforming an input data string of a plurality of data bytes, which includes a consecutive portion of a plurality of consecutive data bytes identical to one another, and is formed as a combination of data bytes of a plurality of types, each type representing different information, into a compressed output data string, and restoring the original data string, said apparatus including a compression section and a restoration section, said compression section comprising:
-
means for detecting if the data byte of said consecutive portion corresponds to a data byte which more frequently occurs consecutively and repetitively and corresponds to a data byte type of a first certain number of types selected in advance among said data bytes of a plurality of types; means for encoding data bytes of said consecutive portion, detected to be data bytes of one of said first number of data byte types selected, in accordance with a first transformation format; means for counting and for encoding the number of said data bytes which constitute said consecutive portion within the range of a certain maximum value; means for generating a compression mark byte which indicates that said encoded data bytes and the encoded number are present; and switching means for connecting compression information data consisting of said encoded data blocks, encoded number and compression mark byte to input data from said data string that is without compression, thereby generating a compressed output data string, said restoration section comprising; means for reading out said output data string; means for detecting said compression mark byte in said read-out output data string; encoding means, when said compression mark is detected, for decoding said encoded data bytes located at the front or rear of said compression mark byte and outputting said decoded data bytes consecutively in number equal to the number indicated by said encoded number associated with said consecutive data; and switching means for selecting the output of said decoding means when said compression mark byte has been detected, or the output of said read-out output data string directly when said compression mark byte has not been detected.
-
Specification