WO2020232683A1 - 一种基于流水式的硬件压缩的系统及方法 - Google Patents
一种基于流水式的硬件压缩的系统及方法 Download PDFInfo
- Publication number
- WO2020232683A1 WO2020232683A1 PCT/CN2019/088033 CN2019088033W WO2020232683A1 WO 2020232683 A1 WO2020232683 A1 WO 2020232683A1 CN 2019088033 W CN2019088033 W CN 2019088033W WO 2020232683 A1 WO2020232683 A1 WO 2020232683A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- character
- data
- unit
- matching
- compressed
- Prior art date
Links
Images
Classifications
-
- H—ELECTRICITY
- H03—ELECTRONIC CIRCUITRY
- H03M—CODING; DECODING; CODE CONVERSION IN GENERAL
- H03M7/00—Conversion of a code where information is represented by a given sequence or number of digits to a code where the same, similar or subset of information is represented by a different sequence or number of digits
- H03M7/30—Compression; Expansion; Suppression of unnecessary data, e.g. redundancy reduction
- H03M7/40—Conversion to or from variable length codes, e.g. Shannon-Fano code, Huffman code, Morse code
Definitions
- the present invention relates to the technical field of data compression, in particular to a system and method based on pipeline hardware compression.
- the embodiment of the present invention provides a pipeline-based hardware compression system and method to increase the data compression rate and reduce the time and memory resources occupied by the central processing unit.
- the first aspect of the present invention provides a pipeline-based hardware compression system, which includes a management control unit, a pipeline matching unit, a standard format conversion unit, a static Huffman coding unit, and a data stream generation unit;
- the management control unit is configured to obtain M bits of data to be compressed from an input buffer channel, where M is a positive integer, divide the M bits of data to be compressed into N characters, and divide the N characters into N characters Periodically input the pipeline matching unit, where N is a positive integer less than M, obtain (M/N) bits of compressed data from the data stream generating unit in each period, and output M bits of compressed data after obtaining N periods ;
- the pipeline matching unit is used to calculate the position where the i-th character matches the previous (i-1) character and the same length of continuous matching, where i is a positive integer not greater than N;
- the standard format conversion unit is configured to match the i-th character, the i-th character, and the first (i-1) character to the same position, and the i-th character to continuously match the same length Standard data converted into standard data format;
- the static Huffman coding unit is used to encode the standard data to obtain a Huffman coded stream
- the data stream generating unit is used to convert the Huffman coded stream into compressed data of every cycle (M/N) bit for output.
- the management control unit specifically includes:
- the input state machine unit is configured to obtain the M-bit data to be compressed from the input buffer channel, divide the M-bit data to be compressed into the N characters, and divide the N characters into N periodic input In the pipeline matching unit, each of the N characters is (M/N) bits;
- a state setting unit configured to set the large and small end conversion of the M-bit data to be compressed and the M-bit compressed data
- the output state machine unit is configured to obtain the (M/N) bit compressed data from the data stream generating unit every period, and output the M bit compressed data after obtaining N periods.
- the pipeline matching unit specifically includes:
- a matching position calculating unit configured to calculate the position where the i-th character matches the first (i-1) character
- K character matching units are used to match the i-th character with the characters stored in the K character matching units, and if the matches are the same, output matching signals, where K is a positive integer, and the K characters
- the matching unit has a pipeline structure. After the j-th character matching unit is matched, the character stored in the j-th character matching unit is output to the (j+1)-th character matching unit, and the j-th character is matched to the character stored in the unit Replace with the character input to the j-th character matching unit, where j is a positive integer less than K;
- the matching length calculation unit is used to calculate that the i-th character continuously matches the same length.
- the standard format conversion unit specifically includes:
- the first character buffer unit is configured to store the i-th character, the position where the i-th character matches the first (i-1) character, and the i-th character continuously matches the same length;
- the second character buffer unit is used to store the (i-1)th character, the position where the (i-1)th character matches the previous (i-2) character, and the (i-1)th character Consecutive characters match the same length;
- the third character buffer unit is used to store the (i-2)th character, the position where the (i-2)th character matches the same position as the previous (i-3) character, and the (i-2)th character Consecutive characters match the same length;
- the format conversion state machine unit is used for judging the data stored in the first character buffer unit, the second character buffer unit, and the third character buffer unit to combine the i-th character and the i-th character
- the character matches the same position with the first (i-1) characters, and the i-th character continuously matches the same length and is converted into the standard data;
- the standard data is a single character, or the standard data includes a position distance, a matching length, and a single character.
- the static Huffman coding unit specifically includes:
- a character encoding unit for converting the single character into a Huffman encoding format to obtain a first Huffman encoding stream
- a position coding unit for converting the position distance into a Huffman coding format
- Huffman encoding splicing unit used to splice the position distance, matching length and single character converted into Huffman encoding format into a second Huffman encoding stream;
- the coded stream selection unit is configured to select whether to output in the first Huffman coded stream or output in the second Huffman coded stream.
- the second aspect of the present invention provides a pipeline-based hardware compression method, including:
- the pipeline matching unit is used to perform pipelined character matching, which improves the matching efficiency, thereby increasing the data compression rate.
- the entire compression process does not require the central processing unit to calculate, reducing the time and memory resources of the central processing unit. .
- FIG. 1 is a schematic structural diagram of a system based on pipeline hardware compression provided by an embodiment of the present invention
- FIG. 2 is a schematic structural diagram of a management control unit in a system based on pipeline hardware compression provided by an embodiment of the present invention
- FIG. 3 is a schematic structural diagram of a pipeline matching unit in a pipeline-based hardware compression system provided by an embodiment of the present invention
- FIG. 4 is a schematic structural diagram of a standard format conversion unit in a pipeline-based hardware compression system provided by an embodiment of the present invention
- FIG. 5 is a schematic structural diagram of a static Huffman coding unit in a pipeline-based hardware compression system provided by an embodiment of the present invention
- FIG. 6 is a flowchart of a method for pipeline-based hardware compression provided by an embodiment of the present invention.
- FIG. 7 is a flowchart of another pipeline-based hardware compression method provided by an embodiment of the present invention.
- FIG. 8 is a working flowchart of a data flow generating unit in a pipeline-based hardware compression system provided by an embodiment of the present invention.
- the embodiment of the present invention provides a pipeline-based hardware compression system and method to increase the data compression rate and reduce the time and memory resources occupied by the central processing unit.
- the pipeline-based hardware compression system can realize the static Gzip compression function, and the compression format is a standard deflate compression encoding stream format.
- the data is compressed by the management control unit, the pipeline matching unit, the standard format conversion unit, the static Huffman coding unit, and the data stream generation unit.
- the pipeline matching unit is used to perform pipeline character matching, which improves the matching efficiency and thus The data compression rate is improved, and the more character matching units used in the pipeline matching unit, the higher the data compression rate.
- the central processing unit only needs to notify the direct memory access module (DMA, Direct Memory Access) Transmit the data to be compressed to the input buffer channel. Until the compression is completed, the central processing unit informs the direct memory access module again to transmit the compressed data to the memory.
- DMA Direct Memory Access
- Figure 1 is a schematic structural diagram of a pipeline-based hardware compression-based system 100 provided by an embodiment of the present invention.
- the pipeline-based hardware compression-based system 100 provided in an embodiment of the present invention may include: A control unit 101, a pipeline matching unit 102, a standard format conversion unit 103, a static Huffman encoding unit 104, and a data stream generation unit 105;
- the management control unit 101 is used to obtain M bits of data to be compressed from the input buffer channel, where M is a positive integer, divide the M bits of data to be compressed into N characters, and divide the N characters into N periodic input pipelines.
- the matching unit 102 where N is a positive integer less than M, and at the same time, each cycle detects whether the data stream generating unit 105 has compressed (M/N) bit data output, and if so, obtains it from the data stream generating unit 105 ( M/N) bit compressed data, output M bit compressed data after obtaining N cycles;
- the pipeline matching unit 102 is used to obtain a character input by the management control unit 101 every cycle, calculate the position where the i-th character matches the previous (i-1) character and the same length for consecutive matches, and combine the i-th character, The i-th character matches the same position as the previous (i-1) characters, and the i-th character continuously matches the same length and is sent to the standard format conversion unit 103, where i is a positive integer not greater than N;
- the standard format conversion unit 103 is used to make a logical judgment on the data in the internal buffer unit, and match the i-th character, the i-th character with the previous (i-1) character in the same position, and the i-th character consecutively to match the same position
- the length of is converted into standard data in a standard data format, and the standard data is sent to the static Huffman coding unit 104;
- the static Huffman encoding unit 104 is configured to encode standard data through an internal encoding conversion unit to obtain a Huffman encoded stream, and send the Huffman encoded stream to the data stream generating unit 105;
- the data stream generating unit 105 is used to convert the non-fixed-length Huffman coded stream into a fixed-length coded stream for output, obtain the Huffman coded stream once per cycle, and store the Huffman coded stream in the internal buffer array.
- the first (M/N) bit data in the internal buffer array is sent to the management control unit 101 every cycle.
- FIG. 2 is a schematic structural diagram of a management control unit 200 in a pipeline-based hardware compression system provided by an embodiment of the present invention.
- the management control unit 200 provided by an embodiment of the present invention may include: an input state machine Unit 201, state setting unit 202, and output state machine unit 203;
- the input state machine unit 201 is used to obtain M bits of data to be compressed from the input buffer channel, where M is a positive integer, divide the M bits of data to be compressed into N characters, and output them in a format of one character per cycle.
- N is a positive integer less than M, and each of the N characters is (M/N) bits;
- the state setting unit 202 is used to set the large and small end conversion of the input data and the output data of the state machine;
- the output state machine unit 203 is configured to obtain compressed (M/N) bit coded stream data every cycle, and output M-bit compressed data after every N cycles.
- the input state machine unit 201 also outputs an input valid bit, where the input valid bit is used to indicate whether the original data of the current cycle is valid, and when the input valid bit is logically 0, it means the current The original data of the cycle is invalid. When the input valid bit is logically 1, the original data of the current cycle is valid.
- the big-endian mode means that the high byte of data is stored in the low address of the memory, while the low byte of data is stored in the high address of the memory, the address increases from small to large, and the data is placed from high to low; Little-endian mode means that the high byte of data is stored in the high address of the memory, and the low byte of data is stored in the low address of the memory.
- the high and low addresses of the address are combined with the data bit weight, and the weight of the high address part is high. , The weight of the lower address part is low.
- the output state machine unit 203 in addition to acquiring (M/N) bit encoded stream data every cycle, the output state machine unit 203 also acquires an encoding valid bit, where the encoding valid bit is used to indicate whether the current cycle encoded stream data is valid. When the bit is logically 0, it means that the current cycle coded stream data is invalid, and when the coded valid bit is logically 1, it means that the current cycle coded stream data is valid.
- the input state machine unit 201 obtains 128-bit data to be compressed every 16 cycles, and divides the 128-bit data to be compressed into 16 characters in a format of one character per cycle Output, where each of the 16 characters is 8 bits;
- the state setting unit 202 sets the state machine input data and the output data of the large and small end conversion
- the output state machine unit 203 stores the input compressed 8-bit encoded stream data, and after each input of 16 8-bit encoded stream data, they are spliced into 128-bit compressed data for output.
- FIG. 3 is a schematic structural diagram of a pipeline matching unit 300 in a pipeline-based hardware compression system provided by an embodiment of the present invention.
- the pipeline matching unit 300 provided in an embodiment of the present invention may include: matching position calculation Unit 301, K character matching unit 302, and matching length calculation unit 303;
- the matching position calculation unit 301 is used to calculate the position where the current input character matches the previous input character. It is judged by the signal sent by each character matching unit. If the current character matching unit is matched successfully, the output of the character matching unit is output. position;
- Each character matching unit is used to match the input character with the character stored in the character matching unit. If the matches are the same, Output matching same signal. After each cycle, the character stored in the character matching unit is output to the next character matching unit as the input character of the next character matching unit, and the character input to the character matching unit is stored in Wait for the next cycle to apply in the character matching unit;
- the matching length calculation unit 303 is used to calculate the current characters that match the same length continuously. If the current characters match the same, the count is increased by one until the character matches are not the same, the count is cleared, and the count is repeated.
- the matching position calculation unit 301 outputs the same position where the current input character matches the previous input character, the position data is 15-bit data, and the matching length calculation unit 303 outputs the current character continuously matches the same length, and the length data is 8-bit data.
- FIG. 4 is a schematic structural diagram of a standard format conversion unit 400 in a pipeline-based hardware compression system provided by an embodiment of the present invention.
- a standard format conversion unit 400 provided by an embodiment of the present invention may include: A character buffer unit 401, a second character buffer unit 402, a third character buffer unit 403, and a format conversion state machine unit 404;
- the first character buffer unit 401 is used to store the i-th character, the position where the i-th character matches the previous (i-1) character, and the i-th character consecutively match the same length, where i is not A positive integer greater than N;
- the second character buffer unit 402 is used to store the (i-1)th character, the position where the (i-1)th character matches the previous (i-2) character, and the (i-1)th character consecutive Match the same length;
- the third character buffer unit 403 is used to store the (i-2)th character, the position where the (i-2)th character matches the previous (i-3) character, and the (i-2)th character consecutive Match the same length;
- the format conversion state machine unit 404 is used to determine the data stored in the first character buffer unit 401, the second character buffer unit 402, and the third character buffer unit 403 to compare the i-th character and the i-th character with the previous (i- 1) The characters match the same position, and the i-th character matches the same length consecutively and converted into standard data in standard data format;
- the standard data is a single character, or the standard data includes position distance, matching length and single character.
- the first character buffer unit 401 stores the i-th character, the position where the i-th character matches the previous (i-1) character, and the i-th character consecutively matches The same length, that is, the character information input in the current cycle of the standard format conversion unit 400;
- the second character cache unit 402 stores the (i-1)th character, the position where the (i-1)th character matches the same position as the previous (i-2) character, and the (i-1)th character continuously matches the same position. Length, that is, the character information input in the previous cycle by the standard format conversion unit 400;
- the third character cache unit 403 stores the (i-2)th character, the position where the (i-2)th character matches the same position as the previous (i-3) character, and the (i-2)th character consecutively matches the same position. Length, that is, the character information input in the previous cycle on the standard format conversion unit 400;
- the format conversion state machine unit 404 by judging the data stored in the three character buffer units, matches the i-th character, the i-th character with the previous (i-1) character in the same position, and the i-th character continuously matches the same
- the length is converted into standard data in LZ77 data format, that is, if the matching length does not exceed three values, it will be output as a single character. If the matching length exceeds three values, the format of ⁇ location distance, matching length, single character ⁇ will be used instead of repeat String output, for example, if the same character is matched for five consecutive cycles, there will be no valid data output from the first cycle to the fourth cycle, and the fifth cycle will be ⁇ position distance, 5, next character ⁇ Data format output.
- the format conversion state machine unit 404 outputs position distance, matching length, and single character, where the position distance is 15-bit data, the matching length is 8-bit data, and the single character is 8-bit data.
- the format conversion state machine unit 404 except In addition to output position distance, matching length and single character, it also outputs a single character flag variable.
- the single character flag variable is used to indicate whether it is a single character output. If it is not a single character output, the data of position distance and matching length is valid. Single-character output, the data of position distance and matching length is invalid.
- FIG. 5 is a schematic structural diagram of a static Huffman encoding unit 500 in a pipeline-based hardware compression system provided by an embodiment of the present invention.
- a static Huffman encoding unit 500 provided by an embodiment of the present invention It may include: a character encoding unit 501, a position encoding unit 502, a length encoding unit 503, a Huffman encoding splicing unit 504, and an encoding stream selection unit 505;
- the character encoding unit 501 is used to convert a single character into a Huffman encoding format to obtain a first Huffman encoding stream;
- the position coding unit 502 is used to convert the position distance into a Huffman coding format
- the length encoding unit 503 is used to convert the matching length into a Huffman encoding format
- the Huffman coding splicing unit 504 is used to splice the position distance, matching length and single character converted into the Huffman coding format into a second Huffman coding stream, wherein the length of the second Huffman coding stream is not greater than 64 bits;
- the coded stream selection unit 505 is used to select whether to output as the first Huffman coded stream or output as the second Huffman coded stream, that is, to select whether to output as a single-character Huffman coded stream or as ⁇ position distance, matching length, Single-character Huffman coding stream output. If the data input to the static Huffman coding unit 500 is a single character, the output coding streams of the position coding unit 502 and the length coding unit 503 are invalid, and only the coding of the character coding unit 501 Stream output, if the data input to the static Huffman coding unit 500 is not a single character, output the spliced coded stream.
- the coded stream selection unit 505 also outputs how many valid data bits are in the Huffman coded stream.
- FIG. 6 is a flowchart of a pipeline-based hardware compression method provided by an embodiment of the present invention.
- a pipeline-based hardware compression method provided by an embodiment of the present invention may include:
- the original data to be compressed is transmitted to the input buffer channel through the direct memory access module.
- each of the N characters is (M/N) bits.
- the method of calculating the position where the i-th character matches the previous (i-1) character and the same length of consecutive matches can be:
- K is a positive integer
- the K character matching units are in a pipeline structure. After the jth character matching unit is matched, the characters stored in the jth character matching unit are output to the (j+1)th character matching unit, and the The characters stored in the j character matching unit are replaced with the characters input to the j-th character matching unit, and j is a positive integer less than K.
- the method for converting the i-th character, the i-th character and the previous (i-1) character in the same position, and the i-th character consecutively matching the same length into standard data in standard data format can be:
- the i-th character, the i-th character and the previous (i-1) character are matched to the same position, and the i-th character is continuously matched to the same length Converted into standard data;
- the first cache data includes the i-th character, the position where the i-th character matches the previous (i-1) character, and the i-th character continuously matches the same length
- the second cache data includes storing the (i-th) 1) characters, the (i-1)th character matches the same position as the previous (i-2) character, and the (i-1)th character continuously matches the same length
- the third buffer data includes the (i-th) 2) Characters, the (i-2)th character matches the same position as the previous (i-3) character, and the (i-2)th character continuously matches the same length;
- the standard data is a single character, or the standard data includes position distance, matching length and single character.
- the method of encoding standard data to obtain a Huffman encoded stream may be:
- the position distance, matching length, and single character converted into the Huffman encoding format are spliced into a second Huffman encoding stream.
- the compressed data is transferred to the memory through the direct memory access module.
- FIG. 7 is a flowchart of another pipeline-based hardware compression method provided by an embodiment of the present invention.
- another pipeline-based hardware compression method provided by an embodiment of the present invention may include:
- the management control unit obtains 128-bit data to be compressed.
- the central processing unit transmits the original data to be compressed to the input buffer channel of the hardware compression system through the direct memory access module, and the management control unit obtains 128-bit data to be compressed from the input buffer channel every 16 cycles.
- the management control unit divides the 128-bit data to be compressed into 16 characters.
- each of the 16 characters is 8 bits.
- the management control unit outputs in the format of one character per cycle, and sends 16 characters to the pipeline matching unit in order. Each time a character is output, the count is increased by one.
- the pipeline matching unit performs pipeline matching on the input characters to obtain matching data, and sends the matching data to the standard format conversion unit.
- the matching data includes the current input character, the position where the current input character matches the previous input character, and the current input character continuously matches the same length.
- the standard format conversion unit converts the input matching data into data in the LZ77 format, and sends the data in the LZ77 format to the static Huffman coding unit.
- the static Huffman encoding unit converts the data in the LZ77 format into a Huffman encoding stream, and sends the Huffman encoding stream to the data stream generating unit.
- the data stream generating unit obtains a Huffman coded stream of variable length, and sends 8-bit coded stream data to the management control unit every cycle.
- each 16 8-bit coded stream data is obtained by the management control unit, they are spliced into 128-bit coded stream data for output.
- step 709. Determine whether the 128-bit data currently input has all been sent, if not, go to step 703, and if yes, go to step 710.
- step 710 Determine whether there is still data in the input buffer channel, if not, go to step 711, if yes, go to step 701, and obtain the next 128-bit data again in order.
- FIG. 8 is a working flowchart of a data flow generating unit in a pipeline-based hardware compression system provided by an embodiment of the present invention.
- the workflow of a data stream generating unit provided by an embodiment of the present invention may include:
- step 801. Determine whether the encoded stream data currently input to the data stream generating unit is valid, if not, go to step 804, and if yes, go to step 802.
- the buffer array is used to store the encoded stream data of the input data stream generating unit, and the buffer array is shifted to the left by the effective length bit and is ORed with the current encoded stream data, that is, the current encoded stream data is spliced to the end of the buffer array.
- step 804. Take out the first (M/N) bit data of the buffer array in the data stream generating unit in the same cycle and output it, and go to step 805.
- step 805. Determine whether the input data has ended, if not, proceed to step 801, if yes, proceed to step 806.
- step 804 Determine whether there is still encoded stream data in the buffered data that has not been output; if yes, go to step 804; if not, go to an end state.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Compression Or Coding Systems Of Tv Signals (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
Description
Claims (12)
- 一种基于流水式的硬件压缩的系统,其特征在于,所述系统包括管理控制单元、流水匹配单元、标准格式转换单元、静态霍夫曼编码单元和数据流生成单元;所述管理控制单元,用于从输入缓存通道获取M比特待压缩数据,其中,M为正整数,将所述M比特待压缩数据分为N个字符,将所述N个字符分为N个周期输入所述流水匹配单元,其中,N为小于M的正整数,每个周期从所述数据流生成单元获取(M/N)比特已压缩数据,获取N个周期后输出M比特已压缩数据;所述流水匹配单元,用于计算第i个字符与前(i-1)个字符匹配相同的位置以及连续匹配相同的长度,其中,i为不大于N的正整数;所述标准格式转换单元,用于将所述第i个字符、所述第i个字符与所述前(i-1)个字符匹配相同的位置、所述第i个字符连续匹配相同的长度转换成标准数据格式的标准数据;所述静态霍夫曼编码单元,用于对所述标准数据进行编码以得到霍夫曼编码流;所述数据流生成单元,用于将所述霍夫曼编码流转换成每个周期(M/N)比特的已压缩数据输出。
- 根据权利要求1所述的系统,其特征在于,所述管理控制单元具体包括:输入状态机单元,用于从所述输入缓存通道获取所述M比特待压缩数据,将所述M比特待压缩数据分为所述N个字符,将所述N个字符分为N个周期输入所述流水匹配单元,其中,所述N个字符中每个字符为(M/N)比特;状态设置单元,用于设置所述M比特待压缩数据和所述M比特已压缩数据的大小端转换;输出状态机单元,用于每个周期从所述数据流生成单元获取所述(M/N)比特已压缩数据,获取N个周期后输出所述M比特已压缩数据。
- 根据权利要求1或2所述的系统,其特征在于,所述流水匹配单元具体包括:匹配位置计算单元,用于计算所述第i个字符与所述前(i-1)个字符匹配相 同的位置;K个字符匹配单元,用于将所述第i个字符与所述K个字符匹配单元保存的字符进行匹配,若匹配相同则输出匹配相同信号,其中,K为正整数,所述K个字符匹配单元呈流水结构,第j个字符匹配单元匹配后,将第j个字符匹配单元保存的字符输出给第(j+1)个字符匹配单元,将所述第j个字符匹配单元保存的字符替换成输入到所述第j个字符匹配单元的字符,j为小于K的正整数;匹配长度计算单元,用于计算所述第i个字符连续匹配相同的长度。
- 根据权利要求3所述的系统,其特征在于,所述标准格式转换单元具体包括:第一字符缓存单元,用于存储所述第i个字符、所述第i个字符与所述前(i-1)个字符匹配相同的位置以及所述第i个字符连续匹配相同的长度;第二字符缓存单元,用于存储第(i-1)个字符、所述第(i-1)个字符与前(i-2)个字符匹配相同的位置以及所述第(i-1)个字符连续匹配相同的长度;第三字符缓存单元,用于存储第(i-2)个字符、所述第(i-2)个字符与前(i-3)个字符匹配相同的位置以及所述第(i-2)个字符连续匹配相同的长度;格式转换状态机单元,用于通过判断所述第一字符缓存单元、所述第二字符缓存单元和所述第三字符缓存单元保存的数据,将所述第i个字符、所述第i个字符与所述前(i-1)个字符匹配相同的位置、所述第i个字符连续匹配相同的长度转换成所述标准数据;其中,所述标准数据为单字符,或者所述标准数据包括位置距离、匹配长度和单字符。
- 根据权利要求4所述的系统,其特征在于,所述静态霍夫曼编码单元具体包括:字符编码单元,用于将所述单字符转换成霍夫曼编码格式,以得到第一霍夫曼编码流;位置编码单元,用于将所述位置距离转换成霍夫曼编码格式;长度编码单元,用于将所述匹配长度转换成霍夫曼编码格式;霍夫曼编码拼接单元,用于将转换成霍夫曼编码格式的位置距离、匹配长度和单字符拼接成第二霍夫曼编码流;编码流选择单元,用于选择以所述第一霍夫曼编码流输出还是以所述第二 霍夫曼编码流输出。
- 一种基于流水式的硬件压缩的方法,其特征在于,包括:从输入缓存通道获取M比特待压缩数据,其中,M为正整数;将所述M比特待压缩数据分为N个字符,其中,N为小于M的正整数;计算第i个字符与前(i-1)个字符匹配相同的位置以及连续匹配相同的长度,其中,i为不大于N的正整数;将所述第i个字符、所述第i个字符与所述前(i-1)个字符匹配相同的位置、所述第i个字符连续匹配相同的长度转换成标准数据格式的标准数据;对所述标准数据进行编码以得到霍夫曼编码流;将所述霍夫曼编码流转换成每个周期(M/N)比特的已压缩数据输出;每个周期获取(M/N)比特已压缩数据,获取N个周期后输出M比特已压缩数据。
- 根据权利要求6所述的方法,其特征在于,所述从输入缓存通道获取M比特待压缩数据之前,包括:通过直接存储器访问模块将原始待压缩数据传输到所述输入缓存通道。
- 根据权利要求6所述的方法,其特征在于,所述N个字符中每个字符为(M/N)比特,所述方法还包括:设置所述M比特待压缩数据和所述M比特已压缩数据的大小端转换。
- 根据权利要求6至8任一项所述的方法,其特征在于,所述计算第i个字符与前(i-1)个字符匹配相同的位置以及连续匹配相同的长度包括:将所述第i个字符与K个字符匹配单元保存的字符进行匹配,若匹配相同则输出匹配相同信号,根据所述匹配相同信号计算所述第i个字符与前(i-1)个字符匹配相同的位置,计算所述第i个字符连续匹配相同的长度;其中,K为正整数,所述K个字符匹配单元呈流水结构,第j个字符匹配单元匹配后,将第j个字符匹配单元保存的字符输出给第(j+1)个字符匹配单元,将所述第j个字符匹配单元保存的字符替换成输入到所述第j个字符匹配单元的字符,j为小于K的正整数。
- 根据权利要求9所述的方法,其特征在于,所述将所述第i个字符、所述第i个字符与所述前(i-1)个字符匹配相同的位置、所述第i个字符连续匹配相同的长度转换成标准数据格式的标准数据包括:通过判断第一缓存数据、第二缓存数据和第三缓存数据,将所述第i个字符、所述第i个字符与所述前(i-1)个字符匹配相同的位置、所述第i个字符连续匹配相同的长度转换成所述标准数据;其中,所述第一缓存数据包括所述第i个字符、所述第i个字符与所述前(i-1)个字符匹配相同的位置以及所述第i个字符连续匹配相同的长度,第二缓存数据包括存储第(i-1)个字符、所述第(i-1)个字符与前(i-2)个字符匹配相同的位置以及所述第(i-1)个字符连续匹配相同的长度,第三缓存数据包括第(i-2)个字符、所述第(i-2)个字符与前(i-3)个字符匹配相同的位置以及所述第(i-2)个字符连续匹配相同的长度,所述标准数据为单字符,或者所述标准数据包括位置距离、匹配长度和单字符。
- 根据权利要求10所述的方法,其特征在于,所述对所述标准数据进行编码以得到霍夫曼编码流包括:当所述标准数据为单字符时,将所述单字符转换成霍夫曼编码格式,以得到第一霍夫曼编码流;当所述标准数据包括位置距离、匹配长度和单字符时,将所述单字符转换成霍夫曼编码格式;将所述位置距离转换成霍夫曼编码格式;将所述匹配长度转换成霍夫曼编码格式;将转换成霍夫曼编码格式的位置距离、匹配长度和单字符拼接成第二霍夫曼编码流。
- 根据权利要求7所述的方法,其特征在于,还包括:所述原始待压缩数据压缩完成后,通过所述直接存储器访问模块将已压缩数据传输到内存。
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/088033 WO2020232683A1 (zh) | 2019-05-22 | 2019-05-22 | 一种基于流水式的硬件压缩的系统及方法 |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
PCT/CN2019/088033 WO2020232683A1 (zh) | 2019-05-22 | 2019-05-22 | 一种基于流水式的硬件压缩的系统及方法 |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2020232683A1 true WO2020232683A1 (zh) | 2020-11-26 |
Family
ID=73459259
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2019/088033 WO2020232683A1 (zh) | 2019-05-22 | 2019-05-22 | 一种基于流水式的硬件压缩的系统及方法 |
Country Status (1)
Country | Link |
---|---|
WO (1) | WO2020232683A1 (zh) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118713680A (zh) * | 2024-08-27 | 2024-09-27 | 湖南师范大学 | 一种基于区块链技术的可信计量数据存储方法 |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104202054A (zh) * | 2014-09-16 | 2014-12-10 | 东南大学 | 一种硬件lzma压缩实现系统及方法 |
CN107135003A (zh) * | 2017-04-19 | 2017-09-05 | 西安电子科技大学 | 基于Gzip硬件实现文本压缩方法 |
US10171103B1 (en) * | 2018-01-12 | 2019-01-01 | Mellanox Technologies, Ltd. | Hardware data compression architecture including shift register and method thereof |
-
2019
- 2019-05-22 WO PCT/CN2019/088033 patent/WO2020232683A1/zh active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN104202054A (zh) * | 2014-09-16 | 2014-12-10 | 东南大学 | 一种硬件lzma压缩实现系统及方法 |
CN107135003A (zh) * | 2017-04-19 | 2017-09-05 | 西安电子科技大学 | 基于Gzip硬件实现文本压缩方法 |
US10171103B1 (en) * | 2018-01-12 | 2019-01-01 | Mellanox Technologies, Ltd. | Hardware data compression architecture including shift register and method thereof |
Non-Patent Citations (1)
Title |
---|
MING-BO LIN ET AL.: "A Lossless Data Compression and Decompression Algorithm and Its Hardware Architecture", IEEE TRANSACTIONS ON VERY LARGE SCALE INTEGRATION (VLSI) SYSTEMS, vol. 14, no. 9, 30 September 2006 (2006-09-30), XP011149588, DOI: 20200218153419 * |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN118713680A (zh) * | 2024-08-27 | 2024-09-27 | 湖南师范大学 | 一种基于区块链技术的可信计量数据存储方法 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US11431351B2 (en) | Selection of data compression technique based on input characteristics | |
CN105207678B (zh) | 一种改进型lz4压缩算法的硬件实现系统 | |
CN104202054A (zh) | 一种硬件lzma压缩实现系统及方法 | |
US20110078222A1 (en) | Enhanced multi-processor waveform data exchange using compression and decompression | |
US9176977B2 (en) | Compression/decompression accelerator protocol for software/hardware integration | |
CN114567331B (zh) | 一种基于lz77的压缩方法、装置及其介质 | |
US20100324914A1 (en) | Adaptive Encoding of a Digital Signal with One or More Missing Values | |
CN103427844A (zh) | 一种基于gpu和cpu混合平台的高速无损数据压缩方法 | |
WO2020211000A1 (zh) | 数据解压缩的装置与方法 | |
WO2020232683A1 (zh) | 一种基于流水式的硬件压缩的系统及方法 | |
US8406538B2 (en) | Image processing apparatus and image processing method | |
CN110233627B (zh) | 一种基于流水式的硬件压缩的系统及方法 | |
CN105005464A (zh) | 一种Burrows Wheeler变换硬件处理装置 | |
US7071854B1 (en) | Hardware-implemented LZW data decompression | |
Erdeljan et al. | IP core for efficient zero-run length compression of CNN feature maps | |
CN114025024B (zh) | 一种数据传输方法及装置 | |
CN110247666B (zh) | 一种硬件并行压缩的系统及方法 | |
CN110473264B (zh) | 基于霍夫曼编码的深度图压缩方法、解压缩方法及编码器 | |
TW201440045A (zh) | 解壓縮電路與相關的解壓縮方法 | |
CN118353966B (zh) | 一种数据传输方法、数据传输设备和相关设备 | |
WO2020232682A1 (zh) | 一种硬件并行压缩的系统及方法 | |
US10491241B1 (en) | Data compression scheme utilizing a repetitive value within the data stream | |
JP2008203959A (ja) | データ転送におけるシリアライズ方法、データフォーマット及びデータ転送装置 | |
TWI883487B (zh) | 資料處理方法及裝置、電子設備、儲存介質 | |
CN116170115B (zh) | 基于码本的数字喷泉编解码方法、装置以及系统 |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 19930104 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19930104 Country of ref document: EP Kind code of ref document: A1 |
|
32PN | Ep: public notification in the ep bulletin as address of the adressee cannot be established |
Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 21.03.2022) |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 19930104 Country of ref document: EP Kind code of ref document: A1 |