Improved SPIHT image coding and decoding method based on wavelet modulus maximum reconstruction

文档序号:1579953 发布日期:2020-01-31 浏览:16次 中文

阅读说明:本技术 基于小波模极大值重建的改进spiht图像编码和解码方法 (Improved SPIHT image coding and decoding method based on wavelet modulus maximum reconstruction ) 是由 宋传鸣 谢维冬 张晋豪 王相海 于 2019-11-05 设计创作,主要内容包括:本发明公开一种基于小波模极大值重建的改进SPIHT图像编码和解码方法,将小波模极大值重建引入到图像可分级编码中,发现对小波变换后的最高频子带进行模极大值重建能取得较高的重构质量,并利用最高频子带系数的方向梯度模长,选取适合模极大值重建的子带;对需要进行模极大值重建的子带施加二次小波变换,将那些具有幅值相关性的高幅值系数的能量进一步集中到少量系数上,在增加了空间方向树高度的同时,增大了局部模极大值的幅值,有利于改善局部模极大值在中、低码率下的解码精度和交替投影的重建质量;利用父子系数间的幅值衰减规律,对模极大值重建后的小波系数幅值进行约束。(The invention discloses improved SPIHT image coding and decoding methods based on wavelet modulus maximum reconstruction, which introduces wavelet modulus maximum reconstruction into image scalable coding, finds that higher reconstruction quality can be obtained by performing modulus maximum reconstruction on a highest frequency sub-band after wavelet transformation, selects a sub-band suitable for modulus maximum reconstruction by using the direction gradient modulus length of a highest frequency sub-band coefficient, applies secondary wavelet transformation on the sub-band needing modulus maximum reconstruction, concentrates the energy of high amplitude coefficients with amplitude correlation to a small number of coefficients by steps, increases the amplitude of local modulus maximum while increasing the height of a spatial direction tree, is beneficial to improving the decoding precision of the local modulus maximum at middle and low code rates and the reconstruction quality of alternative projection, and restricts the amplitude of the wavelet coefficient after modulus maximum reconstruction by using the amplitude attenuation rule among parent sub-coefficients.)

1, improved SPIHT image coding method based on wavelet modulus maximum reconstruction, which is characterized by comprising the following steps:

step 1, inputting an image I to be coded and a target code rate R, setting the size of the image I to be coded as H multiplied by W pixels, calculating the Bit number Bit _ Budget required by the coded image I as H multiplied by W multiplied by R according to the target code rate R, and transmitting H and W to a decoding end by using 1 byte respectively;

step 2, log is carried out on the image I to be coded2min { H, W } -3-level Daubechies biorthogonal 9/7 wavelet transform;

step 3, judging whether the lowest frequency sub-band has a negative coefficient, if the lowest frequency sub-band has the negative coefficient, making the sign variable HavingNegative equal to 1, otherwise, making HavingNegative equal to 0, and then transmitting the value of HavingNegative to a decoding end by using 1 bit;

step 4, calculating the maximum amplitude Max of the absolute value of the lowest frequency sub-band coefficient, and further obtaining the maximum bit plane number

Figure FDA0002260214040000011

step 5, calculating the gradient of the LH, HL and HH sub-bands of the highest frequency at each coefficient by adopting a forward difference operator, and then respectively counting the average gradient modular length of the three sub-bands to ensure that the average gradient modular length is thetaLH、ΘHLAnd ΘHHAnd each 8bit is transmitted to a decoding end;

step 6, selecting thetaLH、ΘHLAnd ΘHHAnd extracting the modulo maximum sequence of the subband B:

step 6.1, reorganizing the two-dimensional wavelet coefficients of the sub-band B into -dimensional coefficient sequences S with the length of l according to the raster scanning sequence, wherein l is H × W/4;

step 6.2, carrying out 1-order -dimensional wavelet transform on the -dimensional coefficient sequence S, so as to centralize the coefficient energy in a step;

step 6.3 order SMaxRepresenting a sequence of modulo maxima of wavelet coefficients and dividing SMaxInitializing to an empty set;

step 6.4 Add the 1 st coefficient of the D coefficient sequence S to SMaxTransmitting bits "1" to the decoder, and making index ← 2;

step 6.5 let S (index), S (index-1) and S (index +1) denote the index-th coefficient, index-1-th coefficient and index + 1-th coefficient, respectively, of the -D coefficient sequence S, as long as | S (index)>| S (index-1) | and | S (index) | hair>If S (index +1) |, S (index) is local modulo maxima, which are added to SMax bits of '1' are transmitted to the decoding end, otherwise '0' is added to SMaxIn, bits of "0" are transmitted to the decoding end;

step 6.6, let index ← index +1, if index ═ l, go to step 6.7, otherwise go to step 6.5;

step 6.7 Add the ith coefficient of the -dimensional coefficient sequence S to SMax bits of '1' are transmitted to a decoding end;

step 6.8 abandon all original wavelet coefficients of sub-band B and use the sequence of modulo maxima SMaxReplacing the wavelet coefficient of the sub-band B with the coefficient in the step (5), and turning to the step (7);

step 7, initializing the non-significant coefficient tableImportant coefficient table

Figure FDA0002260214040000024

And 8, coding all wavelet transformation coefficients by adopting a scanning mode similar to SPIHT:

step 8.1 initialise scan threshold T-2nAll coefficients of the lowest-frequency sub-band are put into an LIP table, the lowest-frequency coefficient with child coefficients is added into an LIS table, and the scanning type of the lowest-frequency sub-band is set to be D type;

step 8.2, if T is less than 1 or the number of bits to be output in the Bit stream table is greater than Bit _ Budget, then step 9 is carried out; otherwise, go to step 8.3;

step 8.3 scan LIP table: sequentially taking out each coefficient c to be processed in the LIP table, and executing the step 8.3.1 to the step 8.3.5; if all the coefficients in the LIP table are processed, the step 8.4 is carried out;

step 8.3.1, if | c | < T, adding bit "0" at the end of the bit stream table E, and returning to step 8.3;

step 8.3.2, if | c | ≧ T, adding bit "1" at the end of the bit stream table E, deleting the coefficient c from the LIP table and adding the coefficient c to the end of the LSP table;

if c is the lowest frequency coefficient and HavingNegative is 0, the step 8.3.4 returns to the step 8.3; otherwise, go to step 8.3.5;

step 8.3.5, if the coefficient c is a positive number, adding bit "1" at the end of the bit stream table E, otherwise, adding bit "0" at the end of the bit stream table E, and returning to step 8.3;

step 8.4 scan LIS table: sequentially taking out each element e to be processed in the LIS table, and executing the step 8.4.1 to the step 8.4.3; if all the elements in the LIS table are processed, the step 8.5 is carried out;

step 8.4.1, if the scanning type is D type, turning to step 8.4.2, otherwise, turning to step 8.4.3;

step 8.4.2 judges whether the D-type subset of e is an important set:

a, if the D-type subset of E is an important set, adding a bit '1' at the end of the bit flow table E, and then executing the steps a.1 to a.3 for 4 times to sequentially judge the importance of 4D-type child coefficients of E;

a.1 if a certain child coefficient is important, adding bit "1" at the end of bit stream table E and adding the child coefficient to the end of LSP table, step , if the child coefficient is a positive number, adding bit "1" at the end of bit stream table E, otherwise adding bit "0" at the end of bit stream table E;

a.2, judging whether the L-type subset of e is an empty set, if not, converting the scanning type of e from D type to L type and then adding the scanning type to the tail part of the LIS table, and if the L-type subset of e is an empty set, deleting an element e from the LIS table;

a.3 if a certain child coefficient is not a significant coefficient, adding the child coefficient to the end of the LIP table and adding a bit "0" at the end of the bitstream table;

b if the type D subset of e is an unimportant set, add the character "0" at the end of the bitstream table;

step 8.4.2 judges whether the L-type subset of e is an important set:

a if the L-type subset of e is an important set, adding bit '1' at the end of the bit stream table, adding 4 direct child coefficients of e to the tail of the LIS table, and setting the scanning type of the LIS table to be D-type; returning to the step 8.4;

b if the L-type subset of e is not an important set, add bit "0" at the end of the bit stream table; returning to the step 8.4;

step 8.5 fine scanning: sequentially scanning the LSP table, and outputting nth bit planes of the rest coefficients in the LSP table to a bit stream table E except for the coefficients increased in the current scanning;

step 8.6, go to step 8.2, i.e., T ← T/2, n ← n-1.

And 9, transmitting the bit stream table E to a decoding end, and finishing the encoding process.

2, decoding method corresponding to the improved SPIHT image coding method based on wavelet modulus maximum reconstruction as claimed in claim 1, characterized by the following steps:

step 1, initializing basic information of an image I to be decoded;

step 1.1, inputting a Bit stream to be decoded and a target code rate R, decoding the height H and the width W of an image from the first 2 bytes of the Bit stream, and further determining the Bit number Bit _ bucket required by the decoded image I as H × W × R;

step 1.2, reading 1bit from the bit stream, and decoding Havingnegative;

step 1.3 read 4 bits from the bit stream, decode the maximum bit plane number n, and let nmax←n;

Step 1.4 reads 24 bits from the bitstream, decodes the average gradient modulo length Θ of the 3 highest frequency subbands in the order LH, HL and HHLH、ΘHL、ΘHH

Step 1.5 select thetaLH、ΘHLAnd ΘHHThe sub-band corresponding to the largest one of the sub-bands is used as a sub-band B needing wavelet modulus maximum reconstruction;

step 1.6, let l ← H × W/4, and read l bits from the bit stream, and temporarily store in buffers M;

step 2, initializing the non-significant coefficient tableImportant coefficient table

Figure FDA0002260214040000042

Step 3, putting all coefficient coordinates of the lowest frequency sub-band into an LIP table, adding the coordinates of the lowest frequency coefficient with child coefficients into the LIS table, and setting the scanning type of the lowest frequency sub-band as a D type;

and 4, processing the LIP table, the LIS table and the LSP table by adopting a scanning mode similar to SPIHT:

step 4.1 scan LIP table: for each element to be processed in the LIP table, executing the step 4.1.1 to the step 4.1.5; if all elements in the LIP table are processed, the step 4.2 is carried out;

step 4.1.1, reading 1bit c from the bit stream;

step 4.1.2, if c is 0, indicating that the coefficient corresponding to the current coordinate (i, j) in the LIP table is an unimportant coefficient, and returning to step 4.1;

step 4.1.3, if c is 1, indicating that the coefficient corresponding to the current coordinate (i, j) in the LIP table is an important coefficient, updating the value of the important coefficient to 1.5 × T, and then deleting the coordinate (i, j) from the LIP table and adding the coordinate (i, j) to the end of the LSP table;

step 4.1.4, if the current coordinate (i, j) is in the lowest frequency sub-band and has a positive negative of 0, returning to step 4.1; otherwise, turning to step 4.1.5;

step 4.1.5, reading 1bit from the bit stream, and if the bit is '0', taking an inverse number for the coefficient value corresponding to the current coordinate (i, j); otherwise, keeping the coefficient value unchanged;

step 4.2 scanning the LIS table: for each element p to be processed in the LIS table, executing the step 4.2.1 to the step 4.2.3; if all the elements in the LIS table are processed, the step 4.3 is carried out;

step 4.2.1, if the scanning type of the current element p to be processed is D type, turning to step 4.2.2, otherwise, turning to step 4.2.3;

step 4.2.2, reading 1bit e from the bit stream;

if e is 1, indicating that the D-type subset corresponding to p is an important set, executing steps a.1-a.4 for 4 times to sequentially judge the importance of 4D-type child coefficients;

a.1, reading 1bit from the bit stream, if the bit is '1', switching to a.2, otherwise, switching to a.4;

a.2, adding the coordinate of the direct child coefficient of p to the end of the LSP table, and reading 1bit from the bit stream, if the bit is '1', updating the value of the corresponding child coefficient to 1.5 × T, otherwise updating the value of the corresponding child coefficient to-1.5 × T;

a.3, judging whether the L-type subset of p is an empty set, if not, converting the scanning type of p from D type to L type and adding the L-type subset to the tail part of the LIS table; if the L-type subset of p is an empty set, deleting the element p from the LIS table; turning to the step 4.2.2;

a.4, adding the coordinates of the child coefficients to the tail of the LIP table;

b if e is 0, indicating that p corresponds to an unimportant set, and returning to the step 4.2;

step 4.2.3, reading 1bit f from the bit stream, and judging whether the L-shaped subset of p is an important set;

a if f is 1, indicating that the L-type subset of p is an important set, adding the coordinates of 4 direct child coefficients of p to the tail of the LIS table, and setting the scanning type of the LIS table to be D-type; returning to the step 4.2;

b if f is 0, indicating that the L-type subset of p is not a significant set; returning to the step 4.2;

step 4.3 fine scanning: sequentially scanning the LSP table, reading 1bit from a bit stream for each element except the elements added in the current scanning, if the bit is '1', increasing the absolute value of the wavelet coefficient corresponding to the element by T/2, otherwise, decreasing the absolute value of the wavelet coefficient corresponding to the element by T/2;

step 4.4, let T ← T/2, n ← n-1, if the Bit quantity read from the Bit stream at present has reached Bit _ Budget or T <1, go to step 5, otherwise go to step 4.1;

step 5, reconstructing wavelet modulus maximum value of the sub-band B;

step 5.1 reorganizing the decoded coefficients of the sub-band B into coefficient sequences S with the length of l in dimensions according to the raster scanning sequence, enabling index ← 1 and num ← 1, establishing arrays Loca with the length of l in dimensions, and initializing the arrays into zero arrays for storing the positions of local modulus maxima;

step 5.2, read 1bit f from the buffer M, if f ═ 1, let num element of dimension group Loca equal index, namely Loca (num) ← index, and let index ← index +1, num ← num + 1;

step 5.3, if index is larger than l, the step 5.4 is carried out, otherwise, the step 5.2 is carried out;

step 5.4, according to the -dimensional coefficient sequence S and the position array Loca of the local modulus maximum, utilizing an alternative projection method containing iter iteration to reconstruct the wavelet modulus maximum to obtain a reconstructed -dimensional coefficient sequence;

step 5.5, carrying out 1-order -dimensional wavelet inverse transformation on the reconstructed -dimensional coefficient sequence to obtain S';

step 5.6, according to the raster scanning sequence, reorganizing the coefficients of the S ' into a two-dimensional matrix B ' with the size of (H/2) x (W/2), and replacing the decoded coefficients at the same spatial position in the sub-band B with the coefficients of the B ' to obtain the sub-band B reconstructed by the wavelet modulus maximum;

step 5.7 for each coefficient in subband B, if its magnitude is greater than

Figure FDA0002260214040000051

step 6. Log the decoded coefficients of all sub-bands2And (5) performing wavelet inverse transformation on min { H, W } -3-level Daubechies biorthogonal 9/7 to obtain a decoded image I 'and outputting I'.

Technical Field

The invention relates to the field of image processing, in particular to improved SPIHT image coding and decoding methods based on wavelet modulus maximum reconstruction and having high edge decoding precision and good subjective quality.

Background

The image scalable coding method can decode parts of a code stream according to the actual conditions of spatial resolution, network bandwidth or terminal computing capacity, the decoded image has higher reconstruction quality, can well adapt to the heterogeneous characteristics of a network, the dynamic fluctuation of the bandwidth and the diversity of the terminal computing capacity, and meets the application requirements of progressive transmission of the image, multi-quality service, image database browsing and the like, and is widely applied to the fields of hyperspectral image compression, video compression, fingerprint image compression, medical image compression, image encryption and the like by due to the excellent execution efficiency and compression ratio.

Image scalable coding consists of three stages, namely transform, quantization scanning and entropy coding. The quantization scanning stage is a core step of scalable coding, determines the overall coding efficiency and the progressive approximation efficiency, and aims to reduce the information entropy of an image to be coded by reducing the pixel value or the value domain interval of a transform coefficient within an acceptable data distortion range so as to further realize image compression. Researchers at home and abroad propose various effective quantitative scanning methods, such as an Embedded zero tree method (EZW), a multilevel tree Set splitting method (SPIHT), a Set split Embedded Block method (SPECK), and an Optimized truncated Embedded Block Coding with Optimized Truncation method (EBCOT).

Among the scalable coding methods for still images, SPIHT is which has the greatest application range of , the most attention, and the most comprehensive improvement.

, SPIHT algorithm improved based on transformation mode.

The research shows that wavelet transform is not an optimal sparse representation tool for 2D images, high-frequency sub-bands still contain a large number of transform coefficients with larger amplitudes, and optimal approximation and energy concentration for complex edge singularities cannot be achieved, then, researchers introduce new -generation multi-scale transforms such as ridge waves, curvelets and Contourlet (Contourlet) into scalable coding, further enable the transform coefficients to have better anisotropy, faster inter-scale attenuation, more prominent energy aggregation, and the like, Lidashan et al discuss the correlation among ridge transform coefficients, and design scalable coding algorithms based on ridge transform in combination with SPT coding algorithm, Mansoor et al propose thresholding the curvelet transform coefficients, centering the former p% of the coefficients with the smallest amplitudes, then select different quantization curvelets to perform lossy compression and entropy coding on the residual coefficients, and coding on the reconstruction quality of the residual coefficients are better than those based on the wavelet transform coefficients based on low-code rate transform, the wavelet transform coefficients are better than those based on the wavelet transform coefficients of the conventional wavelet transform coefficients of the high-frequency sub-band coding, the high-band transform coefficients, the wavelet transform coefficients, the high-curve coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient, the low-coding coefficient, the high-coding coefficient.

Second, the SPIHT algorithm is improved based on a quantization mode.

In this case, Wang et al adopt a multi-scalar quantization method to process the lowest frequency coefficient and use uniform scalar quantization to code other sub-bands, and further propose SPIHT image scalable coding algorithms of composite quantization schemes, aiming at the characteristic that the integer wavelet transform of the lifting scheme has a small coefficient distribution range, Song et al take the odd square as a quantization threshold and propose quantization approximation schemes based on the dichotomy method.

And thirdly, an improved SPIHT algorithm based on a coefficient scanning organization mode.

The method comprises the steps of encoding a binary coding coefficient of a binary coding tree, encoding a binary coding coefficient of a binary coding, encoding a binary coding, encoding, a binary coding, encoding, a multi-encoding, a multi-encoding system, a multi-encoding, a multi-coefficient, a multi-parameter, a multi-encoding system, a multi-parameter, a multi-.

The improved SPIHT algorithm based on the quantization mode and the improved SPIHT algorithm based on the coefficient scanning organization mode are based on the aspects of signal fidelity and energy conservation, the peak signal-to-noise ratio of a decoded image is basically improved, and the problems of edge blurring, obvious ringing effect and the like of a reconstructed image under a low code rate are ignored.

Disclosure of Invention

The invention aims to solve the technical problems in the prior art and provides improved SPIHT image coding and decoding methods which have high edge decoding precision and good subjective quality and are based on wavelet modulus maximum reconstruction.

The technical scheme of the invention is that improved SPIHT image coding methods based on wavelet modulus maximum reconstruction are carried out according to the following steps:

step 1, inputting an image I to be coded and a target code rate R, setting the size of the image I to be coded as H multiplied by W pixels, calculating the Bit number Bit _ Budget required by the coded image I as H multiplied by W multiplied by R according to the target code rate R, and transmitting H and W to a decoding end by using 1 byte respectively;

step 2, log is carried out on the image I to be coded2min { H, W } -3-level Daubechies biorthogonal 9/7 wavelet transform;

step 3, judging whether the lowest frequency sub-band has a negative coefficient, if the lowest frequency sub-band has the negative coefficient, making the sign variable HavingNegative equal to 1, otherwise, making HavingNegative equal to 0, and then transmitting the value of HavingNegative to a decoding end by using 1 bit;

step 4, calculating the maximum amplitude Max of the absolute value of the lowest frequency sub-band coefficient, and further obtaining the maximum bit plane number n ═ log2Max]And the value of n is transmitted to a decoding end by 4 bits;

step 5, calculating the gradient of the LH, HL and HH sub-bands of the highest frequency at each coefficient by adopting a forward difference operator, and then respectively counting the average gradient modular length of the three sub-bands to ensure that the average gradient modular length is thetaLH、ΘHLAnd ΘHHAnd each 8bit is transmitted to a decoding end;

step 6, selecting thetaLH、ΘHLAnd ΘHHAnd extracting the modulo maximum sequence of the subband B:

step 6.1, reorganizing the two-dimensional wavelet coefficients of the sub-band B into -dimensional coefficient sequences S with the length of l according to the raster scanning sequence, wherein l is H × W/4;

step 6.2, carrying out 1-order -dimensional wavelet transform on the -dimensional coefficient sequence S, so as to centralize the coefficient energy in a step;

step 6.3 order SMaxRepresenting a sequence of modulo maxima of wavelet coefficients and dividing SMaxInitializing to an empty set;

step 6.4 Add the 1 st coefficient of the D coefficient sequence S to SMaxTransmitting bits "1" to the decoder, and making index ← 2;

step 6.5 let S (index), S (index-1) and S (index +1) denote the index-th coefficient, index-1-th coefficient and index + 1-th coefficient, respectively, of the -D coefficient sequence S, as long as | S (index)>| S (index-1) | and | S (index) | hair>If S (index +1) |, S (index) is local modulo maxima, which are added to SMax bits of '1' are transmitted to the decoding end, otherwise '0' is added to SMaxIn, bits of "0" are transmitted to the decoding end;

step 6.6, let index ← index +1, if index ═ l, go to step 6.7, otherwise go to step 6.5;

step 6.7 Add the ith coefficient of the -dimensional coefficient sequence S to SMax bits of '1' are transmitted to a decoding end;

step 6.8 abandon all original wavelet coefficients of sub-band B and use the sequence of modulo maxima SMaxReplacing the wavelet coefficient of the sub-band B with the coefficient in the step (5), and turning to the step (7);

step 7, initializing the non-significant coefficient table

Figure BDA0002260214050000061

Important coefficient table

Figure BDA0002260214050000062

List of non-significant subsetsAnd bit stream table

And 8, coding all wavelet transformation coefficients by adopting a scanning mode similar to SPIHT:

step 8.1 initialise scan threshold T-2nAll coefficients of the lowest-frequency sub-band are put into an LIP table, the lowest-frequency coefficient with child coefficients is added into an LIS table, and the scanning type of the lowest-frequency sub-band is set to be D type;

step 8.2, if T is less than 1 or the number of bits to be output in the Bit stream table is greater than Bit _ Budget, then step 9 is carried out; otherwise, go to step 8.3;

step 8.3 scan LIP table: sequentially taking out each coefficient c to be processed in the LIP table, and executing the step 8.3.1 to the step 8.3.5; if all the coefficients in the LIP table are processed, the step 8.4 is carried out;

step 8.3.1, if | c | < T, adding bit "0" at the end of the bit stream table E, and returning to step 8.3;

step 8.3.2, if | c | ≧ T, adding bit "1" at the end of the bit stream table E, deleting the coefficient c from the LIP table and adding the coefficient c to the end of the LSP table;

if c is the lowest frequency coefficient and HavingNegative is 0, the step 8.3.4 returns to the step 8.3; otherwise, go to step 8.3.5;

step 8.3.5, if the coefficient c is a positive number, adding bit "1" at the end of the bit stream table E, otherwise, adding bit "0" at the end of the bit stream table E, and returning to step 8.3;

step 8.4 scan LIS table: sequentially taking out each element e to be processed in the LIS table, and executing the step 8.4.1 to the step 8.4.3; if all the elements in the LIS table are processed, the step 8.5 is carried out;

step 8.4.1, if the scanning type is D type, turning to step 8.4.2, otherwise, turning to step 8.4.3;

step 8.4.2 judges whether the D-type subset of e is an important set:

a, if the D-type subset of E is an important set, adding a bit '1' at the end of the bit flow table E, and then executing the steps a.1 to a.3 for 4 times to sequentially judge the importance of 4D-type child coefficients of E;

a.1 if a certain child coefficient is important, adding bit "1" at the end of bit stream table E and adding the child coefficient to the end of LSP table, step , if the child coefficient is a positive number, adding bit "1" at the end of bit stream table E, otherwise adding bit "0" at the end of bit stream table E;

a.2, judging whether the L-type subset of e is an empty set, if not, converting the scanning type of e from D type to L type and then adding the scanning type to the tail part of the LIS table, and if the L-type subset of e is an empty set, deleting an element e from the LIS table;

a.3 if a certain child coefficient is not a significant coefficient, adding the child coefficient to the end of the LIP table and adding a bit "0" at the end of the bitstream table;

b if the type D subset of e is an unimportant set, add the character "0" at the end of the bitstream table;

step 8.4.2 judges whether the L-type subset of e is an important set:

a if the L-type subset of e is an important set, adding bit '1' at the end of the bit stream table, adding 4 direct child coefficients of e to the tail of the LIS table, and setting the scanning type of the LIS table to be D-type; returning to the step 8.4;

b if the L-type subset of e is not an important set, add bit "0" at the end of the bit stream table; returning to the step 8.4;

step 8.5 fine scanning: sequentially scanning the LSP table, and outputting nth bit planes of the rest coefficients in the LSP table to a bit stream table E except for the coefficients increased in the current scanning;

step 8.6, go to step 8.2, i.e., T ← T/2, n ← n-1.

And 9, transmitting the bit stream table E to a decoding end, and finishing the encoding process.

decoding method corresponding to the improved SPIHT image coding method based on wavelet modulus maximum reconstruction, which comprises the following steps:

step 1, initializing basic information of an image I to be decoded;

step 1.1, inputting a Bit stream to be decoded and a target code rate R, decoding the height H and the width W of an image from the first 2 bytes of the Bit stream, and further determining the Bit number Bit _ bucket required by the decoded image I as H × W × R;

step 1.2, reading 1bit from the bit stream, and decoding Havingnegative;

step 1.3 read 4 bits from the bit stream, decode the maximum bit plane number n, and let nmax←n;

Step 1.4 reads 24 bits from the bitstream, decodes the average gradient modulo length Θ of the 3 highest frequency subbands in the order LH, HL and HHLH、ΘHL、ΘHH

Step 1.5 select thetaLH、ΘHLAnd ΘHHThe sub-band corresponding to the largest one of the sub-bands is used as a sub-band B needing wavelet modulus maximum reconstruction;

step 1.6, let l ← H × W/4, and read l bits from the bit stream, and temporarily store in buffers M;

step 2, initializing the non-significant coefficient table

Figure BDA0002260214050000081

Important coefficient table

Figure BDA0002260214050000082

List of non-significant subsets

Figure BDA0002260214050000083

Log of image to be decoded2All the min { H, W } -3 level wavelet transform coefficients are initialized to 0, and the scanning threshold T is made to be 2n

Step 3, putting all coefficient coordinates of the lowest frequency sub-band into an LIP table, adding the coordinates of the lowest frequency coefficient with child coefficients into the LIS table, and setting the scanning type of the lowest frequency sub-band as a D type;

and 4, processing the LIP table, the LIS table and the LSP table by adopting a scanning mode similar to SPIHT:

step 4.1 scan LIP table: for each element to be processed in the LIP table, executing the step 4.1.1 to the step 4.1.5; if all elements in the LIP table are processed, the step 4.2 is carried out;

step 4.1.1, reading 1bit c from the bit stream;

step 4.1.2, if c is 0, indicating that the coefficient corresponding to the current coordinate (i, j) in the LIP table is an unimportant coefficient, and returning to step 4.1;

step 4.1.3, if c is 1, indicating that the coefficient corresponding to the current coordinate (i, j) in the LIP table is an important coefficient, updating the value of the important coefficient to 1.5 × T, and then deleting the coordinate (i, j) from the LIP table and adding the coordinate (i, j) to the end of the LSP table;

step 4.1.4, if the current coordinate (i, j) is in the lowest frequency sub-band and has a positive negative of 0, returning to step 4.1; otherwise, turning to step 4.1.5;

step 4.1.5, reading 1bit from the bit stream, and if the bit is '0', taking an inverse number for the coefficient value corresponding to the current coordinate (i, j); otherwise, keeping the coefficient value unchanged;

step 4.2 scanning the LIS table: for each element p to be processed in the LIS table, executing the step 4.2.1 to the step 4.2.3; if all the elements in the LIS table are processed, the step 4.3 is carried out;

step 4.2.1, if the scanning type of the current element p to be processed is D type, turning to step 4.2.2, otherwise, turning to step 4.2.3;

step 4.2.2, reading 1bit e from the bit stream;

if e is 1, indicating that the D-type subset corresponding to p is an important set, executing steps a.1-a.4 for 4 times to sequentially judge the importance of 4D-type child coefficients;

a.1, reading 1bit from the bit stream, if the bit is '1', switching to a.2, otherwise, switching to a.4;

a.2, adding the coordinate of the direct child coefficient of p to the end of the LSP table, and reading 1bit from the bit stream, if the bit is '1', updating the value of the corresponding child coefficient to 1.5 × T, otherwise updating the value of the corresponding child coefficient to-1.5 × T;

a.3, judging whether the L-type subset of p is an empty set, if not, converting the scanning type of p from D type to L type and adding the L-type subset to the tail part of the LIS table; if the L-type subset of p is an empty set, deleting the element p from the LIS table; turning to the step 4.2.2;

a.4, adding the coordinates of the child coefficients to the tail of the LIP table;

b if e is 0, indicating that p corresponds to an unimportant set, and returning to the step 4.2;

step 4.2.3, reading 1bit f from the bit stream, and judging whether the L-shaped subset of p is an important set;

a if f is 1, indicating that the L-type subset of p is an important set, adding the coordinates of 4 direct child coefficients of p to the tail of the LIS table, and setting the scanning type of the LIS table to be D-type; returning to the step 4.2;

b if f is 0, indicating that the L-type subset of p is not a significant set; returning to the step 4.2;

step 4.3 fine scanning: sequentially scanning the LSP table, reading 1bit from a bit stream for each element except the elements added in the current scanning, if the bit is '1', increasing the absolute value of the wavelet coefficient corresponding to the element by T/2, otherwise, decreasing the absolute value of the wavelet coefficient corresponding to the element by T/2;

step 4.4, let T ← T/2, n ← n-1, if the Bit quantity read from the Bit stream at present has reached Bit _ Budget or T <1, go to step 5, otherwise go to step 4.1;

step 5, reconstructing wavelet modulus maximum value of the sub-band B;

step 5.1 reorganizing the decoded coefficients of the sub-band B into coefficient sequences S with the length of l in dimensions according to the raster scanning sequence, enabling index ← 1 and num ← 1, establishing arrays Loca with the length of l in dimensions, and initializing the arrays into zero arrays for storing the positions of local modulus maxima;

step 5.2, read 1bit f from the buffer M, if f ═ 1, let num element of dimension group Loca equal index, namely Loca (num) ← index, and let index ← index +1, num ← num + 1;

step 5.3, if index is larger than l, the step 5.4 is carried out, otherwise, the step 5.2 is carried out;

step 5.4, according to the -dimensional coefficient sequence S and the position array Loca of the local modulus maximum, utilizing an alternative projection method containing iter iteration to reconstruct the wavelet modulus maximum to obtain a reconstructed -dimensional coefficient sequence;

step 5.5, carrying out 1-order -dimensional wavelet inverse transformation on the reconstructed -dimensional coefficient sequence to obtain S';

step 5.6, according to the raster scanning sequence, reorganizing the coefficients of the S ' into a two-dimensional matrix B ' with the size of (H/2) x (W/2), and replacing the decoded coefficients at the same spatial position in the sub-band B with the coefficients of the B ' to obtain the sub-band B reconstructed by the wavelet modulus maximum;

step 5.7 for each coefficient in subband B, if its magnitude is greater than

Figure BDA0002260214050000091

Set 1/2 the magnitude of that coefficient to the magnitude of its parent coefficient;

step 6. Log the decoded coefficients of all sub-bands2And (5) performing wavelet inverse transformation on min { H, W } -3-level Daubechies biorthogonal 9/7 to obtain a decoded image I 'and outputting I'.

Compared with the prior art, the method has the advantages that , wavelet modulus maximum reconstruction is introduced into image scalable coding, the decoding effect of main edges and outlines of the image under medium and low code rates is enhanced by exploring the correlation between singular points and non-singular points of wavelet transformation coefficients, secondly, the modulus length of the average direction gradient of the highest frequency sub-band coefficient is used for self-adaptively determining the sub-band suitable for modulus maximum reconstruction, so that modulus maximum reconstruction is carried out on the sub-band with more complex textures and local extreme points, and abundant edges and texture detail areas are decoded more effectively.

Drawings

FIG. 1 is a comparison graph of the effect of decoding Lena images at different code rates of the SPIHT method according to the embodiment of the present invention.

Fig. 2 is a comparison graph of the decoding effect of the Barbara image at different code rates by the embodiment of the present invention and the conventional SPIHT method.

Table 1 shows the comparison between the decoding peak snr of Lena image (512 × 512 pixels) at different coding rates according to the present invention and the prior art.

Table 2 shows the comparison of the decoding peak snr of Barbara images (512 × 512 pixels) at different code rates according to the present invention.

Detailed Description

The improved SPIHT image coding method based on wavelet modulus maximum reconstruction is carried out according to the following steps:

step 1, inputting an image I to be coded and a target code rate R, setting the size of the image I to be coded as H multiplied by W pixels, calculating the Bit number Bit _ Budget required by the coded image I as H multiplied by W multiplied by R according to the target code rate R, and transmitting H and W to a decoding end by using 1 byte respectively;

step 2, log is carried out on the image I to be coded2min { H, W } -3-level Daubechies biorthogonal 9/7 wavelet transform;

step 3, judging whether the lowest frequency sub-band has a negative coefficient, if the lowest frequency sub-band has the negative coefficient, making the sign variable HavingNegative equal to 1, otherwise, making HavingNegative equal to 0, and then transmitting the value of HavingNegative to a decoding end by using 1 bit;

step 4, calculating the maximum amplitude Max of the absolute value of the lowest frequency sub-band coefficient, and further obtaining the maximum bit plane number

Figure BDA0002260214050000115

And the value of n is transmitted to a decoding end by 4 bits;

step 5, calculating the gradient of the LH, HL and HH sub-bands of the highest frequency at each coefficient by adopting a forward difference operator, and then respectively counting the average gradient modular length of the three sub-bands to ensure that the average gradient modular length is thetaLH、ΘHLAnd ΘHHAnd each 8bit is transmitted to a decoding end;

step 6, selecting thetaLH、ΘHLAnd ΘHHAnd extracting the modulo maximum sequence of the subband B:

step 6.1, reorganizing the two-dimensional wavelet coefficients of the sub-band B into -dimensional coefficient sequences S with the length of l according to the raster scanning sequence, wherein l is H × W/4;

step 6.2, carrying out 1-order -dimensional wavelet transform on the -dimensional coefficient sequence S, so as to centralize the coefficient energy in a step;

step 6.3 order SMaxRepresenting a sequence of modulo maxima of wavelet coefficients and dividing SMaxInitializing to an empty set;

step 6.4 Add the 1 st coefficient of the D coefficient sequence S to SMaxTransmitting bits "1" to the decoder, and making index ← 2;

step 6.5 let S (index), S (index-1) and S (index +1) denote the index-th coefficient, index-1-th coefficient and index + 1-th coefficient, respectively, of the -D coefficient sequence S, as long as | S (index)>| S (index-1) | and | S (index) | hair>If S (index +1) |, S (index) is local modulo maxima, which are added to SMax bits of '1' are transmitted to the decoding end, otherwise '0' is added to SMaxIn, bits of "0" are transmitted to the decoding end;

step 6.6, let index ← index +1, if index ═ l, go to step 6.7, otherwise go to step 6.5;

step 6.7 Add the ith coefficient of the -dimensional coefficient sequence S to SMax bits of '1' are transmitted to a decoding end;

step 6.8 abandon all original wavelet coefficients of sub-band B and use the sequence of modulo maxima SMaxReplacing the wavelet coefficient of the sub-band B with the coefficient in the step (5), and turning to the step (7);

step 7, initializing the non-significant coefficient table

Figure BDA0002260214050000111

Important coefficient table

Figure BDA0002260214050000112

List of non-significant subsets

Figure BDA0002260214050000113

And bit stream table

Figure BDA0002260214050000114

And 8, coding all wavelet transformation coefficients by adopting a scanning mode similar to SPIHT:

step 8.1 initialise scan threshold T-2nAll coefficients of the lowest frequency sub-band are put into LIP table, and the lowest frequency coefficient with child coefficients is addedEntering an LIS table, and setting the scanning type of the LIS table as a D type;

step 8.2, if T is less than 1 or the number of bits to be output in the Bit stream table is greater than Bit _ Budget, then step 9 is carried out; otherwise, go to step 8.3;

step 8.3 scan LIP table: sequentially taking out each coefficient c to be processed in the LIP table, and executing the step 8.3.1 to the step 8.3.5; if all the coefficients in the LIP table are processed, the step 8.4 is carried out;

step 8.3.1, if | c | < T, adding bit "0" at the end of the bit stream table E, and returning to step 8.3;

step 8.3.2, if | c | ≧ T, adding bit "1" at the end of the bit stream table E, deleting the coefficient c from the LIP table and adding the coefficient c to the end of the LSP table;

if c is the lowest frequency coefficient and HavingNegative is 0, the step 8.3.4 returns to the step 8.3; otherwise, go to step 8.3.5;

step 8.3.5, if the coefficient c is a positive number, adding bit "1" at the end of the bit stream table E, otherwise, adding bit "0" at the end of the bit stream table E, and returning to step 8.3;

step 8.4 scan LIS table: sequentially taking out each element e to be processed in the LIS table, and executing the step 8.4.1 to the step 8.4.3; if all the elements in the LIS table are processed, the step 8.5 is carried out;

step 8.4.1, if the scanning type is D type, turning to step 8.4.2, otherwise, turning to step 8.4.3;

step 8.4.2 judges whether the D-type subset of e is an important set:

a, if the D-type subset of E is an important set, adding a bit '1' at the end of the bit flow table E, and then executing the steps a.1 to a.3 for 4 times to sequentially judge the importance of 4D-type child coefficients of E;

a.1 if a certain child coefficient is important, adding bit "1" at the end of bit stream table E and adding the child coefficient to the end of LSP table, step , if the child coefficient is a positive number, adding bit "1" at the end of bit stream table E, otherwise adding bit "0" at the end of bit stream table E;

a.2, judging whether the L-type subset of e is an empty set, if not, converting the scanning type of e from D type to L type and then adding the scanning type to the tail part of the LIS table, and if the L-type subset of e is an empty set, deleting an element e from the LIS table;

a.3 if a certain child coefficient is not a significant coefficient, adding the child coefficient to the end of the LIP table and adding a bit "0" at the end of the bitstream table;

b if the type D subset of e is an unimportant set, add the character "0" at the end of the bitstream table;

step 8.4.2 judges whether the L-type subset of e is an important set:

a if the L-type subset of e is an important set, adding bit '1' at the end of the bit stream table, adding 4 direct child coefficients of e to the tail of the LIS table, and setting the scanning type of the LIS table to be D-type; returning to the step 8.4;

b if the L-type subset of e is not an important set, add bit "0" at the end of the bit stream table; returning to the step 8.4;

step 8.5 fine scanning: sequentially scanning the LSP table, and outputting nth bit planes of the rest coefficients in the LSP table to a bit stream table E except for the coefficients increased in the current scanning;

step 8.6, go to step 8.2, i.e., T ← T/2, n ← n-1.

And 9, transmitting the bit stream table E to a decoding end, and finishing the encoding process.

The decoding method corresponding to the improved SPIHT image coding method based on wavelet modulus maximum reconstruction is carried out according to the following steps:

step 1, initializing basic information of an image I to be decoded;

step 1.1, inputting a Bit stream to be decoded and a target code rate R, decoding the height H and the width W of an image from the first 2 bytes of the Bit stream, and further determining the Bit number Bit _ bucket required by the decoded image I as H × W × R;

step 1.2, reading 1bit from the bit stream, and decoding Havingnegative;

step 1.3 read 4 bits from the bit stream, decode the maximum bit plane number n, and let nmax←n;

Step 1.4 reads 24 bits from the bitstream, decodes the average gradient modulo length Θ of the 3 highest frequency subbands in the order LH, HL and HHLH、ΘHL、ΘHH

Step 1.5 select thetaLH、ΘHLAnd ΘHHThe sub-band corresponding to the largest one of the sub-bands is used as a sub-band B needing wavelet modulus maximum reconstruction;

step 1.6, let l ← H × W/4, and read l bits from the bit stream, and temporarily store in buffers M;

step 2, initializing the non-significant coefficient table

Figure BDA0002260214050000131

Important coefficient table

Figure BDA0002260214050000132

List of non-significant subsets

Figure BDA0002260214050000133

Log of image to be decoded2All the min { H, W } -3 level wavelet transform coefficients are initialized to 0, and the scanning threshold T is made to be 2n

Step 3, putting all coefficient coordinates of the lowest frequency sub-band into an LIP table, adding the coordinates of the lowest frequency coefficient with child coefficients into the LIS table, and setting the scanning type of the lowest frequency sub-band as a D type;

and 4, processing the LIP table, the LIS table and the LSP table by adopting a scanning mode similar to SPIHT:

step 4.1 scan LIP table: for each element to be processed in the LIP table, executing the step 4.1.1 to the step 4.1.5; if all elements in the LIP table are processed, the step 4.2 is carried out;

step 4.1.1, reading 1bit c from the bit stream;

step 4.1.2, if c is 0, indicating that the coefficient corresponding to the current coordinate (i, j) in the LIP table is an unimportant coefficient, and returning to step 4.1;

step 4.1.3, if c is 1, indicating that the coefficient corresponding to the current coordinate (i, j) in the LIP table is an important coefficient, updating the value of the important coefficient to 1.5 × T, and then deleting the coordinate (i, j) from the LIP table and adding the coordinate (i, j) to the end of the LSP table;

step 4.1.4, if the current coordinate (i, j) is in the lowest frequency sub-band and has a positive negative of 0, returning to step 4.1; otherwise, turning to step 4.1.5;

step 4.1.5, reading 1bit from the bit stream, and if the bit is '0', taking an inverse number for the coefficient value corresponding to the current coordinate (i, j); otherwise, keeping the coefficient value unchanged;

step 4.2 scanning the LIS table: for each element p to be processed in the LIS table, executing the step 4.2.1 to the step 4.2.3; if all the elements in the LIS table are processed, the step 4.3 is carried out;

step 4.2.1, if the scanning type of the current element p to be processed is D type, turning to step 4.2.2, otherwise, turning to step 4.2.3;

step 4.2.2, reading 1bit e from the bit stream;

if e is 1, indicating that the D-type subset corresponding to p is an important set, executing steps a.1-a.4 for 4 times to sequentially judge the importance of 4D-type child coefficients;

a.1, reading 1bit from the bit stream, if the bit is '1', switching to a.2, otherwise, switching to a.4;

a.2, adding the coordinate of the direct child coefficient of p to the end of the LSP table, and reading 1bit from the bit stream, if the bit is '1', updating the value of the corresponding child coefficient to 1.5 × T, otherwise updating the value of the corresponding child coefficient to-1.5 × T;

a.3, judging whether the L-type subset of p is an empty set, if not, converting the scanning type of p from D type to L type and adding the L-type subset to the tail part of the LIS table; if the L-type subset of p is an empty set, deleting the element p from the LIS table; turning to the step 4.2.2;

a.4, adding the coordinates of the child coefficients to the tail of the LIP table;

b if e is 0, indicating that p corresponds to an unimportant set, and returning to the step 4.2;

step 4.2.3, reading 1bit f from the bit stream, and judging whether the L-shaped subset of p is an important set;

a if f is 1, indicating that the L-type subset of p is an important set, adding the coordinates of 4 direct child coefficients of p to the tail of the LIS table, and setting the scanning type of the LIS table to be D-type; returning to the step 4.2;

b if f is 0, indicating that the L-type subset of p is not a significant set; returning to the step 4.2;

step 4.3 fine scanning: sequentially scanning the LSP table, reading 1bit from a bit stream for each element except the elements added in the current scanning, if the bit is '1', increasing the absolute value of the wavelet coefficient corresponding to the element by T/2, otherwise, decreasing the absolute value of the wavelet coefficient corresponding to the element by T/2;

step 4.4, let T ← T/2, n ← n-1, if the Bit quantity read from the Bit stream at present has reached Bit _ Budget or T <1, go to step 5, otherwise go to step 4.1;

step 5, reconstructing wavelet modulus maximum value of the sub-band B;

step 5.1 reorganizing the decoded coefficients of the sub-band B into coefficient sequences S with the length of l in dimensions according to the raster scanning sequence, enabling index ← 1 and num ← 1, establishing arrays Loca with the length of l in dimensions, and initializing the arrays into zero arrays for storing the positions of local modulus maxima;

step 5.2, read 1bit f from the buffer M, if f ═ 1, let num element of dimension group Loca equal index, namely Loca (num) ← index, and let index ← index +1, num ← num + 1;

step 5.3, if index is larger than l, the step 5.4 is carried out, otherwise, the step 5.2 is carried out;

step 5.4, according to the -dimensional coefficient sequence S and the position array Loca of the local modulus maximum, utilizing an alternative projection method containing iter iteration to reconstruct the wavelet modulus maximum to obtain a reconstructed -dimensional coefficient sequence;

step 5.5, carrying out 1-order -dimensional wavelet inverse transformation on the reconstructed -dimensional coefficient sequence to obtain S';

step 5.6, according to the raster scanning sequence, reorganizing the coefficients of the S ' into a two-dimensional matrix B ' with the size of (H/2) x (W/2), and replacing the decoded coefficients at the same spatial position in the sub-band B with the coefficients of the B ' to obtain the sub-band B reconstructed by the wavelet modulus maximum;

step 5.7 for each coefficient in subband B, if its magnitude is greater than

Figure BDA0002260214050000151

Set 1/2 the magnitude of that coefficient to the magnitude of its parent coefficient;

step 6. Log the decoded coefficients of all sub-bands2And (5) performing wavelet inverse transformation on min { H, W } -3-level Daubechies biorthogonal 9/7 to obtain a decoded image I 'and outputting I'.

The decoding peak signal-to-noise ratios of the embodiment of the invention and the traditional SPIHT method, the SPIHT coding method (2015) based on the improved spatial direction tree and the SPACS algorithm (2016) under different code rates are shown in tables 1 to 2.

The comparison result of decoding Lena images under different code rates between the embodiment of the invention and the traditional SPIHT method is shown in figure 1. Wherein (a) - (c) are decoding images of the traditional SPIHT method; (d) the decoded images of the present invention are (f) to (f).

The comparison result of decoding Barbara images under different code rates by the embodiment of the invention and the traditional SPIHT method is shown in figure 2. Wherein (a) - (c) are decoding images of the traditional SPIHT method; (d) the decoded images of the present invention are (f) to (f).

TABLE 1 comparison of decoding peak signal-to-noise ratio (unit: dB) for Lena images (512X 512 pixels) at different code rates

Figure BDA0002260214050000152

Figure BDA0002260214050000161

TABLE 2 comparison of decoded peak signal-to-noise ratio (in dB) of Barbara images (512X 512 pixels) at different code rates

As can be seen from tables 1-2 and FIGS. 1-2, the peak signal-to-noise ratio of the decoded image of the present invention is higher by 2.25dB than the conventional SPIHT algorithm, which is higher by 2.40dB than the improved SPIHT algorithm based on the spatial direction spatial tree at the medium and low bit rates, and higher by 0.48dB than the SPACS algorithm at the medium and high bit rates. Particularly, when the code rate is higher than 0.2bpp, the invention can obtain subjective decoding quality which is obviously higher than that of the prior art. The invention not only obviously improves the peak signal-to-noise ratio of the decoded image, but also can more accurately reconstruct the edge and texture information in the original image at medium and low code rates, thereby ensuring the subjective and objective quality of the decoded image.

19页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种帧级别的应用层动态FEC编码方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类