A kind of method of eliminating bar interband striped
Technical field
The present invention relates to the technical field of video coding in the signal processing, relate in particular to the method for eliminating bar interband striped in a kind of video coding.
Background technology
In recent years a collection of digital audio/video encoding and decoding standard of Chu Xianing, representative have an international standard MPEG-1, H.263, MPEG-2, MPEG-4, AVC H.264/MPEG-4, the autonomous standard A VS that formulates of China, WM9 that Microsoft releases or the like, all defined the notion of band (Slices) in these standards, in actual applications because the fault-tolerance of considering and the application of concurrency all relate to the application of Slices.Then in these are used, owing to adopted a plurality of slices, between adjacent slices, because the independence of mutual coding, image texture characteristic behind the coding has inevitably produced inconsistency, this inconsistency makes the image of the adjacent slices in coding back seem the bar line, and we are called bar interband striped this phenomenon.This striped has had a strong impact on the subjective quality of decoded picture, and particularly when adopting a plurality of band in the sub-picture, this striped is just more and more, has damaged the subjective quality of image so more.
Summary of the invention
A kind of method of eliminating bar interband striped provided by the invention makes decoded image subjective quality not have this interband striped, has improved spectators' appreciation effect greatly.
In order to achieve the above object, the invention provides a kind of method of eliminating bar interband striped, comprise following steps:
Step 1, in the I frame, only adopt a band, eliminate the bar interband striped of I frame;
The I two field picture adopts intraframe coding method, so in the I frame, each macro block all adopts intraframe coding, and the set of macro block is exactly a band, if there are a plurality of bands, the then reference mutually of the macro block between adjacent ribbons just makes the image texture characteristic of each interband be difficult to identical.And if there is bar interband striped in the I frame, in ensuing each frame, all will there be bar interband striped, and be difficult to eliminate;
Encoder is encoded into a band with entire image in the cataloged procedure of I frame, does not adopt a plurality of bands, but only adopts a band, does not so not only have striped at this I frame, and has effectively reduced the bar interband striped in the ensuing afterwards frame;
The bar interband striped of step 2, elimination B frame and P frame;
P frame and B two field picture adopt inter-frame encoding, have promptly utilized the correlation on the room and time simultaneously; The P two field picture only adopts the forward direction time prediction, can improve compression efficiency and picture quality; The B two field picture adopts two-way time prediction, can improve compression multiple greatly;
The quantization parameter QP value of adjacent two band intersections in step 2.1, calculating one two field picture;
In cataloged procedure, encoder carries out the residual error conversion to image block earlier, according to quantization parameter value conversion coefficient is quantized then, if the QP of adjacent image piece is identical, then the boundary block effect of these adjacent blocks is just very little, if the QP at band boundaries place image block is identical, the striped at band boundaries place just has been eliminated;
Suppose that a two field picture is made up of N band, then the average QP of each band is respectively QP
1, QP
2..., QP
N, then the QP of i and i+1 band intersection is
QP
i,i+1th-slice=(QP
i+QP
i+1)/2 (1)
The QP value of macro block in step 2.2, the restriction band;
At i and i+1 band intersection, limit by following formula apart from the QP value of the capable macro block position of n of this intersection:
QP
i,i+1th-slice-n≤QP
n,i,i+1th-slice≤QP
i,i+1th-slice+n (2)
Wherein, n≤NE;
NE is the BORDER PROCESSING zone, and the NE value is by the size decision of image and N, General N E 〉=2; If the pixel of image is less than 288 o'clock, N≤2, NE=2; If the pixel of image is greater than 288 and less than 480 o'clock, N≤4,2≤NE≤3; If the pixel of image is greater than 480 o'clock, N≤16,2≤NE≤8;
By the processing of step 2.1 and step 2.2, make that the QP value of band intersection macro block is basic identical, such control makes the intersection area image be fused into one, thereby has eliminated bar interband striped.
A kind of method of eliminating bar interband striped provided by the invention has been eliminated bar interband striped fully, and has improved subjective picture quality greatly, and computation complexity is very low simultaneously, not only is fit to the various software application and the real-time working of suitable hardware.
Embodiment
Below specify a kind of better embodiment of the present invention:
The invention provides a kind of method of eliminating bar interband striped, comprise following steps:
Step 1, in the I frame, only adopt a band, eliminate the bar interband striped of I frame;
The I two field picture adopts intraframe coding method, so in the I frame, each macro block all adopts intraframe coding, and the set of macro block is exactly a band, if there are a plurality of bands, the then reference mutually of the macro block between adjacent ribbons just makes the image texture characteristic of each interband be difficult to identical.And if there is bar interband striped in the I frame, in ensuing each frame, all will there be bar interband striped, and be difficult to eliminate;
Encoder is encoded into a band with entire image in the cataloged procedure of I frame, does not adopt a plurality of bands, but only adopts a band, does not so not only have striped at this I frame, and has effectively reduced the bar interband striped in the ensuing afterwards frame;
The bar interband striped of step 2, elimination B frame and P frame;
P frame and B two field picture adopt inter-frame encoding, have promptly utilized the correlation on the room and time simultaneously; The P two field picture only adopts the forward direction time prediction, can improve compression efficiency and picture quality; The B two field picture adopts two-way time prediction, can improve compression multiple greatly;
The quantization parameter QP value of adjacent two band intersections in step 2.1, calculating one two field picture;
In cataloged procedure, encoder carries out the residual error conversion to image block earlier, according to quantization parameter value conversion coefficient is quantized then, if the QP of adjacent image piece is identical, then the boundary block effect of these adjacent blocks is just very little, if the QP at band boundaries place image block is identical, the striped at band boundaries place just has been eliminated;
Suppose that a two field picture is made up of N band, then the average QP of each band is respectively QP
1, QP
2..., QP
N, then the QP of i and i+1 band intersection is
QP
i,i+1th-slice=(QP
i+QP
i+1)/2 (1)
The QP value of macro block in step 2.2, the restriction band;
At i and i+1 band intersection, limit by following formula apart from the QP value of the capable macro block position of n of this intersection:
QP
i,i+1th-slice-n≤QP
n,i,i+1th-slic≤QP
i,i+1th-slice+n (2)
Wherein, n≤NE;
NE is the BORDER PROCESSING zone, and the NE value is by the size decision of image and N, General N E 〉=2; If the pixel of image is less than 288 o'clock, N≤2, NE=2; If the pixel of image is greater than 288 and less than 480 o'clock, N≤4,2≤NE≤3; If the pixel of image is greater than 480 o'clock, N≤16,2≤NE≤8;
By the processing of step 2.1 and step 2.2, make that the QP value of band intersection macro block is basic identical, such control makes the intersection area image be fused into one, thereby has eliminated bar interband striped.
A kind of method of eliminating bar interband striped provided by the invention has been eliminated bar interband striped fully, and has improved subjective picture quality greatly, and computation complexity is very low simultaneously, not only is fit to the various software application and the real-time working of suitable hardware.