The present embodiments generally relate to deblocking filtering and in particular to controlling strong deblocking filtering over a block boundary between adjacent blocks of pixels in a picture.
Deblocking filters are used in video coding standards in order to combat blocking artifacts. The blocking artifacts arise because the original video is split into blocks which are processed relatively independently. The blocking artifacts can arise due to different intra prediction of blocks, quantization effects and motion compensation. Two particular variants of deblocking are described below.
These descriptions assume a vertical block boundary. The process is also done in the same way for horizontal block boundaries.
In state of the art video coding such as H.264 there is an adaptive de-blocking filter/loop filter after prediction and residual reconstruction, but before storage of the reconstruction for later reference when encoding or decoding subsequent frames. The deblocking filtering consists of several steps such as filter decisions, filtering operations, a clipping function and changes of pixel values. The decision to filter the border or not is made based on evaluating several conditions. Filter decisions depend on macro block (MB) type, motion vector (MV) difference between neighboring blocks, whether neighboring blocks have coded residuals and on the local structure of the current and/or neighboring blocks.
The amount of filtering for a pixel depends on the position of that pixel relative to the block boundary and on the quantization parameter (QP) value used for residual coding. Here below a to h represent pixel values across a vertical block boundary.
The filter decision is based on comparing three pixel differences with three thresholds. The thresholds are adapted to the QP.
If the following conditions are fulfilled the filtering is done:
abs(d-e)<thr1,
abs(c-d)<thr2, and
abs(e-f)<thr2
where thr1 and thr2 are functions of QP.
There are two filtering modes in H.264. In the first filtering mode (normal filtering), filtering can be described with a delta value that the filtering changes the current pixel value with. The filtering for the pixel closest to the block boundary is:
d′=d+delta and e′=e−delta
where delta has been clipped off to a threshold±thr3 to a value that is constrained by the QP. d′ is here the pixel value at position d after filtering and e′ is the pixel value after filtering at position e. More filtering is allowed for high QP than for low QP.
Clipping can be described as:
delta_clipped=max(−thr3,min(thr3,delta))
where thr3 is controlling the filter strength. A larger value of thr3 means that the filtering is stronger, which in turns means that a stronger low-pass filtering effect will happen.
The filter strength can be increased if any of the following two conditions also holds:
abs(b-d)<thr2 and abs(e-g)<thr2
The filter strength is adapted by clipping the delta less, e.g. to allow for more variation.
The second filtering mode (strong filtering) is applied for intra macroblock boundaries only, when the following condition is fulfilled:
abs(d-e)<thr1/4.
The thresholds thr1, thr2 and thr3 are derived from table lookup using QP as index. Each slice can contain modifications of thr2 and thr3 using slice_beta_offset_div2 and thr1 using slice_alpha_c0_offset_div2. The slice parameters 2×slice_beta_offset_div2 and 2×slice_alpha_c0_offset_div2 are added to the current QP index before table lookup of thr2/thr3 and thr1 respectively.
Here below p0 to p3 and q0 to q3 represent pixel values across a vertical block boundary.
In the draft HEVC specification, the deblocking filter works differently than H.264. The filtering is performed if at least one of the blocks on the side of the border is intra, or has non-zero coefficients, or the difference between the motion vector components of the blocks is greater than or equal to one integer pixel. For example, if one is filtering the border between the blocks A and B below, then the following condition should satisfy for the block boundary to be filtered:
dp0=|p20−2×p10+p00|
dp3=|p23−2×p13+p03|
dq0=|q20−2×q10+q00|
dq3=|q23−2×q13+q03|
dpq0=dp0+dq0
dpq3=dp3+dq3
dp=dp0+dp3
dq=dq0+dq3 (1)
The variable d is derived as follows:
d=dpq0+dpq3(2)
The deblocking filtering is performed on the block boundary for lines i=0 . . . 3 if the following condition holds:
d<β (3)
where β depends on QP. In the draft HEVC specification, there is a table, see Table 1 below, for looking up the value of β using QP as the table index. β increases with increasing QP.
If the condition in equation (3) above is fulfilled and filtering is done between blocks A and B, one of two types of filtering (weak or strong filtering) is performed. The choice between the strong and the weak filtering is done separately for each line depending on the following conditions. For lines i=0,3, strong filtering is performed if all the following conditions are true, otherwise, weak filtering is performed:
2×dpq1<(β>>2) (4)
and (|p31−p01|+|q01−q31|)<(β>>3) (5)
and |p01−q01|<((5*tc+1)>>1), (6)
where tc and β depend on QP as shown in Table 1. The tc is calculated as tc×(QP+2) when A or B has PredMode==MODE_INTRA.
The two filtering modes (weak and strong filtering) in the HEVC draft look like in the following:
Weak filtering is performed based on the above conditions. The actual filtering works by computing an offset (Δ) for each of the lines i that the weak filter has been selected for. The following weak filtering procedure is applied for every line, where it has been chosen. In the following algorithm, the variables p0 . . . p2 and q0 . . . q2 are assigned the following values (from row/column i) where p0=p01, p1=p11, p2=p21, q0=q01, q1=q11, q2=q21. One can see that if the weak filtering is performed, one to two pixels are modified at each side of the block boundary:
where Clip is defined as x′=Clip3(A, B, x): x′=x or if x<A x′=A or if x>B x′=B and Clip1Y(x)=Clip3(0, (1<<BitDepthY)−1, x), where BitDepthY is the bit depth, for example 8 or 10.
Strong filtering mode is performed for a line i of pixels by the following set of operations, where p0=p01, p1=p11, p2=p21, q0=q01, q1=q11, q2=q21:
p0′=Clip3(p0−2×tc,p0+2×tc,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
p1′=Clip3(p1−2×tc,p1+2×tc,(p2+p1+p0+q0+2)>>2)
p2′=Clip3(p2−2×tc,p2+2×tc,(2×p3+3×p2+p1+p0+q0+4)>>3)
q0′=Clip3(q0−2×tc,q0+2×tc,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
q1′=Clip3(q1−2×tc,q1+2×tc,(p0+q0+q1+q2+2)>>2)
q2′=Clip3(q2−2×tc,q2+2×tc,(p0+q0+q1+3×q2+2×q3+4)>>3)
A shortcoming with the prior art strong deblocking filtering and in particular the clipping operations is that it may result in subjective quality problems. These subjective quality problems include creating a sort of ripple at the block boundary in certain situations, e.g. when the signal on the sides of the block boundary has a skewed line. Hence, there is a need for improvement with regard to strong deblocking filtering and clipping operations.
It is a general object to provide an improved deblocking filtering control.
It is a particular object to provide an improved clipping function for strong deblocking filtering.
These and other objects are met by embodiment as disclosed herein.
An aspect of the embodiments relates to a filtering control method comprising filtering pixel values of pixels in a line of pixels in a block of pixels with a strong deblocking filter to obtain filtered pixel values. The method also comprises clipping off, for each filtered pixel value of a pixel in the line of pixel, the filtered pixel value to a respective clipping parameter value defined based on a position of the pixel relative to a block boundary between the block of pixels and a neighboring block of pixels. The clipping parameter values change at least approximately linearly depending on the position of the pixel relative to the block boundary and pixels in the line of pixels having different positions from the block boundary have different clipping parameter values.
Another aspect of the embodiments relates to a filtering control device comprising a filtering unit configured to filter pixel values of pixels in a line of pixels in a block of pixels with a strong deblocking filter to obtain filtered pixel values. The filtering control device also comprises a clipping unit configured to clip off, for each filtered pixel value of a pixel in the line of pixel, the filtered pixel value to a respective clipping parameter value defined based on a position of the pixel relative to a block boundary between the block of pixels and a neighboring block of pixels. The clipping parameter values change at least approximately linearly depending on the position of the pixel relative to the block boundary and pixels in the line of pixels having different positions from the block boundary have different clipping parameter values.
A further aspect of the embodiments relates to a filtering control device comprising a processing unit configured to filter pixel values of pixels in a line of pixels in a block of pixels with a strong deblocking filter to obtain filtered pixel values. The processing unit is also configured to clip off, for each filtered pixel value of a pixel in the line of pixel, the filtered pixel value to a respective clipping parameter value defined based on a position of the pixel relative to a block boundary between the block of pixels and a neighboring block of pixels. The clipping parameter values change at least approximately linearly depending on the position of the pixel relative to the block boundary and pixels in the line of pixels having different positions from the block boundary have different clipping parameter values.
Further aspects of the embodiments relate to an encoder comprising a filtering control device according to above, a decoder comprising a filtering control device according to above, a user equipment comprising an encoder and/or a decoder according to above and a network device being or belonging to a network node in a communication network. The network device comprises an encoder and/or a decoder according to above.
Yet another aspect of the embodiments relates to a computer program for filtering control. The computer program comprises code means, which when executed by a processing unit, causes the processing unit to filter pixel values of pixels in a line of pixels in a block of pixels with a strong deblocking filter to obtain filtered pixel values. The code means also causes the processing unit to clip off, for each filtered pixel value of a pixel in the line of pixel, the filtered pixel value to a respective clipping parameter value defined based on a position of the pixel relative to a block boundary between the block of pixels and a neighboring block of pixels. The clipping parameter values change at least approximately linearly depending on the position of the pixel relative to the block boundary and pixels in the line of pixels having different positions from the block boundary have different clipping parameter values.
A related aspect relates to a computer program product comprising computer readable code means and a computer program according to above stored on the computer readable code means.
A further embodiment relates to a media terminal comprising a processing unit and a memory comprising code means executable by the processing unit. The media terminal is thereby operative to filter pixel values of pixels in a line of pixels in a block of pixels with a strong deblocking filter to obtain filtered pixel values. The media terminal is also operative to clip off, for each filtered pixel value of a pixel in the line of pixel, the filtered pixel value to a respective clipping parameter value defined based on a position of the pixel relative to a block boundary between the block of pixels and a neighboring block of pixels. The clipping parameter values change at least approximately linearly depending on the position of the pixel relative to the block boundary and pixels in the line of pixels having different positions from the block boundary have different clipping parameter values.
The proposed solution improves the subjective and/or objective quality of strong deblocking filtering. Usage of unequal clipping and/or the proposed filtering prevents artifacts, such as a ripple or wave, from appearing at the block boundary.
The embodiments, together with further objects and advantages thereof, may best be understood by making reference to the following description taken together with the accompanying drawings, in which:
Throughout the drawings, the same reference numbers are used for similar or corresponding elements.
The present embodiments generally relate to deblocking filtering, and in particular to controlling deblocking filtering over a block boundary or border between adjacent blocks of pixels in a picture.
Deblocking filters are used to combat blocking artifacts that arise because the pictures in the original video are split into blocks of pixels, which are processed relatively independently. Deblocking filters are often divided into two types or modes of filtering, generally denoted weak filtering and strong filtering. A strong filter applies, which its name indicate, a stronger filtering of pixel values as compared to a weak filter.
Deblocking filtering involves filtering decision, i.e. determining whether pixel values should be filtered at all and if so, whether strong or weak deblocking filtering should be used; the actual filtering operation and a clipping function that clips the filtered pixel values to be within an allowed pixel value range, i.e. not smaller than a minimum allowed pixel value and not larger than a maximum allowed pixel value.
The prior art clipping function employed for strong deblocking filtering and the strong filter function, as represented by the HEVC strong filtering in the background section, may result in subjective quality problems by causing a sort of ripple at the block boundary between adjacent blocks of pixels. A main reason for this problem is that the prior art clipping function applies the same modification, i.e. clipping parameter value, to the pixels regardless of their positions relative to the block boundary. This same modification is 2×tc. The HEVC strong deblocking filter also has a tendency to create a ripple on the signal of some shapes, e.g. then the signal has a form of the inclined ramp crossing the block boundary.
According to the embodiments, an unequal clipping for the strong deblocking filter is introduced. It means that pixels, sometimes denoted samples in the art of deblocking filtering, having different positions from the block boundary have different maximum modification values.
Hence, the embodiments solve the problems of the prior art by using clipping parameter values that change at least approximately linearly depending on the position of a pixel relative to a block boundary. This further implies that pixels in a line of pixels having different positions from the block boundary have different clipping parameter values, i.e. different maximum modification values.
In the art, filtering pixel values of pixels in a line of pixels in a block of pixels are sometimes denoted as filtering sample values of samples in a line of samples in a block of samples. Herein, pixel values and pixels are used throughout the description but also encompass alternative notations used in the art, such as sample values and samples. A pixel value (sample value) generally represents a color value of the pixel (sample). Different color formats are available in the art including luminance+chrominance, red+green+blue (RGB). Video coding generally use the color format with one luminance component and two chrominance components for each pixel. Traditionally, luminance component filtering and chrominance component filtering are done separately possibly employing different filtering decisions and different de-blocking filters. The embodiments can be applied to filter the luminance component, filter the chrominance component or filter both the luminance component and the chrominance component. In a particular embodiment, the embodiments are applied to achieve luminance or luma filtering. Hence, in a particular embodiment a pixel value (sample value) represents a luminance value.
Step S1 of
The result of the filtering with the strong deblocking filter, or more correct with a set of strong deblocking filter as is further disclosed herein, in step S1 is filtered pixel values. Hence, the strong filtering as applied in step S1 typically changes the pixel values of the filtered pixels 12, 14, 16 into changed or filtered pixel values.
These filtered pixel values are then clipped off in step S2 to be within a respective allowed pixel value range. Such clipping off is performed by using a respective clipping parameter value for each filtered pixel value. In clear contrast to the prior art, the clipping parameter values applied for strong deblocking filtering are, according to the embodiments, defined based on the position of the pixel 12, 14, 16 relative to the block boundary 2. Accordingly, the clipping parameter values for the filtered pixel values change at least approximately linearly depending on the position of the pixel 12, 14, 16 relative to the block boundary 2. This means that pixels 12, 14, 16 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 having different positions from the block boundary 2 have different clipping parameter values. The clipping in step S2 is preferably performed for each filtered pixel value obtained in step S1, which is schematically illustrated by the loop in
For instance, assume that tc0 indicates the clipping parameter value for the first pixel 12, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18; tc1 indicates the clipping parameter value for the second pixel 14, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18; and tc2 indicates the clipping parameter value for the third pixel 16, relative to block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18. In such a case, tc0≠tc1≠tc2.
In a particular embodiment, pixels 16 that are further away from the block boundary 2 are allowed smaller modifications than the pixels 12 that are closer to the block boundary 2. This enables controlling the strength of deblocking filtering with clipping at the same time making sample on the two sides of the block boundary 2 converge to the middle. This is not always possible if the uniform clipping of the prior art is applied.
In an embodiment, it is proposed to use values of the clipping parameter that change linearly or approximately linearly depending on the position of the sample, i.e. pixel 12, 14, 16, from the block boundary 2. For example, the values of the clipping parameter may form a straight line depending on the distance of the sample from the block boundary 2.
Thus, in this embodiment the clipping parameter values are defined to form a straight line when traveling along the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 from the block boundary 2. In addition, since the clipping parameter values change at least approximately linearly depending on pixel position relative to the block boundary 2 as defined in the foregoing and pixels 12, 14, 16 with different pixel positions have different clipping parameter values, the straight line is in the form of a ramp or gradient, i.e. has a slope different from zero. In a particular embodiment, the clipping parameter values can be defined as tc=k×p×+m, wherein px represents the position of a pixel 12, 14, 16 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 relative to the block boundary 2, k is a non-zero value and m is zero or a positive or negative value. In a particular embodiment, the sign of k is set so that a pixel 12 having a position closer to the block boundary 2 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 has a larger clipping parameter value than another pixel 16 having a position further away from the block boundary 2 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 and where the pixel 12 and the another pixel 16 are present in the block 10 of pixels 12, 14, 16, 18.
Step S5 is preferably performed for each filtered pixel value in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28, which is schematically illustrated by the loop as shown in
An example of a straight line for the clipping parameter values is the following. Assume that the value of the clipping parameter for the sample position, i.e. the pixel position, closest to the block boundary 2, i.e. p0, is tc. Then, the clipping parameter value for the second pixel position, i.e. p1, is tc×2/3, and the clipping parameter value for the third position form the block boundary 2, i.e. p2, is tc/3.
Alternatively, assume that the value of the clipping parameter for the sample position, i.e. the pixel position, second closest to the block boundary, i.e. p1, is tc2. Then, the clipping parameter value for the first pixel position, i.e. p0, is tc2×3/2, and the clipping parameter value for the third position from the block boundary 2, i.e. p2, is tc2/2.
is a largest integer not greater than c. The method then continues to step S1 or S2 of
In a variant of
In another variant of
In yet another variant of
The value of the parameter tc can be obtained based on the QP value determined for or associated with the block 10 of pixels 12, 14, 16, 18. For instance, the QP value can be used to retrieve tc from a look-up table, such as Table 1.
Strong deblocking filtering typically involves filtering pixel values in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 on either side of the block boundary 2, i.e. both in the block 10 of pixels 12, 14, 16, 18 and in the neighboring block 20 of pixels 22, 24, 26, 28. The clipping parameter values as determined according to the embodiments as defined in the foregoing are preferably applicable to both pixels 12, 14, 16 present in the block 10 of pixels 12, 14, 16, 18 and pixels 22, 24, 26 present in the neighboring block 20 of pixels 22, 24, 26, 28. All these pixels 12, 14, 16, 22, 24, 26, 28 are present in the same line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28. Pixel values of pixels 22, 24, 26, 28 present in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28 are generally denoted qx herein. In such a case, the clipping parameter value defined for the first pixel position is preferably the same regardless of this pixel 12 is present in the block 10 of pixels 12, 14, 16, 18, i.e. denoted p0, or if the pixel 22 is the first pixel 22 in the neighboring block 20 of pixels 22, 24, 26, 28, i.e. denoted q0. Hence, the clipping parameter value tc0 is preferably applicable to pixels 12, 22 with pixel values p0 and q0, the clipping parameter value tc1 is preferably applicable to pixels 14, 24 with pixel values p1 and q1 and the clipping parameter value tc2 is preferably applicable to pixels 16, 26 with pixel values p2 and q2.
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
p
1′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
p
2′=(3×p3+3×p2+p1+q0+4)>>3
wherein p0 represents a pixel value of a first pixel 12, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p1 represents a pixel value of a second pixel 14, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p2 represents a pixel value of a third pixel 16, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p3 represents a pixel value of a fourth pixel 18, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, q0 represents a pixel value of a first pixel 22, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q1 represents a pixel value of a second pixel 24, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, p0′ represents a filtered pixel value for the first pixel 12 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, P1′ represents a filtered pixel value for the second pixel 14 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p2′ represents a filtered pixel value for the third pixel 16 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18.
In a particular embodiment, step S7 preferably also comprises calculating filtered pixel values according to:
q
0′=(q2+2×q1+2×q0+2×p0+p1+4)>>3
q
1′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
q
2′=(3×q3+3×q2+q1+p0+4)>>3
wherein q2 represents a pixel value of a third pixel 26, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q3 represents a pixel value of a fourth pixel 28, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q0′ represents a filtered pixel value for the first pixel 22 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q1′ represents a filtered pixel value for the second pixel 24 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q2′ represents a filtered pixel value for the third pixel 26 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28.
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
p
1′=(p3+3×p2+2×p1+q0+q1+4)>>3
p
2′=(3×p3+4×p2+q0+4)>>3
In a particular embodiment, step S8 preferably also comprises calculating filtered pixel values according to:
q
0′=(q2+2×q1+2×q0+2×p0+p1+4)>>3
q
1′=(q3+3×q2+2×q1+p0+p1+4)>>3
q
2′=(3×q3+4×q2+p0+4)>>3
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
p
1′=(p2+p1+p0+q0+2)>>2
p
2′=(2×p3+3×p2+p1+p0+q0+4)>>3
In a particular embodiment, step S9 preferably also comprises calculating filtered pixel values according to:
q
0′=(q2+2×q1+2×q0+2×p0+p1+4)>>3
q
1′=(q2+q1+q0+p0+2)>>2
q
2′=(2×q3+3×q2+q1+q0+p0+4)>>3
The proposed implementation embodiments are examples of application of the proposed clipping. These examples are, however, not restrictive and can be used separately or in combination with each other or other methods.
An example of implementation of the proposed strong filter in integer arithmetics, including clipping:
p
0′=Clip3(p0−2×tc,p0+2×tc,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−2×tc,q0+2×tc,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
2′=Clip3(p1−tc2,p1−tc2,(p3+2×p2+2×p1+p0+2×q0+4)>>3)
q
2′=Clip3(q1−tc2,q1−tc2,(q3+2×q2+2×q1+q0+2×p0+4)>>3)
p
3′=Clip3(p2−tc3,p2+tc3,(3×p3+3×p2+1×p1+0×p0+q0+4)>>3)
q
3′=Clip3(q2−tc3,q2+tc3,(p0+0×q0+1×q1+3×q2+3×q3+4)>>3),
where tc, tc1 and tc2 are clipping values for the first, second and third sample position from the block boundary respectively.
The clipping values generally depend on the quantization parameter (QP) value and can be stored in a look-up table. The clipping values can also be derived from other values, which in its turn depend on the quantization parameters (QP) and possibly other conditions.
An example of implementation of the proposed strong filter in integer arithmetics, including clipping:
p
0′=Clip3(p0−tc0,p0+tc0,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−tc0,q0+tc0,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
1′=Clip3(p1−tc1,p1+tc1,(p3+2×p2+2×p1+p0+2×q0+4)>>3)
q
1′=Clip3(q1−tc1,q1+tc1,(q3+2×q2+2×q1+q0+2×p0+4)>>3)
p
2′=Clip3(p2−tc2,p2+tc2,(3×p3+3×p2+p1+q0+4)>>3)
q
2′=Clip3(q2−tc2,q2+tc2,(p0+q1+3×q2+3×q3+4)>>3),
where tc0, tc1 and tc2 are clipping values for the first, second and third sample position from the block boundary respectively.
The clipping values generally depend on the quantization parameter (QP) value and can be stored in a look-up table. The clipping values can also be derived from other values, which in its turn depend on the quantization parameters (QP) and possibly other conditions.
This embodiment shows the clipping value with the parameters (QP) and possibly other conditions.
tc2=tc
tc1=(tc×3+1)>>1
tc3=(tc+1)>>1
where tc is the value of the current deblocking clipping parameter that depends on the clipping and possibly some other conditions.
This embodiment shows the clipping value with the parameters (QP) and possibly other conditions.
tc1=tc
tc0=(tc×3+1)>>1
tc2=(tc+1)>>1
where tc is the value of the current deblocking clipping parameter that depends on the clipping and possibly some other conditions.
This embodiment shows the clipping value with the parameters (QP) and possibly some other conditions.
tc2=((tc<<1)+tc+1)>>2
tc1=(tc×3+1)>>1
tc3=(tc+1)>>1,
where tc is the value of the current deblocking clipping parameter that depends on the clipping and possibly some other conditions.
This embodiment shows the clipping value with the parameters (QP) and possibly some other conditions.
tc1=((tc<<1)+tc+1)>>2
tc0=(tc1×3+1)>>1
tc2=(tc1+1)>>1,
where tc is the value of the current deblocking clipping parameter that depends on the clipping and possibly some other conditions.
This embodiment is a combination of the proposed deblocking filter with clipping from implementation embodiment 3.
tc2=tc
tc1=(tc×3+1)>>1
tc3=(tc+1)>>1
p
0′=Clip3(p0−2×tc,p0+2×tc,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−2×tc,q0+2×tc,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
2′=Clip3(p1−tc2,p1+tc2,(p3+2×p2+2×p1+p0+2×q0+4)>>3)
q
2′=Clip3(q1−tc2,q1+tc2,(q3+2×q2+2×q1+q0+2×p0+4)>>3)
p
3′=Clip3(p2−tc3,p2+tc3,(3×p3+3×p2+1×p1+0×p0+q0+4)>>3)
q
3′=Clip3(q2−tc3,q2+tc3,(p0+0×q0+1×q1+3×q2+3×q3+4)>>3)
This embodiment is a combination of the proposed deblocking filter with clipping from implementation embodiment 4.
tc1=tc
tc0=(tc×3+1)>>1
tc2=(tc+1)>>1
p
0′=Clip3(p0−tc0,p0+tc0,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−tc0,q0+tc0,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
1′=Clip3(p1−tc1,p1+tc1,(p3+2×p2+2×p1+p0+2×q0+4)>>3)
q
1′=Clip3(q1−tc1,q1+tc1,(q3+2×q2+2×q1+q0+2×p0+4)>>3)
p
2′=Clip3(p2−tc2,p2+tc2,(3×p3+3×p2+p1+q0+4)>>3)
q
2′=Clip3(q2−tc2,q2+tc2,(p0+q1+3×q2+3×q3+4)>>3)
This embodiment is a combination of the proposed deblocking filter with clipping from implementation embodiment 5.
tc2=((tc<<1)+tc+1)>>2
tc1=(tc×3+1)>>1
tc3=(tc+1)>>1,
p
0′=Clip3(p0−2×tc,p0+2×tc,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−2×tc,q0+2×tc,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
2′=Clip3(p1−tc2,p1+tc2,(p3+2×p2+2×p1+p0+2×q0+4)>>3)
q
2′=Clip3(q1−tc2,q1+tc2,(q3+2×q2+2×q1+q0+2×p0+4)>>3)
p
3′=Clip3(p2−tc3,p2+tc3,(3×p3+3×p2+1×p1+0×p0+q0+4)>>3)
q
3′=Clip3(q2−tc3,q2+tc3,(p0+0×q0+1×q1+3×q2+3×q3+4)>>3)
This embodiment is a combination of the proposed deblocking filter with clipping from implementation embodiment 6.
tc1=((tc<<1)+tc+1)>>2
tc0=(tc1×3+1)>>1
tc3=(tc1+1)>>1
p
0′=Clip3(p0−tc0,p0+tc0,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−tc0,q0+tc0,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
1′=Clip3(p1−tc1,p1+tc1,(p3+2×p2+2×p1+p0+2×q0+4)>>3)
q
1′=Clip3(q1−tc1,q1+tc1,(q3+2×q2+2×q1+q0+2×p0+4)>>3)
p
2′=Clip3(p2−tc2,p2+tc2,(3×p3+3×p2+p1+q0+4)>>3)
q
2′=Clip3(q2−tc2,q2+tc2,(p0+q1+3×q2+3×q3+4)>>3)
This embodiment an integer implementation of an alternative deblocking filter with clipping:
p
0′=Clip3(p0−2×tc,p0+2×tc,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−2×tc,q0+2*tc,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
2′=Clip3(p1−tc2,p1+tc2,(p3+3×p2+2×p1+q0+q1+4)>>3)
q
2′=Clip3(q1−tc2,q1+tc2,(q3+3×q2+2×q1+p0+p1+4)>>3)
p
3′=Clip3(p2−tc3,p2+tc3,(3×p3+4×p2+q0+4)>>3)
q
3′=Clip3(q2−tc3,q2+tc3,(p0+4×q2+3×q3+4)>>3)
This embodiment an integer implementation of an alternative deblocking filter with clipping:
p
0′=Clip3(p0−tc0,p0+tc0,(p2+2×p1+2×p0+2×q0+q1+4)>>3)
q
0′=Clip3(q0−tc0,q0+tc0,(p1+2×p0+2×q0+2×q1+q2+4)>>3)
p
1′=Clip3(p1−tc1,p1+tc1,(p3+3×p2+2×p1+q0+q1+4)>>3)
q
2′=Clip3(q1−tc1,q1+tc1,(q3+3×q2+2×q1+p0+p1+4)>>3)
p
2′=Clip3(p2−tc2,p2+tc2,(3×p3+4×p2+q0+4)>>3)
q
2′=Clip3(q2−tc2,q2+tc2,(p0+4×q2+3×q3+4)>>3)
The alternative deblocking filter from embodiments 12 and 13 can also be used in combination with the clipping proposed in implementation embodiments 3 to 6. Other deblocking filters, as well as the current HEVC strong deblocking filter, can also be used with the clipping proposed in implementation embodiments 3 to 6.
The proposed solution improves the subjective and objective quality of the HEVC strong filtering. The unequal clipping prevent artifacts at the block boundary to appear, such as a ripple or wave, which otherwise could be created.
The implementation example shown in
One can see that although the HEVC strong deblocking filter efficiently suppresses the blocking artifacts, it does not preserve a ramp signal. This means that if the HEVC strong filter is applied to the signal that has a shape of a perfect ramp, e.g. 10 20 30 40, the ramp gets distorted. The shape then becomes similar to that of a wave. It means that when the strong filter is applied to areas with a gradient change in the intensity of pixel values, the filter can produce artifacts that have a shape of a ripple or wave. This can decrease the subjective quality of the filtered video.
The implementation examples shown in
The new strong deblocking filters as proposed in
In an alternative approach, strong deblocking filters proposed in
Hence, an aspect of the embodiments relates to a deblocking filtering method. The deblocking filtering method comprises deblocking filtering pixel values of pixels 12, 14, 16, 22, 24, 26, 28 in a line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in a block 10 of pixels 12, 14, 16, 18 and in a neighboring block 20 of pixels 22, 24, 26, 28 by calculating filtered pixel values according to:
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
q
1′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
p
2′=(3×p3+3×p2+p1+q0+4)>>3
q
2′=(p0+q1+3×q2+3×q3+4)>>3
wherein p0 represents a pixel value of a first pixel 12, relative to a block boundary 2 between the block 10 of pixels 12, 14, 16, 18 and the neighboring block 20 of pixels 22, 24, 26, 28, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p1 represents a pixel value of a second pixel 14, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p2 represents a pixel value of a third pixel 16, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p3 represents a pixel value of a fourth pixel 18, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, q0 represents a pixel value of a first pixel 22, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q1 represents a pixel value of a second pixel 24, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q2 represents a pixel value of a third pixel 26, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q3 represents a pixel value of a fourth pixel 28, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, p0′ represents a filtered pixel value for the first pixel 12 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p1′ represents a filtered pixel value for the second pixel 14 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p2′ represents a filtered pixel value for the third pixel 16 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, q0′ represents a filtered pixel value for the first pixel 22 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q1′ represents a filtered pixel value for the second pixel 24 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q2′ represents a filtered pixel value for the third pixel 26 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, and >> represents a right shift operator defined as
and └c┘ is a largest integer not greater than c.
Another aspect of the embodiments relates to a deblocking filtering method. The deblocking filtering method comprises deblocking filtering pixel values of pixels 12, 14, 16, 22, 24, 26, 28 in a line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in a block 10 of pixels 12, 14, 16, 18 and in a neighboring block 20 of pixels 22, 24, 26, 28 by calculating filtered pixel values according to:
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+3×p2+2×p1+q0+q1+4)>>3
q
1′=(q3+3×q2+2×q1+p0+p1+4)>>3
p
2′=(3×p3+4×p2+q0+4)>>3
q
2′=(p0+4×q2+3×q3+4)>>3
wherein p0 represents a pixel value of a first pixel 12, relative to a block boundary 2 between the block 10 of pixels 12, 14, 16, 18 and the neighboring block 20 of pixels 22, 24, 26, 28, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p1 represents a pixel value of a second pixel 14, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p2 represents a pixel value of a third pixel 16, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p3 represents a pixel value of a fourth pixel 18, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, q0 represents a pixel value of a first pixel 22, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q1 represents a pixel value of a second pixel 24, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q2 represents a pixel value of a third pixel 26, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q3 represents a pixel value of a fourth pixel 28, relative to the block boundary 2, in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, p0′ represents a filtered pixel value for the first pixel 12 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p1′ represents a filtered pixel value for the second pixel 14 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, p2′ represents a filtered pixel value for the third pixel 16 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the block 10 of pixels 12, 14, 16, 18, q0′ represents a filtered pixel value for the first pixel 22 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q1′ represents a filtered pixel value for the second pixel 24 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, q2′ represents a filtered pixel value for the third pixel 26 in the line 15 of pixels 12, 14, 16, 18, 22, 24, 26, 28 in the neighboring block 20 of pixels 22, 24, 26, 28, and >> represents a right shift operator defined as
and └c┘ is a largest integer not greater than c.
It can be seen from the HEVC strong filter description that when the filter is applied to the signal that has a form of a ramp, the filters applied to the samples closest to the block boundary do not modify a ramp since the filters applied to these samples are symmetric filters with odd number of filter taps. Unlike this, the filter for second and the third sample from the block boundary in HEVC strong filter do modify the ramp. Therefore, the proposed filters use the same equations for the sample values closest to the block boundary, whereas other expressions than in the HEVC strong deblocking filter are used for the sample values that are further away from the block boundary.
It is proposed to use the deblocking filter that is based on the following formula:
p
0′=(p2+2×p1+2×p0+2×q0+q1)/8
q
0′=(p1+2×p0+2×q0+2×q1+q2)/8
p
1′=(p3+2×p2+2×p1+p0+2×q0)/8
q
1′=(q3+2×q2+2×q1+q0+2×p0)/8
p
2′=(3×p3+3×p2+p1+q0)/8
q
2′=(p0+q1+3×q2+3×q3)/8
An alternative filter with similar properties can be used instead.
p
0′=(p2+2×p1+2×p0+2×q0+q1)/8
q
0′=(p1+2×p0+2×q0+2×q1+q2)/8
p
1′=(p3+3×p2+2×p1+q0+q1)/8
q
1′=(q3+3×q2+2×q1+p0+p1)/8
p
2′=(3×p3+4×p2+q0)/8
q
2′=(p0+4×q2+3×q3)/8
The proposed implementation embodiments are examples of application of the proposed filter. These examples are, however, not restrictive and can be used separately or in combination with each other or other methods.
An example of implementation of the proposed strong filter in integer arithmetics
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
2′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
q
2′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
p
3′=(3×p3+3×p2+p1+q0+4)>>3
q
3′=(p0+q1+3×q2+3×q3+4)>>3
An example of implementation of the proposed strong filter in integer arithmetics
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
q
1′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
p
2′=(3×p3+3×p2+p1+q0+4)>>3
q
2′=(p0+q1+3×q2+3×q3+4)>>3
This embodiment is an integer implementation of an alternative deblocking filter.
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
2′=(p3+3×p2+2×p1+q0+q1+4)>>3
q
2′=(q3+3×q2+2×q1+p0+p1+4)>>3
p
3′=(3×p3+4×p2+q0+4)>>3
q
3′=(p0+4×q2+3×q3+4)>>3
This embodiment is an integer implementation of an alternative deblocking filter.
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+3×p2+2×p1+q0+q1+4)>>3
q
1′=(q3+3×q2+2×q1+p0+p1+4)>>3
p
2′=(3×p3+4×p2+q0+4)>>3
q
2′=(p0+4×q2+3×q3+4)>>3
The filters proposed in implementation embodiments 14 to 17 can be used with the clipping implementation embodiments 1 to 13, with other clipping, e.g. uniform clipping, or without any clipping. Other combinations of embodiments are possible.
The proposed solution improves the subjective and objective quality of the HEVC strong filtering. The new strong deblocking filters prevent artifacts at the block boundary to appear, such as a ripple or wave, which otherwise could be created if the current HEVC filter is applied to the block boundaries.
The filtering unit 101 of the filtering control device 100 is also referred to herein as a filtering means or module and the clipping unit 102 is correspondingly also referred to as a clipper, clipping means or module.
In an embodiment, a pixel in the line of pixels further away from the block boundary has a smaller clipping parameter value than another pixel in the line of pixels closer to the block boundary.
In an embodiment, the clipping parameter values form a straight line depending on a distance of the pixel from the block boundary.
In an embodiment, the clipping unit 102 is configured to calculate, for each filtered pixel value, a clipped filtered pixel value x′=Clip3(A, B, x), which is defined as in the foregoing.
In another embodiment, the value calculator 103 is configured to calculate the clipping parameter values to be tc1=((tc<<1)+tc+1)>>2 for a second pixel, relative to the block boundary, in the line of pixels, tc0=(tc1×3+1)>>1 for a first pixel, relative to the block boundary, in the line of pixels and tc2=(tc1+1)>>1 for a third pixel, relative to the block boundary, in the line of pixels.
In a further embodiment, the value calculator 103 is configured to calculate the clipping parameter values to be tc0=(tc×3+1)>>1 for a first pixel, relative to the block boundary, in the line of pixels, tc1=((tc<<1)+tc+1)>>2 for a second pixel, relative to the block boundary, in the line of pixels and tc2=(tc+1)>>1 for a third pixel, relative to the block boundary, in the line of pixels.
In yet another embodiment, the value calculator 103 is configured to calculate the clipping parameter values to be tc0=tc for a first pixel, relative to the block boundary, in the line of pixels, tc1=((tc<<1)+tc+1)>>2 for a second pixel, relative to the block boundary, in the line of pixels and tc2=(tc+1)>>1 for a third pixel, relative to the block boundary, in the line of pixels.
The value calculator 103 is also referred to herein as a value calculating unit, means or module.
In an embodiment, the filtering unit 101 of
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
p
1′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
p
2′=(3×p3+3×p2+p1+q0+4)>>3
In a particular embodiment, the filtering unit 101 is also configured to calculate filtered pixel values according to:
q
0′=(q2+2×q1+2×q0+2×p0+p1+4)>>3
q
1′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
q
2′=(3×q3+3×q2+q1+p0+4)>>3
In another embodiment, the filtering unit 101 of
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
p
1′=(p3+3×p2+2×p1+q0+q1+4)>>3
p
2′=(3×p3+4×p2+q0+4)>>3
In a particular embodiment, the filtering unit 101 is also configured to calculate filtered pixel values according to:
q
0′=(q2+2×q1+2×q0+2×p0+p1+4)>>3
q
1′=(q3+3×q2+2×q1+p0+p1+4)>>3
q
2′=(3×q3+4×q2+p0+4)>>3
In a further embodiment, the filtering unit 101 of
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
p
1′=(p2+p1+p0+q0+2)>>2
p
2′=(2×p3+3×p2+p1+p0+q0+4)>>3
In a particular embodiment, the filtering unit 101 is also configured to calculate filtered pixel values according to:
q
0′=(q2+2×q1+2×q0+2×p0+p1+4)>>3
q
1′=(q2+q1+q0+p0+2)>>2
q
2′=(2×q3+3×q2+q1+q0+p0+4)>>3
The processing unit 120 is also referred to herein as processor or processing means, circuit or module.
Hence, the processing unit 120 of
Accordingly as illustrated in
The filtering control device 100 of
Hence, the steps, functions, procedures and/or blocks described above may be implemented in hardware using any conventional technology, such as discrete circuit or integrated circuit technology, including both general-purpose electronic circuitry and application-specific circuitry.
Particular examples include one or more suitably configured digital signal processors and other known electronic circuits, e.g. discrete logic gates interconnected to perform a specialized function, or Application Specific Integrated Circuits (ASICs).
Alternatively, at least some of the steps, functions, procedures and/or blocks described above may be implemented in software such as a computer program for execution by suitable processing circuitry including one or more processing units. Examples of processing circuitry includes, but is not limited to, one or more microprocessors, one or more DSPs, one or more Central Processing Units (CPUs), video acceleration hardware, and/or any suitable programmable logic circuitry such as one or more Field Programmable Gate Arrays (FPGAs) or one or more Programmable Logic Controllers (PLCs).
It should also be understood that it may be possible to re-use the general processing capabilities of any conventional device or unit in which the proposed technology is implemented. It may also be possible to re-use existing software, e.g. by reprogramming of the existing software or by adding new software components.
The filtering control device 100 described herein could alternatively be implemented e.g. by one or more of a processing unit 72 in a computer 70 and adequate software with suitable storage or memory therefore, a programmable logic device (PLD) or other electronic component(s) as shown in
In the following, an example of a computer implementation will be described with reference to
The term ‘computer’ should be interpreted in a general sense as any system or device capable of executing program code or computer program instructions to perform a particular processing, determining or computing task.
The software or computer program 74 may be realized as a computer program product 73, which is normally carried or stored on a computer-readable medium. The computer-readable medium may include one or more removable or non-removable memory devices including, but not limited to a Read-Only Memory (ROM), a Random Access Memory (RAM), a Compact Disc (CD), a Digital Versatile Disc (DVD), a Universal Serial Bus (USB) memory, a Hard Disk Drive (HDD) storage device, a flash memory, or any other conventional memory device. The computer program 74 may thus be loaded into the operating memory of a computer 70 or equivalent processing device for execution by the processing unit 72 thereof.
For example, the computer program 74 stored in memory includes program instructions executable by the processing unit 72, whereby the processing unit 72 is able or operative to execute the above-described steps, functions, procedure and/or blocks.
The computer 70 or processing unit 72 does not have to be dedicated to only execute the above-described steps, functions, procedure and/or blocks, but may also execute other tasks.
Furthermore, the computer 70 comprises at least one computer program product 73 in the form of a non-volatile memory, for instance an EEPROM (Electrically Erasable Programmable Read-Only Memory) or a flash memory. The computer program product 73 comprises a computer program 74, which comprises code means 310 which when run on or executed by the computer 70, such as by the processing unit 72, causes the computer 70 to perform the steps of the method described in the foregoing in connection with
An embodiment therefore relates to a computer program 74 comprising code means 310, which when executed by a processing unit 72, causes the processing unit 72 to filter pixel values of pixel in a line of pixels in a block of pixels with a strong deblocking filter to obtain filtered pixel values. The code means 310 of the computer program 74 also causes the processing unit 72 to clip off, for each filtered pixel value of a pixel in the line of pixels, the filtered pixel value to a respective clipping parameter value defined based on a position of the pixel relative to a block boundary between the block of pixels and a neighboring block of pixels. The clipping parameter values change at least approximately linearly depending on the position of the pixel relative to the block boundary and pixels in the line of pixels having different positions from the block boundary have different clipping parameter values.
An embodiment relates to a computer program product 73 comprising computer readable code means and a computer program 74 according to above stored on the computer readable code means.
The deblocking filter is used in video coding. It functions in both the video encoder and in the video decoder. The video decoder can be implemented preferably in hardware but also in software. The same holds for the video encoder.
The methods of the embodiments are performed in a filtering control device which can be located in an encoder or a decoder as schematically illustrated in
The embodiments can be implemented in a filtering control device.
A current block of pixels is predicted by performing a motion estimation by a motion estimator 50 from an already provided block of pixels in the same frame or in a previous frame. The result of the motion estimation is a motion or displacement vector associated with the reference block, in the case of inter prediction. The motion vector is utilized by a motion compensator 50 for outputting an inter prediction of the block of pixels.
An intra predictor 49 computes an intra prediction of the current block of pixels. The outputs from the motion estimator/compensator 50 and the intra predictor 49 are input in a selector 51 that either selects intra prediction or inter prediction for the current block of pixels. The output from the selector 51 is input to an error calculator in the form of an adder 41 that also receives the pixel values of the current block of pixels. The adder 41 calculates and outputs a residual error as the difference in pixel values between the block of pixels and its prediction.
The error is transformed in a transformer 42, such as by a discrete cosine transform, and quantized by a quantizer 43 followed by coding in an encoder 44, such as by entropy encoder. In inter coding, also the estimated motion vector is brought to the encoder 44 for generating the coded representation of the current block of pixels.
The transformed and quantized residual error for the current block of pixels is also provided to an inverse quantizer 45 and inverse transformer 46 to retrieve the original residual error. This error is added by an adder 47 to the block prediction output from the motion compensator 50 or the intra predictor 49 to create a reference block of pixels that can be used in the prediction and coding of a next block of pixels. This new reference block is first processed by a filtering control device 100 in order to control any filtering that is applied to the reference block to combat any artifact. The processed new reference block is then temporarily stored in a frame buffer 48, where it is available to the intra predictor 49 and the motion estimator/compensator 50.
These residual errors are added in an adder 64 to the pixel values of a reference block of pixels. The reference block is determined by a motion estimator/compensator 67 or intra predictor 66, depending on whether inter or intra prediction is performed. A selector 68 is thereby interconnected to the adder 64 and the motion estimator/compensator 67 and the intra predictor 66. The resulting decoded block of pixels output from the adder 64 is input to a filtering control device 100 in order to control any filter that is applied to combat any artifacts. The filtered block of pixels is output form the decoder 60 and is furthermore preferably temporarily provided to a frame buffer 65 and can be used as a reference block of pixels for a subsequent block of pixels to be decoded. The frame buffer 65 is thereby connected to the motion estimator/compensator 67 to make the stored blocks of pixels available to the motion estimator/compensator 67.
The output from the adder 64 is preferably also input to the intra predictor 66 to be used as an unfiltered reference block of pixels.
In the embodiments disclosed in
The solution, including the embodiments above, applies to a decoder, an encoder, as an in-loop filter or as a post-processing filter. The encoder may for example be located in a transmitter in a video camera in e.g. a mobile device. The decoder may for example be located in a receiver in a video camera or any other device for displaying, decoding or transcoding a video stream.
The solution is not limited to HEVC but may be applied to any extension of HEVC such as a scalable extension or multiview extension or to a different video codec.
Alternatively, the encoded video frames are generated by some other device and wirelessly transmitted or transmitted by wire to the user equipment 80. The user equipment 80 then comprises a transceiver (transmitter and receiver) or input and output port 82 to achieve the data transfer.
In
The encoded video frames are brought from the memory 84 to a decoder 60, such as the decoder illustrated in
An embodiment therefore relates to a media terminal 70, 80, 90 comprising a processing unit 72 and a memory 73 comprising code means executable by the processing unit 72. The media terminal 70, 80, 90 is thereby operative to filter pixel values of pixel in a line of pixels in a block of pixels with a strong deblocking filter to obtain filtered pixel values. The media terminal 70, 80, 90 is also operative to clip off, for each filtered pixel value of a pixel in the line of pixels, the filtered pixel value to a respective clipping parameter value defined based on a position of the pixel relative to a block boundary between the block of pixels and a neighboring block of pixels. The clipping parameter values change at least approximately linearly depending on the position of the pixel relative to the block boundary and pixels in the line of pixels having different positions from the block boundary have different clipping parameter values.
As illustrated in
As was discussed in the foregoing, the new proposed strong deblocking filters that preserve a ramp signal and smooth a step signal can be used independent of the unequal clipping.
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
q
1′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
p
2′=(3×p3+3×p2+p1+q0+4)>>3
q
2′=(p0+q1+3×q2+3×q3+4)>>3
In an alternative embodiment, the filtering unit 101 is configured to deblocking filter pixel values of pixels in a line of pixels in a block of pixels and in a neighboring block of pixels by calculating filtered pixel values according to:
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+3×p2+2×p1+q0+q1+4)>>3
q
1′=(q3+3×q2+2×q1+p0+p1+4)>>3
p
2′=(3×p3+4×p2+q0+4)>>3
q
2′=(p0+4×q2+3×q3+4)>>3
In an alternative implementation example the filtering control device 100 is implemented as shown in
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
q
1′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
p
2′=(3×p3+3×p2+p1+q0+4)>>3
q
2′=(p0+q1+3×q2+3×q3+4)>>3
In an alternative embodiment, the processing unit 120 is configured to deblocking filter pixel values of pixels in a line of pixels in a block of pixels and in a neighboring block of pixels by calculating filtered pixel values according to:
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+3×p2+2×p1+q0+q1+4)>>3
q
1′=(q3+3×q2+2×q1+p0+p1+4)>>3
p
2′=(3×p3+4×p2+q0+4)>>3
q
2′=(p0+4×q2+3×q3+4)>>3
This aspect of the embodiments also encompasses an encoder comprising a filtering control device as defined above, a decoder comprising a filtering control device according to above and a user equipment comprising an encoder according to above and/or a decoder according to above. The embodiments also relates to a network device being or belonging to a network node in a communication network. The network device comprises an encoder according to above and/or a decoder according to above. The encoder, the decoder, the user equipment and the network device can then be implemented as discussed in the foregoing in connection with
The filtering control device applying the new strong deblocking filter can be implemented in hardware, software or a combination thereof as disclosed in the foregoing in connection with
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+2×p2+2×p1+p0+2×q0+4)>>3
q
1′=(q3+2×q2+2×q1+q0+2×p0+4)>>3
p
2′=(3×p3+3×p2+p1+q0+4)>>3
q
2′=(p0+q1+3×q2+3×q3+4)>>3
In an alternative embodiment, the code means also causes the processing unit to deblocking filter pixel values of pixels in a line of pixels in a block of pixels and in a neighboring block of pixels by calculating filtered pixel values according to:
p
0′=(p2+2×p1+2×p0+2×q0+q1+4)>>3
q
0′=(p1+2×p0+2×q0+2×q1+q2+4)>>3
p
1′=(p3+3×p2+2×p1+q0+q1+4)>>3
q
1′=(q3+3×q2+2×q1+p0+p1+4)>>3
p
2′=(3×p3+4×p2+q0+4)>>3
q
2′=(p0+4×q2+3×q3+4)>>3
An embodiment of this aspect relates to a computer program product comprising computer readable code means a computer program according to above stored on the computer readable code means.
The embodiments described above are merely given as examples, and it should be understood that the proposed technology is not limited thereto. It will be understood by those skilled in the art that various modifications, combinations and changes may be made to the embodiments without departing from the present scope as defined by the appended claims. In particular, different part solutions in the different embodiments can be combined in other configurations, where technically possible.
Filing Document | Filing Date | Country | Kind |
---|---|---|---|
PCT/SE2013/050832 | 6/30/2013 | WO | 00 |
Number | Date | Country | |
---|---|---|---|
61667501 | Jul 2012 | US |