Background technology
Rapid popularization along with Development of Multimedia Technology and multimedia application, video image compression standard and technology have obtained paying close attention to widely, present video encoding standard, H.26x and MPEG-x (MPEG, Motionpicture experts group, Motion Picture Experts Group) and the video standard in AVS (Audio video Standard, the audio/video encoding standard) standard of formulating by Chinese audio/video encoding/decoding technical standard working group all be based on the hybrid encoding frame.This hybrid encoding frame has following characteristics:
1, utilize predictive coding to remove the time domain redundancy;
2, utilize transition coding to remove the spatial domain redundancy;
3, utilize entropy coding to remove the statistical redundancy degree.
Wherein predictive coding is the important step in the video coding, and predictive coding mainly utilizes the motion compensated prediction technology to realize reducing temporal redundancy.Because the continuity of object of which movement in the video motion prediction, adopts the image element interpolation technology to improve the accuracy of motion prediction compensation usually, interpolation precision can be 1/2,1/4,1/8 picture element interpolation etc.The image element interpolation technology has been improved the order of accuarcy of motion prediction greatly, has further reduced the energy of the residual image between current encoded image and reference picture.
Residual image is again through removing the spatial redundancies of video image after orthogonal transform and the quantification, wherein, quantification is an irreversible process, purpose is to remove the insensitive information of human eye, in video coding system, quantizing factor QP (Quantization Parameter, quantizing factor) value is to the code efficiency of image and the picture quality important influence after the reconstruction.Less QP value can better keep original image information, but the code check of encoder output is also bigger; And bigger QP value can reduce the bit rate output of encoder, but reconstructed image quality also can descend to some extent.The scope of QP value is 0~63, and the size of QP value has directly influenced the size of encoder bit rate output.
In actual applications, in the AVS video encoding standard, two kinds of situations of the general existence of QP value:
1, fixing QP value
Fixedly QP value standard is divided into two kinds: a kind of is that all macro blocks in the whole two field picture are quantized according to identical quantizing factor QP, QP concrete when coding is set according to the specific requirement of current application by the user, in this case, corresponding marker bit (as fixed_picture_qp) is set in the image head in the encoder output code flow and writes current QP value, identification and use when handling for decoding end; Another kind is that macro blocks all in each band in the two field picture is quantized according to identical quantizing factor QP, QP concrete when coding is still set according to the specific requirement of current application by the user, in this case, corresponding marker bit (as fixed_slice_qp) is set in the slice header of encoder in output code flow and writes current QP value, identification and use when handling for decoding end.
2, self adaptation QP value
In the self adaptation QP value standard, the QP value of each macro block of one two field picture changes, reach best quantification effect according to selecting suitable QP value when the picture material of pre-treatment, this moment, coding side write the QP value information in each macro block head, identification and use when handling for decoding end.
In the AVS video encoding standard, each levels of precision adopts fixing interpolation filter to compensate prediction, the motion compensated prediction of 1/4 pixel precision for example, 1/4 picture element interpolation process be divided into two the step carry out, at first be that reference picture is carried out 1/2 pixel precision interpolation, by interpolation filter F1 original image is carried out interpolation in the horizontal and vertical directions, image after the interpolation becomes 4 times of original image, carry out 1/4 picture element interpolation by interpolation filter F2 and F3 then, obtain the 1/4 interpolation reference picture of size for 16 times of original images.As shown in Figure 1, in existing AVS brightness interpolating standard, the position of integral sample, 1/2nd samples and 1/4th samples concerns schematic diagram, the position of integer pixel point in the capitalization A-L presentation video, lowercase aa, ff, hh, ee, b, bb, gg, h, j, m, cc, s, dd represent the position of 1/2nd pixels, and lowercase a, c, d, e, f, g, i, k, n, p, q, r represent the position of 1/4th pixels.Wherein, the predicted value of two/the same this position is by 4 tap filter F
1(1,5,5 ,-1)/8 calculate, 1/2 picture element interpolation as:
b=(-C+5D+5E-F)/8;
h=(-A+5D+5H-K)/8;
The predicted value of four/the same this position is by 4 tap filter F
2(1,7,7,1)/16 and 2 tap filter F
3(1,1)/2 calculate, 1/4 picture element interpolation as:
d=(ff+7D+7h+H)/16;
e=(D+j)/2;
g=(E+j)/2;
p=(H+j)/2;
r=(I+j)/2。
H.264 1/4 picture element interpolation process and the AVS in the standard is similar, and its 1/2 picture element interpolation adopts one 6 tap filter F
1(1 ,-5,20,20 ,-5,1)/32,1/4 pixel interpolation filtering device adopts 2 tap filter F
2(1,1)/2.
No matter be AVS or standard H.264, each levels of precision interpolation all adopts fixing interpolation filter in its interpolation process, do not select different interpolation filters, can not effectively improve the efficient and the quality of video coding according to different video contents and encoder bit rate.
Except the interpolation technique that adopts in the AVS video encoding standard, also there is the researcher to propose to carry out the method for motion compensated interpolation according to the picture material self adaptation, process is as follows:
1, utilize initial interpolation filter to carry out the initial motion vector of interpolation calculation;
2, on the basis of initial motion vectors, carry out motion compensated prediction, calculate predicated error, adjust the coefficient of interpolation filter, make the predicated error minimum, this step may need to repeat repeatedly, just can obtain the coefficient of the best interpolation filter of minimum predicated error correspondence;
3, using a best interpolation filter coefficient that two steps calculated to carry out interpolation and follow-up coding, simultaneously with 2) the best interpolation filter coefficient of step gained is encoded in the output code flow.
The method of adjustment computation complexity height of this adaptive interpolation filters can not satisfy the real-time requirement of coding.But also need be in code stream frame level or macro-block level add extra information and be correctly decoded guaranteeing, these information also can reduce code efficiency to a certain extent.
Summary of the invention
The invention provides a kind of self-adaptive interpolation process method and coding/decoding module, when utilizing fixedly the interpolation filter interpolation in the prior art to solve, the problem that the predicted picture precision is relatively poor.
For solving the problems of the technologies described above, the invention provides following technical scheme:
A kind of self adaptation image element interpolation processing method comprises the steps:
A, based on different image element interpolation bank of filters to the performance comparison between the image element interpolation image that set to quantize the factor graph picture and carry out respectively, obtain the matching relationship between each quantizing factor and the optimum image element interpolation bank of filters;
B, coding side are selected with the corresponding best interpolation bank of filters of quantizing factor information of reference picture content described reference picture content to be carried out image element interpolation and are handled in cataloged procedure from described matching relationship.
Further, described method also comprises simultaneously: decoding end is selected with the corresponding best interpolation bank of filters of quantizing factor information of reference picture content described reference picture content to be carried out image element interpolation and is handled in decode procedure from described matching relationship.
According to different coding modes, described method further comprises:
When coding side was set at frame level fixed quantisation factor coding mode by the user, described picture material was meant a two field picture, and described quantizing factor information is this fixed quantisation factor.And,
In the image head of each image that coding side comprises in sending to the video code flow of decoding end, frame level fixed quantisation factor coding mode flag bit is set, and in each image build of each image, carries this fixed quantisation factor;
After decoding end receives described video code flow, determine the coding mode frame level fixed quantisation factor, from the image build of reference picture, read this fixed quantisation factor then according to the flag bit of correspondence setting.
When coding side was set at slice level fixed quantisation factor coding mode by the user, described picture material was meant a band in the two field picture, and described quantizing factor information is this fixed quantisation factor.And,
In the slice header of each band that coding side comprises in sending to the video code flow of decoding end, slice level fixed quantisation factor coding mode flag bit is set, and in each image build of each band, carries this fixed quantisation factor;
After decoding end receives described video code flow, determine that according to the flag bit of correspondence setting coding mode is the slice level fixed quantisation factor, from the image build of reference band, read this fixed quantisation factor then.
When the coding side user is set at frame level/slice level adaptive quantizing factor coding mode, described picture material is meant one two field picture/band, and described quantizing factor information is each image block quantizing factor and the sum of products after the weighted value of corresponding setting multiplies each other respectively in reference picture/band.
Coding side is provided with frame level/slice level adaptive quantizing factor coding mode flag bit or other all coding mode flag bits of default setting in sending to the video code flow of decoding end, and in each image build of each image/band, correspondence is carried the quantizing factor of each image block.
And during frame level/slice level adaptive quantizing factor coding mode, decoding end is determined the optimal filter group by one of following three kinds of modes:
Decoding end determines that according to the flag bit of correspondence setting or the default setting state of other all mode flags the pattern of described video code flow is frame level/slice level adaptive quantizing factor, reads each image block corresponding quantitative factor then from each image build of reference picture/band; Perhaps
Decoding end writes the described sum of products correspondence of reference picture content by in the slice header of the image head of each image of reference or band simultaneously; Decoding end is directly determined the best interpolation bank of filters of the reference picture/band correspondence of this image/band according to the described sum of products; Perhaps
Decoding end writes the group identification information correspondence of the best interpolation bank of filters of reference picture content by in the slice header of the image head of each image of reference or band simultaneously; Decoding end is directly determined the best interpolation bank of filters of the reference picture/band correspondence of this image/band according to described group identification information.
The present invention also provides a kind of coding/decoding module, comprising:
Each quantizing factor that sub module stored, storage obtain the performance comparison between the image element interpolation image that set to quantize the factor graph picture and carry out respectively based on different image element interpolation bank of filters and the matching relationship between the optimum image element interpolation bank of filters;
The interpolation processing submodule, connect described sub module stored, be used for from the quantizing factor information corresponding best interpolation bank of filters of described matching relationship selection, and utilize this best interpolation bank of filters that described reference picture content is carried out image element interpolation and handle with the reference picture content;
The encoding and decoding submodule connects described interpolation processing submodule, is used for reading quantizing factor information from each image build of reference picture content, and reference picture coded data and quantizing factor information are exported to described interpolation processing submodule; Reference picture content encoding and decoding present image content after perhaps handling according to image element interpolation.
Beneficial effect of the present invention is as follows:
The present invention utilizes the characteristics of QP value decision code check, select different interpolation filter groups according to the QP value, improved the predicted picture precision after the interpolation, reduced the energy of residual image, thereby the data in the video code flow have been reduced, in decoding end, owing to improved the predicted picture precision after the interpolation, so promoted decoded picture quality.
Embodiment
In video coding process, the setting of quantizing factor has directly influenced the size of encoder bit rate, less quantizing factor can better keep the information of image, reconstructed image is meticulousr, thereby the code stream of encoder output is bigger, and bigger quantizing factor has been given up more images information, and reconstructed image is comparatively coarse, thereby the code stream of output is less.
When high code check, owing to selected less quantizing factor, the image after therefore rebuilding is meticulousr; When hanging down code check, owing to selected bigger quantizing factor, the image after therefore rebuilding is comparatively coarse, and the fine degree of reconstructed image influences the interpolation performance of different filters.
The present invention is directed to that need to have proposed a kind of quantizing factor QP value of the video image according to present encoding with reference to other image (the present invention does not limit handling with reference to self image encoded) big or small, be that encoder bit rate is selected image element interpolation filter in the motion compensated prediction, with the efficient and the quality of further raising video coding.
Concrete technical conceive comprises following two steps as shown in Figure 2:
S1, based on different image element interpolation bank of filters to the performance comparison between the image element interpolation image that set to quantize the factor graph picture and carry out respectively, obtain the matching relationship between each quantizing factor and the optimum image element interpolation bank of filters, and described matching relationship is saved in coding side and decoding end respectively;
S2, coding side are in cataloged procedure, according to the quantizing factor integrated value of each image block (for example macro block) in the reference picture content of current encoded image, from described matching relationship, select one group of corresponding best interpolation filter that the reference picture content is carried out image element interpolation and handle;
S3, decoding end are when decoding, according to the quantizing factor integrated value of each image block (for example macro block) in the reference picture content of current decoded picture, from described matching relationship, select one group of corresponding best interpolation filter that the reference picture content is carried out image element interpolation and handle equally.
Among the step S1, the image that reference picture is carried out obtaining behind the image element interpolation is the motion compensated prediction image, the performance of this image is meant the combination property of picture quality and amount of coded data, because in the process of image element interpolation, need carry out the interpolation of each minute pixel precision to image, the interpolation filter of therefore carrying out each minute pixel is actually one group of interpolation filter.
The preparation method of best interpolation bank of filters is consulted shown in Figure 3, to obtain quantizing factor QP
iCorresponding optimal filter group is an example, an at first given reference picture, and generally speaking, the quantizing factor of each image block of this reference picture (for example macro block) equates, all is QP
i:
S101, divide pixel precision to select several candidate commonly used at each;
For example: carrying out 1/4 picture element interpolation, from F commonly used
1In the filter, select F
1 1(1,5,5 ,-1)/8 and F
1 2(1,9,9 ,-1)/16 are candidate; From F commonly used
2In the filter, select F
2 1(1,7,7,1)/16 and F
2 2(1,1)/2 are candidate;
S102, provide all candidate groups that candidate is combined to form mutually;
Comprise a F in each candidate group
1Filter and a F
2Filter, example is as shown in table 1:
Table 1.
Group | 1/2 pixel interpolation filtering device | 1/4 pixel interpolation filtering device |
First group | F
1 1(-1,9,9,-1)/16
| F
2 1(1,7,7,1)/16
|
Second group | F
1 2(-1,5,5,-1)/8
| F
2 1(1,7,7,1)/16
|
The 3rd group | F
1 2(-1,9,9,-1)/16
| F
2 2(1,1)/2
|
S103, utilize each group bank of filters that reference picture is simulated interpolation respectively, produce the skimulated motion compensation prediction image comprise image element interpolation;
The combination property of S104, each skimulated motion compensation prediction image of comparative analysis, with the bank of filters of the motion compensated prediction image correspondence of combination property optimum wherein as QP
iCorresponding optimal filter group.
Repeat above-mentioned steps, can obtain respectively value in 0~63 scope, each QP
iCorresponding optimal filter group.
Put QP then in order
iAnd the matching relationship between the optimal filter group obtains being similar to the matching relationship table of table 2:
Table 2.
Quantizing factor span (comprising end value) | The optimal filter group |
0~30 | First group |
30~50 | Second group |
50~63 | The 3rd group |
Table 2 only is an example, and the concrete line number that this table comprises determines according to the analog quantization result of reality, perhaps in the acceptable image performance range, each span of quantizing factor is merged, to reduce the control complexity.Same during for 1/4 picture element interpolation the F3 filter or when need carry out 1/8 pixel precision interpolation required filter and can make up according to above-mentioned principle with bank of filters that 1/2 and 1/4 pixel precision interpolation filter is formed and to choose.
The acquisition methods of above-mentioned best interpolation bank of filters is a kind of simulation example only, and is not intended to limit the scope of the invention.
Store table 1 and table 2 into coding side and decoding end respectively, the processing procedure of coding side and decoding end is:
Coding side is to the reference picture (reference picture is the immediate image of content) of current encoded image content when carrying out image element interpolation, obtain the up-sampling picture material after according to the best interpolation bank of filters of the concrete quantizing factor Information Selection correspondence of reference picture content reference picture being handled, after then the residual image between up-sampling picture material and the current encoded image content being encoded, coded data write in the video code flow send;
After decoding end is received video code flow, equally according to the concrete quantizing factor of reference picture (identification information of reference picture is carried in the image head) content of current decoded picture content, obtain the up-sampling picture material after selecting corresponding best interpolation bank of filters that reference picture is handled, restore current decoded picture according to up-sampling image and residual image then.
Code encoding/decoding mode according to user's setting, the reference picture content of current encoded image content may be a whole two field picture, it also may be certain band in the two field picture, in the above-mentioned processing procedure, if based on the fixedly QP coded system of frame level or slice level, then the span at the fixedly QP place of directly using according to reference picture is selected corresponding optimal filter group; If self adaptation QP coded system, can calculate the comprehensive QP value of reference picture content according to following formula 1:
QP=f(QP
i) i=0,1,...,N (1)
QP wherein
iIt is the quantizing factor of each image block (for example macro block), QP is the comprehensive QP factor of entire frame or band, N is the image block number (for example macroblock number) in entire frame or the band, f (x) is the method that is used to calculate the comprehensive quantification factor, can adopt following weighted accumulation method to calculate QP as f (x):
W wherein
iBe the weighted value that each image block (for example macro block) is distributed, after calculating QP, select for use corresponding optimal filter group to carry out interpolation according to the segmentation limit at QP place.
The weighted value of each the image block quantizing factor optimal filter group corresponding with this quantizing factor to image element interpolation after the improvement amount of image property be directly proportional.For example: the selected optimal filter group of different Q P value scope is A: B: C to coding efficiency improvement ratio, as draw first group, second group, the 3rd group raising performance ratio by test under table 2 situation is 2: 4: 1, then when calculating comprehensive QP with factor Q P, it is to be 2/7 for QP weight in 0~30 scope that weight setting closes, weight is that weight is 1/7 in 4/7,50~63 scopes in 30~50 scopes.
How under the different encoding and decoding mode of operations that the user sets, to implement technical scheme of the present invention below in conjunction with description of drawings.
The handling process of decoding end is divided into following three kinds of situations:
One, the fixing QP value of frame level
As shown in Figure 4,, the user is frame level fixedly during the QP value when being provided with the coding side mode of operation, the handling process of coding side during with reference to other image encoding one frame present image, and this flow process is actually a kind of specific implementation flow process of step S2 shown in Figure 2, comprises the steps:
S201, determine and the immediate reference picture of content of present image;
S202, select the best interpolation bank of filters of the current QP value correspondence that the user sets according to table 1 and table 2;
S203, utilize the best interpolation bank of filters that the reference picture of this image is carried out interpolation, obtain the up-sampling image behind the motion compensated prediction;
S204, determine the residual image between this up-sampling image and the present image;
Each image block (for example macro block) on S205, the current QP value of setting according to the user are encoded respectively in this residual image;
Coding side is in cataloged procedure, frame level fixedly QP value flag bit (as fixed_picture_qp) and reference picture identification information are set in the image head of each image, and current QP value is write in the image build (for example macro block head) of each image block (for example macro block), synchronous coded data with residual image writes and sends to decoding end in the video code flow.
Two, the fixing QP value of slice level
The quantizing factor of different bands has identical quantizing factor also according to the band content-adaptive in the same band under this pattern, and different band quantizing factors can be different.
When the user is provided with the coding side mode of operation is that slice level is fixedly during the QP value, when coding side is encoded current band with reference to other band, cataloged procedure is consulted shown in Figure 4, determine with the content of current band immediate earlier with reference to band, and select the best interpolation bank of filters of the current QP value correspondence that the user sets according to table 1 and table 2, utilize the best interpolation bank of filters that the reference bar of this band is brought into row interpolation, obtain up-sampling band behind the motion compensated prediction and the residual error histogram picture between this up-sampling band and the current band, each image block (for example macro block) on the current QP value of setting according to the user is encoded respectively then in this residual error histogram picture;
Coding side is in cataloged procedure, slice level fixedly QP value coding mode flag bit (as fixed_slice_qp) and reference bar tape identification information are set in the slice header of each band, and current QP value is write in the image build (for example macro block head) of each image block (for example macro block), synchronous coded data with residual error histogram picture writes and sends to decoding end in the video code flow, under this pattern, fixedly QP value flag bit (as fixed_picture_qp) of frame level is not set in each image head in the current code stream.
Three, adaptive frame level (or slice level) QP value
When the user is provided with the coding side mode of operation and is adaptive frame level (or slice level) QP value, coding side utilizes formula 1 or 2 to calculate the QP of reference picture (or band), select corresponding best interpolation bank of filters according to the span of QP then, reference picture (or band) is carried out interpolation;
At this moment, fixedly QP value flag bit (as fixed_picture_qp) of frame level is not set in each image head in the current code stream, fixedly QP value coding mode flag bit (as fixed_slice_qp) of slice level is not set in the slice header yet.
The handling process of decoding end as shown in Figure 5, this flow process is actually a kind of specific implementation flow process of step S3 shown in Figure 2, comprises the steps:
S301, according to the frame level in each image head in the current code stream fixedly QP value flag bit (as fixed_picture_qp) judge that the present encoding pattern is whether for the fixing QP binarization mode of frame level, if then continue; Otherwise change step S306 over to;
S302, read the QP value (reference picture is determined according to the identification information in the image head) of carrying in the image build (for example macro block head) of any one image block (for example macro block) in the reference picture of current decoded picture in the video code flow;
S303, determine the best interpolation bank of filters of this QP value correspondence according to table 1 and table 2;
S304, utilize the best interpolation bank of filters that the reference picture of this image is carried out interpolation, obtain the up-sampling image behind the motion compensated prediction;
S305, decoded residual view data and according to up-sampling image restoration continues to handle next two field picture after going out present image;
S306, decoding end again according to the slice level in each slice header in the current code stream fixedly QP value flag bit (as fixed_slice_qp) judge whether the present encoding pattern is fixedly QP binarization mode of slice level, if then continue; Otherwise execution in step S311;
S307, read the QP value (determining according to the identification information in the slice header) of carrying in the image build (for example macro block head) of any one image block (for example macro block) in the reference band of current decoding band in the video code flow with reference to band;
S308, determine the best interpolation bank of filters of this QP value correspondence according to table 1 and table 2;
S309, utilize the best interpolation bank of filters that the reference bar of this band is brought into row interpolation, obtain the up-sampling histogram picture behind the motion compensated prediction;
S310, decoded residual band view data and go out current histogram picture according to the image restoration of up-sampling band after continue to handle next band;
S311, calculate the comprehensive quantification factor Q P of the reference picture (or band) of present images (or band) according to formula 1 and 2;
S312, determine the best interpolation bank of filters of this QP value correspondence according to table 1 and table 2;
S313, utilize the best interpolation bank of filters that the reference picture (or band) of this band is carried out interpolation, obtain the up-sampling image (or histogram picture) behind the motion compensated prediction;
S314, decoded residual image (or histogram picture) data are also restored present image (or band) back according to up-sampling image (or histogram picture) and are continued to handle next band.
Coding side can write by the specific bit position in the reference picture image head according to the QP value that reference picture calculates is corresponding, decoding end directly reads the result of calculation of coding side and selects corresponding best interpolation bank of filters according to table 1 and table 2 from the specific bit position, slice level adaptive coding mode class seemingly;
Coding side can also write the group identification information correspondence of the best interpolation bank of filters selected by the specific bit position in the reference picture image head, decoding end is determined corresponding best interpolation bank of filters according to table 1 directly read group information from the specific bit position after, and slice level adaptive coding mode class seemingly.
As shown in Figure 6, realize the coding/decoding module of said method, comprising:
Each quantizing factor that sub module stored 100, storage obtain the performance comparison between the image element interpolation image that set to quantize the factor graph picture and carry out respectively based on different image element interpolation bank of filters and the matching relationship between the optimum image element interpolation bank of filters;
Interpolation processing submodule 200, connect described sub module stored 100, be used for from the quantizing factor information corresponding best interpolation bank of filters of described matching relationship selection, and utilize this best interpolation bank of filters that described reference picture content is carried out image element interpolation and handle with the reference picture content.
Encoding and decoding submodule 300 connects described interpolation processing submodule 200, be used for reading quantizing factor information from each image build of reference picture content, and reference picture coded data and quantizing factor information is exported to described interpolation processing submodule 200; Reference picture content encoding and decoding present image content after perhaps handling according to image element interpolation.
Technical solution of the present invention is utilized the characteristics of QP value decision code check, select different interpolation filter groups according to the QP value, improved the predicted picture precision after the interpolation, reduced the energy of coding side residual image, thereby the data in the video code flow have been reduced, in decoding end, owing to improved the predicted picture precision after the interpolation, so the corresponding decoding back picture quality that improved.
Obviously, those skilled in the art can carry out various changes and modification to the present invention and not break away from the spirit and scope of the present invention.Like this, if of the present invention these are revised and modification belongs within the scope of claim of the present invention and equivalent technologies thereof, then the present invention also is intended to comprise these changes and modification interior.