CN106407285A - RLE and LZW-based optimized bit file compression and decompression method - Google Patents
RLE and LZW-based optimized bit file compression and decompression method Download PDFInfo
- Publication number
- CN106407285A CN106407285A CN201610752157.9A CN201610752157A CN106407285A CN 106407285 A CN106407285 A CN 106407285A CN 201610752157 A CN201610752157 A CN 201610752157A CN 106407285 A CN106407285 A CN 106407285A
- Authority
- CN
- China
- Prior art keywords
- string
- char
- data
- character
- current
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000007906 compression Methods 0.000 title claims abstract description 141
- 230000006835 compression Effects 0.000 title claims abstract description 136
- 238000000034 method Methods 0.000 title claims abstract description 53
- 230000006837 decompression Effects 0.000 title claims abstract description 50
- 238000005457 optimization Methods 0.000 claims description 10
- 241001269238 Data Species 0.000 claims 1
- 238000006748 scratching Methods 0.000 claims 1
- 230000002393 scratching effect Effects 0.000 claims 1
- 238000005516 engineering process Methods 0.000 abstract description 7
- 238000004458 analytical method Methods 0.000 abstract description 3
- 238000013461 design Methods 0.000 description 6
- 238000013144 data compression Methods 0.000 description 4
- 230000003044 adaptive effect Effects 0.000 description 3
- 230000000694 effects Effects 0.000 description 3
- 230000006870 function Effects 0.000 description 3
- 238000012545 processing Methods 0.000 description 2
- 238000012360 testing method Methods 0.000 description 2
- 102100039250 Essential MCU regulator, mitochondrial Human genes 0.000 description 1
- 101000813097 Homo sapiens Essential MCU regulator, mitochondrial Proteins 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 230000005540 biological transmission Effects 0.000 description 1
- 238000004364 calculation method Methods 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000012669 compression test Methods 0.000 description 1
- 230000007812 deficiency Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 230000002427 irreversible effect Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/10—File systems; File servers
- G06F16/17—Details of further file system functions
- G06F16/174—Redundancy elimination performed by the file system
- G06F16/1744—Redundancy elimination performed by the file system using compression, e.g. sparse files
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
技术领域technical field
本发明涉及一种基于RLE和LZW的优化比特文件压缩与解压缩方法,属于通信中比特文件压缩与解压缩技术领域。The invention relates to an optimized bit file compression and decompression method based on RLE and LZW, and belongs to the technical field of bit file compression and decompression in communication.
背景技术Background technique
随着星上应用复杂度的增加,对星上数据处理能力的要求也越来越高,采用的FPGA型号也随着应用复杂度的提升而不得不采用更高等级的器件。这些先进型号的FPGA由于功能的更为强大,所对应的比特文件也变得更大,配置一片V5130T的FPGA的比特文件较V4SX55增长了大约3倍左右,这就意味着应用一片V5FPGA需要过去3倍的存储资源来存储配置比特,这对星上有限的资源来说无疑是个问题,必须要采取一定的压缩方法来降低存储资源。而且必须满足以下要求:1)必须无损的还原比特文件,对比特流进行解压缩要求能够准确地恢复出原数据;2)压缩率要高,压缩解压缩时间要短。针对这个问题及以上两点要求,提出了一种基于RLE和LZW的优化比特文件压缩与解压缩方法,以实现高速高压缩率的比特文件压缩解压缩。With the increase in the complexity of on-board applications, the requirements for on-board data processing capabilities are getting higher and higher, and the FPGA models used have to use higher-level devices with the increase in application complexity. Due to the more powerful functions of these advanced FPGA models, the corresponding bit files have also become larger. The bit files of an FPGA configured with a V5130T have increased by about 3 times compared with the V4SX55, which means that the application of a V5 FPGA requires the past 3 Times the storage resources to store the configuration bits, which is undoubtedly a problem for the limited resources on the star, and certain compression methods must be adopted to reduce storage resources. And the following requirements must be met: 1) the bit file must be restored without loss, and the bit stream must be decompressed to accurately restore the original data; 2) the compression rate should be high, and the compression and decompression time should be short. Aiming at this problem and the above two requirements, an optimized bitfile compression and decompression method based on RLE and LZW is proposed to achieve high-speed and high compression rate bitfile compression and decompression.
数据压缩通常包括有损压缩和无损压缩两种。有损压缩是有失真的压缩,不可逆的,信息会受到损失。无损压缩是无失真的压缩,压缩过程中去除数据中的冗余度,解压后不丢失任何信息,与压缩前完全一致。无损压缩通常用于文本、程序、重要数据的压缩,它能保证完全地恢复原始数据。对比特流进行压缩要求能够准确地恢复出原数据,因此需要选用无损压缩技术对比特文件进行压缩和解压缩来解决配置比特数据的传输和存储问题。Data compression usually includes lossy compression and lossless compression. Lossy compression is compression with distortion, irreversible, and information will be lost. Lossless compression is lossless compression. The redundancy in the data is removed during the compression process, and no information is lost after decompression, which is exactly the same as before compression. Lossless compression is usually used for the compression of text, programs, and important data, and it can guarantee the complete restoration of the original data. Compressing the bit stream requires that the original data can be accurately restored, so it is necessary to use lossless compression technology to compress and decompress the bit file to solve the transmission and storage problems of the configuration bit data.
经典的无损压缩算法主要有:基于统计模式的算法,如香农编码、霍夫曼编码、算术编码等;基于字典模式的算法,如LZ系列算法;还有一些其它的算法,如游程编码、JPEG-LS算法、JPEG2000的DEM算法、BWT算法等。综合考虑设计复杂度和压缩效率,字典模式的算法较统计模式的算法更适合用于比特文件压缩。国内外目前针对比特文件压缩主要采用的压缩方法是字典式压缩或者采用游程编码技术压缩。Xilinx自己的压缩工具采用字典式的LZ77方法进行比特文件压缩。通过后面的实验数据可以看出,Xilinx压缩的比特文件压缩率并不高。The classic lossless compression algorithms mainly include: algorithms based on statistical modes, such as Shannon coding, Huffman coding, arithmetic coding, etc.; algorithms based on dictionary modes, such as LZ series algorithms; and some other algorithms, such as run-length coding, JPEG -LS algorithm, DEM algorithm of JPEG2000, BWT algorithm, etc. Considering the design complexity and compression efficiency, the dictionary mode algorithm is more suitable for bit file compression than the statistical mode algorithm. At present, the main compression methods for bit file compression at home and abroad are dictionary compression or run-length coding compression. Xilinx's own compression tool uses the dictionary-style LZ77 method for bitfile compression. It can be seen from the following experimental data that the compression rate of Xilinx compressed bit files is not high.
发明内容Contents of the invention
本发明解决的技术问题为:克服现有技术不足,提供一种基于RLE和LZW的优化比特文件压缩与解压缩方法,在快速压缩和高压缩率的要求下,本发明通过对比特文件数据结构进行分析,适应性的优化改进了RLE算法,并结合LZW方法进一步提升压缩率,设计了一种基于RLE和LZW的优化比特文件压缩/解压缩方法,该方法通过对比特文件数据结构的分析,创造性的根据比特文件特点优化了RLE算法;在应用优化RLE算法的基础上,为了进一步提升压缩率,创造性地将优化后的RLE算法并与LZW算法结合,应用于比特文件压缩解压缩。该方法节省了存储资源,提高了计算效率,压缩及解压缩的设计实现,验证了方法的正确性、有效性、高效性和可行性。The technical problem solved by the present invention is: to overcome the deficiencies in the prior art, to provide a method for compressing and decompressing optimized bit files based on RLE and LZW, and under the requirements of fast compression and high compression rate, the present invention adopts the bit file data structure Analysis, adaptive optimization improved the RLE algorithm, combined with the LZW method to further improve the compression rate, and designed an optimized bit file compression/decompression method based on RLE and LZW. This method analyzes the bit file data structure, Creatively optimize the RLE algorithm according to the characteristics of the bit file; on the basis of applying the optimized RLE algorithm, in order to further improve the compression rate, creatively combine the optimized RLE algorithm with the LZW algorithm and apply it to the bit file compression and decompression. This method saves storage resources and improves computing efficiency. The design and implementation of compression and decompression verify the correctness, effectiveness, efficiency and feasibility of the method.
本发明解决的技术方案为:一种基于RLE和LZW的优化比特文件压缩方法,包括步骤如下:The technical scheme that the present invention solves is: a kind of optimization bit file compression method based on RLE and LZW, comprises steps as follows:
步骤一:FPGA配置比特文件由多部分数据组成,包含头部控制字、数据和命令字,其中,数据和命令字格式都是以四字节为一个单位,抠除FPGA配置比特文件的头部控制字;Step 1: The FPGA configuration bit file is composed of multiple parts of data, including the header control word, data and command word. The format of the data and command word is in units of four bytes, and the header of the FPGA configuration bit file is removed. control word;
初始化RLE中的游长计数器;将RLE的游程长度根据步骤一所述比特文件数据特点设置为4;The run length counter in the initialization RLE; The run length of RLE is set to 4 according to the bit file data characteristics described in step 1;
初始化LZW的压缩字典,使字典包含所有可能的根,所述根为单一词条;Initialize the compressed dictionary of LZW so that the dictionary contains all possible roots, and the root is a single entry;
设置前缀pre_char,令当前前缀pre_char为空;Set the prefix pre_char, so that the current prefix pre_char is empty;
步骤二:设置字符串pre_string;将步骤一中抠除头部控制字的FPGA配置比特文件的第一个字符串赋给字符串pre_string;所述抠除头部控制字的FPGA配置比特文件为被压缩文件;Step 2: the string pre_string is set; the first character string of the FPGA configuration bit file that removes the header control word is assigned to the string pre_string in step 1; the FPGA configuration bit file that removes the header control word is set Compressed file;
步骤三:将被压缩文件进行压缩,步骤如下:Step 3: Compress the compressed file, the steps are as follows:
(1)判断被压缩文件中是否有字符串需要压缩,如果没有字符串需要压缩,则先输出字符串pre_string,再输出游长计数器的值,进入步骤四;(1) Judging whether there is a character string to be compressed in the compressed file, if there is no character string to be compressed, then first output the character string pre_string, then output the value of the tour length counter, and enter step 4;
(2)如果有字符串需要压缩,设置当前字符串current_string,令当前字符串current_string等于字符流中的下一个字符串;(2) If there is a character string that needs to be compressed, set the current character string current_string so that the current character string current_string is equal to the next character string in the character stream;
(3)判断pre_string与current_string是否一致:如果pre_string与current_string一致,游长计数器加1,判断游长计数器值是否计到255;如果游长计数器值计到255,先输出pre_string,再输出游长计数器值,令游长计数器值为1,(3) Determine whether pre_string is consistent with current_string: if pre_string is consistent with current_string, add 1 to the tour length counter, and judge whether the tour length counter reaches 255; if the tour length counter reaches 255, first output pre_string, and then output the tour length counter value, so that the swim length counter value is 1,
读取待压缩文件的未压缩的字符串给pre_string,返回步骤三Read the uncompressed string of the file to be compressed to pre_string, return to step 3
如果游长计数器值未计到255,返回步骤三;If the swim length counter value does not count to 255, return to step 3;
如果pre_string与current_string不一致,输出pre_string,输出游长计数器值,将此时current_string赋给pre_string,返回步骤三;If pre_string is inconsistent with current_string, output pre_string, output the value of the tour length counter, assign current_string to pre_string at this time, and return to step 3;
步骤四:设定当前字符current_char,按照步骤三(1)输出顺序,将输出依次排列成新的字符流,读取该字符流中的第一个字符赋给current_char;Step 4: Set the current character current_char, according to the output sequence of step 3 (1), arrange the output into a new character stream in turn, read the first character in the character stream and assign it to current_char;
步骤五:判断pre_char与current_char依次排列组成的词条是否在字典中:如果在字典中,将pre_char与current_char依次排列组成的词条赋给pre_char;如果未在字典中,则输出当前前缀pre_char的码字,添加pre_char与current_char依次排列组成的词条到字典中,将current_char的值赋给pre_char;Step 5: Determine whether the entry consisting of pre_char and current_char is in the dictionary: if it is in the dictionary, assign the entry consisting of pre_char and current_char to pre_char; if it is not in the dictionary, output the code of the current prefix pre_char word, add the entries composed of pre_char and current_char in sequence to the dictionary, and assign the value of current_char to pre_char;
步骤六:判断新的字符流中是否还有字符需要压缩,如果有字符需要压缩,将需要压缩的第一个字符赋给current_char,返回步骤五;如果没有字符需要压缩,输出当前前缀pre_char的码字,完成压缩。Step 6: Determine whether there are characters in the new character stream that need to be compressed. If there are characters that need to be compressed, assign the first character that needs to be compressed to current_char, and return to step 5; if there are no characters that need to be compressed, output the code of the current prefix pre_char word, complete the compression.
LZW的压缩字典用于存储压缩过程中产生的词条。LZW's compression dictionary is used to store the entries generated during the compression process.
游长计数器,从1开始计数,即读取第一个字符串时计1,能够在遇到连续重复出现的字符串时每次加1,直到出现不同的字符串时,能够输出游长计数器的值,还原初值1;游长计数器的值为1-255,达到255时还原1。The swim length counter starts counting from 1, that is, counts 1 when reading the first character string, and can add 1 each time when encountering consecutive repeated strings, until a different character string appears, it can output the swim length counter value, restore the initial value 1; the value of the swim length counter is 1-255, and restore 1 when it reaches 255.
初始化LZW的压缩字典的索引值为1-4096。Initialize LZW's compression dictionary with index values 1-4096.
一种基于RLE和LZW的优化比特文件解压缩方法,包括步骤如下:A kind of optimized bit file decompression method based on RLE and LZW, comprises steps as follows:
步骤一:初始化解压缩字典,使字典包含所有可能的根,所述根为单一词条;Step 1: Initialize the decompression dictionary, so that the dictionary contains all possible roots, and the root is a single entry;
步骤二:设置变量pw,读取待解压缩数据流中第一个码流,赋值给pw,以pw为索引查询解压缩字典,读取该索引对应的词条,设置字符串变量pre_char,将pw表示的索引对应的词条赋给pre_char,并输出pre_char;Step 2: Set the variable pw, read the first code stream in the data stream to be decompressed, assign it to pw, query the decompression dictionary with pw as the index, read the entry corresponding to the index, set the string variable pre_char, and set The entry corresponding to the index represented by pw is assigned to pre_char, and pre_char is output;
步骤三:设置变量cw,继续读取待解压缩数据中的下一个码流,赋值给cw,判断在字典中是否有cw表示的索引对应的词条,如果有cw表示的索引对应的词条,输出cw表示的索引对应的词条,即cw表示的索引对应的字符串数据,设置变量current_char,将cw表示的索引对应的字符串数据赋值给current_char,设置字符变量pc,将pre_char赋值给pc,设置字符变量cc,将current_char对应的词条的第一个字符赋给cc,将pc和cc依次排列组成的字符串添加到解压缩字典中;如果没有cw表示的索引对应的词条,将pre_char的值赋给pc,将current_char的第一个字符赋给cc,输出pc和cc依次排列组成的字符串数据,并添加pc和cc依次排列组成的字符串数据到字典中;Step 3: Set the variable cw, continue to read the next code stream in the data to be decompressed, assign it to cw, and judge whether there is an entry corresponding to the index represented by cw in the dictionary, if there is an entry corresponding to the index represented by cw , output the entry corresponding to the index represented by cw, that is, the string data corresponding to the index represented by cw, set the variable current_char, assign the string data corresponding to the index represented by cw to current_char, set the character variable pc, and assign pre_char to pc , set the character variable cc, assign the first character of the entry corresponding to current_char to cc, and add the string composed of pc and cc in sequence to the decompression dictionary; if there is no entry corresponding to the index represented by cw, set Assign the value of pre_char to pc, assign the first character of current_char to cc, output the string data composed of pc and cc arranged in sequence, and add the string data composed of pc and cc arranged in sequence to the dictionary;
步骤四:判断待解压缩数据流中是否还有数据需要解压缩,如果还有数据需要解压缩,返回步骤三;如果没有数据需要解压缩,将步骤三的输出按输出顺序排列成新的字符串数据,识别新的字符串数据中的头部控制字;设置字符串head,将头部控制字赋值给head;Step 4: Determine whether there is still data to be decompressed in the data stream to be decompressed, if there is still data to be decompressed, return to step 3; if there is no data to be decompressed, arrange the output of step 3 into new characters in the output order String data, identify the head control word in the new string data; set the string head, and assign the head control word to head;
步骤五:设置字符串变量current_string,从去掉头部控制字的新的字符串数据中按照游长读取字符串赋值给current_string,然后再读取该字符串后的一个字符,即游长计数器的值,根据读取出的字符串和游长计数器的值还原出原始压缩数据;Step 5: Set the string variable current_string, read the string from the new string data without the header control word and assign it to current_string according to the length of the tour, and then read a character after the string, which is the value of the length counter Value, restore the original compressed data according to the read string and the value of the swim length counter;
步骤六:判断去掉头部控制字的新的字符串数据中是否还有待解压缩的数据,若有,则将待解压缩的数据代替去掉头部控制字的新的字符串数据,返回步骤五;,若无,则将head与步骤五输出的数据依次排列得到原始数据,完成解压缩。Step 6: Determine whether there is data to be decompressed in the new string data with the header control word removed, and if so, replace the new string data with the header control word removed with the data to be decompressed, and return to step 5 ;, if not, arrange the head and the data output in step 5 in order to obtain the original data, and complete the decompression.
本发明与现有技术相比的优点在于:The advantage of the present invention compared with prior art is:
(1)在快速压缩和高压缩率的要求下,本发明通过对比特文件数据结构进行分析,适应性的优化改进了RLE算法,并结合LZW方法进一步提升压缩率,设计了一种基于RLE和LZW的优化比特文件压缩/解压缩方法。该方法通过对比特文件数据结构的分析,创造性的根据比特文件特点优化了RLE算法;在应用优化RLE算法的基础上,为了进一步提升压缩率,创造性地将优化后的RLE算法并与LZW算法结合,应用于比特文件压缩解压缩。该方法节省了存储资源,提高了计算效率,压缩及解压缩的设计实现,验证了方法的正确性、有效性、高效性和可行性。(1) Under the requirements of fast compression and high compression rate, the present invention improves the RLE algorithm by analyzing the data structure of the bit file, and improves the RLE algorithm through adaptive optimization, and further improves the compression rate in conjunction with the LZW method, and designs a method based on RLE and Optimized bitfile compression/decompression methods for LZW. This method creatively optimizes the RLE algorithm according to the characteristics of the bit file by analyzing the data structure of the bit file; on the basis of applying the optimized RLE algorithm, in order to further improve the compression rate, the optimized RLE algorithm is creatively combined with the LZW algorithm , applied to bitfile compression and decompression. This method saves storage resources and improves computing efficiency. The design and implementation of compression and decompression verify the correctness, effectiveness, efficiency and feasibility of the method.
(2)本发明通过对比特文件结构以及RLE和LZW算法分析,针对比特文件设计了一种基于RLE和LZW的优化比特文件压缩以及解压缩技术方法,创造性的根据比特文件特点优化了RLE算法,为了进一步提升压缩率,创造性地将优化后的RLE算法并与LZW算法结合,应用于比特文件压缩解压缩,在保证一定压缩率的基础上节省了压缩时间和大量的存储资源,通过相应解压缩程序设计验证了压缩方法的正确性、高效性和可行性。(2) the present invention designs a kind of optimized bit file compression and decompression method based on RLE and LZW at the bit file by analyzing the bit file structure and RLE and LZW algorithm, creatively optimizes the RLE algorithm according to the bit file characteristics, In order to further improve the compression rate, the optimized RLE algorithm is creatively combined with the LZW algorithm and applied to bit file compression and decompression, which saves compression time and a large amount of storage resources on the basis of ensuring a certain compression rate, and through corresponding decompression The program design verifies the correctness, efficiency and feasibility of the compression method.
附图说明Description of drawings
图1为本发明基本数码结构;Fig. 1 is basic digital structure of the present invention;
图2为本发明一种基于RLE和LZW的优化比特文件压缩算法流程图;Fig. 2 is a kind of optimization bit file compression algorithm flowchart based on RLE and LZW of the present invention;
图3为本发明一种基于RLE和LZW的优化比特文件解压缩算法流程图;Fig. 3 is a kind of optimized bit file decompression algorithm flowchart based on RLE and LZW of the present invention;
图4为不同压缩算法压缩率比较示意图。Fig. 4 is a schematic diagram showing the comparison of compression ratios of different compression algorithms.
具体实施方式detailed description
本发明的基本思路为:一种基于RLE和LZW的优化比特文件压缩与解压缩方法,通过对FPGA配置比特文件进行数据格式分析,抠出比特文件的头部控制字,从真实配置数据开始,采用游长为4的RLE编码进行初步压缩,再进行LZW压缩进一步提升压缩率。解压缩时为压缩的逆过程,先进行LZW解压缩还原出中间数据,再对不包含头部控制字的数据部分进行RLE解压缩,还原出原始的FPGA配置比特文件。该方法综合考虑了压缩/解压缩的时间和压缩率,与Xilinx自带的压缩工具比较,与单纯应用RLE算法,单纯应用LZW算法比较,实现了压缩率与压缩速度的双赢。解决了Xilinx先进型号FPGA配置比特文件过大的问题,节省了存储芯片的开销,为FPGA在轨重构技术提供了关键技术支撑。The basic idea of the present invention is: a kind of optimized bit file compression and decompression method based on RLE and LZW, by analyzing the data format of the FPGA configuration bit file, extracting the header control word of the bit file, starting from the real configuration data, RLE coding with a run length of 4 is used for initial compression, and then LZW compression is used to further improve the compression rate. Decompression is the inverse process of compression. First, LZW decompression is performed to restore the intermediate data, and then the data part that does not contain the header control word is decompressed by RLE to restore the original FPGA configuration bit file. This method comprehensively considers the compression/decompression time and compression rate. Compared with Xilinx's built-in compression tool, and the simple application of RLE algorithm and LZW algorithm, it achieves a win-win situation of compression rate and compression speed. It solves the problem of excessively large configuration bit files of Xilinx advanced FPGA models, saves the cost of memory chips, and provides key technical support for FPGA on-orbit reconfiguration technology.
下面结合附图和具体实施例对本发明做进一步详细描述。The present invention will be further described in detail below in conjunction with the accompanying drawings and specific embodiments.
游程编码(RLE)又称为行程编码,是一种相对简单的数据压缩技术。游程指的是由信源符号或信号样值构成的数据流中各个字符连续重复而形成字符串的长度,又称游程长度或游长。游程编码就是将这种字符序列映射成串的字符串的长度和串的位置的标志序列,当给定了行程串的字符、串的位置和长度,就能够恢复出原始数据流。数据流的基本数码结构如图1所示,其中标识码根据具体使用而定,也可以省略。Run-length encoding (RLE), also known as run-length encoding, is a relatively simple data compression technique. The run length refers to the length of a character string formed by the continuous repetition of each character in the data stream composed of source symbols or signal samples, also known as the run length or run length. Run-length encoding is to map this sequence of characters into the length of the string and the position of the string. When the characters of the run-length string, the position and length of the string are given, the original data stream can be recovered. The basic digital structure of the data stream is shown in Figure 1, where the identification code depends on the specific use and can also be omitted.
根据游程编码的数据流基本结构可知,只有游程长度大于3时,游程编码才具有数据压缩的功能。游程编码的效率取决于信源符号的重复率,重复率越高,游长越长,其压缩效果越明显。游程压缩逻辑和硬件实现简单,且速度很快。在实际工程中有时将游程编码和其它编码方法一起混合使用,能获得更好的压缩效果。According to the basic structure of the data stream of the run-length coding, it can be seen that the run-length coding has the function of data compression only when the length of the run length is greater than 3. The efficiency of run-length coding depends on the repetition rate of the source symbols. The higher the repetition rate and the longer the run length, the more obvious the compression effect. Runlength compression logic and hardware implementation are simple and fast. In actual engineering, run-length coding is sometimes mixed with other coding methods to obtain better compression effects.
由游程编码的原理可以知道,只有当被压缩样本重复率比较高的时候游程编码的压缩效果才会较好。分析比特文件的架构,首先每个比特文件都有自己的头部信息,这部分信息样本的重复率非常低,相对于整个比特文件而言,头部信息的所占的比特位非常少,故在对比特文件进行压缩时,抠出头部信息位,仅对头部信息后面的数据进行压缩,这样一定程度上提升了压缩速度和压缩率。抠出头部信息后,剩余的比特文件仍是有一定规律的,那就是不管是命令字还是数据都是以4个字节为一个单位的,这样应用游程编码对比特文件压缩的游长选取为4字节是最合适的,选取小于4字节的话会增加更多的游长信息在压缩后的文件中,会降低压缩率;选取大于4字节的话,样本的重复率会降低,在压缩后的文件中会增加标识码信息,降低压缩率。在实现了优化RLE压缩算法后,通过实验也证实了分析结果。It can be known from the principle of run-length coding that the compression effect of run-length coding will be better only when the repetition rate of the compressed sample is relatively high. Analyzing the structure of the bitfile, firstly, each bitfile has its own header information, and the repetition rate of this part of information samples is very low. Compared with the whole bitfile, the header information occupies very few bits, so When compressing bit files, the header information bits are cut out, and only the data behind the header information is compressed, which improves the compression speed and compression rate to a certain extent. After extracting the header information, the remaining bit files still have certain rules, that is, both the command word and the data are based on 4 bytes as a unit, so the length selection of bit file compression by using run-length encoding 4 bytes is the most suitable. If you choose less than 4 bytes, more length information will be added in the compressed file, which will reduce the compression rate; if you choose more than 4 bytes, the repetition rate of the sample will decrease. The identification code information will be added to the compressed file, reducing the compression ratio. After implementing the optimized RLE compression algorithm, the analysis results are also confirmed by experiments.
改进游程编码由于压缩过程不需要存储,没有计算,所以压缩速度很快,但是受限于比特文件复杂度和压缩算法本身,压缩率并不是特别高。故在此优化RLE算法的基础上进一步结合LZW算法对压缩后的数据进行进一步的处理来提升压缩率。Improved run-length coding Since the compression process does not require storage and calculation, the compression speed is very fast, but limited by the complexity of the bit file and the compression algorithm itself, the compression rate is not particularly high. Therefore, on the basis of optimizing the RLE algorithm, the LZW algorithm is further combined to further process the compressed data to improve the compression rate.
LZW算法由Terry Welch在1984年提出,它是LZ78的改进算法,与LZ78算法相比,去掉了标识的第二个字段。LZW算法是基于字典模式的压缩算法,不依赖于信源的概率分布,是一种面向通用数据、易于实现的无损数据压缩算法。LZW算法不依赖于任何数据格式,具有很大的应用范围,并且编码速度快,逻辑简单而且具有自适应的功能,特别有利于硬件实现同时具有很高的实时性。The LZW algorithm was proposed by Terry Welch in 1984. It is an improved algorithm of LZ78. Compared with the LZ78 algorithm, the second field of the identification is removed. The LZW algorithm is a compression algorithm based on the dictionary mode, which does not depend on the probability distribution of the information source. It is a lossless data compression algorithm for general data and easy to implement. LZW algorithm does not depend on any data format, has a wide range of applications, and has fast encoding speed, simple logic and self-adaptive function, which is especially beneficial to hardware implementation and has high real-time performance.
LZW算法首先将字母表中的所有字符初始化到字典中,通常使用8位字符,因此在输入数据之前就已经占用了字典的前256项,即0~255。因为字典已经被初始化,所以输入的下一个字符总能在字典中找到。实际中字典编码就是对8位字符集的扩充,用来表示数据中出现的字符串,新增的字典编码可用9位、10位、11位、12位甚至更多位来表示。例如若每个字符串用9位表示,可以有512个不同的9位代码。这就是说,转换表有512个字符串,其中256个表项用来存放已定义的字符,剩下256个用来存放(前缀,字符串)。The LZW algorithm first initializes all characters in the alphabet into the dictionary, usually using 8-bit characters, so the first 256 items of the dictionary, ie 0-255, have been occupied before the data is input. Since the dictionary has already been initialized, the next character typed will always be found in the dictionary. In practice, the dictionary encoding is an extension of the 8-bit character set, which is used to represent the strings appearing in the data. The newly added dictionary encoding can be represented by 9 bits, 10 bits, 11 bits, 12 bits or even more bits. For example, if each character string is represented by 9 bits, there can be 512 different 9-bit codes. That is to say, the conversion table has 512 character strings, 256 of which are used to store defined characters, and the remaining 256 are used to store (prefix, string).
LZW算法的编码原理如下:首先需要初始化字典,将前256项分给0~255,然后每读入一个字符pre_char,均必须先在字典中进行查找。如果字典中已经有该字符,则更新当前字符为pre_char,并且将当前字符pre_char作为前缀,继续读入下一字符current_char作为尾字符,组成一个字符串“pre_char,current_char”,并再次在字典中查找“pre_char,current_char”。如果字典中没有,则输出字符pre_char位置码,并将“pre_char,current_char”添加到字典中,然后将current_char作为前缀。重复以上步骤,直到所有编码完成。The encoding principle of the LZW algorithm is as follows: firstly, the dictionary needs to be initialized, and the first 256 items are allocated to 0~255, and then each time a character pre_char is read, it must first be searched in the dictionary. If the character already exists in the dictionary, update the current character to pre_char, and use the current character pre_char as a prefix, continue to read the next character current_char as the end character, form a string "pre_char, current_char", and look it up in the dictionary again "pre_char, current_char". If not in the dictionary, output the character pre_char position code, and add "pre_char, current_char" to the dictionary, and then use current_char as a prefix. Repeat the above steps until all encodings are completed.
LZW的解码算法是编码的逆过程,同样的表现为一种基于字典的自适应的算法,一边生成字典,一边解码输出。The decoding algorithm of LZW is the inverse process of encoding, which is also an adaptive algorithm based on the dictionary, which generates the dictionary and decodes the output at the same time.
综上所述,本发明提出了一种基于RLE和LZW的优化比特文件压缩方法,包括步骤如下:In summary, the present invention proposes a kind of optimized bit file compression method based on RLE and LZW, comprising steps as follows:
步骤一:FPGA配置比特文件由多部分数据组成,主要包含头部控制字、数据和命令字,其中,数据和命令字格式都是以四字节为一个单位,抠除FPGA配置比特文件的头部控制字;Step 1: The FPGA configuration bit file is composed of multiple parts of data, mainly including the header control word, data and command word. The format of the data and command word is four bytes as a unit, and the header of the FPGA configuration bit file is removed. part control word;
初始化RLE中的游长计数器为1;将RLE的游程长度根据步骤一所述比特文件数据特点设置为4;The run length counter in the initialization RLE is 1; The run length of RLE is set to 4 according to the bit file data characteristics described in step 1;
初始化LZW的压缩字典为4096行*32列,使字典包含所有可能的根,所述根为单一词条,即初始化后的字典第0到255行的第一列数据为0-255;Initialize the compression dictionary of LZW to be 4096 rows*32 columns, so that the dictionary contains all possible roots, and the root is a single entry, that is, the first column data of rows 0 to 255 of the initialized dictionary is 0-255;
设置前缀pre_char,令当前前缀pre_char为空;Set the prefix pre_char, so that the current prefix pre_char is empty;
步骤二:设置字符串pre_string;将步骤一中抠除头部控制字的FPGA配置比特文件的第一个字符串赋给字符串pre_string;所述抠除头部控制字的FPGA配置比特文件为被压缩文件;Step 2: the string pre_string is set; the first character string of the FPGA configuration bit file that removes the header control word is assigned to the string pre_string in step 1; the FPGA configuration bit file that removes the header control word is set Compressed file;
步骤三:Step three:
(1)判断被压缩文件中是否有字符串需要压缩,如果没有字符串需要压缩,则先输出字符串pre_string,再输出游长计数器的值,进入步骤四;(1) Judging whether there is a character string to be compressed in the compressed file, if there is no character string to be compressed, then first output the character string pre_string, then output the value of the tour length counter, and enter step 4;
(2)如果有字符串需要压缩,设置当前字符串current_string,令当前字符串current_string等于字符流中的下一个字符串;(2) If there is a character string that needs to be compressed, set the current character string current_string so that the current character string current_string is equal to the next character string in the character stream;
(3)判断pre_string与current_string是否一致:如果pre_string与current_string一致,游长计数器加1,判断游长计数器值是否计到255;如果游长计数器值计到255,先输出pre_string,再输出游长计数器值,令游长计数器值为1,(3) Determine whether pre_string is consistent with current_string: if pre_string is consistent with current_string, add 1 to the tour length counter, and judge whether the tour length counter reaches 255; if the tour length counter reaches 255, first output pre_string, and then output the tour length counter value, so that the swim length counter value is 1,
读取待压缩文件的未压缩的字符串给pre_string,返回步骤三Read the uncompressed string of the file to be compressed to pre_string, return to step 3
如果游长计数器值未计到255,返回步骤三;If the swim length counter value does not count to 255, return to step 3;
如果pre_string与current_string不一致,输出pre_string,输出游长计数器值,将此时current_string赋给pre_string,返回步骤三;If pre_string is inconsistent with current_string, output pre_string, output the value of the tour length counter, assign current_string to pre_string at this time, and return to step 3;
步骤四:(1)设定当前字符current_char,Step 4: (1) Set the current character current_char,
(2)按照步骤三(1)输出顺序,将输出依次排列成新的字符流,读取该字符流中的第一个字符赋给current_char;为了提高压缩速度,该步骤可以在步骤三有数据输出时同时启动进行,读取步骤三输出的第一个字符给current_char,然后进行后续步骤;(2) According to the output sequence of step 3 (1), arrange the output into a new character stream in turn, read the first character in the character stream and assign it to current_char; in order to improve the compression speed, this step can have data in step 3 Start at the same time when outputting, read the first character output in step 3 to current_char, and then proceed to the subsequent steps;
步骤五:判断pre_char与current_char依次排列组成的词条是否在字典中:如果是在字典中,将pre_char与current_char依次排列组成的词条付给pre_char;如果未在字典中,则输出当前前缀pre_char的码字,添加pre_char与current_char依次排列组成的词条到字典中,将current_char的值赋给pre_char;Step 5: Determine whether the entry composed of pre_char and current_char is in the dictionary: if it is in the dictionary, pay the entry composed of pre_char and current_char to pre_char; if it is not in the dictionary, output the current prefix pre_char Codeword, add the entries composed of pre_char and current_char in sequence to the dictionary, and assign the value of current_char to pre_char;
步骤六:判断新的字符流中是否还有字符需要压缩,如果有字符需要压缩,将需要压缩的第一个字符付给current_char,返回步骤五;如果没有字符需要压缩,输出当前前缀pre_char的码字,完成压缩。Step 6: Determine whether there are characters in the new character stream that need to be compressed. If there are characters that need to be compressed, pay the first character that needs to be compressed to current_char, and return to step 5; if there are no characters that need to be compressed, output the code of the current prefix pre_char word, complete the compression.
LZW的压缩字典用于存储压缩过程中产生的词条。LZW's compression dictionary is used to store the entries generated during the compression process.
游长计数器,从1开始计数,即读取第一个字符串时计1,能够在遇到连续重复出现的字符串时每次加1,直到出现不同的字符串时,能够输出游长计数器的值,还原为初值1;游长计数器的值为1-255。The swim length counter starts counting from 1, that is, counts 1 when reading the first character string, and can add 1 each time when encountering consecutive repeated strings, until a different character string appears, it can output the swim length counter The value of is restored to the initial value 1; the value of the swim length counter is 1-255.
初始化LZW的压缩字典的索引值为1-4096。Initialize LZW's compression dictionary with index values 1-4096.
结合上述优化比特文件压缩算法及程序设计思路,一种基于RLE和LZW的优化比特文件压缩算法流程如图2所示。Combining the above-mentioned optimized bit file compression algorithm and program design ideas, a process flow of an optimized bit file compression algorithm based on RLE and LZW is shown in Figure 2.
在完成了压缩后,相对应于压缩技术处理后的数据,解压缩是压缩的逆过程既可以实现还原出原始数据,可以需要采用LZW算法还原出优化RLE压缩的数据,再进行优化RLE解压缩还原出最初的原始数据。解压缩与压缩思路相逆。After the compression is completed, corresponding to the data processed by the compression technology, decompression is the inverse process of compression, which can restore the original data, or use the LZW algorithm to restore the optimized RLE compressed data, and then optimize the RLE decompression Restore the original original data. Decompression is the opposite of compression.
下面给出一种优选的具体解压缩方法流程如图3所示,本发明优选的一种基于RLE和LZW的优化比特文件解压缩方法包括步骤如下:Provide a kind of preferred specific decompression method flow process as shown in Figure 3 below, a kind of optimal bit file decompression method based on RLE and LZW of the present invention preferably comprises steps as follows:
步骤一:初始化解压缩字典为4096行*32列,使字典包含所有可能的根,所述根为单一词条,即初始化后的字典第0到255行的第一列数据为0-255;Step 1: Initialize the decompression dictionary as 4096 rows*32 columns, so that the dictionary contains all possible roots, and the root is a single entry, that is, the data in the first column of rows 0 to 255 of the initialized dictionary is 0-255;
步骤二:设置变量pw,读取待解压缩数据流中第一个码流,赋值给pw,以pw为索引查询字典,读取该索引对应的词条,设置字符串变量pre_char,将pw表示的索引对应的词条赋给pre_char,并输出pre_char;如pw为10,查询索引为10的字典中字符串数据,赋值为pre_char;Step 2: Set the variable pw, read the first code stream in the data stream to be decompressed, assign it to pw, use pw as the index to query the dictionary, read the entry corresponding to the index, set the string variable pre_char, and represent pw The entry corresponding to the index of the index is assigned to pre_char, and pre_char is output; if pw is 10, and the string data in the dictionary whose index is 10 is searched, the value is assigned to pre_char;
步骤三:设置变量cw,继续读取待解压缩数据中的下一个码流,赋值给cw,判断在字典中是否有cw表示的索引对应的词条,如果有cw表示的索引对应的词条,输出cw表示的索引对应的字符串数据(输出cw表示的索引对应的词条,即cw表示的索引对应的字符串数据),设置变量current_char,将cw表示的索引对应的字符串数据赋值给current_char,设置字符变量pc,将pre_char赋值给pc,设置字符变量,将current_char对应的词条的第一个字符赋给cc,将pc和cc依次排列组成的字符串添加到解压缩字典中;如果没有cw表示的索引对应的词条,将pre_char的值赋给pc,将current_char的第一个字符赋给cc,输出pc和cc依次排列组成的字符串数据,并添加pc和cc依次排列组成的字符串数据到字典中;如待解压缩数据为“9 18 300…..4095”,则读取第一个pw值9,输出字典第9条表示的字符串“9256 256….256”给pre_char,并输出“9”;继续读取cw值18,该值在初始化的字典中,输出字典第18条表示的字符串“18 256 256….256”给current_char,并输出“18”,添加“9 18256….256”到字典中,该词条索引为257;继续读取cw值300,该值不在初始化的字典中,输出“18 18”,添加“18 18 256….256”到字典中,依次类推,直到所有数据处理完成。Step 3: Set the variable cw, continue to read the next code stream in the data to be decompressed, assign it to cw, and judge whether there is an entry corresponding to the index represented by cw in the dictionary, if there is an entry corresponding to the index represented by cw , output the string data corresponding to the index represented by cw (output the entry corresponding to the index represented by cw, that is, the string data corresponding to the index represented by cw), set the variable current_char, and assign the string data corresponding to the index represented by cw to current_char, set the character variable pc, assign pre_char to pc, set the character variable, assign the first character of the entry corresponding to current_char to cc, and add the string composed of pc and cc to the decompression dictionary; if If there is no entry corresponding to the index indicated by cw, assign the value of pre_char to pc, assign the first character of current_char to cc, output the string data composed of pc and cc arranged in sequence, and add the sequence composed of pc and cc String data into the dictionary; if the data to be decompressed is “9 18 300…..4095”, read the first pw value 9, and output the string “9256 256….256” represented by the ninth entry in the dictionary to pre_char, and output "9"; continue to read the cw value 18, which is in the initialized dictionary, output the string "18 256 256....256" represented by item 18 of the dictionary to current_char, and output "18", add Add "9 18256....256" to the dictionary, and the entry index is 257; continue to read the cw value 300, which is not in the initialized dictionary, output "18 18", add "18 18 256....256" to the dictionary , and so on, until all data processing is completed.
步骤四:判断待解压缩数据流中是否还有数据需要解压缩,如果还有数据需要解压缩,返回步骤三;如果没有数据需要解压缩,将步骤三的输出按输出顺序排列成新的字符串数据,识别新的字符串数据中的头部控制字;设置字符串head,将头部控制字赋值给head(如新的字符串数据为“头部控制字AA AA AA AA 02 BB BB BB BB 01 CC CC CC CC09……DD DD DD DD 03”,将头部控制字赋给head,对“AA AA AA AA 02 BB BB BB BB 01CC CC CC CC 09……DD DD DD DD 03”进行后续解压缩);Step 4: Determine whether there is still data to be decompressed in the data stream to be decompressed, if there is still data to be decompressed, return to step 3; if there is no data to be decompressed, arrange the output of step 3 into new characters in the output order string data, identify the head control word in the new string data; set the string head, assign the head control word to head (such as the new string data is "head control word AA AA AA 02 BB BB BB BB 01 CC CC CC CC09...DD DD DD DD 03", assign the head control word to the head, follow up on "AA AA AA AA 02 BB BB BB BB 01CC CC CC CC 09...DD DD DD DD 03" unzip);
步骤五:设置字符串变量current_string,从去掉头部控制字的新的字符串数据中按照游长读取字符串赋值给current_string,然后再读取该字符串后的一个字符,即游长计数器的值,根据读取出的字符串和游长计数器的值还原出原始压缩数据;如字符串“AABB CC DD 02”,读取current_string为“AA BB CC DD”,游长为2,还原后的数据为“AA BBCC DD AA BB CC DD”;Step 5: Set the string variable current_string, read the string from the new string data without the header control word and assign it to current_string according to the length of the tour, and then read a character after the string, which is the value of the length counter Value, restore the original compressed data according to the read string and the value of the length counter; such as the string "AABB CC DD 02", read the current_string as "AA BB CC DD", the length of the length is 2, and the restored The data is "AA BBCC DD AA BB CC DD";
步骤六:判断去掉头部控制字的新的字符串数据中是否还有待解压缩的数据,若有,则将带压缩的数据代替去掉头部控制字的新的字符串数据,返回步骤五;若无,则将head与步骤五输出的数据依次排列得到原始数据,完成解压缩。如带解压缩数据还有“AAAA AA AA 02 BB BB BB BB 01 CC CC CC CC 09……DD DD DD DD 03”,先读取“AA AA AAAA”,根据“02”,还原数据为“AA AA AA AA AA AA AA AA”;再读取“BB BB BB BB”,根据“01”,还原数据为“BB BB BB BB”,依次读完所有数据,直到读取“DD DD DD DD”,根据“03”,还原数据为“DD DD DD DD DD DD DD DD DD DD DD DD”(与头部控制字拼接完成完整原始数据解压缩为“头部控制字AA AA AA AA AA AA AA AA BB BB BB BB……DD DD DD DD DDDD DD DD DD DD DD DD”)。Step 6: judge whether there is data to be decompressed in the new character string data that removes the header control word, if so, then replace the new character string data that removes the header control word with compressed data, and return to step 5; If not, arrange the head and the data output in step 5 in order to obtain the original data, and complete the decompression. If there is "AAAA AA AA 02 BB BB BB BB 01 CC CC CC CC 09...DD DD DD DD 03" with decompressed data, read "AA AA AAAA" first, and restore the data to "AA" according to "02" AA AA AA AA AA AA"; read "BB BB BB BB" again, according to "01", restore the data to "BB BB BB BB", read all the data in turn until "DD DD DD DD" is read, According to "03", the restored data is "DD DD DD DD DD DD DD DD DD DD DD DD" (spliced with the header control word to complete the complete original data decompression as "header control word AA AA AA AA AA AA AA AA BB BB BB BB...DD DD DD DD DDDD DD DD DD DD DD").
6、变量current_char作为索引号,解压缩字典中相应的字符串数据。6. The variable current_char is used as the index number to decompress the corresponding string data in the dictionary.
相对应于压缩技术处理后的数据,解压缩技术首先需要采用LZW算法还原出优化RLE压缩的数据,再进行优化RLE解压缩还原出最初的原始数据。算法设计思路与压缩算法类似,具体解压缩算法流程如图3所示。Corresponding to the data processed by the compression technology, the decompression technology first needs to use the LZW algorithm to restore the optimized RLE compressed data, and then perform the optimized RLE decompression to restore the original original data. The algorithm design idea is similar to the compression algorithm, and the specific decompression algorithm flow is shown in Figure 3.
压缩和解压缩程序设计完成后,采用五种不同资源利用率的比特文件进行了压缩率测试和解压缩还原试验,还原后的数据与原始数据一致,验证了算法实现的正确性。压缩率大小如下表所示:After the compression and decompression program design is completed, five kinds of bit files with different resource utilization rates are used to test the compression rate and decompression restoration test. The restored data is consistent with the original data, which verifies the correctness of the algorithm implementation. The compression rate is shown in the table below:
表1压缩试验数据Table 1 Compression test data
图形化显示实验结果如图4所示,从实验结果可以看出:The graphical display of the experimental results is shown in Figure 4. From the experimental results, it can be seen that:
随着资源的增加,所有压缩方法的压缩率都在下降;对于资源使用非常少的数据(1%),我们开发的三种方法压缩率都在95%以上,Xilinx的压缩率只有85%;As resources increase, the compression ratios of all compression methods decrease; for data with very little resource usage (1%), the compression ratios of the three methods we developed are all above 95%, and the compression ratio of Xilinx is only 85%;
对于资源使用非常多的数据(99%),Xilinx的压缩方法压缩率只比优化RLE的压缩率略高,但还是远低于LZW以及优化RLE_LZW压缩方法;For data that uses a lot of resources (99%), the compression rate of Xilinx's compression method is only slightly higher than that of optimized RLE, but still far lower than that of LZW and optimized RLE_LZW compression methods;
对于资源稍多的数据(20%、56%、81%),LZW压缩方法的压缩率与其他三种方法比较是最高的(百分之七八十),Xilinx的压缩率是最低的(只能达到百分之二三十);For data with slightly more resources (20%, 56%, 81%), the compression rate of the LZW compression method is the highest (70% to 80%) compared with the other three methods, and the compression rate of Xilinx is the lowest (only can reach 20-30%);
RLE_LZW优化压缩方法,对于资源使用率较高的比特压缩率略低于LZW,差别不是很大,但在压缩时间上较LZW方法提升了许多,这是由于待压缩数据先经过优化RLE算法压缩,再送到LZW压缩时数据量较未压缩数据已经减少了很多。优化RLE算法本身不耗时,而LZW算法本身由于数据需要与字典进行逐一比较,而字典本身又是动态更新的,所以非常耗时。RLE_LZW优化算法较单纯的LZW算法损失的压缩率是由于优化RLE算法处理后的压缩数据复杂度较原始数据增加,导致压缩率受到了一点影响。但是,综合考虑压缩时间与压缩率,一种基于RLE和LZW的优化比特文件压缩与解压缩技术是最优的。The RLE_LZW optimized compression method has a slightly lower compression rate than LZW for bits with high resource usage, and the difference is not very large, but the compression time is much improved compared with the LZW method. This is because the data to be compressed is first compressed by the optimized RLE algorithm. When it is sent to LZW for compression, the amount of data has been reduced a lot compared to uncompressed data. Optimizing the RLE algorithm itself is not time-consuming, but the LZW algorithm itself is very time-consuming because the data needs to be compared one by one with the dictionary, and the dictionary itself is dynamically updated. Compared with the simple LZW algorithm, the RLE_LZW optimization algorithm loses compression rate because the complexity of the compressed data processed by the optimized RLE algorithm is higher than that of the original data, resulting in a slight impact on the compression rate. However, considering the compression time and compression rate comprehensively, an optimized bit file compression and decompression technology based on RLE and LZW is optimal.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610752157.9A CN106407285B (en) | 2016-08-26 | 2016-08-26 | A kind of optimization bit file compression & decompression method based on RLE and LZW |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610752157.9A CN106407285B (en) | 2016-08-26 | 2016-08-26 | A kind of optimization bit file compression & decompression method based on RLE and LZW |
Publications (2)
Publication Number | Publication Date |
---|---|
CN106407285A true CN106407285A (en) | 2017-02-15 |
CN106407285B CN106407285B (en) | 2019-11-29 |
Family
ID=58003710
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610752157.9A Active CN106407285B (en) | 2016-08-26 | 2016-08-26 | A kind of optimization bit file compression & decompression method based on RLE and LZW |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN106407285B (en) |
Cited By (13)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN107294538A (en) * | 2017-06-09 | 2017-10-24 | 深圳市华星光电技术有限公司 | The compensation gauge pressure compression method and decompressing method of OLED display |
CN107483055A (en) * | 2017-08-04 | 2017-12-15 | 北京世纪铭辰科技有限公司 | A kind of lossless compression method and system |
CN108184082A (en) * | 2018-01-22 | 2018-06-19 | 豪威科技(上海)有限公司 | Image data transmission system and method |
CN108259041A (en) * | 2017-12-29 | 2018-07-06 | 中国电子科技集团公司第二十研究所 | A kind of Big Dipper data expansion method based on modified LZW Coding Compression Technologies |
CN108832935A (en) * | 2018-05-31 | 2018-11-16 | 郑州云海信息技术有限公司 | A kind of RLE algorithm implementation method, system, equipment and computer storage medium |
WO2018214140A1 (en) * | 2017-05-26 | 2018-11-29 | 深圳配天智能技术研究院有限公司 | Data compression method and data decompression method, and related device |
CN110518917A (en) * | 2019-07-17 | 2019-11-29 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | LZW data compression method and system based on Huffman coding |
CN110719105A (en) * | 2019-09-16 | 2020-01-21 | 上海御渡半导体科技有限公司 | Lossless compression and decompression method for test vector |
CN110928809A (en) * | 2019-11-25 | 2020-03-27 | 航天科技控股集团股份有限公司 | Method for programming image data to external Flash through CAN bus |
WO2020259400A1 (en) * | 2019-06-25 | 2020-12-30 | 比亚迪股份有限公司 | Encoding method and apparatus, storage medium, and computer device |
CN112579128A (en) * | 2020-12-23 | 2021-03-30 | 恒为科技(上海)股份有限公司 | Data processing method, upper computer, single chip microcomputer and system |
CN112968706A (en) * | 2021-01-29 | 2021-06-15 | 上海联影医疗科技股份有限公司 | Data compression method, FPGA chip and FPGA online upgrading method |
CN113709144A (en) * | 2021-08-26 | 2021-11-26 | 哈尔滨工业大学 | High-frequency signal compression method |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105630999A (en) * | 2015-12-28 | 2016-06-01 | 华为技术有限公司 | Data compressing method and device of server |
-
2016
- 2016-08-26 CN CN201610752157.9A patent/CN106407285B/en active Active
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105630999A (en) * | 2015-12-28 | 2016-06-01 | 华为技术有限公司 | Data compressing method and device of server |
Non-Patent Citations (3)
Title |
---|
刘建: "《多媒体技术基础及应用》", 31 March 2008, 机械工业出版社 * |
刘立柱等: "《无失真信源编码纠错译码理论与技术》", 28 February 2008, 国防工业出版社 * |
王新年等: "《数字图像压缩技术实用教程》", 31 October 2009, 机械工业出版社 * |
Cited By (19)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2018214140A1 (en) * | 2017-05-26 | 2018-11-29 | 深圳配天智能技术研究院有限公司 | Data compression method and data decompression method, and related device |
CN110799959B (en) * | 2017-05-26 | 2024-02-27 | 深圳配天智能技术研究院有限公司 | Data compression method, decompression method and related equipment |
CN110799959A (en) * | 2017-05-26 | 2020-02-14 | 深圳配天智能技术研究院有限公司 | Data compression method, decompression method and related equipment |
CN107294538A (en) * | 2017-06-09 | 2017-10-24 | 深圳市华星光电技术有限公司 | The compensation gauge pressure compression method and decompressing method of OLED display |
CN107294538B (en) * | 2017-06-09 | 2020-09-01 | 深圳市华星光电半导体显示技术有限公司 | Compression method and decompression method for compensation gauge of OLED display device |
CN107483055B (en) * | 2017-08-04 | 2020-06-16 | 北京世纪铭辰科技有限公司 | Lossless compression method and system |
CN107483055A (en) * | 2017-08-04 | 2017-12-15 | 北京世纪铭辰科技有限公司 | A kind of lossless compression method and system |
CN108259041A (en) * | 2017-12-29 | 2018-07-06 | 中国电子科技集团公司第二十研究所 | A kind of Big Dipper data expansion method based on modified LZW Coding Compression Technologies |
CN108184082A (en) * | 2018-01-22 | 2018-06-19 | 豪威科技(上海)有限公司 | Image data transmission system and method |
CN108832935A (en) * | 2018-05-31 | 2018-11-16 | 郑州云海信息技术有限公司 | A kind of RLE algorithm implementation method, system, equipment and computer storage medium |
WO2020259400A1 (en) * | 2019-06-25 | 2020-12-30 | 比亚迪股份有限公司 | Encoding method and apparatus, storage medium, and computer device |
US11750211B2 (en) | 2019-06-25 | 2023-09-05 | Byd Company Limited | Encoding method and apparatus, storage medium, and computer device |
CN110518917B (en) * | 2019-07-17 | 2023-01-03 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | LZW data compression method and system based on Huffman coding |
CN110518917A (en) * | 2019-07-17 | 2019-11-29 | 华东计算技术研究所(中国电子科技集团公司第三十二研究所) | LZW data compression method and system based on Huffman coding |
CN110719105A (en) * | 2019-09-16 | 2020-01-21 | 上海御渡半导体科技有限公司 | Lossless compression and decompression method for test vector |
CN110928809A (en) * | 2019-11-25 | 2020-03-27 | 航天科技控股集团股份有限公司 | Method for programming image data to external Flash through CAN bus |
CN112579128A (en) * | 2020-12-23 | 2021-03-30 | 恒为科技(上海)股份有限公司 | Data processing method, upper computer, single chip microcomputer and system |
CN112968706A (en) * | 2021-01-29 | 2021-06-15 | 上海联影医疗科技股份有限公司 | Data compression method, FPGA chip and FPGA online upgrading method |
CN113709144A (en) * | 2021-08-26 | 2021-11-26 | 哈尔滨工业大学 | High-frequency signal compression method |
Also Published As
Publication number | Publication date |
---|---|
CN106407285B (en) | 2019-11-29 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106407285B (en) | A kind of optimization bit file compression & decompression method based on RLE and LZW | |
WO2019153700A1 (en) | Encoding and decoding method, apparatus and encoding and decoding device | |
US10187081B1 (en) | Dictionary preload for data compression | |
CN107565971B (en) | Data compression method and device | |
CN103236847A (en) | Multilayer Hash structure and run coding-based lossless compression method for data | |
CN102122960A (en) | Multi-character combination lossless data compression method for binary data | |
CN110021369B (en) | Gene sequencing data compression and decompression method, system and computer readable medium | |
CN100517979C (en) | Data compression and decompression method | |
CN104125475B (en) | Multi-dimensional quantum data compressing and uncompressing method and apparatus | |
Nandi et al. | A compression technique based on optimality of LZW code (OLZW) | |
CN101534124A (en) | Compression algorithm for short natural language | |
CN104156990A (en) | Lossless compressed encoding method and system supporting oversize data window | |
JP2022048930A (en) | Data compression method, data compression device, data compression program, data decompression method, data decompression device, and data decompression program | |
Mathpal et al. | A research paper on lossless data compression techniques | |
CN104682966B (en) | The lossless compression method of table data | |
Konecki et al. | Efficiency of lossless data compression | |
US8018359B2 (en) | Conversion of bit lengths into codes | |
CN117895950A (en) | Data compression method based on radar algorithm | |
CN115913246A (en) | Lossless Data Compression Algorithm Based on Adaptive Instantaneous Entropy | |
CN1964351A (en) | A method to reduce network flow of game server by data package compression | |
CN115865098A (en) | Data Compression Method Based on Huffman Coding | |
JP2005521324A (en) | Method and apparatus for lossless data compression and decompression | |
Begum et al. | An efficient text compression for massive volume of data | |
JPH0628149A (en) | Data compression method for multiple types of data | |
Mahmoudi et al. | Comparison of Compression Algorithms in text data for Data Mining |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |