CN111384968B - Data compression/decompression device and data decompression method - Google Patents

Data compression/decompression device and data decompression method Download PDF

Info

Publication number
CN111384968B
CN111384968B CN201811628184.0A CN201811628184A CN111384968B CN 111384968 B CN111384968 B CN 111384968B CN 201811628184 A CN201811628184 A CN 201811628184A CN 111384968 B CN111384968 B CN 111384968B
Authority
CN
China
Prior art keywords
value
data
code
coding
decompression
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201811628184.0A
Other languages
Chinese (zh)
Other versions
CN111384968A (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.)
Shanghai Cambricon Information Technology Co Ltd
Original Assignee
Shanghai Cambricon Information Technology 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
Application filed by Shanghai Cambricon Information Technology Co Ltd filed Critical Shanghai Cambricon Information Technology Co Ltd
Priority to CN201811628184.0A priority Critical patent/CN111384968B/en
Priority to PCT/CN2019/121056 priority patent/WO2020114283A1/en
Publication of CN111384968A publication Critical patent/CN111384968A/en
Application granted granted Critical
Publication of CN111384968B publication Critical patent/CN111384968B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/40Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
    • H03M7/4006Conversion to or from arithmetic code
    • HELECTRICITY
    • H03ELECTRONIC CIRCUITRY
    • H03MCODING; DECODING; CODE CONVERSION IN GENERAL
    • H03M7/00Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
    • H03M7/30Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
    • H03M7/46Conversion to or from run-length codes, i.e. by representing the number of consecutive digits, or groups of digits, of the same kind by a code word and a digit indicative of that kind
    • H03M7/48Conversion to or from run-length codes, i.e. by representing the number of consecutive digits, or groups of digits, of the same kind by a code word and a digit indicative of that kind alternating with other codes during the code conversion process, e.g. run-length coding being performed only as long as sufficientlylong runs of digits of the same kind are present

Abstract

The application relates to a data compression and decompression device and a data decompression method, which can decompress n input data streams in parallel, wherein FIFO memories are arranged at the input end and the output end, and the input data streams and the output decompression results are synchronously operated, so that the compression of a plurality of data streams of data to be compressed in parallel is ensured, or the output results are accurate when the compressed data is decompressed.

Description

Data compression/decompression device and data decompression method
Technical Field
The present application relates to the field of computer technologies, and in particular, to a data compression/decompression apparatus and a data decompression method.
Background
Data compression is a technical method for reducing the data volume to reduce the storage space and improve the transmission, storage and processing efficiency of the data on the premise of not losing useful information, or for reorganizing the data according to a certain algorithm and reducing the data redundancy and the storage space.
However, the conventional data decompression method has a problem of low efficiency in decompressing data.
Disclosure of Invention
In view of the above, it is necessary to provide a data compression/decompression apparatus and a data compression method for efficiently decompressing data.
A data compression/decompression apparatus comprising: the data dividing circuit is connected with the input FIFO memory, wherein n is a positive integer,
the data splitting circuit is used for splitting the compressed data into a plurality of data streams;
each input FIFO memory is used for executing synchronous operation on the received data stream and transmitting the data stream after the synchronous operation to the connected compression operation execution unit;
the compression operation executing components are connected in series in each compression operation executing assembly and used for sequentially executing corresponding decompression sub-operations on the received input data to obtain a decompression result of each data stream;
each output FIFO memory is used for receiving the decompression result sent by the connected compression and decompression operation execution component, and outputting the received decompression result after synchronous operation.
A method of data decompression, the method comprising:
dividing the compressed data into a plurality of data streams;
acquiring n data streams, performing synchronous operation on the n data streams, and decompressing the n data streams after the synchronous operation in parallel to obtain n decompressed sub-results, wherein n is a positive integer;
synchronously operating the n decompressed numbers, and writing the n decompressed sub-results after the synchronous operation into the decompressed sub-results according to the sequence and/or position of each data stream in the data to be compressed;
and repeating the steps from the acquisition of the n data streams to the writing of the n decompressed sub-results until the number of the single decompressed sub-results is less than n, and then terminating the acquisition of the data streams.
The data compression and decompression device and the data decompression method can decompress n input data streams in parallel, the FIFO memories are arranged at the input end and the output end, the input data streams and the output decompression results are synchronously operated, and the condition that a plurality of data streams of data to be compressed are compressed in parallel or the output result is accurate when the compressed data is decompressed is ensured.
Drawings
FIG. 1 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 2 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 3 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 4 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 5 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 6 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 7 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 8 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 9 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 10 is a block diagram showing the structure of a data compression/decompression apparatus according to an embodiment;
FIG. 11 is a flow diagram illustrating a method of data compression, according to one embodiment;
FIG. 12 is a flow diagram illustrating a method for data decompression in one embodiment;
FIG. 13 is a flow chart illustrating additional steps of a data compression method according to another embodiment;
FIG. 14 is a flowchart illustrating additional steps of a data decompression method according to an embodiment;
FIG. 15 is a flowchart illustrating the steps of compressing the various data streams in one embodiment;
FIG. 16 is a schematic flow chart diagram illustrating the steps for decompressing various data streams in one embodiment;
FIG. 17 is a flow chart illustrating the steps of compressing the respective data streams in another embodiment;
FIG. 18 is a flow chart illustrating the steps of decompressing respective data streams in another embodiment;
FIG. 19 is a flowchart illustrating steps for compressing the respective data streams in one embodiment;
FIG. 20 is a schematic flow chart diagram illustrating the steps for decompressing various data streams in one embodiment;
FIG. 21 is a flowchart illustrating the steps of compressing the respective data streams in another embodiment;
fig. 22 is a schematic flow chart illustrating a step of decompressing each data stream in another embodiment.
Detailed Description
In order to make the objects, technical solutions and advantages of the present application more apparent, the present application is described in further detail below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative of the present application and are not intended to limit the present application.
As shown in fig. 1-10, which are block diagrams illustrating a data compression and decompression apparatus 100 according to an embodiment of the present application, the data compression and decompression apparatus 100 in fig. 1 includes: n codec operation executing components 110, each of which includes an input FIFO memory 111, at least one codec operation executing unit 112, and an output FIFO memory 113, wherein the plurality of codec operation executing units 112 are connected in series between the input FIFO memory 111 and the output FIFO memory 113, where n is a positive integer.
Wherein each of the input FIFO memories 111 is configured to perform a synchronization operation on the received data stream and to transmit the data stream after the synchronization operation to a connected compression operation execution unit; at least one compression/decompression operation executing component 112 connected in series in each compression/decompression operation executing component 110, sequentially executing corresponding compression sub-operations on the received input data to obtain a compression encoding result of each data stream; each output FIFO memory is used for receiving the compression coding result sent by the connected compression and decompression operation execution component, and outputting the received compression coding result after synchronous operation. Further, the output FIFO memory writes out the received compressed encoding results according to the sequence and/or position of each data stream in the data to be compressed. It should be clear that the data in the data stream is the data to be compressed.
Optionally, the data compression and decompression apparatus 100 may further include a data dividing circuit 120 configured to divide the input data into a plurality of data streams. Alternatively, the input data may be data to be compressed or compressed data. Alternatively, the size of the data stream divided by the data dividing circuit 120 may be 1024kb or other set size.
Further, the data compression and decompression apparatus 100 can also decompress compressed data.
Specifically, the data dividing circuit 120 divides the compressed data into a plurality of data streams, then each of the input FIFO memories 111 performs a synchronization operation on the received data streams, and transmits the data streams after the synchronization operation to a connected compression operation execution unit, the plurality of compression operation execution units 112 connected in series in each of the compression operation execution components 110 sequentially perform corresponding decompression sub-operations on the received input data to obtain a decompression result of each data stream, and each of the output FIFO memories 113 is configured to receive the decompression result sent by the connected compression decompression operation execution unit, and output the received decompression result after performing the synchronization operation.
The data compression and decompression device in this embodiment can compress or decompress n input data streams in parallel, and sets FIFO memories at both the input and output ends to perform synchronous operation on the input data streams and the output compression encoding results or decompression results, thereby ensuring that the output results are accurate when a plurality of data streams of data to be compressed are compressed in parallel or the compressed data is decompressed.
Optionally, the input bit width may be set according to the area of the input FIFO memory 111 and the type of data processing performed, where the input bit width is the number of bytes of data acquired by the input FIFO memory at a time. The type of data processing performed includes compressing data or decompressing data. For example, in data compression, the input bit width of the input FIFO memory may be 64 kb. When data decompression is performed, the input bit width of the input FIFO memory can be 16kb and the like. Alternatively, the output bit width may be set according to the area of the output FIFO memory 113 and the type of data processing performed, where the input bit width is the number of bytes of data output from the output FIFO memory at a single time. For example, when data compression is performed, a value such as 16kb of bit width of the FIFO memory is output. When data compression is performed, the input bit width of the output FIFO memory may be 64kb and so on.
In one embodiment, the input FIFO memory 111, the compression/decompression operation execution section 112, and the output FIFO memory 113 are each provided with an end signal transmitter for transmitting an end signal.
Specifically, when the data compression/decompression device 100 performs data compression or decompression, if there is a compression/decompression operation execution component of an uninput data stream in the n compression/decompression operation execution components, the end signal transmitter on the input FIFO memory of the compression/decompression operation execution component of the uninput data stream transmits an end signal to the connected compression/decompression operation execution component, the compression/decompression operation execution component that receives the end signal transmits the end signal back through the installed end signal transmitter until transmitting the end signal to the output FIFO memory, the output FIFO memory of the compression/decompression operation execution component of the uninput data stream outputs the end signal through the installed end signal transmitter, and at this time, the data compression/decompression device 100 terminates the currently performed compression or decompression process.
In this embodiment, the data compression and decompression apparatus triggers the set end signal transmitter to transmit the end signal when no data stream is input during the compression or decompression process of a certain compression and decompression operation executing component, so as to control the compression or decompression process of data, thereby avoiding additional overhead caused by the need of supplementing input data when the data compression or decompression process is finished.
In one embodiment, as shown in fig. 3, the data compression and decompression apparatus 100 may further include a data shuffling operation execution unit 140. The data shuffle operation performing unit 140 is connected to the input FIFO memory 111 of the codec operation performing unit 110. The data shuffling operation execution unit 140 is configured to receive the data shuffling signal and then shuffle the original data stream to obtain a data stream. Alternatively, the original data stream may be from data to be compressed, or compressed data.
Optionally, the data shuffling operation executing unit 140 shuffles the last data in the n original data streams according to a preset rule, so as to obtain n data streams, where the preset rule includes: adjacent m data streams are shuffled, or k data streams are skipped for shuffling, wherein m is a positive integer, and k is a positive integer.
For example, n is 16, m is 4, the respective codec execution blocks 110 are distinguished using sequence numbers 0 to 15, and 1 data shuffling operation is performed during the input of the original data stream. At this time, the data shuffling operation execution unit 140 performs data shuffling on the original data streams of the four adjacent codec operation execution components 110 after receiving the corresponding data shuffling signal, that is, performs data shuffling on the codec operation execution components with sequence numbers of 0 to 3; performing data shuffling on the 4-7 codec operation execution component; performing data shuffling on 8-11 compression and decompression operation execution components; the data shuffling is performed on the 12-15 codec operation execution component.
For example, n is 16, k is 4, the respective codec execution blocks 110 are distinguished using the sequence numbers 0 to 15, the original data streams are also distinguished using the sequence numbers 0 to 15, and 3 times of data shuffling operations are performed in the process of inputting the original data streams. At this time, after receiving the corresponding data shuffle signal, the data shuffle operation performing unit 140 skips over the original data streams of the four codec operation performing units 110 to perform data shuffle, and at this time, the final data stream obtained by the sequence number 0 codec operation performing unit 110 includes 4 sub-data streams, which are corresponding sub-data streams in the data streams having sequence numbers 0, 4, 8, and 12.
It should be clear that if no data shuffle operation is performed on the raw data stream, the raw data stream input into the FIFO is the data stream in the subsequent operation.
The data compression and decompression device in the embodiment can shuffle the input original data stream, and can overcome the problem that when the difference of compression or decompression efficiency of data in the original data stream of each compression and decompression operation execution component is large, the difference of execution time of each compression and decompression operation execution component is large, and the data compression or decompression efficiency is reduced.
In one embodiment, as shown in fig. 4, a memory 115 is connected in series between two adjacent codec operation executing components 112 in each codec operation executing component 110 of the data codec device 100,
a memory 115 is connected in series between the two adjacent codec operation executing components, and is used for storing the output result of the previous codec operation executing component in the corresponding two adjacent codec operation executing components.
Specifically, the subsequent one of the two adjacent codec operation execution sections 112 in the codec operation execution section 110 acquires the output result in the connected memory 115 as input data to execute the corresponding codec or codec sub-operation. It should be clear that this output result is the output result of the preceding codec operation execution section.
In this embodiment, a memory is connected in series between two adjacent codec operation execution units, so that the output results of the codec operation execution units in each codec operation execution component are stored separately, thereby ensuring the accuracy of the execution results of the data streams processed by each codec operation execution component.
In one embodiment, as shown in fig. 5, the data compression and decompression apparatus 100 may further include a control circuit 130, and the control circuit 130 is respectively connected to the data dividing circuit 120 and the compression operation executing component 110. Specifically, the control circuit 130 is used to control the data dividing circuit 120 to perform the dividing operation. The control circuit 130 is configured to control the data dividing circuit 120 to perform a dividing operation on the input data to be compressed or the compressed data according to a preset data size. Optionally, the predetermined data size may be 1024kb or the like. Optionally, the control circuit 130 may be further configured to control the codec operation execution component 110 to execute a codec operation, where the codec operation includes at least one codec sub-operation. Optionally, the control circuit 130 may be further configured to control the decompression operation execution component 110 to execute a decompression operation, where the decompression operation includes at least one decompression sub-operation.
In one embodiment, when data compression is performed, as shown in fig. 6, the compression/decompression operation performing unit 112 connected in series in each compression/decompression operation performing component 110 of the data compression/decompression apparatus 100 includes: a query operation executing unit 1121, a comparison operation executing unit 1122, and an addition operation executing unit 1123, which are connected in series in this order, the addition operation executing unit 1123 being connected to the output FIFO memory 113. Optionally, the comparison operation execution unit 1122 may be further connected to the input FIFO memory 111. Optionally, the query operation executing unit 1121 may be further connected to output the FIFO memory 113.
The data codec device 100 of the present embodiment can control the sequence of the input data stream entering each codec operation execution unit in the codec operation execution unit according to the received control signal. For example, when data compression is performed, the data flow direction is: the query operation performing part 1121 → the compare operation performing part 1122 → the add operation performing part 1123. Accordingly, when data is decompressed, the data stream flow direction is as follows: the comparison operation performing part 1122 → the addition operation performing part 1123 → the query operation performing part 1121.
Alternatively, if the data compression and decompression apparatus 100 only implements a single operation of data compression or decompression, the concatenation order of the respective compression and decompression operation execution components 110 when performing data compression is: the query operation performing section 1121, the comparison operation performing section 1122, and the addition operation performing section 1123 are connected in series in this order. The concatenation order of the individual codec operation execution components 110 when performing data decompression is as follows: the comparison operation performing unit 1122, the addition operation performing unit 1123, and the query operation performing unit 1121 are connected in series in this order.
A query operation executing unit 1121 configured to sequentially obtain an ordering value of each number in the data stream in a preset symbol sequence table, where the symbol sequence table includes a plurality of numbers and an ordering value of each number obtained based on an occurrence probability of the plurality of numbers.
A comparison operation executing unit 1122, configured to access a preset code length boundary table, and sequentially determine a code length of each digit in the data stream according to a sorting value of each digit in the data stream in the symbol sequence table and the preset code length table, where the code length boundary table includes multiple code lengths and a maximum sorting value of each digit of the code length, and the code length table includes multiple preset code lengths.
An adding operation executing unit 1123, configured to obtain a basic value of each digit in the data stream in sequence according to a preset code length basic value table and a code length of each digit in the data stream, add the ranking value of each digit in the data stream to a corresponding basic value to obtain an initial code value of each digit, and then convert each initial code value according to a corresponding code length to obtain a compressed code value of each digit in the data stream, where the code length basic value table includes the basic value of each code length.
Optionally, the comparison operation executing unit 1122 is specifically configured to search for a minimum rank value of the code length boundary table, and determine the code length of the current symbol according to the minimum rank value of the code length boundary table and the code length table.
The data compression and decompression device 100 in this embodiment can sequentially execute the query, comparison and addition operations by the query operation execution unit, the comparison operation execution unit and the addition operation execution unit which are sequentially connected in series, and replace the conventional table look-up operation to compress and encode the data to be compressed. Since the compression efficiency of the compressed data obtained by the data compression method is basically consistent with that of the traditional Huffman coding, for the convenience of expression, the improved Huffman coding is used for expressing the data compression method when the data compression method is mentioned in the following.
Optionally, the symbol sequence table in the above embodiment may be set according to the following steps:
according to the occurrence probability of each digit in the data to be compressed, the digits in the digits to be compressed are arranged in a descending order mode to obtain the ordering value of each digit, and a symbol sequence table is constructed by using each digit and the corresponding ordering value.
Optionally, the code length table in the above embodiment may be set according to the following steps:
firstly, the code length of Huffman coding of each digit in the data to be compressed is taken as the code length of each digit in the data to be compressed. Alternatively, a corresponding Huffman tree may be obtained first according to the occurrence probability of each number in the data to be compressed. And then, according to the path length from the leaf node to the root node corresponding to each digit in the Huffman tree, obtaining the code length of each digit in the data to be compressed. In one example: the number included in the data to be compressed: 10. 20, 30, 40, 50, the corresponding probability of occurrence is: 0.4, 0.1, 0.2, 0.1. The Huffman tree obtained by the control circuit 110 according to the probability of occurrence of each number in the data to be compressed is shown in fig. 7. As can be seen from fig. 7, the path lengths from the leaf nodes to the root nodes corresponding to 10, 20, 30, 40, and 50 are 2, 3, 2, and 3, respectively, and the path lengths from the leaf nodes to the root nodes in the Huffman tree correspond to the coding code lengths of Huffman coding, so the coding code lengths corresponding to 10, 20, 30, 40, and 50 obtained by the coding circuit 130 in this example are 2, 3, 2, and 3, respectively. Optionally, the Huffman coding code length of each digit in the data to be compressed may also be directly obtained. Following the above example, the Huffman codes (the branch pointing to the left sub-tree in the convention Huffman book indicates "0" and the branch pointing to the right sub-tree indicates "1") obtained from the Huffman trees constructed according to the appearance probabilities of 10, 20, 30, 40, and 50 are: 00. 010, 10, 11, 011. It should be clear that the present embodiment performs compression coding with the code length of each digit consistent with Huffman coding.
Then, the types of the code length of each digit in the data to be compressed are counted, and the code length tables are formed by the code lengths of all the types in the data to be compressed. Optionally, the code lengths in the code length table are arranged in an ascending order, and the sequence numbers are used to sequentially identify the respective code lengths arranged in the ascending order.
Optionally, the code length boundary table in the above embodiment may be set according to the following steps:
firstly, a symbol sequence table and a code length of each digit in the symbol sequence table are obtained. And then searching the maximum sorting value corresponding to each code length in the symbol sequence table, and constructing the code length boundary table by using the maximum sorting values, wherein the maximum sorting value is the maximum value of the sorting values of the numbers of the various code lengths. Further, the maximum sorting values in the code length boundary table are sorted in an ascending order to obtain the code length boundary table. Furthermore, the sequence numbers corresponding to the code length table are used for identifying each sequencing value in the code length boundary table in ascending sequence.
Optionally, the code length basic value table in the above embodiment may be set according to the following steps:
and subtracting the sorting value from the coding value corresponding to each maximum sorting value in the code length boundary table to obtain a basic value of each coding code length. Optionally, the respective base values in the code length base value table are sorted in ascending order, and the respective base values in the code length base value table sorted in ascending order are identified by using the sequence numbers corresponding to the code length table.
Further, the encoding value of each digit in the data to be compressed is set by the following steps:
sequentially accessing the digits in the code length sequence list, and if the code length of the current digit is the same as that of the digit of the last sequencing value, adding 1 to the code value of the digit of the last sequencing value to obtain the code value of the current digit; and if the code length of the current digit is different from that of the digit of the last sorting value, adding 1 to the code value of the digit of the last sorting value to obtain a numerical value supplementary mantissa 0 to obtain the code value of the current digit. And circularly executing the step of setting the coding value until the coding value of the last digit in the symbol sequence table is obtained.
For example: in the above example, 40 codes the number of the largest rank value among the numbers having a code length of 2 bits whose rank value is 2, and 50 codes the number of the largest rank value among the numbers having a code length of 3 bits whose rank value is 4. And arranging the 2 and 4 in ascending order to obtain a code length boundary table of [2, 4 ]. In the above example, 40 is the number of the largest rank value among the numbers having a code length of 2 bits, the rank value thereof is 2, and the code value thereof is 10 (binary, corresponding to a decimal number of 2), and therefore, a base value of 2 bits having a code length of 0 can be obtained in this example; 50 is the number of the largest rank value among the numbers having a code length of 3 bits, the rank value thereof is 4, and the code value thereof is 111 (binary, corresponding to a decimal value of 7), so that a base value of 4 bits having a code length of 3 can be obtained in this example. The code length basis value table obtained by the encoding circuit 130 in this example is [0, 3 ].
Accordingly, when data decompression is performed, the query operation executing unit 1122 of the data compression and decompression apparatus 100 shown in fig. 6 may be configured to sequentially obtain an ordered value of each number in the data stream in a preset symbol sequence table, where the symbol sequence table includes a plurality of numbers and the ordered value of each number obtained based on the occurrence probability of the plurality of numbers.
The comparison operation executing unit 1122 may be configured to access a preset code value range table and a preset code length table, and sequentially obtain the code length of each code value in the input data stream, where the code value range table includes the maximum code value of multiple code lengths, and the code length code includes the multiple code lengths.
The adding operation executing unit 1123 may be configured to sequentially obtain an effective value of each encoded value in a data stream as an initial encoded value of each encoded value, obtain a base value of each encoded value in the data stream according to an encoded code length of each encoded value in the data stream and a preset code length base value table, and use a difference value between the initial encoded value and the base value of each encoded value in the data stream as a sorting value of each encoded value in the data stream, where the code length base value table includes the base value of each encoded code length.
The query operation executing part 1121 may be configured to query a preset symbol sequence table according to an ordering value of each coded value in the data stream to obtain a number corresponding to each coded value in the data stream, where the symbol sequence table includes a plurality of numbers and an ordering value of each number obtained based on an occurrence probability of the plurality of numbers.
The data compression and decompression device 100 in this embodiment can sequentially execute comparison, addition, query, and operation by the comparison operation execution unit, the addition operation execution unit, and the query operation execution unit, which are sequentially connected in series, to replace the conventional table lookup operation to decode the compressed data, because the data amount in the used symbol sequence table, the used coding value range table, the used code length table, and the used code length basic value table is small, the addition operation is performed, and the operation speed is high, the data compression and decompression device 100 can efficiently perform data compression.
The symbol sequence table, the code length table, and the code length basic value table used in this embodiment are consistent with the data compression process, and specific setting modes thereof may be referred to the above embodiments, which are not described in detail herein.
Alternatively, the encoding value range table may be set by:
acquiring the coding value of each digit in the symbol sequence table; and searching the maximum code value of each code length in the symbol sequence list, and then constructing a code value range table by using the maximum code values. Further, the code values in the code value range table are arranged in ascending order. Alternatively, the code values in the code value range table in the ascending order are represented using symbols corresponding to the code length table.
The method for setting the coded value of each digit in the implementation has the advantages of simple implementation, low error probability and strong regularity by simple operations of adding 1 or adding 1 to complement the mantissa 0, is easy to be converted into the data coding implementation form for acquiring the coded value of the digit in the form of table look-up and addition, and is favorable for improving the efficiency and the accuracy of data compression.
In an alternative embodiment, as shown in fig. 8, the codec operation execution unit 112 in each codec operation execution unit 110 of the data codec device 100 includes: and a run-length encoding execution unit 1124 connected to the input FIFO memory. Further, the run-length encoding execution part 1124 may be further connected to the output FIFO memory.
In one optional embodiment, when data compression is performed, the run-length encoding execution unit 1124 in the data compression and decompression apparatus 100 shown in fig. 8 is configured to divide the input data stream according to a preset run-length bit width and a specified number and other numbers in the input data stream to obtain a data group; performing run-length coding on other numbers except the initial number in the data group to obtain the run length of the data group, and converting the initial number of the data group according to a preset numerical bit width to obtain a coded value of the initial number in each data group; and taking the coded value and the run length of the initial digit in the data group as the coded value of the data group, and writing the coded value of the data group according to the sequence of the data group in the input data stream.
For example, the input data stream is {0,0,0,0,2,0,3,0,0}, the run bit width is set to 2 bits, the designated number is 0, and the preset value bit width is 8 bits.
The data stream segmentation results are:0,0,0,0,2,0,3,0,0. The encoding result is:00000000,11,00000010, 01,00000011,10. Wherein, run 11 represents three 0 s arranged consecutively in the input data; a 0 in the input data is represented by a run 01; two 0 s arranged consecutively in the input data are denoted by a run 10.
It should be clear that the run-length coding execution unit 1124 may perform run-length coding on the specified number of the data group and convert the start number of the data group according to the preset value bit width after dividing a data stream, and of course, the optional run-length coding execution unit 1124 may perform run-length coding on the specified number of the data group and convert the start number of the data group according to the preset value bit width after dividing a data stream to obtain all data groups. It can be flexibly selected according to the requirement, and the embodiment is not particularly limited.
The data compression and decompression device of the embodiment can compress a large number of continuously appearing numbers by performing run length coding on the designated numbers in the data to be compressed and using the run length to represent the continuously arranged designated numbers, thereby effectively saving bandwidth resources.
In one optional embodiment, when data decompression is performed, the run-length encoding execution component 1124 in the data compression and decompression apparatus 100 shown in fig. 8 may be further configured to obtain a decompressed array according to the run length in the data stream, convert the digits in the decompressed array except for the run length to obtain the decompressed array significant digits, decode the run length in the decompressed array to a specified digit, and use the significant digits and the specified digit of the decompressed array as the decompressed digits of the decompressed array.
For example, the input data stream is: 00000000,11,00000010,01,00000011,10. Wherein, run 11 represents three 0 s arranged consecutively in the input data; a 0 in the input data is represented by a run 01; two 0 s arranged consecutively in the input data are denoted by a run 10.
The data stream segmentation results are:00000000,11,00000010,01,00000011,10。the decompression results obtained were: 0,0,0,0,2,0,3,0,0.
The data compression and decompression device of the embodiment can compress a large number of continuously appearing numbers by performing run length coding on the designated numbers in the data to be compressed and using the run length to represent the continuously arranged designated numbers, thereby effectively saving bandwidth resources.
In one embodiment, when performing data compression, as shown in fig. 9, the compression/decompression operation execution unit 112 connected in series in each compression/decompression operation execution component 110 of the data compression/decompression apparatus 100 may further include: and a replacement operation execution unit 1125 disposed between the run-length encoding execution unit and the output FIFO memory. Optionally, the replacement operation performing part 1125 may be further connected to an output FIFO memory.
Specifically, the replacement operation executing section 1125 is configured to replace the encoded value of the data group whose start value is the designated number and whose run length is the maximum value, with a preset number, at the time of data compression by the data compression/decompression apparatus 100. It should be clear that the encoded value of the data group that specifies a number and the run is the maximum value when the specified number is a definite number and the run bit width is definite is a combination of the definite number plus the run. That is, the replacement operation performing part 1125 actually replaces the fixed number plus run combination in the resulting run-length code with the preset number.
For example: taking the above example in mind, the resulting run-length encoding results are:00000000,11,00000010,01,00000011,10, Preset use01000000 (binary digits, corresponding to 64 decimal) replaces the coded value of the data group whose start value is the designated number and whose run is the maximum value.In this example, the replace operation execution part 1125 actually replaces the run-length encoding result with 0100000000000000,11
Specifically, when the data compression/decompression apparatus 100 decompresses data and obtains the data, the replacement operation executing part 1125 is configured to obtain the encoding code length of the current encoding value according to the minimum encoding value not less than the current encoding value in the encoding value range table and a preset code length table. It should be clear that the encoded value of the data group that specifies a number and the run is the maximum value when the specified number is a definite number and the run bit width is definite is a combination of the definite number plus the run. That is, the replacement operation performing part 1125 actually replaces the fixed number plus run combination in the resulting run-length code with the preset number.
For example: taking the above example as a support, the result obtained after performing the replacement operation on the run-length encoding result by using the preset number is:01000000,00000010,01,00000011,10. When decompressing it, it needs to first preset number01000000Replacement of00000000,11。Obtaining compressed coding result of run-length coding00000000,11,00000010,01,00000011,10. And then decoding the result by using run-length coding to obtain decompressed data. The specific process of decoding the result by using run-length coding can be referred to the above-mentioned embodiment of run-length decoding, and will not be described in detail here.
The data compression and decompression device of the embodiment further replaces a fixed combination of a number and a run length in the compression and encoding result by a preset number on the basis of performing the run length encoding on the designated number to obtain the compression and encoding result, and the compression and encoding result can reduce the run bit width of bytes once the run length encoding result is replaced by a large number of the combination of the number and the run length, so that the scheme can more effectively save bandwidth resources.
In one embodiment, as shown in fig. 10, the codec operation execution unit 112 in the codec operation execution components 110 of the data codec device 100 may include: the run-length encoding execution unit 1124, the replacement operation execution unit 1125, the query operation execution unit 1121, the comparison operation execution unit 1122, and the addition operation execution unit 1123 are sequentially connected in series, and the addition operation execution unit is connected to the output FIFO memory. Alternatively, the replacement operation execution section 1125 may be connected to the input FIFO memory 111. Optionally, the run-length coding execution unit 1124 may be further connected to the comparison operation execution unit 1122. Optionally, the query operation executing unit 1121 may also be connected to the output FIFO memory 130.
The data codec device 100 of the present embodiment can control the sequence of the input data stream entering each codec operation execution unit in the codec operation execution unit according to the received control signal. For example, when data compression is performed, the data flow direction is: the run-length encoding execution part 1124 → the replacement operation execution part 1125 → the query operation execution part 1121 → the comparison operation execution part 1122 → the addition operation execution part 1123. Accordingly, when data is decompressed, the data stream flow direction is as follows: the replacement operation performing part 1125 → the run-length encoding performing part 1124 → the comparison operation performing part 1122 → the addition operation performing part 1123 → the query operation performing part 1121.
It should be clear that if the apparatus is only for realizing a single operation of data compression or decompression, the serial relationship among the program code executing part 1124, the replacing operation executing part 1125, the inquiring operation executing part 1121, the comparing operation executing part 1122 and the adding operation executing part 1123 in each of the compression/decompression operation executing components 110 of the data compression/decompression apparatus 100 is as follows: the run-length encoding execution unit 1124, the replacement operation execution unit 1125, the query operation execution unit 1121, the comparison operation execution unit 1122, and the addition operation execution unit 1123 are sequentially connected in series. When data decompression is performed, the serial relationship among the run-length encoding executing component 1124, the replacing operation executing component 1125, the inquiring operation executing component 1121, the comparing operation executing component 1122, and the adding operation executing component 1123 in each of the decompression operation executing components 110 of the data decompression apparatus 100 is as follows: a replacement operation execution part 1125, a run-length encoding execution part 1124, a comparison operation execution part 1122, an addition operation execution part 1123, and a query operation execution part 1121.
Further, the data compression/decompression apparatus 100 shown in fig. 10 may also select whether to set the replacement operation execution part 1125 according to actual needs. If the operation executing part 1125 is not configured, the run-length encoding executing part 1124 in fig. 10 needs to be configured between the input FIFO 111 and the query operation executing part 1121 in order to implement the corresponding data compression operation. Further, the run-length encoding execution unit 1124 may be further connected to the comparison operation execution unit 1122 to implement the corresponding data decompression operation.
Further, the inquiry operation executing section 1121 and the comparison operation executing section 1122 in the data compression/decompression apparatus 100 shown in fig. 10 may be connected to the input FIFO memory 111. The run-length encoding execution part 1124 and the replacement operation execution part 1125 in the apparatus may be connected to the output FIFO memory 113. At this time, the data compression and decompression apparatus 100 may select a specific sub-operation performed when the received data stream is compressed or decompressed, according to the received control signal.
For example, when the apparatus needs to perform the run-length addition replacement in combination with the improved Huffman coding, the data compression/decompression apparatus 100 processes the received data stream in the order of the run-length coding execution part 1124 → the replacement operation execution part 1125 → the query operation execution part 1121 → the comparison operation execution part 1122 → the addition operation execution part 1123. Specifically, when the data compression and decompression apparatus 100 performs run-length addition replacement and performs data compression in combination with improved Huffman coding, each of the compression and decompression operation executing components is specifically configured to:
a run-length encoding execution unit 1124 configured to divide an input data stream according to a preset run-length bit width and a designated number and other numbers in the input data stream to obtain a data group; performing run-length coding on other numbers except the initial number in the data group to obtain the run length of the data group, and converting the initial number of the data group according to a preset numerical bit width to obtain a coded value of the initial number in each data group; and taking the coded value and the run length of the initial digit in the data group as the coded value of the data group, and writing the coded value of the data group according to the sequence of the data group in the input data stream.
And a replacing operation executing part 1125, configured to obtain the encoded values of the data sets, and replace, by using a preset number, the encoded values of the data sets whose start values are the designated numbers and whose runs are the maximum values, so as to obtain a replacing code of the data stream.
A query operation executing unit 1121, configured to obtain the replacement code of the data stream, and sequentially obtain the ranking value of each digit in the replacement code of the data stream in a preset symbol sequence table, where the symbol sequence table includes a plurality of digits and the ranking value of each digit obtained based on the occurrence probability of the plurality of digits.
A comparison operation executing unit 1122, configured to access a preset code length boundary table, and sequentially determine the code length of each digit according to the ordering value of each digit in the replacement code of the data stream in the symbol sequence table and the preset code length table, where the code length boundary table includes multiple code lengths and each maximum ordering value of the digits of the code length, and the code length table includes multiple preset code lengths.
An adding operation executing unit 1123, configured to obtain a base value of each digit in the replacement code of the data stream in sequence according to a preset code length base value table and a code length of each digit in the replacement code of the data stream, add the ranking value of each digit in the replacement code of the data stream to a corresponding base value to obtain an initial code value of each digit in the replacement code, and then convert the initial code value according to the corresponding code length to obtain a compressed code value of each digit in the replacement code, where the code length base value table includes the base value of each code length.
Accordingly, when the apparatus needs to perform the run-length addition replacement in combination with the improved Huffman decoding, the data compression/decompression apparatus 100 processes the received data stream in the order of the replacement operation performing part 1125 → the run-length encoding performing part 1124 → the comparison operation performing part 1122 → the addition operation performing part 1123 → the query operation performing part 1121. Specifically, when the data compression and decompression apparatus 100 performs run-length addition replacement and performs data decompression by combining with improved Huffman coding, each of the compression and decompression operation executing components is specifically configured to:
the replacing operation executing unit 1125 is configured to replace a preset number in the data stream with a designated number and a preset run, where the preset run is a maximum value corresponding to a preset run bit width.
The run-length encoding execution component 1124 is configured to obtain a decompressed array according to a run length in the acquired data, convert numbers in the decompressed array except the run length to obtain decompressed array significant digits, decode the run length in the decompressed array to obtain designated numbers, and use the decompressed array significant digits and the designated numbers as intermediate encoding results of the data stream, where the intermediate encoding results include a plurality of intermediate encoding values.
The comparison operation executing unit 1122 is configured to obtain the intermediate coding result, access a preset coding value range table and a preset code length table, and sequentially obtain a code length of each intermediate coding value in the intermediate coding result, where the coding value range table includes a maximum coding value of multiple coding code lengths, and the code length code includes the multiple coding code lengths.
An adding operation executing unit 1123, configured to sequentially obtain an effective value of each intermediate coding value in the intermediate coding result as an initial coding value of each intermediate coding value, obtain a base value of each intermediate coding value in the intermediate coding result according to a coding code length of each intermediate coding value in the intermediate coding result and a preset code length base value table, and use a difference value between the initial coding value and the base value of each intermediate coding value in the intermediate coding result as a ranking value of each intermediate coding value in the intermediate coding result, where the code length base value table includes the base value of each coding code length.
A query operation executing unit 1121 configured to query a preset symbol sequence table according to the ranking value of each code value in the intermediate code result to obtain a number corresponding to each code value in the intermediate code result, where the symbol sequence table includes a plurality of numbers and a ranking value of each number obtained based on an occurrence probability of the plurality of numbers.
For example, the apparatus needs to perform only run-length encoding to achieve data compression, and the data compression and decompression apparatus 100 can control the data stream to enter the run-length encoding execution unit 1124 to perform the relevant operations, and then directly send the obtained compressed encoded data to the output FIFO memory.
Accordingly, the apparatus needs to perform only run-length encoding to realize data decompression, and the data compression and decompression apparatus 100 can control the data stream to enter the run-length encoding execution unit 1124 for performing the relevant operations, and then directly send the obtained decompressed data to the output FIFO memory.
It should be noted that, the above-mentioned specific modes of performing run-length addition replacement and performing data compression in combination with improved Huffman coding, and performing only run-length coding is only two data compression modes that can be realized by the data compression and decompression apparatus of this embodiment, the apparatus may also flexibly combine the apparatus in different compression and decompression execution components based on the user's requirements to realize various data compression schemes, and the specific implementation form may refer to the content in the above-mentioned embodiment on the basis of flexibly selecting the compression and decompression execution components, so that a specific data compression scheme may be obtained, which is not described in detail herein.
The data compression device in this embodiment may implement different data compression schemes by controlling different compression/decompression operation executing components to execute corresponding compression sub-operations according to different requirements.
Based on the same inventive concept, as shown in fig. 11, the present application further proposes a data compression method, which is applied to the data compression/decompression apparatus, and the method specifically includes:
step S101, dividing data to be compressed into a plurality of data streams.
Specifically, the data dividing circuit 120 divides data to be compressed into a plurality of data streams. Alternatively, the size of the data stream may be 1024 kb. Alternatively, the size of the data stream may be determined according to the size of the data to be compressed and the number of the compression/decompression performing components 110 in the data compression/decompression apparatus 100.
Step S102, acquiring n data streams, performing synchronous operation on the n data streams, and compressing the n data streams after the synchronous operation in parallel to obtain n compression coding results, wherein n is a positive integer.
Specifically, n data streams are obtained and input into n codec executing components 110 of the data codec 100, and after performing a synchronization operation, the n data streams are parallel-executed to obtain n codec results. More specifically, n data streams are obtained and input into the input FIFO memory 111 of each codec component 110, after the input FIFO memory 111 performs a synchronization operation on the received data streams, the n data streams after the synchronization operation are sent to the codec executing components connected thereto, and after each codec executing component executes a corresponding codec in sequence, n codec results are obtained.
Step S103, the n compression codes are synchronized, and the n compression coding results after the synchronization operation are written out according to the sequence and/or the position of each data stream in the data to be compressed.
Specifically, the compression/decompression operation executing component that obtains n compression-encoded values transmits the obtained compression-encoded results to the output FIFO memories connected thereto, and after each output FIFO memory performs a synchronization operation on the received compression-encoded results, the received compression-encoded results are written out according to the order and/or position of each data stream in the data to be compressed.
Steps 101-S103 are repeatedly performed until the number of single output compression encoding results is less than n. Step S104 is then executed to terminate acquiring the data stream.
Specifically, if the number of the compression-encoding results output by the n compression-decompression executing components 110 of the data compression-decompression apparatus 100 at a time is less than n, the data stream acquisition is terminated.
Correspondingly, as shown in fig. 12, the present application further proposes a data decompression method, which is also applied to the data compression/decompression apparatus, and the method specifically includes:
s201, the compressed data is divided into a plurality of data streams.
Specifically, the data dividing circuit 120 divides the compressed data into a plurality of data streams. Alternatively, the size of the data stream may be 1024 kb. Alternatively, the size of the data stream may be determined according to the size of the compressed data and the number of the compression/decompression performing components 110 in the data compression/decompression apparatus 100.
S202, acquiring n data streams, performing synchronous operation on the n data streams, and decompressing the n data streams after the synchronous operation in parallel to obtain n decompressed sub-results, wherein n is a positive integer.
Specifically, n data streams are obtained and input into n codec executing components 110 of the data codec device 100, and after performing a synchronization operation, the compression operation is performed in parallel to obtain n codec results. More specifically, n data streams are obtained and input into the input FIFO memory 111 of each codec component 110, after the input FIFO memory 111 performs a synchronization operation on the received data streams, the n data streams after the synchronization operation are sent to the codec executing components connected thereto, and after each codec executing component executes a corresponding codec operation in sequence, n codec results are obtained.
S203, synchronously operating the n decompressed numbers, and writing the n decompressed sub-results after the synchronous operation into the decompressed sub-results according to the sequence and/or position of each data stream in the data to be compressed.
Specifically, the compressing and decompressing operation executing component which obtains n decompressed sub-results transmits the decompressed sub-results obtained by the component to the output FIFO memories connected with the component, and after the output FIFO memories synchronously operate the received decompressed sub-results, the received decompressed sub-results are written out according to the sequence and/or position of each data stream in the compressed data.
And repeating the steps from the acquisition of the n data streams to the writing of the n decompressed sub-results until the number of the single decompressed sub-results is less than n, and then executing S204 to terminate the acquisition of the data streams.
Specifically, if the number of the sub-decompression results output by the n codec executing components 110 of the data codec device 100 at a time is less than n, the data stream acquisition is terminated.
The data compression method of this embodiment can compress or decompress n input data streams in parallel, and sets FIFO memories at both the input and output ends, and performs synchronous operation on both the input data streams and the output compression coding values or decompression results, thereby ensuring that the output results are accurate when a plurality of data streams of data to be compressed are compressed in parallel or the compressed data are decompressed.
As an optional implementation manner, as shown in fig. 13, when performing data compression, before step S102, the method further includes:
step S105, obtaining n original data streams, and after receiving the data shuffling signal, shuffling last data in the n original data streams to obtain n data streams, where the last data is data in each original data stream that has not been obtained after receiving the data shuffling signal.
In this embodiment, the data stream obtained by dividing the data to be compressed by the data dividing circuit is referred to as an original data stream, and the data stream output from the input FIFO memory is referred to as a data stream. Specifically, the data shuffling operation execution unit 140 of the data compression/decompression apparatus 100 shuffles the last data in the n original data streams after receiving the data shuffling signal, and obtains n data streams.
Similarly, when data decompression is performed, as shown in fig. 14, step S105 may be included before step S202. At this time, a data stream obtained by dividing the compressed data by the data dividing circuit is referred to as an original data stream.
Further, step S105 may include: shuffling the last-stage data in the n original data streams according to a preset rule to obtain n data streams, wherein the preset rule comprises: adjacent m data streams are shuffled, or k data streams are skipped and shuffled, wherein m is a positive integer, m is less than or equal to n, k is a positive integer, and m is less than n.
Specifically, the data shuffling operation execution unit 140 shuffles the last data in the n original data streams according to a preset rule, so as to obtain n data streams.
The present embodiment may overcome the problem that when the difference of the compression efficiency of the data in the original data stream of each codec execution component is large, the difference of the execution time of each codec execution component is large, and the data compression efficiency is reduced by shuffling the data stream.
In one embodiment, the data compression method or the data decompression method may further include: and if the number of the acquired original data streams and/or the acquired data streams is less than n, outputting an end signal. The end signal is used to terminate the acquisition of the data stream.
Specifically, when the data compression/decompression device 100 performs data compression or decompression, if there is a compression/decompression operation execution component of an uninput data stream in the n compression/decompression operation execution components, the end signal transmitter on the input FIFO memory of the compression/decompression operation execution component of the uninput data stream transmits an end signal to the connected compression/decompression operation execution component, the compression/decompression operation execution component that receives the end signal transmits the end signal back through the installed end signal transmitter until transmitting the end signal to the output FIFO memory, the output FIFO memory of the compression/decompression operation execution component of the uninput data stream outputs the end signal through the installed end signal transmitter, and at this time, the data compression/decompression device 100 terminates the currently performed compression or decompression process.
In one embodiment, as shown in fig. 15, step S102 may include:
and S1021a, sequentially acquiring the ranking values of the numbers in the data stream in a preset symbol sequence table, wherein the symbol sequence table comprises a plurality of numbers and the ranking values of the numbers obtained based on the occurrence probabilities of the numbers.
Specifically, the query operation executing part 1121 sequentially obtains the ranking value of each number in the data stream in a preset symbol sequence table, where the symbol sequence table includes a plurality of numbers and the ranking value of each number obtained based on the occurrence probability of the plurality of numbers.
S1022a, accessing a preset code length boundary table, and sequentially determining a code length of each digit in the data stream according to an ordering value of each digit in the data stream in the symbol sequence table and the preset code length table, where the code length boundary table includes multiple code lengths and a maximum ordering value of each digit of the code lengths, and the code length table includes multiple preset code lengths.
Specifically, the comparison operation executing unit 1122 is configured to access a preset code length boundary table, and sequentially determine the code length of each digit in the data stream according to the sorting value of each digit in the data stream in the symbol sequence table and the preset code length table, where the code length boundary table includes multiple code lengths and each maximum sorting value of the digits of the code length, and the code length table includes multiple preset code lengths.
Further, the comparison operation executing unit 1122 first searches for the minimum sorting value of the code length boundary table, where the sorting value is not less than the current number; and then determining the code length of the current symbol according to the minimum sorting value of which the sorting value is not less than the current number in the code length boundary table and the code length table.
S1023a, sequentially obtaining the basic value of each digit in the data stream according to a preset code length basic value table and the code length of each digit in the data stream, where the code length basic value table includes the basic value of each code length. And adding the sorting value of each digit in the data stream and the corresponding basic value to obtain an initial coding value of each digit, and then converting each initial coding value according to the corresponding coding code length to obtain the compressed coding value of each digit in the data stream.
Specifically, the addition operation executing unit 1123 obtains a basic value of each digit in the data stream in sequence according to a preset code length basic value table and a code length of each digit in the data stream, adds the ranking value of each digit in the data stream to a corresponding basic value to obtain an initial code value of each digit, and then converts each initial code value according to a corresponding code length to obtain a compressed code value of each digit in the data stream, where the code length basic value table includes the basic value of each code length.
Accordingly, in one embodiment, as shown in fig. 16, when decompressing the compressed data obtained by the data compression method shown in fig. 15, step S202 may include:
s2021a, accessing a preset code value range table and a preset code length table, and sequentially obtaining the code length of each code value in the input data stream, where the code value range table includes the maximum code value of multiple code lengths, and the code length code includes the multiple code lengths.
Specifically, the comparison operation executing unit 1122 accesses a preset code value range table and a preset code length table, and sequentially obtains the code length of each code value in the input data stream, where the code value range table includes the maximum code value of multiple code lengths, and the code length code includes the multiple code lengths.
Further, the encoding code length of the current encoding value is obtained according to the minimum encoding value not less than the current encoding value in the encoding value range table and a preset code length table.
Specifically, the comparison operation executing unit 1122 obtains the code length of the current code value according to the minimum code value not less than the current code value in the code value range table and a preset code length table.
S2022a, sequentially obtaining an effective value of each coding value in a data stream as an initial coding value of each coding value, obtaining a base value of each coding value in the data stream according to a coding code length of each coding value in the data stream and a preset code length base value table, and taking a difference between the initial coding value and the base value of each coding value in the data stream as a ranking value of each coding value in the data stream, where the code length base value table includes the base value of each coding code length.
Specifically, the addition operation executing unit 1123 sequentially obtains an effective value of each encoded value in the data stream as an initial encoded value of each encoded value, obtains a base value of each encoded value in the data stream according to an encoded code length of each encoded value in the data stream and a preset code length base value table, and uses a difference value between the initial encoded value and the base value of each encoded value in the data stream as a sorting value of each encoded value in the data stream, where the code length base value table includes the base value of each encoded code length.
S2023a, querying a preset symbol sequence table according to the ranking value of each encoded value in the data stream to obtain a number corresponding to each encoded value in the data stream, where the symbol sequence table includes a plurality of numbers and ranking values of each number obtained based on occurrence probabilities of the plurality of numbers.
Specifically, the query operation executing part 1121 queries a preset symbol sequence table according to the ranking value of each encoded value in the data stream to obtain a number corresponding to each encoded value in the data stream, where the symbol sequence table includes a plurality of numbers and ranking values of the numbers obtained based on the occurrence probability of the numbers.
In the data compression method or the data decompression method of the present embodiment, the symbol sequence table, the code length boundary table/coded value range table, the code length table, and the code length basic value table are used with a small data amount, and therefore, the data compression or data decompression using these tables with a small data amount is efficient.
In another embodiment, as shown in fig. 17, step S102 may also include:
s1021b, according to the preset run bit width and the designated number and other numbers in the input data stream, dividing the input data stream to obtain a data set.
S1022b, run-length coding is performed on the other numbers except the initial number in the data set, so as to obtain the run-length of the data set.
And S1023b, converting the initial digit of the data group according to a preset numerical value bit width to obtain the coded value of the initial digit in each data group.
S1024b, using the coded value and the run length of the start number in the data group as the coded value of the data group, and writing the coded value of the data group according to the order of the data group in the input data stream.
Specifically, the run-length encoding execution section 1124 divides the input data stream according to a preset run-length bit width, and a designated number and other numbers in the input data stream, to obtain a data group; performing run-length coding on other numbers except the initial number in the data group to obtain the run length of the data group, and converting the initial number of the data group according to a preset numerical bit width to obtain a coded value of the initial number in each data group; and taking the coded value and the run length of the initial digit in the data group as the coded value of the data group, and writing the coded value of the data group according to the sequence of the data group in the input data stream.
Accordingly, in one embodiment, as shown in fig. 18, when decompressing the compressed data obtained by the data compression method shown in fig. 17, step S202 may include:
s2021b, obtaining the decompressed array according to the run in the acquired data stream.
S2022b, converting the digits except the run in the decompression array to obtain the effective digits of the decompression array, and decoding the run in the decompression array into the designated digits; and taking the effective number and the designated number of the decompression array as the decompression number of the decompression array.
S2023b, writing the decompressed numbers of the decompressed arrays in sequence according to the order of the decompressed arrays in the data stream.
Specifically, the run-length encoding execution unit 1124 obtains a decompressed array from the run length in the data stream, converts the digits in the decompressed array except for the run length to obtain the decompressed array significant digits, decodes the run length in the decompressed array to the designated digits, and takes the significant digits and the designated digits of the decompressed array as the decompressed digits of the decompressed array.
The data compression method of the embodiment performs run length coding on the designated numbers, and uses the run length to represent the designated numbers which are continuously arranged.
In another embodiment, as shown in fig. 19, after step S1024b, the method further includes:
s1025b, replacing the encoded value of the data group whose start value is the designated number and whose run is the maximum value with a preset value.
Specifically, the replacement operation performing section 1125 replaces the encoded value of the data group whose start value is the designated number and whose run is the maximum value, with a preset number. It should be clear that the encoded value of the data group that specifies a number and the run is the maximum value when the specified number is a definite number and the run bit width is definite is a combination of the definite number plus the run. That is, the replacement operation performing part 1125 actually replaces the fixed number plus run combination in the resulting run-length code with the preset number.
For example: the obtained run-length coding result is:00000000,11,00000010,01,00000011,10, Preset use01000000 (binary digits, corresponding to 64 decimal) replaces the coded value of the data group whose start value is the designated number and whose run is the maximum value. In this example, the replace operation execution part 1125 actually replaces the run-length encoding result with 0100000000000000,11
Accordingly, in one embodiment, as shown in fig. 20, when decompressing the compressed data obtained by the data compression method shown in fig. 19, before step S2021b, the method may include:
s2024b, replacing the preset number in the data stream with the designated number and a preset run, where the preset run is a maximum value corresponding to a preset run bit width.
Specifically, the replacing operation executing part 1125 obtains the code length of the current code value according to the minimum code value not less than the current code value in the code value range table and a preset code length table. It should be clear that the encoded value of the data group that specifies a number and the run is the maximum value when the specified number is a definite number and the run bit width is definite is a combination of the definite number plus the run. That is, the replacement operation performing part 1125 actually replaces the fixed number plus run combination in the resulting run-length code with the preset number.
For example: taking the above example as a support, the result obtained after performing the replacement operation on the run-length encoding result by using the preset number is:01000000,00000010,01,00000011,10. When decompressing it, it needs to first preset number01000000Replacement of00000000,11。Obtaining compressed coding result of run-length coding00000000,11,00000010,01,00000011,10. And then decoding the result by using run-length coding to obtain decompressed data. The specific process of decoding the result by using run-length coding can be referred to the above-mentioned embodiment of run-length decoding, and will not be described in detail here.
The data compression method of the embodiment further replaces a fixed combination of a number and a run length in the compression coding result by a preset number on the basis of obtaining the compression coding result by performing the run length coding on the designated number, and the compression coding result can reduce the run bit width by a byte once the run length coding result is replaced by a large number of the combination of the number and the run length in the compression coding result obtained by the run length coding, so that the scheme can more effectively save bandwidth resources.
In one embodiment, as shown in fig. 21, step S102 may also include:
s1021c, dividing the input data stream according to the preset run bit width and the appointed number and other numbers in the input data stream to obtain a data group; performing run-length coding on other numbers except the initial number in the data groups to obtain the run length of the data groups, and performing binary conversion on the initial number of the data groups according to a preset numerical bit width to obtain a coded value of the initial number in each data group; and taking the coded value and the run length of the initial digit in the data group as the coded value of the data group, and writing the coded value of the data group according to the sequence of the data group in the input data stream.
Specifically, the run-length encoding execution section 1124 divides the input data stream according to a preset run-length bit width, and a designated number and other numbers in the input data stream, to obtain a data group; performing run-length coding on other numbers except the initial number in the data group to obtain the run length of the data group, and converting the initial number of the data group according to a preset numerical bit width to obtain a coded value of the initial number in each data group; and taking the coded value and the run length of the initial digit in the data group as the coded value of the data group, and writing the coded value of the data group according to the sequence of the data group in the input data stream.
S1022c, obtaining the encoded value of the data set, and replacing the encoded value of the data set whose start value is the designated number and whose run is the maximum value with a preset value, to obtain a replacement code of the data stream.
Specifically, the replacement operation executing part 1125 obtains the encoded values of the data sets, and replaces the encoded values of the data sets having the start value of the designated number and the run length of the maximum value with a preset number, to obtain the replacement code of the data stream.
And S1023c, acquiring the replacement code of the data stream, and sequentially acquiring the ranking value of each digit in the replacement code of the data stream in a preset symbol sequence list, wherein the symbol sequence list comprises a plurality of digits and the ranking value of each digit obtained based on the appearance probability of the digits.
Specifically, the query operation executing part 1121 obtains the replacement code of the data stream, and sequentially obtains the ranking value of each digit in the replacement code of the data stream in a preset symbol sequence table, where the symbol sequence table includes a plurality of digits and the ranking value of each digit obtained based on the occurrence probability of the plurality of digits.
S1024c, accessing a preset code length boundary table, and sequentially determining the code length of each digit according to the ordering value of each digit in the replacement code of the data stream in the symbol sequence table and the preset code length table, wherein the code length boundary table contains various code lengths and the maximum ordering value of each digit of the code lengths, and the code length table contains various preset code lengths.
Specifically, the comparison operation executing unit 1122 accesses a preset code length boundary table, and sequentially determines the code length of each digit according to the ordering value of each digit in the replacement code of the data stream in the symbol sequence table and the preset code length table, where the code length boundary table contains multiple code lengths and the maximum ordering value of each digit of the code length, and the code length table contains multiple preset code lengths.
S1025c, sequentially obtaining a basic value of each digit in the replacement code of the data stream according to a preset code length basic value table and a code length of each digit in the replacement code of the data stream, adding the ranking value of each digit in the replacement code of the data stream to the corresponding basic value to obtain an initial code value of each digit in the replacement code, and then converting the initial code value according to the corresponding code length to obtain a compressed code value of each digit in the replacement code, wherein the code length basic value table includes the basic value of each code length.
Specifically, the addition operation executing unit 1123 obtains a base value of each digit in the replacement code of the data stream in sequence according to a preset code length base value table and a code length of each digit in the replacement code of the data stream, adds the ranking value of each digit in the replacement code of the data stream to a corresponding base value to obtain an initial code value of each digit in the replacement code, and then converts the initial code value according to the corresponding code length to obtain a compressed code value of each digit in the replacement code, where the code length base value table includes the base value of each code length.
Accordingly, in one embodiment, as shown in fig. 22, when decompressing the compressed data obtained by the data compression method shown in fig. 22, step S202 may include:
s2021c, replacing the preset number in the data stream with the designated number and a preset run, where the preset run is a maximum value corresponding to a preset run bit width.
Specifically, the replacement operation execution part 1125 replaces a preset number in the data stream with a designated number and a preset run, where the preset run is a maximum value corresponding to a preset run bit width.
S2022c, obtaining a decompression array according to the run length in the acquired data, converting the digits except the run length in the decompression array to obtain the effective digits of the decompression array, decoding the run length in the decompression array to be the designated digits, and taking the effective digits and the designated digits of the decompression array as the intermediate coding result of the data stream, wherein the intermediate coding result comprises a plurality of intermediate coding values.
Specifically, the run-length encoding execution unit 1124 obtains a decompressed array according to a run length in the acquired data, converts the digits in the decompressed array except for the run length to obtain the decompressed array significant digits, decodes the run length in the decompressed array to the designated digits, and uses the decompressed array significant digits and the designated digits as an intermediate encoding result of the data stream, where the intermediate encoding result includes a plurality of intermediate encoding values.
S2023c, accessing a preset code value range table and a preset code length table, and sequentially obtaining a code length of each intermediate code value in the intermediate coding result, where the code value range table includes a maximum code value of multiple code lengths, and the code length code includes the multiple code lengths.
Specifically, the comparison operation executing unit 1122 obtains the intermediate coding result, and accesses a preset coding value range table and a preset code length table to sequentially obtain the code length of each intermediate coding value in the intermediate coding result, where the coding value range table includes the maximum coding value of multiple coding code lengths, and the code length code includes the multiple coding code lengths.
S2024c, sequentially obtaining an effective value of each intermediate coding value in the intermediate coding result as an initial coding value of each intermediate coding value, obtaining a base value of each intermediate coding value in the intermediate coding result according to a coding code length of each intermediate coding value in the intermediate coding result and a preset code length base value table, and taking a difference value between the initial coding value and the base value of each intermediate coding value in the intermediate coding result as a ranking value of each intermediate coding value in the intermediate coding result, where the code length base value table includes the base value of each coding code length.
Specifically, the addition operation executing unit 1123 sequentially obtains an effective value of each intermediate code value in the intermediate code result as an initial code value of each intermediate code value, obtains a base value of each intermediate code value in the intermediate code result according to a code length of each intermediate code value in the intermediate code result and a preset code length base value table, and uses a difference value between the initial code value and the base value of each intermediate code value in the intermediate code result as a ranking value of each intermediate code value in the intermediate code result, where the code length base value table includes the base value of each code length.
S2025c, querying a preset symbol sequence table according to the ranking value of each code value in the intermediate coding result to obtain a number corresponding to each code value in the intermediate coding result, where the symbol sequence table includes a plurality of numbers and ranking values of each number obtained based on the occurrence probability of the plurality of numbers.
Specifically, the query operation executing part 1121 queries a preset symbol sequence table according to the ranking value of each code value in the intermediate code result to obtain a number corresponding to each code value in the intermediate code result, where the symbol sequence table includes a plurality of numbers and a ranking value of each number obtained based on the occurrence probability of the plurality of numbers.
The data compression method of the embodiment combines the run-length coding with the digital replacement and the improved Huffman coding, can combine the advantages of the coding and the operation, and has high data compression efficiency.
It will be understood by those skilled in the art that all or part of the processes of the methods of the embodiments described above can be implemented by hardware instructions of a computer program, which can be stored in a non-volatile computer-readable storage medium, and when executed, can include the processes of the embodiments of the methods described above. Any reference to memory, storage, database, or other medium used in the embodiments provided herein may include non-volatile and/or volatile memory, among others. Non-volatile memory can include read-only memory (ROM), Programmable ROM (PROM), Electrically Programmable ROM (EPROM), Electrically Erasable Programmable ROM (EEPROM), or flash memory. Volatile memory can include Random Access Memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in a variety of forms such as Static RAM (SRAM), Dynamic RAM (DRAM), Synchronous DRAM (SDRAM), Double Data Rate SDRAM (DDRSDRAM), Enhanced SDRAM (ESDRAM), Synchronous Link DRAM (SLDRAM), Rambus Direct RAM (RDRAM), direct bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM).
The technical features of the above embodiments can be arbitrarily combined, and for the sake of brevity, all possible combinations of the technical features in the above embodiments are not described, but should be considered as the scope of the present specification as long as there is no contradiction between the combinations of the technical features.
The above-mentioned embodiments only express several embodiments of the present application, and the description thereof is more specific and detailed, but not construed as limiting the scope of the invention. It should be noted that, for a person skilled in the art, several variations and modifications can be made without departing from the concept of the present application, which falls within the scope of protection of the present application. Therefore, the protection scope of the present patent shall be subject to the appended claims.

Claims (18)

1. A data compression/decompression apparatus, comprising: the data dividing circuit is connected with the input FIFO memory, wherein n is a positive integer,
the data splitting circuit is used for splitting the compressed data into a plurality of data streams;
each input FIFO memory is used for executing synchronous operation on the received data stream and transmitting the data stream after the synchronous operation to the connected compression operation execution unit;
the plurality of compression operation executing components connected in series in each compression and decompression operation executing assembly are used for sequentially executing corresponding decompression sub-operations on the received input data to obtain a decompression result of each data stream;
each output FIFO memory is used for receiving decompression results sent by the connected compression and decompression operation execution components, and outputting the received decompression results after synchronous operation;
the input bit width of the input FIFO memory is set based on the area of the input FIFO memory and the type of data processing executed, and the input bit width is the number of bytes of data acquired by the input FIFO memory at a time;
the output bit width of the output FIFO memory is set based on the area of the output FIFO memory and the type of data processing executed, and the output bit width is the number of bytes of single output data of the output FIFO memory.
2. The apparatus according to claim 1, wherein an end signal transmitter is provided on each of the input FIFO memory, the compression operation performing means, and the output FIFO memory, the end signal transmitter being configured to transmit an end signal.
3. The apparatus according to claim 1 or 2, wherein a memory is connected in series between two adjacent codec operation executing components in each codec operation executing component,
and a memory is connected in series between the two adjacent compression and decompression operation execution parts and is used for storing the output result of the previous compression and decompression operation execution part in the two corresponding adjacent compression and decompression operation execution parts.
4. The apparatus according to claim 3, wherein a subsequent compression-decompression operation execution section of the adjacent two compression-decompression operation execution sections acquires an output result in the connected memory as input data to execute a corresponding decompression sub-operation.
5. The apparatus of claim 1 or 2, further comprising: a control circuit connected to the data dividing circuit and the compression/decompression operation execution block,
the control circuit is used for controlling the data dividing circuit to execute dividing operation and controlling the compression and decompression operation execution component to execute decompression operation, wherein the decompression operation comprises at least one decompression sub-operation.
6. The apparatus according to claim 1 or 2, wherein the compression operation executing means connected in series in each of the compression/decompression operation executing assemblies comprises: a comparison operation execution unit, an addition operation execution unit and a query operation execution unit which are connected in series in sequence, wherein the query operation execution unit is connected with the output FIFO memory,
the comparison operation executing component is configured to access a preset code value range table and a preset code length table, and sequentially obtain the code length of each code value in the input data stream, where the code value range table includes the maximum code value of multiple code lengths, and the code length table includes the multiple code lengths;
the addition operation executing component is configured to sequentially obtain an effective value of each coding value in a data stream as an initial coding value of each coding value, obtain a base value of each coding value in the data stream according to a coding code length of each coding value in the data stream and a preset code length base value table, and use a difference value between the initial coding value and the base value of each coding value in the data stream as a ranking value of each coding value in the data stream, where the code length base value table includes the base value of each coding code length;
and the query operation executing component is used for querying in a preset symbol sequence table according to the ranking value of each coded value in the data stream to obtain a number corresponding to each coded value in the data stream, wherein the symbol sequence table comprises a plurality of numbers and the ranking value of each number obtained based on the occurrence probability of the plurality of numbers.
7. The apparatus of claim 6,
the comparison operation executing component is specifically configured to obtain the code length of the current code value according to the minimum code value not less than the current code value in the code value range table and a preset code length table.
8. The apparatus according to claim 1 or 2, wherein the compression operation executing means connected in series in each of the compression/decompression operation executing assemblies comprises: run length coding execution means coupled to said output FIFO memory,
the run-length coding execution component is used for obtaining a decompression array according to the run length in the data stream, converting the digits except the run length in the decompression array to obtain the effective digits of the decompression array, decoding the run length in the decompression array into the designated digits, and taking the effective digits and the designated digits of the decompression array as the decompression digits of the decompression array.
9. The apparatus according to claim 8, wherein if the compressed data contains a replaced default number, the each codec execution component further comprises: a replacement operation execution unit coupled to the input FIFO memory,
and the replacing operation executing component is used for replacing the preset number in the data stream by using the designated number and a preset run, wherein the preset run is a maximum value corresponding to the preset run bit width.
10. The apparatus according to claim 1 or 2, wherein a replacement operation execution unit, a run-length encoding execution unit, a comparison operation execution unit, an addition operation execution unit, and a query operation execution unit are connected in series in each of the codec execution components, the replacement operation execution unit is connected to the input FIFO memory, and the query operation execution unit is connected to the output FIFO memory, wherein,
the replacing operation executing component is used for replacing preset numbers in the data stream by using the designated numbers and preset runs, and the preset runs are maximum values corresponding to preset run bit widths;
the run-length coding execution component is used for obtaining a decompressed array according to the run length in the acquired data, converting the digits except the run length in the decompressed array to obtain the valid digits of the decompressed array, decoding the run length in the decompressed array into designated digits, and taking the valid digits and the designated digits of the decompressed array as intermediate coding results of the data stream, wherein the intermediate coding results comprise a plurality of intermediate coding values;
the comparison operation executing component is configured to obtain the intermediate coding result, access a preset coding value range table and a preset code length table, and sequentially obtain a code length of each intermediate coding value in the intermediate coding result, where the coding value range table includes a maximum coding value of multiple coding code lengths, and the code length table includes the multiple coding code lengths;
the addition operation executing component is configured to sequentially obtain an effective value of each intermediate coding value in an intermediate coding result as an initial coding value of each intermediate coding value, obtain a basic value of each intermediate coding value in the intermediate coding result according to a coding code length of each intermediate coding value in the intermediate coding result and a preset code length basic value table, and use a difference value between the initial coding value and the basic value of each intermediate coding value in the intermediate coding result as a ranking value of each intermediate coding value in the intermediate coding result, where the code length basic value table includes the basic value of each coding code length;
and the query operation execution component is used for querying in a preset symbol sequence table according to the ranking value of each code value in the intermediate code result to obtain a number corresponding to each code value in the intermediate code result, wherein the symbol sequence table comprises a plurality of numbers and the ranking value of each number obtained based on the occurrence probability of the plurality of numbers.
11. The apparatus of claim 1 or 2, wherein the data splitting circuit is specifically configured to: determining the size of a data stream according to the size of input data and the number of compression and decompression execution components in the data compression and decompression device, and executing segmentation operation on the input data based on the size of the data stream to obtain a plurality of data streams.
12. A method for data decompression, the method comprising:
dividing the compressed data into a plurality of data streams;
setting an input bit width of an input FIFO memory based on the area of the input FIFO memory and the type of executed data processing, wherein the input FIFO memory acquires n data streams based on the input bit width and performs synchronous operation on the n data streams, and the input bit width is the number of bytes of data acquired by the input FIFO memory at a time;
decompressing the n data streams subjected to the synchronous operation in parallel to obtain n decompressed sub-results, wherein n is a positive integer;
setting an output bit width of an output FIFO memory based on the area of the output FIFO memory and the type of data processing to be executed, receiving each decompressed sub-result by the output FIFO memory based on the output bit width, performing synchronous operation on the n decompressed sub-results, writing the decompressed sub-results of the n decompressed sub-results after the synchronous operation according to the sequence and/or position of each data stream in the data to be compressed, wherein the output bit width is the byte number of single output data of the output FIFO memory;
and repeating the steps from the acquisition of the n data streams to the writing of the n decompressed sub-results until the number of the single decompressed sub-results is less than n, and then terminating the acquisition of the data streams.
13. The method of claim 12, further comprising:
and if the number of the acquired data streams is less than n, outputting an end signal, wherein the end signal is used for terminating the receiving of the data streams.
14. The method of claim 12 or 13, wherein decompressing each of the n data streams comprises:
accessing a preset code value range table and a preset code length table, and sequentially obtaining the code length of each code value in an input data stream, wherein the code value range table contains the maximum code value of multiple code lengths, and the code length table contains the multiple code lengths;
sequentially acquiring an effective value of each coding value in a data stream as an initial coding value of each coding value, obtaining a basic value of each coding value in the data stream according to a coding code length of each coding value in the data stream and a preset code length basic value table, and taking a difference value between the initial coding value and the basic value of each coding value in the data stream as a sorting value of each coding value in the data stream, wherein the code length basic value table comprises the basic value of each coding code length;
and inquiring in a preset symbol sequence table according to the sorting value of each coded value in the data stream to obtain a number corresponding to each coded value in the data stream, wherein the symbol sequence table comprises a plurality of numbers and the sorting value of each number obtained based on the occurrence probability of the plurality of numbers.
15. The method of claim 14, wherein the accessing a preset code value range table and a preset code length table to obtain the code length of each code value in the input data stream sequentially comprises:
and obtaining the code length of the current code value according to the minimum code value which is not less than the current code value in the code value range table and a preset code length table.
16. The method of claim 12 or 13, wherein compressing each of the n data streams comprises:
obtaining a decompression array according to the run length in the acquired data stream;
converting the digits except the run in the decompression array to obtain the effective digits of the decompression array, and decoding the run in the decompression array into the designated digits; taking the effective digits and the designated digits of the decompression array as the decompression digits of the decompression array;
and sequentially writing the decompressed numbers of the decompressed arrays according to the sequence of the decompressed arrays in the data stream.
17. The method of claim 16, wherein if the compressed data includes a predetermined number of replacements, before obtaining the decompressed array according to the run length in the obtained data stream, further comprising:
and replacing preset numbers in the data stream by using the designated numbers and preset runs, wherein the preset runs are maximum values corresponding to preset run bit widths.
18. The method of claim 12 or 13, wherein compressing each of the n data streams comprises:
replacing preset numbers in the data stream by using designated numbers and preset runs, wherein the preset runs are maximum values corresponding to preset run bit widths;
according to the run length in the acquired data, a decompression array is obtained, the digits except the run length in the decompression array are converted to obtain the effective digits of the decompression array, the run length in the decompression array is decoded into the designated digits, the effective digits and the designated digits of the decompression array are used as the intermediate coding result of the data stream, and the intermediate coding result comprises a plurality of intermediate coding values;
accessing a preset code value range table and a preset code length table, and sequentially obtaining the code length of each intermediate code value in the intermediate coding result, wherein the code value range table contains the maximum code value of multiple code lengths, and the code length table contains the multiple code lengths;
sequentially acquiring an effective value of each intermediate coding value in an intermediate coding result as an initial coding value of each intermediate coding value, acquiring a basic value of each intermediate coding value in the intermediate coding result according to a coding code length of each intermediate coding value in the intermediate coding result and a preset code length basic value table, and taking a difference value between the initial coding value and the basic value of each intermediate coding value in the intermediate coding result as a ranking value of each intermediate coding value in the intermediate coding result, wherein the code length basic value table comprises the basic value of each coding code length;
and inquiring in a preset symbol sequence table according to the ranking value of each code value in the intermediate code result to obtain a number corresponding to each code value in the intermediate code result, wherein the symbol sequence table comprises a plurality of numbers and the ranking value of each number obtained based on the occurrence probability of the plurality of numbers.
CN201811628184.0A 2018-12-07 2018-12-28 Data compression/decompression device and data decompression method Active CN111384968B (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201811628184.0A CN111384968B (en) 2018-12-28 2018-12-28 Data compression/decompression device and data decompression method
PCT/CN2019/121056 WO2020114283A1 (en) 2018-12-07 2019-11-26 Data processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811628184.0A CN111384968B (en) 2018-12-28 2018-12-28 Data compression/decompression device and data decompression method

Publications (2)

Publication Number Publication Date
CN111384968A CN111384968A (en) 2020-07-07
CN111384968B true CN111384968B (en) 2022-08-09

Family

ID=71219261

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811628184.0A Active CN111384968B (en) 2018-12-07 2018-12-28 Data compression/decompression device and data decompression method

Country Status (1)

Country Link
CN (1) CN111384968B (en)

Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1199284A (en) * 1997-04-04 1998-11-18 三星电子株式会社 Symbols decoding method and apparatus
CN1257621A (en) * 1997-04-18 2000-06-21 首要研究有限公司 Method and apparatus for lossless digital data compression
US6657561B1 (en) * 2000-05-15 2003-12-02 International Business Machines Corporation Data decompression system and method
US7129860B2 (en) * 1999-01-29 2006-10-31 Quickshift, Inc. System and method for performing scalable embedded parallel data decompression
CN101198056A (en) * 2006-12-05 2008-06-11 华为技术有限公司 Variable length encoding method and device
CN103326730A (en) * 2013-06-06 2013-09-25 清华大学 Data parallelism compression method
CN104052493A (en) * 2013-03-12 2014-09-17 三星电子株式会社 Data Processing System And Method Of Operating The Same
CN107836083A (en) * 2015-05-21 2018-03-23 零点科技公司 Method, apparatus and system for semantic values data compression and decompression
CN109075798A (en) * 2016-03-31 2018-12-21 零点科技公司 Data compression of the variable-size symbol based on entropy
CN109088636A (en) * 2018-07-25 2018-12-25 郑州云海信息技术有限公司 A kind of data processing method, system and electronic equipment and storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4479530B2 (en) * 2004-12-28 2010-06-09 カシオ電子工業株式会社 Data compression apparatus and data restoration apparatus
CN100517979C (en) * 2005-10-10 2009-07-22 中兴通讯股份有限公司 Data compression and decompression method
CN105007083A (en) * 2015-08-13 2015-10-28 东南大学 Method for storing output result of LZ77 compression algorithm

Patent Citations (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1199284A (en) * 1997-04-04 1998-11-18 三星电子株式会社 Symbols decoding method and apparatus
CN1257621A (en) * 1997-04-18 2000-06-21 首要研究有限公司 Method and apparatus for lossless digital data compression
US7129860B2 (en) * 1999-01-29 2006-10-31 Quickshift, Inc. System and method for performing scalable embedded parallel data decompression
US6657561B1 (en) * 2000-05-15 2003-12-02 International Business Machines Corporation Data decompression system and method
CN101198056A (en) * 2006-12-05 2008-06-11 华为技术有限公司 Variable length encoding method and device
CN104052493A (en) * 2013-03-12 2014-09-17 三星电子株式会社 Data Processing System And Method Of Operating The Same
CN103326730A (en) * 2013-06-06 2013-09-25 清华大学 Data parallelism compression method
CN107836083A (en) * 2015-05-21 2018-03-23 零点科技公司 Method, apparatus and system for semantic values data compression and decompression
CN109075798A (en) * 2016-03-31 2018-12-21 零点科技公司 Data compression of the variable-size symbol based on entropy
CN109088636A (en) * 2018-07-25 2018-12-25 郑州云海信息技术有限公司 A kind of data processing method, system and electronic equipment and storage medium

Also Published As

Publication number Publication date
CN111384968A (en) 2020-07-07

Similar Documents

Publication Publication Date Title
US10979071B2 (en) Systems and methods for variable length codeword based, hybrid data encoding and decoding using dynamic memory allocation
US8456331B2 (en) System and method of compression and decompression
JP7031828B2 (en) Methods, devices, and systems for data compression and decompression of semantic values
KR100894002B1 (en) Device and data method for selective compression and decompression and data format for compressed data
KR20110007865A (en) Data compression method
US6748520B1 (en) System and method for compressing and decompressing a binary code image
CN111384962B (en) Data compression/decompression device and data compression method
CN111384963B (en) Data compression/decompression device and data decompression method
EP1941617A1 (en) Method and system for compressing data
US11309909B2 (en) Compression device, decompression device, and method
CN114157305A (en) Method for rapidly realizing GZIP compression based on hardware and application thereof
CN111384968B (en) Data compression/decompression device and data decompression method
US7872596B2 (en) Dictionary-based compression
CN111384964B (en) Data compression/decompression device and data compression method
KR101023536B1 (en) Lossless data compression method
Rathore et al. A brief study of data compression algorithms
CN103746701A (en) Rapid encoding option selecting method applied to Rice lossless data compression
CN1209925C (en) Data compress method based on higher order entropy of message source
CN112217521B (en) gZIP-based large file distributed compression method
CN114429200A (en) Standardized Huffman coding and decoding method and neural network computing chip
Rani et al. A survey on lossless text data compression techniques
JP7305609B2 (en) A device that processes received data
CN117200805B (en) Compression and decompression method and device with low memory occupation of MCU
US20220353519A1 (en) Memory system
JPH0629861A (en) Data compression method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant