Train chain lossless compressor of digital values

CN117280617BActive Publication Date: 2026-10-20HONG KONG APPLIED SCI & TECH RES INST
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202280003591.0
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2022-08-31
Filing Date
2022-09-13
Publication Date
2026-10-20
Estimated Expiration
2042-09-13

Smart Images

  • Figure CN117280617B_ABST
    Figure CN117280617B_ABST
Patent Text Reader

Abstract

The train chain lossless data compressor checks the data block, when all data values in the input block are the same, the same encoder is used to generate the same code. When the input data is not all the same value, then the Gaussian encoder, Laplace encoder and incremental encoder are activated in parallel. Compare the three compressed code lengths, when the minimum code length is less than the copy code length, output the minimum code length as the compressed code. The copy code is a label followed by all the data in the copy input block. When the minimum of the three compressed code lengths is greater than the copy code length, then the file is not compressible, output the copy code. No frequency table is needed, so the delay is very low. The incremental encoder is to subtract the data value from the average value of the previous data block.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical Field] This invention relates to data compression systems, and more particularly to data compressors that use various compression methods by linking data blocks together like train-linking. [Background Technology] Data can be compressed using lossy or lossless methods. Image data such as video typically uses lossy compression because the loss of visual data may not be particularly noticeable. Other types of data cannot tolerate loss, so lossless data compression is used.

[0003] Neural networks use weights for the nodes in the network. The network's topology and connectivity can be defined by feature maps. For deep neural networks and convolutional neural networks, these weights and feature maps can be quite large. Neural network weights and feature maps can be compressed before storage or transmission. Since computational results may be altered due to data compression losses, neural networks require lossless data compression.

[0004] Figure 1 shows a neural network whose weights and feature maps are compressed before storage or transmission. The neural network 104 can be a graphics processing unit (GPU) or a dedicated neural network processor. The neural network 104 may have been trained, with its weights and feature maps tuned to optimize for a specific problem or dataset. These weights and feature maps can be backed up or stored in memory 102.

[0005] However, the memory 102 can be located remotely from the neural network 104, for example, when the neural network 104 is on a portable device and the memory 102 is in cloud storage. The connection between the neural network 104 and the memory 102 may be bandwidth-limited. The compressor 100 can use lossless compression to compress the weights and feature maps from the neural network 104 and send the compressed data to the memory 102. This can reduce the amount of memory required for storage in the memory 102 and also reduce the bandwidth consumed by the transmission.

[0006] The compressed weights and feature maps stored in memory 102 can be transmitted via a network link to a local device including compressor 100, which decompresses the weights and feature maps and loads them into neural network 104 to configure neural network 104 for a specific processing task.

[0007] Some data blocks may be so random or unordered that they are poorly compressed. It's best to avoid compressing such data, as the compressed result may be larger than the original. Other data blocks, such as those containing only zeros, may be easily compressed.

[0008] Classic lossless compression algorithms include WinZip, WinRAR, and 7z. These compressors typically employ both run-length coding and entropy coding. The drawback of run-length coding is its large search window, which can become a significant bottleneck. Entropy coding, such as Huffman coding, arithmetic coding, and Finite State Entropy (FSE) coding, may require a symbol frequency table. This symbol frequency table can be created or populated during compression and transmitted along with the compressed data. This overloaded symbol frequency table is a bandwidth-intensive overhead and can reduce compression efficiency in some cases.

[0009] Parallel implementation of this classic two-stage coding system, which uses run-length encoding and entropy encoding, can be difficult. Latency can be significant.

[0010] We desire a lossless compression system that does not use a symbol frequency table. We desire a compressed data stream that does not overload the symbol frequency table. We desire a low-latency lossless data compressor that allows for parallel implementation. We also desire a lossless data compression that partially considers the data structure, making it highly efficient for blocks of all zeros and blocks with minimal data changes. We desire a lossless data compression that references a previous block to link the current block to the previous block. [Attached Image Description] Figure 1 shows a neural network whose weights and feature maps are compressed before storage or transmission.

[0012] Figure 2 shows the Gaussian and Laplace distributions.

[0013] Figure 3 shows a data block with multiple data distributions.

[0014] Figure 4 This is a block diagram of a train chain data compressor.

[0015] Figure 5 is a flowchart of lossless data compression for train chains.

[0016] Figure 6 shows the coded compressed data using Gaussian and Laplace coding.

[0017] Figure 7 shows the label table used for encoding.

[0018] Figure 8 is a table of Gaussian coding.

[0019] Figure 9 is a table of Laplace encoding.

[0020] Figure 10 is a schematic diagram of a Gaussian encoded bitstream.

Detailed Implementation Methods

[0022] Figure 2 shows the Gaussian and Laplace distributions. The Gaussian distribution is a commonly used model for the distribution of data values ​​or symbols in a data block to be compressed. Many data blocks can be well compressed using Gaussian compression techniques.

[0023] Other data blocks may contain a few large values ​​and many smaller values. These blocks are compressed better when using the Laplace coding method. The Laplace distribution 110 can generally model these data blocks with large data peaks better than the Gaussian distribution 112.

[0024] The inventors have realized that Gaussian and Laplace methods can complement each other. A data compressor that can choose between Gaussian or Laplace codes can compress a wider range of datasets more effectively.

[0025] Figure 3 This demonstrates a data block with multiple data distributions. The input data block contains 64 bytes of data, arranged into 8 blocks of 8 bytes each. The inventors realized that multiple data distributions can occur within different data blocks. The inventors used different encoding methods for different types of data distributions. Each data block can be encoded using deltacoding, same coding, Gaussian coding, Laplace coding, or copy coding.

[0026] The inventors recognized that a common type of data block has very small differences between the data values ​​within it. These differences, or deltas, are small. The inventors have developed incremental encoding to encode these small delta values ​​within data blocks, thereby providing high compression ratios for these incremental blocks. Eight bytes in data block 1, eight bytes in data block 2, and eight bytes in data block 4 are all encoded using incremental encoding.

[0027] Incremental encoding is easy to implement. Subtract the average of the eight values ​​from the previous block from each byte of the current block to generate eight increment values. These increment values ​​x can be positive or negative, and can therefore be converted into eight positive values ​​X using the following equation:

[0028] X = [abs(x)]*2 – 1, when x<0, or X = (x)*2, when x>= 0 Then, Gaussian coding can be used to encode these 8 positive increment values ​​X.

[0029] If the previous block consisted entirely of positive values, then when the current block is encoded as Gaussian or Laplace, the encoder can assume that the current block also has 8 positive values, so the current block is encoded as positive Gaussian or Laplace code. However, if the previous block contained both positive and negative values, or if encoding the current block as 8 positive values ​​fails or overflows, then the 8 values ​​in the current block can be converted into 8 positive values ​​X using the following equation:

[0030] X = [abs(x)]*2 – 1, when x<0, or X = (x)*2, when x>= 0 These eight positive values ​​X can then be encoded using Gaussian or Laplace coding methods.

[0031] The inventors also recognized that some data blocks contain only zero values, while others contain only a single non-zero value that is repeated throughout the block. All bytes or symbols in these data blocks have the same value. By encoding the same value only once with the same encoder, these data blocks with identical values ​​can be compressed to the maximum extent. Figure 3 Data block 3 in the code is encoded using the same encoding method.

[0032] Data blocks 5 and 6 can be compressed using Gaussian coding. The data values ​​in these two blocks are generally smooth and not small.

[0033] In data block 7, there is a data byte that is significantly larger than the other bytes in the block. Laplace coding is well-suited for this type of data spike. Data block 7 is compressed using Laplace coding.

[0034] The inventors also recognized that some data blocks are not suitable for any of these previously described data distributions. Some data blocks exhibit significant data variability and appear unsuitable for Gaussian or Laplace distributions or encoding. These data blocks may even expand when compressed using Gaussian or Laplace encoding. These wild data blocks are incompressible.

[0035] The inventors realized that it was better to simply copy the data in these blocks rather than trying to compress them. The copy encoder can simply copy the data in these blocks. Figure 8Data block 8 in the code has a wide range of data fluctuations, making it impossible to compress using Gaussian or Laplace encoding. Instead, the 8 bytes in data block 8 can be encoded using copy encoding.

[0036] Since the encoding of the current block may depend on previous blocks, the encoded blocks are chained together, much like train carriages are linked together. Therefore, the inventors called this multi-method compression "train-linking coding".

[0037] Figure 4 This is a block diagram of a train chain data compressor. Input data 12 is a fixed-size data block, such as an 8-byte block. Instead of trying to predict which encoding provides the best compression for this data, each block of input data 12 is applied to all five encoders, each encoder producing a compressed code for the data block in input data 12. The optimal code selector 30 then checks the code lengths of the five codes from encoders 20, 22, 24, 26, and 28 and selects the smallest code length for the data block for output. This process is repeated for all eight blocks of input data 12. The selected eight codes are then output as the compressed binary data 14.

[0038] The five encoders are an identical encoder 20, a Gaussian encoder 22, a Laplace encoder 24, an incremental encoder 26, and a copy encoder 28. Each encoder outputs a label identifying the code type (identical, Gaussian, Laplace, incremental, or copy), followed by the encoded data. For each data block, the optimal code selector 30 selects the shortest code and discards the other four codes.

[0039] The same encoder 20 generates its code by producing the same encoded tag 000 and then appending an 8-bit data byte (which is identical to all 8 bytes in the data block). Therefore, the code length of the same encoder 20 is 11 bits. The same data block is compressed to 17% of its original size, reduced from 64 bits to 11 bits.

[0040] The copy encoder 28 generates its code by producing a tag 001 for copy encoding and then appending 8 bytes of data from that block. The copy code block is expanded by 3 bits, resulting in a compression rate of 105%.

[0041] Instead of running all five encoders (20, 22, 24, 26, 28) in parallel, the same encoder 20 can be checked first to determine if all eight bytes are identical. When any of the eight bytes differ, the same encoder 20 stops, and the Gaussian encoder 22, Laplace encoder 24, and incremental encoder 26 are run in parallel. The smallest code is selected and compared with the code length of the copy encoder 28, which is always 3 bits longer than the input data length (3 + 64 = 67 bits). When the smallest code from the Gaussian encoder 22, Laplace encoder 24, and incremental encoder 26 is greater than 67 bits, the copy encoder 28 is run to generate the copy code as the output code. The optimal code selector 30 can pipeline the encoders 20-28 to achieve a sequence where the same encoder 20 runs first, then the Gaussian encoder 22, Laplace encoder 24, and incremental encoder 26 run in parallel, and finally the copy encoder 28, if necessary.

[0042] Figure 5 is a flowchart of lossless data compression for train chains. Each data block is 64 bits or 8 bytes, with 8 data values. In step 502, an 8-byte data block is input, and it is checked that all 8 data values ​​are the same. In step 504, if all 8 data values ​​are the same, then in step 506, the data block is encoded using the same encoding. When all 8 data values ​​are the same, this is the most efficient encoding because the compression rate is 17%. In step 524, the same code is output for this block, and the process is repeated for other blocks.

[0043] In step 504, when the 8 data bytes are not all identical, a less efficient code must be used. In step 510, the Laplace encoder generates a Laplace code for this block. In step 512, the Gaussian encoder generates a Gaussian code for this block. In step 514, the incremental encoder generates an incremental code for this block. These three codes can be generated in parallel. The smallest code is not known beforehand. Then, in step 516, the code with the shortest length is selected. In step 520, if the length of this code does not exceed 3 bits of the original data, or 64 + 3 = 67 bits, then in step 524, the selected code is output for this data block, and the process is repeated for the next data block.

[0044] In step 520, if the length of this code exceeds the original data by 3 bits or 64 + 3 = 67 bits, then using Laplace, Gaussian, or incremental encoding would cause the data to bloat excessively. These codes are discarded, and in step 522, a copy encoder is used to generate the code for that data block. The code length of the copy code for this data block is only 3 bits longer than the original data block size, or 67 bits. In step 524, the copy code is output, and the process is repeated for the next data block.

[0045] Figure 6 shows the encoded compressed data using Gaussian and Laplace coding. Incremental coding uses Gaussian coding, but the data values ​​are changed before Gaussian coding. The output compressed binary data (14 in Figure 4) has a tag 42 for each data block (8 bytes of original data), which indicates the compression code type, followed by a pair of docks 44 and code values ​​46. Docks 44 have a fixed length of 3 bits for Gaussian coding, but a variable length for Laplace coding. The code value 46 has a variable length, specified by dock 44.

[0046] Figure 7 shows the coded tag table. The tag 42 can be 2 bits or 3 bits long. A tag value of 000 indicates that the data block is encoded using the same code. For the entire 64-bit data block, the same code requires only 3 tag bits and 8 data bits.

[0047] Tag value 001 indicates that the data block uses replication encoding. Tag value 10 indicates that the data block uses Gaussian encoding. Tag value 10 indicates that the data block uses Laplace encoding. Incremental encoding is represented by tag value 11.

[0048] Each coded block of the copy, Gaussian, Laplace, and incremental coding blocks has a tag followed by eight pairs of terminal 44 and code value 46. Each raw data byte in the original data block has a pair of terminal 44 and code value 46.

[0049] Figure 8 The table displays the Gaussian encoding. Gaussian encoding table 50 shows the range of data values ​​for the original data bytes in the first column. For the original data byte 0, the first row indicates that terminal 44 is 000, code value 46 is NUL, and the code length is 3 bits.

[0050] For the original data byte value of 1, 2, 3, or 4, the second line displays terminal 44 as 001, followed by code value 46 as XX, where XX=00 represents original data 1, XX=01 represents original data 2, XX=10 represents original data 3, and XX=11 represents original data 4. XX = D–1, where D is the original data byte value in the input data stream. The code length is 5, and the code is 001XX.

[0051] For the original data byte values ​​5, 6, 7, or 8, the third line displays terminal 44 as 010, followed by code value 46 as XX, where XX=00 represents original data 5, XX=01 represents original data 6, XX=10 represents original data 7, and XX=11 represents original data 8. XX = D – 5, where D is the original data byte value in the input data stream. The code length is 5, and the code is 010XX.

[0052] For raw data byte values ​​between 9 and 16, the fourth line shows that terminal 44 is 011, followed by code value 46 as XXX, where XXX=000 is raw data 9, XXX=001 is raw data 10, XXX=010 is raw data 11, and so on, XXX=111 is raw data 16. XX=D-9, where D is the raw data byte value in the input data stream. The code length is 6, and the code is 011XXX.

[0053] Other rows are used for data ranges 17-24, 25-40, and 41-72, with code lengths of 6, 7, and 8 bits, respectively.

[0054] For raw data byte values ​​between 73 and 255, the last line shows terminal 44 as 111, followed by code value 46 as XXXXXXXX, where XXXXXXXX=00000000 represents raw data 73, XXXXXXXX=00000001 represents raw data 74, XXXXXXXX=00000010 represents raw data 75, and XXXXXXXX=11111111 represents raw data 255. XX=D-73, where D is the raw data byte value in the input data stream. The code length is 11, and the code is 111XXXXXXXX.

[0055] Figure 9 shows a table of Laplace encoding. Table 52 of the Laplace encoding shows the range of data values ​​for the original data bytes in the first column. For an original data byte of 0, the first row indicates that terminal 44 is 0, code value 46 is an empty NUL, and the code length is 1 bit. For Laplace encoded input data values ​​0 and 255, code value 46 does not exist.

[0056] For a raw data byte value of 1 or 2, the second line displays terminal 44 as 01, followed by code value 46 as X, where X=0 represents raw data 1, and X=1 represents raw data 2. XX = D–1, where D is the raw data byte value in the input data stream. The code length is 3, and the code is 01X.

[0057] For each subsequent row in the Laplace coding table 52, terminal 44 increases by one bit, and code value 46 increases by one bit, thus increasing the code length by 2 bits for each subsequent row. For larger input data values, Laplace consumes more code bits than Gaussian. However, the code length for the maximum input value of 255 is 8 bits, which is less than the Gaussian code length of 11 bits for the input value of 255. Therefore, Laplace coding is efficient when encoding maximum values.

[0058] Figure 10 is a schematic diagram of a Gaussian-coded bitstream. In this example diagram, the bitstream is read from right to left. The first bit, 1, followed by 0, is the tag 01 indicating that the block is Gaussian-coded.

[0059] The next bit is 11010, with a terminal value of 010, followed by the code value 11, used for the data value 8. Figure 8 The third line. The following data value 20 is encoded by dock 100 followed by the code value 011. Figure 8 The fifth row. The following data value 10 is encoded using terminal 011 and code value 001, as shown in the fourth row of Figure 8. Data values ​​17 and 13 are also encoded as 6-bit lengths. Then input data 4 uses 5-bit terminal 001 and code value 11. Figure 8 The second line. The input data value 0 is a 3-bit code, terminal 000, which has no code value. The final input value 5 is encoded by terminal 101 and the 5-bit code value 00. Figure 8 The third line.

[0060] The eight input data values ​​8, 20, 10, 17, 13, 4, 0, and 5 are encoded into a total of 44 bits. The compression ratio is 44 / 64 = 69%. While the compression of neural network weights has been described, this compressor can be used in other applications to compress data other than neural network weights. For example, high-frequency stock trading data might benefit from the low latency of this data compressor.

[0061] [Alternative Embodiments] The inventors have also provided several other embodiments. For example, although an 8-byte input block has been described, it can be replaced by other block or symbol sizes, such as a 16-byte block or a block with 16 symbols. A 128-byte block can have 16 8-bit symbols or 8 16-bit symbols. Many modifications and transformations to the encoding scheme can be substituted.

[0062] While graphs and charts have been shown and described to aid reader comprehension, computer systems can implement these graphs or charts using tables or other data structures. Tables can be computer-implemented graphs.

[0063] The incremental encoder 26 can subtract the average value of the previous block to obtain the incremental value. When there is no previous block, the average value can be set to zero. The difference or incremental value can then be encoded using a Gaussian encoder 22, a Laplace encoder 24, or some other encoder.

[0064] Various parameters can be expressed in various ways and with various variations. For example, for an incompressible file, the compression ratio can be defined as 100%; for a file that is compressed to a size of 80%, the compression ratio can be defined as 20%; or for a file that is compressed to a size of only 20%, the compression ratio can be defined as 20%. Other statistical data can also be changed, redefined, transferred, or transformed.

[0065] Various block sizes and symbol sizes can be used. Block sizes can be fixed or variable. An 8-bit input symbol (byte) and an 8-byte block are just one of many possibilities. Symbol values ​​can be encoded in binary, two's complement, or other encoding codes.

[0066] The codes used by the Gaussian encoder 22, Laplace encoder 24, and incremental encoder 26 can be combined into a single code, which the inventors call group symbol coding. Two flag bits indicate the number of subsequent code value bits. For example, flag bit 00 has no code value bits, and the encoded data input value is 0. For data values ​​from 1 to 4, flag bit 01 has 2 code value bits. For data input values ​​from 5 to 20, the flag bit is set to 10, followed by 4 code value bits. For data input values ​​from 21 to 276, the flag bit is set to 11, and there are 8 code value bits. The code length is 2, 4, 6, or 10 bits. Group symbol coding can use fewer bits than Golomb coding to achieve a better compression ratio without requiring cyclic bits or tables. Different data distributions can be encoded using group symbol coding.

[0067] Some embodiments may not use all components. Additional components can be added. Various components can be implemented using a variety of technologies, employing various combinations of software, hardware, firmware, programs, modules, functions, etc. The train chain compressor can be implemented as a bit program module or in an application-specific integrated circuit (ASIC) or other hardware to improve processing speed and reduce power consumption.

[0068] The terms left, right, top, and bottom are relative and can be flipped, rotated, transformed, or transposed in various ways. Adders can add two's complement values ​​to perform subtraction. Therefore, subtraction and addition can be used interchangeably.

[0069] Various interleaving and mapping schemes can alter the actual storage location to optimize bandwidth or other design parameters. Many memory arrangements, both physical and logical, are possible. Various parallel processing techniques can be used to perform the basic operations described here serially for easier understanding.

[0070] The background section of this invention may include background information about the problem or environment of the invention, rather than a description of prior art. Therefore, the material included in the background section is not an admission of prior art by the applicant.

[0071] Any methods or processes described herein are machine-implemented or computer-implemented and are intended to be performed by machines, computers, or other devices, and not necessarily by humans alone without machine assistance. Tangible results may include reports or other machine-generated displays on display devices such as computer monitors, projection devices, audio generation devices, and related media devices, and may include hard-copy printouts that are also machine-generated. Computer control of other machines is another tangible result.

[0072] Any advantages and benefits described herein may not necessarily apply to all embodiments of the invention. When the word “device” appears in a claim element, the applicant intends that the claim element fall within the provisions of Section 112, Paragraph 6 of 35 USC. Typically, one or more words precede the word “device.” These words preceding “device” are a label intended to facilitate reference to the claim element, not to express structural limitations. Such device-plus-function claims must cover not only the structure described herein for performing the function and its structural equivalents, but also equivalent structures. For example, although nails and screws have different constructions, they are equivalent structures because they both perform the fastening function. Claims that do not use the word “device” do not fall within the provisions of Section 112, Paragraph 6 of 35 USC. Signals are typically electronic signals, but can also be optical signals, for example, transmitted via fiber optic lines.

[0073] The above description of embodiments of the invention is provided for illustrative and descriptive purposes. It is not exhaustive and is not intended to limit the invention to the precise forms disclosed. Many modifications and variations are possible in accordance with the above teachings. The purpose is that the scope of the invention is not limited by this detailed description but by the appended claims.

Claims

1. A train chain data compressor, comprising: The input terminal receives an input data block, which has multiple data values. A same-value checker checks the multiple data values ​​and outputs a same-value code when the multiple data values ​​have the same value. A plurality of encoders, each of which receives the input data block and generates a compressed code for the input data block, the compressed code having a code length; The optimal code selector checks the code length from each of the plurality of encoders and outputs the compressed code from the encoder that produces the smallest code length among the plurality of encoders as the selected compressed code. A length comparator that emits an incompressible block signal when the code length of the selected compression code is greater than a threshold length, wherein the threshold length is the length of the input data block plus the tag length; A copy encoder generates a copy code by generating a tag immediately following the input data block when the length comparator outputs an incompressible block signal; The compression code output terminal outputs the selected compression code from the optimal code selector when it does not output the same value code and when it does not issue an incompressible block signal, and outputs the copy code when it issues an incompressible block signal. This results in the output of the optimal compression code for the input data block.

2. The train chain data compressor according to claim 1, wherein, The plurality of encoders also includes: A Gaussian encoder is used to encode an input data block having a plurality of data values ​​having a Gaussian distribution; A Laplace encoder is used to encode a block of input data having a plurality of data values ​​having a Laplace distribution.

3. The train chain data compressor according to claim 2, wherein, The plurality of encoders also includes: An incremental encoder having an incremental generator that generates multiple differences between the plurality of data values ​​and an average value, the incremental encoder generating the compressed code from the plurality of differences.

4. The train chain data compressor according to claim 3, wherein, The average value is the average of multiple data values ​​from the previously input data block.

5. The train chain data compressor according to claim 2, wherein, The compression code includes a tag and multiple compressed data codes. The compressed data code used for intermediate data values ​​includes a terminal and a code value, wherein the terminal indicates the number of bits in the code value; The compressed data code used for zero values ​​includes the terminal but not the code value.

6. The train chain data compressor according to claim 5, wherein, The compressed data code of the maximum value generated by the Laplace encoder includes the dock but has no code value.

7. The train chain data compressor according to claim 6, wherein, The dock generated by the Gaussian encoder has a fixed number of bits, while the dock generated by the Laplace encoder has a variable number of bits.

8. The train chain data compressor according to claim 7, wherein, The terminal generated by the Laplace encoder has a variable number of bits, which increases for larger data values ​​in the input data block.

9. The train chain data compressor according to claim 8, wherein, The label indicates whether the compressed code was generated by the Gaussian encoder or the Laplace encoder.

10. The train chain data compressor according to claim 9, wherein, The same value code is a label plus the same data value detected by the same value checker.

11. The train chain data compressor of claim 10, wherein the input data block is a fixed-length block having the plurality of data values, wherein the plurality of data values ​​includes N data values, wherein N is an integer of at least 8.

12. A computer-implemented method for compressing data, comprising: Inspect an input data block that has multiple input data values ​​to determine whether the multiple input data values ​​are all equal to the same data value; When the multiple input data values ​​are all equal to the same data value, a label is generated to represent the same data encoding type, and the same data value is appended to the label to generate a compressed data code; When the multiple input data values ​​are not all equal to the same data value: A Gaussian code is generated from the plurality of input data values ​​of the input data block, the Gaussian code having a Gaussian code length; A Laplace code is generated from the plurality of input data values ​​of the input data block, the Laplace code having a Laplace code length; An incremental code is generated from the plurality of input data values ​​of the input data block, the incremental code having an incremental code length; Compare the code lengths of the Gaussian code, the Laplace code, and the incremental code; When the code length of the Laplace code and the incremental code is greater than the code length of the Gaussian code, the Gaussian code is selected as the selected code. When the code length of the Gaussian code and the incremental code is greater than the code length of the Laplace code, the Laplace code is selected as the selected code. When the code length of the Gaussian code and the Laplace code is greater than the code length of the incremental code, the incremental code is selected as the selected code; The selected code length of the selected code is compared with a threshold length; When the selected code length is less than the threshold length, the selected code is output as the compressed data code; When the selected code length is greater than the threshold length, the compressed data code is generated, which is the input data block with a label indicating an uncompressed block; This allows the input data block to be compressed into the same data value plus the label, or compressed into the compressed data code, or the input data block to be output with a label indicating an uncompressed block.

13. The computer-implemented method for compressing data according to claim 12, further comprising: The compressed data code is output to the computer storage device.

14. The computer implementation method for compressing data according to claim 12, wherein generating the Gaussian code comprises: Generate a label indicating the Gaussian code type and multiple data codes, each data code being used for one of the multiple input data values.

15. The computer implementation method for compressing data according to claim 14, wherein each data code for a non-zero input data value includes a terminal and a code value, the terminal indicating the number of bits in the code value.

16. The computer-implemented method for compressing data according to claim 15, wherein, The pier has a fixed number of bits when generating the Gaussian code, but a variable number of bits when generating the Laplace code.

17. A multi-mode data compression system, comprising: The input terminal is used to receive input data blocks; A common encoder is used to generate a common code when all data values ​​in the input data block have the same data value, the common code having a label indicating the type of the common code followed by the same data value; A Gaussian encoder for generating Gaussian codes having a label indicating the type of Gaussian code and multiple data codes, each non-zero data code having a terminal and a code value, wherein the terminal has a fixed number of bits, representing the number of bits in the code value, wherein the number of bits in the code value increases for consecutive large groups of data values; A Laplace encoder for generating Laplace codes having a label indicating the type of Laplace code and multiple data codes, each intermediate data code having a terminal and a code value, wherein the terminal indicates the number of bits in the code value, and wherein for consecutive large groups of data values, the terminal and the number of bits in the code value increase. Each intermediate data code is a data value that is neither zero nor the maximum data value; An incremental encoder is used to generate incremental codes. The incremental encoder subtracts a base value from each data value in the input data block to generate an incremental value. The incremental code generated by the incremental encoder has a label indicating the type of incremental code and an encoding of the incremental value. The Gaussian code has a Gaussian code length; Wherein, the Laplace code has a Laplace code length; The incremental code has an incremental code length; A length comparator compares the Gaussian code length, the Laplace code length, the incremental code length, and a threshold length, and outputs the minimum code length. A copy encoder that generates copy codes by appending a tag indicating the copy code type to the input data block, the copy codes having the threshold length; and An optimal code selector is configured to select the same code when all data values ​​in the input data block have the same data value; and when all data values ​​in the input data block do not have the same data value, output the Gaussian code when the Gaussian code length is the minimum code length, output the Laplace code when the Laplace code length is the minimum code length, output the incremental code when the incremental code length is the minimum code length; or output the copy code when the threshold length is the minimum code length.

18. The multi-mode data compression system of claim 17, wherein the zero data code has a terminal but not a code value.

19. The multi-mode data compression system according to claim 18, wherein, The maximum data code of the Laplace code has a terminal but no code value.

20. The multi-mode data compression system according to claim 17, wherein, The input data block includes 8 data values, each of which consists of 8 bits.

Citation Information

Patent Citations

  • Methods, devices and systems for compressing and decompressing data

    CN108886367A

  • Compression with doppler enhancement

    US20080107169A1