Method of and apparatus for compressing and restoring data
First Claim
1. A data compression apparatus comprising:
- storage means for storing contexts and code trees according to a Huffman code rule, each of the code trees is related to a context;
input means for inputting a character string to be compressed;
character obtaining means for obtaining a character to be encoded from the inputted character string;
context specifying means for specifying a context occurred just preceding to the character obtained by said character obtaining means;
code outputting means for outputting a code corresponding to the character obtained by said character obtaining means in the code tree with respect to the context specified by said context specifying means;
updating means for updating the code tree used by said code outputting means in accordance with the Huffman code rule,whereineach of the code trees contains a special code `escape` which is transmitted to signal a decoder to shorten the context,if the data relative to the character obtained by said character obtaining means does not exist in the code tree stored in said storage means with respect to the context specified by said context specifying means, said code outputting means outputs the special code `escape` within the code tree and repeats the outputting of the special code `escape` while shortening the context until the code for the character related to the context is found, and outputs the code of the character; and
adding means for adding data about unregistered combinations of character and contexts to said storage means when said code outputting means outputs the special code `escape`.
1 Assignment
0 Petitions
Accused Products
Abstract
A data compression apparatus is capable of compressing data at a high compression rate and at a high speed. A data decompression apparatus is used in combination with this data compression apparatus to decode the compressed data. The data compression apparatus includes a RAM which stores Huffman code trees each of which corresponds to a character string, i.e. "context." A CPU encodes each character which is to be encoded by use of a Huffman code tree corresponding to the context at that time. Each time a character is encoded, the Huffman code tree used is reconstructed so as to account for the encoded character. The data decompression apparatus stores Huffman code trees corresponding to contexts respectively, decodes the code to be decoded by use of a Huffman code tree corresponding to the context (a character string previously decoded). Each time one character is decoded, the Huffman code tree used for decoding is reconstructed so as to account for the decoded character.
143 Citations
24 Claims
-
1. A data compression apparatus comprising:
-
storage means for storing contexts and code trees according to a Huffman code rule, each of the code trees is related to a context; input means for inputting a character string to be compressed; character obtaining means for obtaining a character to be encoded from the inputted character string; context specifying means for specifying a context occurred just preceding to the character obtained by said character obtaining means; code outputting means for outputting a code corresponding to the character obtained by said character obtaining means in the code tree with respect to the context specified by said context specifying means; updating means for updating the code tree used by said code outputting means in accordance with the Huffman code rule, wherein each of the code trees contains a special code `escape` which is transmitted to signal a decoder to shorten the context, if the data relative to the character obtained by said character obtaining means does not exist in the code tree stored in said storage means with respect to the context specified by said context specifying means, said code outputting means outputs the special code `escape` within the code tree and repeats the outputting of the special code `escape` while shortening the context until the code for the character related to the context is found, and outputs the code of the character; and adding means for adding data about unregistered combinations of character and contexts to said storage means when said code outputting means outputs the special code `escape`. - View Dependent Claims (2, 3, 4, 5)
-
-
6. A data compression apparatus comprising:
-
storage means for storing code trees according to a Huffman code rule and an occurrence frequency table, each of the code trees and the occurrence frequency table is related to a context; input means for inputting a character string to be compressed; character obtaining means for obtaining a character to be encoded from the inputted character string; context specifying means for specifying a context that occurs just preceding to the character obtained by said character obtaining means; first code outputting means for outputting, if data stored in said storage means for the context specified by said context specifying means is a code tree, a code corresponding to the character obtained by said character obtaining means in that by the code tree; first updating means for updating the code tree used by said first code outputting means in accordance with the Huffman code rule; second code outputting means for calculating, if data stored in said storage means for the context specified by said context specifying means is the occurrence frequency table, a code of the character obtained by said character obtaining means based on arithmetic coding rules using the occurrence frequency table, and for outputting the code; and second updating means for increasing occurrence frequency relative to the character obtained by said character obtaining means within the occurrence frequency table used by said second code outputting means. - View Dependent Claims (7, 8, 9, 10, 11, 12)
-
-
13. A data decompression apparatus comprising:
-
storage means for storing contexts and code trees according to a Huffman code rule, each of the code trees is related to a context; context specifying means for specifying a context to be used for restoring data; character outputting means for outputting a character corresponding to the code in the code tree stored in said storage means with respect to the context specified by said context specifying means; updating means for updating the code tree used by said character outputting means in accordance with the Huffman code rule, wherein each of the code trees contains a special code `escape`, and if the code is the special code in the code tree is the special character, said character outputting means repeats the restoration while shortening the context until the character is restored; and registering means for registering said storage means with data about unregistered combinations of contexts and character. - View Dependent Claims (14, 15, 16, 17, 22)
-
-
18. A data decompression apparatus comprising:
-
storage means for storing code trees according to a Huffman code rule and an occurrence frequency table, each of the code trees and occurrence frequency table is related to a context; context specifying means for specifying a context used for decoding; first character outputting means for outputting, if data stored in said storage means for the context specified by said context specifying means is a code tree, a character made corresponding to the code in that code tree; first updating means for updating the code tree used by said first character outputting means in accordance with the Huffman code rule; second character outputting means for performing, if data stored in said storage means for the context specified by said context specifying means is the occurrence frequency table, arithmetic decoding of the code on the basis of the occurrence frequency table and outputting the character obtained as a decoded result; and second updating means for increasing the occurrence frequency relative to the outputted character in the occurrence frequency table used by said second character outputting means. - View Dependent Claims (19, 20, 21, 23, 24)
-
Specification