CN105915227A - Adaptive mixed data lossless compression system - Google Patents
Adaptive mixed data lossless compression system Download PDFInfo
- Publication number
- CN105915227A CN105915227A CN201610214126.8A CN201610214126A CN105915227A CN 105915227 A CN105915227 A CN 105915227A CN 201610214126 A CN201610214126 A CN 201610214126A CN 105915227 A CN105915227 A CN 105915227A
- Authority
- CN
- China
- Prior art keywords
- signal
- module
- coded
- golomb
- prediction
- 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 29
- 230000006835 compression Effects 0.000 title claims abstract description 29
- 230000003044 adaptive effect Effects 0.000 title claims abstract description 21
- 238000000034 method Methods 0.000 claims abstract description 16
- 238000007619 statistical method Methods 0.000 claims abstract description 15
- 238000012545 processing Methods 0.000 claims description 20
- 238000004364 calculation method Methods 0.000 claims description 13
- 238000004422 calculation algorithm Methods 0.000 claims description 8
- 238000004458 analytical method Methods 0.000 claims description 7
- 238000013144 data compression Methods 0.000 claims description 5
- 238000006243 chemical reaction Methods 0.000 claims description 4
- 238000013507 mapping Methods 0.000 description 8
- 238000005070 sampling Methods 0.000 description 7
- 238000005516 engineering process Methods 0.000 description 6
- 230000005540 biological transmission Effects 0.000 description 3
- 238000007405 data analysis Methods 0.000 description 3
- 238000013506 data mapping Methods 0.000 description 3
- 238000011161 development Methods 0.000 description 3
- 238000012360 testing method Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 2
- 230000004048 modification Effects 0.000 description 2
- 230000007547 defect Effects 0.000 description 1
- 238000010586 diagram Methods 0.000 description 1
- 238000009432 framing Methods 0.000 description 1
- 230000035772 mutation Effects 0.000 description 1
- 230000001737 promoting effect Effects 0.000 description 1
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
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Compression, Expansion, Code Conversion, And Decoders (AREA)
Abstract
本发明涉及一种自适应混合数据无损压缩系统,为了提高编码的有效性、可靠性而设计。本发明包括:统计分析模块,分析待编码信号统计特征并与设定的门限值进行比较,实现线性预测Golomb编码法和自适应Golomb编码法的自适应切换;若适用线性预测Golomb编码法,则线性预测模块对待编码信号进行线性预测,得到残差信号,将残差信号映射为正整数,统计判决模块根据映射后的残差信号确定Golomb编码参数后进行Golomb编码;若适用自适应Golomb编码法,则统计判决模块直接对待编码信号进行映射,根据映射后的数据确定Golomb编码参数后进行Golomb编码。本发明,通过分析每帧信号的数字统计特征,自适应采用不同的编码方式和编码参数对信号进行压缩编码,从而提高压缩的有效性与可靠性。
The invention relates to an adaptive mixed data lossless compression system, which is designed to improve the effectiveness and reliability of coding. The present invention includes: a statistical analysis module, which analyzes the statistical characteristics of the signal to be coded and compares it with the set threshold value to realize the adaptive switching between the linear predictive Golomb coding method and the adaptive Golomb coding method; if the linear predictive Golomb coding method is applicable, Then the linear prediction module performs linear prediction on the coded signal to obtain the residual signal, maps the residual signal to a positive integer, and the statistical judgment module determines the Golomb coding parameters according to the mapped residual signal and performs Golomb coding; if adaptive Golomb coding is applicable method, the statistical judgment module directly maps the signal to be coded, and performs Golomb coding after determining the Golomb coding parameters according to the mapped data. The present invention compresses and encodes the signal by adaptively adopting different encoding modes and encoding parameters by analyzing the digital statistical characteristics of each frame signal, thereby improving the effectiveness and reliability of compression.
Description
技术领域technical field
本发明涉及一种信号压缩技术,尤其涉及一种自适应的混合的数据无损压缩系统。The invention relates to a signal compression technology, in particular to an adaptive hybrid data lossless compression system.
背景技术Background technique
随着多媒体技术的发展和应用,人们获得的信息有文本、图像、视频、音频及各种动画媒体,传输这些信息需要处理和传送的数据量非常大,制约了多媒体信息的存储和传输,阻碍了信息的获取和传送。因此数据压缩技术和大容量存储技术对于多媒体技术的发展极为重要。近年来,随着大容量存储设备的出现和网络传输带宽的增加,为无损压缩提供了物理保证,从而推动了其发展。无损压缩的主要内容包括分帧、预测和无损编码等。With the development and application of multimedia technology, the information that people obtain includes text, image, video, audio and various animation media. The amount of data that needs to be processed and transmitted to transmit this information is very large, which restricts the storage and transmission of multimedia information and hinders information acquisition and transmission. Therefore, data compression technology and mass storage technology are extremely important for the development of multimedia technology. In recent years, with the emergence of large-capacity storage devices and the increase of network transmission bandwidth, a physical guarantee is provided for lossless compression, thereby promoting its development. The main content of lossless compression includes framing, prediction and lossless coding.
实际应用中遇到的绝大多数信号都不是平稳信号,而对于随机信号,譬如间歇性突变信号的压缩处理,采用固定码长的编码方式比采用变长码编码会占用更多的比特位数,降低压缩性能。Most of the signals encountered in practical applications are not stationary signals, and for random signals, such as the compression processing of intermittent mutation signals, the encoding method of fixed code length will occupy more bits than that of variable length code encoding , reducing compression performance.
有鉴于上述的缺陷,本设计人,积极加以研究创新,以期创设一种自适应的混合的数据无损压缩系统,使其更具有产业上的利用价值。In view of the above-mentioned defects, the designer is actively researching and innovating in order to create an adaptive hybrid data lossless compression system to make it more industrially applicable.
发明内容Contents of the invention
为解决上述技术问题,本发明的目的是提供一种提高压缩的有效性与可靠性的自适应的混合的数据无损压缩系统。To solve the above technical problems, the purpose of the present invention is to provide an adaptive hybrid data lossless compression system that improves the effectiveness and reliability of compression.
本发明自适应的混合的数据无损压缩系统,包括:The self-adaptive hybrid data lossless compression system of the present invention includes:
中央控制器,所述中央控制器包括统计分析、线性预测模块、统计判决模块、Golomb编码模块;Central controller, said central controller includes statistical analysis, linear prediction module, statistical judgment module, Golomb coding module;
所述统计分析模块,对待编码信号的信号分析统计特征与设定的门限值进行比较,判断待编码信号是否需要进行预测,The statistical analysis module compares the signal analysis statistical characteristics of the signal to be encoded with the set threshold value to determine whether the signal to be encoded needs to be predicted,
若需要预测,则所述统计分析模块输出待编码信号至所述线性预测模块;所述线性预测模块对待编码信号进行线性预测,得到残差信号,将所述残差信号输出至所述统计判决模块;所述统计判决模块,基于所述残差信号得到Golomb编码参数,输出Golomb编码参数至所述Golomb编码模块,所述Golomb编码模块对残差信号进行编码;If prediction is required, the statistical analysis module outputs the signal to be encoded to the linear prediction module; the linear prediction module performs linear prediction on the signal to be encoded to obtain a residual signal, and outputs the residual signal to the statistical decision module; the statistical judgment module obtains Golomb encoding parameters based on the residual signal, outputs the Golomb encoding parameters to the Golomb encoding module, and the Golomb encoding module encodes the residual signal;
若不需要预测,则所述统计分析模块输出待编码信号至所述统计判决模块;所述统计判决模块,基于待编码信号得到Golomb编码参数,输出Golomb编码参数至所述Golomb编码模块,所述Golomb编码模块对待编码信号进行编码。If prediction is not required, then the statistical analysis module outputs the signal to be encoded to the statistical judgment module; the statistical judgment module obtains the Golomb coding parameters based on the signal to be coded, and outputs the Golomb coding parameters to the Golomb coding module, the The Golomb encoding module encodes the signal to be encoded.
进一步地,所述中央控制器还包括预测判决模块、逆线性预测模块、Golomb解码模块;Further, the central controller also includes a prediction decision module, an inverse linear prediction module, and a Golomb decoding module;
预测判决模块,判断编码码流是否进行了线性预测,The prediction judgment module judges whether the coded code stream has been linearly predicted,
若没有线性预测,则将所述的编码码流输出至Golomb解码模块,经过Golomb解码模块处理恢复出待编码信号;If there is no linear prediction, the coded code stream is output to the Golomb decoding module, and the signal to be encoded is recovered through the processing of the Golomb decoding module;
若进行了线性预测,将所述的编码码流输出至逆线性预测模块处理之后,输出至Golomb解码模块,经过Golomb解码模块处理恢复出待编码信号。If linear prediction is performed, the encoded code stream is output to the inverse linear prediction module for processing, and then output to the Golomb decoding module, and the signal to be encoded is recovered through the Golomb decoding module.
进一步地,所述统计分析模块,包括预测系数计算单元、比较单元,Further, the statistical analysis module includes a prediction coefficient calculation unit and a comparison unit,
所述预测系数计算单元,用于运行莱文森-德宾算法求解出待编码信号两阶线性预测的预测系数以及输出自相关系数;The prediction coefficient calculation unit is used to run the Levinson-Durbin algorithm to solve the prediction coefficient of the two-order linear prediction of the signal to be encoded and output the autocorrelation coefficient;
所述比较单元,用于获取预测系数计算单元输出的自相关系数2阶预测的最小预测误差功率以及尤尔-沃克Yule-Walker方程中的 The comparison unit is used to obtain the minimum prediction error power of the second-order prediction of the autocorrelation coefficient output by the prediction coefficient calculation unit and in the Yule-Walker equation
若最小预测误差功率*β<自相关系数则比较单元输出待编码信号至线性预测模块;If the minimum prediction error power *β<autocorrelation coefficient Then the comparison unit outputs the signal to be encoded to the linear prediction module;
若最小预测误差功率*β≥自相关系数则比较单元输出待编码信号至统计判决模块;If the minimum prediction error power *β≥autocorrelation coefficient Then the comparison unit outputs the signal to be encoded to the statistical judgment module;
其中,β为根据信号特征预先确定的参数。Among them, β is a parameter determined in advance according to the signal characteristics.
进一步地,所述统计判决模块包括第一判决单元、第二判决单元以及参数输出单元,所述第一判决单元,接收残差信号,将所述残差信号映射为正整数、计算均值mean;所述第二判决单元接收待编码信号,将所述待编码信号映射为正整数、计算均值mean;Further, the statistical judgment module includes a first judgment unit, a second judgment unit, and a parameter output unit, the first judgment unit receives a residual signal, maps the residual signal to a positive integer, and calculates a mean mean; The second decision unit receives the signal to be encoded, maps the signal to be encoded into a positive integer, and calculates a mean value;
所述参数输出单元,若mean<m1,则参数输出单元输出选择参数b=m1/2至所述Golomb编码模块;若m1≤mean<m2,则参数输出单元输出选择参数b=m1至所述Golomb编码模块;若m2≤mean<m3,则参数输出单元输出选择参数b=m2至所述Golomb编码模块;若mean≥m3,则参数输出单元输出选择参数b=m3至所述Golomb编码模块。The parameter output unit, if mean<m 1 , then the parameter output unit outputs the selection parameter b=m 1 /2 to the Golomb encoding module; if m 1 ≤ mean<m 2 , then the parameter output unit outputs the selection parameter b= m 1 to the Golomb coding module; if m 2 ≤ mean<m 3 , the parameter output unit outputs the selection parameter b=m 2 to the Golomb coding module; if mean≥m 3 , the parameter output unit outputs the selection parameter b = m 3 to the Golomb encoding module.
进一步地,所述线性预测模块包括残差计算单元,用于获取预测系数,基于P个在前的待编码信号预测待编码信号预测值,并计算数字数据与数字数据预测值的插值,获得预测残差。Further, the linear prediction module includes a residual calculation unit, which is used to obtain the prediction coefficient, predict the predicted value of the signal to be encoded based on the P previous signals to be encoded, and calculate the interpolation between the digital data and the predicted value of the digital data to obtain the prediction residual.
优选地,中央处理器的专用芯片以DSP作为主处理器、以ARM芯片为主处理器芯片或者以FPGA做主处理器。Preferably, the dedicated chip of the central processing unit uses a DSP as the main processor, an ARM chip as the main processor chip, or an FPGA as the main processor.
进一步地,还包括分别与所述中央控制器连接的模拟/数字信号输入电路、模拟/数字信号输出电路以及码流输出接口、码流输入接口,若待编码信号为模拟信号,通过模拟/数字信号输入电路进行AD转换后输入中央处理器,若待编码信号为数字信号,则直接输入中央处理器;Further, it also includes an analog/digital signal input circuit, an analog/digital signal output circuit, a code stream output interface, and a code stream input interface respectively connected to the central controller. If the signal to be encoded is an analog signal, through the analog/digital signal The signal input circuit is input to the central processing unit after performing AD conversion, and if the signal to be encoded is a digital signal, it is directly input to the central processing unit;
所述Golomb编码模块处理生成编码码流,所述编码码流经所述编码码流输出接口输出;所述编码码流经码流输入接口输入至中央处理器,经所述Golomb编码模块处理恢复出待编码信号,若需要恢复模拟信号所述待编码信号经模拟/数字信号输出接口输出。The Golomb coding module processes and generates a coded code stream, and the coded code stream is output through the coded code stream output interface; the coded code stream is input to the central processing unit through the code stream input interface, and is processed and restored by the Golomb coded module Output the signal to be encoded, if it is necessary to restore the analog signal, the signal to be encoded is output through the analog/digital signal output interface.
借由上述方案,本发明至少具有以下优点:By means of the above solution, the present invention has at least the following advantages:
本发明首先对信号预处理,提高运算速度。通过对信号数据的测试与分析,在线性预测模块中有选择的对每帧信号进行预测。采用2阶线性预测。The present invention first preprocesses the signal to improve the operation speed. Through the test and analysis of the signal data, the signal of each frame is selectively predicted in the linear prediction module. 2nd order linear prediction is used.
线性预测模块根据每帧信号的数字特征,选择不同的选择参数进行Golomb编码,实现压缩编码的自适应性能。在无损编码模块中采用不同于Huffman编码的Golomb编码进行熵编码,测试后可以进行改进,提高无损压缩编码的有效性和可靠性。According to the digital characteristics of each frame signal, the linear prediction module selects different selection parameters for Golomb coding, so as to realize the adaptive performance of compression coding. In the lossless coding module, Golomb coding, which is different from Huffman coding, is used for entropy coding. After testing, it can be improved to improve the effectiveness and reliability of lossless compression coding.
以Golomb编码为主要编码方式,对信号分帧,分析每帧信号的数字特征,采用不同的选择参数进行Golomb编码,实现压缩编码的自适应性能。计算出每帧的自相关系数,由Levinson-Durbin算法求出两阶线性预测系数。引入线性预测,在分析信号帧的基础上选择是否预测,提高压缩效率,根据判决门限判定该数据帧是否需要线性预测,对预测帧、非预测帧分别采用自适应选择参数的Golomb编码,灵活性强,压缩率高。Using Golomb coding as the main coding method, the signal is divided into frames, the digital characteristics of each frame signal are analyzed, and different selection parameters are used for Golomb coding to realize the adaptive performance of compression coding. The autocorrelation coefficient of each frame is calculated, and the two-order linear prediction coefficient is obtained by the Levinson-Durbin algorithm. Introduce linear prediction, choose whether to predict or not on the basis of analyzing the signal frame, improve the compression efficiency, judge whether the data frame needs linear prediction according to the judgment threshold, and use Golomb coding with adaptive selection parameters for the predicted frame and non-predicted frame respectively, with flexibility Strong, high compression ratio.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,并可依照说明书的内容予以实施,以下以本发明的较佳实施例并配合附图详细说明如后。The above description is only an overview of the technical solutions of the present invention. In order to understand the technical means of the present invention more clearly and implement them according to the contents of the description, the preferred embodiments of the present invention and accompanying drawings are described in detail below.
附图说明Description of drawings
图1是本发明自适应的混合的数据无损压缩系统的流程图;Fig. 1 is the flow chart of the self-adaptive mixed data lossless compression system of the present invention;
图2是本发明自适应的混合的数据无损压缩系统的结构框图。Fig. 2 is a structural block diagram of the self-adaptive hybrid data lossless compression system of the present invention.
具体实施方式detailed description
下面结合附图和实施例,对本发明的具体实施方式作进一步详细描述。以下实施例用于说明本发明,但不用来限制本发明的范围。The specific implementation manners of the present invention will be further described in detail below in conjunction with the accompanying drawings and embodiments. The following examples are used to illustrate the present invention, but are not intended to limit the scope of the present invention.
本发明使用一种变长码——Golomb编码对信号进行压缩编码。Golomb编码可以使服从几何分布的正整数数据流的平均码长最短,对较小的数用较短的编码,较大的数用较长的码表示,可直接给出最佳变长码。The present invention uses a variable length code—Golomb code to compress and code the signal. Golomb coding can make the average code length of the positive integer data flow subject to geometric distribution the shortest, use shorter codes for smaller numbers, and use longer codes for larger numbers, and can directly give the best variable-length code.
正整数n的Golomb码由“前缀码+尾码”组成The Golomb code of positive integer n is composed of "prefix code + tail code"
①前缀码是q+1位的一元码字,而1. prefix code is the unary code word of q+1 position, and
②尾码是(n-1)/b的余数②The tail code is the remainder of (n-1)/b
r=n-1-qbr=n-1-qb
的二进制编码。binary encoding.
其中b=2m为Golomb码的选择参数。Among them, b=2 m is the selection parameter of Golomb code.
每帧数据需要分析该信号帧的数字特征,根据数字特征选择合适的选择参数,实现自适应编码。通过多次实验分析,本发明提供四种选择参数的Golomb编码,b分取值别为4,8,16,32,其中Golomb码尾码最大比特位数为5。但是对于较大数值的数据帧,在b值取32的情况下,其q值就会相应地变大,前缀码则会占用较大的比特位数,码长变大。Each frame of data needs to analyze the digital characteristics of the signal frame, and select appropriate selection parameters according to the digital characteristics to realize adaptive coding. Through repeated experimental analysis, the present invention provides four Golomb codes with selected parameters, the values of b points are 4, 8, 16, and 32 respectively, and the maximum number of bits of the Golomb code tail code is 5. But for a data frame with a larger value, when the value of b is 32, the value of q will increase correspondingly, the prefix code will occupy a larger number of bits, and the code length will become larger.
因此本发明还引入了线性预测技术,对所有的数据帧有选择的进行预测。即对于数值较小的数据帧不进行预测,直接编码;对于数值较大的数据帧进行2阶线性预测,只需要对预测误差编码,降低了编码占用的比特数。Therefore, the present invention also introduces a linear prediction technology to selectively predict all data frames. That is, the data frame with a small value is not predicted, but directly encoded; for the data frame with a large value, the second-order linear prediction only needs to encode the prediction error, which reduces the number of bits occupied by the encoding.
实施例1Example 1
参见图1,本发明一较佳实施例所述的自适应的混合的数据无损压缩系统,自适应的混合的数据无损压缩系统,包括:中央控制器,所述中央控制器包括统计分析、线性预测模块、统计判决模块、Golomb编码模块;Referring to Fig. 1, the self-adaptive hybrid data lossless compression system described in a preferred embodiment of the present invention, the self-adaptive hybrid data lossless compression system includes: a central controller, the central controller includes statistical analysis, linear Prediction module, statistical judgment module, Golomb coding module;
所述统计分析模块,对待编码信号的信号分析统计特征与设定的门限值进行比较,判断待编码信号是否需要进行预测,The statistical analysis module compares the signal analysis statistical characteristics of the signal to be encoded with the set threshold value to determine whether the signal to be encoded needs to be predicted,
若需要预测,则所述统计分析模块输出待编码信号至所述线性预测模块;所述线性预测模块对待编码信号进行线性预测,得到残差信号,将所述残差信号输出至所述统计判决模块;所述统计判决模块,基于所述残差信号得到Golomb编码参数,输出Golomb编码参数至所述Golomb编码模块,所述Golomb编码模块对残差信号进行编码;If prediction is required, the statistical analysis module outputs the signal to be encoded to the linear prediction module; the linear prediction module performs linear prediction on the signal to be encoded to obtain a residual signal, and outputs the residual signal to the statistical decision module; the statistical judgment module obtains Golomb encoding parameters based on the residual signal, outputs the Golomb encoding parameters to the Golomb encoding module, and the Golomb encoding module encodes the residual signal;
若不需要预测,则所述统计分析模块输出待编码信号至所述统计判决模块;所述统计判决模块,基于待编码信号得到Golomb编码参数,输出Golomb编码参数至所述Golomb编码模块,所述Golomb编码模块对待编码信号进行编码。If prediction is not required, then the statistical analysis module outputs the signal to be encoded to the statistical judgment module; the statistical judgment module obtains the Golomb coding parameters based on the signal to be coded, and outputs the Golomb coding parameters to the Golomb coding module, the The Golomb encoding module encodes the signal to be encoded.
所述中央控制器还包括预测判决模块、逆线性预测模块、Golomb解码模块;The central controller also includes a prediction and decision module, an inverse linear prediction module, and a Golomb decoding module;
预测判决模块,判断编码码流是否进行了线性预测,The prediction judgment module judges whether the coded code stream has been linearly predicted,
若没有线性预测,则将所述的编码码流输出至Golomb解码模块,经过Golomb解码模块处理恢复出待编码信号;If there is no linear prediction, the coded code stream is output to the Golomb decoding module, and the signal to be encoded is recovered through the processing of the Golomb decoding module;
若进行了线性预测,将所述的编码码流输出至逆线性预测模块处理之后,输出至Golomb解码模块,经过Golomb解码模块处理恢复出待编码信号。If linear prediction is performed, the encoded code stream is output to the inverse linear prediction module for processing, and then output to the Golomb decoding module, and the signal to be encoded is recovered through the Golomb decoding module.
所述中央控制器分别与模拟/数字信号输入电路、模拟/数字信号输出电路以及码流输出接口、码流输入接口连接,若待编码信号为模拟信号,通过模拟/数字信号输入电路进行AD转换后输入中央处理器,若待编码信号为待编码信号,则直接输入中央处理器;The central controller is respectively connected with the analog/digital signal input circuit, the analog/digital signal output circuit, the code stream output interface, and the code stream input interface. If the signal to be encoded is an analog signal, the AD conversion is performed through the analog/digital signal input circuit Then input to the central processing unit, if the signal to be encoded is the signal to be encoded, then directly input to the central processing unit;
所述Golomb编码模块处理生成编码码流,所述编码码流经所述编码码流输出接口输出;所述编码码流经码流输入接口输入至中央处理器,经所述Golomb编码模块处理恢复出待编码信号,所述待编码信号经模拟/数字信号输出接口输出。The Golomb coding module processes and generates a coded code stream, and the coded code stream is output through the coded code stream output interface; the coded code stream is input to the central processing unit through the code stream input interface, and is processed and restored by the Golomb coded module Output the signal to be encoded, and the signal to be encoded is output through the analog/digital signal output interface.
本实施例中,无损压缩大致由三个部分实现。第一步是分帧操作,分帧提供可编辑能力,是大部分待编码信号压缩算法重要且必要的特点。接着帧内去相关。通过线性预测器去除相邻样值包含的冗余信息,将线性预测器有选择的应用于帧数据中,产生预测误差序列。无损编码预测器的参数和预测误差一起代表帧信号。最后是熵编码。熵编码是无损编码,山边马一区误差信号自身的冗余度。在此过程中无信息丢失。本实施例经过分析采用了Golomb码对每帧信号进行熵编码。In this embodiment, the lossless compression is roughly implemented by three parts. The first step is the frame division operation, which provides editability, which is an important and necessary feature of most signal compression algorithms to be encoded. Intra-frame decorrelation follows. The redundant information contained in the adjacent samples is removed by the linear predictor, and the linear predictor is selectively applied to the frame data to generate a prediction error sequence. The parameters of the lossless coded predictor together with the prediction error represent the frame signal. Finally there is entropy coding. Entropy coding is lossless coding, the redundancy of the error signal itself. No information is lost during this process. After analysis, this embodiment adopts Golomb codes to perform entropy coding on each frame signal.
在实际应用中,待压缩信号通常是模拟信号,所以需要经过A/D采样将模拟信号转换为数字信号,对数字信号压缩编码,输出编码码流。In practical applications, the signal to be compressed is usually an analog signal, so it is necessary to convert the analog signal into a digital signal through A/D sampling, compress and encode the digital signal, and output the coded stream.
首先对信号预处理,提高运算速度。通过对信号数据的测试与分析,采用2阶线性预测。计算出每帧的自相关系数,由Levinson-Durbin算法求出两阶线性预测系数。根据判决门限判定该数据帧是否需要线性预测。Firstly, the signal is preprocessed to improve the operation speed. Through the test and analysis of the signal data, the second-order linear prediction is adopted. The autocorrelation coefficient of each frame is calculated, and the two-order linear prediction coefficient is obtained by the Levinson-Durbin algorithm. Determine whether the data frame needs linear prediction according to the decision threshold.
若数据帧需要预测,则根据信号的前两个采样点采样值对后来的信号对线性预测,然后求出残差信号。If the data frame needs to be predicted, the subsequent signal pair is linearly predicted according to the sample values of the first two sampling points of the signal, and then the residual signal is obtained.
若数据帧不需要线性预测,则直接对该数据帧映射,对映射后的数据进行数据分析,选择合适的Golomb编码的参数值b,然后进行Golomb编码。该数据帧同样也包含两个部分,标志位和Golomb码流。标志位有3位,存放预测标志位和选择参数值b。If the data frame does not require linear prediction, directly map the data frame, perform data analysis on the mapped data, select the appropriate parameter value b of Golomb coding, and then perform Golomb coding. The data frame also includes two parts, the flag bit and the Golomb code stream. There are 3 flag bits, which store the prediction flag bit and the selection parameter value b.
本实施例自适应的混合的数据无损压缩系统,若数据帧需要预测,则根据信号的前两个采样点采样值对后来的信号对线性预测,然后求出残差信号。考虑到Golomb编码是对正整数进行编码,所以需要对残差信号映射为正整数,对残差信号进行Golomb编码。数据帧预测标志位为1位,前两个采样点则分别用16位二进制编码,线性预测系数分别用13位二进制编码,选择参数b有四种情况,所以占用两个比特位。因此该数据帧的编码有两个部分,分别为标志位和Golomb码流。标志位有61位,用于存放预测标志位、预测系数、2个采样点值以及Golomb编码的选择参数b。Golomb码流则存放所有残差信号的Golomb编码码字。In the self-adaptive mixed data lossless compression system of this embodiment, if the data frame needs to be predicted, the subsequent signal pair is linearly predicted according to the sampling values of the first two sampling points of the signal, and then the residual signal is obtained. Considering that Golomb coding encodes positive integers, it is necessary to map the residual signal to a positive integer and perform Golomb coding on the residual signal. The data frame prediction flag is 1 bit, the first two sampling points are respectively coded in 16-bit binary, and the linear prediction coefficients are coded in 13-bit binary respectively. There are four cases for selecting parameter b, so two bits are occupied. Therefore, the encoding of the data frame has two parts, namely the flag bit and the Golomb code stream. There are 61 flag bits, which are used to store prediction flag bits, prediction coefficients, 2 sampling point values, and the selection parameter b of Golomb encoding. The Golomb code stream stores the Golomb encoded codewords of all residual signals.
若数据帧不需要线性预测,则直接对该数据帧映射,对映射后的数据进行数据分析,选择合适的Golomb编码的参数值b,然后进行Golomb编码。该数据帧同样也包含两个部分,标志位和Golomb码流。标志位有3位,存放预测标志位和选择参数值b。If the data frame does not require linear prediction, directly map the data frame, perform data analysis on the mapped data, select the appropriate parameter value b of Golomb coding, and then perform Golomb coding. The data frame also includes two parts, the flag bit and the Golomb code stream. There are 3 flag bits, which store the prediction flag bit and the selection parameter value b.
本实施例,解码过程是对输入的编码码流做解码恢复待编码信号的过程。因为输入的每帧码流包含标志位和编码码流,所以需要首先判断标志位中的预测标志位。In this embodiment, the decoding process is a process of decoding the input encoded code stream and recovering the signal to be encoded. Because each frame of the input code stream includes flag bits and coded code streams, it is necessary to first determine the prediction flag bits in the flag bits.
解码过程是对输入的编码码流做解码恢复待编码信号的过程。因为输入的每帧码流包含标志位和编码码流,所以需要首先判断标志位中的预测标志位。The decoding process is the process of decoding the input encoded code stream and recovering the signal to be encoded. Because each frame of the input code stream includes flag bits and coded code streams, it is necessary to first determine the prediction flag bits in the flag bits.
若该帧为预测帧,则需要提取出2阶预测的两个预测系数以及2个采样点值,Golomb编码的选择系数b,然后再对编码码流作解码处理,恢复出待编码信号。If the frame is a prediction frame, it is necessary to extract two prediction coefficients of the second-order prediction and two sampling point values, the selection coefficient b of Golomb coding, and then decode the coded stream to recover the signal to be coded.
若该帧不是预测帧,则只需提取出Golomb编码的选择系数b,即可对码流解码恢复待编码信号。If the frame is not a predictive frame, it only needs to extract the selection coefficient b of Golomb coding to decode the code stream and restore the signal to be coded.
实施例2Example 2
本实施例所述的自适应的混合的数据无损压缩系统,在实施例1的基础上,所述线性预测模块,包括预测系数计算单元,运行莱文森-德宾Levinson-Durbin算法计算各帧待编码信号的线性预测系数,具体包括:In the adaptive mixed data lossless compression system described in this embodiment, on the basis of Embodiment 1, the linear prediction module, including a prediction coefficient calculation unit, runs the Levinson-Durbin Levinson-Durbin algorithm to calculate each frame The linear prediction coefficient of the signal to be encoded, specifically including:
p阶线性预测的尤尔-沃克Yule-Walker方程如下:The Yule-Walker equation for p-order linear prediction is as follows:
其中,为自相关系数;in, is the autocorrelation coefficient;
尤尔-沃克Yule-Walker方程中共有p+1个方程,There are p+1 equations in the Yule-Walker equation,
当k=0,1,2,…,p的已知时,解得apk[k=1,2,…,p]以及样p+1个未知量,其中,apk预测系数,为最小误差功率;When k=0,1,2,...,p When known, solve a pk [k=1, 2, ..., p] and Sample p+1 unknown quantities, where, a pk prediction coefficient, is the minimum error power;
线性预测的尤尔-沃克Yule-Walker方程中的自相关系数根据Levinson-Durbin算法求出2阶预测的最小预测误差功率 Autocorrelation Coefficient in Yule-Walker Equation for Linear Prediction Calculating the minimum forecast error power of the second-order forecast based on the Levinson-Durbin algorithm
莱文森-德宾Levinson-Durbin算法递推公式为The recursive formula of Levinson-Durbin algorithm is
其中[k=1,2,…,p];where [k=1, 2, . . . , p];
两阶预测,k取值为1和2,预测系数就是a11、a22 For two-stage prediction, the value of k is 1 and 2, and the prediction coefficients are a 11 and a 22
aki=ak-1,i+akkak-1,k-i,i=1,2,…,k-1a ki = a k-1, i + a kk a k-1, ki , i=1, 2, ..., k-1
由此求解出两阶线性预测的预测系数a11、a22。From this, the prediction coefficients a 11 and a 22 of the two-order linear prediction are obtained.
所述线性预测模块,还包括比较单元,预测系数计算单元输出线性预测的尤尔-沃克Yule-Walker方程中的自相关系数2阶预测的最小预测误差功率至所述结果输出单元;The linear prediction module also includes a comparison unit, and the prediction coefficient calculation unit outputs the autocorrelation coefficient in the Yule-Walker equation of the linear prediction Minimum Forecast Error Power for 2nd Order Forecast to said result output unit;
所述结果输出单元,获取预测系数计算单元输出的自相关系数2阶预测的最小预测误差功率以及尤尔-沃克Yule-Walker方程中的 The result output unit obtains the minimum prediction error power of the second-order prediction of the autocorrelation coefficient output by the prediction coefficient calculation unit and in the Yule-Walker equation
若最小预测误差功率*β<自相关系数则比较单元输出待编码信号至线性预测模块;If the minimum prediction error power *β<autocorrelation coefficient Then the comparison unit outputs the signal to be encoded to the linear prediction module;
若最小预测误差功率*β≥自相关系数则比较单元输出待编码信号至统计判决模块;If the minimum prediction error power *β≥autocorrelation coefficient Then the comparison unit outputs the signal to be encoded to the statistical judgment module;
其中,β为根据信号特征预先确定的参数。Among them, β is a parameter determined in advance according to the signal characteristics.
所述自适应模块包括预测残差计算单元,预测残差ε(n)的具体计算公式为:The adaptive module includes a prediction residual calculation unit, and the specific calculation formula of the prediction residual ε (n) is:
其中,s(n)是待编码数据,是待编码数据预测值。Among them, s(n) is the data to be encoded, is the predicted value of the data to be encoded.
待编码数据预测值是用过去p个待编码数据s(n)来预测得到,其中The predicted value of the data to be encoded It is predicted by using the past p data to be encoded s(n), where
其中aii为线性预测系数。Where a ii is the linear prediction coefficient.
本实施例中的线性预测,对所有的数据帧有选择的进行预测。即对于数值较小的数据帧不进行预测,直接编码;对于数值较大的数据帧进行2阶线性预测,只需要对预测误差编码,降低了编码占用的比特数。The linear prediction in this embodiment selectively predicts all data frames. That is, the data frame with a small value is not predicted, but directly encoded; for the data frame with a large value, the second-order linear prediction only needs to encode the prediction error, which reduces the number of bits occupied by the encoding.
本实施例中,还包括分别与所述中央控制器连接的模拟/数字信号输入电路、模拟/数字信号输出电路以及码流输出接口、码流输入接口,若待编码信号为模拟信号,通过模拟/数字信号输入电路进行AD转换后输入中央处理器,若待编码信号为数字信号,则直接输入中央处理器;In this embodiment, it also includes an analog/digital signal input circuit, an analog/digital signal output circuit, a code stream output interface, and a code stream input interface respectively connected to the central controller. If the signal to be encoded is an analog signal, the /The digital signal input circuit carries out AD conversion and then input to the central processing unit, if the signal to be coded is a digital signal, then directly input to the central processing unit;
所述Golomb编码模块处理生成编码码流,所述编码码流经所述编码码流输出接口输出;所述编码码流经码流输入接口输入至中央处理器,经所述Golomb编码模块处理恢复出待编码信号,若需要恢复模拟信号所述待编码信号经模拟/数字信号输出接口输出。The Golomb coding module processes and generates a coded code stream, and the coded code stream is output through the coded code stream output interface; the coded code stream is input to the central processing unit through the code stream input interface, and is processed and restored by the Golomb coded module Output the signal to be encoded, if it is necessary to restore the analog signal, the signal to be encoded is output through the analog/digital signal output interface.
上述各实施例中,所述统计判决模块包括第一判决单元、第二判决单元以及参数输出单元,所述第一判决单元,接收残差信号,将所述残差信号映射为正整数、计算均值mean;所述第二判决单元接收待编码信号,将所述待编码信号映射为正整数、计算均值mean;In each of the above embodiments, the statistical judgment module includes a first judgment unit, a second judgment unit, and a parameter output unit, and the first judgment unit receives a residual signal, maps the residual signal to a positive integer, and calculates mean mean; the second decision unit receives the signal to be encoded, maps the signal to be encoded into a positive integer, and calculates the mean mean;
第一判决单元对各帧待编码预测残差进行数据映射,具体包括:将各帧待编码预测残差的带编码值c被替换为映射值d:The first decision unit performs data mapping on the prediction residual of each frame to be coded, specifically including: replacing the coded value c of the prediction residual of each frame to be coded with the mapping value d:
判断各帧待编码预测残差中带编码值c是否小于0,Judging whether the coded value c in each frame to be coded prediction residual is less than 0,
若带编码值c小于0,则映射值d=2c;If the coded value c is less than 0, then the mapping value d=2c;
若带编码值c大于等于0,则映射值d=2c+1;If the coded value c is greater than or equal to 0, then the mapping value d=2c+1;
第二判决单元对各帧待编码预测残差进行数据映射,具体包括:将各帧待编码预测残差的带编码值c被替换为映射值d:The second decision unit performs data mapping on the prediction residual of each frame to be coded, specifically including: replacing the coded value c of the prediction residual of each frame to be coded with the mapping value d:
判断各帧待编码预测残差中带编码值c是否小于0,Judging whether the coded value c in the prediction residual of each frame to be coded is less than 0,
若带编码值c小于0,则映射值d=2c;If the coded value c is less than 0, then the mapping value d=2c;
若带编码值c大于等于0,则映射值d=2c+1;If the coded value c is greater than or equal to 0, then the mapping value d=2c+1;
对各帧待编码信号进行数据映射,具体包括:将各帧待编码信号的带编码值e被替换为映射值f:Perform data mapping on each frame of the signal to be encoded, specifically including: replacing the encoded value e of each frame of the signal to be encoded with the mapping value f:
判断各帧待编码预测残差中带编码值e是否小于0,Judging whether the coded value e in the prediction residual of each frame to be coded is less than 0,
若带编码值e小于0,则映射值f=2e;If the coded value e is less than 0, then the mapping value f=2e;
若带编码值e大于等于0,则映射值f=2e+1。If the coded value e is greater than or equal to 0, then the mapped value f=2e+1.
所述所述参数输出单元用于对待编码信号或预测残差进行数据分析得到均值;The parameter output unit is used to perform data analysis on the signal to be coded or the prediction residual to obtain a mean value;
若需要预测,则参数输出单元通过计算分析第一判决单元输出的残差信号的均值得到选择参数吧,具体包括,If prediction is required, the parameter output unit obtains the selected parameters by calculating and analyzing the mean value of the residual signal output by the first decision unit, specifically including,
若残差信号mean<m1,则参数输出单元输出选择参数b=m1/2至所述Golomb编码模块;If the residual signal mean<m 1 , then the parameter output unit outputs the selection parameter b=m 1/2 to the Golomb coding module;
若m1≤残差信号mean<m2,则参数输出单元输出选择参数b=m1至所述Golomb编码模块;If m 1 ≤ residual signal mean<m 2 , then the parameter output unit outputs the selection parameter b=m 1 to the Golomb encoding module;
若m2≤残差信号mean<m3,则参数输出单元输出选择参数b=m2至所述Golomb编码模块;If m 2 ≤ residual signal mean<m 3 , then the parameter output unit outputs the selection parameter b=m 2 to the Golomb encoding module;
若残差信号mean≥m3,则参数输出单元输出选择参数b=m3至所述Golomb编码模块。If the residual signal mean≥m 3 , the parameter output unit outputs the selection parameter b=m 3 to the Golomb encoding module.
若不需要预测,则参数输出单元通过计算分析第二判决单元输出的待编码信号的均值得到选择参数吧,具体包括,If prediction is not required, then the parameter output unit obtains the selected parameters by calculating and analyzing the mean value of the signal to be encoded output by the second decision unit, specifically including,
若待编码信号mean<m1,则参数输出单元输出选择参数b=m1/2至所述Golomb编码模块;If the signal to be encoded mean<m 1 , then the parameter output unit outputs the selection parameter b=m 1/2 to the Golomb encoding module;
若m1≤待编码信号mean<m2,则参数输出单元输出选择参数b=m1至所述Golomb编码模块;If m 1 ≤ signal to be encoded mean<m 2 , then the parameter output unit outputs the selection parameter b=m 1 to the Golomb encoding module;
若m2≤待编码信号mean<m3,则参数输出单元输出选择参数b=m2至所述Golomb编码模块;If m 2 ≤ signal to be encoded mean<m 3 , then the parameter output unit outputs the selection parameter b=m 2 to the Golomb encoding module;
若待编码信号mean≥m3,则参数输出单元输出选择参数b=m3至所述Golomb编码模块。If the signal to be encoded is mean≥m 3 , the parameter output unit outputs the selection parameter b=m 3 to the Golomb encoding module.
m1、m2、m3、取值根据残差均值或带编码数据均值来确定大小。The values of m 1 , m 2 , and m 3 are determined according to the mean value of the residual or the mean value of the coded data.
以上所述仅是本发明的优选实施方式,并不用于限制本发明,应当指出,对于本技术领域的普通技术人员来说,在不脱离本发明技术原理的前提下,还可以做出若干改进和变型,这些改进和变型也应视为本发明的保护范围。The above is only a preferred embodiment of the present invention, and is not intended to limit the present invention. It should be pointed out that for those of ordinary skill in the art, some improvements can be made without departing from the technical principle of the present invention. and modifications, these improvements and modifications should also be considered as the protection scope of the present invention.
Claims (7)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610214126.8A CN105915227B (en) | 2016-04-08 | 2016-04-08 | Adaptive Hybrid Data Lossless Compression System |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201610214126.8A CN105915227B (en) | 2016-04-08 | 2016-04-08 | Adaptive Hybrid Data Lossless Compression System |
Publications (2)
Publication Number | Publication Date |
---|---|
CN105915227A true CN105915227A (en) | 2016-08-31 |
CN105915227B CN105915227B (en) | 2019-03-15 |
Family
ID=56745737
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201610214126.8A Active CN105915227B (en) | 2016-04-08 | 2016-04-08 | Adaptive Hybrid Data Lossless Compression System |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN105915227B (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114003546A (en) * | 2022-01-04 | 2022-02-01 | 之江实验室 | A method and device for designing multi-channel switch-value composite coding |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1767395A (en) * | 2004-10-29 | 2006-05-03 | 微软公司 | Lossless adaptive encoding and decoding of integer data |
CN1783144A (en) * | 2004-10-29 | 2006-06-07 | 微软公司 | Lossless adaptive Golomb/Rice encoding and decoding of integer data using backward-adaptive rules |
CN102262881A (en) * | 2010-05-24 | 2011-11-30 | 中科开元信息技术(北京)有限公司 | AVS (audio video standard) destructive audio based nondestructive coding and decoding expansion method |
CN102368385A (en) * | 2011-09-07 | 2012-03-07 | 中科开元信息技术(北京)有限公司 | Backward block adaptive Golomb-Rice coding and decoding method and apparatus thereof |
CN104217726A (en) * | 2014-09-01 | 2014-12-17 | 东莞中山大学研究院 | Encoding method and decoding method for lossless audio compression |
CN104349165A (en) * | 2014-09-16 | 2015-02-11 | 上海通途半导体科技有限公司 | High-performance length-variable coding and decoding methods and devices |
-
2016
- 2016-04-08 CN CN201610214126.8A patent/CN105915227B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN1767395A (en) * | 2004-10-29 | 2006-05-03 | 微软公司 | Lossless adaptive encoding and decoding of integer data |
CN1783144A (en) * | 2004-10-29 | 2006-06-07 | 微软公司 | Lossless adaptive Golomb/Rice encoding and decoding of integer data using backward-adaptive rules |
CN102262881A (en) * | 2010-05-24 | 2011-11-30 | 中科开元信息技术(北京)有限公司 | AVS (audio video standard) destructive audio based nondestructive coding and decoding expansion method |
CN102368385A (en) * | 2011-09-07 | 2012-03-07 | 中科开元信息技术(北京)有限公司 | Backward block adaptive Golomb-Rice coding and decoding method and apparatus thereof |
CN104217726A (en) * | 2014-09-01 | 2014-12-17 | 东莞中山大学研究院 | Encoding method and decoding method for lossless audio compression |
CN104349165A (en) * | 2014-09-16 | 2015-02-11 | 上海通途半导体科技有限公司 | High-performance length-variable coding and decoding methods and devices |
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN114003546A (en) * | 2022-01-04 | 2022-02-01 | 之江实验室 | A method and device for designing multi-channel switch-value composite coding |
CN114003546B (en) * | 2022-01-04 | 2022-04-12 | 之江实验室 | Multi-channel switching value composite coding design method and device |
Also Published As
Publication number | Publication date |
---|---|
CN105915227B (en) | 2019-03-15 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107135004B (en) | An Adaptive Real-time Lossless Compression Method for Seismic Data Streams | |
CN102368385B (en) | Backward block adaptive Golomb-Rice coding and decoding method and apparatus thereof | |
TW201036449A (en) | Video encoder, video decoder, video coding method, video decoding method, video coding program, video decoding program, and video coding/decoding system | |
CN107743239B (en) | A method and device for encoding and decoding video data | |
US8909521B2 (en) | Coding method, coding apparatus, coding program, and recording medium therefor | |
US10666289B1 (en) | Data compression using dictionary encoding | |
EP2214315A1 (en) | Method and device for encoding a bit sequence | |
KR20120031950A (en) | Compression coding and decoding method, coder, decoder, and coding device | |
JP2019124947A (en) | Coding and decoding of spectral peak positions | |
CN115883670B (en) | Medical data analysis and acquisition method and device | |
CN104380733A (en) | Video quantization-parameter encoding method, video quantization-parameter decoding method, device, and program | |
JP2003524983A (en) | Method and apparatus for optimized lossless compression using multiple coders | |
CN101945286A (en) | Compression coding method, decoding decompression method, device and communication system | |
KR20110043684A (en) | Methods, systems, and apparatus for compressing or decompressing digital signals | |
KR20100035955A (en) | Apparatus and method for lossless coding and decoding | |
RU2611249C1 (en) | Entropy modifier and method to use it | |
CN102265336A (en) | Adaptive differential pulse code modulation encoding equipment and decoding equipment | |
CN105915228B (en) | Adaptive Hybrid Data Lossless Compression Method | |
CN105915227B (en) | Adaptive Hybrid Data Lossless Compression System | |
CN111836045A (en) | A Lossless Compression Method for Bridge Health Monitoring Sensor Data | |
CN102710263B (en) | Entropy decision optimal differential coding-based Lempel-Ziv-Welch (LZW) compression method | |
US8416104B2 (en) | Method and apparatus for entropy decoding | |
CN116582689A (en) | Lossless compression for low-latency video transmission in resource-constrained coding environments | |
CN201418137Y (en) | A Lossless Compression Processing System for Spaceborne Images | |
KR100462789B1 (en) | method and apparatus for multi-symbol data compression using a binary arithmetic coder |
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 |