The application is by North China University of Tech and the joint study of information institute of Beijing Jiaotong University, and obtain following fund assistance: state natural sciences fund (No.60903066, No.60972085), Beijing's Natural Science Fund In The Light (No.4102049), Ministry of Education beginning teacher fund (No.20090009120006), Beijing institution of higher education talent directly under the jurisdiction of a municipal government teaches by force in-depth plan (PHR201008187).
Summary of the invention
In order to solve the problems of the technologies described above, this patent improves the sample adaptive equalization in HEVC.First, the boundary pixel for each coding unit in maximum coding unit carries out extra boundary compensation.Secondly, new pattern is added: current pixel differs 1 with the pixel value of left side neighbor in edge compensation (EO) type 2 and 3, differ more than 3 with right side neighbor, current pixel differs 2 with the pixel value of left side neighbor, differs more than 6 with right side neighbor.Finally, the difference eliminating current pixel and neighbor in type 2 and 3 is less than or equal to the situation of 1.
According to an aspect, a kind of in HEVC for determining the method for the sample adaptive equalization parameter of decoder end, described method is implemented in the encoder, and described method comprises:
Maximum coding unit (CU) is rebuild from encoded image;
Based on following 4 kinds of sample adaptive equalization types, sample adaptive equalization is carried out to the maximum CU rebuild respectively: pixel strips compensates (Band offset, BO) type, edge compensation (Edge offset, EO) Class1, EO type 2 and EO type 3, to obtain 4 compensation results;
Based on the maximum CU of each in described 4 compensation results and described reconstruction relative to the rate distortion costs value of original image, optimum sample adaptive equalization type is selected from BO type, EO type 0, EO Class1, EO type 2, EO type 3 and EO type 4, wherein, described EO type 0 represents and does not compensate and correspond to the maximum CU of described reconstruction thus;
Determine first offset corresponding with selected optimum sample adaptive equalization type, wherein, the first offset of described EO type 0 correspondence is 0;
Based on selected optimum sample adaptive equalization type determination the second boundary offset,
Selected optimum sample adaptive equalization type, described first offset, described second offset are encoding in the coded message be associated with described maximum CU and transmit;
It is characterized in that:
The pixel value comprising current pixel in described EO type 2 is less than the pixel value of left side neighbor by 1, the situation of larger than the pixel value of right side neighbor more than 3, and the pixel value of current pixel is less than the pixel value of left side neighbor by 2, the situation of larger than the pixel value of right side neighbor more than 6
The pixel value larger than the pixel value of right side neighbor 1 of current pixel is comprised in described EO type 3, the situation of less than the pixel value of left side neighbor more than 3, and the pixel value of current pixel larger than the pixel value of right side neighbor 2, the situation of less than the pixel value of left side neighbor more than 6
In described EO type 2 and described EO type 3, if difference is less than or equal to 1 between the pixel value of the pixel value of current pixel and two neighbors, be then set to described EO type 0,
Describedly determine that the second boundary offset comprises: based on described optimum sample adaptive equalization type, calculate the multiple rate distortion costs values for multiple boundary compensation values of the boundary pixel of each converter unit in described maximum CU, and select a boundary compensation value based on described multiple rate distortion costs value.
Further, the value of syntactic element sao_type_idx and sao_eo_class in described maximum CU is set based on optimum sample adaptive equalization type, wherein, the value 0,1,2 of sao_type_idx represents respectively does not carry out sample adaptive equalization, the compensation of use pixel strips (BO) and edge compensation (EO), and the value 0-3 of sao_eo_class represents EO Class1, EO type 2, EO type 3 and EO type 4.
Further, described EO Class1-4 is usage level line, vertical line, 135 degree of angle diagonal and miter angle diagonal respectively.
Further, in described BO type, 32 pixel strips are divided into by unified for both full-pixel scope, select wherein 4 pixel strips, and determine for selected 4 pixel strips just compensation or negative to compensate, wherein, utilization rate distortion cost determine for selected 4 pixel strips just compensation or negatively to compensate, described optimum sample adaptive equalization type is described BO type, described first offset comprise determine for selected 4 pixel strips just compensation or negative to compensate.
Further, in described EO Class1-4, described first offset comprises based on the penalty function determined offset corresponding respectively with described EO Class1-4.
Further, in described EO Class1-4, described first offset comprises based on the penalty function determined offset corresponding respectively with described EO Class1-4.
According on the other hand, 7, a kind of in HEVC for determining the device of the sample adaptive equalization parameter of decoder end, described device is implemented in the encoder, and described device comprises:
For rebuilding the unit of maximum coding unit (CU) from encoded image;
For carrying out sample adaptive equalization based on following 4 kinds of sample adaptive equalization types to the maximum CU rebuild respectively: pixel strips compensates (Band offset, BO) type, edge compensation (Edge offset, EO) Class1, EO type 2 and EO type 3, to obtain the unit of 4 compensation results;
For the maximum CU based on each in described 4 compensation results and described reconstruction relative to the rate distortion costs value of original image, optimum sample adaptive equalization type is selected from BO type, EO type 0, EO Class1, EO type 2, EO type 3 and EO type 4, wherein, described EO type 0 represents and does not compensate and correspond to the unit of maximum CU of described reconstruction thus;
For determining the unit of first offset corresponding with selected optimum sample adaptive equalization type, wherein, the first offset of described EO type 0 correspondence is 0;
For the unit based on selected optimum sample adaptive equalization type determination the second boundary offset,
For selected optimum sample adaptive equalization type, described first offset, described second offset are encoding to the unit carrying out in the coded message be associated with described maximum CU transmitting;
It is characterized in that:
The pixel value comprising current pixel in described EO type 2 is less than the pixel value of left side neighbor by 1, the situation of larger than the pixel value of right side neighbor more than 3, and the pixel value of current pixel is less than the pixel value of left side neighbor by 2, the situation of larger than the pixel value of right side neighbor more than 6
The pixel value larger than the pixel value of right side neighbor 1 of current pixel is comprised in described EO type 3, the situation of less than the pixel value of left side neighbor more than 3, and the pixel value of current pixel larger than the pixel value of right side neighbor 2, the situation of less than the pixel value of left side neighbor more than 6
In described EO type 2 and described EO type 3, if difference is less than or equal to 1 between the pixel value of the pixel value of current pixel and two neighbors, be then set to described EO type 0,
Described for determining that the unit of the second boundary offset comprises: for based on described optimum sample adaptive equalization type, calculate the multiple rate distortion costs values for multiple boundary compensation values of the boundary pixel of each converter unit in described maximum CU, and select the unit of a boundary compensation value based on described multiple rate distortion costs value.
According to another aspect, the present invention proposes a kind of computer program, it comprises computer-readable medium, and described computer-readable medium comprises program code, and described program code when being executed by a processor, performs method as above.
According to another aspect, the present invention proposes a kind of codec based on HEVC, it is for performing method for video coding as above.
Embodiment
With reference now to accompanying drawing, various scheme is described.In the following description, in order to make an explanation, set forth multiple detail to provide the thorough understanding to one or more scheme.But, obviously, also these schemes can be realized when there is no these details.
As used in this specification, term " assembly ", " module ", " system " etc. are intended to refer to the entity relevant to computer, such as but not limited to, the combination of hardware, firmware, hardware and software, software, or executory software.Such as, assembly can be but be not limited to: the process run on a processor, processor, object, executable (executable), execution thread, program and/or computer.For example, the application program run on the computing device can be assembly with this computing equipment.One or more assembly can be positioned at executive process and/or execution thread, and assembly can be positioned on a computer and/or be distributed on two or more platform computers.In addition, these assemblies can perform from the various computer-readable mediums with various data structures stored thereon.Assembly can communicate by means of local and/or remote process, such as according to the signal with one or more packet, such as, come from by means of another component interaction in signal and local system, distributed system and/or with the data by means of signal and the mutual assembly of other system on the network of such as internet and so on.
Figure 12 shows the general configuration figure of the video encoder that efficient video coding (HEVC) realizes.The encoder architecture of HEVC is roughly the same with H.264 used encoder architecture, mainly further research, improvement are carried out for the algorithm used in modules, especially for high-resolution video sequence, its target improved is that code check reduces to 50% of H.264 standard under same video quality (PSNR).
Because the encoder architecture of HEVC is roughly the same with H.264 used encoder architecture, therefore do not obscure the present invention, the overall architecture in Fig. 9 is not described in the application.
In HEVC, first the video of input is divided into some fritters and is called code tree unit (coding tree units, CTU).It will be understood by those skilled in the art that CTU be equivalent to before the concept of macro block (macroblock) of standard.Coding unit (CU) is foursquare (pixel) unit having a predictive mode (in frame, interframe or skip).Based on CTU and CU predicting unit partitioning scheme as shown in Figure 1.
1.1 sample adaptive equalization brief introductions
Sample adaptive equalization is a fine emerging new technology in HEVC, and this technology adds new blood to HEVC.
Have employed new loop filter in the middle of HEVC, comprise de-blocking filter (Deblocking Filter, DF) and sample adaptive equalization (Sample Adaptive Offset, SAO).After sample adaptive equalization is positioned at de-blocking filter, object reduces the average distortion measure in region, first sample in maximum coding unit can be carried out statistic of classification by selected sorting technique by sample adaptive equalization, thus obtain, for various species obtains an offset, then offset being added in the pixel value of corresponding kind.
Self adaptation sample compensation in the process of coding be positioned at de-blocking filter after a module, a process of an amendment decoded samples value that what this module completed is, modification process is value certain to sample compensation in any case
[1] [2].Sample adaptive equalization filtering acts on certain area, all can be chosen the filter patterns of this unit in each maximum coding unit by the syntax elements of a sao_type_idx, wherein " sao " then represents sample adaptive equalization (samples adaptive offset).Be represent the inapplicable sample adaptive equalization of this maximum coding unit when sao_type_idx is 0, represent accordingly when this value is 1 and 2 and use pixel strips to compensate (BO, band offset) and edge compensation (EO, edge offset)
[3] [4].Sample adaptive equalization flow chart as shown in Figure 1.
In pixel strips compensation model, the offset chosen directly depends on the amplitude of pixel.In this mode, the scope of both full-pixel is divided into 32 parts by what unify, namely divide into 32 pixel strips, as shown in Figure 2, pixel strips pattern can choose wherein continuous print 4 pixel strips, and to the sample value in these four pixel strips just carrying out (to) compensate or negative (to) compensate.Why will choose that continuous print 4 pixel strips compensate is that and the pixel value in a maximum coding unit trends towards concentrating in less pixel strips because band artifacts is usually found in level and smooth region.The operation simultaneously choosing 4 offsets and edge compensation pattern matches, because edge compensation is also have chosen 4 offsets.
In edge compensation, the value of syntax elements sao_eo_class represents edge compensations from 0 to 3 and uses level, vertical, 135 degree of angle diagonal and miter angle diagonal, as shown in Figure 3.Pixel values all in maximum coding unit all can be classified as one in 5 types as shown in table 1 and Fig. 4, and wherein c represents current pixel value, a and b represents two adjacent pixel values respectively.This foundation sorted out is each pixel sample values of having decoded out, so do not need extra signal to go to transmit this categorization results
[5].Rely on the edge index classification in pixel samples, be transferred to the look-up table of decoding end by one, we just can add corresponding offset to corresponding sample value.For kind 1 and 2, offset always just (to), and the offset of kind 3 and 4 always negative (to), a level and smooth effect that what therefore edge filter produced is.
In the diagram, what kind 1,2 was carried out is that forward compensates, and what kind 3,4 was carried out is that negative sense compensates.
Table 1 pixel boundary compensates classification judgement
Kind |
Condition |
1 |
c<a&&c<b |
2 |
(c<a&&c==b)||(c==a&&c<b) |
3 |
(c>a&&c==b)||(c==a&&c>b) |
4 |
c>a&&c>b |
0 |
Non-above situation |
In sum, the pixel strips of sample adaptive equalization compensates and edge compensation all can be respectively the amplitude that each maximum coding unit transmits 4 offsets, and compensates for pixel strips, and the symbol (plus or minus) of compensation needs to transmit
[6].Choosing of offset and corresponding syntax elements value, such as sao_type_idx and sao_eo_class is chosen by the effect of optimization rate distortion.Meanwhile, the sample adaptive equalization parameter of current block also can be obtained by the sample adaptive equalization parameter of the maximum coding unit inheriting the left side and top.On the whole, sample adaptive equalization is a non-linear filtering operation allowing to improve further reconstruction signal, and he not only can strengthen the signal representation of smooth region but also can improve marginal portion.
2. the sample adaptive equalization based on converter unit border is optimized
The size of the converter unit (Transform Unit, TU) in HEVC is from 4x4 to 32x32, and the size of converter unit is not more than 8x8 in h .264.Because use discrete cosine transform (Discrete Cosine Transform, DCT) larger converter unit the quantizing distortion of conversion coefficient can be caused, so can cause more significantly annular artifact and more serious distortion at the edge of converter unit.But sample adaptive equalization realizes is the reduction of the average distortion measure in region, de-blocking filter does not reduce the effect of the distortion factor, and the sample distortion therefore for TU edge is not processed especially.
Optimized algorithm
Found by our research, even the converter unit after have passed through de-blocking filter, the borderline distortion of converter unit is also much larger than converter unit inside.In order to reduce the borderline distortion of converter unit targetedly, we are a kind of new pattern for sample adaptive equalization adds, i.e. converter unit edge pattern.This pattern is intended to the extra compensation in one, converter unit border, thus brings lower converter unit boundary sample distortion and lower bit rate.As shown in Figure 5, dotted portion is wherein the borderline pixel samples of converter unit to maximum coding unit inner transformation unit.
Through statistics, we find that the distortion of converter unit boundary is than converter unit inner large about 20%, in order to further obtain the difference compensated required for converter unit border and converter unit inside, converter unit boundary sample and converter unit internal specimen are passed through sample adaptive equalization by us.Result shows, and for edge compensation, the average distortion measure on converter unit border wants large 0.45, compensates for pixel strips, and the average distortion measure on converter unit border wants large 0.4.
Thus, we have proposed following novel compensation way:
A) when adding up sample, the pixel samples of converter unit inside and the borderline sample of converter unit are added up respectively.
B) calculate optimum compensation model and offset according to original sample adaptive equalization, calculate rate distortion costs.As shown in the types index 0 of table 2, namely extra compensation is not carried out to converter unit border.
C) carry out extra compensation to the border of converter unit, in traversal list 2, strategy converter unit border being carried out to additional compensation of types index 1,2,3, compensates to the inside of converter unit again by converter unit internal compensation value after adding the value in table 2.Calculate the rate distortion costs that this three types brings.
D) four more above-mentioned rate distortion costs values, the compensation type of the type selecting Least-cost current block the most, and index value is transmitted.
Table 2 is for the additional compensation of converter unit
Experimental result shows, this algorithm is compared former algorithm and BD-rate is reduced-0.13, and the performance of sample adaptive compensation algorithm achieves the lifting of 26%, and this algorithm has certain effect for the optimization of sample adaptive equalization as can be seen here.
3. the compensation model optimization of sample adaptive equalization
In the process of research, we find, sample adaptive equalization is very harsh for the requirement of sample statistics, there is a large amount of regular, compensating to corresponding of needing the pixel compensated not have.As shown in Figure 6, in second and third class sample adaptive equalization, we can see only have when current pixel must identical with the pixel value of adjacent pixel time just can judge whether current pixel belongs to second and third class sample adaptive equalization.The problem that such compensation policy brings is, exist as shown in Figure 7 a large amount of, namely pixel gradient but can not be judged as the pixel of carrying out sample adaptive equalization very greatly, but do not compensate, in Fig. 7, pixel c and pixel a or b only differ very little, gradient is but very large, this situation meets the design original intention that sample adaptive equalization makes marginal portion more level and smooth completely, and the pixel of pixel and Fig. 6 type is poor only at 1,2 pixel value in Fig. 7, therefore we are based on this idea, propose this algorithm.
Meanwhile, we find also to there is a kind of irrational situation in sample adaptive equalization.This situation is: current pixel is judged as second or the third type, even if but current pixel value and adjacent pixel only differ one or little pixel value, namely pixel gradient is very little, and as shown in Figure 8, this position also can compensate according to second or the third type.This is obviously irrational, because current pixel is very level and smooth, does not have space level and smooth further, the original intention that the edge having run counter to sample adaptive equalization compensates.Therefore, one of our content of also this point being studied as us.
Therefore, we propose a, b, c, d tetra-kinds of patterns as shown in Figure 9 to join meeting in sample adaptive equalization, and by a lot needing supplementary, pixel samples that is that do not compensate is brought in sample adaptive equalization, and e, f two kinds of patterns of removing are advantageously in obtaining offset more accurately.
Specifically, the situation as shown in Fig. 9 (a) is that current pixel c differs 1 with the pixel value of neighbor a, and differs more than 3 with the pixel value of the neighbor b of another side; Situation shown in Fig. 9 (b) is that current pixel c differs 2 with the pixel value of neighbor a, and differs more than 6 with the pixel value of the pixel b of another side; Situation as shown in Fig. 9 (c) is that current pixel c differs 1 with the pixel value of neighbor b, and differs more than 3 with the pixel value of the neighbor a of another side; Situation shown in Fig. 9 (d) is that current pixel c differs 2 with the pixel value of neighbor b, and differs more than 6 with the pixel value of the pixel a of another side.
We bring the situation of Fig. 9 (a), (b) into type 2, the situation of Fig. 9 (c), (d) is brought in type 3, and the situation of Fig. 9 (e), (f) is eliminated the 2nd, 3 classes compensation of sample adaptive equalization by us afterwards.
Carry out adding up and rate-distortion optimization according to sample adaptive equalization standard step subsequently, after selecting the compensation model of current maximum coding unit optimum, sample adaptive equalization is carried out to current maximum coding unit.
Figure 11 (a) show according to an embodiment of the invention a kind of in HEVC for determining the flow chart of the method for the sample adaptive equalization parameter of decoder end, the method is implemented in the encoder.
Known in conjunction with the schematic diagram shown in Figure 10:
In step 1101, in the encoder, from encoded image, maximum coding unit (CU) is rebuild.
In step 1102, based on following 4 kinds of sample adaptive equalization types, sample adaptive equalization is carried out to the maximum CU rebuild respectively: pixel strips compensates (Band offset, BO) type, edge compensation (Edge offset, EO) Class1, EO type 2 and EO type 3, to obtain 4 compensation results.
In step 1103, based on the maximum CU of each in described 4 compensation results and described reconstruction relative to the rate distortion costs value of original image, optimum sample adaptive equalization type is selected from BO type, EO type 0, EO Class1, EO type 2, EO type 3 and EO type 4, wherein, described EO type 0 represents and does not compensate and correspond to the maximum CU of described reconstruction thus.
In step 1104, determine first offset corresponding with selected optimum sample adaptive equalization type, wherein, the first offset of described EO type 0 correspondence is 0.
In step 1105, based on selected optimum sample adaptive equalization type determination the second boundary offset.
In a step 1106, selected optimum sample adaptive equalization type, described first offset, described second offset are encoding in the coded message be associated with described maximum CU and transmit.
In one embodiment of the invention, the pixel value comprising current pixel in EO type 2 is less than the pixel value of left side neighbor by 1, the situation of larger than the pixel value of right side neighbor more than 3, and the pixel value of current pixel is less than the pixel value of left side neighbor by 2, the situation of larger than the pixel value of right side neighbor more than 6.
In one embodiment of the invention, the pixel value larger than the pixel value of right side neighbor 1 of current pixel is comprised in EO type 3, the situation of less than the pixel value of left side neighbor more than 3, and the pixel value of current pixel larger than the pixel value of right side neighbor 2, the situation of less than the pixel value of left side neighbor more than 6.
In one embodiment of the invention, in described EO type 2 and described EO type 3, if difference is less than or equal to 1 between the pixel value of the pixel value of current pixel and two neighbors, be then set to described EO type 0.
In step 1105, determine that the second boundary offset comprises further: based on described optimum sample adaptive equalization type, calculate the multiple rate distortion costs values for multiple boundary compensation values of the boundary pixel of each converter unit in described maximum CU, and select a boundary compensation value based on described multiple rate distortion costs value.
In a preferred embodiment of the invention, the value of syntactic element sao_type_idx and sao_eo_class in described maximum CU is set based on optimum sample adaptive equalization type, wherein, the value 0,1,2 of sao_type_idx represents respectively does not carry out sample adaptive equalization, the compensation of use pixel strips (BO) and edge compensation (EO), and the value 0-3 of sao_eo_class represents EO Class1, EO type 2, EO type 3 and EO type 4.
In a preferred embodiment of the invention, described EO Class1-4 usage level line, vertical line, 135 degree of angle diagonal and miter angle diagonal respectively.
In a preferred embodiment of the invention, in described BO type, 32 pixel strips are divided into by unified for both full-pixel scope, select wherein 4 pixel strips, and determine the just compensation for selected 4 pixel strips or negative compensation, wherein, utilization rate distortion cost determine for selected 4 pixel strips just compensation or negative to compensate, described optimum sample adaptive equalization type is described BO type, described first offset comprise determine for selected 4 pixel strips just compensation or negative to compensate.
In a preferred embodiment of the invention, in described EO Class1-4, described first offset comprises based on the penalty function determined offset corresponding respectively with described EO Class1-4.
In a preferred embodiment of the invention, in described EO Class1-4, described first offset comprises based on the penalty function determined offset corresponding respectively with described EO Class1-4.
Figure 11 (b) show according to an embodiment of the invention a kind of in HEVC for determining the block diagram of the device of the sample adaptive equalization parameter of decoder end, this device is implemented in the encoder.Unit in Figure 11 (b) corresponds respectively to the correlation method step in Figure 11 (a), does not therefore repeat them here.
The method disclosed in the present can realize with software, hardware, firmware etc.
When implemented in hardware, video encoder by general processor, digital signal processor (DSP), application-specific integrated circuit (ASIC) (ASIC), field programmable gate array (FPGA) or other programmable logic device, discrete gate or transistor logic, discrete hardware components or can be designed to its combination in any performing function described herein, realizes or performs.General processor can be microprocessor, but alternatively, this processor also can be the processor of any routine, controller, microcontroller or state machine.Processor also can be implemented as the combination of computing equipment, such as, and the combination of the combination of DSP and microprocessor, the combination of multi-microprocessor, one or more microprocessor and DSP kernel or other this kind of structure any.In addition, at least one processor can comprise and can operate to perform above-mentioned one or more step and/or one or more modules of operation.
When realizing video encoder with hardware circuits such as ASIC, FPGA, it can comprise the various circuit blocks being configured to perform various function.Those skilled in the art can carry out these circuit of Design and implementation in every way according to the various constraintss applied over the whole system, realize various function disclosed in this invention.
Although aforementioned open file discusses exemplary arrangement and/or embodiment, it should be noted that when not deviating from the scope of the scheme of the description defined by claims and/or embodiment, many changes and amendment can be made at this.And, although describe in the singular or the described scheme that requires and/or the key element of embodiment, also it is contemplated that the situation of plural number, be limited to odd number unless expressly stated.In addition, any scheme and/or all or part of of embodiment can with other scheme and/or all or part of of embodiment be combined, unless indicated different arbitrarily.