Low-complexity image filters

By extending the coefficient value range of the CC-ALF filter and using shift and addition operations, the problem of degradation of encoding efficiency of CC-ALF when reducing hardware complexity is solved, and more efficient image encoding is achieved.

CN114846790BActive Publication Date: 2025-08-15TELEFONAKTIEBOLAGET LM ERICSSON (PUBL)
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202080087947.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Priority Date
2019-12-17
Filing Date
2020-12-16
Publication Date
2025-08-15
Estimated Expiration
2040-12-16

AI Technical Summary

Technical Problem

In existing video encoding standards, cross-component adaptive loop filters (CC-ALFs) may lead to a decrease in encoding efficiency, especially loss in BD rates while reducing hardware complexity.

Method used

By extending the coefficient value range of the CC-ALF filter without reintroducing multiplication operations, the residual correction values are calculated using shift and addition operations, and the coefficients in the set Zsub are filtered.

Benefits of technology

While maintaining low complexity, the encoding efficiency of CC-ALF filtering is improved, the loss of BD rate is reduced, and the image encoding quality is improved.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN114846790B_ABST
    Figure CN114846790B_ABST
Patent Text Reader

Abstract

A method for encoding or decoding an image is provided. The method includes obtaining a first luma sample value L1 associated with the image. The method includes obtaining a second luma sample value L2 associated with the image. The method also includes obtaining a first luma delta value ΔL1, where ΔL1=L2-L1. The method includes obtaining a first product P1 using ΔL1 and a first coefficient value C1, where P1=(C1)(ΔL1). The method includes calculating a first residual correction value ΔI1 using P1 and a set of other products. The method includes using the first residual correction value ΔI1 to correct an unfiltered chroma value R associated with the image. C Filtering is performed to produce filtered chrominance values associated with the image #imgabs0#
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present disclosure relates to encoding and / or decoding of images or video sequences. Background Art

[0002] A video sequence consists of several images. When viewed on a screen, an image consists of pixels, each of which has a red, green, and blue (RGB) value. However, when encoding and decoding a video sequence, images are not usually represented using RGB values, but are usually represented using another color space, which includes but is not limited to YCbCr, IC, and RGB. T C P , non-constant brightness YCbCr and constant brightness YCbCr. If we take YCbCr as an example, YCbCr consists of three components: luminance (Y), which roughly represents brightness; and chrominance (Cb and Cr), both of which represent chrominance. Typically, Y has full resolution, while the other two components, Cb and Cr, have smaller resolutions. A typical example is a high-definition (HD) video sequence containing 1920x1080 RGB pixels, which is typically represented by a Y component with a resolution of 1920x1080, a Cb component of 960x540, and a Cr component of 960x540. The elements in a component are called samples. Therefore, in the example given above, there are 1920x1080 samples in the Y component, and therefore there is a direct relationship between samples and pixels. Therefore, in this document, we sometimes use the terms pixel and sample interchangeably. For the Cb and Cr components, there is no direct relationship between samples and pixels; a single Cb sample typically affects several pixels.

[0003] In the draft of the Versatile Video Coding (VVC) standard developed by the Joint Video Experts Group (JVET), the decoding of an image can be considered to occur in two stages: predictive decoding and loop filtering. In the predictive decoding stage, the samples of the components (Y, Cb, and Cr) are divided into rectangular blocks. For example, one block may be of size 4×8 samples, while another block may be of size 64×64 samples. The decoder is given instructions on how to predict each block, such as copying samples from a previously decoded image (an example of temporal prediction), or copying samples from a decoded portion of the current image (an example of intra-frame prediction), or a combination thereof. To improve this prediction, the decoder can obtain a residual, which is typically encoded using a transform code such as a discrete sine transform (DST) or discrete cosine transform (DCT). This residual is added to the prediction, and the decoder can continue decoding the subsequent block.

[0004] The output from the predictive decoding stage is three components Y, Cb, and Cr. However, the fidelity of these components can be further improved, and this is done in the loop filtering stage. The loop filtering stage in the current draft of VVC consists of four sub-stages; the LMCS stage, the deblocking filter stage, the sample adaptive offset filter (SAO) sub-stage, and the adaptive loop filter (ALF) sub-stage. Each stage is optional for the encoder to use, but the decoder must support them. In the LMCS stage, if the mapped luma values are encoded, the inverse mapping of the luma values is performed. Mapping of luma values is a way of utilizing a larger range of code values than is present in the source, which may have a limited range of luma values. In the deblocking filter sub-stage, when certain conditions are met, the decoder changes Y, Cb, and Cr by smoothing the edges near block boundaries. This improves perceptual quality (subjective quality) because the human visual system is very good at detecting regular edges, such as block artifacts along block boundaries. In the SAO sub-stage, the decoder adds or subtracts the signaled value to samples that meet certain conditions, such as being in a certain value range (band-shifted SAO) or having a specific neighborhood (edge-shifted SAO). This can reduce ringing noise, as such noise is often concentrated in a certain value range or in a specific neighborhood (for example, in a local maximum). In this document, we will denote the reconstructed image component Y as the result of this stage SAO , Cb SAO Cr SAO .

[0005] The basic idea behind adaptive loop filtering is that the image component Y SAO , Cb SAO and Cr SAO The fidelity of can often be improved by filtering the image using a linear filter that is signaled from the encoder to the decoder. As an example, by solving a least squares problem, the encoder can determine the linear filter that is most effective in reducing the current reconstructed image component Y SAO , Cb SAO Cr SAO With the original image component Y org , Cb org and Cr org What coefficients should the error between have? These coefficients can then be signaled from the encoder to the decoder. The decoder reconstructs the image as before to obtain Y SAO , Cb SAO and Cr SAO , get the filter coefficients from the bitstream, and then apply the filter to get the final output, which we will record as Y ALF , Cb ALF Cr ALF .

[0006] In VVC, the ALF goes further. First, it's observed that it's often advantageous to filter some samples with one coefficient set, while avoiding filtering other samples or perhaps filtering them with another coefficient set. To this end, VVC classifies each Y sample (i.e., each luma sample) into one of 25 categories. The category a sample belongs to is determined based on its local neighborhood, specifically the gradients of surrounding samples and the activity of surrounding samples. The encoder can signal a coefficient set for each of the 25 categories. The decoder will then first determine which category the sample belongs to and then select the appropriate coefficient set to filter the sample. However, signaling 25 coefficient sets can be costly. Therefore, the VVC standard also allows filtering only a few of the 25 categories using unique coefficient sets. The remaining categories can reuse coefficient sets used in another category, or they can be determined not to be filtered at all. Another approach to reducing costs is to use so-called fixed coefficient sets. This fixed coefficient set is a set of 64 hard-coded filters (i.e., 64 sets of coefficient values) known to the decoder. The encoder can very cheaply signal the use of one of these fixed (i.e., hard-coded) filters to the decoder because they are already known to the decoder. For example, the decoder stores a set of 16 different groups of N index values (e.g., N=25), and the encoder sends an initial index value that points to one of the 16 groups of N index values, where each of the index values included in the N index value groups is associated with a category, and each of the index values points to one of the 64 hard-coded filters. For example, the first of the N values in the index value group points to the fixed filter that should be used for the first category, while the second value points to the fixed filter that should be used for the second category, and so on. Thus, the decoder obtains the index value for a specific filter based on the initial index value and the category. Although these filters are cheap, they may not perfectly match the desired filter, resulting in slightly lower quality. For samples belonging to Cb or Cr, that is, for chroma samples, no classification is used, and the same set of coefficients is used for all samples.

[0007] It is expensive to send the filter coefficients, so the same coefficient values are used for both filter positions. For luma (samples in the Y component), the coefficients are given by Figure 1 Reuse as shown in .

[0008] Assume that R(x,y) is the sample to be filtered, which is located at Figure 1 Then the sample R(x,y-1) (the sample just above) and the sample R(x,y+1) (the sample just below) will be processed using the same coefficient C6.

[0009] The filtered version of the sample at position (x,y) (which we denote as R F (x,y)) is calculated with the help of the variable sum, and sum is calculated as follows:

[0010] Sum=C0*[clip(s0,R(x,y-3)-R(x,y))+clip(s0,R(x,y+3)-R(x,y))]+C1*[clip(s1,R(x-1,y-2)-R(x, y))+clip(s1,R(x+1,y+2)-R(x,y))]+C2*[clip(s2,R(x,y-2)-R(x,y))+clip(s2,R(x,y-2)-R(x,y))]+ C3*[clip(s3,R(x+1,y+2)-R(x,y))+clip(s3,R(x-1,y-2)-R(x,y))]+C4*[clip(s4,R(x-2,y-1)-R(x, y))+clip(s4,R(x+2,y+1)-R(x,y))]+C5*[clip(s5,R(x-1,y-1)-R(x,y))+clip(s5,R(x+1,y+1)-R(x,y ))]C6*[clip(s6,R(x,y-1)-R(x,y))+clip(s6,R(x,y+1)-R(x,y))]+C7*[clip(s7,R(x+1,y-1)-R(x,y ))+clip(s7,R(x-1,y+1)-R(x,y))]+C8*[clip(s8,R(x+2,y-1)-R(x,y))+clip(s8,R(x-2,y+1)-R(x,y) )]+C9*[clip(s9,R(x-3,y)-R(x,y))+clip(s9,R(x+3,y)-R(x,y))]+C10*[clip(s10,R(x-2,y)-R(x,y) )+clip(s10,R(x+2,y)-R(x,y))]+C11*[clip(s11,R(x-1,y)-R(x,y))+clip(s11,R(x+1,y)-R(x,y))]. (Equation 1)

[0011] Here, the clip(m,x) operation simply ensures that the magnitude of the value x never exceeds m:

[0012]

[0013] The filtered value R F (x,y) is finally calculated as

[0014] R F(x,y)=R(x,y)+((sum+64)>>7) (Equation 3)

[0015] The amplitudes s0 to s11 are also signaled from the encoder to the decoder. Note that the coefficient C12 is not used in Equation 1 because the value clip(s12, R(x,y)-R(x,y)) is always zero.

[0016] In JVET-O0636 reference [1], a tool called Cross-Component Adaptive Loop Filter (CC-ALF) was first proposed as part of the adaptive loop filter process. CC-ALF was studied in the core experiments of the JVET-P and JVET-Q conferences. CC-ALF uses luma sample values to refine each chroma component. The luma sample values used are the reconstructed luma samples after SAO and before the luma ALF operation, i.e., Y as described above. SAO For each chroma component i, a linear diamond filter is applied to the luma samples to derive the residual correction ΔI i (x,y). After the ALF-chroma operation, the residual correction is applied to the reconstructed chroma samples to derive the reconstructed chroma sample values. Figure 2 The placement of the CC-ALF relative to other loop filters is shown.

[0017] In JVET-P2025 [Reference 2] "Description of Core experiment 5 (CE5): Crosscomponent Adaptive Loop filtering", the anchor of CC-ALF (hereinafter referred to as "CE anchor" in the current invention) is specified for the core experiment test. The CE anchor has the following seven properties: 1) the filter shape is a 3×4 diamond with 8 unique coefficients; 2) the filter coefficient dynamic range is between [-32, 31], inclusive; 3) the filter coefficient bit scale is equal to 7; 4) filter selection is performed at the CTU level, supporting up to 4 filters; 5) symmetric line selection is used at virtual boundaries; 6) the temporal layer coefficient buffer is not used; 7) the residual correction is clipped to -2 BitDepthC-1 to 2 BitDepthC-1 -1, inclusive.

[0018] The CE anchor applies an 8-tap diamond CC-ALF filter to the collocated luma samples centered around the chroma sample to be segmented. Figure 3The CE-anchor CC-ALF filter shape for the 4:2:0 color format is shown, with one type of chroma position where chroma is aligned horizontally but vertically between luma samples, as in ITU-T Rec 709. An example of another chroma position type is to align chroma with luma, as in ITU-T BT.2100.

[0019] Assume R C (x C ,y C ) is the ALF chroma reconstruction chroma sample to be refined by CC-ALF, where (x C ,y C ) specifies the position of the chroma sample in the current image. C (x C ,y C ) The juxtaposed brightness sample is R L (x L ,y L ), where (x L ,y L ) specifies the position of the collocated luminance samples in the current image. Figure 3 As seen in , in some cases the chroma sample position may not be at the same location as any luma sample, but may be, for example, between two luma samples. In these cases, we have to define what we mean by collocated luma samples. Figure 3 In the case of , the upper of the two closest luma samples is defined as the collocated luma sample, also as Figure 4 The 8 luminance samples to be filtered by CC-ALF are R L (x L -1,y L ), R L (x L ,y L -1) R L (x L ,y L ), R L (x L -1,y L +1), R L (x L +1,y L -1) R L (x L +1,y L ), R L (x L +1,y L +1), R L (x L +2,y L ). Figure 4The 8-tap 3×4 diamond CC-ALF filter coefficients are shown relative to the luma sample positions.

[0020] Residual correction ΔI i (x,y) is calculated as follows:

[0021] ΔI i (x,y)=(C L 0*R L (x L ,y L -1)+C L 1*R L (x L -1,y L )+C L 2*R L (x L ,y L )+C L 3*R L (x L +1,y L )+C L 4*R L (x L -1,y L +1)+C L 5*R L (x L ,y L +1)+C L 6*R L (x L +1,y L +1)+C L 7*R L (x L ,y L +2)+2 shiftFactor-1 )>>shiftFactor (Equation 4)

[0022] Among them C L i specifies the CC-ALF filter coefficients. i ranges from 0 to 7, except for C L 2, each coefficient is estimated at the encoder side; each CC-ALF filter coefficient C L i has a value range of [-32, 31], including the end value (this value range is also called the dynamic range); C L 2 is calculated as C L 2=(-1)*(C L 0+C L 1+C L 3+C L 4+C L 5+C L 6+C L7), and then clip it to the range [-32, 31], including the end value; and shiftFactor = coefficient bit scale + (BitDepth Y –BitDepth C ), where, in the CE anchor, the coefficient bit scale is equal to 7.

[0023] Correct the residual ΔI i (x,y) clipped to [-2 BitDepthC-1 ,2 BitDepthC-1 -1], including the end value. CC-ALF refines the chroma sample R F (x C ,y C ) is then exported as: Then clip it to [0,2 BitDepthC -1], including the end value.

[0024] Each CC-ALF filter coefficient is encoded using a 6-bit fixed-length code that can represent a value from 0 to 63. The encoded / decoded CC-ALF coefficient is named D L (i), where i ranges from 0, 1, 2 to 7. CC-ALF coefficient C L (i) Equal to D L (i)–32.

[0025] In the CE description document JVET-P2025, there are two tests that can remove CC-ALF multiplications in the filtering process. In the document, these tests are referred to as CE5-2.1 and CE5-2.2. When implementing a video encoder or video decoder in hardware, multiplications are expensive in terms of surface area and / or power consumption. Therefore, removing the multiplication operations reduces the complexity of the CC-ALF filtering process. One CE test (CE5-2.1) restricts the CC-ALF filter coefficients to have values from the set {-64, -32, -16, -8, -4, -2, -1, 0, 1, 2, 4, 8, 16, 32, 64}. Another CE test (CE5-2.2) restricts the CC-ALF filter coefficients to have values from the set {-8, -4, -2, -1, 0, 1, 2, 4, 8}. Since all of these coefficient values can be written as (±)2 N , so the multiplication operation in the CC-ALF filtering process can be replaced by shift operation and sign change, which is much cheaper in hardware design. For example, (M*2 N ) is equivalent to (M<<N), where the operator << represents an arithmetic left shift. In the following of the proposed invention, we name the set Z two , where the set Ztwo Each value in can be written as 0 or ±2 N . Summary of the Invention

[0026] There are certain challenges. For example, while the CE test of multiplication removal reduces the hardware complexity of the CC-ALF filtering process, limiting the CC-ALF coefficient values to 0 or pure powers of 2 (e.g., + / - 0, 1, 2, 4, 8, 16, 32, 64, 128) may reduce the CC-ALF filtering accuracy. This means that the coding efficiency at BD rates will be significantly reduced.

[0027] Here, we give an example of BD rate results from CE test CE5-2.2, which restricts the CC-ALF filter coefficients to have values {-8,-4,-2,-1,0,1,2,4,8}.

[0028] Compared with the CE anchor, the BD rate numbers are shown in Table 1 below:

[0029] Table 1: BDR results of CE5-2.2 compared with CE anchor.

[0030] Y U V YUV All interior -0.03% 0.74% 0.60% 0.11% Random Access 0.00% 0.35% 0.45% 0.08% Low Latency B

[0031] Here, the YUV value represents a combined BD rate of three components Y, U, and V, and is calculated as follows: YUV=(8*Y+U+V) / 10.

[0032] From Table 1, we see that the combined YUV BD rate of CE5-2.2 is 0.11% (all intra) and 0.08% (random access) compared to the CE anchor. This means that the solution proposed in CE5-2.2 needs to use 0.11% (all intra) and 0.08% (random access) more bits than the CE anchor to get the same quality in terms of PSNR.

[0033] In the present disclosure, an improved low complexity CC-ALF is proposed. Instead of restricting the CC-ALF coefficient values to be from the set Z, the present disclosure proposes to extend the allowed CC-ALF coefficient values. two To keep the CC-ALF design low complexity, this proposal does not reintroduce multiplication in the CC-ALF filtering process, but uses shift and addition to calculate the residual correction ΔI i (x,y).

[0034] According to a first aspect of the present disclosure, a method for encoding or decoding an image is provided. The method includes obtaining a first luminance sample value L1 associated with the image. The method includes obtaining a second luminance sample value L2 associated with the image. The method also includes obtaining a first luminance delta value ΔL1, where ΔL1=L2-L1. The method includes using ΔL1 and a first coefficient value C1 to obtain a first product P1, where P1=(C1)(ΔL1). The method includes using P1 and a set of other products to calculate a first residual correction value ΔI1. The method includes using the first residual correction value ΔI1 to correct an unfiltered chrominance value R associated with the image. C Filtering is performed to produce filtered chrominance values associated with the image

[0035] According to a second aspect of the present disclosure, there is provided a computer program comprising instructions which, when executed by a processing circuit, cause the processing circuit to perform the method according to the first aspect.

[0036] According to a third aspect of the present disclosure, there is provided a carrier comprising the computer program according to the second aspect, wherein the carrier is one of an electric signal, an optical signal, a radio signal and a computer-readable storage medium.

[0037] According to a fourth aspect of the present disclosure, a device is provided, which is suitable for performing the method according to the first aspect.

[0038] At least one of these aspects provides the advantage of improving BD rate compared to the low-complexity CC-ALF design proposed in CE5-2.1 and CE5-2.2. BRIEF DESCRIPTION OF THE DRAWINGS

[0039] Figure 1 An example of reuse of filter coefficients is shown.

[0040] Figure 2 The placement of the CC-ALF relative to other loop filters is shown.

[0041] Figure 3 Example chromaticity positions are shown.

[0042] Figure 4 The coefficients of an 8-tap 3×4 diamond CC-ALF filter are shown.

[0043] Figure 5 A system according to an example embodiment is shown.

[0044] Figure 6 is a schematic block diagram of an encoder according to some embodiments.

[0045] Figure 7is a corresponding schematic block diagram of a decoder according to some embodiments.

[0046] Figure 8 Shows the set Z 128 All values in .

[0047] Figure 9 Shows all the values that can be written as 0, ±2 n or ±(2 n +2 n-1 ) value.

[0048] Figure 10 One method for implementing multiplication is shown.

[0049] Figure 11 Shown Figure 10 Implementation of the "Bitwise AND" box in .

[0050] Figure 11A Shown for expansion Figure 10 An example implementation of the output of the Bitwise AND box in .

[0051] Figure 12 An implementation example of a conditional negator is shown.

[0052] Figure 13 An implementation example of a barrel shifter is shown.

[0053] Figure 14 Another method for implementing multiplication is shown.

[0054] Figure 15 Shown for expansion Figure 14 An example implementation of the output of the Bitwise AND box in .

[0055] Figure 16 is a flow chart illustrating a process for decoding an image according to an embodiment.

[0056] Figure 17 is a flow chart illustrating another process for decoding an image according to an embodiment.

[0057] Figure 18 is a flow chart illustrating another process for decoding an image according to an embodiment.

[0058] Figure 19 is a block diagram of an apparatus for implementing an encoder or a decoder according to some embodiments.

[0059] Figure 20 is a flow chart illustrating a process performed by an encoder according to an embodiment. DETAILED DESCRIPTION

[0060] Figure 5 A system 500 is shown according to an example embodiment. The system 500 includes an encoder 502 and a decoder 504. In the example shown, the decoder 504 may receive an encoded image produced by the encoder 502 via a network 110 (eg, the Internet or other network).

[0061] Figure 6 is a schematic block diagram of the encoder 502. Figure 6 As shown, an encoder 502 receives the original image and subtracts a prediction 41, which is selected 51 from previously decoded samples ("intra-frame prediction" 49) or from samples of previously decoded frames stored in a frame buffer 48 through a method known as motion compensation 50. The task of finding the best motion-compensated sample is often called motion estimation 50 and involves comparison with the original samples. After subtracting the prediction 41, the resulting difference is transformed 42 and then quantized 43. The quantized result is entropy coded 44, resulting in bits that can be stored, transmitted, or further processed. The output from quantization 43 is also inverse quantized 45 and then inverse transformed 46. The predictions from 51 are then summed 47, and the result is forwarded to both the intra-frame prediction unit 49 and the loop filter unit 100. The loop filter unit 100 may perform deblocking, SAO filtering, and / or ALF filtering (including CC-ALF filtering). The result is stored in the frame buffer 48 and used for future predictions. Figure 6 Not shown in FIG, the coding parameters of other blocks such as 42, 43, 49, 50, 51 and 100 may also be entropy coded.

[0062] Figure 7 is a corresponding schematic block diagram of a decoder 504 according to some embodiments. The decoder 504 receives entropy-encoded transform coefficients, which are then decoded by a decoder 61. The output of the decoder 61 then undergoes inverse quantization 62, followed by an inverse transform 63, to form a decoded residual. A prediction is added 64 to the decoded residual. The prediction is selected 68 from a motion compensation unit 67 or from an intra-frame prediction unit 66. After the prediction has been added to the decoded residual 64, the sample can be forwarded for intra-frame prediction of a subsequent block. The sample is also forwarded to the loop filter unit 100, which can perform deblocking, SAO processing, and / or ALF processing (including CC-ALF filtering). The output of the loop filter unit 100 is forwarded to a frame buffer 65, which can be used for motion-compensated prediction of a subsequently decoded image 67. The output of the loop filter unit 100 can also output a decoded image for viewing or subsequent processing outside the decoder. Figure 7Not shown in FIG, parameters of other blocks such as 63, 67, 66 and 100 may also be entropy decoded. As an example, the coefficients of the ALF filter in block 100 may be entropy decoded.

[0063] In one embodiment, to achieve the advantages discussed above, the allowed CC-ALF coefficient values for the low complexity CC-ALF design are extended, but in such a way that there is an inexpensive way to implement the required multiplications.

[0064] First, it can be written as 0 or ±2 n or ±2 n ±2 m Until the value of magnitude <= M is defined as the set Z M For example, Z 128 All values in are between -128 and 128, inclusive, so Z 128 The values in 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}. Figure 8 Shows the set Z 128 All values in .

[0065] Can be written as 0 or ±2 n Until the value of magnitude <= M is defined as the set Z two M As an example, Z two 128 Includes values + / - {0,1,2,4,8,16,32,64,128}.

[0066] By M Remove Z two M The values in the derive set Z npot M As an example, Z npot 128The 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}.

[0067] Define Z M A subset of (denoted as Z sub ), where Z sub Contains from Z npot M At least one value of .

[0068] The present disclosure proposes a filter that is operable to use a filter from Z sub In addition, the filter should be constrained so that each coefficient value must belong to the set Z sub .

[0069] A special case of this is when Z sub =Z two M +Z ext When Z two M The value in is Z sub Can be written as 0 or ±2 n The value of , and where Z ext The value in is Z sub The above two values cannot be written in Z M Available in ).

[0070] 1. The hardware complexity assertion of the coefficient value is a power of 2 of 0, 1, and 3

[0071] In one embodiment, the CC-ALF coefficients are expanded so that they can be written as 0 or ±2 n or ±(2 n +2 n -1 ).

[0072] The given value range is between -128 and 128. In this embodiment, Z extAn example of a set is {-96,-48,-24,-12,-6,-3,3,6,12,24,48,96}. Here, Z two 128 ={-128,-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64,128}. The set Z of filter coefficients should be selected from sub Then it becomes Z 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}.

[0073] The given value range is between -64 and 64. In this embodiment, Z ext An example of a set is {-48,-24,-12,-6,-3,3,6,12,24,48}. Here, Z two 64 ={-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64}. The set Z of filter coefficients should be selected from sub Then it becomes Z 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}.

[0074] The given value range is between -32 and 32. In this embodiment, Z ext An example of a set is {-24,-12,-6,-3,3,6,12,24}. Here, Z two 32 ={-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32}. The set Z of filter coefficients should be selected from sub Then it becomes Z sub ={-32,-24,-16,-12,-8,-6,-4,-3,-2,-1,0,1,2,3,4,6,8,12,16,24,32}.

[0075] The given value range is between -16 and 16. In this embodiment, Z ext An example of a set is {-12,-6,-3,3,6,12}. Here, Z two 16={-16,-8,-4,-2,-1,0,1,2,4,8,16}. The set Z of filter coefficients should be selected from sub Then it becomes Z sub ={-16,-12,-8,-6,-4,-3,-2,-1,0,1,2,3,4,6,8,12,16}.

[0076] The given value range is between -8 and 8. In this embodiment, Z ext An example of a set is {-6,-3,3,6}. Here, Z two 8 ={-8,-4,-2,-1,0,1,2,4,8}. The set Z of filter coefficients should be selected from sub Then it becomes Z sub ={-8,-6,-4,-3,-2,-1,0,1,2,3,4,6,8}.

[0077] Figure 9 Shows all the values that can be written as 0, ±2 n or ±(2 n +2 n-1 ) value.

[0078] From here, this disclosure explains why Z sub The extended CC-ALF coefficient values in can keep the CC-ALF filtering process low complexity in terms of hardware multiplication design, even if the ext The coefficients of the set {-96,-48,-24,-12,-6,-3,3,6,12,24,48,96} cannot be written as pure powers of 2.

[0079] To calculate the sum according to equation 4, it is necessary to perform several multiplications in the form a*b, where ab is the allowed coefficient, i.e. it belongs to the set Z sub ={Z two ,Z ext}, and b is the luma reconstruction sample value, i.e., given luma bitDepth=12, it can take any value in the range [0,4095], requiring a 12-bit variable to store it.

[0080] In Z ext Each value in can be written as ±(2 n +2 n-1 ), we can write each such value as ±2 n-1 (2+1)=±2 n-1 * 3. Therefore, the value a is either a pure power of 2 or a pure power of 2 times three. This can be written as:

[0081] a=±(k1*2+k0*1)*2 s , (Equation 5)

[0082] where k0 and k1 can take values of 0 or 1. In the case where we have a pure power of 2 (e.g., 128), we set k1=1, k0=0, and s to a suitable shift value, which in the case of 128 is 6. (Since k1=1 we multiply by 2, we should use 6 to represent 128.) In the case where we have a power of 2 multiplied by three (e.g., 96), we set both k1 and k0 to 1 and use a suitable shift value, which in the case of 96 is 5. Table 2 shows possible values of k1, k0, and s for the values in S. It also shows the value n, which indicates whether the value should be negated.

[0083] Table 2: How to use (-1) n (2k1+k0)2 s Write the allowed coefficients in the form

[0084]

[0085]

[0086] The decoder can determine the values of k1, k0, s, and n from the coefficients using Table 2. An alternative approach is to use the following pseudocode for the coefficients coeff:

[0087] k1 = (abs(coeff) < 2? 0:1);

[0088] k0=coeff&1;

[0089] s=max(0,6-clz(abs(coeff)));

[0090] n=sign(coeff).

[0091] Here, abs(x) represents the absolute value of x, & represents a bitwise AND, max(a,b) returns the maximum of a and b, clz(x) counts the number of leading zeros in x, so the 8-bit number 0001111 would return 3, and sign(x) returns the sign of x. clz() is a common assembly instruction on most CPUs and is therefore inexpensive.

[0092] Note that this conversion only needs to happen when the coefficients are read from the APS, that is, once per frame. Therefore, it is not critical that this conversion from coefficients to values is very fast or efficient. On the other hand, if this conversion must happen in every sample, then it would be very important that it can be done quickly.

[0093] Once they have been converted, the hardware implementation can store them for later use during filtering.Since k1, k0 and n are 1-bit values, and s is a 3-bit value, the total number of bits that need to be stored is 6 bits.

[0094] a can be written as follows: a = (-1) n (2k1+k0)2 s , so the multiplication a*b can be rewritten as:

[0095] a*b=

[0096] =(-1) n (2k1+k0)2 s *b (Equation 6)

[0097] =(-1) n (2b*k1+b*k0)2 s

[0098] =(-1) n (((b*k1)<<1)+b*k0)2 s .

[0099] To evaluate the bottom-most expression, we can begin by multiplying b by k1. Since k1 is either 0 or 1, this is the same as performing an AND operation between b and each bit in k1. After this, we shift it left by one step. Similarly, we perform an AND operation between b and k0. We add the two results together, negate them if necessary, and shift them by 0, which is 6 steps. Since multiplication can be replaced by AND, Equation 6 can be written as:

[0100] a*b=(-1) n (((b& b k1)<<1)+b& b k0)2 s , (Equation 6b)

[0101] where x& b y is used to represent the AND operation of each bit in x with the 1-bit value y. Equation 6b can be obtained by Figure 10 The circuit shown is effectively implemented.

[0102] Figure 10 A cheap way to implement the multiplication a*b, where a belongs to the set S.

[0103] like Figure 10 As shown, the upper left cell labeled "Bitwise AND" accepts a 12-bit number b=b 11 b 10 b9b8b7b6b5b4b3b2b1b0, where b11 is the most significant bit and is based on the out k =b k & Perform a bitwise AND operation on k1 and k1. Figure 11 shows how to implement such a unit in hardware using only 11 AND gates, which is one of the cheapest computational units available in hardware. Figure 11 Shown Figure 10 Implementation of the "Bitwise AND" box in .

[0104] The output of the top left unit is shifted by one bit and a zero is inserted in the least significant bit position. This means the resulting value is 13 bits.

[0105] In a similar manner, the value b is bitwise ANDed with k0 in the lower left cell labeled "Bitwise AND." The output is not shifted, but the sign bit is extended so that the result is also 13 bits. This is indicated by the wiring diagram between the lower "Bitwise AND" cell and the adder. Figure 11A As shown, this does not contain any logic.

[0106] Copies the input bits to the output, with the most significant bit in 11 Copied to outputs out1 and out 11 The two most significant bits in .

[0107] These 13-bit values are then added together using a 13-bit adder. The output is 14 bits because one bit can be carried over. This result is then input to the unit labeled "Conditional Negation" which implements (-1) n Multiplication. Figure 12 shows how to implement such a unit in hardware. Figure 12 This example shows how to implement a conditional negator. If the value of n is 1, the input value is negated. If the value is 0, the input value remains unchanged.

[0108] As is well known to those skilled in the art, a value can be inverted by inverting all bits and adding 1. This should only be done if n=1. By using an exclusive-OR (XOR) gate, each input bit is inverted if n=1, and remains unchanged if n=0. The result is then fed to an adder where the other input is zero and where the carry bit is set to n. This means that if n=0, the value will remain unchanged, but if n=1, 1 will be added. The result is a 14-bit value that is inverted relative to the input if n=1 and remains unchanged otherwise.

[0109] at last, Figure 10 The rightmost box labeled "Variable Bit Shift" implements the multiplication by 2s This can be efficiently implemented using a barrel shifter, as in Figure 13 shown. Figure 13 A barrel shifter controlled by parameter s = s2s1s0 is shown, which shifts the input to the left (in Figure 13 s2 is the most significant bit in s.

[0110] Figure 13 The barrel shifter in

[15] consists of 51 1-bit multiplexers, and although it may look complex, it can be implemented very efficiently in hardware. The input to the barrel shifter is shifted left by s steps, where s = s2s1s0, and where s2 is the most significant bit.

[0111] Figures 10 to 13 This is just an example of how to implement this type of multiplication. There are usually cheaper ways to do it. Figure 10 As an example, Figure 12 An adder is used where one of the inputs is set to zero. It will be apparent to those skilled in the art that this does not require the use of a full general purpose adder, but rather the size of the adder can be reduced since we already know that one input will be zero.

[0112] The two most expensive operations are the 13-bit adder and the barrel shift. Assuming the barrel shifter is roughly as complex as the adder, the cost of the implementation is reduced to roughly two 13-bit adders.

[0113] 2. The hardware complexity assertion of the coefficient value is a power of 2 of 0, 1, 3, and 5

[0114] In some cases, the coefficients are restricted to only ±{0,1,3}×2 n The form may be a limitation. Most coefficients are close to zero, which means that the coefficients close to zero are the most important, such as {0, ±1, ±2, ±3, ±4, ±5, ±6, ±7, ±8, ±9, ±10}. Among these coefficients, only {0, ±1, ±2, ±3, ±4, ±6, ±8} can be represented by ±{0, 1, 3} × 2 n However, if we also allow 5×2 n , then we can also express ±5 and ±10. It turns out that creating a system that allows ±{0,1,3,5}×2 n The hardware is no better than creating a system that allows ±{0,1,3}×2 n The reason for this is that, just like factoring 3, multiplying a number by 5 can also be done with a single addition and shift, since 5x = 4x + x = (x < < 2) + x.

[0115] In general, equation 6b can be modified so that we can also incorporate the multiplication a*b when a=5:

[0116]

[0117] The difference compared to Equation 6 is that instead of always shifting by 1, we now shift by 1 or 2 steps, which is controlled by the variable s0. Another change compared to Equation 5 is that the variable s has changed its name to s1. Figure 14 shows how to build such a hardware implementation. Figure 14 It is shown that ±{0,1,3,5}×2 n The coefficients of the circuit are of the form .

[0118] When the general Figure 14 The pictures in Figure 10 When we compare the diagrams in Figure 1 and 2, we see that the main difference is in the box marked 803. Now, this will be the value of b& b k1 shifts one or two steps to the left, and Figure 10 In the example, it is always shifted to the left by one step. This means that both 3*b=(b<<1)+b and 5*b=(b<<2)+b can be constructed as the output of adder 805. The shift is controlled by the shift value s0. If s0=0, it shifts by 1 step, and if s0=1, it shifts by 2 steps. Figure 15 As shown, block 803 can be implemented inexpensively using 13 1-bit multiplexers. Figure 15 A circuit is shown that implements a left shift of 1 step (if s0=0) or 2 steps (if s0=1).

[0119] and Figure 14 Another difference is that the output of 802 is now sign extended by two bits to go from a signed 12-bit number to a signed 14-bit number using wiring labeled 804. Now it is possible to use a signal generator such as S 135 = ±{0,1,2,3,4,5,6,8,10,12,16,20,24,32,40,48,64}. Table 3 shows what values to set for k1, k2, s0 and s1 to obtain S 135 (For positive coefficients, the value of n is 0.) For negative coefficients, the values of k1, k2, s0, and s1 are the same as for positive coefficients, but n = 1.

[0120] Table 3: How to Write the allowed coefficients in the form

[0121]

[0122]

[0123] In one embodiment, we scale the CC-ALF coefficients so that they can be written as ±2 n or ±(2 n +2 n-1 ) or ±(2 n +2 n-2 ).

[0124] The given value range is between -128 and 128. In this embodiment, Z ext An example of a set 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 two 128 ={-128,-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64,128}. The set Z of filter coefficients should be selected from sub Then it becomes Z 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}.

[0125] The given value range is between -64 and 64. In this embodiment, Z ext An example of a set is {-48,-40,-24,-20,-12,-10,-6,-5,-3,3,5,6,10,12,20,24,40,48}. Here, Z two 64 ={-64,-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32,64}. The set Z of filter coefficients should be selected from sub Then it becomes Z 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}.

[0126] The given value range is between -32 and 32. In this embodiment, Z ext An example of a set is {-24,-20,-12,-10,-6,-5,-3,3,5,6,10,12,20,24}. Here, Z two32 ={-32,-16,-8,-4,-2,-1,0,1,2,4,8,16,32}. The set Z of filter coefficients should be selected from sub Then it becomes Z 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}.

[0127] The given value range is between -16 and 16. In this embodiment, Z ext An example of a set is {-12,-10,-6,-5,-3,3,5,6,10,12}. Here, Z two 16 ={-16,-8,-4,-2,-1,0,1,2,4,8,16}. The set Z of filter coefficients should be selected from sub Then it becomes Z sub ={-16,-12,-10,-8,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,8,10,12,16}.

[0128] The given value range is between -8 and 8. In this embodiment, Z ext An example of a set is {-6,-5,-3,3,5,6}. Here, Z two 8 ={-8,-4,-2,-1,0,1,2,4,8}. The set Z of filter coefficients should be selected from sub Then it becomes Z sub ={-8,-6,-5,-4,-3,-2,-1,0,1,2,3,4,5,6,8}.

[0129] 3. Software Implementation

[0130] The above description provides a detailed explanation of how to reduce hardware implementation costs. In some software architectures, if it is known that a belongs to the set S, the multiplication a*b can be implemented even faster. However, in other software architectures, multiplication may not be much more expensive than addition and shifting in terms of speed. On such architectures, using the current approach may not offer any advantages. However, it is always possible to implement it using only multiplication. Therefore, it can be said that regardless of the software architecture, the proposed extension will not be inferior to the extension in the current VVC draft or the extension in the CE test.

[0131] 4. Improved residual correction ΔI i Derivation of (x,y)

[0132] In the current CC-ALF anchor, the CC-ALF coefficient C L 2 is derived in the encoder 502 in the following way: C L 2=(-1)*(C L 0+C L 1+C L 3+C L 4+C L 5+C L 6+C L 7), and then clipped to the value range between [-32, 31], inclusive.

[0133] This may produce filtering errors because the sum of all 8 CC-ALF coefficients May not be equal to 0 due to clipping.

[0134] Assume that in a local area of the current picture (for example, in a CTU), the luminance reconstruction samples used in CC-ALF filtering are very flat. An extreme example is that all luminance reconstruction samples have the same sample value R L_const According to Equation 4, the residual correction is then derived as:

[0135]

[0136] If C L_sum =0, then ΔI i (x,y)=0, in which case it does not make any correction to the current chroma sample.

[0137] Otherwise, due to the clipping C L 2 to equal -32 or 31, ΔI i (x,y)≠0, so in this case, the average chroma sample value of the local area in the current picture will be changed, which is a strong artifact that may reduce the subjective quality of the decoded picture. To make matters worse, this average value cannot be compensated because the chroma residual (which can include average correction) occurs before CC-ALF processing. Therefore, it is likely to cause persistent artifacts in the chroma channel. If this design is used, the encoder is better to check it and then change some of the other coefficient values so that C L_sum This is to ensure that the value of C L 2=(-1)*(C L 0+C L 1+C L 3+C L 4+C L 5+C L 6+C L7) Keep it the same within the allowed range [-32, 32]. However, this is extra work for the encoder.

[0138] In one embodiment, the residual correction ΔI i The derivation of (x,y) is improved as follows:

[0139] ΔI i (x,y)=(C L 0*(R L (x L ,y L -1)-R L (x L ,y L ))+C L 1*(R L (x L -1,y L )-R L (x L ,y L ))+C L 3*(R L (x L +1,y L )-R L (x L ,y L ))+C L 4*(R L (x L -1,y L +1)-R L (x L ,y L ))+C L 5*(R L (x L ,y L +1)-R L (x L ,y L ))+C L 6*(R L (x L +1,y L +1)-R L (x L ,y L ))+C L 7*(R L (x L ,y L +2)-R L (x L ,y L ))+2 shiftFactor-1 )>>shiftFactor (Equation 8)

[0140] This can be written using the difference or delta value as

[0141] ΔI i (x,y)=(C L 0*ΔR L (x L ,y L -1)+C L 1*ΔR L (x L -1,y L )+C L 3*ΔR L (x L +1,y L )+C L 4*ΔR L (x L -1,y L +1)+C L 5*ΔR L (x L ,y L +1)+C L 6*ΔR L (x L +1,y L +1)+C L 7*ΔR L (x L ,y L +2)+2 shiftFactor-1 )>>shiftFactor, (Equation 8b)

[0142] Each increment value ΔR L (a,b) is calculated as the brightness value at position (a,b) minus C L 2 position (x L ,y L ) in the brightness value. As an example, the incremental value ΔR L (x L ,y L +1)=(R L (x L ,y L +1)-R L (x L ,y L ).

[0143] By correcting the residual ΔI i Improved derivation of (x,y) where all luminance reconstruction samples have the same sample value R L_const In a very flat local area, the residual correction is guaranteed to be ΔI i (x, y) = 0. Then use the following equation to correct the residual value ΔI i(x,y) and the unfiltered chroma sample value R C (x C ,y C ) to calculate the filtered chroma sample value

[0144] 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 signal in the bitstream. Another way to reduce the number of coefficients to be signaled is to calculate C in the same way as the anchor. L 2, namely C L 2=clip(-32,31,(-1)*(C L 0+C L 1+C L 3+C L 4+C L 5+C L 6+C L 7)), but then only avoid transmitting C L 2. The decoder must use this equation to recover C L 2. This will solve the problem of sending more than 7 coefficients, but will not solve the problem of having C L_sum ≠0 problem.

[0145] Essentially, the core idea of this embodiment is to obtain the first brightness value R L (x L ,y L ) and at least two other brightness values (e.g., R L (x L -1,y L ) and R L (x L ,y L -1)). At least two incremental values are obtained by subtracting the first brightness value from the other values, for example, ΔR L (x L -1,y L )=(R L (x L -1,y L )-R L (x L ,y L ) and ΔR L (x L ,y L -1)=(R L (x L ,y L -1)-R L (x L ,y L)). The at least two incremental values and the coefficient value are then used to calculate the residual correction value ΔI i (x,y). Finally, the residual correction value ΔI i (x,y) and the unfiltered chroma sample value R C (x C ,y C ) to calculate the filtered chroma value like

[0146] 5. Change the representation of filter coefficients

[0147] Several variants of improved low-complexity CC-ALF are described. This description uses CE5-2.2 as an anchor to illustrate the improvement in BD rate. Given a dynamic range of coefficients [min_value, max_value], in each of the proposed methods, the CC-ALF coefficients can be selected from the set Z sub ={Z two M ,Z ext}, where:

[0148] Z ext It's Z nopot M A subset of Z nopot M As defined above. As an example, Z nopot 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 Z ext An example of would be a subset of it, such as Z ext ={-24,-12,-6,-3,3,6,12,24}.

[0149] In other words, Z sub At least one value in the set Z ext .

[0150] 5.1 dynamic range [-8,8], Z ext ={-6,-3,3,6}, signaling 7 CC-ALF coefficients

[0151] In this embodiment, the dynamic range is the same as that of CE5-2.2, which is [-8, 8]. sub ={Z two 8 ,Z ext}, and Z ext ={-6,-3,3,6}. Compared to CE5-2.2 in which CC-ALF coefficients have values from the set {-8,-4,-2,-1,0,1,2,4,8}, CC-ALF coefficients are extended to have values from the set {-8,-6,-4,-3,-2,-1,0,1,2,3,4,6,8}. In this embodiment, CC-ALF coefficients can be written as 0 or ±2 n 0 or ±(2 n +2 n-1 ).

[0152] In this embodiment, we use the residual correction ΔI as described in this paper i Improved derivation of (x,y), hence 7 CC-ALF coefficients are signaled in the bitstream.

[0153] In this embodiment, the coefficient signaling uses truncated binary coding for the index of the coefficient magnitude, and then uses a 1-bit sign coding if the value of the coefficient magnitude is greater than 0. Table 4 shows the binarization of the coefficient signaling in this embodiment:

[0154] Table 4: In one embodiment, the coefficients are encoded using TB encoding.

[0155] Amplitude index Index bit 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

[0156] Compared with CE5-2.2, we get the following BD rate numbers:

[0157]

[0158]

[0159] Compared with the CE anchor, we obtain the following BD rate numbers:

[0160] Y U V YUV All interior -0.02% 0.08% -0.12% -0.02% Random Access 0.00% -0.13% -0.11% -0.02% Low Latency B

[0161] 5.2 Dynamic range [-8,8], Z ext ={-6,-3,3,6}, signaling 8 CC-ALF coefficients

[0162] In this embodiment, the dynamic range is the same as that of CE5-2.2, which is [-8, 8]. sub ={Z two 8 ,Z ext}, and Z ext ={-6,-3,3,6}. With CC-ALF coefficients from Z sub Set Z sub={-8,-4,-2,-1,0,1,2,4,8}, the CC-ALF coefficients are extended to have values from the set {-8,-6,-4,-3,-2,-1,0,1,2,3,4,6,8}. In this embodiment, the CC-ALF coefficients can be written as 0 or ±2 n 0 or ±(2 n +2 n-1 ).

[0163] In this example, we use the same residual correction ΔI as CE5-2.2 i (x,y) derivation process, so 8 CC-ALF coefficients are signaled in the bitstream. Since we have restricted the CC-ALF coefficients to have values from the set, it should be noted that there is a difference compared to the CE anchor, which has 7 coefficients trained on the encoder side, and one coefficient C L 2 by C L 2=(-1)*(C L 0+C L 1+C L 3+C L 4+C L 5+C L 6+C L 7) Export, with values clipped to the range [-32, 31], inclusive. This will give a value that may not come from the set Z sub Therefore, in this embodiment, all 8 CC-ALF coefficients are trained on the encoder side to ensure that the coefficient values come from the set Z sub .

[0164] The coefficient signaling in this embodiment uses truncated binary coding for the index of the coefficient magnitude, and then uses a 1-bit sign coding if the value of the coefficient magnitude is greater than 0. Table 5 shows the binarization of the coefficient signaling in this embodiment:

[0165] Table 5: In one embodiment, the coefficients are encoded using TB encoding.

[0166] Amplitude index Index bit 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

[0167] Compared with CE5-2.2, we get the following BD rate numbers:

[0168]

[0169] Compared with the CE anchor, we obtain the following BD rate numbers:

[0170] Y U V YUV All interior -0.02% 0.43% 0.39% 0.06% Random Access Low Latency B

[0171] 5.3 Dynamic range [-32, 32], Z ext ={-24,-12,-6,-3,3,612,24}, signaling 7 CC-ALF coefficients

[0172] In this embodiment, the dynamic range is the same as that of the CE anchor, which is [-32, 32]. sub ={Z two 32 ,Z ext}, and Z ext ={-24,-12,-6,-3,3,6,12,24}. Compared to CE5-2.2 in which CC-ALF coefficients have values from the set {-8,-4,-2,-1,0,1,2,4,8}, CC-ALF coefficients are extended to have values from the 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, CC-ALF coefficients can be written as 0 or ±2 n 0 or ±(2 n +2 n-1 ).

[0173] In this embodiment, we use the residual correction ΔI as described in 5.2 i Improved derivation of (x,y), hence 7 CC-ALF coefficients are signaled in the bitstream.

[0174] The coefficient signaling in this embodiment uses truncated binary coding for the index of the coefficient magnitude, and then uses a 1-bit sign coding if the value of the coefficient magnitude is greater than 0. Table 6 shows the binarization of the coefficient signaling in this embodiment:

[0175] Table 6: In one embodiment, the coefficients are encoded using TB encoding.

[0176] Amplitude index Index bit 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

[0177] Compared with CE5-2.2, we get the following BD rate numbers:

[0178]

[0179]

[0180] Compared with the CE anchor, we obtain the following BD rate numbers:

[0181] Y U V YUV All interior -0.02% -0.09% -0.28% -0.05% Random Access -0.01% -0.29% -0.32% -0.07% Low Latency B

[0182] 5.4 Dynamic range [-32, 32], Z ext={-24,-20,-12,-10,-6,-5,-3,3,5,6,10,12,20,24}, signaling 7 CC-ALF coefficients

[0183] In this embodiment, the dynamic range is the same as that of the CE anchor, which is [-32, 32]. sub ={Z two 32 ,Z ext}, and Z ext ={-24,-12,-10,-6,-5,-3,3,5,6,10,12,24}. Compared to CE5-2.2 in which CC-ALF coefficients have values from the set {-8,-4,-2,-1,0,1,2,4,8}, CC-ALF coefficients are extended to have values from the 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, CC-ALF coefficients can be written as 0 or ±2 n or ±(2 n +2 n-1 ) or ±(2 n +2 n-2 ).

[0184] In this embodiment, we use the residual correction ΔI as described in 5.2 i Improved derivation of (x,y), hence 7 CC-ALF coefficients are signaled in the bitstream.

[0185] The coefficient signaling in this embodiment uses truncated binary coding for the index of the coefficient magnitude, and then uses a 1-bit sign coding if the value of the coefficient magnitude is greater than 0. Table 7 shows the binarization of the coefficient signaling in this embodiment:

[0186] Table 7: In one embodiment, the coefficients are encoded using TB encoding.

[0187]

[0188]

[0189] Compared with CE5-2.2, we get the following BD rate numbers:

[0190] Y U V YUV All interior 0.01% -0.85% -0.85% -0.16% Random Access -0.01% -0.63% -0.75% -0.15% Low Latency B

[0191] Compared with the CE anchor, we obtain the following BD rate numbers:

[0192] Y U V YUV All interior -0.02% -0.11% -0.26% -0.05% Random Access -0.01% -0.29% -0.32% -0.07% Low Latency B

[0193] 5.5 Using signed truncated encoding for coefficients

[0194] In some embodiments, signed truncation coding may be used for coefficient signaling. Table 8 shows an example of how to encode CC-ALF coefficients:

[0195] Table 8: Example using signed truncation encoding for coefficients.

[0196] 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

[0197] The coefficients can be recovered using the following pseudocode:

[0198]

[0199] 5.6 Using Fixed-Length Coding for Coefficients

[0200] In some embodiments, a fixed length code may be used for the index of the coefficient magnitude, followed by a 1-bit sign. Table 9 shows an example of how the CC-ALF coefficients in one embodiment are encoded:

[0201] Table 9: Example using fixed-length encoding for coefficients.

[0202] Amplitude index Index bit 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

[0203] Note that encoding index 0 adds one bit. However, fixed-length encoding may be more efficient than truncated binary encoding in terms of parsing / decoding the bitstream.

[0204] Another example uses the full power of the 3-bit fixed-length encoding for the index of the coefficient magnitude. Instead of setting the dynamic range to [-8, 8], we set the CC-ALF coefficient dynamic range to [-12, 12]. Thus, the CC-ALF coefficients are extended to have values from the 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 coefficients can be encoded:

[0205] Table 10: Example of all capabilities using 3-bit fixed-length coding for coefficients

[0206] Amplitude index Index bit 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

[0207] Figure 16 is a flow chart illustrating a process 1600 for decoding an image according to an embodiment. The process 1600 may start at step s1602.

[0208] Step s1602 comprises obtaining a set of sample values associated with an image.

[0209] Step s1604 comprises employing a cross-component adaptive loop filter (CC-ALF) to generate 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 generate the first residual correction using the set of sample values and any set of N coefficient values, in which any set each 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 a subset of the following unique values: + / - 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 12, 14, 15, 16, 17, 18, 2 3, 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 + / - 3, 5, 6, 7, 9, 10, 12, 14, 15, 17, 18, 20, 24, 28, 30, 31, 32, 33, 34, 36, 40, 48, 56, 60, 62, 63, 65, 66, 68, 72, 80, 96, 112, 120, 124, 126, or 127.

[0210] Producing a first residual correction using the CC-ALF includes the steps of: a) obtaining a 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 so that the coefficient value must be equal to one of the values included in the set of M unique values.

[0211] Figure 17 is a flow chart illustrating a process 1700 for decoding an image according to an embodiment. The process 1700 may start at step s1702.

[0212] Step s1702 comprises obtaining a set of sample values associated with an image.

[0213] Step s1704 comprises obtaining an index value that points to a particular coefficient value group included in 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, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85 3, 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 coefficient value included in the 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.

[0214] Step s1706 comprises selecting a particular coefficient value group from a set of predefined coefficient value groups using an index value.

[0215] Step s1708 comprises computing a residual correction using a cross-component adaptive loop filter (CC-ALF) using i) a particular set of coefficient values selected from a set of predefined coefficient value groups and ii) a set of sample values.

[0216] Figure 18is a flow chart illustrating a process 1800 for decoding an image according to an embodiment. Process 1800 may begin at step s1802. Step s1802 includes obtaining a first luma sample value L1 associated with the image. Step s1804 includes obtaining a second luma sample value L2 associated with the image. Step s1806 includes obtaining a first luma delta value ΔL1, where ΔL1 = L2 - L1. Step s1808 includes using ΔL1 and a first coefficient value C1 to obtain a first product P1, where P1 = (C1)(ΔL1). There are multiple ways to obtain P1. For example, in one embodiment, if C1 is a power of 2, P1 may be obtained by bit-shifting ΔL1 based on C1. In another embodiment, if C1 = 3*2^n, P1 may be obtained by adding a shifted version of the delta value to itself and then shifting the result. In yet another embodiment, P1 may be obtained by multiplying C1 by ΔL1. Step s1810 comprises calculating a first residual correction value ΔI1 using P1 and the set of other products. Step s1812 comprises using the first residual correction value ΔI1 to correct the unfiltered chrominance values R associated with the image. C Filtering is performed to produce filtered chrominance values associated with the image

[0217] In some embodiments, filtering the unfiltered chroma values to produce filtered chroma values includes calculating:

[0218] In some embodiments, the set of other products includes a second product P2, P2 = (C2)(ΔL2), where C2 is a second coefficient value, ΔL2 is a second luma delta value equal to L3 - L1, and L3 is a third luma sample value associated with the image.

[0219] In some embodiments, L1 has a first position within a two-dimensional block of luma sample values associated with an image, where the first position has coordinates x1, y1, and L2 has a second position within the two-dimensional block of luma sample values, where the second position has coordinates 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.

[0220] 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.

[0221] In some embodiments, R Chas a position within a two-dimensional block of chrominance sample values associated with an image, wherein the coordinates of the position are xc, yc; L1 has a first position within a two-dimensional block of luminance 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 luminance sample values, wherein the coordinates of the second position are x2, y2; and the second position is from R C The position within the two-dimensional block of chroma sample values is obtained.

[0222] In some embodiments, x2=(Wc)(xc); y2=(Hc)(yc); Wc is a first predetermined coefficient based on the image format; and Hc is a second predetermined coefficient based on the image format.

[0223] In some embodiments, when the image format is 4:2:0, Wc=Hc=2; when the image format is 4:2:2, Wc=2 and Hc=1; and when the image format is 4:4:4, Wc=Hc=1.

[0224] Figure 20 is a flow chart illustrating a process 2000 performed by the encoder 302 according to one embodiment. The process 2000 may begin at step s2002.

[0225] Step s2002 comprises the encoder selecting a set of coefficient values for use by the CC-ALF of the decoder 504 in generating a residual correction value for use in filtering chroma sample values, the selected set of coefficient values consisting of N coefficient values. Each 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 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.

[0226] Step s2004 comprises the encoder providing the decoder 504 with N coefficient values or an index value for the decoder to determine a set of N coefficient values.

[0227] Figure 19 1 is a block diagram of an apparatus 1901 for implementing the encoder 502 or the decoder 504 according to some embodiments. That is, the apparatus 1901 may be adapted to perform the methods disclosed herein. In embodiments where the apparatus 1901 implements the encoder 502, the apparatus 1901 may be referred to as "encoding apparatus 1901," and in embodiments where the apparatus 1901 implements the decoder 504, the apparatus 1901 may be referred to as "decoding apparatus 1901." Figure 19 As shown, the device 1901 may include: a processing circuit (PC) 1902, which may include one or more processors (P) 1955 (for example, one or more general-purpose microprocessors and / or one or more other processors, such as application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), etc.), which may be co-located in a single housing or a single data center, or may be geographically distributed; one or more network interfaces 1948 (which may be located at the same location or geographically distributed), wherein each network interface includes a transmitter (Tx) 1945 and a receiver (Rx) 1947, for enabling the device 1901 to send data to and receive data from other nodes connected to a network 110 (for example, an Internet Protocol (IP) network), to which the network interface 1948 is connected; and one or more storage units (also referred to as "data storage systems") 1908, which may be located at the same location or geographically distributed, and which may include one or more non-volatile storage devices and / or one or more volatile storage devices. In embodiments where PC 1902 includes a programmable processor, a computer program product (CPP) 1941 may be provided. CPP 1941 includes a computer-readable medium (CRM) 1942 storing a computer program (CP) 1943 including computer-readable instructions (CRI) 1944. CRM 842 may be a non-transitory computer-readable medium, such as magnetic media (e.g., a hard drive), optical media, a memory device (e.g., random access memory, flash memory), or the like. In some embodiments, CRI 1944 of computer program 1943 is adapted such that, when executed by PC 1902, the CRI causes device 1901 to perform the steps described herein (e.g., the steps described herein with reference to the flowcharts). In other embodiments, device 1901 may be adapted to perform the steps described herein without requiring code. That is, for example, PC 1902 may consist solely of one or more ASICs. Thus, features of the embodiments described herein may be implemented in hardware and / or software.

[0228] References

[0229] Misra et al., “Cross-Component Adaptive Loop Filter for chroma,” JVET-O0636_r1, July 2019 (available at URL = phenix.it-sudparis.eu / jvet / doc_end_user / documents / 15_Gothenburg / wg11 / JVET-O0636-v2.zip)

[0230] 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)

[0231] Appendix A

[0232] Proposed changes to the VVC draft text

[0233] The following section describes an improved low complexity CC-ALF process for one embodiment, with example proposed changes to the current CC-ALF revised VVC draft text (reference CCALF-Text-JVET-P1008-v2-over-JVET-O2001-vE).

[0234] **START CHANGE**

[0235] 7.2 Specification of Syntax Functions and Descriptors

[0236] The functions presented here are used for syntactical description. These functions are expressed in terms of the value of a bitstream pointer, which indicates the location of the next bit to be read from the bitstream by the decoding process.

[0237] byte_aligned() is specified as follows:

[0238] – The return value of byte_aligned() is equal to TRUE if the current position in the bitstream is on a byte boundary, that is, the next bit in the bitstream is the first bit in a byte.

[0239] – Otherwise, the return value of byte_aligned() is equal to “FALSE”.

[0240] more_data_in_byte_stream() (which is used only for the byte stream NAL unit syntax structure specified in Appendix B) is specified as follows:

[0241] – If there is more data in the byte stream, the return value of more_data_in_byte_stream() is equal to TRUE.

[0242] – Otherwise, the return value of more_data_in_byte_stream() is equal to “FALSE”.

[0243] more_data_in_payload() is specified as follows:

[0244] – 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, then the return value of more_data_in_payload() is equal to FALSE.

[0245] – Otherwise, the return value of more_data_in_payload() is equal to TRUE.

[0246] more_rbsp_data() is specified as follows:

[0247] – If there is no more data in the raw byte sequence payload (RBSP), the return value of more_rbsp_data() is equal to FALSE.

[0248] – Otherwise, search the RBSP data for the last bit (least significant, rightmost bit) present in the RBSP that is equal to 1. 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:

[0249] – If there is more data in the RBSP before the rbsp_trailing_bits() syntax structure, the return value of more_rbsp_data() is equal to TRUE.

[0250] – Otherwise, the return value of more_rbsp_data() is equal to “FALSE”.

[0251] The method used to enable determining whether there is more data in the RBSP is specified by the application (or in Appendix B for applications using the byte stream format).

[0252] more_rbsp_trailing_data() is specified as follows:

[0253] – If there is more data in the RBSP, the return value of more_rbsp_trailing_data() is equal to TRUE.

[0254] – Otherwise, the return value of more_rbsp_trailing_data() is equal to “FALSE”.

[0255] next_bits(n) provides the next bits in the bitstream for comparison purposes, rather than

[0256] Advances the bitstream pointer. Provides access to the next n bits in the bitstream, where n is its argument. When used in the bytestream format specified in Annex B and there are fewer than n bits remaining in the bytestream, next_bits(n) returns the value 0.

[0257] payload_extension_present() is specified as follows:

[0258] – If the current position in the sei_payload() syntax structure is not the position of the last bit (least significant bit, rightmost bit) equal to 1, and the current position 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), then the return value of payload_extension_present() is equal to "TRUE".

[0259] – Otherwise, the return value of payload_extension_present() is equal to “FALSE”.

[0260] read_bits(n) reads the next n bits from the bitstream and advances the bitstream pointer by n bits. When n is equal to 0, read_bits(n) is specified to return a value equal to 0 and not advance the bitstream pointer.

[0261] The following descriptors specify the parsing process for each syntax element:

[0262] –ae(v): Context-adaptive arithmetic entropy coding syntax element. The parsing process of this descriptor is specified in Section 9.3.

[0263] -b(8): Byte has any bit string pattern (8 bits). The parsing process of this descriptor is specified by the return value of the function read_bits(8).

[0264] –f(n): A fixed-pattern bit string of n bits written from left to right, with the left bit first. The parsing process of this descriptor is specified by the return value of the function read_bits(n).

[0265] -i(n): Uses a signed integer of n bits. When n is "v" in the syntax table, the number of bits varies depending on the values of other syntax elements. The parsing process of this descriptor is specified by the return value of the function read_bits(n), which is interpreted as a two's complement integer representation with the most significant bit written first.

[0266] –se(v): a signed integer Exp-Golomb-encoded syntax element of order 0, left bit first. The parsing process for this descriptor is specified in Section 9.2, where the order k is equal to 0.

[0267] –u(n): An unsigned integer using n bits. When n is "v" in the syntax table, the number of bits varies depending on the values of other syntax elements. The parsing process of this descriptor is specified by the return value of the function read_bits(n), which is interpreted as the binary representation of an unsigned integer with the most significant bit written first.

[0268] –ue(v): unsigned integer 0th order Exp-Golomb coded syntax element, left bit first. The parsing process of this descriptor is specified in Section 9.2, where the order k is equal to 0.

[0269] –uek(v): unsigned integer k-th order Exp-Golomb coded syntax element, left bit first. The parsing process of this descriptor is specified in Section 9.2, where the order k is defined in the semantics of the syntax element.

[0270] –tb(v): truncated binary using at most maxVal bits, where maxVal is in the semantics of the syntax element The parsing process for this descriptor is specified in Section 0.

[0271] 7.3.2.14 Adaptive Loop Filter Data Syntax

[0272]

[0273]

[0274]

[0275] 7.4.3.14 Adaptive loop filter data semantics

[0276] alf_luma_filter_signal_flag equal to 1 specifies that the luma filter set is signaled. alf_luma_filter_signal_flag equal to 0 specifies that the luma filter set is not signaled.

[0277] alf_chroma_filter_signal_flag equal to 1 specifies that the chroma filter is signaled. alf_chroma_filter_signal_flag equal to 0 specifies that the chroma filter is not signaled. When ChromaArrayType is equal to 0, alf_chroma_filter_signal_flag shall be equal to 0.

[0278] The variable NumAlfFilters, which specifies the number of different adaptive loop filters, is set equal to 25.

[0279] alf_luma_clip_flag equal to 0 specifies that linear adaptive loop filtering is applied to the luma component. alf_luma_clip_flag equal to 1 specifies that nonlinear adaptive loop filtering may be applied to the luma component.

[0280] alf_luma_num_filters_signalled_minus1 specifies the number of adaptive loop filter categories that can signal luma coefficients plus 1. The value of alf_luma_num_filters_signalled_minus1 shall be in the range of 0 to NumAlfFilters-1, inclusive.

[0281] alf_luma_coeff_delta_idx[filtIdx] specifies the index of the signaled adaptive loop filter luma coefficient delta for the filter category indicated by filtIdx, which ranges from 0 to NumAlffilter - 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(Log2(alf_luma_num_filters_signalled_minus1+1)) bits.

[0282] alf_luma_coeff_signalled_flag equal to 1 indicates that alf_luma_coeff_flag[sfIdx] is signaled. alf_luma_coeff_signalled_flag equal to 0 indicates that alf_luma_coeff_flag[sfIdx] is not signaled.

[0283] alf_luma_coeff_flag[sfIdx] equal to 1 specifies that the coefficients of the luma filter indicated by sfIdx are signaled. 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.

[0284] alf_luma_coeff_abs[sfIdx][j] specifies the absolute value of the j-th coefficient of the luma filter of the signal indicated by sfIdx. When alf_luma_coeff_abs[sfIdx][j] is not present, it is inferred to be equal to 0.

[0285] The order k of the exp-Golomb binarization uek(v) is set equal to 3.

[0286] alf_luma_coeff_sign[sfIdx][j] specifies the sign of the j-th luma coefficient of the filter indicated by sfIdx as follows:

[0287] If alf_luma_coeff_sign[sfIdx][j] is equal to 0, the corresponding luma filter coefficient has a positive value.

[0288] Otherwise (alf_luma_coeff_sign[sfIdx][j] is equal to 1), the corresponding luma filter coefficient has a negative value.

[0289] When alf_luma_coeff_sign[sfIdx][j] is not present, it is inferred to be equal to 0.

[0290] The variable filtCoeff[sfIdx][j] is initialized as follows (where sfIdx=0..alf_luma_num_filters_signalled_minus1, j=0..11):

[0291] filtCoeff[sfIdx][j]=alf_luma_coeff_abs[sfIdx][j]*(1-2*alf_luma_coeff_sign[sfIdx][j]) (7-47)

[0292] With element AlfCoeff L [adaptation_parameter_set_id][filtIdx][j] Luma filter coefficient AlfCoeff L [adaptation_parameter_set_id] (where filtIdx = 0..NumAlfFilters-1 and j = 0..11) is derived as follows:

[0293] Alf Coeff L [adaptation_parameter_set_id][filtIdx][j]=filtCoeff[alf_luma_coeff_delta_idx[filtIdx]][j] (7-48)

[0294] The fixed filter coefficients AlfFixFiltCoeff[i][j] (where i=0..64, j=0..11) and the class of the filter map AlfClassToFiltMap[m][n] (where m=0..15 and n=0..24) are derived as follows:

[0295] AlfFixFiltCoeff= (7-49)

[0296] {

[0297] {0,0,2,-3,1,-4,1,7,-1,1,-1,5}

[0298] {0,0,0,0,0,-1,0,1,0,0,-1,2}

[0299] {0,0,0,0,0,0,0,1,0,0,0,0}

[0300] {0,0,0,0,0,0,0,0,0,0,-1,1}

[0301] {2,2,-7,-3,0,-5,13,22,12,-3,-3,17}

[0302] {-1,0,6,-8,1,-5,1,23,0,2,-5,10}

[0303] {0,0,-1,-1,0,-1,2,1,0,0,-1,4}

[0304] {0,0,3,-11,1,0,-1,35,5,2,-9,9}

[0305] {0,0,8,-8,-2,-7,4,4,2,1,-1,25}

[0306] {0,0,1,-1,0,-3,1,3,-1,1,-1,3}

[0307] {0,0,3,-3,0,-6,5,-1,2,1,-4,21}

[0308] {-7,1,5,4,-3,5,11,13,12,-8,11,12}

[0309] {-5,-3,6,-2,-3,8,14,15,2,-7,11,16}

[0310] {2,-1,-6,-5,-2,-2,20,14,-4,0,-3,25}

[0311] {3,1,-8,-4,0,-8,22,5,-3,2,-10,29}

[0312] {2,1,-7,-1,2,-11,23,-5,0,2,-10,29}

[0313] {-6,-3,8,9,-4,8,9,7,14,-2,8,9}

[0314] {2,1,-4,-7,0,-8,17,22,1,-1,-4,23}

[0315] {3,0,-5,-7,0,-7,15,18,-5,0,-5,27}

[0316] {2,0,0,-7,1,-10,13,13,-4,2,-7,24}

[0317] {3,3,-13,4,-2,-5,9,21,25,-2,-3,12}

[0318] {-5,-2,7,-3,-7,9,8,9,16,-2,15,12}

[0319] {0,-1,0,-7,-5,4,11,11,8,-6,12,21}

[0320] {3,-2,-3,-8,-4,-1,16,15,-2,-3,3,26}

[0321] {2,1,-5,-4,-1,-8,16,4,-2,1,-7,33}

[0322] {2,1,-4,-2,1,-10,17,-2,0,2,-11,33}

[0323] {1,-2,7,-15,-16,10,8,8,20,11,14,11}

[0324] {2,2,3,-13,-13,4,8,12,2,-3,16,24}

[0325] {1,4,0,-7,-8,-4,9,9,-2,-2,8,29}

[0326] {1,1,2,-4,-1,-6,6,3,-1,-1,-3,30}

[0327] {-7,3,2,10,-2,3,7,11,19,-7,8,10}

[0328] {0,-2,-5,-3,-2,4,20,15,-1,-3,-1,22}

[0329] {3,-1,-8,-4,-1,-4,22,8,-4,2,-8,28}

[0330] {0,3,-14,3,0,1,19,17,8,-3,-7,20}

[0331] {0,2,-1,-8,3,-6,5,21,1,1,-9,13}

[0332] {-4,-2,8,20,-2,2,3,5,21,4,6,1}

[0333] {2,-2,-3,-9,-4,2,14,16,3,-6,8,24}

[0334] {2,1,5,-16,-7,2,3,11,15,-3,11,22}

[0335] {1,2,3,-11,-2,-5,4,8,9,-3,-2,26}

[0336] {0,-1,10,-9,-1,-8,2,3,4,0,0,29}

[0337] {1,2,0,-5,1,-9,9,3,0,1,-7,20}

[0338] {-2,8,-6,-4,3,-9,-8,45,14,2,-13,7}

[0339] {1,-1,16,-19,-8,-4,-3,2,19,0,4,30}

[0340] {1,1,-3,0,2,-11,15,-5,1,2,-9,24}

[0341] {0,1,-2,0,1,-4,4,0,0,1,-4,7}

[0342] {0,1,2,-5,1,-6,4,10,-2,1,-4,10}

[0343] {3,0,-3,-6,-2,-6,14,8,-1,-1,-3,31}

[0344] {0,1,0,-2,1,-6,5,1,0,1,-5,13}

[0345] {3,1,9,-19,-21,9,7,6,13,5,15,21}

[0346] {2,4,3,-12,-13,1,7,8,3,0,12,26}

[0347] {3,1,-8,-2,0,-6,18,2,-2,3,-10,23}

[0348] {1,1,-4,-1,1,-5,8,1,-1,2,-5,10}

[0349] {0,1,-1,0,0,-2,2,0,0,1,-2,3}

[0350] {1,1,-2,-7,1,-7,14,18,0,0,-7,21}

[0351] {0,1,0,-2,0,-7,8,1,-2,0,-3,24}

[0352] {0,1,1,-2,2,-10,10,0,-2,1,-7,23}

[0353] {0,2,2,-11,2,-4,-3,39,7,1,-10,9}

[0354] {1,0,13,-16,-5,-6,-1,8,6,0,6,29}

[0355] {1,3,1,-6,-4,-7,9,6,-3,-2,3,33}

[0356] {4,0,-17,-1,-1,5,26,8,-2,3,-15,30}

[0357] {0,1,-2,0,2,-8,12,-6,1,1,-6,16}

[0358] {0,0,0,-1,1,-4,4,0,0,0,-3,11}

[0359] {0,1,2,-8,2,-6,5,15,0,2,-7,9}

[0360] {1,-1,12,-15,-7,-2,3,6,6,-1,7,30}

[0361] },

[0362] AlfClassToFiltMap= (7-50)

[0363] {

[0364] {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}

[0365] {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}

[0366] {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}

[0367] {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}

[0368] {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}

[0369] {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}

[0370] {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}

[0371] {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}

[0372] {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}

[0373] {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}

[0374] {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}

[0375] {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}

[0376] {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}

[0377] {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}

[0378] {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}

[0379] {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}

[0380] },

[0381] The requirement for bitstream consistency is AlfCoeff L The value of [adaptation_parameter_set_id][filtIdx][j] (where filtIdx = 0..NumAlfFilters-1, j = 0..11) should be between -2 7 to 2 7 The range is -1, inclusive.

[0382] alf_luma_clip_idx[sfIdx][j] specifies the clip index of the clipping value to use before multiplying the j-th coefficient of the signaled luma filter indicated by sfIdx. A bitstream conformance requirement is that the value of alf_luma_clip_idx[sfIdx][j] (where sfIdx = 0..alf_luma_num_filters_signalled_minus1 and j = 0..11) shall be in the range 0 to 3, packet-endian.

[0383] Has element AlfClip L [adaptation_parameter_set_id][filtIdx][j] Luma filter clipping value AlfClip L [adaptation_parameter_set_id] (where filtIdx = 0..NumAlfFilters-1 and j = 0..11) is derived as specified in Table 7-4, depending on which is set equal to BitDepth Y The bitDepth and clipIdx of alf_luma_clip_idx[alf_luma_coeff_delta_idx[filtIdx]][j] are set equal.

[0384] alf_chroma_num_alt_filters_minus1 plus 1 specifies the number of alternative filters for chroma components.

[0385] alf_chroma_clip_flag[altIdx] equal to 0 specifies that linear adaptive loop filtering is applied to the chroma components when the chroma filter with index altIdx is used; alf_chroma_clip_flag[altIdx] equal to 1 specifies that non-linear adaptive loop filtering is applied to the chroma components when the chroma filter with index altIdx is used. When not present, alf_chroma_clip_flag[altIdx] is inferred to be equal to 0.

[0386] alf_chroma_coeff_abs[altIdx][j] specifies the absolute value of the jth 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 to 0. A bitstream conformance requirement is that the value of alf_chroma_coeff_abs[altIdx][j] shall be between 0 and 2. 7 The range is -1, inclusive.

[0387] The order k of the exp-Golomb binarization uek(v) is set equal to 3.

[0388] 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:

[0389] If alf_chroma_coeff_sign[altIdx][j] is equal to 0, the corresponding chroma filter coefficient has a positive value.

[0390] Otherwise (alf_chroma_coeff_sign[altIdx][j] is equal to 1), the corresponding chroma filter coefficient has a negative value.

[0391] When alf_chroma_coeff_sign[altIdx][j] is not present, it is inferred to be equal to 0.

[0392] With element AlfCoeff C [adaptation_parameter_set_id][altIdx][j] chroma filter coefficient AlfCoeff C[adaptation_parameter_set_id][altIdx] (where altIdx = 0..alf_chroma_num_alt_filters_minus1, j = 0..5) is derived as follows:

[0393] Alf Coeff C [adaptation_parameter_set_id][altIdx][j]=alf_chroma_coeff_abs[altIdx][j]*(1-2*alf_chroma_coeff_sign[altIdx][j]) (7-51)

[0394] The requirement for bitstream consistency is AlfCoeff C The value of [adaptation_parameter_set_id][altIdx][j] (where altIdx = 0..alf_chroma_num_alt_filters_minus1, j = 0..5) should be between -2 7 -1 to 2 7 The range is -1, inclusive.

[0395] alf_cross_component_cb_filter_signal_flag equal to 1 specifies that the cross-component Cb filter is signaled. alf_cross_component_cb_filter_signal_flag equal to 0 specifies that the cross-component Cb filter is not signaled. When ChromaArrayType is equal to 0, alf_cross_component_cb_filter_signal_flag shall be equal to 0.

[0396] aalf_cross_component_cb_filters_signalled_minus1 plus 1 specifies the number of cross-component Cb filters signaled in the current ALF APS. The value of alf_cross_component_cb_filters_signalled_minus1 shall be in the range of 0 to 3.

[0397]

[0398]

[0399] alf_cross_component_cb_coeff_abs_idx[k][j] specifies the kth cross-component Cb filter set The absolute table index value of the j-th coefficient. When alf_cross_component_cb_coeff_abs_idx[k][j] does not exist, It is inferred to be equal to 0. The bitstream conformance requirement is alf_cross_component_cb_coeff_abs_idx[k][j] The value of shall be in the range of 0 to 10, inclusive. The maximum value of the tb(v) coding syntax element shall be 11.

[0400] alf_cross_component_cb_coeff_sign[k][j][k][j] specifies the kth cross component to be signaled The sign of the j-th coefficient of the component Cb filter set is as follows:

[0401] If alf_cross_component_cb_coeff_sign[k][j] is equal to 0, the corresponding cross-component Cb filter The device coefficient has a positive value.

[0402] Otherwise (alf_cross_component_cb_coeff_sign[k][j] is equal to 1), the corresponding cross-component Cb filtering The coefficient has a negative value.

[0403] When alf_cross_component_cb_coeff_sign[k][j] is not present, it is inferred to be equal to 0.

[0404] Cross-component Cb filter coefficient CcAlfApsCoeff Cb [adaptation_parameter_set_id][k][j] The guide is as follows:

[0405] CcAlfApsCoeff Cb [adaptation_parameter_set_id][k][j]=(7-51)

[0406] CcAlfApsCoeffMap[alf_cross_component_cb_coeff_abs_idx[k][j]]*(1-2* alf_cross_component_cb_coeff_sign[k][j])

[0407] CcAlfApsCoeffMap={0,1,2,3,4,6,8,12,16,24,32}

[0408] The bitstream consistency requirement is CcAlfApsCoeff Cb [adaptation_parameter_set_id][k][j] The value of (where i = 0...6) should be in the range of -32 to 32, inclusive.

[0409] alf_cross_component_cr_filter_signal_flag equal to 1 specifies that the cross-component Cr filter is signaled. alf_cross_component_cr_filter_signal_flag equal to 0 specifies that the cross-component Cr filter is not signaled. When ChromaArrayType is equal to 0, alf_cross_component_cr_filter_signal_flag shall be equal to 0.

[0410] alf_cross_component_cr_filters_signalled_minus1 plus 1 specifies the number of cross-component Cr filters signaled in the current ALF APS. The value of alf_cross_component_cr_filters_signalled_minus1 shall be in the range of 0 to 3.

[0411]

[0412] alf_cross_component_cr_coeff_abs_idx[k][j] specifies the kth cross-component Cr filter set The absolute table index value of the j-th coefficient. When alf_cross_component_cr_coeff_abs_idx[k][j] does not exist, It is inferred to be equal to 0. The bitstream conformance requirement is alf_cross_component_cr_coeff_abs_idx[k][j] The value of shall be in the range of 0 to 10, inclusive. The maximum value of the tb(v) coding syntax element shall be 11.

[0413] alf_cross_component_cr_coeff_sign[k][j][k][j] specifies the kth cross component to be signaled The sign of the j-th coefficient of the component Cr filter set is as follows:

[0414] If alf_cross_component_cr_coeff_sign[k][j] is equal to 0, the corresponding cross-component Cr filter The device coefficient has a positive value.

[0415] Otherwise (alf_cross_component_cr_coeff_sign[k][j] is equal to 1), the corresponding cross-component Cr filter The coefficient has a negative value.

[0416] When alf_cross_component_cr_coeff_sign[k][j] is not present, it is inferred to be equal to 0.

[0417] Cross-component Cr filter coefficient CcAlfApsCoeff Cr [adaptation_parameter_set_id][k][j] The guide is as follows:

[0418] CcAlfApsCoeff Cr [adaptation_parameter_set_id][k][j]=(7-52)

[0419] CcAlfApsCoeffMap[alf_cross_component_cr_coeff_abs_idx[k][j]]*(1-2* alf_cross_component_cr_coeff_sign[k][j])

[0420] CcAlfApsCoeffMap={0,1,2,3,4,6,8,12,16,24,32}

[0421] The bitstream conformance requirement is CcAlfApsCoeffCr[adaptation_parameter_set_id][k] The value of [j] (i=0...6) should be in the range of -32 to 32, inclusive.

[0422] alf_chroma_clip_idx[altIdx][j] specifies the clipping index of the clipping value to be used before multiplying the j-th coefficient of the alternative chroma filter with index altIdx. A bitstream conformance requirement is that the value of alf_chroma_clip_idx[altIdx][j] (where altIdx = 0..alf_chroma_num_alt_filters_minus1, j = 0..5) shall be in the range 0 to 3, inclusive.

[0423] Has element AlfClip C [adaptation_parameter_set_id][altIdx][j] chroma filter clipping value AlfClip C [adaptation_parameter_set_id][altIdx] (where altIdx = 0..alf_chroma_num_alt_filters_minus1, j = 0..5) is derived as specified in Table 7-4, depending on which is set equal to BitDepth C The bitDepth and clipIdx of alf_chroma_clip_idx[altIdx][j] are set equal to each other.

[0424] Table 7-4: Specifying AlfClip depending on bitDepth and clipIdx

[0425]

[0426]

[0427] Cross-component filtering of chroma sample blocks

[0428] The inputs to this process are:

[0429] The reconstructed luminance picture sample array recPicture before the luminance adaptive loop filtering process L ,

[0430] Filtered reconstructed chroma picture sample array alfPicture C ,

[0431] The chroma position (xCtbC, yCtbC) specifies the top left sample of the current chroma coding tree block relative to the top left sample of the current picture.

[0432] The width of the chroma sample block ccAlfWidth

[0433] The height of the chroma sample block ccAlfHeight

[0434] Cross-component filter coefficients CcAlfCoeff[j], where j = 0..6

[0435] The output of this process is the modified filtered reconstructed chrominance image sample array ccAlfPicture.

[0436] The coding tree block luma position (xCtb, yCtb) is derived as follows:

[0437] xCtb=(((xCtbC*SubWidthC)>>CtbLog2SizeY)< <CtbLog2SizeY(8-1229)

[0438] yCtb=(((yCtbC*SubHeightC)>>CtbLog2SizeY)< <CtbLog2SizeY(8-1229)

[0439] For the derivation of the filtered reconstructed chroma sample ccAlfPicture[xCtbC+x][yCtbC+y], each reconstructed chroma sample lfPicture in the current sample chroma block C [xCtbC+x][yCtbC+y] (where x=0..ccAlfWidth-1, y=0..ccAlfHeight-1) is filtered as follows:

[0440] The luma position (xL, yL) corresponding to the current chroma sample at chroma position (xCtbC+x, yCtbC+y) is set equal to ((xCtbC+x)*SubWidthC, (yCtbC+y)*SubHeightC)

[0441] Array recPicture L Brightness position within (h xL+i ,v yL+j ) (where i = -1..1, j = -1..2) is derived as follows:

[0442] 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_num_ver_virtual_boundaries-1, the following applies:

[0443] h xL+i =Clip3(PpsVirtualBoundariesPosX[n],pic_width_in_luma_samples-1,xL+i) (8-1229)

[0444] 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, then the following applies:

[0445] h x+i =Clip3(0,PpsVirtualBoundariesPosX[n]-1,xL+i) (8-1230)

[0446] Otherwise, the following applies:

[0447] h x+i =Clip3(0,pic_width_in_luma_samples-1,xL+i) (8-1231)

[0448] 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_num_hor_virtual_boundaries-1, the following applies:

[0449] v y+j =Clip3(PpsVirtualBoundariesPosY[n],pic_height_in_luma_samples-1,yL+j) (8-1232)

[0450] 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, then the following applies:

[0451] v y+j =Clip3(0,PpsVirtualBoundariesPosY[n]-1,yL+j) (8-1233)

[0452] Otherwise, the following applies:

[0453] v y+j =Clip3(0,pic_height_in_luma_samples-1,yL+j) (8-1234)

[0454] The variables clipLeftPos, clipRightPos, clipTopPos, and clipBottomPos are derived by calling the ALF boundary position derivation procedure specified in clause 8.8.5.5 with (xCtb, yCtb) and (xL–xCtb, yL–yCtb) as input.

[0455] The vertical sample position offsets yM1, yP1, and yP2 are specified in Table x- according to the vertical luma sample position yL, clipLeftPos, and clipRightPos.

[0456] The horizontal sample position offsets xM1 and xP1 are specified in Table y-yyyy based on the horizontal luma sample position xL, clipLeftPos, and clipRightPos.

[0457] The variable curr is derived as follows:

[0458] curr=alfPicture C [xCtbC+x,yCtbC+y] (8-1286)

[0459] The array of cross-component filter coefficients f[j] (where j = 0..6 ) is derived as follows:

[0460] f[j]=CcAlfCoeff[j] (8-1287)

[0461] The variable sum is derived as follows:

[0462]

[0463] sum=f[0]*(recPicture L [h x ,v y+yM1 ]-recPicture L [h x ,v y ])+f[1]*(recPicture L [h x+xM1 ,v y ]-recPicture L [h x ,v y ])+f[2]*(recPicture L [h x+xP1 ,v y ]-recPicture L [h x ,v y ])+f [3]*(recPicture L [h x+xM1 ,v y+yP1 ]-recPicture L [h x ,v y ])+f[4]*(recPicture L [h x ,v y+yP1 ]- recPicture L [h x ,v y ])+f[5]*(recPicture L [h x+xP1 ,v y+yP1 ]-recPicture L [h x ,v y ])+f[6]* (recPicture L [h x ,v y+yP2 ]-recPicture L [h x ,v y ])

[0464] sum=Clip3(-(1<<(BitDepth C -1)),(1<<(BitDepth C -1))-1,sum)(8-1290)

[0465] sum=curr+(sum+64)>>(7+(BitDepth Y -BitDepth C ))(8-1290)

[0466] The modified filtered reconstructed chroma picture sample array ccAlfPicture[xCtbC+x][yCtbC+y] is derived as follows:

[0467] ccAlfPicture[xCtbC+x][yCtbC+y]=Clip3(0,(1< <BitDepth C )-1,sum)(8-1291)

[0468] Table xx-xx: Specifying yM1, yP1, and yP2 according to vertical luminance sample position yL, clipTopPos, and clipBottomPos

[0469] 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

[0470] Table y-yy: Specifying xM1 and xP1 based on horizontal luma sample position xL, clipLeftPos, and clipRightPos

[0471] condition xM1 xP1 xL==clipLeftPos 0 0 xL==clipRightPos-1 0 0 xL == clipRightPos–2 -1 1 otherwise -1 1

[0472] 9.3 Parsing process of truncated binary code

[0473] This process is called when the descriptor of the syntax element in the syntax table in subclause 7.3 is equal to tb(v).

[0474] The input to this process is the bits from the RBSP and the maximum value maxVal.

[0475] The output of this process is the syntax element value.

[0476] The syntax element coded as tb(v) is truncated binary coded. First, the possible value range of the syntax element is determined. The range of this syntax element is 0 to maxVal, inclusive, where maxVal is greater than or equal to 1. The value synVal is given by the procedure specified as follows:

[0477]

[0478]

[0479] The value returned from read bits(th) is interpreted as a binary representation of an unsigned integer, with the smallest bit written first. Most significant bit.

[0480] **END CHANGE**.

Claims

1. A method (1800) for encoding or decoding an image, the method comprising: obtaining (s1802) a first luminance sample value L1 associated with the image; obtaining (s1804) a second luminance sample value L2 associated with said image; Obtaining (s1806) a first brightness increment value ΔL1, where ΔL1=L2-L1; Obtaining (s1808) a first product P1 using ΔL1 and the first coefficient value C1, where P1 = (C1)(ΔL1); calculating (s1810) a first residual correction value ΔI1 using P1 and at least a second product P2, where P2=(C2)(ΔL2), C2 is a second coefficient value, ΔL2 is a second luma delta value equal to L3-L1, and L3 is a third luma sample value associated with the image; and Using the first residual correction value ΔI1, the unfiltered chrominance values associated with the image are corrected. Filtering is performed (s1812), thereby generating filtered chrominance values associated with the image .

2. The method according to claim 1, wherein Filtering the unfiltered chroma values to produce the filtered chroma values comprises calculating: ΔI1+ .

3. The method according to claim 1 or 2, wherein L1 has a first position within a two-dimensional block of luminance 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 luminance 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.

4. The method according to claim 3, 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.

5. The method according to claim 1 or 2, wherein R C has a position within a two-dimensional block of chrominance sample values associated with the image, the position having coordinates xc, yc, L1 has a first position within a two-dimensional block of luminance 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 from R C The positions within the two-dimensional block of chroma sample values are obtained.

6. The method according to claim 5, wherein x2=(Wc)(xc), y2=(Hc)(yc), Wc is a first predetermined coefficient based on the format of the image, and Hc is a second predetermined coefficient based on the format of the image.

7. The method according to claim 6, 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.

8. A computer-readable storage medium containing a computer program (1943), the computer program (1943) comprising instructions (1944) which, when executed by a processing circuit (1902), cause the processing circuit (1902) to perform the method according to any one of claims 1 to 7.

9. A device (1901) for encoding or decoding an image, the device comprising: Processing Circuit (1902); as well as A memory (1942) containing instructions (1944) executable by the processing circuitry, whereby the apparatus is operable to perform a method according to any one of claims 1 to 7.