LOW COMPLEXITY IMAGE FILTER
20230023387 · 2023-01-26
Assignee
Inventors
Cpc classification
H04N19/42
ELECTRICITY
International classification
Abstract
There is provided a method for encoding or decoding an image. The method comprises obtaining a first luma sample value, L1, associated with the image. The method comprises obtaining a second luma sample value, L2, associated with the image. The method further comprises obtaining a first luma delta value, ΔL1, wherein ΔL1=L2−L1. The method comprises obtaining a first product, P1, using ΔL1 and a first coefficient value, C1, wherein P1=(C1)(ΔL1). The method comprises calculating a first residual correction value, ΔI1 using P1 and a set of other products. The method comprises filtering an unfiltered chroma value, R.sub.C, associated with the image using the first residual correction value, ΔI1, thereby producing a filtered chroma value R.sup.F.sub.C associated with the image.
Claims
1. A method for encoding or decoding an image, the method comprising: obtaining a first luma sample value, L1, associated with the image; obtaining a second luma sample value, L2, associated with the image; obtaining a first luma delta value, ΔL1, wherein ΔL1=L2−L1; obtaining a first product, P1, using ΔL1 and a first coefficient value, C1, wherein P1=(C1)(ΔL1); calculating a first residual correction value, ΔI1 using P1 and a set of other products; and filtering an unfiltered chroma value, R.sub.C, associated with the image using the first residual correction value, ΔI1, thereby producing a filtered chroma value R.sub.C.sup.F associated with the image.
2. The method of claim 1, wherein filtering the unfiltered chroma value to produce the filtered chroma value consists of calculating: R.sub.C.sup.F=ΔI1+R.sub.C.
3. The method of claim 1, wherein the set of other products comprises a second product, P2,
P2=(C2)(ΔL2), C2 is a second coefficient value, ΔL2 is a second luma delta value that is equal to L3−L1, and L3 is a third luma sample value associated with the image.
4. The method of claim 1, wherein L1 has a first position within a two-dimensional block of luma sample values associated with the image, wherein the coordinates of the first position are x1,y1, L2 has a second position within the two-dimensional block of luma sample values, wherein the coordinates of the second position are x2,y2, the absolute value of (x1-x2) is less than or equal to 4, and the absolute value of (y1-y2) is less than or equal to 4.
5. The method of claim 4, wherein the absolute value of (x1-x2) is less than or equal to 1, and the absolute value of (y1-y2) is less than or equal to 2.
6. The method of claim 1, wherein R.sub.C has a position within a two-dimensional block of chroma sample values associated with the image, where the coordinates of the position are xc,yc, L1 has a first position within a two-dimensional block of luma sample values associated with the image, wherein the coordinates of the first position are x1,y1, L2 has a second position within the two-dimensional block of luma sample values, wherein the coordinates of the second position are x2,y2, and the second position is obtained from the position of R.sub.C within the two-dimensional block of chroma sample values.
7. The method of claim 6, wherein
x2=(Wc)(xc),
y2=(Hc)(yc), Wc is a first predetermined coefficient that is based on the format of the image, and Hc is a second predetermined coefficient that is based on the format of the image.
8. The method of claim 7, wherein when the format of the image is 4:2:0, Wc=Hc=2; when the format of the image is 4:2:2, Wc=2 and Hc=1; and when the format of the image is 4:4:4, Wc=Hc=1.
9. A non-transitory computer readable medium storing a computer program comprising instructions which when executed by processing circuitry causes the processing circuitry to perform the method of claim 1.
10-11. (canceled)
12. An apparatus, the apparatus comprising: processing circuitry; and a memory, said memory containing instructions executable by said processing circuitry, wherein said apparatus is operative to perform a method comprising: obtaining a first luma sample value, L1, associated with the image; obtaining a second luma sample value, L2, associated with the image; obtaining a first luma delta value, ΔL1, wherein ΔL1=L2−L1; obtaining a first product, P1, using ΔL1 and a first coefficient value, C1, wherein P1=(C1)(ΔL1); calculating a first residual correction value, ΔI1, using P1 and a set of other products; and filtering an unfiltered chroma value, R.sub.C, associated with the image using the first residual correction value, ΔI1 thereby producing a filtered chroma value R.sub.C.sup.F associated with the image.
13. The apparatus of claim 12, wherein filtering the unfiltered chroma value to produce the filtered chroma value consists of calculating: R.sub.C.sup.F=ΔI1+R.sub.C.
14. The apparatus of claim 12, wherein the set of other products comprises a second product, P2,
P2=(C2)(ΔL2), C2 is a second coefficient value, ΔL2 is a second luma delta value that is equal to L3−L1, and L3 is a third luma sample value associated with the image.
15. The apparatus of claim 12, wherein L1 has a first position within a two-dimensional block of luma sample values associated with the image, wherein the coordinates of the first position are x1,y1, L2 has a second position within the two-dimensional block of luma sample values, wherein the coordinates of the second position are x2,y2, the absolute value of (x1-x2) is less than or equal to 4, and the absolute value of (y1-y2) is less than or equal to 4.
16. The apparatus of claim 15, wherein the absolute value of (x1-x2) is less than or equal to 1, and the absolute value of (y1-y2) is less than or equal to 2.
17. The apparatus of claim 12, wherein R.sub.C has a position within a two-dimensional block of chroma sample values associated with the image, where the coordinates of the position are xc,yc, L1 has a first position within a two-dimensional block of luma sample values associated with the image, wherein the coordinates of the first position are x1,y1, L2 has a second position within the two-dimensional block of luma sample values, wherein the coordinates of the second position are x2,y2, and the second position is obtained from the position of R.sub.C within the two-dimensional block of chroma sample values.
18. The apparatus of claim 17, wherein
x2=(Wc)(xc),
y2=(Hc)(yc), Wc is a first predetermined coefficient that is based on the format of the image, and Hc is a second predetermined coefficient that is based on the format of the image.
19. The apparatus of claim 7, wherein when the format of the image is 4:2:0, Wc=Hc=2; when the format of the image is 4:2:2, Wc=2 and Hc=1; and when the format of the image is 4:4:4, Wc=Hc=1.
Description
DETAILED DESCRIPTION
[0031]
[0032]
[0033]
[0034] In one embodiment, to achieve the advantages discussed above, the allowed CC-ALF coefficient values of low complexity CC-ALF design are extended, but extended in such a way that there is an inexpensive way to implement the required multiplication.
[0035] Firstly, the values that can be written as 0 or ±2.sup.n or ±2.sup.n±2.sup.m up to a magnitude<=M are defined as the set Z.sup.M. As an example, all values in Z.sup.128 are between and inclusive of −128 and 128, thus the values in Z.sup.128 are: +/−{0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 24, 28, 30, 31, 32, 33, 34, 36, 40, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, 127, 128}.
[0036] The values that can be written as 0 or ±2.sup.n up to a magnitude<=M are defined as set Z.sub.two.sup.M. As an example, Z.sub.two.sup.128 includes the values +/−{5 0, 1, 2, 4, 8, 16, 32, 64, 128}.
[0037] A set Z.sub.npot.sup.M is dervied by removing the values in Z.sub.two.sup.m from the set Z.sup.M. As an example, of Z.sub.npot.sup.128 set is {−127, −126, −124, −120, −112, −96, −80, −72, −68, −66, −65, −63, −62, −60, −56, −48, −40, −36, −34, −33, −31, −30, −28, −24, −20, −18, −17, −15, −14, −12, −10, −9, −7, −6, −5, −3, 3, 5, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 24, 28, 30, 31, 33, 34, 36, 40, 48, 56, 60, 62, 63, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, 127}.
[0038] A subset of Z.sup.M (denoted Z.sub.sub) is defined where Z.sub.sub contains at least one value from Z.sub.npot.sup.M.
[0039] This disclosure proposes to use a filter that is operable to filter a sample using any set of N filter coefficients from Z.sub.sub. Furthermore, the filter should also be constrained so that each coefficient value must belong to the set Z.sub.sub.
[0040] One special case of this is when Z.sub.sub=Z.sub.two.sup.M+Z.sub.ext, where the values in Z.sub.two.sup.M are the ones in Z.sub.sub that can be written as 0 or ±2.sup.n and where the values in Z.sub.ext are the ones that cannot (but are available in Z.sup.M).
1. Hardware Complexity Assert for a Coefficient Value is Power-of-Two Multiples of 0, 1, 3
[0041] In one embodiment, the CC-ALF coefficients are extended so that they can be written as either 0 or ±2.sup.n or ±(2.sup.n+2.sup.n-1).
[0042] Given the values ranges between −128 and 128, one example of the Z.sub.ext set in this embodiment is {−96, −48, −24, −12, −6, −3, 3, 6, 12, 24, 48, 96}. Here, Z.sub.two.sup.128={−128, −64, −32, −16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16, 32, 64, 128}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−128, −96, −64, −48, −32, −24, −16, −12, −8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128}.
[0043] Given the values ranges between −64 and 64, one example of the Z.sub.ext set in this embodiment is {−48, −24, −12, −6, −3, 3, 6, 12, 24, 48}. Here, Z.sub.two.sup.64={−64, −32, −16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16, 32, 64}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−64, −48, −32, −24, −16, −12, −8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64}.
[0044] Given the values ranges between −32 and 32, one example of the Z.sub.ext set in this embodiment is {−24, −12, −6, −3, 3, 6, 12, 24}. Here, Z.sub.two.sup.32={−32, −16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16, 32}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−32, −24, −16, −12, −8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32}.
[0045] Given the values ranges between −16 and 16, one example of the Z.sub.ext set in this embodiment is {−12, −6, −3, 3, 6, 12}. Here, Z.sub.two.sup.16={−16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−16, −12, −8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8, 12, 16}.
[0046] Given the values ranges between −8 and 8, one example of the Z.sub.ext set in this embodiment is {−6, −3, 3, 6}. Here, Z.sub.two.sup.8=|−8, −4, −2, −1, 0, 1, 2, 4, 8}. The set Z.sub.sub from which one should select filter coefficients then become Z.sub.sub={−8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8}.
[0047]
[0048] From here, this disclosure explains why the extended CC-ALF coefficient values in Z.sub.sub can keep the low complexity CC-ALF filtering process in term of hardware multiplication design even though the coefficients from the Z.sub.ext set {−96, −48, −24, −12, −6, −3, 3, 6, 12, 24, 48, 96} that cannot be written as a pure power of two are included.
[0049] To calculate the sum value from Equation 4, one needs to perform several multiplications on the form a*b, where a is an allowed coefficient, i.e., it belongs to the set Z.sub.sub={Z.sub.two, Z.sub.ext}, and b is a luma reconstructed sample value, i.e., given a luma bitDepth=12, it can take any value in the range [0, 4095], needing a 12-bit variable to hold it.
[0050] In the special case where every value in Z.sub.ext can be written as +(2.sup.n+2.sup.n-1) we can write each such value as ±2.sup.n-1(2+1)=+2.sup.n-1*3. Hence the value a is either a pure power-of-two or a pure power-of-two multiplied by three. This can be written as:
a=±(k.sub.1*2+k.sub.0*1)*2.sup.s (Eqn 5)
[0051] where k.sub.0 and k.sub.1 can take the values of 0 or 1. In the case when we have a pure power-of-two, such as 128, we set k.sub.1=1, k.sub.0=0 and s to a suitable shift value, 6 in the case of 128. (Since k.sub.1=1 we multiply by two, hence we should use 6 to represent 128.) In the case when we have a power-of-two number multiplied by three, such as 96, we set both k.sub.1 and k.sub.0 to 1, and use a suitable shift value, such as 5 in the case of 96. Table 2 shows possible values for k.sub.1, k.sub.0 and s for the values in S. It also shows the value n, which indicates if the value should be negated.
TABLE-US-00002 TABLE 2 How to write the allowed coefficients on the form (−1).sup.n(2k.sub.1 + k.sub.0)2.sup.s coefficient k.sub.1 k.sub.0 s n −128 1 0 6 1 −96 1 1 5 1 −64 1 0 5 1 −48 1 1 4 1 −32 1 0 4 1 −24 1 1 3 1 −16 1 0 3 1 −12 1 1 2 1 −8 1 0 2 1 −6 1 1 1 1 −4 1 0 1 1 −3 1 1 0 1 −2 1 0 0 1 −1 0 1 0 1 0 0 0 0 0 1 0 1 0 0 2 1 0 0 0 3 1 1 0 0 4 1 0 1 0 6 1 1 1 0 8 1 0 2 0 12 1 1 2 0 16 1 0 3 0 24 1 1 3 0 32 1 0 4 0 48 1 1 4 0 64 1 0 5 0 96 1 1 5 0 128 1 0 6 0
[0052] The decoder can use Table 2 to determine the values of k.sub.1, k.sub.0, s and n from the coefficient. An alternative is to use the following pseudo code for a coefficient coeff:
[0053] k1=(abs(coeff)<2?0:1);
[0054] k0=coeff & 1;
[0055] s=max(0, 6−clz(abs(coeff)));
[0056] n=sign(coeff).
[0057] Here abs(x) denotes absolute value of x, & denotes bitwise AND, max(a,b) returns the largest value of a and b, clz(x) counts the leading number of zeros in x, so the 8-bit number 0001111 will return 3, and sign(x) returns the sign of x. clz( ) is a common assembly instruction on most CPUs so it is inexpensive.
[0058] Note that this conversion only needs to happen when the coefficients are read from the APS, which is once per frame. Hence it is not critical that this conversion from coefficient to values is extremely fast or efficient. If, on the other hand, this conversion would have to happen every sample, it would be very important that it could be done quickly.
[0059] Once they have been converted, a hardware implementation can store them for later use during the filtering. Since of k.sub.1, k.sub.0, and n are 1-bit values, and s is a 3-bit value, the total number of bits that needs to be stored is 6 bits.
[0060] a can be written in the form of: a=(−1).sup.n (2k.sub.1+k.sub.0) 2.sup.S, hence one can rewrite the multiplication a*b as:
[0061] To evaluate the bottom-most expression, we can start by multiplying b by k.sub.1. Since k.sub.1 is either 0 or 1 this is the same as doing AND between every bit in b and k.sub.1. After this, we will shift it one step left. Likewise, we will do AND between b and k.sub.0. We add these two results together, negate it if necessary and shift it 0 to 6 steps. Since the multiplications can be replaced by ANDs, Equation 6 can be written as:
a*b=(−1).sup.n(((b &.sub.bk.sub.1)<<1)+b &.sub.bk.sub.0)2.sup.s, (Eqn 6b)
where x &.sub.b y is used to denote that every bit in x is ANDed with the one-bit value y. Equation 6b can be efficiently implemented by the circuit shown in
[0062]
[0063] As can be seen in
[0064] The output of the top left unit is shifted one bit, and a zero is inserted in the least significant bit position. This means that the resulting value is 13 bits.
[0065] In a similar manner, the value b is bit-wise AND:ed with k.sub.0 in the bottom-left unit marked “bit-wise &”. The output is not shifted, instead the sign bit is extended so that the result is also 13 bits. This is indicated by the wiring diagram between the lower “bit-wise &” unit and the adder. As can be seen in
[0066] The input bits are copied to the output, and the most significant bit inti is copied to the two most significant bits in the output out.sub.12 and out.sub.11.
[0067] These 13-bit values are then added together using a 13-bit adder. The output is 14 bits, since one bit may carry. This result is then input to the unit marked “conditional negate”, which implements the multiplication of (−1).sup.n.
[0068] As is well-known for a person skilled in the art, it is possible to negate a value by inverting all the bits and adding 1. This should only be done in the case when n=1. By using an XOR gate, each input bit is inverted in the case when n=1, and left untouched when n=0. The result is then fed to an adder, where the other input is zero, and where the carry-in is set to n. This means that it will leave the value untouched if n=0, but if n=1 it will add 1. The result is a 14-bit value which is negated in relation to the input if n=1 and left untouched otherwise.
[0069] Finally, the right-most box in
[0070] The barrel-shifter in
[0071]
[0072] The two most expensive operations are the 13-bit adder and the barrel shift. Assuming that the barrel-shifter is approximately as complex as the adder, the cost of implementation is down to approximately two 13-bit adders.
2. Hardware Complexity Assert for a Coefficient Value is Power-of-Two Multiples of 0, 1, 3 and 5:
[0073] In some circumstances it may be limiting to constrain the coefficients to only be of the form ±{0, 1, 3}×2.sup.n. Most coefficients are close to zero, which means that it is most important to be able to represent coefficients close to zero, such as {0, ±1, ±2, ±3, ±4, ±5, ±6, ±7, ±8, ±9, ±10}. Out of these only {0, ±1, ±2, ±3, ±4, ±6, ±8} are possible to represent on the form ±{0, 1, 3}×2.sup.n. However, if we also allow 5×2.sup.n, we can also represent ±5 and ±10. As it turns out, it is not much more expensive to create hardware that allows for ±{0, 1, 3, 5}×2.sup.n than it is to create hardware that allows for ±{0, 1, 3}×2.sup.n. The reason for this is that, just as for the factor 3, multiplying a number by 5 can also be implemented using a single addition and shifts, since 5x=4x+x=(x<<2)+x.
[0074] In general, one can modify Equation 6b so that we will be able to incorporate also a multiplication a*b when a=5:
a*b=(−1)n(((b &.sub.bk.sub.1)<<s.sub.0)+b &.sub.bk.sub.0)2.sup.s.sup.
[0075] The difference compared to Equation 6 is that, instead of always shifting 1 step, we now shift 1 or 2 steps, controlled by the variable s.sub.0. Another change compared to Equation 5 is that the variable s has changed name to s.sub.1.
[0076] When comparing the diagram in
[0077] The other difference against
TABLE-US-00003 TABLE 3 How to write the allowed coefficients on the form (−1).sup.n(2(k.sub.1 << s.sub.0) + k.sub.0)2.sup.s.sup.
[0078] In one embodiment, we extend the CC-ALF coefficients, so that they can be written as either ±2.sup.n or ±(2.sup.n+2.sup.n-1) or ±(2.sup.n+2.sup.n−2).
[0079] Given the values ranges between −128 and 128, one example of the Z.sub.ext set in this embodiment is {−96, −80, −48, −40, −24, −20, −12, −10, −6, −5, −3, 3, 5, 6, 10, 12, 20, 24, 40, 48, 80, 96}. Here, Z.sub.two 12 8 {−128, −64, −32, −16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16, 32, 64, 128}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−128, −96, −80, −64, −48, −40, −32, −24, −20, −16, −12, −10, −8, −6, −5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64, 80, 96, 128}.
[0080] Given the values ranges between −64 and 64, one example of the Z.sub.ext set in this embodiment is {−48, −40, −24, −20, −12, −10, −6, −5, −3, 3, 5, 6, 10, 12, 20, 24, 40, 48}. Here, Z.sub.two.sup.64={−64, −32, −16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16, 32, 64}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−64, −48, −40, −32, −24, −20, −16, −12, −10, −8, −6, −5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32, 40, 48, 64}.
[0081] Given the values ranges between −32 and 32, one example of the Z.sub.ext set in this embodiment is {−24, −20, −12, −10, −6, −5, −3, 3, 5, 6, 10, 12, 20, 24}. Here, Z.sub.two.sup.32={−32, −16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16, 32}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−32, −24, −20, −16, −12, −10, −8, −6, −5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32}.
[0082] Given the values ranges between −16 and 16, one example of the Z.sub.ext set in this embodiment is {−12, −10, −6, −5, −3, 3, 5, 6, 10, 12}. Here, Z.sub.two.sup.16={−16, −8, −4, −2, −1, 0, 1, 2, 4, 8, 16}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−16, −12, −10, −8, −6, −5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16}.
[0083] Given the values ranges between −8 and 8, one example of the Z.sub.ext set in this embodiment is {−6, −5, −3, 3, 5, 6}. Here, Z.sub.two.sup.8={−8, −4, −2, −1, 0, 1, 2, 4, 8}. The set Z.sub.sub from which one should select filter coefficients then becomes Z.sub.sub={−8, −6, −5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, 6, 8}.
3. Software Implementations
[0084] The above description gives a detailed account for how to lower the implementation cost in hardware. In certain software architectures, it may also be faster to implement the multiplication a*b if it is known that a belongs to the set S. However, in other software architectures, a multiplication may not be so much more expensive than addition and shift in terms of speed. On such architectures it may not be possible to gain an advantage by using the current method. However, it is always possible to just implement it using a multiplication. Hence it can at least be said that regardless of the software architecture, the proposed extensions are never worse than the one currently in the VVC draft or the one in CE test.
4. Improving the Derivation of the Residual Correction ΔI.SUB.i.(x,y)
[0085] In the current CC-ALF anchor, the CC-ALF coefficient C.sub.L2 is derived in the encoder 502 by: C.sub.L2=(−1)*(C.sub.L0+C.sub.L1+C.sub.L3+C.sub.L4+C.sub.L5+C.sub.L6+C.sub.L7), and it is then clipped to a value range between [−32, 31], inclusive.
[0086] This may give a filtering error since the sum of all 8 CC-ALF coefficients C.sub.L_sum=Σ.sub.i=0.sup.7C.sub.L (i) may not equal to 0 due to the clip.
[0087] Let's assume that in one local area (in one CTU for example) in the current picture, the luma reconstructed samples which are used in the CC-ALF filtering are very flat, one extreme example is that all luma reconstructed sample have the same sample value R.sub.L_const. According to equation 4, the residual correction is then derived as:
[0088] If the C.sub.L_sum=0, I.sub.i(x,y)=0, in this case, it will not do any correction to the current chroma sample.
[0089] Otherwise, due to the clip of C.sub.L2 to be equal to −32 or 31, I.sub.i(x,y)≠0, in this case, it will change the average chroma sample values in the local area in the current picture, which is a strong artifact that reduce the subjective quality of a decoded picture. What is worse is that this average value cannot be compensated for, since the chroma residual (which can contain an average value correction) happens before the CC-ALF processing. Therefore, it is likely going to cause a lasting artifact in the chroma channel. If such a design is used it would be desirable for the encoder to avoid this situation by checking for it and then changing some of the other coefficient values so that C.sub.L_sum becomes zero. This is the same thing as making sure that the value C.sub.L2=(−1)*(C.sub.L0+C.sub.L1+C.sub.L2+C.sub.L3+C.sub.L4+C.sub.L5+C.sub.L6+C.sub.L7) stays within the allowed range [−32, 32]. However, that is extra work for the encoder.
[0090] In one embodiment, the derivation of the residual correction I.sub.i(x,y) is improved as follows:
[0091] This can be written using difference values, or delta values as
[0092] where each delta value ΔR.sub.L(a,b) is calculated as the luma value in position (a,b) minus the luma value in the C.sub.L2 position (x.sub.L, y.sub.L). As an example, the delta value ΔR.sub.L(x.sub.L,y.sub.L+1)=(R.sub.L (x.sub.L, y.sub.L+1) R.sub.L (x.sub.L, y.sub.L).
[0093] By this improved derivation of the residual correction ΔI.sub.i(x,y), in a very flat local area where all luma reconstructed samples have the same sample value R.sub.L_const, the residual correction is guaranteed to be ΔI.sub.i(x,y)=0. The filtered chroma sample value R.sub.C.sup.F(x.sub.C,y.sub.C) is then calculated from the residual correction value ΔI.sub.i(x,y) and the unfiltered chroma sample value R.sub.C(x.sub.C, y.sub.C) using
R.sub.C.sup.F(x.sub.C,Y.sub.C)=I.sub.i(x.sub.C,Y.sub.C), (Eqn 8c)
[0094] and this filtered value is then clipped to produce the final value. Another small advantage is that the number of CC-ALF coefficients is reduced from 8 to 7 to be signaled in the bitstream. Another way to reduce the number of coefficients signaled is to use the calculation of C.sub.L2 in the same way as the anchor, i.e., C.sub.L2=clip(−32, 31, (−1)*(C.sub.L0+C.sub.L1+C.sub.L3+C.sub.L4+C.sub.L5+C.sub.L6+C.sub.L7)), but then simply avoid transmitting C.sub.L2. This decoder will have to use the formula to recover C.sub.L2. This will solve the problem of transmitting more than 7 coefficients, but it will not solve the problem of having C.sub.L_sum≠0.
[0095] In essence, the core idea in this embodiment is to obtain a first luma value R.sub.L(x.sub.L, y.sub.L) and at least two other luma values (for instance R.sub.L (x.sub.L−1,y.sub.L) and R.sub.L(x.sub.L, y.sub.L−1)). At least two delta values are obtained by subtracting the first luma value from other values, for instance ΔR.sub.L(X.sub.L−1,Y.sub.L)=(R.sub.L (X.sub.L−1,Y.sub.L)−R.sub.L (x.sub.L, Y.sub.L) and ΔR.sub.L (x.sub.L, Y.sub.L−1)=(R.sub.L (x.sub.L, Y.sub.L−1)−R.sub.L (x.sub.L, y.sub.L). A residual correction value ΔI.sub.i(x,y) is then calculated using the at least two delta values and coefficient values. Finally, a filtered chroma value R.sub.C.sup.F(x.sub.C, y.sub.C) is calculated by adding the residual correction value ΔI.sub.i(x,y) to the unfiltered chroma sample value R.sub.C(x.sub.C,y.sub.C) as R.sub.C.sup.F(x.sub.C,y.sub.C)=ΔI.sub.i(x,y)+R.sub.C(x.sub.C,y.sub.C).
5. Changing the Representation of Filter Coefficients
[0096] Several variants of the improved low complexity CC-ALF are described. This description uses the CE5−2.2 as anchor to show the BD-rate improvement. Given a dynamic range of the coefficient [min value, max value], in each of the proposed method, the CC-ALF coefficient can take any value from a set Z.sub.sub={Z.sub.two.sup.M, Z.sub.ext}, where:
[0097] Z.sub.ext is a subset of Z.sub.nopot.sup.M, where Z.sub.nopot.sup.M is defined above. As an example, Z.sub.nopot.sup.32={−31, −30, −28, −24, −20, −18, −17, −15, −14, −12, −10, −9, −7, −6, −5, −3, 3, 5, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 24, 28, 30, 31}, and an example of Z.sub.ext would be a subset thereof, for instance Z.sub.ext={−24, −12, −6, −3, 3, 6, 12, 24}.
[0098] In other words, at least one value in Z.sub.sub belongs to the set Z.sub.ext.
5.1 Dynamic Range [−8, 8], Z.SUB.ext.=[−6, −3, 3, 6], Signal 7 CC-ALF Coefficients
[0099] In this embodiment, the dynamic range is same as the CE5−2.2 to be [−8, 8]. Z.sub.sub={Z.sub.two.sup.8, Z.sub.ext}, and Z.sub.ext={−6, −3, 3, 6}. Compared to CE5−2.2 where the CC-ALF coefficient has a value that from a set {−8, −4, −2, −1, 0, 1, 2, 4, 8}, the CC-ALF coefficient extended to have a value that from a set {−8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8}. In this embodiment, a CC-ALF coefficient can be written to can be written to 0 or ±2.sup.n or ±(2.sup.n+2.sup.n-1).
[0100] In this embodiment, we use the improved derivation of the residual correction ΔI.sub.i(x,y) as described herein, therefore, 7 CC-ALF coefficients are signaled in the bitstream.
[0101] The coefficient signaling in this embodiment uses truncated binary coding for the index of the magnitude of the coefficient followed by one-bit sign coding if the coefficient magnitude value is greater than 0. Table 4 shows the binarization of the coefficient signaling in this embodiment:
TABLE-US-00004 TABLE 4 In one embodiment, the coefficients are encoded using TB coding. magnitude index index bits sign bit 0 0 00 1 1 010 0/1 2 2 011 0/1 3 3 100 0/1 4 4 101 0/1 6 5 110 0/1 8 6 111 0/1
[0102] Compared to CE5−2.2, we get the following BD-rate numbers:
TABLE-US-00005 Y U V YUV All intra 0.01% −0.65% −0.71% −0.13% Random Access 0.00% −0.47% −0.54% −0.10% Low delay B
[0103] Compared to CE anchor, we get the following BD-rate numbers:
TABLE-US-00006 Y U V YUV All intra −0.02% 0.08% −0.12% −0.02% Random Access 0.00% −0.13% −0.11% −0.02% Low delay B
5.2 Dynamic Range [−8, 8], Z.SUB.ext.=[−6, −3, 3, 6], Signal 8 CC-ALF Coefficients
[0104] In this embodiment of, the dynamic range is same as the CE5−2.2 to be [−8, 8]. Z.sub.sub={Z.sub.two.sup.8, Z.sub.ext}, and Z.sub.ext={−6, −3, 3, 6}. Compared to CE5−2.2 where the CC-ALF coefficient has a value that from a set {−8, −4, −2, −1, 0, 1, 2, 4, 8}, the CC-ALF coefficient extended to have a value that from a set Z.sub.sub={−8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8}. In this embodiment, a CC-ALF coefficient can be written to can be written to 0 or ±2.sup.n or ±(2.sup.n+2.sup.n-1).
[0105] In this embodiment, we use the same derivation process of the residual correction ΔI.sub.i(x,y) as CE5−2.2, therefore, 8 CC-ALF coefficients are signaled in the bitstream. Since we have restricted the CC-ALF coefficient to have a value that from a set, it should be noticed that there is a difference compared to the CE anchor which has 7 coefficients that are trained in the encoder side and one coefficient C.sub.L2 is derived by C.sub.L2=(−1)*(C.sub.L0+C.sub.L1+C.sub.L3+C.sub.L4+C.sub.L5+C.sub.L6+C.sub.L7) with clip to a value range between [−32, 31], inclusive. This would give a coefficient value that may not from the set Z.sub.sub. Therefore, in this embodiment, all 8 CC-ALF coefficients are trained in the encoder side to be sure that the coefficient value is from the set Z.sub.sub.
[0106] The coefficient signaling in this embodiment uses truncated binary coding for the index of the magnitude of the coefficient followed by one-bit sign coding if the coefficient magnitude value is greater than 0. Table 5 shows the binarization of the coefficient signaling in this embodiment:
TABLE-US-00007 TABLE 5 In one embodiment, the coefficients are encoded using TB coding. magnitude index index bits sign bit 0 0 00 1 1 010 0/1 2 2 011 0/1 3 3 100 0/1 4 4 101 0/1 6 5 110 0/1 8 6 111 0/1
[0107] Compared to CE5−2.2, we get the following BD-rate numbers:
TABLE-US-00008 Y U V YUV All intra 0.01% −0.31% −0.21% −0.05% Random Access Low delay B
[0108] Compared to CE anchor, we get the following BD-rate numbers:
TABLE-US-00009 Y U V YUV All intra −0.02% 0.43% 0.39% 0.06% Random Access Low delay B
5.3 Dynamic Range [−32, 32], Z.SUB.ext.=[−24, −12, −6, −3, 3, 612, 24], Signal 7 CC-ALF Coefficients
[0109] In this embodiment, the dynamic range is same as the CE anchor to be [−32, 32]. Z.sub.sub={Z.sub.two.sup.32, Z.sub.ext}, and Z.sub.ext={−24, −12, −6, −3, 3, 6, 12, 24}. Compared to CE5−2.2 where the CC-ALF coefficient has a value that from a set {−8, −4, −2, −1, 0, 1, 2, 4, 8}, the CC-ALF coefficient extended to have a value that from a set {−32, −24, −16, −12, −8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32}. In this embodiment, a CC-ALF coefficient can be written to can be written to 0 or ±2.sup.n or ±(2.sup.n±2.sup.n-1).
[0110] In this embodiment, we use the improved derivation of the residual correction ΔI.sub.i(x,y) as described in 5.2, therefore, 7 CC-ALF coefficients are signaled in the bitstream.
[0111] The coefficient signaling in this embodiment uses truncated binary coding for the index of the magnitude of the coefficient followed by one-bit sign coding if the coefficient magnitude value is greater than 0. Table 6 shows the binarization of the coefficient signaling in this embodiment:
TABLE-US-00010 TABLE 6 In one embodiment, the coefficients are encoded using TB coding. magnitude index index bits sign bit 0 0 000 1 1 001 0/1 2 2 010 0/1 3 3 011 0/1 4 4 100 0/1 6 5 1010 0/1 8 6 1011 0/1 12 7 1100 0/1 16 8 1101 0/1 24 9 1110 0/1 32 10 1111 0/1
[0112] Compared to CE5−2.2 we get the following BD-rate numbers:
TABLE-US-00011 Y U V YUV All intra 0.01% −0.83% −0.87% −0.16% Random Access −0.01% −0.63% −0.75% −0.15% Low delay B
[0113] Compared to CE anchor, we get the following BD-rate numbers:
TABLE-US-00012 Y U V YUV All intra −0.02% −0.09% −0.28% −0.05% Random Access −0.01% −0.29% −0.32% −0.07% Low delay B
5.4 Dynamic Range [−32, 32], Z.SUB.ext.={−24, −20, −12, −10, −6, −5, −3, 3, 5, 6, 10, 12, 20, 24}, Signal 7 CC-ALF Coefficients
[0114] In this embodiment of, the dynamic range is same as the CE anchor to be [−32, 32]. Z.sub.sub={Z.sub.two.sup.32, Z.sub.ext}, and Z.sub.ext={−24, −12, −10, −6, −5, −3, 3, 5, 6, 10, 12, 24}. Compared to CE5−2.2 where the CC-ALF coefficient has a value that from a set {−8, −4, −2, −1, 0, 1, 2, 4, 8}, the CC−ALF coefficient extended to have a value that from a set {−32, −24, −20, −16, −12, −10, −8, −6, −5, −4, −3, −2, −1, 0, 1, 2, 3, 4, 5, 6, 8, 10, 12, 16, 20, 24, 32}. In this embodiment, a CC−ALF coefficient can be written to can be written to 0 or ±2.sup.n or ±(2.sup.n+2.sup.n-1−) or ±(2.sup.n+2.sup.n-2).
[0115] In this embodiment, we use the improved derivation of the residual correction ΔI.sub.i(x,y) as described in 5.2, therefore, 7 CC-ALF coefficients are signaled in the bitstream.
[0116] The coefficient signaling in this embodiment uses truncated binary coding for the index of the magnitude of the coefficient followed by one-bit sign coding if the coefficient magnitude value is greater than 0. Table 7 shows the binarization of the coefficient signaling in this embodiment:
TABLE-US-00013 TABLE 7 In one embodiment, the coefficients are encoded using TB coding. magnitude index index bits sign bit 0 0 000 1 1 001 0/1 2 2 0100 0/1 3 3 0101 0/1 4 4 0110 0/1 5 5 0111 0/1 6 6 1000 0/1 8 7 1001 0/1 10 8 1010 0/1 12 9 1011 0/1 16 10 1100 0/1 20 11 1101 0/1 24 12 1110 0/1 32 13 1111 0/1
[0117] Compared to CE5−2.2 we get the following BD-rate numbers:
TABLE-US-00014 Y U V YUV All intra 0.01% −0.85% −0.85% −0.16% Random Access −0.01% −0.63% −0.75% −0.15% Low delay B
[0118] Compared to CE anchor, we get the following BD-rate numbers:
TABLE-US-00015 Y U V YUV All intra −0.02% −0.11% −0.26% −0.05% Random Access −0.01% −0.29% −0.32% −0.07% Low delay B
5.5 Using Signed Truncated Coding for the Coefficients
[0119] In some embodiments, it is possible to use signed truncated coding for the coefficients signaling. Table 8 shows an example of how the CC-ALF coefficients may be coded:
TABLE-US-00016 TABLE 8 Example of using signed truncated coding for the coefficients. coefficient index bit representation 0 0 000 −1 1 001 1 2 010 −2 3 0110 2 4 0111 −3 5 1000 3 6 1001 −4 7 1010 4 8 1011 −6 9 1100 6 10 1101 −8 11 1110 8 12 1111
[0120] The coefficients could be recovered using the following pseudo-code:
TABLE-US-00017 char magtab[7] = { 0, 1, 2, 3, 4, 6, 8 }; xReadTruncBinCode(index, 13); // read index sign = (−1) * (index & 1); magnitude = (index+1) >> 1; coefficient = sign*magtab[magnitude].
5.6 Using Fix Length Coding for the Coefficients
[0121] In some embodiments it is possible to use fix length coding for the index of the magnitude of the coefficient followed by one-bit sign. Table 9 shows an example of how the CC-ALF coefficients in one embodiment may be coded:
TABLE-US-00018 TABLE 9 Example of using fix length coding for the coefficients. magnitude index index bits sign bit 0 0 000 1 1 001 0/1 2 2 010 0/1 3 3 011 0/1 4 4 100 0/1 6 5 101 0/1 8 6 110 0/1
[0122] It is noticed that one bit increases for coding the index 0. However, the fix length coding may be more efficient than truncated binary coding in term of parsing/decoding bitstream.
[0123] Another example to use all the capacity of 3-bits fix length coding for the index of the magnitude of the coefficient. Instead of setting the dynamic range to be [−8, 8], we set the CC-ALF coefficient dynamic range to be [−12, 12]. Therefore, the CC-ALF coefficient extended to have a value that from a set {−12, −8, −6, −4, −3, −2, −1, 0, 1, 2, 3, 4, 6, 8, 12}. Table 10 shows an example of how the CC-ALF coefficient may be coded:
TABLE-US-00019 TABLE 10 Example of using all capacity of 3-bits fix length coding for the coefficients magnitude index index bits sign bit 0 0 000 1 1 001 0/1 2 2 010 0/1 3 3 011 0/1 4 4 100 0/1 6 5 101 0/1 8 6 110 0/1 12 7 111 0/1
[0124]
[0125] Step s1602 comprises obtaining a set of sample values associated with the image.
[0126] Step s1604 comprises employing a cross-component adaptive loop filter (CC-ALF) to produce a first residual correction using the set of sample values and a first set of N coefficient values, wherein the CC-ALF is operable to produce the first residual correction using the set of sample values and any set of N coefficient values in which each one of the N coefficient values is included in a set of M unique coefficient values, wherein N is greater than 1 and M is greater than 1 and further wherein i) the set of M unique coefficient values consists of the following unique values or consists of a subset of the following unique values: +/−0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 24, 28, 30, 31, 32, 33, 34, 36, 40, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, 127, or 128 (i.e., Z+128) and ii) the set of M unique coefficient values includes at least one of the following values: +/−3, 5, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 24, 28, 30, 31, 33, 34, 36, 40, 48, 56, 60, 62, 63, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, or 127.
[0127] Employing the CC-ALF to produce the first residual correcting comprises the steps of: a) obtaining the first set of N coefficient values and b) using the CC-ALF to calculate the first residual correction using the obtained first set of N coefficient values and the set of sample values, thereby producing the first residual correction. Each coefficient value included in the obtained first set of N coefficient values is constrained such that the coefficient value must be equal to one of the values included in the set of M unique values.
[0128]
[0129] Step s1702 comprises obtaining a set of sample values associated with the image.
[0130] Step s1704 comprises obtaining an index value that points to a particular coefficient value group included within a set of M predefined coefficient value groups (e.g., M=64), wherein each coefficient value group included in the set of predefined coefficient value groups consists of N coefficient values, N being greater than 1, and further wherein: i) for each coefficient value group included in the set of predefined coefficient value groups, each coefficient value included in the coefficient group is constrained such that the coefficient value must be equal to one of the following values: +/−0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 24, 28, 30, 31, 32, 33, 34, 36, 40, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, 127, or 128 and ii) for at least one coefficient value group included in the set of predefined coefficient value groups, at least one of the coefficient values included in said at least one coefficient value group is equal to one of the following values: +/−3, 5, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 24, 28, 30, 31, 33, 34, 36, 40, 48, 56, 60, 62, 63, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, or 127.
[0131] Step s1706 comprises using the index value to select the particular coefficient value group from the set of predefined coefficient value groups.
[0132] Step s1708 comprises employing a cross-component adaptive loop filter (CC-ALF) to calculate a residual correction using i) the particular coefficient value group selected from the set of predefined coefficient value groups and ii) the set of sample values.
[0133]
[0134] In some embodiments, filtering the unfiltered chroma value to produce the filtered chroma value consists of calculating: R.sub.C.sup.F=ΔI1+R.sub.C.
[0135] In some embodiments, the set of other products comprises a second product, P2, P2=(C2)(ΔL2), C2 is a second coefficient value, ΔL2 is a second luma delta value that is equal to L3−L1, and L3 is a third luma sample value associated with the image.
[0136] In some embodiments, L1 has a first position within a two-dimensional block of luma sample values associated with the image, wherein the coordinates of the first position are x1,y1, L2 has a second position within the two-dimensional block of luma sample values, wherein the coordinates of the second position are x2,y2, the absolute value of (x1-x2) is less than or equal to 4, and the absolute value of (y1-y2) is less than or equal to 4.
[0137] In some embodiments, the absolute value of (x1-x2) is less than or equal to 2, and the absolute value of (y1-y2) is less than or equal to 2.
[0138] In some embodiments, R.sub.C has a position within a two-dimensional block of chroma sample values associated with the image, where the coordinates of the position are xc,yc; L1 has a first position within a two-dimensional block of luma sample values associated with the image, wherein the coordinates of the first position are x1,y1; L2 has a second position within the two-dimensional block of luma sample values, wherein the coordinates of the second position are x2,y2; and the second position is obtained from the position of R.sub.C within the two-dimensional block of chroma sample values.
[0139] In some embodiments, x2=(Wc)(xc); y2=(Hc)(yc); Wc is a first predetermined coefficient that is based on the format of the image; and Hc is a second predetermined coefficient that is based on the format of the image.
[0140] In some embodiments, when the format of the image is 4:2:0, Wc=Hc=2; when the format of the image is 4:2:2, Wc=2 and Hc=1; and when the format of the image is 4:4:4, Wc=Hc=1.
[0141]
[0142] Step s2002 comprises the encoder selecting a set of coefficient values for use by the CC-ALF of decoder 504 in producing a residual correction value for use in filtering a chroma sample value, the selected set of coefficient values consisting of N coefficient values. Each one of the N coefficient values is included in a set of M unique coefficient values, wherein N is greater than 1 and M is greater than 1 and further wherein i) the set of M unique coefficient values consists of the following unique values or consists of a subset of the following unique values: +/−0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 20, 24, 28, 30, 31, 32, 33, 34, 36, 40, 48, 56, 60, 62, 63, 64, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, 127, or 128 (i.e., Z+128) and ii) the set of M unique coefficient values includes at least one of the following values: +/−3, 5, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 24, 28, 30, 31, 33, 34, 36, 40, 48, 56, 60, 62, 63, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, or 127, and each coefficient value included in the set of N coefficient values is constrained such that the coefficient value must be equal to one of the values included in the set of M unique values.
[0143] Step s2004 comprises the encoder providing to decoder 504 the N coefficient values or an index value for use by the decode to determine the set of N coefficient values.
[0144]
REFERENCES
[0145] [1] Misra, et al., “Cross-Component Adaptive Loop Filter for chroma,” JVET-00636 r1, July 2019 (available at URL=phenix.it-sudparis.eu/jvet/doc end user/documents/15_Gothenburg/wg11/JVET-00636-v2.zip) [0146] [2] Chen, “Description of Core Experiment 5 (CE5): Cross-component adaptive loop filtering,” JVET-P2025-v4, October 2019 (available at URL=phenix.it-sudparis.eu/jvet/doc_end_user/documents/16_Geneva/wg11/JVET-P2025-v4.zip)
Annex A
Proposed Changes to VVC Draft Text
[0147] The section below illustrates example proposed changes to the current CC-ALF modified VVC draft text (ref CCALF-Text-NET-P1008-v2-over-NET-02001-vE) for the improved low complexity CC-ALF process for one embodiment.
**Start changes**
7.2 Specification of Syntax Functions and Descriptors
[0148] The functions presented here are used in the syntactical description. These functions are expressed in terms of the value of a bitstream pointer that indicates the position of the next bit to be read by the decoding process from the bitstream.
[0149] byte_aligned( ) is specified as follows: [0150] If the current position in the bitstream is on a byte boundary, i.e., the next bit in the bitstream is the first bit in a byte, the return value of byte_aligned( ) is equal to TRUE. [0151] Otherwise, the return value of byte_aligned( ) is equal to FALSE.
[0152] more_data_in_byte_stream( ) which is used only in the byte stream NAL unit syntax structure specified in Annex B, is specified as follows: [0153] If more data follow in the byte stream, the return value of more_data_in_byte_stream( ) is equal to TRUE. [0154] Otherwise, the return value of more_data_in_byte_stream( ) is equal to FALSE. more_data_in_payload( ) is specified as follows: [0155] If byte_aligned( ) is equal to TRUE and the current position in the sei_payload( ) syntax structure is 8* payloadSize bits from the beginning of the sei_payload( )) syntax structure, the return value of more_data_in_payload( ) is equal to FALSE. [0156] Otherwise, the return value of more_data_in_payload( ) is equal to TRUE. more_rbsp_data( ) is specified as follows: [0157] If there is no more data in the raw byte sequence payload (RBSP), the return value of more_rbsp_data( ) is equal to FALSE. [0158] Otherwise, the RBSP data are searched for the last (least significant, right-most) bit equal to 1 that is present in the RBSP. Given the position of this bit, which is the first bit (rbsp_stop_one_bit) of the rbsp_trailing_bits( ) syntax structure, the following applies: [0159] If there is more data in an RBSP before the rbsp_trailing_bits( ) syntax structure, the return value of more_rbsp_data( ) is equal to TRUE. [0160] Otherwise, the return value of more_rbsp_data( ) is equal to FALSE.
[0161] The method for enabling determination of whether there is more data in the RBSP is specified by the application (or in Annex B for applications that use the byte stream format).
[0162] more_rbsp_trailing_data( ) is specified as follows: [0163] If there is more data in an RBSP, the return value of more_rbsp_trailing_data( ) is equal to TRUE. [0164] Otherwise, the return value of more_rbsp_trailing_data( ) is equal to FALSE.
[0165] next_bits(n) provides the next bits in the bitstream for comparison purposes, without advancing the bitstream pointer. Provides a look at the next n bits in the bitstream with n being its argument. When used within the byte stream format as specified in Annex B and fewer than n bits remain within the byte stream, next_bits(n) returns a value of 0.
[0166] payload_extension_presenft) is specified as follows: [0167] If the current position in the sei_payload( ) syntax structure is not the position of the last (least significant, right-most) bit that is equal to 1 that is less than 8* payloadSize bits from the beginning of the syntax structure (i.e., the position of the payload_bit_equal_to_one syntax element), the return value of payload_extension_present( ) is equal to TRUE. [0168] Otherwise, the return value of payload_extension_present( ) is equal to FALSE.
[0169] read_bits(n) reads the next n bits from the bitstream and advances the bitstream pointer by n bit positions. When n is equal to 0, read_bits(n) is specified to return a value equal to 0 and to not advance the bitstream pointer.
[0170] The following descriptors specify the parsing process of each syntax element: [0171] ae(v): context-adaptive arithmetic entropy-coded syntax element. The parsing process for this descriptor is specified in clause 9.3. [0172] b(8): byte having any pattern of bit string (8 bits). The parsing process for this descriptor is specified by the return value of the function read_bits(8). [0173] f(n): fixed-pattern bit string using n bits written (from left to right) with the left bit first. The parsing process for this descriptor is specified by the return value of the function read_bits(n). [0174] i(n): signed integer using n bits. When n is “v” in the syntax table, the number of bits varies in a manner dependent on the value of other syntax elements. The parsing process for this descriptor is specified by the return value of the function read_bits(n) interpreted as a two's complement integer representation with most significant bit written first. [0175] se(v): signed integer 0-th order Exp-Golomb-coded syntax element with the left bit first. The parsing process for this descriptor is specified in clause 9.2 with the order k equal to 0. [0176] u(n): unsigned integer using n bits. When n is “v” in the syntax table, the number of bits varies in a manner dependent on the value of other syntax elements. The parsing process for this descriptor is specified by the return value of the function read bits(n) interpreted as a binary representation of an unsigned integer with most significant bit written first. [0177] ue(v): unsigned integer 0-th order Exp-Golomb-coded syntax element with the left bit first. The parsing process for this descriptor is specified in clause 9.2 with the order k equal to 0. [0178] uek(v): unsigned integer k-th order Exp-Golomb-coded syntax element with the left bit first. The parsing process for this descriptor is specified in clause 9.2 with the order k defined in the semantics of the syntax element. [0179] tb(v): truncated binary using up to maxVal bits with maxVal defined in the semantics of the symtax element. The parsing process for this descriptor is specified in clause 0.
7.3.2.14 Adaptive Loop Filter Data Syntax
[0180]
TABLE-US-00020 De- scrip- tor alf_data( ) { alf_luma_filter_signal_flag u(1) alf_chroma_filter_signal_flag u(1) alf_cross_component_cb_filter_signal_flag u(1) alf_cross_component_cr_filter_signal_flag u(1) if( alf_luma_filter_signal_flag ) { alf_luma_clip_flag u(1) alf_luma_num_filters_signalled_minus1 ue(v) if( alf_luma_num_filters_signalled_minus1 > 0 ) { for( filtIdx = 0; filtIdx < NumAlfFilters; filtIdx++ ) alf_luma_coeff_delta_idx[ filtIdx ] u(v) } alf_luma_coeff_signalled_flag u(1) if( alf_luma_coeff_signalled_flag ) { for( sfIdx = 0; sfIdx <= alf_luma_num_filters_signalled_minus1; sfIdx++ ) alf_luma_coeff_flag[ sfIdx ] u(1) } for( sfIdx = 0; sfIdx <= alf_luma_num_filters_signalled_minus1; sfIdx++ ) { if( alf_luma_coeff_flag[ sfIdx ] ) { for ( j = 0; j < 12; j++ ) { alf_luma_coeff_abs[ sfIdx ][ j ] uek(v) if( alf_luma_coeff_abs[ sfIdx ][ j ] ) alf_luma_coeff_sign[ sfIdx ][ j ] u(1) } } } if( alf_luma_clip_flag ) { for( sfIdx = 0; sfIdx <= alf_luma_num_filters_signalled_minus1; sfIdx++ ) { if( alf_luma_coeff_flag[ sfIdx ] ) { for ( j = 0; j < 12; j++ ) alf_luma_clip_idx[ sfIdx ][ j ] u(2) } } } } if( alf_chroma_filter_signal_flag ) { alf_chroma_num_alt_filters_minus1 ue(v) for( altIdx = 0; altIdx <= alf_chroma_num_alt_filters_minus1; altIdx++ ) { alf_chroma_clip_flag[ altIdx ] u(1) for( j = 0; j < 6; j++ ) { alf_chroma_coeff_abs[ altIdx ][ j ] uek(v) if( alf_chroma_coeff_abs[ altIdx ][ j ] > 0 ) alf_chroma_coeff_sign[ altIdx ][ j ] u(1) } if( alf_chroma_clip_flag[ altIdx ] ) { for( j = 0; j < 6; j++ ) alf_chroma_clip_idx[ altIdx ][ j ] u(2) } } } if ( alf_cross_component_cb_filter_signal_flag ) { alf_cross_component_cb_filters_signalled_minus1 ue(v) for( k = 0; k < (alf_cross_component_cb_filters_signalled_minus1+1); k++ ) { for ( j = 0; j < 7; j++ ) {
alf_cross_component_cb_coeff_abs_idx[ k ][ j ] tb(v) if (alf_cross_component_cb_coeff_abs_idx[ k ][ j ] >0 ) alf_cross_component_cb_coeff_sign[ k ][ j ] u(1) } } } if ( alf_cross_component_cr_filter_signal_flag ) { alf_cross_component_cr_filters_signalled_minus1 ue(v) for( k = 0; k < (alf_cross_component_cr_filters_signalled_minus1+1); k++ ) {
for ( j = 0; j < 7; j++ ) {
alf_cross_component_cr_coeff_abs_idx[ k ][ j ] tb(v) if (alf_cross_component_cr_coeff_abs_idx[ k ][ j ] > 0 ) alf_cross_component_cr_coeff_sign[ k ][ j ] u(1) } } } }
7.4.3.14 Adaptive Loop Filter Data Semantics
[0181] alf luma_filter_signal_flag equal to 1 specifies that a luma filter set is signalled. alf luma_filter_signal_flag equal to 0 specifies that a luma filter set is not signalled.
[0182] alf chroma_filter_signal_flag equal to 1 specifies that a chroma filter is signalled. alf chroma_filter_signal_flag equal to 0 specifies that a chroma filter is not signalled. When ChromaArrayType is equal to 0, alf chroma_filter_signal_flag shall be equal to 0.
[0183] The variable NumAlfFilters specifying the number of different adaptive loop filters is set equal to 25.
[0184] alf_luma_clip_flag equal to 0 specifies that linear adaptive loop filtering is applied on luma component. alf_luma_clip_flag equal to 1 specifies that non-linear adaptive loop filtering may be applied on luma component.
[0185] alf_luma_num_filters_signalled_minus1 plus 1 specifies the number of adpative loop filter classes for which luma coefficients can be signalled. The value of alf_luma_num_filters_signalled_minus1 shall be in the range of 0 to NumAlfFilters−1, inclusive.
[0186] alf_luma_coeff_delta_idx[filtIdx] specifies the indices of the signalled adaptive loop filter luma coefficient deltas for the filter class indicated by filtIdx ranging from 0 to NumAlfFilters−1. When alf_luma_coeff_delta_idx[filtIdx] is not present, it is inferred to be equal to 0. The length of alf_luma_coeff_delta_idx[filtIdx] is Ceil(Log 2(alf_luma_num_filters_signalled_minus1+1)) bits.
[0187] alf_luma_coeff_signalled_flag equal to 1 indicates that alf_luma_coeff flag[sfIdx] is signalled. alf_luma_coeff_signalled_flag equal to 0 indicates that alf_luma_coeff flag[sfIdx] is not signalled.
[0188] alf_luma_coeff_flag[sfIdx] equal 1 specifies that the coefficients of the luma filter indicated by sfIdx are signalled. alf_luma_coeff_flag[sfIdx] equal to 0 specifies that all filter coefficients of the luma filter indicated by sfIdx are set equal to 0. When not present, alf_luma_coeff_flag[sfIdx] is set equal to 1.
[0189] alf_luma_coeff_abs[sfIdx][j] specifies the absolute value of the j-th coefficient of the signalled luma filter indicated by sfIdx. When alf luma coeff_abs[sfIdx][j] is not present, it is inferred to be equal 0.
[0190] The order k of the exp-Golomb binarization uek(v) is set equal to 3.
[0191] alf_luma_coeff sign[sfIdx][j] specifies the sign of the j-th luma coefficient of the filter indicated by sfIdx as follows:
[0192] If alf_luma_coeff sign[sfIdx][j] is equal to 0, the corresponding luma filter coefficient has a positive value.
[0193] Otherwise (alf_luma_coeff sign[sfIdx][j] is equal to 1), the corresponding luma filter coefficient has a negative value.
[0194] When alf_luma_coeff_sign[sfIdx][j] is not present, it is inferred to be equal to 0.
[0195] The variable filtCoeff[sfIdx][j] with sfIdx=0 . . . alf_luma_num_filters_signalled_minus1, j=0 . . . 11 is initialized as follows:
filtCoeff[sfIdx][j]=alf_luma_coeff_abs[sfIdx][j]* (1−2*alf_luma_coeff_sign[sfIdx][j) (7-47)
[0196] The luma filter coefficients AlfCoeff.sub.L [adaptation_parameter_set_id] with elements AlfCoeff.sub.L [adaptation_parameter_set_id][filtIdx][j], with filtIdx=0 . . . NumAlffilters−1 and j=0 . . . 11 are derived as follows:
AlfCoeff.sub.L[adaptation_parameter_set_id][filtIdx][j]=filtCoeff[alf_luma_coeff_delta_idx[filtIdx]][j] (7-48)
[0197] The fixed filter coefficients AlffixFiltCoeff[i][j] with i=0.64, j=0.11 and the class to filter mapping AlfClassToFiltMap[m][n] with m=0.15 and n=0.24 are derived as follows:
TABLE-US-00021 AlfFixFiltCoeff = (7-49) { { 0, 0, 2, −3, 1, −4, 1, 7, −1, 1, −1, 5} { 0, 0, 0, 0, 0, −1, 0, 1, 0, 0, −1, 2} { 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0} { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, −1, 1} { 2, 2, −7, −3, 0, −5, 13, 22, 12, −3, −3, 17} {−1, 0, 6, −8, 1, −5, 1, 23, 0, 2, −5, 10} { 0, 0, −1, −1, 0, −1, 2, 1, 0, 0, −1, 4} { 0, 0, 3, −11, 1, 0, −1, 35, 5, 2, −9, 9} { 0, 0, 8, −8, −2, −7, 4, 4, 2, 1, −1, 25} { 0, 0, 1, −1, 0, −3, 1, 3, −1, 1, −1, 3} { 0, 0, 3, −3, 0, −6, 5, −1, 2, 1, −4, 21} {−7, 1, 5, 4, −3, 5, 11, 13, 12, −8, 11, 12} {−5, −3, 6, −2, −3, 8, 14, 15, 2, −7, 11, 16} { 2, −1, −6, −5, −2, −2, 20, 14, −4, 0, −3, 25} { 3, 1, −8, −4, 0, −8, 22, 5, −3, 2, −10, 29} { 2, 1, −7, −1, 2, −11, 23, −5, 0, 2, −10, 29} {−6, −3, 8, 9, −4, 8, 9, 7, 14, −2, 8, 9} { 2, 1, −4, −7, 0, −8, 17, 22, 1, −1, −4, 23} { 3, 0, −5, −7, 0, −7, 15, 18, −5, 0, −5, 27} { 2, 0, 0, −7, 1, −10, 13, 13, −4, 2, −7, 24} { 3, 3, −13, 4, −2, −5, 9, 21, 25, −2, −3, 12} {−5, −2, 7, −3, −7, 9, 8, 9, 16, −2, 15, 12} { 0, −1, 0, −7, −5, 4, 11, 11, 8, −6, 12, 21} { 3, −2, −3, −8, −4, −1, 16, 15, −2, −3, 3, 26} { 2, 1, −5, −4, −1, −8, 16, 4, −2, 1, −7, 33} { 2, 1, −4, −2, 1, −10, 17, −2, 0, 2, −11, 33} { 1, −2, 7, −15, −16, 10, 8, 8, 20, 11, 14, 11} { 2, 2, 3, −13, −13, 4, 8, 12, 2, −3, 16, 24} { 1, 4, 0, −7, −8, −4, 9, 9, −2, −2, 8, 29} { 1, 1, 2, −4, −1, −6, 6, 3, −1, −1, −3, 30} {−7, 3, 2, 10, −2, 3, 7, 11, 19, −7, 8, 10} { 0, −2, −5, −3, −2, 4, 20, 15, −1, −3, −1, 22} { 3, −1, −8, −4, −1, −4, 22, 8, −4, 2, −8, 28} { 0, 3, −14, 3, 0, 1, 19, 17, 8, −3, −7, 20} { 0, 2, −1, −8, 3, −6, 5, 21, 1, 1, −9, 13} {−4, −2, 8, 20, −2, 2, 3, 5, 21, 4, 6, 1} { 2, −2, −3, −9, −4, 2, 14, 16, 3, −6, 8, 24} { 2, 1, 5, −16, −7, 2, 3, 11, 15, −3, 11, 22} { 1, 2, 3, −11, −2, −5, 4, 8, 9, −3, −2, 26} { 0, −1, 10, −9, −1, −8, 2, 3, 4, 0, 0, 29} { 1, 2, 0, −5, 1, −9, 9, 3, 0, 1, −7, 20} {−2, 8, −6, −4, 3, −9, −8, 45, 14, 2, −13, 7} { 1, −1, 16, −19, −8, −4, −3, 2, 19, 0, 4, 30} { 1, 1, −3, 0, 2, −11, 15, −5, 1, 2, −9, 24} { 0, 1, −2, 0, 1, −4, 4, 0, 0, 1, −4, 7} { 0, 1, 2, −5, 1, −6, 4, 10, −2, 1, −4, 10} { 3, 0, −3, −6, −2, −6, 14, 8, −1, −1, −3, 31} { 0, 1, 0, −2, 1, −6, 5, 1, 0, 1, −5, 13} { 3, 1, 9, −19, −21, 9, 7, 6, 13, 5, 15, 21} { 2, 4, 3, −12, −13, 1, 7, 8, 3, 0, 12, 26} { 3, 1, −8, −2, 0, −6, 18, 2, −2, 3, −10, 23} { 1, 1, −4, −1, 1, −5, 8, 1, −1, 2, −5, 10} { 0, 1, −1, 0, 0, −2, 2, 0, 0, 1, −2, 3} { 1, 1, −2, −7, 1, −7, 14, 18, 0, 0, −7, 21} { 0, 1, 0, −2, 0, −7, 8, 1, −2, 0, −3, 24} { 0, 1, 1, −2, 2, −10, 10, 0, −2, 1, −7, 23} { 0, 2, 2, −11, 2, −4, −3, 39, 7, 1, −10, 9} { 1, 0, 13, −16, −5, −6, −1, 8, 6, 0, 6, 29} { 1, 3, 1, −6, −4, −7, 9, 6, −3, −2, 3, 33} { 4, 0, −17, −1, −1, 5, 26, 8, −2, 3, −15, 30} { 0, 1, −2, 0, 2, −8, 12, −6, 1, 1, −6, 16} { 0, 0, 0, −1, 1, −4, 4, 0, 0, 0, −3, 11} { 0, 1, 2, −8, 2, −6, 5, 15, 0, 2, −7, 9} { 1, −1, 12, −15, −7, −2, 3, 6, 6, −1, 7, 30} }, AlfClassToFiltMap = (7-50) { { 8, 2, 2, 2, 3, 4, 53, 9, 9, 52, 4, 4, 5, 9, 2, 8, 10, 9, 1, 3, 39, 39, 10, 9, 52 } { 11, 12, 13, 14, 15, 30, 11, 17, 18, 19, 16, 20, 20, 4, 53, 21, 22, 23, 14, 25, 26, 26, 27, 28, 10 } { 16, 12, 31, 32, 14, 16, 30, 33, 53, 34, 35, 16, 20, 4, 7, 16, 21, 36, 18, 19, 21, 26, 37, 38, 39 } { 35, 11, 13, 14, 43, 35, 16, 4, 34, 62, 35, 35, 30, 56, 7, 35, 21, 38, 24, 40, 16, 21, 48, 57, 39 } { 11, 31, 32, 43, 44, 16, 4, 17, 34, 45, 30, 20, 20, 7, 5, 21, 22, 46, 40, 47, 26, 48, 63, 58, 10 } { 12, 13, 50, 51, 52, 11, 17, 53, 45, 9, 30, 4, 53, 19, 0, 22, 23, 25, 43, 44, 37, 27, 28, 10, 55 } { 30, 33, 62, 51, 44, 20, 41, 56, 34, 45, 20, 41, 41, 56, 5, 30, 56, 38, 40, 47, 11, 37, 42, 57, 8 } { 35, 11, 23, 32, 14, 35, 20, 4, 17, 18, 21, 20, 20, 20, 4, 16, 21, 36, 46, 25, 41, 26, 48, 49, 58 } { 12, 31, 59, 59, 3, 33, 33, 59, 59, 52, 4, 33, 17, 59, 55, 22, 36, 59, 59, 60, 22, 36, 59, 25, 55 } { 31, 25, 15, 60, 60, 22, 17, 19, 55, 55, 20, 20, 53, 19, 55, 22, 46, 25, 43, 60, 37, 28, 10, 55, 52} { 12, 31, 32, 50, 51, 11, 33, 53, 19, 45, 16, 4, 4, 53, 5, 22, 36, 18, 25, 43, 26, 27, 27, 28, 10 } { 5, 2, 44, 52, 3, 4, 53, 45, 9, 3, 4, 56, 5, 0, 2, 5, 10, 47, 52, 3, 63, 39, 10, 9, 52 } { 12, 34, 44, 44, 3, 56, 56, 62, 45, 9, 56, 56, 7, 5, 0, 22, 38, 40, 47, 52, 48, 57, 39, 10, 9 } { 35, 11, 23, 14, 51, 35, 20, 41, 56, 62, 16, 20, 41, 56, 7, 16, 21, 38, 24, 40, 26, 26, 42, 57, 39 } { 33, 34, 51, 51, 52, 41, 41, 34, 62, 0, 41, 41, 56, 7, 5, 56, 38, 38, 40, 44, 37, 42, 57, 39, 10 } { 16, 31, 32, 15, 60, 30, 4, 17, 19, 25, 22, 20, 4, 53, 19, 21, 22, 46, 25, 55, 26, 48, 63, 58, 55 } },
[0198] It is a requirement of bitstream conformance that the values of AlfCoeff.sub.L [adaptation_parameter_set_id][filtIdx][j] with filtIdx=0 . . . NumAlffilters−1, j=0 . . . 11 shall be in the range of −2.sup.7 to 2.sup.7−1, inclusive.
[0199] alf_luma_clip_idx[sfIdx][j] specifies the clipping index of the clipping value to use before multiplying by the j-th coefficient of the signalled luma filter indicated by sfIdx. It is a requirement of bitstream conformance that the values of alf_luma_clip_idx[sfIdx][j] with sfIdx=0 . . . alf_luma_num_filters_signalled_minus1 and j=0 . . . 11 shall be in the range of 0 to 3, inclusive.
[0200] The luma filter clipping values AlfClip.sub.L adaptation_parameter_set_id] with elements AlfClip.sub.L[adaptation_parameter_set_id][filtIdx][j], with filtIdx=0 . . . NumAlfFilters−1 and j=0.11 are derived as specified in Table 7−4 depending on bitDepth set equal to BitDepth.sub.Y and clipIdx set equal to alf_luma_clip_idx[alf_luma_coeff_delta_idx[filtIdx] ][j].
[0201] alf_chroma_num_alt_filters_minus1 plus 1 specifies the number of alternative filters for chroma components.
[0202] alf_chroma_clip_flag[altIdx] equal to 0 specifies that linear adaptive loop filtering is applied on chroma components when using the chroma filter with index altIdx; alf_chroma_clip_flag[altIdx] equal to 1 specifies that non-linear adaptive loop filtering is applied on chroma components when using the chroma filter with index altIdx. When not present, alf_chroma_clip_flag[altIdx] is inferred to be equal to 0.
[0203] alf_chroma_coeff_abs[altIdx][j] specifies the absolute value of the j-th chroma filter coefficient for the alternative chroma filter with index altIdx. When alf chroma_coeff_abs[altIdx][j] is not present, it is inferred to be equal 0. It is a requirement of bitstream conformance that the values of alf_chroma_coeff_abs[altIdx][j] shall be in the range of 0 to 2.sup.7−1, inclusive.
[0204] The order k of the exp-Golomb binarization uek(v) is set equal to 3.
[0205] alf_chroma_coeff_sign[altIdx][j] specifies the sign of the j-th chroma filter coefficient for the alternative chroma filter with index altIdx as follows:
[0206] If alf_chroma_coeff_sign[altIdx][j] is equal to 0, the corresponding chroma filter coefficient has a positive value.
[0207] Otherwise (alf_chroma_coeff_sign[altIdx][j] is equal to 1), the corresponding chroma filter coefficient has a negative value.
[0208] When alf_chroma_coeff_sign[altIdx][j] is not present, it is inferred to be equal to 0.
[0209] The chroma filter coefficients AlfCoeff.sub.C[adaptation_parameter_set_id][altIdx] with elements AlfCoeff.sub.C[adaptation_parameter_set_id][altIdx][j], with altIdx=0 . . . alf chromanum_alt_filtersminus1, j=0 . . . 5 are derived as follows:
AlfCoeff.sub.C[adaptation_parameter_set_id][altIdx][j]=alf_chroma_coeff_abs[altIdx][j]* (1−2*alf_chroma_coeff_sign[altIdx][j]) (7-51)
[0210] It is a requirement of bitstream conformance that the values of AlfCoeff.sub.C[adaptation_parameter_set_id][altIdx][j] with altIdx=0 . . . alf_chroma_num_alt_filters_minus1, j=0 . . . 5 shall be in the range of −2.sup.7−1 to 2.sup.7−1, inclusive.
[0211] alf_cross_component_cb_filter_signal_flag equal to 1 specifies that a cross component Cb filter is signalled. alf_cross_component_cb_filter_signal_flag equal to 0 specifies that a cross component Cb filter is not signalled. When ChromaArrayType is equal to 0, alf_cross_component_cb_filter_signal_flag shall be equal to 0.
[0212] alf_cross_component_cb_filters_signalled_minus1 plus 1 specifies the number of cross component Cb filters signalled in the current ALF APS. The value of alf cross_component_cb_filters_signalled_minus1 shall be in the range 0 to 3.
[0213] alf_cross_component_cb_coeff_abs_idx[k] [j] specifies the absolute table index value of the j-th coefficient of the signalled k-th cross-component Cb filter set. When alf_cross_component_cb_coeff abs_idx[k][j] is not present, it is inferred to be equal to 0. It is a requirement of bitstream conformance that the values of alf_cross_component_cb_coeff_abs_idx[k][j] shall be in the range of 0 to 10, inclusive. The maximum value of the tb(v) coded syntax element is 11.
[0214] alf_cross_component_cb_coeff_sign[k][j] specifies the sign of the j-th coefficient of the signalled k-th cross-component Cb filter set as follows:
[0215] If alf_cross_component_cb_coeff_sign[k][j] is equal to 0, the corresponding cross-component Cb filter coefficient has a positive value.
[0216] Otherwise (alf_cross_component_cb_coeff_sign[k][j] is equal to 1), the corresponding cross-component Cb filter coefficient has a negative value.
[0217] When alf_cross_component_cb_coeff_sign[k][j] is not present, it is inferred to be equal to 0.
[0218] The cross-component Cb filter coefficient CcAlfApsCoeff.sub.Cb[adaptation parameter set id][k][j] are derived as follows:
CcAlfApsCoeffc.sub.b[adaptation_parameter_set_id][k][j]=CcAlfApsCoeffMap[alf_cross_component_cb_coeff_abs_idx[k][j]]* (1-2*alf_cross_component_cb_coeff_sign[k][j]) CcAlfApsCoeffMap={0,1,2,3,4,6,8,12,16,24,32} (7-51)
[0219] It is required of bitstream conformance that the value of CcAlfApsCoeffcb[adaptation_parameter_set_id][k][j] with i=0, . . . , 6 shall be in the range of −32 to 32, inclusive.
[0220] alf_cross_component_cr_filter_signal_flag equal to 1 specifies that a cross component Cr filter is signalled. alf_cross_component_cr_filter_signal_flag equal to 0 specifies that a cross component Cr filter is not signalled. When ChromaArrayType is equal to 0, alf_cross_component_crfiltersignalflag shall be equal to 0.
[0221] alf_cross_component_cr_filters_signalled_minus1 plus 1 specifies the number of cross component Cr filters signalled in the current ALF APS. The value of alf_cross_component_crfilters_signalled_minus1 shall be in the range 0 to 3.
[0222] alf_cross_component_cr_coeff_abs_idx [k][j] specifies the absolute table index value of the j-th coefficient of the signalled k-th cross-component Cr filter set. When alf_cross_component_cr_coeff_absidx[k][j] is not present, it is inferred to be equal to 0. It is a requirement of bitstream conformance that the values of alf_cross_component_cr_coeff_abs_idx[k][j] shall be in the range of 0 to 10, inclusive. The maximum value of the tb(v) coded syntax element is 11.
[0223] alf_cross_component_cr_coeff_sign [k][j] specifies the sign of the j-th coefficient of the signalled k-th cross-component Cr filter set as follows:
[0224] If alf_cross_component_cr_coeff_sign[k][j] is equal to 0, the corresponding cross-component Cr filter coefficient has a positive value.
[0225] Otherwise (alf_cross_component_cr_coeff_sign[k][j] is equal to 1), the corresponding cross-component Cr filter coefficient has a negative value.
[0226] When alf_cross_component_cr_coeff_sign[k][j] is not present, it is inferred to be equal to 0.
[0227] The cross-component Cr filter coefficient CcAlfApsCoeff.sub.CR[adaptation_parameter_set_id][k][j] are derived as follows:
CcAlfApsCoeff.sub.Cr[adaptation_parameter_set_id][k][j]=CcAlfApsCoeffMap[alf_cross_component_cr_coeff_abs_idx[k][j]]*(1-2*alf_cross_component_cr_coeff_sign[k][j])CcAlfApsCoeffMap={0,1,2,3,4,6,8,12,16,24,32} (7-52)
[0228] It is required of bitstream conformance that the value of CcAlfApsCoeff.sub.Cr[adaptation_parameter_set_id][k][j] with i=0, . . . , 6 shall be in the range of −32 to 32, inclusive.
[0229] alf_chroma_clip_idx[altIdx][j] specifies the clipping index of the clipping value to use before multiplying by the j-th coefficient of the alternative chroma filter with index altIdx. It is a requirement of bitstream conformance that the values of alf_chroma_clip_idx[altIdx][j] with altIdx=0 . . . alf_chroma_num_alt_filters_minus1, j=0 . . . 5 shall be in the range of 0 to 3, inclusive.
[0230] The chroma filter clipping values AlfClip.sub.C[adaptation_parameter_set_id][altIdx] with elements AlfClip.sub.C[adaptation_parameter_set_id][altIdx][j], with altIdx=0 . . . alf_chroma_num_alt_filters_minus1, j=0 . . . 5 are derived as specified in Table 7−4 depending on bitDepth set equal to BitDepth.sub.C and clipIdx set equal to alf_chroma_clip_idx[altIdx][j].
TABLE-US-00022 TABLE 7-4 Specification AlfClip depending on bitDepth and clipIdx clipIdx bitDepth 0 1 2 3 8 255 64 16 4 9 511 108 23 5 10 1023 181 32 6 11 2047 504 45 7 12 4095 512 64 8 13 8191 861 91 10 14 16383 1448 128 11 15 32767 2435 181 13 16 65535 4096 256 16
Cross Component Filtering Process for Block of Chroma Samples
[0231] Inputs of this process are:
[0232] a reconstructed luma picture sample array recPicture.sub.L prior to the luma adaptive loop filtering process,
[0233] a filtered reconstructed chroma picture sample array alfPicture.sub.C,
[0234] a chroma location (xCtbC, yCtbC) specifying the top-left sample of the current chroma coding tree block relative to the top left sample of the current picture,
[0235] a width ccAlfWidth of block of chroma samples
[0236] a height ccAlfHeight of block of chroma samples
[0237] cross component filter coefficients CcAlfCoeff[j], with j=0 . . . 6
[0238] Output of this process is the modified filtered reconstructed chroma picture sample array ccAlfPicture.
[0239] The coding tree block luma location (xCtb, yCtb) is derived as follows:
xCtb=(((xCtbC*SubWidthC)>>Ctb Log 2SizeY)<<Ctb Log 2SizeY (8-1229)
yCtb=(((yCtbC*SubHeightC)>>Ctb Log 2SizeY)<<Ctb Log 2SizeY (8-1229)
[0240] For the derivation of the filtered reconstructed chroma samples ccAlfPicture[xCtbC+x][yCtbC+y], each reconstructed chroma sample inside the current chroma block of samples 1fPictured.sub.C [xCtbC+x][yCtbC+y] with x=0 . . . ccAlfWidth−1, y=0 . . . ccAlfHeight−1, is filtered as follows:
[0241] The luma location (x.sub.L, y.sub.L) corresponding to the current chroma sample at chroma location (xCtbC+x, yCtbC+y) is set equal to ((xCtbC+x)*SubWidthC, (yCtbC+y)*SubHeightC)
[0242] The luma locations (h.sub.xL+i, v.sub.yL+j) with i=—1 . . . 1, j=−1 . . . 2 inside the array recPicture.sub.L are derived as follows:
[0243] If pps_loop_filter_across_virtual_boundaries_disabled_flag is equal to 1, and PpsVirtualBoundariesPosX[n] % CtbSizeY is not equal to 0, and xL−PpsVirtualBoundariesPosX[n] is greater than or equal to 0 and less than 3 for any n=0 . . . pps_numver_virtual_boundaries−1, the following applies:
h.sub.xL+i=Clip3(PpsVirtualBoundariesPosX[n],pic_width_in_luma_samples−1,xL+i) (8-1229)
[0244] Otherwise, if pps_loop_filter_across_virtual_boundaries_disabled_flag is equal to 1, and PpsVirtualBoundariesPosX[n] % CtbSizeY is not equal to 0, and PpsVirtualBoundariesPosX[n]−xL is greater than 0 and less than 4 for any n=0 . . . pps_num_ver_virtual_boundaries−1, the following applies:
h.sub.x+i=Clip3(0,PpsVirtualBoundariesPosX[n]−1,xL+i) (8-1230)
Otherwise, the following applies:
h.sub.x+i=Clip3(0,pic_width_in_luma_samples−1,xL+i) (8−1231)
[0245] If pps_loop_filter_across_virtual_boundaries_disabled_flag is equal to 1, and PpsVirtualBoundariesPosY[n] % CtbSizeY is not equal to 0, and yL−PpsVirtualBoundariesPosY[n] is greater than or equal to 0 and less than 3 for any n=0 . . . pps_numhor_virtual_boundaries−1, the following applies:
v.sub.y+j=Clip3(PpsVirtualBoundariesPosY[n],pic_height_in_luma_samples−1,yL+j) (8-1232)
[0246] Otherwise, if pps_loop_filter_across_virtual_boundaries_disabled_flag is equal to 1, and PpsVirtualBoundariesPosY[n] % CtbSizeY is not equal to 0, and PpsVirtualBoundariesPosY[n]−yL is greater than 0 and less than 4 for any n=0 . . . pps_num_hor_virtual_boundaries−1, the following applies:
v.sub.y+j=Clip3(0,PpsVirtualBoundariesPosY[n]−1,yL+j) (8-1233)
[0247] Otherwise, the following applies:
v.sub.y+j=Clip3(0,pic_height_in_luma_samples−1,yL+j) (8-1234)
[0248] The variables clipLeftPos, clipRightPos, clipTopPos and clipBottomPos are derived by invoking the ALF boundary position derivation process as specified in clause 8.8.5.5 with (xCtb, yCtb) and (x.sub.L−xCtb, y.sub.L−yCtb) as inputs.
[0249] The vertical sample position offsets yM1, yP1 and yP2 are specified in Table x—according to the vertical luma sample position y.sub.L, clipLeftPos and clipRightPos.
[0250] The horizontal sample position offsets xM1 and xP1 are specified in Table y-yyyy according to the horizontal luma sample position xL, clipLeftPos and clipRightPos.
[0251] The variable curr is derived as follows:
curr=alfPicturec[xCtbC+x,yCtbC+y] (8-1286)
The array of cross component filter coefficients f[j] is derived as follows with j=0 . . . 6:
f[j]=CcAlfCoeff[j] (8-1287)
[0252] The variable sum is derived as follows:
sum=f[0]*(recPicture.sub.L[h.sub.x,v.sub.y+M1]−recPicture.sub.L[h.sub.x,v.sub.y])+f[1]*(recPicture.sub.L[h.sub.x+xM1,v.sub.y]−recPicture.sub.L[h.sub.x,v.sub.y])+f[2]*(recPicture.sub.L[h.sub.x+xP1,v.sub.y]−recPicture.sub.L[h.sub.x,v.sub.y])+f[3]*(recPicture.sub.L[h.sub.x+xM1,v.sub.y+yP1]−recPicture.sub.L[h.sub.k,v.sub.y])+f[4]*(recPicture.sub.L[h.sub.x,v.sub.y+P1]−recPicture.sub.L[h.sub.x,v.sub.y])+f[5]*(recPicture.sub.L[h.sub.x+xP1,v.sub.y+yP1]−recPicture.sub.L[h.sub.x,v.sub.y])+f[6]*(recPicture.sub.L[h.sub.x,v.sub.y+yP2]−recPicture.sub.L[h.sub.x,v.sub.y])
sum=Clip3(−(1<<(BitDepth.sub.C−1)),(1<<(BitDepth.sub.C−1))−1, sum) (8-1290)
sum=curr+(sum+64)>>(7+(BitDepth.sub.y-BitDepth.sub.C)) (8-1290)
The modified filtered reconstructed chroma picture sample array ccAlfPicture [xCtbC+x][yCtbC+y is derived as follows:
ccAlfPicture[xCtbC+x][yCtbC+y]=Clip3(0,(1<<BitDepth.sub.C)−1,sum) (8-1291)
TABLE-US-00023 TABLE x-xx Specification of yM1, yP1 and yP2 according to the vertical luma sample position yL, clipTopPos and clipBottomPos Condition yM1 yP1 yP2 yL = = clipTopPos + 1 −1 1 1 yL = = clipTopPos 0 0 1 yL = = clipBottomPos − 1 0 0 1 yL = = clipBottomPos − 2 −1 1 1 Otherwise −1 1 2
TABLE-US-00024 TABLE y-yy Specification of xM1 and xP1 according to the horizontal luma sample position xL, clipLeftPos and clipRightPos Condition xM1 xP1 xL = = clipLeftPos 0 0 xL = = clipRightPos − 1 0 0 xL = = clipRightPos − 2 −1 1 Otherwise −1 1
9.3 Parsing Process for Truncated Binary Codes
[0253] This process is invoked when the descriptor of a syntax element in the syntax tables in subclause 7.3 is equal to tb(v).
[0254] Inputs to this process are bits from the RBSP and the maximum value maxVal.
[0255] Outputs of this process are syntax element values.
[0256] Syntax elements coded as tb(v) are truncated binary coded. The range of possible values for the syntax element is determined first. The range of this syntax element is 0 to maxVal, inclusive, with maxVal being greater than or equal to 1. synVal which is equal to the value of the syntax element is given by a process specified as follows:
TABLE-US-00025 thVal = 1 th = −1 while( thVal <= maxVal ) { th++ thVal <<= 1 } val = 1 << th (9−3) b = maxVal − val synVal = read_bits( th ) if( synVal >= val − b ) { synVal <<= 1 synVal += read_bits( 1 ) synVal −= val − b }
[0257] where the value returned from read bits(th) is interpreted as a binary representation of an unsigned integer with most significant bit written first.
[0258] **End changes**