CN101095284B - 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
CN101095284B
CN101095284B CN2005800453617A CN200580045361A CN101095284B CN 101095284 B CN101095284 B CN 101095284B CN 2005800453617 A CN2005800453617 A CN 2005800453617A CN 200580045361 A CN200580045361 A CN 200580045361A CN 101095284 B CN101095284 B CN 101095284B
Authority
CN
China
Prior art keywords
data
compression
unit
decompression
output
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.)
Expired - Fee Related
Application number
CN2005800453617A
Other languages
Chinese (zh)
Other versions
CN101095284A (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

The apparatus and method for that is used for compression and decompression data selectively
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 through 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 through 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 on character ground one by one, 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 great amount of calculation, 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 explain this principle.
In Figure 28, the input data that 281 storages of P buffer have been encoded, Q buffer 282 storages data to be encoded.The character string 283 that is input in the Q buffer 282 is begun from its stem, carry out comparison with the character string stream that is stored in the P buffer 281.If in P buffer 281, found the longest character string 284 corresponding according to the character that is comprised, then coding beginning.For example; In P buffer 281, found under the situation of respective symbols string 284, shown in figure 28, then the starting position through 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.Shown in figure 29, the 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 said 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 through 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 the character string of having encoded, and be the copy of this partial character string, as stated 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 increasingly high 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 complex processing, for example the position is redistributed.In addition, the amount of calculation of relatively calculating 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, begin most what use, 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 in dictionary, there is not sufficient content.
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;
Second data compression unit (2,12,22), it adopts the statistical coding method to carry out second data compression process;
Unit (25) is calculated/confirmed to size,
Wherein, said first data compression unit (1,11,21) search long data corresponding in the coded data from dictionary with said input data, and be that unit compresses said input data with the byte,
Said size is calculated/is confirmed unit (25) calculating and works as said input data only by said first data compression unit (1; 11; First output data quantity that to export when 21) compressing; And work as through said first data compression unit (1; 11; 21) to the compression of said input data and first dateout that obtains further by said second data compression unit (2; 12; Second output data quantity that to export when 22) compressing; And confirm that whether said second output data quantity is greater than said first output data quantity
When said size is calculated/is confirmed unit (25) and confirms said second output data quantity greater than said first output data quantity; Said second data compression unit (2,12,22) does not carry out said second data compression process and said first data compression unit (1,11,21) is carried out said first data compression process, and
When said size is calculated/is confirmed unit (25) and confirms that said second output data quantity is not more than said first output data quantity; Said first data compression unit (1,11,21) is carried out compression, and said second data compression unit (2,12,22) is to further being compressed by the data of said first data compression unit (1,11,21) compression.
Said first data compression unit (1,11,21) can be calculated the frequency of occurrences of the identical data that in said input data, comprises.
Said second data compression unit (2,12,22) can be carried out data compression through using the result of calculation of the frequency of occurrences of being calculated by said first data compression unit (1,11,21).
Unit (25) is calculated/confirmed to said size can further calculate the 3rd output data quantity that when said input data are only compressed by said second data compression unit (2,12,22), will export, and the data volume of more said first output data quantity, said second output data quantity, said the 3rd output data quantity and said input data.
Under the situation of said first output data quantity minimum, only said first data compression unit (1,11,21) is carried out compression.
Under the situation of said second output data quantity minimum; Said first data compression unit (1,11,21) and said second compression unit (2,12,22) both carry out compression, and said second data compression unit (2,12,22) is to further being compressed by the data of said first data compression unit (1,11,21) compression.
Under the situation of said the 3rd output data quantity minimum, only said second data compression unit (2,12,22) is carried out compression, and said second data compression unit (2,12,22) is carried out compression to said input data.
Under the minimum situation of the data volume of said input data, said first data compression unit (1,11,21) and said second data compression unit (2,12,22) are not carried out compression.
Said data compression device can also comprise that compression efficiency confirms unit (39); It determines whether in said input data, to occur continuously identical character data; And occur continuously under the identical characters data conditions definite, order said first data compression unit (1,11,21) or said second data compression unit (2,12,22) to carry out distance of swimming processed compressed.
Before carrying out said data compression process; The size of the data after said first data compression unit (1,11,21) and said second data compression unit (2,12,22) can be calculated and be compressed; Confirm to realize the data output mode of minimal data size, and confirm that according to this result finds output format (113).
Said output format (113) can be included as predetermined quantity in the character code that in said 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 said predetermined quantity is associated with the frequency of occurrences of the character code of said predetermined quantity.
Data decompression equipment according to a second aspect of the invention comprises:
The first data decompression unit (51), it adopts the method decompression packed data corresponding with the statistical coding method; And
The second data decompression unit (52), it adopts the method corresponding with the dictionary encoding method packed data that decompresses.
Said data decompression equipment can also comprise definite unit (54), and it confirms to be included in the value of the identification data in the said packed data,
Wherein:
Confirm that in said definite unit (54) said identification data is under the situation of first identification data; The said first data decompression unit (51) the said packed data that can decompress, and the said second data decompression unit (52) can further decompress to the data that decompression obtained through the said first data decompression unit (51); And
Confirm that in said definite unit (54) said identification data is under the situation of second identification data, decompression is not carried out in can decompress said packed data and the said second data decompression unit (52), the said first data decompression unit (51).
Confirm that in said definite unit (54) said identification data is under the situation of the 3rd identification data, decompression is not carried out in can decompress said packed data and the said first data decompression unit (51), the said second data decompression unit (52).
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 adopts the statistical coding method to carry out second data compression process,
Wherein, said data compression method comprises that also size calculates/confirm step, and step was calculated/confirmed to said size before said first data compression step and the said second data compression step,
Calculate/confirm in the step in said size; Calculate first output data quantity that when said input data only are compressed, will export in the said first data compression step; And when in the said first data compression step, said input data being compressed second output data quantity that first dateout that obtained will be exported when further compressing in the said second data compression step; And confirm that whether said second output data quantity is greater than said first output data quantity
Wherein, in the said first data compression step, from dictionary, finding the long data corresponding in the coded data, and be that unit compresses said input data and exports with the byte with said input data,
When calculating/confirm in said size in the step when confirming said second output data quantity greater than said first output data quantity; In the said second data compression step, do not carry out said second data compression process and in the said first data compression step, carry out said first data compression process, and
Confirm in the step that when calculating/confirm said second output data quantity is not more than under the situation of said first output data quantity in said size; After in the said first data compression step, having carried out said first data compression process, in the said second data compression step to further compressing through the data that compression obtained in the said first data compression step.
In the said first data compression step, can calculate the frequency of occurrences of the identical data that in said input data, comprises.
In the said second data compression step, can carry out data compression through using the result of calculation of the frequency of occurrences of being calculated in the said first data compression step.
Calculate/confirm in the step in said size; Can further calculate the 3rd output data quantity that in the said second data compression step, will export during the said input data of compression when only, and can more said first output data quantity, the data volume of said second output data quantity, said the 3rd output data quantity and said input data;
In said first output data quantity is under the situation of minimum, can only in the said first data compression step, carry out compression;
In said second output data quantity is under the situation of minimum; In the said second data compression step, carry out compression after can in the said first data compression step, having carried out compression, so that to further compressing through the data that compression obtained in the said first data compression step;
In said the 3rd output data quantity is under the situation of minimum, can only in the said second data compression step, carry out compression, wherein in the said second data compression step, said input data is carried out compression; And
Data volume in said input data is under the situation of minimum, can in said first data compression step and the said second data compression step, not carry out compression, and
Wherein, under the situation of said the 3rd output data quantity minimum.
Said data compression method can also comprise that compression efficiency confirms step; Be used for determining whether occurring identical character data continuously in said input data; And occur continuously under the identical characters data conditions definite, distance of swimming processed compressed is carried out in order in said first data compression step or the said second data compression step.
In said first data compression step or the said second data compression step; Can be before carrying out said data compression process; Calculating is compressed the size of data afterwards, confirms to realize the output mode of minimal data size, and confirms that according to this result finds output format (113).
Said output format (113) can be included as predetermined quantity in the character code that comprises in the said 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 said predetermined quantity is associated with the frequency of occurrences of the character code of said predetermined quantity.
Uncompressing data according to a forth aspect of the invention comprises:
Confirm step, be used for confirming to be included in the identification data of packed data;
The first data decompression step is used to adopt the method corresponding with the statistical coding method said packed data that decompresses; And
The second data decompression step is used to adopt the method corresponding with the dictionary encoding method that data are decompressed.
Wherein:
When in said definite step, confirming that said identification data is first identification data; The said packed data that can in said first decompression step, decompress, and can be to further decompressing through the data that obtained that in said first decompression step, decompress in said second compression step; And
When in said definite step, confirming that said identification data is second identification data, said packed data and execution decompression in the said second data decompression step decompress in the said first data decompression step.
When in said definite step, confirming that said identification data is the 3rd identification data, said packed data and execution decompression in the said first data decompression step decompress in said second decompression step.
According to the present invention, adopt said first compression unit and said 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, said first compression unit uses the dictionary encoding method to come coded input data, and said second compression unit uses the statistical coding method to come coded input data.
Description of drawings
Through reading following detailed description and accompanying drawing, these purposes of the present invention will become more clear with other purposes and advantage, 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 explain the not figure of the structure of packed data, and Fig. 3 F is the figure that is used to explain the structure of pressure texture;
Fig. 4 is the figure that is used to explain according to the structure of the data compression device of embodiment 2;
Fig. 5 is the figure that is used to explain 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 explain 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 explain according to the structure of the data compression device of embodiment 5;
Figure 10 is the figure that is used to explain the configuration of preliminary treatment unit;
Figure 11 is used to explain the flow chart by the performed processing in preliminary treatment unit;
Figure 12 is the figure that the example of compressed format is shown;
Figure 13 is used to explain the flow chart by the performed processing of coding generation unit;
Figure 14 is the figure that is used to explain 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 and coded data in each deterministic model;
Figure 16 is illustrated in the various deterministic models figure of the data that will in output data buffer, be provided with;
Each all shows according to what confirm based on compression efficiency that result of calculation that the unit obtains makes and confirms Figure 17 A to 17H, confirms as the output format of the compressed format that will be exported;
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 used to explain the figure according to the data compression process of embodiment 8;
Figure 21 is the figure that is used to explain according to the structure of the data compression device of embodiment 9;
Figure 22 is the figure that is used to explain according to the structure of the data decompression equipment of embodiment 10;
Figure 23 is the figure that is used to explain according to the structure of the data decompression equipment of embodiment 11;
Figure 24 is the figure that is used to explain according to the structure of the data decompression equipment of embodiment 12;
Figure 25 is used to explain 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 explain according to the structure of the data decompression equipment of embodiment 14;
Figure 27 is the figure that is used to explain according to the structure of the data decompression equipment of embodiment 15;
Figure 28 is the figure that is used to explain early stage data compression process; And
Figure 29 is the figure that is used to explain 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 (below be called " 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 through 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 through 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 up 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 through 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); Said 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 its form according to 1 byte data is exported, thereby be unit all data of output with the byte.
Fig. 3 is the figure that is used to specify above-mentioned configuration.At first, shown in Fig. 3 A, Input Data Buffer 3 comprises P buffer 4 and Q buffer 5.P buffer 4 is historic buffer, is made up 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 said sliding window 6 that on the direction of the arrow of Fig. 3 A, slides 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 in flag data, writes down.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 unit all data of output 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 processed compressed.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 with 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 explain 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 more specifically explain 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 said 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 processed compressed of being undertaken by second compression unit 12, 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 is included among the RAM103 with frequency of occurrences table memory cell 14.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 through using this frequency of occurrences table to carry out compression effectively, thereby quicken this processed compressed.
(embodiment 3)
Now embodiments of the invention 3 will be described.
Fig. 5 is the figure that is used to explain 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 explain more specifically 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 the for example frequency of occurrences data of each character code.
The size (perhaps compression ratio) that unit 25 calculates second packed data that when second compression unit 22 is carried out data compression, will generate is calculated/confirmed to size; Confirm whether the data volume that will export in size can be bigger than first packed data, and output indicates this to confirm result's identification data 28.
For example, confirming that unit 25 output valves " 1 " are calculated/confirmed to size as identification data 28 under the situation that this dateout will be bigger.Opposite, confirming that unit 25 output valves " 2 " are calculated/confirmed to size as identification data 28 under the situation that this output data quantity can be not bigger.
In addition; Confirming under the situation that this output data quantity will be bigger; Size is calculated/is confirmed first packed data of ordering initial data output units 26 will be stored in the intermediate data buffer 23 in unit 25 and outputs to output data buffer 27, and first packed data is not carried out second processed compressed.On the other hand; Confirming under the situation that this output data quantity can be not bigger; Size is calculated/is confirmed unit 25 orders, second compression unit 22 and obtains first packed data that is stored in the intermediate data buffer 23, so that the data that obtained are carried out second processed compressed.
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 illustrates that first processed compressed has been carried out and second processed compressed is not also carried out, and another kind illustrates that first processed compressed has been carried out and second processed compressed has also been carried out, shown in Fig. 6 A.What replace the two is that identification data 28 can compress first sign of having carried out and indicate second processed compressed to carry out/do not have second sign of carrying out by indication, shown in Fig. 6 B.
Through these steps, identification data 28 is imported into output data buffer 27 with packed data.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 calculates/confirm unit 25 and initial data output unit 26 is 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 RAM 103.Perhaps, these unit can be constructed as the circuit that is used to carry out above-mentioned functions.
As stated, according to present embodiment, after having carried out first processed compressed, calculate size (perhaps compression ratio) in the situation lower compression data of implementing second processed compressed.If the data volume after second processed compressed then will can not carried out second processed compressed greater than the data size after first processed compressed only.This has just been avoided second processed compressed to produce the size of the bigger data than first packed data.That is, can avoid invalidly carrying out second processed compressed, make processed compressed more effective.
(embodiment 4)
Now embodiments of the invention 4 will be described.
Fig. 7 is the figure that is used to explain 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 more effectively processed compressed.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 self-adapting dictionary coding method compression should import 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.The size (perhaps compression ratio) that unit 25 calculates second coded data that when second compression unit 22 is carried out data compression, will generate is calculated/confirmed to size, and confirm whether the data volume that will export dimensionally can be bigger than first packed data.
Size is calculated/is confirmed unit 25 and calculates 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 minimum situation of the size SIZE_INPUT of input data, export these input data and it is not handled.That is, the identification data 28 of unit 25 output values of illustrating " 1 " is calculated/confirmed to size, and order initial data output unit 26 is exported and is stored in the data in the Input Data Buffer 20 and it does 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 unit 25 output show values " 2 " is calculated/confirmed to size, 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 unit 25 output values of illustrating " 3 " is calculated/confirmed to size, and order second compression unit 22 to obtain the input data and these input data are used second processed compressed from Input Data Buffer 20.Second compression unit 22 obtains the input data from Input Data Buffer 20, carries out second processed compressed, 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 and compressed, to obtain second packed data.That is, the identification data 28 of unit 25 output values of illustrating " 4 " is calculated/confirmed to size, 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 processed compressed all do not have to carry out.Value " 2 " indication has been carried out first processed compressed but has not been carried out second processed compressed.Value " 3 " indication is not carried out first processed compressed but has been carried out second processed compressed.Value " 4 " indication first and second processed compressed have all been carried out.
Replace above four values; Identification data 28 can be carried out/not have second sign of carrying out and indicate second processed compressed to carry out/do not have the 3rd sign of carrying out by first sign, indication first processed compressed that the indication compression has been carried out and constitute, shown in Fig. 8 B.
For example, first compression unit 21, second compression unit 22, size calculates/confirm unit 25 and initial data output unit 26 is 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 RAM 103.Perhaps, these unit can be constructed as the circuit that is used to carry out above-mentioned processing.
As stated, according to present embodiment, can make up first and second processed compressed, thereby make and can select the most effectively 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 explain according to the structure of the compression device of present embodiment.In the present embodiment, with the processed compressed of explanation use half self adaptation statistical coding method, 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.First packed data that for example, will obtain through 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 calculations with the frequency of occurrences that is provided are stored 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 describe it subsequently.
At first, with the processing that preliminary treatment unit 35 is described.Figure 10 is used to explain 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 representes that this character code is 16 systems numerals.According to these frequency of occurrences values, preliminary treatment unit 35 generating code tables 112, this code table 112 will be the 23rd or the character code of high-order frequent appearance more 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 explain 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 stated.
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 confirms whether said reading has arrived the last data (step S3) of in frequency of occurrences table 111, being stored.(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 confirms whether the frequency of occurrences value of the 23rd character code of storage in code table 112 is 0 (step S6).Not that (step S6: not), preliminary treatment unit 35 compares (step S7) with the frequency of occurrences value of frequency of occurrences value that is obtained and the 23rd character code under 0 the situation 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 confirms 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 gets into step S9.
Under this frequency of occurrences value and the 23rd 's the corresponding situation of frequency values, preliminary treatment unit 35 confirms 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 gets into 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, all is read as up to the data in frequency of occurrences table 111 and ends.
Through 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 are all read (step S3: be), preliminary treatment unit 35 is arranged the 8th to the 23rd character code (step S10) again 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 equality.
(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 is with comprising 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 areas 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 read the data (step S21) of 1 byte from the input data that Input Data Buffer 30, provide.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 confirmed 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 confirms 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 in step 26, being read does not correspond under the 2nd the situation of character code that (step S26: not), coding generation unit 36 confirms 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 in step 29, being read does not correspond under the 3rd the situation of character code that (step S29: not), coding generation unit 36 confirms 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 in step 31, being read does not correspond under the 4th the situation of character code that (step S31: not), coding generation unit 36 confirms 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 in step 33, being read does not correspond under the 5th the situation of character code that (step S33: not), coding generation unit 36 confirms 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 in step 35, being read does not correspond under the 6th the situation of character code that (step S35: not), coding generation unit 36 confirms 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 confirms that the character codes of being read are not the frequent sign indicating numbers that occurs, and execution data processed compressed (step S41) not.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 the frequencies of occurrences processing (step S42) is set.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, the order of the character code that is searched be set to the 7th output data buffer in the character code of being read corresponding.
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 's character code.Under their identical situation, 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 following explanation, 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.
Through above-mentioned processing; The output format of coded data can be suitable for variable length code, and 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; Through 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), thereby make processed compressed to carry out with very high speed.
(embodiment 6)
Now embodiments of the invention 6 will be described.
Figure 14 is the figure that is used to explain according to the structure of the compression device of present embodiment.According to present embodiment, different with above embodiment 5, compression device comprises that compression efficiency confirms 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 that preliminary treatment unit 35, coding generation unit 36, compression efficiency confirm 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, between first to the 8th output data buffer, distributes this packed data, 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, like the following stated.By preliminary treatment unit 35 performed preliminary treatment is that flow chart according to above-mentioned Figure 11 carries out.
Compression efficiency is confirmed unit 39 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 confirms 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 through 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.Through 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 and confirms the example of unit 39 according to the compressed format 113 of the definite output of result of calculation.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 confirms that unit 39 can select to have the compressed format 113 with the corresponding appropriate size of characteristic of input data.
Therefore; According to present embodiment; Can carry out compression through selecting to have, and can shorten processed compressed required time and transmitted data compressing required time, thereby feasible can the execution exported processed compressed very efficiently 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 being confirmed the output format of unit 39 determined situation 4 by above-mentioned compression efficiency.In addition, present embodiment is the situation that the frequency of occurrences data to the 1st to the 17th character code are generated by preliminary treatment unit 35, and wherein compressed format 113 has structure shown in figure 18.Shown in figure 18, compressed format 113 is made up of stem zone and data area.Total reduced size, F1 of in the stem zone, having stored coded data is to the amount of bits of F3 data area, the not bytes in of packed data and the 1st to the 17th character code.The data area comprises by the set F1 data area of the 12nd the-the 17th the public encoding process of the following stated and F2 data area, will handle the F3 data area that be provided with and will be by the data of the following stated F4 data area that is provided with of processed compressed not by the 17th the encoding process of the following stated and the frequency of occurrences.
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 read 1 byte data (step S51) from the input data that Input Data Buffer 30, provide.Coding generation unit 36 confirms 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 confirming 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 's character code.Generation unit 36 is carried out not processed compressed (step S57) of data 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 the frequency of occurrences processing (step S58) is set 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, the order of the character code that is searched be set to the 3rd output data buffer in sense data corresponding.
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 's 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, the bit that coding generation unit 36 is opened in first output data buffer, and open 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 stated, according to present embodiment, can carry out compression, and can shorten compression required time and transmitted data compressing required time through select to have the output format of only compression efficiency for the input data.Through use frequency of occurrences scope be first to the 17th example description present embodiment.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 explain the processed compressed of present embodiment.The processed compressed of present embodiment 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 to occur continuously a character, this character is with identical with its next-door neighbour's character before it.Under the situation that same character occurs continuously, first compression unit 1 is carried out distance of swimming processed compressed.For example, Figure 20 shows character " a " and occurs 8 times situation continuously.According to common distance of swimming processed compressed, 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, data should be imported with compression, compression efficiency can be improved through the Run-Length Coding processing of adding present embodiment.
(embodiment 9)
Next, embodiments of the invention 9 will be described.
Figure 21 is the figure that is used to explain 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 first processed compressed by the input data that 21 pairs of first compression units are input in the Input Data Buffer 43, carries out second processed compressed by second compression unit 22 then.
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 be 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 is included in the controller 101 with packed data output unit 44.Input Data Buffer 43 is included among the RAM 103.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 explained the processing of compression input data.Present embodiment will be explained and be used for processing that the packed data that generates through above-mentioned processed compressed is decompressed.To specify decompression 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 the data of using the self-adapting dictionary encoded are carried out process of decoding.Adopt and to dispose, can carry out the processing that the data of being compressed according to the foregoing description 1 to 9 are decompressed.
The packed data that is generated according to embodiment 1 to 9 is input in first decompression unit 51 as the input data, thereby can the packed data that generated by above-mentioned second compression unit 12 or 22 be decompressed.52 pairs of packed datas that generated by above-mentioned first compression unit 11 or 21 of second decompression unit decompress.
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 and to dispose, can oppositely carry out decoding, and can carry out and the corresponding decoding processing of processed compressed.
(embodiment 11)
Next, embodiments of the invention 11 will be described.
Present embodiment also is the explanation decoding processing.Will specify this decoding processing now.
Figure 23 is the figure that is used to explain 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, second decompression unit 52 is carried out the processing that the data of using the self-adapting dictionary encoded are decompressed.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 to identification data confirm any in unit 54, first decompression unit 51 and second decompression unit 52.Notice that in initial condition, input switch unit 53 is set to, will import data and send identification data to and confirm unit 54.
Employed in the present embodiment identification data 28 is with illustrated identical in embodiment 3.Identification data confirms unit 54 confirms will where the input data that received be offered according to identification data 28.Input switch unit 53 is according to confirming 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 through 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 is confirmed unit 54 control switch unit 55, thereby makes 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 through using since the data decompression of first decompression unit, 51 inputs.
Input switch unit 53, identification data confirm that 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, according to present embodiment, the value of the identification data 28 that is provided with in the time of can being based on compression is carried out decompression, realizes carrying out the decompression to packed data effectively through using and the corresponding decompression method of compression method.
(embodiment 12)
Next, embodiments of the invention 12 will be described.
The present invention also will the declarative data decompression.Will specify this processing now.
Figure 24 is the figure that is used to explain 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, second decompression unit 52 is carried out the processing that the data of using the self-adapting dictionary encoded are decompressed.In Figure 24, input switch unit 53 confirms that with identification data unit 54 is identical with above embodiment.Yet, 4 kinds of values of the identification data 28 that identification data is confirmed will to describe below unit 54 identification.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.
Be input to value that identification data confirms the identification data 28 in the unit 54 under the situation of " 1 ", identification data confirms that unit 54 eliminates 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 ", and identification data is confirmed the unit 54 control input switch unit 53 and the first switch unit 55A, thereby makes the input data can be provided for second decompression unit 52.Second decompression unit 52 outputs to output switch unit 58 with dateout.Therefore, through 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 ", and identification data is confirmed unit 54 control input switch units 53, thereby makes the input data can be provided for first decompression unit 51.First decompression unit 51 decompresses should the input data.In addition, identification data is confirmed the unit 54 control second switch unit 55B, thereby makes the dateout from first decompression unit 51 will be imported into output switch unit 58.Therefore, through this control, first decompression unit 51 decompresses and should import data, and output switch unit 58 is exported the data that first decompression unit 51 decompresses.
Value at identification data 28 is under the situation of " 4 "; Identification data is confirmed unit 54 control input switch units 53, the first switch unit 55A, the second switch unit 55B and output switch unit 58, thereby makes the data after being decompressed by first decompression unit 51 to be decompressed by second decompression unit 52.First decompression unit 51 and second decompression unit 52 are carried out decompression.More specifically, first decompression unit 51 decompresses and should import 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 the value outside " 4 ", and identification data confirms that the input data that unit 54 will include determined identification data output to output switch unit 58, and it is 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 and should handle, the value of the identification data 28 that is provided with in the time of can being based on data compression is carried out decompression, realizes carrying out decompression effectively through selecting and the corresponding decompression method of coding method.
(embodiment 13)
Next embodiments of the invention 13 will be described.
Present embodiment is also with the declarative data decompression.What present embodiment was directed against is that the data that the statistical coding method of using the foregoing description 5 to 7 is compressed are decompressed.To specify this processing 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 (below be called " 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 whether the data that 113 inspections are obtained according to compressed format are formatd.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 confirms 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 to have data.In addition, decompression unit confirms that these data of 1 Bit data indication that obtained are unpressed or compression (step S74).
In these these data of 1 Bit data indication 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, be that decompression unit obtains the data (step S76) of 1 bit under the situation about compressing (step S74: be) from the F2 data area in these data of 1 Bit data indication that obtained.Then, decompression unit confirms that whether 1 Bit data that is obtained indicates these data is data (step S77) of the 1st according to frequency of occurrences ordering.Are (step S77: be) under the 1st the data conditions in these data of this 1 Bit data indication, decompression unit is inquired about the 1st character code, and exports the 1st code (step S78).
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 confirms that whether the data of this 1 bit indicate these data is according to any one in two inferior maximum codes of frequency of occurrences ordering, and promptly these data are the 2nd perhaps data (step S80) of the 3rd.
These data of 1 Bit data that obtained indication 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 confirms that 1 Bit data that is obtained is that these data of indication are codes (step S82) that code or these data of indication of the 2nd 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 confirms 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 (the step S86) in the 4th to the 7th the code.In these data is under any one 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 of the 4th code in the 7th; Decompression unit obtains the data of 4 bits from the F7 data area, and output is by any one in indicated the 8th to the 23rd the character code of 4 Bit datas that obtained.
Through adopting said method to carry out decompression, can data that use the compression of statistical coding method be decompressed, and execution and the corresponding decompression of processed compressed.
(embodiment 14)
Next, embodiments of the invention 14 will be described.
The present invention is also with the declarative data decompression.The present invention is suitable for the foregoing description 9.
Figure 26 is the figure that is used to explain according to the structure of the data decompression equipment of present embodiment.Present embodiment will be explained the processing that the packed data that generates through the processed compressed 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 confirms that unit 65 selects first decompression unit 66, second decompression unit 67 or the initial data output unit 68 according to the value of identification data 28, and control processing that packed data is decompressed.
The data that decompression decompressed by present embodiment are outputed to output data buffer 69.Be input to the be extracted data output unit 70 that contracts of data in the output data buffer 69 and take out, and in turn output in the output file 71.
Initial data cuts apart/and input unit 60, identification data confirm that unit 65, first decompression unit 66, second decompression unit 67, initial data output unit 68 and decompressed data output unit 70 are included in the control unit 101.Input Data Buffer 63 is included among the RAM 103 with output data buffer 69.Perhaps, these unit can be constructed as the circuit of carrying out above-mentioned processing.
Through 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, with illustrative embodiment 15.
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, second decompression unit 72 is carried out the processing that the data of using the self-adapting dictionary encoded are decompressed.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 scope of the present invention.Scope of the present invention is to be defined by subsidiary claim, rather than is defined by embodiment.The various distortion of in the connotation of equal value of claim of the present invention and in claim, carrying out all are considered to be 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 (16)

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;
Second data compression unit (2,12,22), it adopts the statistical coding method to carry out second data compression process, and
Unit (25) is calculated/confirmed to size,
Wherein:
Said first data compression unit (1,11,21) search long data corresponding in the coded data from dictionary with said input data, and be that unit compresses said input data with the byte,
Said size is calculated/is confirmed unit (25) calculating and works as said input data only by said first data compression unit (1; 11; First output data quantity that to export when 21) compressing; And work as through said first data compression unit (1; 11; 21) to the compression of said input data and first dateout that obtains further by said second data compression unit (2; 12; Second output data quantity that to export when 22) compressing; And confirm that whether said second output data quantity is greater than said first output data quantity
When said size is calculated/is confirmed unit (25) and confirms said second output data quantity greater than said first output data quantity; Said second data compression unit (2,12,22) does not carry out said second data compression process and said first data compression unit (1,11,21) is carried out said first data compression process, and
When said size is calculated/is confirmed unit (25) and confirms that said second output data quantity is not more than said first output data quantity; Said first data compression unit (1,11,21) is carried out compression, and said second data compression unit (2,12,22) is to further being compressed by the data of said first data compression unit (1,11,21) compression.
2. data compression device as claimed in claim 1, wherein
Said first data compression unit (1,11,21) is calculated the frequency of occurrences of the identical data that in said input data, comprises; And
Said second data compression unit (2,12,22) is carried out data compression through the result of calculation of using the frequency of occurrences of being calculated by said first data compression unit (1,11,21).
3. data compression device as claimed in claim 1, wherein:
Said size is calculated/is confirmed unit (25) and further calculates the 3rd output data quantity that when said input data are only compressed by said second data compression unit (2,12,22), will export, and the data volume of more said first output data quantity, said second output data quantity, said the 3rd output data quantity and said input data;
Under the situation of said first output data quantity minimum, only said first data compression unit (1,11,21) is carried out compression;
Under the situation of said second output data quantity minimum; Said first data compression unit (1,11,21) is carried out compression, and said second data compression unit (2,12,22) is to further being compressed by the data of said first data compression unit (1,11,21) compression;
Under the situation of said the 3rd output data quantity minimum, only said second data compression unit (2,12,22) is carried out compression, and said second data compression unit (2,12,22) is carried out compression to said input data; And
Under the minimum situation of the data volume of said input data, said first data compression unit (1,11,21) and said second data compression unit (2,12,22) are not carried out compression.
4. data compression device as claimed in claim 1 also comprises:
Compression efficiency is confirmed unit (39); It determines whether in said input data, to occur continuously identical character data; And confirming under the situation that identical character data occurs continuously, ordering said first data compression unit (1,11,21) or said second data compression unit (2,12,22) to carry out distance of swimming processed compressed.
5. data compression device as claimed in claim 1, wherein:
Before carrying out said data compression process; Said first data compression unit (1,11,21) or said second data compression unit (2,12,22) are calculated the size of the data after being compressed; Confirm to realize the data output mode of minimal data size, and find output format (113) according to said definite result.
6. data compression device as claimed in claim 5, wherein
Said 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 said input data, and storage data that the Code Number of the character code of said predetermined quantity is associated with the frequency of occurrences of the character code of said predetermined quantity.
7. data decompression equipment comprises:
The first data decompression unit (51), it adopts the method corresponding with the statistical coding method packed data that decompresses; And
The second data decompression unit (52), it adopts the method corresponding with the dictionary encoding method packed data that decompresses; And
Confirm unit (54), it confirms to be included in the identification data in the said packed data,
Wherein:
Confirm that in said definite unit (54) said identification data is under the situation of first identification data; The said first data decompression unit (51) the said packed data that decompresses, and the said second data decompression unit (52) further decompresses to the data that the decompression through the said first data decompression unit (51) obtains; And
Confirm that in said definite unit (54) said identification data is under the situation of second identification data, decompression is not carried out in the said first data decompression unit (51) said packed data of decompression and the said second data decompression unit (52).
8. data decompression equipment as claimed in claim 7, wherein:
Confirm that in said definite unit (54) said identification data is under the situation of the 3rd identification data, decompression is not carried out in the said second data decompression unit (52) said packed data of decompression and the said first data decompression unit (51).
9. 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 adopts the statistical coding method to carry out second data compression process; And
Wherein, said data compression method comprises that also size calculates/confirm step, and step was calculated/confirmed to said size before said first data compression step and the said second data compression step,
Calculate/confirm in the step in said size; Calculate first output data quantity that when said input data only are compressed, will export in the said first data compression step; And when in the said first data compression step, said input data being compressed second output data quantity that first dateout that obtained will be exported when further compressing in the said second data compression step; And confirm that whether said second output data quantity is greater than said first output data quantity
In the said first data compression step, the search long data corresponding in the coded data from dictionary with said input data, and be that unit compresses said input data and exports with the byte, and
When calculating/confirm in said size in the step when confirming said second output data quantity greater than said first output data quantity; In the said second data compression step, do not carry out said second data compression process and in the said first data compression step, carry out said first data compression process, and
Confirm in the step that when calculating/confirm said second output data quantity is not more than under the situation of said first output data quantity in said size; After in the said first data compression step, having carried out said first data compression process, in the said second data compression step to further compressing through the data that compression obtained in the said first data compression step.
10. data compression method as claimed in claim 9, wherein:
In the said first data compression step, calculate the frequency of occurrences of the identical data that in said input data, comprises; And
In the said second data compression step, carry out data compression through the result of calculation of using the frequency of occurrences of calculating in the said first data compression step.
11. data compression method as claimed in claim 10, wherein:
Calculate/confirm in the step in said size; Further calculating is when the 3rd output data quantity that only in the said second data compression step, will export during the said input data of compression, and the data volume of more said first output data quantity, said second output data quantity, said the 3rd output data quantity and said input data;
Under the situation of said first output data quantity minimum, only in the said first data compression step, carry out compression;
Under the situation of said second output data quantity minimum; In the said second data compression step, carry out compression after in the said first data compression step, having carried out compression, so that to further compressing through the data that compression obtained in the said first data compression step;
Under the situation of said the 3rd output data quantity minimum, only in the said second data compression step, carry out compression, wherein in the said second data compression step, said input data are carried out compression; And
Under the minimum situation of the data volume of said input data, in said first data compression step and the said second data compression step, do not carry out compression.
12. data compression method as claimed in claim 9 also comprises:
Compression efficiency is confirmed step; Be used for determining whether occurring identical character data continuously in said input data; And under the situation of confirming the character data that appearance continuously is identical, distance of swimming processed compressed is carried out in order in said first data compression step or the said second data compression step.
13. data compression method as claimed in claim 9, wherein:
In said first data compression step or the said second data compression step; Before carrying out data compression; Calculating is compressed the size of data afterwards, confirms to realize the output mode of minimal data size, and finds output format (113) according to said definite result.
14. data compression method as claimed in claim 13, wherein:
Said 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 said input data, and storage data that the Code Number of the character code of said predetermined quantity is associated with the frequency of occurrences of the character code of said predetermined quantity.
15. a uncompressing data comprises:
Confirm step, be used for confirming to be included in the identification data of packed data;
The first data decompression step is used to adopt the method corresponding with the statistical coding method said packed data that decompresses; And
The second data decompression step is used to adopt the method corresponding with the dictionary encoding method that data are decompressed;
Wherein:
When in said definite step, confirming that said identification data is first identification data; The said packed data of decompression in the said first data decompression step, and in the said second data decompression step, the data that obtain through the decompression in the said first data decompression step are decompressed; And
When in said definite step, confirming that said identification data is second identification data, said packed data and execution decompression in the said second data decompression step decompress in the said first data decompression step.
16. uncompressing data as claimed in claim 15, wherein:
When in said definite step, confirming that said identification data is the 3rd identification data, said packed data and execution decompression in the said first data decompression step decompress in the said 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
JP039807/2005 2005-02-16
JP2005039807A JP4479530B2 (en) 2004-12-28 2005-02-16 Data compression apparatus and data restoration apparatus
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 CN101095284A (en) 2007-12-26
CN101095284B true 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 (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN105099843A (en) * 2014-05-16 2015-11-25 罗伯特·博世有限公司 Run time compression method for a vehicle communication bus

Families Citing this family (22)

* 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
JP5149939B2 (en) 2010-06-15 2013-02-20 任天堂株式会社 Information processing program, information processing apparatus, information processing system, and information processing method
CN102457283B (en) * 2010-10-28 2015-10-14 阿里巴巴集团控股有限公司 A kind of data compression, decompression method and equipment
WO2014055229A1 (en) 2012-10-01 2014-04-10 Eveready Battery Company, Inc Fuel unit, gas generator and system
EP2720376A1 (en) 2012-10-09 2014-04-16 Alcatel Lucent Secure and lossless data compression
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
CN104424900B (en) * 2013-09-05 2018-03-30 联咏科技股份有限公司 Data compression system and its electricity saving method for liquid crystal display
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
CN107065687B (en) * 2017-05-26 2019-07-26 西安工程大学 Embedded knitting system based on LZHUF controls data compression method
CN107911570B (en) * 2017-11-27 2019-11-29 公安部交通管理科学研究所 The method that a kind of pair of picture feature is compressed and decompressed
CN108427704B (en) * 2018-01-05 2022-08-09 平安科技(深圳)有限公司 Compression tool calling method and device and storage medium
JP6775558B2 (en) * 2018-09-18 2020-10-28 キヤノン株式会社 Image stretcher and its control method and program
US10476518B1 (en) * 2018-12-06 2019-11-12 Nyquist Semiconductor Limited Hardware friendly data compression
CN110518917B (en) * 2019-07-17 2023-01-03 华东计算技术研究所(中国电子科技集团公司第三十二研究所) LZW data compression method and system based on Huffman coding
CN111464187B (en) * 2020-04-17 2023-04-28 北京百瑞互联技术有限公司 Host control interface command event coding method, storage medium and computer equipment
CN112100455B (en) * 2020-08-18 2022-09-20 北京理工大学 LZW dictionary searching method based on character string parallel search
TWI758897B (en) * 2020-10-08 2022-03-21 大陸商星宸科技股份有限公司 Convolution calculation apparatus and method
CN115310409A (en) * 2022-06-29 2022-11-08 杭州似然数据有限公司 Data encoding method, system, electronic device and storage medium
CN116886104B (en) * 2023-09-08 2023-11-21 西安小草植物科技有限责任公司 Intelligent medical data analysis method based on artificial intelligence

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1228887A (en) * 1996-07-24 1999-09-15 尤尼西斯公司 Data compression and decompression system with immediate dictionary updating interleaved with string search
US6311224B1 (en) * 1997-01-31 2001-10-30 Network Computing Devices, Inc. Dynamically selectable data compression techniques based on processing capacity

Family Cites Families (5)

* 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
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

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1228887A (en) * 1996-07-24 1999-09-15 尤尼西斯公司 Data compression and decompression system with immediate dictionary updating interleaved with string search
US6311224B1 (en) * 1997-01-31 2001-10-30 Network Computing Devices, Inc. Dynamically selectable data compression techniques based on processing capacity

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
FRANASZEK P ET AL.Parallel compression with cooperative dictionary construction.DATA COMPRESSION CONFERENCE,1996.IEEE.1996,200-209. *
FRANASZEKPETAL.Parallelcompressionwithcooperativedictionaryconstruction.DATACOMPRESSIONCONFERENCE 1996.IEEE.1996

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
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

Also Published As

Publication number Publication date
CN101095284A (en) 2007-12-26
JP2010136417A (en) 2010-06-17
JP4905562B2 (en) 2012-03-28

Similar Documents

Publication Publication Date Title
CN101095284B (en) Device and data method for selective compression and decompression and data format for compressed data
US5870036A (en) Adaptive multiple dictionary data compression
JP3278297B2 (en) Data compression method, data decompression method, data compression device, and data decompression device
US5374916A (en) Automatic electronic data type identification process
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
US7492290B1 (en) Alternative encoding for LZSS output
CN116681036B (en) Industrial data storage method based on digital twinning
CN104834539B (en) A kind of data increment update method
US5594435A (en) Permutation-based data compression
CN107565970B (en) Hybrid lossless compression method and device based on feature recognition
US5216423A (en) Method and apparatus for multiple bit encoding and decoding of data through use of tree-based codes
CN108886367A (en) Method, apparatus and system for compression and decompression data
US5857036A (en) System and method for the fractal encoding of datastreams
US6748520B1 (en) System and method for compressing and decompressing a binary code image
CN104811209A (en) Compressed file data embedding method and device capable of resisting longest matching detection
CN104125475A (en) Multi-dimensional quantum data compressing and uncompressing method and apparatus
US6055273A (en) Data encoding and decoding method and device of a multiple-valued information source
CN105791832A (en) Data coding method, data decoding method, data coding system and data decoding system
JP2536422B2 (en) Data compression device and data decompression device
JP5070086B2 (en) Data compression apparatus and image reading apparatus
CN112262578B (en) Point cloud attribute coding method and device and point cloud attribute decoding method and device
US7612692B2 (en) Bidirectional context model for adaptive compression
CN104199352A (en) Range encoding hardware implementation system based on FPGA (field programmable gate array)
CN117118456B (en) Magnetic control switch control data processing method based on depth fusion

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

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.

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

Granted publication date: 20120418

Termination date: 20191227

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