CN101095284A - Device and data method for selective compression and decompression and data format for compressed data - Google Patents

Device and data method for selective compression and decompression and data format for compressed data Download PDF

Info

Publication number
CN101095284A
CN101095284A CNA2005800453617A CN200580045361A CN101095284A CN 101095284 A CN101095284 A CN 101095284A CN A2005800453617 A CNA2005800453617 A CN A2005800453617A CN 200580045361 A CN200580045361 A CN 200580045361A CN 101095284 A CN101095284 A CN 101095284A
Authority
CN
China
Prior art keywords
data
compression
unit
output
decompression
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.)
Granted
Application number
CNA2005800453617A
Other languages
Chinese (zh)
Other versions
CN101095284B (en
Inventor
笹仓三好
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.)
Graphic Technology Corporation
Original Assignee
Casio Computer Co Ltd
Casio Electronics Manufacturing Co 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
Priority claimed from JP2005039807A external-priority patent/JP4479530B2/en
Application filed by Casio Computer Co Ltd, Casio Electronics Manufacturing Co Ltd filed Critical Casio Computer Co Ltd
Publication of CN101095284A publication Critical patent/CN101095284A/en
Application granted granted Critical
Publication of CN101095284B publication Critical patent/CN101095284B/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

A first compression unit compresses input data by a first compression method utilizing a dictionary coding method. A second decompression unit compresses input data by a second compression method utilizing a statistical coding method. A size calculation/determination unit pre-calculates sizes of data to be output when the data is compressed only by the first compression method, when the data is compressed only by the second compression method, when the data is compressed both by the first and second compression methods, and when the data is compressed neither by the first nor the second compression method, and selects the method that will result in the smallest data size, so that the input data is compressed by the selected method.

Description

Be used for the equipment of compression and decompression selectively and the data format of data method and packed data
Technical field
The present invention relates to be used for apparatus and method for that various data (for example character data, view data or the like) are carried out compression and decompression.
Background technology
Along with recent rapid development of computer, various information, for example character information, Vector Message, image information or the like are all handled by computer, produce lot of data.In this case, a kind of data compression method and corresponding decompression method have been proposed, be used for coming amount of compressed data,, perhaps realize effective use the memory capacity of memory device so that shorten the needed time of transfer of data by being omitted in the redundancy section that data comprise.
Based on universal coding, be applicable to that the several different methods such as various data such as character information, Vector Message, image informations has been adopted as the coding method that is used for packed data.Universal coding comprises the dictionary encoding method, and this method is utilized the similitude between the character string, and the statistical coding method, the frequency that this method utilizes character to occur.
The Lempel-Ziv coding is the typical case of dictionary encoding method.For the Lempel-Ziv coding method, two kinds of algorithms have been proposed; A kind of is slip dictionary type (being also referred to as universal class), and another kind is dynamic dictionary type (is also referred to as increment and can decomposes (increment resolvable) type).The known improved form of slip dictionary type algorithm is the LZSS coding, QIC-122 coding or the like, and the QIC-122 coding is the standard compression method of quarter inch cartridge tape.
On the other hand, LZW (Lempel-Ziv-Welch) coding or the like is the known improvement of dynamic dictionary type.
Statistical coding method purpose is to be that the character with higher frequency of occurrences distributes longer code length by the statistic frequency (occurrence rate) that occurs according to each character, improves compression efficiency.For example, arithmetic coding method and Huffman coding method are the known typical methods of statistical coding method.According to the Huffman coding method, the code (Huffman sign indicating number) that will have the code length that the frequency of occurrences with a character is inversely proportional to is used for this character.
Simultaneously, also have a kind of compound data compression method, it adopts above-mentioned dictionary encoding method and statistical coding method simultaneously.This method comprises the LZH method, and it uses the Huffman method that the data of being compressed by above-mentioned LZSS method are compressed.Because the LZSS method is that unit compresses data with the character string, and the Huffman method is compressed data character by character, therefore from the complex method of these two kinds of methods, can expect to obtain complementary effect.
Early stage slip dictionary type algorithm (LZ1) is described now.This algorithm needs a large amount of calculating, but can realize high compression rate.This algorithm is divided into the longest partial character string with data to be encoded, each partial character string is according to character that it comprised, corresponding with each character of the character string that comprises in the data flow formerly, then each partial character string is encoded to the copy of previous character string.Figure 28 is the diagrammatic sketch that is used to illustrate this principle.
In Figure 28, the encoded input data of P buffer 281 storages, Q buffer 282 storages data to be encoded.With being input to character string 283 in the Q buffer 282, carry out comparison with the character string stream that is stored in the P buffer 281 from its stem.If in P buffer 281, found the longest character string 284 corresponding according to the character that is comprised, then coding beginning.For example, found in P buffer 281 under the situation of respective symbols string 284, as shown in figure 28, then the starting position by the longest respective symbols string 284 is set to p1, and the length of the longest respective symbols string in Q buffer 282 is set to q1, comes data are compressed.1/2 of its original length of document information boil down to that this coding will be for example be made up of character code.Utilize the invention of this slip dictionary type algorithm for example disclosing among the Japan Patent No.3241788.
Next, statistical coding will be described.As shown in figure 29, statistical coding method comprises Input Data Buffer 291, statistical modeling unit 292, frequency of occurrences table 293, entropy coding processing unit 294.292 scannings of statistical modeling unit are stored in the character string in the Input Data Buffer 291, and calculate the frequency of occurrences of each character.The assignment of code that entropy coding processing unit 294 will generate according to the frequency of occurrences that statistical modeling unit 292 calculates is given each character.
The frequency of occurrences of being calculated by statistical modeling unit 292 is classified as the ratio that is used for the statistical coding method, the ratio that is used for the ratio of half self-adaptive encoding method and is used for self-adaptive encoding method, wherein, in described statistical coding method, the frequency of occurrences of each character is predetermined, in half self-adaptive encoding method, the frequency of occurrences of each character obtains by when handling beginning whole character string being scanned, in self-adaptive encoding method, frequency is all reset in the each appearance of each character, frequency occurs to recomputate.Utilize the invention of statistical coding method for example disclosing among the Japan Patent No.3276860.
Yet above-mentioned coding method has following problem.
At first, according to the dictionary encoding method,, be that search is come out from encoded character string, and be the copy of this partial character string, as mentioned above digital coding according to the character that the is comprised the longest partial character string corresponding with the character of data to be encoded.Must use can obtain the structure of more and more higher data compression rate, so that utilize this algorithm.This structure also must be able to make coded data be convenient to Computer Processing.
For example, in order to improve the data compression rate in the dictionary encoding method, must increase will be stored in the quantity of the character in the P buffer, also be same requirement in the Q buffer.Yet, increasing if be stored in the quantity of the character in P buffer and the Q buffer, the amount of bits of data to be encoded can not be the multiple of " 8 ".When this will transmit in data, will call complicated processing, for example the position is redistributed.In addition, relatively the amount of calculation of Ji Suaning is huge, causes low-down compression efficiency.
The dictionary encoding method with hard-wired situation in, if compressor circuit and decompression circuit are structured on the single integrated circuit, then the scale of this circuit can be very huge, thereby greatly improved the cost of necessary hardware.
In addition, beginning most of using, slip dictionary type algorithm is coded data under the situation that is not structured in the reference data deposit in the dictionary.Therefore, for input data early, compression ratio is low, and this is because there is not sufficient content in dictionary.
On the other hand, according to the statistical coding method,, handle as two-way between the two, so processing speed is low because encoding process needs the participation of statistical modeling unit 292 and entropy coding processing unit 294.In addition, because its characteristic as variable length code, this coding method needs the position to handle, and this needs long time, and makes codimg logic become complicated.
Summary of the invention
The above situation of the present invention's consideration is made, and the purpose of this invention is to provide a kind of can the realization at a high speed and the data compression/decompression apparatus and the data compression/decompression compression method of high compression rate.
Data compression device according to a first aspect of the invention comprises:
First data compression unit (1,11,21), it carries out first data compression process, is used to use dictionary encoding method compression input data; And
Second data compression unit (2,12,22), it carries out second data compression process, is used to use the statistical coding method that the data of being compressed by described first data compression unit (1,11,21) are compressed,
Wherein, described first data compression unit (1,11,21) search long data corresponding in the coded data from dictionary with described input data, and be the unit described input data that decompress with the byte.
Described first data compression unit (1,11,21) can be calculated the frequency of occurrences of the identical data that comprises in described input data.
Described second data compression unit (2,12,22) can be carried out data compression by using the result of calculation of the frequency of occurrences of being calculated by described first data compression unit (1,11,21).
Described data compression device can also comprise size calculating/determining unit (25), it calculates works as described input data only by described first compression unit (1,11, first output data quantity that will export when 21) compressing, and work as by described first data compression unit (1,11,21) to the compression of described input data and first dateout that obtains by described second compression unit (2,12, second output data quantity that will export when 22) further compressing, and determine that whether described second output data quantity is greater than described first output data quantity
Wherein, when described size calculating/determining unit (25) was determined described second output data quantity greater than described first output data quantity, described second compression unit (2,12,22) can not carried out described second data compression process.
Described size calculating/determining unit (25) can further be calculated the 3rd output data quantity that will export when described input data are only compressed by described second compression unit (2,12,22), and the data volume of more described first output data quantity, described second output data quantity, described the 3rd output data quantity and described input data.
Under the situation of the described first output data quantity minimum, only described first compression unit (1,11,21) is carried out compression.
Under the situation of the described second output data quantity minimum, described first compression unit (1,11,21) and described second compression unit (2,12,22) both carry out compression.
Under the situation of described the 3rd output data quantity minimum, only described second compression unit (2,12,22) is carried out compression.
Under the situation of the data volume minimum of described input data, described first compression unit (1,11,21) and described second compression unit (2,12,22) are not carried out compression.
Described data compression device can also comprise compression efficiency determining unit (39), it determines whether to occur continuously identical character data in described input data, and occur continuously under the identical characters data conditions definite, order described first compression unit (1,11,21) or described second compression unit (2,12,22) to carry out distance of swimming compression and handle.
Before carrying out described data compression process, the size of the data after described first compression unit (1,11,21) and described second compression unit (2,12,22) can calculate and be compressed, determine to realize the data output mode of minimal data size, and determine that according to this result finds output format (113).
Described output format (113) can be included as predetermined quantity in the character code that in described input data, comprises, have the set zone of character code of the high frequency of occurrences, and storage data that the Code Number of the character code of described predetermined quantity is associated with the frequency of occurrences of the character code of described predetermined quantity.
Data decompression equipment according to a second aspect of the invention comprises:
First decompression unit (51), it adopts the method decompression packed data corresponding with the statistical coding method; And
Second decompression unit (52), it adopts the method corresponding with the dictionary encoding method that the data that decompressed by described first decompression unit (51) are further decompressed.
Described data decompression equipment can also comprise determining unit (54), and it determines to be included in the value of the identification data in the described packed data,
Wherein:
Determine that in described determining unit (54) described identification data is under the situation of first identification data, described first decompression unit (51) the described packed data that can decompress, and described second decompression unit (52) can further decompress to the data that decompression obtained by described first decompression unit (51); And
Determine that in described determining unit (54) described identification data is under the situation of second identification data, described first decompression unit (51) the described packed data that can decompress.
Determine that in described determining unit (54) described identification data is under the situation of the 3rd identification data, described second decompression unit (52) the described packed data that can decompress.
Data compression method according to a third aspect of the invention we comprises:
The first data compression step is carried out first data compression process, is used to use dictionary encoding method compression input data; And
The second data compression step is carried out second data compression process, is used for using the statistical coding method that the data of being compressed in the described first data compression step are compressed,
Wherein, in the described first data compression step, from dictionary, having found corresponding with described input data long data in the coded data, and be that unit compresses it with the byte, and output.
In the described first data compression step, can calculate the frequency of occurrences of the identical data that in described input data, comprises.
In the described second data compression step, can carry out data compression by using the result of calculation of the frequency of occurrences of being calculated in the described first data compression step.
Described data compression method can also comprise size calculating/determining step; Be used for calculating first output data quantity that only when described first compression step is compressed, will export when described input data; And second output data quantity that when the first output data that in the described first data compression step described input data compression obtained are further compressed in the described second data compression step, will export; And determine that whether described second output data quantity is greater than described first output data quantity
Wherein, when determine that in described size calculating/determining step described second data compression process can not carried out under the situation of described second output data quantity greater than described first output data quantity in the described second data compression step.
In described size calculating/determining step, can further calculate the 3rd output data quantity that in the described second data compression step, will export during the described input data of compression when only, and can more described first output data quantity, the data volume of described second output data quantity, described the 3rd output data quantity and described input data;
In described first output data quantity is under the situation of minimum, can only carry out compression in the described first data compression step;
In described second output data quantity is under the situation of minimum, can only carry out compression in described first data compression step and the described second data compression step;
In described the 3rd output data quantity is under the situation of minimum, can only carry out compression in the described second data compression step; And
Data volume in described input data is under the situation of minimum, can not carry out compression in described first data compression step and the described second data compression step.
Described data compression method can also comprise the compression efficiency determining step, be used for determining whether occurring identical character data continuously in described input data, and occur continuously under the identical characters data conditions definite, order is carried out distance of swimming compression and is handled in described first data compression step or the described second data compression step.
In described first data compression step or the described second data compression step, can be before carrying out described data compression process, calculating is compressed the size of data afterwards, determines to realize the output mode of minimal data size, and determines that according to this result finds output format (113).
Described output format (113) can be included as predetermined quantity in the character code that comprises in the described input data, have the set zone of character code of the high frequency of occurrences, and storage data that the Code Number of the character code of described predetermined quantity is associated with the frequency of occurrences of the character code of described predetermined quantity.
Uncompressing data according to a forth aspect of the invention comprises:
The first data decompression step is used to adopt the method corresponding with the statistical coding method packed data that decompresses; And
The second data decompression step is used for adopting the method corresponding with the dictionary encoding method that the data that decompressed in the described first data decompression step are further decompressed.
Described uncompressing data can also comprise determining step, is used for determining being included in the value of the identification data of described packed data,
Wherein:
When in described determining step, determining that described identification data is first identification data, the described packed data that can in described first decompression step, decompress, and can be to further decompressing by the data that obtained that in described first decompression step, decompress in described second compression step; And
When determining that described identification data is second identification data in described determining step, described packed data decompresses in the described first data decompression step.
When determining that described identification data is the 3rd identification data in described determining step, described packed data decompresses in described second decompression step.
According to the present invention, adopt described first compression unit and described second compression unit, can provide and can realize at a high speed and the data compression/decompression apparatus and the data compression/decompression compression method of high compression rate.According to the present invention, described first compression unit uses the dictionary encoding method to come coded input data, and described second compression unit uses the statistical coding method to come coded input data.
Description of drawings
By reading following the detailed description and the accompanying drawings, these purposes of the present invention and other purposes and advantage will become more clear, in the accompanying drawings:
Fig. 1 is the block diagram that illustrates according to the structure of data compression device of the present invention;
Fig. 2 is the block diagram that illustrates according to the system configuration of the data compression device of embodiment 1;
Fig. 3 A is the figure that the structure of input data is shown, Fig. 3 B is the figure that the concrete structure of packed data is shown, Fig. 3 C and 3D are the figure that is used for the structure of description flags data, and Fig. 3 E is used to illustrate the not figure of the structure of packed data, and Fig. 3 F is the figure that is used to illustrate the structure of pressure texture;
Fig. 4 is the figure that is used to illustrate according to the structure of the data compression device of embodiment 2;
Fig. 5 is the figure that is used to illustrate according to the structure of the data compression device of embodiment 3;
Fig. 6 A and 6B are the figure that the example of identification data is shown;
Fig. 7 is the figure that is used to illustrate according to the structure of the data compression device of embodiment 4;
Fig. 8 A and 8B are the figure that the example of identification data is shown;
Fig. 9 is the figure that is used to illustrate according to the structure of the data compression device of embodiment 5;
Figure 10 is the figure that is used to illustrate the configuration of preliminary treatment unit;
Figure 11 is the flow chart that is used to illustrate by the performed processing in preliminary treatment unit;
Figure 12 is the figure that the example of compressed format is shown;
Figure 13 is the flow chart that is used to illustrate by the performed processing of coding generation unit;
Figure 14 is the figure that is used to illustrate according to the structure of the data compression device of embodiment 6;
Figure 15 is the figure that is illustrated in the relation between the size of code in each deterministic model and coded data;
Figure 16 is illustrated in the various deterministic models figure of the data that will be provided with in output data buffer;
Each all shows according to determining that the result of calculation that is obtained based on the compression efficiency determining unit is made Figure 17 A to 17H, is defined as the output format of the compressed format that will be output;
Figure 18 is the figure that illustrates according to the structure of the compressed format of embodiment 7;
Figure 19 is the flow chart by the performed processing of coding generation unit;
Figure 20 is the figure that is used to illustrate according to the data compression process of embodiment 8;
Figure 21 is the figure that is used to illustrate according to the structure of the data compression device of embodiment 9;
Figure 22 is the figure that is used to illustrate according to the structure of the data decompression equipment of embodiment 10;
Figure 23 is the figure that is used to illustrate according to the structure of the data decompression equipment of embodiment 11;
Figure 24 is the figure that is used to illustrate according to the structure of the data decompression equipment of embodiment 12;
Figure 25 is used to illustrate the flow chart of being handled by the data decompression of carrying out according to the data decompression equipment of embodiment 13;
Figure 26 is the figure that is used to illustrate according to the structure of the data decompression equipment of embodiment 14;
Figure 27 is the figure that is used to illustrate according to the structure of the data decompression equipment of embodiment 15;
Figure 28 is the figure that is used to illustrate early stage data compression process; And
Figure 29 is the figure that is used to illustrate early stage data compression process.
Embodiment
Referring now to description of drawings each embodiment of the present invention.
(embodiment 1)
Fig. 1 is the block diagram according to the data compression device 100 of present embodiment.
Data compression device 100 comprises control unit 101, ROM (read-only memory) 102, RAM (random access storage device) 103, I/O (I/O) 104, external memory unit 105 and system bus 106.
Control unit 101 is by CPU formations such as (central processing units), and whole data compression device 100 is controlled.Control unit 101 is read program that is stored among ROM 102 and the RAM 103 or the like, and carries out predetermined process according to program of being read or the like.
ROM 102 is nonvolatile memories, and its storage is controlled necessary operating system (hereinafter referred to as " OS "), program or the like to whole data compression device 100.Control unit 101 is read OS, program or the like where necessary from ROM 102, and carries out predetermined process according to OS, program or the like.Data compression device 100 can be constructed as, and makes OS, program or the like be stored in the memory cell 105, and control unit 101 reads OS, program or the like where necessary from memory cell 105, and carries out predetermined process according to them.
RAM 103 is volatile memory, is used to store 101 that read by control unit, as to be used to carry out predetermined process program, perhaps is used for the necessary data of storage execute program.
I/O 104 by be connected to be used for to read or write such as the removable dish of CD (compact disk) or the like, such as the driving arrangement of CD-ROM drive or the like, perhaps, carry out data input or data output by being connected on the input equipment such as keyboard, mouse or the like.For example I/O 104 receives the input data that will be encoded by control unit 101, and the data that received are input in the control unit 101.
Memory cell 105 is made of the memory device such as hard disk drive or the like.
System bus 106 is the transmission paths that are used for transfer instruction and data between control unit 101, ROM 102, RAM 103, I/O104 and memory cell 105.
Next, the system configuration of describing according to the data compression device 100 of present embodiment with reference to figure 2.
In Fig. 2, first compression unit 1 uses self-adapting dictionary coding method (Lempel-Ziv method) compression input data, and second compression unit 2 uses half self adaptation statistical coding method compression input data.The input data are imported into first compression unit 1, and by first compression unit, 1 coding, generate first packed data.First packed data that is obtained by first compression unit 1 is provided for intermediate data buffer 13.These data further by 2 compressions of second compression unit, generate second packed data.
For example, first compression unit 1 and second compression unit 2 are included in first control unit 101.Intermediate data buffer 13 is included among the RAM 103.Perhaps, these unit can be constructed as the independent circuits that is used to carry out above-mentioned processing.
Be input to data in first compression unit 1 and be for example character data, vector data, view data or the like.First compression unit 1 uses the self-adapting dictionary coding method to come coded input data, this method is encoded to data based on partial data string (partial data string), described partial data string is from finding the coded data, and it is the longest to hold upward corresponding with input data degree within it.First compression unit, 1 outputting encoded data, except the form that will describe subsequently is the identifier sign of 1 byte data, and make 8 identifier signs (each is made up of 1 bit) for a branch of, and with its form output, thereby be that unit exports all data with the byte according to 1 byte data.
Fig. 3 is the figure that is used to specify above-mentioned configuration.At first, as shown in Figure 3A, Input Data Buffer 3 comprises P buffer 4 and Q buffer 5.P buffer 4 is historic buffer, is made of 32 bytes.Q buffer 5 is provided the input data, is made up of 9 bytes.On the direction shown in the arrow of sliding window 6 in Fig. 3 A slidably.
Particularly, the first compression unit 1 described sliding window 6 that slides on the direction of the arrow of Fig. 3 A is got in the Q buffer 5 will import data.
Fig. 3 B is the figure that the concrete structure of packed data is shown.First byte is a flag data, is 8 packed datas (perhaps not packed data) subsequently.
Shown in Fig. 3 C, flag data is the data of 1 byte (8 bit), and according to the present invention, value " 0 " is indicated not packed data, value " 1 " indication packed data.Shown in Fig. 3 C first to the 8th sign corresponding to first of the packed data of this flag data back (perhaps not packed data) to the 8th data.
For example, illustrate under the situation of value of statistical indicant " 1 " at first sign of this flag data, first data in 8 packed datas (perhaps not packed data) are packed datas of 1 byte (8 bit).Fig. 3 F show m as packed data (m be equal to, or greater than 1 and be equal to or less than 8 integer) topology example of individual data.5 the highest bits of these m data are indicated corresponding starting position, the length of 3 minimum bit indication respective symbols strings.P buffer 4 is the buffers with capacity of can enough 5 bits representing.For example, suppose that 3 minimum bits are " 000 ", it indicates corresponding string length is 2 bytes, and first compression unit 1 can proceed to the corresponding relation search of the string data of many 9 bytes.
On the other hand, illustrate under the situation of value of statistical indicant " 0 " at first sign of flag data, first data in 8 packed datas (perhaps not packed data) are not packed datas of 1 byte (8 bit).Fig. 3 E shows the not topology example of m data of packed data of conduct, and unpressed original data storage is in this structure.
Same be applied to second to the 8th data, they represent packed data or packed data not thus, and it is corresponding with the state of the sign that writes down in flag data.Comprise information in above-mentioned 8 packed datas (perhaps not packed data) flag data afterwards, shown in Fig. 3 D about ensuing the 9th to the 16 packed data (perhaps not packed data).
According to present embodiment, P buffer 4 (historic buffer) and Q buffer 5 as the slip dictionary are to form with very little size, first compression unit 1 is that unit exports all data with the byte, wherein, each coded data (except its identifier sign) all the data by 1 byte constitute.
Therefore, according to present embodiment, can quicken compression and handle.In addition, aspect hardware configuration, the shift register of historical array, conduct " slip dictionary P buffer ", comparator or the like can form with less size, thereby realize very little circuit scale.
In addition, second compression unit 2 in preparation, can realize can high compression and data compression efficiently.
In addition, first compression unit 1 and second compression unit 2 all are to be processes data in units with the byte, and this can reduce bit process as much as possible, and help to handle acceleration.
In addition, first compression unit 1 and second compression unit 2 all are the universal coding types, therefore can be with the data of high speed and high compression efficiency coding any kind, for example character data, graph data or the like.
(embodiment 2)
The second embodiment of the present invention is described now.
Fig. 4 is the figure that is used to illustrate according to the structure of the compression device of present embodiment.First compression unit 11 uses self-adapting dictionary coding method (Lempel-Ziv method) packed data, and second compression unit 2 uses half self adaptation statistical coding method packed data.First compression unit 11 of present embodiment is designed to calculate simultaneously and will be used the frequency of occurrences by second compression unit 12.Below will be described more specifically it.
The input data are imported into first compression unit 11, and are encoded to generate first packed data.Be imported into input data in first compression unit 11 and be for example character data or the like.First compression unit 11 is encoded to the input data based on partial character string, and described partial character string finds in the coded data from dictionary, and it is corresponding with the input data with the longest degree in terms of content.First packed data that is obtained is provided for intermediate data buffer 13.When being provided the data of specific quantity, intermediate data buffer 13 outputs to second compression unit 12 with first packed data.
Simultaneously, first compression unit 11 is carried out the processing of calculating the frequency of occurrences, and this frequency of occurrences is necessary in the compression of being undertaken by second compression unit 12 is handled, and subsequently result of calculation is outputed to frequency of occurrences table memory cell 14.That is, first compression unit 11 generates the frequency of occurrences table that will be used by second compression unit 12, thereby second compression unit 12 can use statistical coding method packed data effectively.
Notice that for example, first compression unit 11 and second compression unit 12 are included in the control unit 101.Intermediate data buffer 13 and frequency of occurrences table memory cell 14 are included among the RAM103.Perhaps, these unit can be constructed as the circuit that is used to carry out above-mentioned processing.
Adopt this mode, according to present embodiment, first compression unit 11 generates coded data, calculates the frequency of occurrences simultaneously, frequency meter occurs with generation.This makes second compression unit 12 need not calculate the frequency of occurrences, but by using this frequency of occurrences table to carry out compression effectively, handles thereby quicken this compression.
(embodiment 3)
Now embodiments of the invention 3 will be described.
Fig. 5 is the figure that is used to illustrate according to the structure of the compression device of present embodiment.In Fig. 5, be provided for Input Data Buffer 20 such as the input data of character data or the like.These input data further offer first compression unit 21 from Input Data Buffer 20.Similar with above embodiment, first compression unit 21 adopts self-adapting dictionary coding method packed data, also carries out the processing of the frequency of occurrences of calculating the identical characters string.Below will carry out more specific description to it.
First compression unit, 21 coded input datas, and it is outputed to intermediate data buffer 23, and measure simultaneously from the size of first packed data of first compression unit, 21 outputs and the frequency of occurrences of aforesaid calculating identical characters string.
24 storages of frequency of occurrences table memory cell are used to write down the frequency of occurrences table of the frequency of occurrences.24 pairs of data from 21 outputs of first compression unit of frequency of occurrences table memory cell are counted, and store for example frequency of occurrences data of each character code.
Size calculating/determining unit 25 is calculated the size (perhaps compression ratio) of second packed data that will generate when second compression unit 22 is carried out data compression, determine whether the data volume that will export in size can be bigger than first packed data, and output indicates this to determine result's identification data 28.
For example, determining that size calculating/determining unit 25 output valves " 1 " are as identification data 28 under the situation that this dateout will be bigger.Opposite, determining that size calculating/determining unit 25 output valves " 2 " are as identification data 28 under the situation that this output data quantity can be not bigger.
In addition, determining under the situation that this output data quantity will be bigger, first packed data that size calculating/determining unit 25 order initial data output units 26 will be stored in the intermediate data buffer 23 outputs to output data buffer 27, handles and first packed data is not carried out second compression.On the other hand, determining under the situation that this output data quantity can be not bigger, size calculating/determining unit 25 orders second compression unit 22 obtains first packed data that is stored in the intermediate data buffer 23, handles so that the data that obtained are carried out second compression.
Fig. 6 is the figure that the topology example of identification data 28 is shown.For example, identification data 28 comprises two types, promptly a kind ofly first compression is shown handles and to have carried out and second compression is handled and also do not carried out, and another kind illustrates first compression and handles and carried out and second compression is handled and also carried out, as shown in Figure 6A.What replace the two is that identification data 28 can and indicate the second compression processing to carry out/do not have second sign of execution by first sign of indicating compression to carry out, shown in Fig. 6 B.
By these steps, identification data 28 and packed data are imported into output data buffer 27.Output data buffer 27 outputs are only by the data of first compression unit, 21 compressions, perhaps by the data of first compression unit 21 and 22 both compressions of second compression unit.
First compression unit 21, second compression unit 22, size calculating/determining unit 25 and initial data output unit 26 are included in the control unit 101.Input Data Buffer 20, intermediate data buffer 23, frequency of occurrences table memory cell 24 and output data buffer 27 are included among the RAM103.Perhaps, these unit can be constructed as the circuit that is used to carry out above-mentioned functions.
As mentioned above, according to present embodiment, after having carried out the first compression processing, calculate the size (perhaps compression ratio) of the situation lower compression data of handling in enforcement second compression.If the data volume after second compression is handled, then will can not be carried out second compression and handle in first data size of compressing after handling greater than only.This has just been avoided second compression to handle the size that produces the bigger data than first packed data.That is, can avoid invalidly carrying out second compression and handle, it is more effective to make compression handle.
(embodiment 4)
Now embodiments of the invention 4 will be described.
Fig. 7 is the figure that is used to illustrate according to the structure of the compression device of present embodiment.According to present embodiment, the frequency of occurrences table in embodiment 3, also to prepare another frequency of occurrences table, so that realize that more effectively compression is handled.Below will be elaborated to it.Identical reference marker will give the assembly identical with embodiment 3.
Similar to the above embodiments, be provided for Input Data Buffer 20 such as the input data of character data or the like.The input data that offer Input Data Buffer 20 also are provided for first compression unit 21.First compression unit 21 uses the self-adapting dictionary coding method to compress this input data, and first packed data is outputed to intermediate data buffer 23.First compression unit 21 is measured the size of these input data and the size of first packed data, also calculates the frequency of occurrences of identical characters string.
According to present embodiment, frequency of occurrences table memory cell 24 storage first frequency of occurrences table 24A and second frequency of occurrences table 24B, both's storage representation is the data of the frequency of occurrences of each character code for example, and is similar to the above embodiments.For example, frequency of occurrences table 24A is stored in the frequency of occurrences of each data that comprises in these input data, and frequency of occurrences table 24B is stored in the frequency of occurrences of each data that comprises in first packed data.Size calculating/determining unit 25 is calculated the size (perhaps compression ratio) of second coded data that will generate when second compression unit 22 is carried out data compression, and determines whether the data volume that will export dimensionally can be bigger than first packed data.
Size calculating/determining unit 25 is calculated following four kinds of sizes, to carry out the following processing that will describe.
(1) size of input data: SIZE_INPUT
The Output Size of (2) first packed datas: SIZE_1
(3) Output Size when the input data are only compressed by second compression unit 22: SIZE_2
(4) Output Size when first packed data is further compressed by second compression unit 22: SIZE_12
Under the situation of size SIZE_INPUT minimum of input data, export these input data and it is not handled.That is, the identification data 28 of size calculating/determining unit 25 output values of illustrating " 1 ", and order initial data output unit 26 is exported and is stored in the data in the Input Data Buffer 20 and it is not handled.Initial data output unit 26 obtains to offer the input data of Input Data Buffer 20, and it is outputed to output data buffer 27.
Under the situation of the size SIZE_1 of first packed data minimum, first compression unit 21 is carried out compression, and second compression unit 22 is not carried out compression.That is, the identification data 28 of size calculating/determining unit 25 output show values " 2 ", and 26 outputs of order initial data output unit are stored in first packed data in the intermediate data buffer 23.First packed data that initial data output unit 26 will be stored in the intermediate data buffer 23 outputs to output data buffer 27.
Under the situation of SIZE_2 minimum, first compression unit 21 is not carried out compression, but 22 pairs of inputs of second compression unit data are carried out compression.That is, the identification data 28 of size calculating/determining unit 25 output values of illustrating " 3 ", and order second compression unit 22 to be handled from Input Data Buffer 20 acquisition input data and to this input data application second compression.Second compression unit 22 obtains the input data from Input Data Buffer 20, carries out second compression and handles, and the packed data that is obtained is outputed to output data buffer 27.
Under the situation of SIZE_12 minimum, first compression unit 21 is carried out the compression of input data, and first packed data that 22 pairs of second compression units are obtained is carried out further compression, to obtain second packed data.That is, the identification data 28 of size calculating/determining unit 25 output values of illustrating " 4 ", and order second compression unit 22 to carry out data compression.Second compression unit 22 obtains to be stored in first packed data in the intermediate data buffer 23, compresses so that it is carried out further, and second packed data that is obtained is outputed to output data buffer 27.
For example, each value of identification data 28 is all just like the connotation shown in Fig. 8 A.That is, value " 1 " indication first and second compressions are handled and are not all had to carry out.Value " 2 " indication has been carried out the first compression processing but has not been carried out second compression and handle.Value " 3 " indication is not carried out the first compression processing but has been carried out second compression and handled.Value " 4 " indication first and second compressions are handled and have all been carried out.
Replace above four values, identification data 28 can be compressed to handle to carry out/do not have second sign of carrying out and indicate the second compression processing to carry out/do not have the 3rd sign of carrying out and constitute by first sign, indication first that the indication compression has been carried out, shown in Fig. 8 B.
For example, first compression unit 21, second compression unit 22, size calculating/determining unit 25 and initial data output unit 26 are included in the control unit 101.Input Data Buffer 20, intermediate data buffer 23, frequency of occurrences table memory cell 24 and output data buffer 27 are included among the RAM103.Perhaps, these unit can be constructed as the circuit that is used to carry out above-mentioned processing.
As mentioned above, according to present embodiment, can make up first and second compressions and handle, thereby make and can select the most effective compression method, the size of the data after can preventing to compress simultaneously is bigger than the size of input data.
(embodiment 5)
Now embodiments of the invention 5 will be described.
Fig. 9 is the figure that is used to illustrate according to the structure of the compression device of present embodiment.In the present embodiment, use the compression of half self adaptation statistical coding method to handle explanation, these are different with previous embodiment 1 to 4.Compression device 31 comprises Input Data Buffer 30, statistical modeling processing unit 32, frequency of occurrences table memory cell 33 and entropy coding unit 34.Below will be described in more details it.
At first, the input data such as character data or the like are provided for Input Data Buffer 30.For example, first packed data that will obtain by the compression of above-mentioned first compression unit 21 offers Input Data Buffer 30.The input data that offer Input Data Buffer 30 are provided for statistical modeling processing unit 32.Statistical modeling processing unit 32 calculates the frequency of occurrences of each data.The result of calculation of the frequency of occurrences is provided for frequency of occurrences table memory cell 33.Frequency of occurrences table memory cell 33 result of calculation of the frequency of occurrences that provided is provided in the frequency of occurrences table 111.
Entropy coding unit 34 comprises preliminary treatment unit 35, coding generation unit 36, first output data buffer to the, eight output data buffers and coded data output processing unit 37.
Preliminary treatment unit 35 calculates the size of packed data, and between first output data buffer to the, eight output data buffers distribute data, and carry out the processing of the following stated, with order to be the stem zone that the 1st to the 23rd code outputs to dateout.Coding generation unit 36 generates suitable compressed format 113 according to the order information that is generated by preliminary treatment unit 35, will be described subsequently.
At first, will the processing of preliminary treatment unit 35 be described.Figure 10 is used to illustrate the illustrative arrangement of preliminary treatment unit 35 and the figure of processing.Frequency of occurrences value shown in Figure 10 only is an example.The frequency of occurrences table 111 that is stored in the frequency of occurrences table memory cell 33 has been stored the frequency of occurrences value corresponding with character code (byte data 00h is to FFh).The end character " h " of character code represents that this character code is 16 system numerals.According to these frequency of occurrences values, preliminary treatment unit 35 generating code tables 112, this code table 112 will be the character code of the 23rd or more high-order frequent appearance according to the ordering of the order of the frequency of occurrences, be associated with the frequency of occurrences value of these character codes.For example, code table 112 is stored among the RAM 103.
Figure 11 is the flow chart that is used to illustrate by the performed processing in preliminary treatment unit 35.
At first, preliminary treatment unit 35 setup code tables 112 and frequency of occurrences table 111 (step S1).
When compression device 31 beginning data compressions, statistical modeling processing unit 32 upgrades frequency of occurrences table 111, as mentioned above.
Next, preliminary treatment unit 35 begins to read the data (step S2) that are stored in the frequency of occurrences table 111.Preliminary treatment unit 35 determines whether described reading has arrived the last data (step S3) of being stored in frequency of occurrences table 111.(step S3: not), preliminary treatment unit 35 obtains the current frequency of occurrences value (step S4) that arrives from frequency of occurrences table 111 under the last data conditions that does not also arrive in frequency of occurrences table 111.
Preliminary treatment unit 35 calculates the sum that frequency values occurs, to obtain the quantity (step S5) of input data.Then, preliminary treatment unit 35 determines whether the frequency of occurrences value of the 23rd character code of storage in code table 112 is 0 (step S6).Not under 0 the situation that (step S6: not), preliminary treatment unit 35 compares (step S7) with the frequency of occurrences value that obtained and the frequency of occurrences value of the 23rd character code in the frequency of occurrences value of the 23rd character code.The frequency values that is obtained than the little situation of the frequency of occurrences value of the 23rd character code under, preliminary treatment unit 35 determines that the character codes that are associated with the frequency of occurrences value that is obtained are not the character codes of frequent appearance, and returns step S3.On the contrary, the frequency values that is obtained than the big situation of the frequency of occurrences value of the 23rd character code under, flow process enters step S9.
Under this frequency of occurrences value and the 23rd 's the corresponding situation of frequency values, preliminary treatment unit 35 determines that whether these character codes are greater than the 23rd character code (step S8).Then, when preliminary treatment unit 35 has any character code of identical frequency of occurrences value in existence, adopt less character code.During greater than the 23rd character code, flow process is returned step S3 in the character code of the character data that is obtained.Opposite, during less than the 23rd character code, flow process enters step S9 in the character code of the character data that is obtained.
Preliminary treatment unit 35 is inserted into the frequency of occurrences value character code relevant with it that is obtained in the 1st tram in the code table 112 of the 23rd frequency of occurrences value of storage, thereby makes these frequency of occurrences values with descending (step S9).Then, return step S3, preliminary treatment unit 35 repeats the processing from step S3 to step S9, till the data in frequency of occurrences table 111 all are read out.
By this process, character code is stored in the code table 112 according to the order of the frequency of occurrences from the 1st to the 23rd with relevant frequency of occurrences value.
When all data in frequency of occurrences table all are read out (step S3: be), preliminary treatment unit 35 rearranges the 8th to the 23rd character code (step S10) according to ascending order.
Then, preliminary treatment unit 35 calculates the size (step S11) that will be stored in the data in first output data buffer to the, eight output data buffers.
For example, can calculate the size that will be stored in data in each output data buffer based on following equation.
(1) will be stored in the size (SIZE_BUF1) of the data in first output data buffer=(quantity+7 of input data)/8 bytes
(2) will be stored in size (SIZE_BUF2)=(the 1st to the 23rd summation+7 of frequency of occurrences value)/8 bytes of the data in second output data buffer
(3) will be stored in size (SIZE_BUF3)=(the 2nd to the 23rd summation+7 of frequency of occurrences value)/8 bytes of the data in the 3rd output data buffer
(4) will be stored in size (SIZE_BUF4)=(the 4th to the 23rd summation+7 of frequency of occurrences value)/8 bytes of the data in the 4th output data buffer
(5) will be stored in size (SIZE_BUF5)=(the 2nd to the 23rd summation+7 of frequency of occurrences value)/8 bytes of the data in the 5th output data buffer
(6) will be stored in size (SIZE_BUF6)=(the 4th to the 7th summation+3 of frequency of occurrences value)/4 bytes of the data in the 6th output data buffer
(7) will be stored in size (SIZE_BUF7)=(the 8th to the 23rd summation+1 of frequency of occurrences value)/2 bytes of the data in the 7th output data buffer
(8) will be stored in the 1st to the 23rd the summation of quantity-frequency of occurrences value of size (the SIZE_BUF8)=input data of the data in the 8th output data buffer.
Next, preliminary treatment unit 35 generates compressed formats 113, is used to store the data that will be generated by coding generation unit 36.The preliminary treatment unit will comprise the stem zone (step S12) that relevant the 1st data to the information of the 23rd character code output to compressed format.
Figure 12 shows the example of compressed format 113.Compressed format 113 is made up of stem zone and eight data zones corresponding with first to the 8th output data buffer.The stem zone by the zone of the overall size that is used for stores compressed data, be used to store the dimension definitions zone of the size of the data that will be stored in the data area corresponding and the 1st to the 23rd code table zone with first to the 8th output data buffer.
Coding generation unit 36 according to flow chart shown in Figure 13, is arranged on the occurrence in the compressed format 113 according to the data that provide from preliminary treatment unit 35.
At first, coding generation unit 36 is provided from the input data that provide Input Data Buffer 30 by the data (step S21) of 1 byte.Whether the data of coding generation unit 36 definite 1 byte of being read are the last data (step S22) of input serial data.Be not (step S22: not) under the last data conditions of input serial data in these data, coding generation unit 36 obtains the information (step S23) about the frequency of occurrences of 1 byte data of being read.Be (step S22: be) under the last data conditions of input serial data in 1 byte data of being read, processing finishes.
Whether 1 byte data that coding generation unit 36 is determined to be read is corresponding to the 1st character code (step S24) according to frequency of occurrences order.Under the situation of 1 byte data of being read corresponding to the 1st character code (step S24: be), coding generation unit 36 is carried out the 1st encoding process (step S25).Particularly, coding generation unit 36 is opened (turnon) bit (that is, bit is set to 1) in first output data buffer, and closes (turnoff) bit (that is, bit is set to 0) in second output data buffer.
Do not correspond in 1 byte data of being read under the 1st the situation of character code that (step S24: not), coding generation unit 36 determines that these 1 byte datas are whether corresponding to the 2nd character code (step S26).Under the situation of 1 byte data of being read corresponding to the 2nd character code (step S26: be), coding generation unit 36 is carried out the 2nd encoding process.Particularly, coding generation unit 36 is closed in the bit (step S27) in the 5th output data buffer.In addition, coding generation unit 36 is carried out the 2nd/the 3rd public encoding process (step S28).Particularly, coding generation unit 36 is open at the bit in first output data buffer, is open at the bit in second output data buffer, is closed in the bit in the 3rd output data buffer.
1 byte data of being read in step 26 does not correspond under the 2nd the situation of character code that (step S26: not), coding generation unit 36 determines that these 1 byte datas are whether corresponding to the 3rd character code (step S29).Under the situation of 1 byte data of being read corresponding to the 3rd character code (step S29: be), coding generation unit 36 is carried out the 3rd encoding process (step S30).Particularly, coding generation unit 36 is open at the bit in the 3rd output data buffer.In addition, coding generation unit 36 is carried out the 2nd/the 3rd above-mentioned public encoding process (step S28).
1 byte data of being read in step 29 does not correspond under the 3rd the situation of character code that (step S29: not), coding generation unit 36 determines that these 1 byte datas are whether corresponding to the 4th character code (step S31).Under the situation of 1 byte data of being read corresponding to the 4th character code (step S31: be), coding generation unit 36 is carried out the 4th encoding process (step S32).Particularly, coding generation unit 36 is provided with " 00h " in the 6th output data buffer.In addition, coding generation unit 36 is carried out the 4th the-the 7th public encoding process (step S39).Particularly, coding generation unit 36 is open at the bit in first output data buffer, is open at the bit in second output data buffer, is open at the bit in the 3rd output data buffer, closes the bit in the 4th output data buffer.
1 byte data of being read in step 31 does not correspond under the 4th the situation of character code that (step S31: not), coding generation unit 36 determines that these 1 byte datas are whether corresponding to the 5th character code (step S33).Under the situation of 1 byte data of being read corresponding to the 5th character code (step S33: be), coding generation unit 36 is carried out the 5th encoding process (step S34).Particularly, " 01h " is set in the 6th output data buffer.In addition, coding generation unit 36 is carried out the 4th the-the 7th above-mentioned public encoding process (step S39).
1 byte data of being read in step 33 does not correspond under the 5th the situation of character code that (step S33: not), coding generation unit 36 determines that these 1 byte datas are whether corresponding to the 6th character code (step S35).Under the situation of 1 byte data of being read corresponding to the 6th character code (step S35: be), coding generation unit 36 is carried out the 6th encoding process (step S36).Particularly, coding generation unit 36 is provided with " 10h " in the 6th output data buffer.In addition, coding generation unit 36 is carried out the 4th the-the 7th above-mentioned public encoding process (step S39).
1 byte data of being read in step 35 does not correspond under the 6th the situation of character code that (step S35: not), coding generation unit 36 determines that these 1 byte datas are whether corresponding to the 7th character code (step S37).Under the situation of 1 byte data of being read corresponding to the 7th character code (step S37: be), coding generation unit 36 is carried out the 7th encoding process (step S38).Particularly, coding generation unit 36 is provided with " 11h " in the 6th output data buffer.In addition, coding generation unit 36 is carried out the 4th the-the 7th above-mentioned public encoding process (step S39).
Next, coding generation unit 36 compares (step S40) with the frequency of occurrences of the frequency of occurrences of the 23rd character code and the character code of being read.In the frequency of occurrences of the character code of the frequency of occurrences than the 23rd of the character code of being read hour, coding generation unit 36 determines that the character codes of being read are not the frequent sign indicating numbers that occurs, and the execution data are not compressed processing (step S41).Particularly, the coding generation unit is closed in the bit in first output data buffer, and the character code data of being read is arranged in the 8th output data buffer.
On the contrary, when the frequency of occurrences of the character code of the frequency of occurrences than the 23rd of the character code of being read was big, coding generation unit 36 was carried out frequency of occurrences set handlings (step S42).Particularly, 36 pairs of generation units of coding the 8th in code table 112 carries out dichotomous search (binary search) to the 22nd bit data, and the order of the character code that is searched is set to corresponding with the character code of being read in the 7th output data buffer.
When the frequency of occurrences of the character code of being read equated with the frequency of occurrences of the 23rd character code, coding generation unit 36 compared (step S43) with the data of being read and the 23rd character code.Under their identical situations, coding generation unit 36 is carried out the 23rd encoding process (step S44).Particularly, coding generation unit 36 is arranged on the 23rd character code in the 7th output data buffer.
Next, coding generation unit 36 is carried out the 8th the-the 23rd public encoding process (step S45).Particularly, coding generation unit 36 is open at the bit in first output data buffer, is open at the bit in second output data buffer, is closed in the bit in the 3rd output data buffer, and is open at the bit in the 4th output data buffer.
Coding generation unit 36 repeats this processing, till it arrives the last data of input data.Then, coded data output processing unit 37 is according to above-mentioned compressed format 113, and output is stored in the data in first output data buffer to the, eight output data buffers.In the following description, the zone in the compressed format 113 corresponding with n output data buffer will be called the Fn data area.Symbol " n " expression is equal to, or greater than 1 and be equal to or less than 8 integer.
For example, statistical modeling processing unit 32, preliminary treatment unit 35, coding generation unit 36 and coded data output processing unit 37 are included in the control unit 101.Input Data Buffer 30, frequency of occurrences table memory cell 33 and first to the 8th output data buffer are included among the RAM 103.Perhaps, these unit can be constructed as the circuit that is used to carry out above-mentioned processing.
By above-mentioned processing, the output format of coded data can be suitable for variable length code, in variable length code, the 1st character code is 2 bits, the 2nd to the 3rd character code is 4 bits, the 4th to the 7th code is 6 bits, and the 8th to the 23rd code is 8 bits, and packed data is not 9 bits.In addition, by with the dateout Region Segmentation to first output data buffer to the, eight output data buffers, in coding or decoding processing, can visit memory (promptly according to preliminary dimension, with 1 bit is that unit, 2 bits are unit, 4 bit visits that bit is a unit, and with 1 byte data byte-accessed that is unit), can carry out with very high speed thereby make compression handle.
(embodiment 6)
Now embodiments of the invention 6 will be described.
Figure 14 is the figure that is used to illustrate according to the structure of the compression device of present embodiment.According to present embodiment, different with above embodiment 5, compression device comprises compression efficiency determining unit 39, and it calculates the reduced size of each output format, and the coding of definite full blast.
At first, the input data such as above-mentioned character data or the like are provided for Input Data Buffer 30.The input data that offer Input Data Buffer 30 are provided for statistical modeling processing unit 32.Statistical modeling processing unit 32 calculates the frequency of occurrences that is included in each byte data in the input data.The result of calculation of the frequency of occurrences is provided for frequency of occurrences table memory cell 33.Frequency of occurrences table memory cell 33 is stored in the result of calculation of this frequency of occurrences in the frequency of occurrences table 111.
Entropy coding unit 34 comprises preliminary treatment unit 35, coding generation unit 36, compression efficiency determining unit 39, first output data buffer to the, eight output data buffers, and coded data output processing unit 37.
Preliminary treatment unit 35 calculates the size of packed datas, distributes this packed data between first to the 8th output data buffer, and carries out the processing of the following stated, code of the 1st to the 23rd or the like is outputed to the stem of compressed format 113.Coding generation unit 36 is according to the order information that is generated by preliminary treatment unit 35, based on data one by one these input data encoded, as described below.By preliminary treatment unit 35 performed preliminary treatment is that flow chart according to above-mentioned Figure 11 carries out.
Compression efficiency determining unit 39 is according to the data that provide from frequency of occurrences table memory cell 33, based on form one by one, calculates the size with the data of predetermined output format compression, and determines to have the output format of minimum dimension.
Figure 15 is the figure that the example of output format is shown.According to Figure 15, output format comprises following 8 kinds of patterns.
(situation 1) according to the order of the frequency of occurrences, arranges the data that the 1st code is encoded as 1 bit, and other code is encoded as the data of 9 bits.
The code that (situation 2) is the 1st is encoded as the data of 2 bits, and the 2nd to the 3rd code is encoded as the data of 3 bits, and other code is encoded as the data of 9 bits.
The code that (situation 3) is the 1st is encoded as the data of 2 bits, and the 2nd to the 5th code is encoded as the data of 4 bits, and other code is encoded as the data of 9 bits.
The code that (situation 4) is the 1st is encoded as the data of 2 bits, and the 2nd to the 17th code is encoded as the data of 6 bits, and other sign indicating number is encoded as the data of 9 bits.
The code that (situation 5) is the 1st is encoded as the data of 2 bits, and the 2nd to the 3rd code is encoded as the data of 4 bits, and the 4th to the 7th code is encoded as the data of 5 bits, and other code is encoded as the data of 9 bits.
The code that (situation 6) is the 1st is encoded as the data of 2 bits, and the 2nd to the 3rd sign indicating number is encoded as the data of 4 bits, and the 4th to the 19th code is encoded as the data of 7 bits, and other code is encoded as the data of 9 bits.
The code that (situation 7) is the 1st is encoded as the data of 2 bits, and the 2nd to the 5th code is encoded as the data of 5 bits, and the 6th to the 21st code is encoded as the data of 7 bits, and other code is encoded as the data of 9 bits.
The sign indicating number that (situation 8) is the 1st is encoded as the data of 2 bits, the 2nd to the 3rd code is encoded as the data of 4 bits, the 4th to the 7th code is encoded as the data of 6 bits, the 8th to the 23rd code is encoded as the data of 8 bits, and other code is encoded as the data of 9 bits.
Figure 16 is the figure that concrete bit contents is shown.For example, in situation 1, be stored in by the sign that will represent the 1st code in the 1 bit storage zone of first output data buffer, thereby be 1 Bit data the 1st code coding.By representing that the sign that data are not compressed is stored in the 1 bit storage zone of first output data buffer, and original input data (8 bit) is stored in the storage area of the 8th output data buffer, thereby be that length overall is the data of 9 bits with other code codings.In situation 8, also is according to execution coding shown in Figure 16 in situation 2.
Figure 17 shows compression efficiency determining unit 39 is determined the compressed format 113 of output according to result of calculation example.Figure 17 A is corresponding to situation 1, and Figure 17 B is corresponding to situation 2, and Figure 17 C is corresponding to situation 3, and Figure 17 D is corresponding to situation 4, and Figure 17 E is corresponding to situation 5, and Figure 17 F is corresponding to situation 6, and Figure 17 G is corresponding to situation 7, and Figure 17 H is corresponding to situation 8.For example, under the situation of the view data that comprises the image information that much has same color, compression efficiency determining unit 39 can select to have and import the compressed format 113 of the corresponding appropriate size of feature of data.
Therefore, according to present embodiment, can carry out compression by selecting to have, and can shorten compression and handle required time and transmitted data compressing required time, thereby make that can carry out output compression very efficiently handles with the contract output format of efficient of the corresponding maximal pressure of input data.
(embodiment 7)
Next, embodiments of the invention 7 will be described.Present embodiment is an improvement version by the output format of above-mentioned compression efficiency determining unit 39 determined situations 4.In addition, present embodiment is the situation that the frequency of occurrences data at the 1st to the 17th character code are generated by preliminary treatment unit 35, and wherein compressed format 113 has structure as shown in figure 18.As shown in figure 18, compressed format 113 is made up of stem zone and data area.Total reduced size, F1 of having stored coded data in the stem zone is to the amount of bits of F3 data area, not the byte quantity of packed data and the 1st to the 17th character code.The data area comprises by the 12nd the-the 17th the public encoding process of the following stated set F1 data area and F2 data area, will be handled the F3 data area that is provided with and will do not compressed the F4 data area that processing is provided with by the data of the following stated by the 17th the encoding process and the frequency of occurrences of the following stated.
Figure 19 illustrates according to present embodiment, the flow chart of the processing of being carried out by coding generation unit 36.
At first, coding generation unit 36 is provided from the input data that provide Input Data Buffer 30 by 1 byte data (step S51).Coding generation unit 36 determines whether 1 byte data of being read is the last data (step S52) of input data.For example, if the processing of this step is to carry out for the first time, then imports data and comprise enough big data volume.Be not (step S52: not) under the last data conditions of input data in this 1 byte data, coding generation unit 36 obtains the information (step S53) of the frequency of occurrences of relevant 1 byte data of being read.Coding generation unit 36 search first output data buffer, and whether 1 byte data of determining to be read is corresponding to the 1st character code (step S54) according to frequency of occurrences ordering.
Under the situation of 1 byte data of being read corresponding to the 1st character code (step S54: be), coding generation unit 36 is carried out the 1st encoding process (step S55).Particularly, coding generation unit 36 is open at the bit in first output data buffer, and is closed in the bit in second output data buffer.
Do not correspond in 1 byte data of being read under the 1st the situation of character code that (step S54: not), coding generation unit 36 compares (step S56) with the data of being read and the 17th character code.Generation unit 36 execution data are not compressed processing (step S57) if the frequency of occurrences of the data of being read less than the frequency of occurrences of the 17th code, is then encoded.Particularly, coding generation unit 36 is closed the bit in first output data buffer, and the data of being read are arranged in the 4th output data buffer.
Opposite, generation unit 36 is carried out frequency of occurrences set handling (step S58) if the frequency of occurrences of the data of being read greater than the frequency of occurrences of the 17th character code, is then encoded.Particularly, 36 pairs of generation units of coding the 12nd in code table 112 carries out dichotomous search to the 16th bit data, and the order of the character code that is searched is set to corresponding with the sense data in the 3rd output data buffer.
When if the frequency of occurrences of institute's sense data equates with the frequency of occurrences of the 17th character code, coding generation unit 36 compares (step S59) with 1 byte data of being read and the 17th character code.If they equate that the generation unit 36 of then encoding is carried out the 17th encoding process (step S60).Particularly, coding generation unit 36 is arranged on the value of the 17th character code in the 3rd output data buffer.Then, coding generation unit 36 is carried out the 12nd the-the 17th public encoding process (step S61).Particularly, coding generation unit 36 is opened the bit in first output data buffer, and opens the bit in second output data buffer.Then, coded data output processing unit 37 is according to compressed format 113, and output is stored in the data in first to the 8th output data buffer.
As mentioned above, according to present embodiment, can carry out compression, and can shorten compression required time and transmitted data compressing required time by select to have the output format of only compression efficiency for the input data.Be that first to the 17th example has illustrated present embodiment by using frequency of occurrences scope.Yet the scope of the frequency of occurrences can be from the 1st to the 23rd, or the scope of any other order numeral.
(embodiment 8)
Next, embodiments of the invention 8 will be described.
Figure 20 is the figure that is used to illustrate that the compression of present embodiment is handled.The compression of present embodiment is handled can be applied to above embodiment.For example, when being applied to embodiment 1, before the search of carrying out for the longest corresponding character string, determine whether a character to occur continuously, this character is identical with character with its next-door neighbour before it.Under the situation that same character occurs continuously, first compression unit 1 is carried out distance of swimming compression and is handled.For example, Figure 20 shows character " a " and occurs 8 times situation continuously.Handle according to common distance of swimming compression, the sign that packed data compress/is not compressed by indication, length and the character data that occurs are continuously represented.Opposite, according to present embodiment, packed data is only represented by sign and length that indication compress/is not compressed.This sign is also used the index of the respective symbols string of opposing the longest.Be used for the memory location of the identification information storage of distance of swimming compression in the corresponding starting position of this longest respective symbols string.
For example, comprise in view data under the situation of a lot of white portions, on these parts, occur identical value continuously.Therefore, handle to compress this input data, can improve compression efficiency by the Run-Length Coding that adds present embodiment.
(embodiment 9)
Next, embodiments of the invention 9 will be described.
Figure 21 is the figure that is used to illustrate present embodiment.According to present embodiment, in order to handle the coding for a large amount of input data, compression device comprises that initial data cuts apart/input unit 40, is used for the input data are separated control.Initial data cuts apart/and input data that input unit 40 will be stored in the input file 41 cut apart, and then it are outputed to Input Data Buffer 43.Then, similar above embodiment carries out the first compression processing by the input data that 21 pairs of first compression units are input in the Input Data Buffer 43, carries out second compression by second compression unit 22 then and handles.
Adopt this structure, will import and offer Input Data Buffer 43 after data are cut apart, make a large amount of input data can be easy to processed.
With shown in Figure 7 identical, therefore omitted explanation at other assemblies shown in Figure 21 to it.Then, the packed data that is stored in the output data buffer 27 is in turn outputed to output file 45 from packed data output unit 44.
For example, initial data cut apart/input unit 40 and packed data output unit 44 be included in the controller 101.Input Data Buffer 43 is included among the RAM103.Perhaps, these unit can be constructed as the circuit that is used to carry out above-mentioned processing.
(embodiment 10)
Next, embodiments of the invention 10 will be described.
Embodiment 1 to 9 has illustrated the processing of compression input data.Present embodiment will illustrate and be used for handle the processing that the packed data that generates decompresses by above-mentioned compression.To describe decompression in detail now.
With reference to Figure 22, first decompression unit 51 is carried out using half self adaptation statistical coding method coded data to carry out process of decoding, and second decompression unit 52 is carried out using self-adapting dictionary coding method coded data to carry out process of decoding.Adopt this configuration, can carry out the processing that decompresses to according to the foregoing description 1 to 9 data of being compressed.
Be input in first decompression unit 51 as the input data according to embodiment 1 to 9 packed data that is generated, thus can be to decompressing by above-mentioned second compression unit 12 or 22 packed datas that generated.52 pairs of second decompression units are decompressed by above-mentioned first compression unit 11 or 21 packed datas that generated.
First decompression unit 51 and second decompression unit 52 are included in the controller 101.Perhaps, these unit can be constructed as the circuit of carrying out above-mentioned processing.
Adopt this configuration, can oppositely carry out decoding, and can carry out with compressing and handle corresponding decoding processing.
(embodiment 11)
Next, embodiments of the invention 11 will be described.
Present embodiment also is the explanation decoding processing.Will describe this decoding processing in detail now.
Figure 23 is the figure that is used to illustrate according to the structure of the data decompression equipment of present embodiment.In Figure 23, similar with above embodiment, the processing that first decompression unit 51 is carried out using half self adaptation statistical coding method coded data to decompress, the processing that second decompression unit 52 is carried out using self-adapting dictionary coding method coded data to decompress.Input switch unit 53 obtains (compression) input data of having encoded according to the processing of embodiment 3, and the data that obtained are sent in identification data determining unit 54, first decompression unit 51 and second decompression unit 52 any one.Notice that in initial condition, input switch unit 53 is set to, and will import data and send identification data determining unit 54 to.
Employed in the present embodiment identification data 28 is with illustrated identical in embodiment 3.Identification data determining unit 54 determines where the input data that received will be offered according to identification data 28.Input switch unit 53 is according to determining that the result provides the input data.
For example, be under the situation of " 1 " in the value of identification data 28, input switch unit 53 will be imported data by switch element 55 and offer second decompression unit 52.Then, second decompression unit begins decompression.
Value at identification data 28 is under the situation of " 2 ", and input switch unit 53 will be imported data and offer first decompression unit 51.In addition, identification data determining unit 54 control switch unit 55, thus make the dateout from first decompression unit 51 will be provided for second decompression unit 52.First decompression unit, 51 beginning decompression.Second decompression unit 52 is by using since the data decompression of first decompression unit, 51 inputs.
Input switch unit 53, identification data determining unit 54 and switch element 55 are included in the control unit 101.Perhaps, these unit can be constructed as the circuit of carrying out above-mentioned processing.
Therefore,, can carry out decompression, realize carrying out decompression effectively packed data by use and the corresponding decompression method of compression method based on the value of the identification data 28 that when compressing, is provided with according to present embodiment.
(embodiment 12)
Next, embodiments of the invention 12 will be described.
The present invention also will illustrate the data decompression processing.Will describe this processing in detail now.
Figure 24 is the figure that is used to illustrate according to the structure of the data decompression equipment of present embodiment.In Figure 24, similar with above embodiment, the processing that first decompression unit 51 is carried out using half self adaptation statistical coding method coded data to decompress, the processing that second decompression unit 52 is carried out using self-adapting dictionary coding method coded data to decompress.In Figure 24, input switch unit 53 is identical with above embodiment with identification data determining unit 54.Yet, 4 kinds of values of the identification data 28 that will describe below 54 identifications of identification data determining unit.Present embodiment is suitable for the packed data that the compression device by embodiment 4 generates is decompressed.
According to present embodiment, data decompression equipment also comprises the first switch unit 55A, the second switch unit 55B and output switch unit 58.
The value of the identification data 28 in being input to identification data determining unit 54 is under the situation of " 1 ", and identification data determining unit 54 is eliminated determined identification data 28, and remaining input data are outputed to output switch unit 58, up to the data end.
Value at identification data 28 is under the situation of " 2 ", the identification data determining unit 54 control input switch unit 53 and the first switch unit 55A, thus make the input data can be provided for second decompression unit 52.Second decompression unit 52 outputs to output switch unit 58 with dateout.Therefore, by this process, the input data are decompressed by second decompression unit 52, and 58 outputs of output switch unit are by the data of second decompression unit, 52 decompressions.
Value at identification data 28 is under the situation of " 3 ", identification data determining unit 54 control input switch units 53, thus make the input data can be provided for first decompression unit 51.First decompression unit 51 decompresses, and this imports data.In addition, the identification data determining unit 54 control second switch unit 55B, thus make the dateout from first decompression unit 51 will be imported into output switch unit 58.Therefore, by this control, first decompression unit 51 decompresses, and this imports data, and the data of output switch unit 58 outputs first decompression unit 51 decompressions.
Value at identification data 28 is under the situation of " 4 ", identification data determining unit 54 is controlled input switch units 53, the first switch unit 55A, the second switch unit 55B and output switch unit 58, will be by 52 decompressions of second decompression unit by the data after 51 decompressions of first decompression unit thereby make.First decompression unit 51 and second decompression unit 52 are carried out decompression.More specifically, first decompression unit 51 decompresses, and this imports data, and the decompressed data that is obtained is input to second decompression unit 52.Second decompression unit 52 further decompresses from the data of first decompression unit, 51 inputs.58 outputs of output switch unit are by the decompressed data of first decompression unit 51 and 52 both decompressions of second decompression unit.
Value at identification data 28 is " 1 " when arriving value outside " 4 ", and the input data that identification data determining unit 54 will include determined identification data output to output switch unit 58, and it are not handled.Perhaps, in this case, decompression apparatus can be set to export one " mistake " response.
The first switch unit 55A, the second switch unit 55B and output switch unit 58 are included in the control unit 101.Perhaps, these unit can be constructed as the circuit of carrying out above-mentioned processing.
Adopt this processing, can carry out decompression, realize carrying out decompression effectively by selecting and the corresponding decompression method of coding method based on the value of the identification data 28 that is provided with when the data compression.
(embodiment 13)
Next embodiments of the invention 13 will be described.
Present embodiment also will illustrate the data decompression processing.Present embodiment at be that data to the statistical coding method compression of using the foregoing description 5 to 7 decompress.To describe this processing in detail now.
Figure 25 is the flow chart that the decompression algorithm of the decompression of being carried out by first or second decompression unit 51 or 52 (hereinafter referred to as " decompression unit ") is shown.
At first, decompression unit obtains data (step S71) preparing from F1 to the F8 data area.Particularly, for example, decompression unit obtains coded input data, and checks according to compressed format 113 whether the data that obtained are formatted.If the input data are not based on compressed format 113, then decompression unit can be designed as and stops this decompression.
Next, decompression unit determines whether the data in the F1 data area finish (step S72).If (step S72: not), then decompression unit obtains the data (step S73) of 1 bit from the F1 data area still data.In addition, decompression unit determines that it is unpressed or compression (step S74) that 1 Bit data that is obtained is indicated these data.
Indicating these data at this 1 Bit data is that (step S74: not), decompression unit obtains the data of 1 byte from the F8 data area, and exports the data (step S75) of 1 byte that is obtained under the unpressed situation.
Opposite, indicating these data at 1 Bit data that is obtained is that decompression unit obtains the data (step S76) of 1 bit under the situation about compressing (step S74: be) from the F2 data area.Then, decompression unit determines that whether 1 Bit data that is obtained indicates these data is data (step S77) of the 1st that sort according to the frequency of occurrences.Indicating these data at this 1 Bit data is that decompression unit is inquired about the 1st character code, and exports the 1st code (step S78) under the 1st the data conditions (step S77: be).
This 1 Bit data be not these data of indication be that (step S77: not), decompression unit obtains the data (step S79) of 1 bit from the F3 data area under the 1st the data conditions.Decompression unit determines that whether the data of this 1 bit indicate these data is according in two time maximum codes of frequency of occurrences ordering any one, and promptly these data are data (step S80) of the 2nd or the 3rd.
1 Bit data that is obtained indicate these data be according to the situation of the 2nd of frequency of occurrences ordering or the 3rd 's code under (step S80: be), decompression unit obtains 1 Bit data (step S81) from the F4 data area.Decompression unit further determines that 1 Bit data that is obtained is that these data of indication are codes (step S82) that the 2nd code or these data of indication are the 3rd.In these data (step S82: be) under the 2nd the situation of code, decompression unit inquiry code table 112, and export the 2nd code (step S83).Opposite, be that (step S82: not), decompression unit is exported the 3rd code (step S84) under the 3rd the situation of code in these data.
On the other hand, these data in step S80 neither the 2nd data (step S80: not), decompression unit obtains the data (step S85) of 1 bit from the F4 data area under neither the 3rd data conditions.Decompression unit determines that whether 1 Bit data obtained indicates these data is four codes according to the ensuing maximum of frequency of occurrences ordering, and promptly these data are any one (the step S86) in the 4th to the 7th the code.In these data is under any one the situation in the 4th to the 7th the code (step S86: be), decompression unit obtains the data of 2 bits from the F6 data area, and output is by the data of 2 bits that obtained indicated the 4th, the 5th, the 6th or the 7th character code data (step S87).
Opposite, (step S86: not) when these data are not any one of the 4th code in the 7th, decompression unit obtains the data of 4 bits from the F7 data area, and output is by in indicated the 8th to the 23rd the character code of 4 Bit datas that obtained any one.
By adopting said method execution decompression, can data that use the compression of statistical coding method be decompressed, and carry out and the corresponding decompression of compression processing.
(embodiment 14)
Next, embodiments of the invention 14 will be described.
The present invention also will illustrate the data decompression processing.The present invention is suitable for the foregoing description 9.
Figure 26 is the figure that is used to illustrate according to the structure of the data decompression equipment of present embodiment.Present embodiment will illustrate the processing that the packed data that generates by the compression processing of before compression a large amount of input data being cut apart is decompressed.In Figure 26, initial data cuts apart/and input data that 60 pairs of input units are stored in the input file 61 are cut apart, and the data that will cut apart output to Input Data Buffer 63.Packed data is cut apart, and is provided for Input Data Buffer 63.Then, identification data determining unit 65 is selected first decompression unit 66, second decompression unit 67 or initial data output unit 68 according to the value of identification data 28, and controls the processing that packed data is decompressed.
The data that decompression decompressed by present embodiment are output to output data buffer 69.The decompressed data output unit 70 of data that is input in the output data buffer 69 takes out, and in turn outputs in the output file 71.
Initial data cuts apart/and input unit 60, identification data determining unit 65, first decompression unit 66, second decompression unit 67, initial data output unit 68 and decompressed data output unit 70 be included in the control unit 101.Input Data Buffer 63 and output data buffer 69 are included among the RAM 103.Perhaps, these unit can be constructed as the circuit of carrying out above-mentioned processing.
By adopting said method to carry out decompression, the output device that can decompress(ion) contracts has a large number of packed data.
(embodiment 15)
Next, embodiment 15 will be described.
Present embodiment is the distortion of the decompression of embodiment 10.Figure 27 shows the structure according to the data decompression equipment of present embodiment.In Figure 27, the processing that first decompression unit 71 is carried out using half self adaptation statistical coding method coded data to decompress, the processing that second decompression unit 72 is carried out using self-adapting dictionary coding method coded data to decompress.In addition, this data decompression equipment also has FIFO (first in first out) memory 73.First decompression unit 71 is input to the decompressed data of 1 byte in the FIFO memory 73 when the packed data to 1 byte decompresses.Then, the decompressed data with 1 byte outputs to second decompression unit 72 from FIFO memory 73.Second decompression unit 72 further decompresses and imports data.
Therefore, according to present embodiment, can executed in parallel first decompression and second decompression, help the acceleration of data decompression.
Under the situation that does not break away from broad spirit of the present invention and scope, can realize various embodiment and modification to it.The foregoing description purpose is explanation the present invention, rather than limits the scope of the invention.Scope of the present invention is to be defined by subsidiary claim, rather than is defined by embodiment.The various distortion of carrying out in the connotation of equal value of claim of the present invention and in claim all are counted as within the scope of the present invention.
The present invention is based on Japanese patent application No.2004-379814 that submitted on December 28th, 2004 and the Japanese patent application No.2005-39807 that submits on February 16th, 2005, and comprise specification, claim, accompanying drawing and summary.This integral body that is disclosed in of above Japanese patent application is incorporated herein by reference.

Claims (20)

1. data compression device comprises:
First data compression unit (1,11,21), it carries out first data compression process, is used to adopt the dictionary encoding method to compress the input data; And
Second data compression unit (2,12,22), it carries out second data compression process, is used to adopt the statistical coding method that the data of being compressed by described first data compression unit (1,11,21) are compressed,
Wherein, described first data compression unit (1,11,21) search long data corresponding in the coded data from dictionary with described input data, and be the unit described input data that decompress with the byte.
2. data compression device as claimed in claim 1, wherein
Described first data compression unit (1,11,21) is calculated the frequency of occurrences of the identical data that comprises in described input data; And
Described second data compression unit (2,12,22) is carried out data compression by the result of calculation of using the frequency of occurrences of being calculated by described first data compression unit (1,11,21).
3. data compression device as claimed in claim 2 also comprises:
Size calculating/determining unit (25), it calculates works as described input data only by described first compression unit (1,11, first output data quantity that to export when 21) compressing, and when passing through described first compression unit (1,11,21) to the compression of described input data and first dateout that obtains further by described second compression unit (2,12, second output data quantity that to export when 22) compressing, and determine that whether described second output data quantity is greater than described first output data quantity
Wherein, when described size calculating/determining unit (25) was determined described second output data quantity greater than described first output data quantity, described second compression unit (2,12,22) was not carried out described second data compression process.
4. data compression device as claimed in claim 3, wherein:
Described size calculating/determining unit (25) is further calculated the 3rd output data quantity that will export when described input data are only compressed by described second compression unit (2,12,22), and the data volume of more described first output data quantity, described second output data quantity, described the 3rd output data quantity and described input data;
Under the situation of the described first output data quantity minimum, only described first compression unit (1,11,21) is carried out compression;
Under the situation of the described second output data quantity minimum, described first compression unit (1,11,21) and described second compression unit (2,12,22) are all carried out compression;
Under the situation of described the 3rd output data quantity minimum, only described second compression unit (2,12,22) is carried out compression; And
Under the situation of the data volume minimum of described input data, described first compression unit (1,11,21) and described second compression unit (2,12,22) are not carried out compression.
5. data compression device as claimed in claim 1 also comprises:
Compression efficiency determining unit (39), it determines whether to occur continuously identical character data in described input data, and determining under the situation that identical character data occurs continuously, ordering described first compression unit (1,11,21) or described second compression unit (2,12,22) to carry out distance of swimming compression and handle.
6. data compression device as claimed in claim 1, wherein:
Before carrying out described data compression process, described first compression unit (1,11,21) or described second compression unit (2,12,22) calculate the size of the data after being compressed, determine to realize the data output mode of minimal data size, and find output format (113) according to described definite result.
7. data compression device as claimed in claim 6, wherein
Described output format (113) is included as has a set zone of the character code high frequency of occurrences, predetermined quantity in the character code that comprises in the described input data, and storage data that the Code Number of the character code of described predetermined quantity is associated with the frequency of occurrences of the character code of described predetermined quantity.
8. data decompression equipment comprises:
First decompression unit (51), it adopts the method corresponding with the statistical coding method packed data that decompresses; And
Second decompression unit (52), it adopts the method corresponding with the dictionary encoding method further the data that decompressed by described first decompression unit (51) to be decompressed.
9. data decompression equipment as claimed in claim 8 also comprises:
Determining unit (54), it determines to be included in the value of the identification data in the described packed data,
Wherein:
Determine that in described determining unit (54) described identification data is under the situation of first identification data, described first decompression unit (51) the described packed data that decompresses, and described second decompression unit (52) decompresses further to the data that the decompression by described first decompression unit (51) obtains; And
Determine that in described determining unit (54) described identification data is under the situation of second identification data, described first decompression unit (51) the described packed data that decompresses.
10. data decompression equipment as claimed in claim 9, wherein:
Determine that in described determining unit (54) described identification data is under the situation of the 3rd identification data, described second decompression unit (52) the described packed data that decompresses.
11. a data compression method comprises:
The first data compression step, it carries out first data compression process, is used to adopt the dictionary encoding method to compress the input data; And
The second data compression step, it carries out second data compression process, is used for adopting the statistical coding method that the data of being compressed in the described first data compression step are compressed,
Wherein, in the described first data compression step, the search long data corresponding in the coded data from dictionary with described input data, and be that unit compresses it and exports with the byte.
12. data compression method as claimed in claim 11, wherein:
In the described first data compression step, calculate the frequency of occurrences of the identical data that in described input data, comprises; And
In the described second data compression step, carry out data compression by the result of calculation of using the frequency of occurrences of calculating in the described first data compression step.
13. data compression method as claimed in claim 12 also comprises:
Size calculating/determining step, be used for calculating first output data quantity that only when described first compression step is compressed, will export when described input data, and when in the described first data compression step, described input data being compressed second output data quantity that will export when first dateout that is obtained is further compressed in the described second data compression step, and determine that whether described second output data quantity is greater than described first output data quantity
Wherein, when in described size calculating/determining step, determining described second output data quantity, in the described second data compression step, do not carry out described second data compression process greater than described first output data quantity.
14. data compression method as claimed in claim 13, wherein:
In described size calculating/determining step, further calculating is when the 3rd output data quantity that only will export during the described input data of compression in the described second data compression step, and the data volume of more described first output data quantity, described second output data quantity, described the 3rd output data quantity and described input data;
Under the situation of the described first output data quantity minimum, only in the described first data compression step, carry out compression;
Under the situation of the described second output data quantity minimum, in described first data compression step and the described second data compression step, all carry out compression;
Under the situation of described the 3rd output data quantity minimum, only in the described second data compression step, carry out compression; And
Under the situation of the data volume minimum of described input data, in described first data compression step and the described second data compression step, do not carry out compression.
15. data compression method as claimed in claim 11 also comprises:
The compression efficiency determining step, be used for determining whether occurring identical character data continuously in described input data, and under the situation of determining the character data that appearance continuously is identical, order is carried out distance of swimming compression and is handled in described first data compression step or the described second data compression step.
16. data compression method as claimed in claim 11, wherein:
In described first data compression step or the described second data compression step, before carrying out data compression, calculating is compressed the size of data afterwards, determines to realize the output mode of minimal data size, and finds output format (113) according to described definite result.
17. data compression method as claimed in claim 16, wherein:
Described output format (113) is included as has a set zone of the character code high frequency of occurrences, predetermined quantity in the character code that comprises in the described input data, and storage data that the Code Number of the character code of described predetermined quantity is associated with the frequency of occurrences of the character code of described predetermined quantity.
18. a uncompressing data comprises:
The first data decompression step is used to adopt the method corresponding with the statistical coding method packed data that decompresses; And
The second data decompression step is used for adopting the method corresponding with the dictionary encoding method further the data that decompressed in the described first data decompression step to be decompressed.
19. uncompressing data as claimed in claim 18 also comprises:
Determining step is used for determining being included in the value of the identification data of described packed data,
Wherein:
When in described determining step, determining that described identification data is first identification data, the described packed data of decompression in the described first data decompression step, and in the described second data decompression step, the data that obtain by the decompression in the described first data decompression step are decompressed; And
When determining that described identification data is second identification data in described determining step, described packed data decompresses in the described first data decompression step.
20. uncompressing data as claimed in claim 19, wherein:
When determining that described identification data is the 3rd identification data in described determining step, described packed data decompresses in the described second data decompression step.
CN2005800453617A 2004-12-28 2005-12-27 Device and data method for selective compression and decompression and data format for compressed data Expired - Fee Related CN101095284B (en)

Applications Claiming Priority (5)

Application Number Priority Date Filing Date Title
JP2004379814 2004-12-28
JP379814/2004 2004-12-28
JP2005039807A JP4479530B2 (en) 2004-12-28 2005-02-16 Data compression apparatus and data restoration apparatus
JP039807/2005 2005-02-16
PCT/JP2005/024241 WO2006070925A1 (en) 2004-12-28 2005-12-27 Device and data method for selective compression and decompression and data format for compressed data

Publications (2)

Publication Number Publication Date
CN101095284A true CN101095284A (en) 2007-12-26
CN101095284B CN101095284B (en) 2012-04-18

Family

ID=38992628

Family Applications (1)

Application Number Title Priority Date Filing Date
CN2005800453617A Expired - Fee Related CN101095284B (en) 2004-12-28 2005-12-27 Device and data method for selective compression and decompression and data format for compressed data

Country Status (2)

Country Link
JP (1) JP4905562B2 (en)
CN (1) CN101095284B (en)

Cited By (12)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547010B (en) * 2008-03-24 2011-07-06 华为技术有限公司 System, method and device for coding and decoding
CN102457283A (en) * 2010-10-28 2012-05-16 阿里巴巴集团控股有限公司 Data compression and decompression method and equipment
CN104813588A (en) * 2012-10-09 2015-07-29 阿尔卡特朗讯 Secure and lossless data compression
CN105099843A (en) * 2014-05-16 2015-11-25 罗伯特·博世有限公司 Run time compression method for a vehicle communication bus
CN107065687A (en) * 2017-05-26 2017-08-18 西安工程大学 Embedded knitting system control data compression method based on LZHUF
CN107911570A (en) * 2017-11-27 2018-04-13 公安部交通管理科学研究所 A kind of method for being compressed and decompressing to picture feature
CN108305593A (en) * 2013-09-05 2018-07-20 联咏科技股份有限公司 Data compression system and its electricity saving method for liquid crystal display
CN108427704A (en) * 2018-01-05 2018-08-21 平安科技(深圳)有限公司 Tool of compression call method, device and storage medium
CN110518917A (en) * 2019-07-17 2019-11-29 华东计算技术研究所(中国电子科技集团公司第三十二研究所) LZW data compression method and system based on Huffman coding
CN110913223A (en) * 2018-09-18 2020-03-24 佳能株式会社 Image decompression apparatus, control method thereof, and computer-readable storage medium
CN111464187A (en) * 2020-04-17 2020-07-28 北京百瑞互联技术有限公司 Host control interface command event coding method
TWI758897B (en) * 2020-10-08 2022-03-21 大陸商星宸科技股份有限公司 Convolution calculation apparatus and method

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5149939B2 (en) 2010-06-15 2013-02-20 任天堂株式会社 Information processing program, information processing apparatus, information processing system, and information processing method
WO2014055229A1 (en) 2012-10-01 2014-04-10 Eveready Battery Company, Inc Fuel unit, gas generator and system
TWI490855B (en) * 2013-04-02 2015-07-01 Mstar Semiconductor Inc Decoding circuit and associated decoding method
US9589496B2 (en) 2013-08-27 2017-03-07 Samsung Display Co., Ltd. Temporal dithering technique used in accumulative data compression
JP6363581B2 (en) * 2015-05-11 2018-07-25 ヴィア アライアンス セミコンダクター カンパニー リミテッド A hardware data compressor that maintains a sorted symbol list while scanning the input block
US10027346B2 (en) 2015-05-11 2018-07-17 Via Alliance Semiconductor Co., Ltd. Hardware data compressor that maintains sorted symbol list concurrently with input block scanning
KR102337966B1 (en) * 2017-05-19 2021-12-13 삼성전자주식회사 Electronic device for compressing data and method for operation thereof
US10476518B1 (en) * 2018-12-06 2019-11-12 Nyquist Semiconductor Limited Hardware friendly data compression
CN112100455B (en) * 2020-08-18 2022-09-20 北京理工大学 LZW dictionary searching method based on character string parallel search
CN116886104B (en) * 2023-09-08 2023-11-21 西安小草植物科技有限责任公司 Intelligent medical data analysis method based on artificial intelligence

Family Cites Families (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US4626824A (en) * 1985-06-11 1986-12-02 International Business Machines Corporation Apparatus and algorithm for compressing and decompressing data
JPH0661870A (en) * 1992-08-12 1994-03-04 Mitsubishi Electric Corp Variable length coder decoder
JPH07212243A (en) * 1994-01-13 1995-08-11 Fuji Photo Film Co Ltd Method and device for encoding variable length code
US5861827A (en) * 1996-07-24 1999-01-19 Unisys Corporation Data compression and decompression system with immediate dictionary updating interleaved with string search
US5964842A (en) * 1997-01-31 1999-10-12 Network Computing Devices, Inc. Method and apparatus for scaling data compression based on system capacity
JP3161697B2 (en) * 1997-04-18 2001-04-25 富士ゼロックス株式会社 Encoding device, decoding device, encoding / decoding device, and methods thereof
JP2001044849A (en) * 1999-07-27 2001-02-16 Canon Inc Decoder and method

Cited By (19)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101547010B (en) * 2008-03-24 2011-07-06 华为技术有限公司 System, method and device for coding and decoding
CN102457283A (en) * 2010-10-28 2012-05-16 阿里巴巴集团控股有限公司 Data compression and decompression method and equipment
CN102457283B (en) * 2010-10-28 2015-10-14 阿里巴巴集团控股有限公司 A kind of data compression, decompression method and equipment
CN104813588A (en) * 2012-10-09 2015-07-29 阿尔卡特朗讯 Secure and lossless data compression
US9740720B2 (en) 2012-10-09 2017-08-22 Alcatel Lucent Secure and lossless data compression
CN108305593A (en) * 2013-09-05 2018-07-20 联咏科技股份有限公司 Data compression system and its electricity saving method for liquid crystal display
CN108305593B (en) * 2013-09-05 2020-11-13 联咏科技股份有限公司 Data compression system for liquid crystal display and power saving method thereof
CN105099843A (en) * 2014-05-16 2015-11-25 罗伯特·博世有限公司 Run time compression method for a vehicle communication bus
CN105099843B (en) * 2014-05-16 2020-05-05 罗伯特·博世有限公司 Method for compressing the operating time of a vehicle communication bus
CN107065687A (en) * 2017-05-26 2017-08-18 西安工程大学 Embedded knitting system control data compression method based on LZHUF
CN107911570A (en) * 2017-11-27 2018-04-13 公安部交通管理科学研究所 A kind of method for being compressed and decompressing to picture feature
CN108427704A (en) * 2018-01-05 2018-08-21 平安科技(深圳)有限公司 Tool of compression call method, device and storage medium
CN110913223A (en) * 2018-09-18 2020-03-24 佳能株式会社 Image decompression apparatus, control method thereof, and computer-readable storage medium
CN110913223B (en) * 2018-09-18 2022-12-27 佳能株式会社 Image decompression apparatus, control method thereof, and computer-readable storage medium
CN110518917A (en) * 2019-07-17 2019-11-29 华东计算技术研究所(中国电子科技集团公司第三十二研究所) LZW data compression method and system based on Huffman coding
CN110518917B (en) * 2019-07-17 2023-01-03 华东计算技术研究所(中国电子科技集团公司第三十二研究所) LZW data compression method and system based on Huffman coding
CN111464187A (en) * 2020-04-17 2020-07-28 北京百瑞互联技术有限公司 Host control interface command event coding method
CN111464187B (en) * 2020-04-17 2023-04-28 北京百瑞互联技术有限公司 Host control interface command event coding method, storage medium and computer equipment
TWI758897B (en) * 2020-10-08 2022-03-21 大陸商星宸科技股份有限公司 Convolution calculation apparatus and method

Also Published As

Publication number Publication date
CN101095284B (en) 2012-04-18
JP4905562B2 (en) 2012-03-28
JP2010136417A (en) 2010-06-17

Similar Documents

Publication Publication Date Title
CN101095284B (en) Device and data method for selective compression and decompression and data format for compressed data
US5374916A (en) Automatic electronic data type identification process
US5467087A (en) High speed lossless data compression system
US5870036A (en) Adaptive multiple dictionary data compression
EP1832000B1 (en) Device and data method for selective compression and decompression and data format for compressed data
JP3278297B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
US7358874B2 (en) Data compression using a stream selector with edit-in-place capability for compressed data
US5363098A (en) Byte aligned data compression
CN105207678B (en) A kind of system for implementing hardware of modified LZ4 compression algorithms
US7365658B2 (en) Method and apparatus for lossless run-length data encoding
EP0965171A2 (en) Data coding network
CN104834539B (en) A kind of data increment update method
CN107565970B (en) Hybrid lossless compression method and device based on feature recognition
US6225922B1 (en) System and method for compressing data using adaptive field encoding
US5594435A (en) Permutation-based data compression
US5216423A (en) Method and apparatus for multiple bit encoding and decoding of data through use of tree-based codes
US5857036A (en) System and method for the fractal encoding of datastreams
US6748520B1 (en) System and method for compressing and decompressing a binary code image
US6055273A (en) Data encoding and decoding method and device of a multiple-valued information source
CN104125475A (en) Multi-dimensional quantum data compressing and uncompressing method and apparatus
JP2536422B2 (en) Data compression device and data decompression device
JP5070086B2 (en) Data compression apparatus and image reading apparatus
CN1656688B (en) Processing digital data prior to compression
JPH06202844A (en) Data compression/restoration processing device
Furht et al. Lossless JPEG image compression

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20181008

Address after: Kanagawa

Patentee after: Graphic Technology Corporation

Address before: Saitama Prefecture, Japan

Co-patentee before: CASIO Computer Co., Ltd.

Patentee before: Casio Electronics Manufacturing Co., Ltd.

CF01 Termination of patent right due to non-payment of annual fee
CF01 Termination of patent right due to non-payment of annual fee

Granted publication date: 20120418

Termination date: 20191227