Method, Apparatus and Device for Filtering - Patent application

The filtering method in the encoding/decoding device addresses the poor performance of conventional techniques by dynamically selecting between two centrosymmetric filters based on the adaptive correction filtering unit's capabilities, resulting in improved filtering flexibility and performance.

JP7671853B2Active Publication Date: 2025-05-02HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 6 Cites 0 Cited by

Patent Information

Application Number
JP2023547310
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2021-03-05
Filing Date
2022-03-02
Publication Date
2025-05-02
Estimated Expiration
2042-03-02

AI Technical Summary

Technical Problem

Conventional loop post-processing techniques for video encoding/decoding suffer from poor filtering performance, particularly due to encoding noise and distortion introduced by quantization operations.

Method used

A filtering method is applied to an encoding/decoding device, which determines whether the current adaptive correction filtering unit allows the use of extended adaptive correction filtering. Based on this determination, either a 7*7 cross +5*5 square centrosymmetric filter or a 7*7 cross +3*3 square centrosymmetric filter is used for adaptive correction filtering.

Benefits of technology

This approach enhances filtering flexibility and optimizes filtering effects, thereby improving the overall performance of video encoding/decoding.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007671853000017
    Figure 0007671853000017
  • Figure 0007671853000018
    Figure 0007671853000018
  • Figure 0007671853000019
    Figure 0007671853000019
Patent Text Reader

Abstract

The present invention provides a filtering method, apparatus and device. According to an embodiment, the filtering method includes: determining whether a current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering; if the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, a first filter is used to perform adaptive compensation filtering on the current adaptive compensation filtering unit; if the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering, a second filter is used to perform adaptive compensation filtering on the current adaptive compensation filtering unit, where the first filter is a 7*7 cross+5*5 square centrosymmetric filter, and the second filter is a 7*7 cross+3*3 square centrosymmetric filter.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

[0001] The present invention relates to video encoding / decoding techniques, and in particular to a method, apparatus and device for filtering. [Background technology]

[0002] Complete video coding generally includes operations such as prediction, transformation, quantization, entropy coding, filtering, etc. Block-based motion compensation is followed by a quantization operation, which generates coding noise and causes video quality distortion. In general, loop post-processing techniques can be used to reduce the impact of such distortion. However, practice shows that the filtering performance of conventional loop post-processing techniques is poor. Summary of the Invention [Means for solving the problem]

[0003] In view of the above, the present invention provides a filtering method, apparatus and device. Specifically, the present invention is realized by the following technical solutions:

[0004] According to a first aspect of the embodiment of the present invention, a filtering method is provided for an encoding / decoding device, the method includes: determining whether a current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering; if the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, performing adaptive compensation filtering for the current adaptive compensation filtering unit using a first filter; if the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering, performing adaptive compensation filtering for the current adaptive compensation filtering unit using a second filter, where the first filter is a 7*7 cross+5*5 square centrosymmetric filter, and the second filter is a 7*7 cross+3*3 square centrosymmetric filter.

[0005] In conjunction with the first aspect, in a first possible implementation form, the step of determining whether the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering includes the steps of: determining a value of a flag bit for indicating whether the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering; and, if the value of the flag bit is a first value, determining that the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering; and, if the value of the flag bit is a second value, determining that the current adaptive correction filtering unit does not allow the use of advanced adaptive correction filtering. Here, the flag bit for indicating whether the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering may be EalfEnableFlag, and the value of EalfEnableFlag may be derived from the decoding device, or the value of EalfEnableFlag may be obtained from a bitstream in the decoding device, or the value of EalfEnableFlag may be a constant value. Obtaining the value of the EalfEnableFlag from the bitstream in the decoding device may include determining the value of the EalfEnableFlag based on the value of an extended adaptive correction filtering enable flag obtained by parsing the bitstream, and the extended adaptive correction filtering enable flag may be a sequence level parameter.

[0006] In conjunction with the first aspect, in a second possible implementation form, the method further includes: in the process of performing adaptive correction filtering on a current filtering pixel in a current adaptive correction filtering unit, for any reference pixel of the current filtering pixel, if the reference pixel is located within the current adaptive correction filtering unit, performing adaptive correction filtering using a pixel value of the reference pixel; if the reference pixel is not located within the current adaptive correction filtering unit, and if the pixel value of the reference pixel cannot be obtained, performing adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel; and if the pixel value of the reference pixel has been obtained, performing adaptive correction filtering using the pixel value of the reference pixel.

[0007] In conjunction with the second possible implementation form of the first aspect, in a third possible implementation form, when the pixel value of the reference pixel cannot be obtained, the reference pixel includes one of the following: the reference pixel is located outside the image boundary of the current image frame; the reference pixel is located outside the patch boundary of the current patch and filtering across the patch boundary is not allowed; and the reference pixel is located outside the upper boundary or lower boundary of the current adaptive correction filtering unit.

[0008] In conjunction with the second possible implementation form of the first aspect or the third possible implementation form of the first aspect, in a fourth possible implementation form, the method further includes: when the current adaptive correction filtering unit determines to allow the use of extended adaptive correction filtering and a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, performing adaptive correction filtering using a pixel of the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel; and when the current adaptive correction filtering unit determines not to allow the use of extended adaptive correction filtering and a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, performing adaptive correction filtering using a pixel of the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel.

[0009] According to a second aspect of the embodiment of the present invention, a filtering device is provided for use in an encoding / decoding device, the filtering device includes a filtering unit for determining whether a current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, the filtering unit is further used for performing adaptive compensation filtering for the current adaptive compensation filtering unit using a first filter when the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and for performing adaptive compensation filtering for the current adaptive compensation filtering unit using a second filter when the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering, where the first filter is a 7*7 cross+5*5 square centrosymmetric filter, and the second filter is a 7*7 cross+3*3 square centrosymmetric filter.

[0010] In conjunction with the second aspect, in a first possible implementation form, the filtering unit determines whether the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering, and includes determining a value of a flag bit for indicating whether the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering, and if the value of the flag bit is a first value, determining that the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering, and if the value of the flag bit is a second value, determining that the current adaptive correction filtering unit does not allow the use of advanced adaptive correction filtering. Here, the flag bit for indicating whether the current adaptive correction filtering unit allows the use of advanced adaptive correction filtering may be EalfEnableFlag, and the value of EalfEnableFlag may be derived from the decoding device, or the value of EalfEnableFlag may be obtained from a bitstream in the decoding device, or the value of EalfEnableFlag may be a constant value. Obtaining the value of the EalfEnableFlag from the bitstream in the decoding device may include determining the value of the EalfEnableFlag based on the value of an extended adaptive correction filtering enable flag obtained by parsing the bitstream, and the extended adaptive correction filtering enable flag may be a sequence level parameter.

[0011] In conjunction with the second aspect, in a second possible implementation form, the filtering unit is further used to, in the process of performing adaptive correction filtering on a current filtering pixel in a current adaptive correction filtering unit, perform adaptive correction filtering using a pixel value of a reference pixel of the current filtering pixel if the reference pixel is located within the current adaptive correction filtering unit, and if the reference pixel is not located within the current adaptive correction filtering unit and the pixel value of the reference pixel cannot be obtained, perform adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel, and if the pixel value of the reference pixel is obtained, perform adaptive correction filtering using the pixel value of the reference pixel.

[0012] In conjunction with the second possible implementation form of the second aspect, in a third possible implementation form, when the pixel value of the reference pixel cannot be obtained, the reference pixel includes one of the following: the reference pixel is located outside the image boundary of the current image frame; the reference pixel is located outside the patch boundary of the current patch and filtering across the patch boundary is not allowed; and the reference pixel is located outside the upper boundary or lower boundary of the current adaptive correction filtering unit.

[0013] In conjunction with the second possible implementation form of the second aspect or the third possible implementation form of the second aspect, in a fourth possible implementation form, the filtering unit is further used to perform adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel when the current adaptive correction filtering unit determines that the use of extended adaptive correction filtering is permitted and a pixel value of a reference pixel for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, and to perform adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel when the current adaptive correction filtering unit determines that the use of extended adaptive correction filtering is not permitted and a pixel value of a reference pixel for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained.

[0014] According to a third aspect of an embodiment of the present invention, there is provided a decoding device, comprising a processor and a machine-readable storage medium having stored thereon machine-executable instructions executable by the processor, the processor being adapted to execute the machine-executable instructions so as to implement the filtering method provided according to the first aspect above.

[0015] According to a fourth aspect of an embodiment of the present invention, there is provided an encoding device, comprising a processor and a machine-readable storage medium having stored thereon machine-executable instructions executable by the processor, the processor being adapted to execute the machine-executable instructions so as to implement the filtering method provided by the first aspect above.

[0016] The filtering method of the embodiment of the present invention determines whether a current adaptive compensation filtering unit is allowed to use extended adaptive compensation filtering, and if it is determined that the current adaptive compensation filtering unit is allowed to use extended adaptive compensation filtering, a first filter is used to perform adaptive compensation filtering on the current adaptive compensation filtering unit, and if it is determined that the current adaptive compensation filtering unit is not allowed to use extended adaptive compensation filtering, a second filter is used to perform adaptive compensation filtering on the current adaptive compensation filtering unit, thereby improving the flexibility of filter selection, optimizing the filtering effect, and improving the encoding / decoding performance. [Brief description of the drawings]

[0017] [Figure 1A] 1 is a flowchart showing video encoding / decoding. [Figure 1B] 1 is a flowchart showing video encoding / decoding. [Diagram 2] FIG. 1 is a schematic diagram showing region division. [Diagram 3] FIG. 1 is a schematic diagram showing region merging. [Figure 4A] FIG. 1 is a schematic diagram showing a centrally symmetric filter shape of 7*7 cross+5*5 square. [Figure 4B] FIG. 4B is a schematic diagram showing reference pixels corresponding to the filter shown in FIG. 4A. [Figure 4C] FIG. 13 is a schematic diagram showing reference pixel positions for filtering for a current adaptive correction filtering unit; [Diagram 5] FIG. 4 is a schematic diagram of a sample filtering compensation unit according to an exemplary embodiment of the present invention; [Figure 6A] 4 is a flow chart of a filtering method according to an exemplary embodiment of the present invention. [Figure 6B] 4 is a flow chart of a filtering method according to an exemplary embodiment of the present invention. [Figure 7]4 is a flow chart of a filtering method according to an exemplary embodiment of the present invention. [Figure 8] 4 is a flow chart of a filtering method according to an exemplary embodiment of the present invention. [Figure 9] FIG. 1 is a schematic diagram showing a centrally symmetric filter shape of 7*7 cross+3*3 square. [Figure 10] FIG. 2 is a schematic diagram illustrating a consolidation region according to an exemplary embodiment of the present invention. [Figure 11A] 1 is a schematic diagram illustrating a number of different filter shapes according to an exemplary embodiment of the present invention. [Figure 11B] 1 is a schematic diagram illustrating a number of different filter shapes according to an exemplary embodiment of the present invention. [Figure 11C] 1 is a schematic diagram illustrating a number of different filter shapes according to an exemplary embodiment of the present invention. [Figure 11D] 1 is a schematic diagram illustrating a number of different filter shapes according to an exemplary embodiment of the present invention. [Figure 12] FIG. 2 is a schematic diagram illustrating a 3*3 pixel block according to an exemplary embodiment of the present invention; [Figure 13] FIG. 2 is a schematic diagram illustrating a filter with asymmetric filtering coefficients according to an exemplary embodiment of the present invention; [Figure 14A] FIG. 4 is a schematic diagram illustrating reference pixel locations according to an exemplary embodiment of the present invention; [Figure 14B] FIG. 4 is a schematic diagram illustrating another reference pixel location according to an exemplary embodiment of the present invention. [Figure 15A] FIG. 2 is a schematic diagram illustrating a quadratic segmentation for multiple regions obtained by a fixed region segmentation method according to an exemplary embodiment of the present invention; [Figure 15B] FIG. 2 is a schematic diagram illustrating a quadratic segmentation for multiple regions obtained by a fixed region segmentation method according to an exemplary embodiment of the present invention; [Figure 15C] FIG. 15B is a schematic diagram illustrating region numbers corresponding to each secondary division method in FIG. 15A according to an exemplary embodiment of the present invention. [Figure 16] 1 is a schematic diagram illustrating a structure of a filtering device according to an exemplary embodiment of the present invention; [Figure 17] 1 is a schematic diagram illustrating a structure of a filtering device according to an exemplary embodiment of the present invention; [Figure 18] 2 is a schematic diagram illustrating a hardware structure of a decoding device according to an exemplary embodiment of the present invention; [Figure 19] FIG. 2 is a schematic diagram illustrating a hardware structure of an encoding device according to an exemplary embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0018] Exemplary embodiments will now be described in detail, examples of which are illustrated in the accompanying drawings. When the following description refers to the drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise specified. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present invention. On the contrary, they are merely examples of apparatus and methods consistent with certain aspects of the present invention, as detailed in the appended claims.

[0019] The terminology used in the present invention is for the purpose of describing particular embodiments only and is not intended to limit the present invention. As used in the present invention and the appended claims, the singular forms "a," "the," and "the" are intended to include the plural forms unless the context clearly dictates otherwise.

[0020] In the following, first, technical terms related to the embodiments of the present invention, the main flow of existing video encoding / decoding, and the realization of ALF filtering technology will be briefly described. 1. Technical terms

[0021] 1. Rate-Distortion Optimized (RDO) Principle: The indexes for evaluating coding efficiency include bit rate and Peak Signal to Noise Ratio (PSNR). The smaller the bit rate, the higher the compression rate, and the higher the PSNR, the better the reconstructed image quality. When selecting a mode, the discriminant is essentially a comprehensive evaluation of both.

[0022] The cost corresponding to the mode is: J(mode)=D+λ*R, where D stands for distortion, which is generally measured using the SSE (Sum of Squared Errors) index, where SSE refers to the sum of squared residuals between the reconstructed block and the source image block, λ is the Lagrange multiplier, and R is the actual number of bits required to code the image block in the mode, including the sum of bits required for coding mode information, motion information, residuals, etc. When selecting a mode, using the RDO principle to compare and determine the coding modes can generally ensure optimal coding performance.

[0023] 2. Coding Tree Unit (CTU): Traditional video coding is based on macroblocks. For 4:2:0 sampling format video, one macroblock includes one 16x16 luma block and two 8x8 chroma blocks. Considering the characteristics of high definition video / ultra definition video, a CTU is introduced into Versatile Video Coding (VVC), whose size is specified by the encoder and allowed to be larger than the macroblock size. A co-located luma coding tree block (CTB) and two chroma CTBs, together with corresponding syntax elements, constitute one CTU. In VVC, for one LxL luma CTB, L∈{8,16,32,64,128}.

[0024] The size of the luminance CTB is within the range of {8x8, 16x16, 32x32, 64x64, 128x128}.

[0025] The size of the chromaticity CTB can be within the range of {4x4, 8x8, 16x16, 32x32, 64x64}.

[0026] In high definition video encoding processes, a larger CTB results in higher compression efficiency.

[0027] 3. Deblocking Filter (DBF): The image coding process is based on different blocks, and relatively independent coding is performed within each block. Because different parameters are used for different blocks, the distribution characteristics within the blocks are independent of each other, and there is discontinuity at the edges of the blocks, which can be called the block effect. Deblocking filtering mainly smoothes the boundaries of the blocks to remove the block effect.

[0028] 4. Sample Adaptive Offset (SAO): Start from the pixel domain, classify the reconstructed image based on its characteristics, and then perform compensation in the pixel domain, mainly to reduce ringing.

[0029] 5. Adaptive Leveling Filter (ALF): This is applied after DBF and SAO, mainly to further improve image quality under objective conditions. ALF technology builds a multiple regression model based on the least squares method according to the characteristics of the reference pixels, and performs filtering correction on the pixel area.

[0030] Illustratively, post-loop processing techniques may include DBF, SAO, and ALF.

[0031] 6. Wiener filtering: Essentially, it involves minimizing the mean square of the estimation error (defined as the difference between the desired response and the actual output of the filter). II. Main flow of video encoding / decoding

[0032] Referring to Figure 1A, taking video encoding as an example, video encoding generally includes processes such as prediction, transformation, quantization, entropy encoding, etc. Furthermore, the encoding process may be realized according to the frame of Figure 1B.

[0033] Here, prediction is divided into intra prediction and inter prediction. Intra prediction is to predict a current uncoded block by using surrounding coded blocks as references, thereby effectively removing redundancy in the spatial domain. Inter prediction is to predict a current image by using adjacent coded images, thereby effectively removing redundancy in the temporal domain.

[0034] Transformation refers to converting an image from the spatial domain to the transform domain and using transform coefficients to represent the image. Many images contain many flat and slowly varying regions, and an appropriate transform can convert an image from a dispersed distribution in the spatial domain to a relatively concentrated distribution in the transform domain. In other words, transforms can remove frequency domain correlations between signals, and can effectively compress the bitstream in cooperation with the quantization process.

[0035] Entropy coding is a lossless coding method that converts a series of element symbols into a binary bitstream for transmission or storage, where the input symbols may include quantized transform coefficients, motion vector information, prediction mode information, transform and quantization related syntax, etc. Entropy coding can effectively remove redundancy in the video element symbols.

[0036] Video decoding is in contrast to the process of video encoding, i.e., video decoding generally includes processes such as entropy decoding, prediction, inverse quantization, inverse transform, filtering, etc., and the realization principle of each process in video decoding is the same as or similar to the process in video encoding. 3. Realization of ALF filtering technology

[0037] The ALF technique used in the frames of the Audio Video coding Standard (AVS) calculates the optimal achievable linear filtering of the raw and distorted signals in the mean square sense according to the Wiener filtering principle.

[0038] The ALF coding flow may include region division, reference pixel acquisition, region integration, filtering coefficient calculation, and decision-making of whether each LCU starts filtering. In the whole process, the parameters that need to be calculated and obtained include: 1) the number of filtering parameters, 2) region integration identifier, 3) filtering coefficient of each group, 4) identifier of whether LCU starts filtering, and 5) identifier of whether current component (Y, U, V) starts filtering.

[0039] Some of the processes and concepts of ALF filtering are explained in detail below. 1, area division

[0040] In the ALF flow, for the acquired reconstructed video data, region segmentation processing is performed on the luminance component data, and region non-segmentation processing is performed on the chrominance component data.

[0041] Exemplarily, a specific realization process of region division may be to divide an image into 16 regions of approximately the same size and aligned based on LCU. The width of the non-rightmost region is (((pic_width_InLcus+1) / 4)×Lcu_Width), where pic_width_InLcus represents the number of LCUs in the width of the image, and Lcu_Width represents the width of each LCU. The width of the rightmost region is the difference between the width of the image and the widths of the three non-rightmost regions (the width of the image minus the sum of the widths of the three non-rightmost regions).

[0042] Similarly, the height of the non-bottom regions is (((pic_height_InLcus+1) / 4) × Lcu_Height), where pic_height_InLcus represents the number of LCUs in the image height, and Lcu_Height indicates the height of each LCU. The height of the bottom-most region is the difference between the image height and the heights of the three non-bottom regions (image height minus the sum of the heights of the three non-bottom regions).

[0043] Figure 2 shows an example of how to assign an index value to each region after obtaining the region segmentation results for the entire image. 2. Area integration

[0044] Region merging refers to judging whether adjacent regions should be merged based on the order of index values. The purpose of the merge is to reduce the coding coefficient. It is necessary to use a merge identifier to indicate whether the current region should be merged with the adjacent region.

[0045] For example, after performing the region division as described above, a total of 16 regions (which may be called 16 classes or 16 groups, with index values ​​ranging from 0 to 15, respectively) are included, and in the first integration, integration is attempted in the order of region 0 and region 1, region 1 and region 2, region 2 and region 3, ..., region 13 and region 14, and region 14 and region 15, and the first region integration is performed using the integration method that minimizes the error, thereby integrating the 16 regions into 15 regions.

[0046] For the 15 regions after the first integration (assuming that regions 2 and 3 are integrated, we obtain region 2+3), we attempt to integrate regions 0 and 1, regions 1 and 2+3, regions 2+3 and 4, ..., regions 13 and 14, and regions 14 and 15 in that order, and by performing the second integration using the integration method that minimizes the error, the 15 regions are integrated into 14 regions.

[0047] For the 14 regions after the second integration (assuming that regions 14 and 15 are integrated, region 14+15 is obtained, i.e., the integrated region includes regions 2+3 and 14+15), integration is attempted in the order of regions 0 and 1, regions 1 and 2+3, regions 2+3 and 4, ..., regions 12 and 13, and regions 13 and 14+15, and the third integration is performed using the integration method that minimizes the error, thereby integrating the 14 regions into 13 regions.

[0048] This analogy continues until one merges into a single region, the schematic of which may be as shown in FIG.

[0049] After the above region integration operation is completed, the error when performing Wiener filtering on the entire frame image is calculated in the following order: when no region integration is performed (16 regions in total), when region integration is performed once (15 regions in total), ..., when region integration is performed 14 times (2 regions in total), and when region integration is performed 15 times (1 region in total), and the region integration method that produces the smallest error may be determined as the final region integration method. 3. Reference pixels, filtering coefficients

[0050] After performing region division according to the above method, filtering coefficients may be calculated according to the Wiener filtering principle based on the reference pixels for each pixel in each region.

[0051] For all pixel points involved in filtering, each pixel point is set as the current pixel, and surrounding pixel points within a certain range centered on the pixel point are set as reference pixels. The reference pixels and current pixel are used as inputs, and filtering coefficients are calculated using the least squares method with the original value of the pixel point as the target.

[0052] Fig. 4A shows a schematic diagram of a filter shape. As shown in Fig. 4A, the filter shape is a central symmetric filter of 7*7 cross shape + 5*5 square shape, and the reference pixels corresponding to the filter are as shown in Fig. 4B.

[0053] As shown in Figure 4B, the filtering coefficients of the central symmetric filters P0 and P28 are the same, so when training is performed on the encoding side, (Pi+P28-i, i=0,...,13) are taken as the same feature, and P14 is taken as one feature and input, respectively, to train 15 filtering coefficients. That is, the selection of the reference pixel is as follows: E[i]=(Pi+P28-i) E

[14] =P14

[0054] where Pi belongs to the pixel value in the reconstructed image before filtering, and E[i] is the value of the reference pixel, i=0,1,2,3,4,5,6,7,8,9,10,11,12,13.

[0055] The goal of Wiener filtering is to linearly combine the current pixel with the reference pixel values ​​surrounding the current pixel, so that the result of the linear combination approaches the current pixel value in the original image.

[0056] The ALF technique performs processing based on the largest coding unit (LCU), and LCUs that belong to the same integrated region are filtered using filtering coefficients from the same group. 4. Adaptive correction filtering unit

[0057] As shown in FIG. 5, the adaptive correction filtering unit is derived based on the current maximum coding unit in the following steps:

[0058] 4.1. Remove the part of the sample region where the current largest coding unit C is located that exceeds the image boundary to obtain sample region D.

[0059] 4.2. If the sample on which the lower boundary of sample area D is located does not belong to the lower boundary of the image, shrink the lower boundary of sample area D of luma and chroma components by 4 rows upward to obtain sample area E1; otherwise, make sample area E1 equal to sample area D, and the sample in the last row of sample area D is the lower boundary of area E1.

[0060] 4.3. If the sample on which the upper boundary of sample area E1 is located belongs to the upper boundary of the image, or belongs to the patch boundary and the value of cross_patch_loopfilter_enable_flag is “0”, then make sample area E2 equal to sample area E1; otherwise, extend the upper boundary of sample area E1 of luma and chroma components upward by four rows to obtain sample area E2, and the sample in the first row of sample area E1 is the upper boundary of area E2.

[0061] 4.4, the sample area E2 is the current adaptive correction filtering unit, the samples in the first row of the image are the upper boundary of the image, and the samples in the last row of the image are the lower boundary of the image. 5. Adaptive correction filtering operation

[0062] When it is determined to perform filtering on the current adaptive filtering unit, if the reference pixel used in the adaptive correction filtering process is a sample in the adaptive correction filtering unit, the sample is directly used to perform filtering.

[0063] If the samples used in the adaptive compensation filtering process are samples in the adaptive compensation filtering unit, the samples are directly used to perform filtering; otherwise, filtering is performed according to the following method.

[0064] 5.1. If the sample is located outside the image boundary, or outside the patch boundary and the value of cross_patch_loopfilter_enable_flag is “0”, i.e., filtering across patch boundaries is not allowed, the sample is filtered using the closest sample in the adaptive correction filtering unit instead of the sample.

[0065] 5.2. If the sample is outside the upper or lower boundary of the adaptive compensation filtering unit, the closest sample to the sample in the adaptive compensation filtering unit is used instead of the sample to be filtered.

[0066] 5.3. If the sample is not outside the upper boundary of the adaptive compensation filtering unit, and is not outside the lower boundary of the adaptive compensation filtering unit, the sample is directly used for filtering. 6. Decision-making on whether to start ALF

[0067] For the encoding device, after merging the regions to obtain the filtering coefficients for each region, a decision needs to be made, that is, taking the LCU as the basic unit, to determine whether to use ALF for each LCU in the current image.

[0068] The encoding device may calculate the rate-distortion cost before and after turning on and off the current LCU to determine whether the current LCU uses ALF. If the current LCU is marked as using ALF, the encoding device performs Wiener filtering on each pixel in the LCU.

[0069] In the related art, the ALF technology transmits only one group of fixed filtering coefficients to each region, and the filter shape is fixed. Therefore, in the fixedly divided regions, problems may occur such as pixels with the same characteristics cannot be divided into the same class, or the filter shape used is inappropriate. In addition, each divided region can transmit only one group of filtering coefficients at most, and one group of filtering coefficients is insufficient for large regions or image regions with complex textures.

[0070] In order to optimize the ALF filtering effect and improve the encoding / decoding performance, the embodiment of the present invention puts forward the following optimization measures.

[0071] Means 1: Taking LCU as the smallest unit, adaptively divide each frame into multiple regions, and each region may contain one or more LCUs. Accordingly, it is proposed to classify each LCU and classify LCUs in the same region into N classes (N is a positive integer). For example, if all LCUs in each region are divided into the same class, this corresponds to the fixed region division means of the conventional ALF means. In order to distinguish from the fixed region division method of the conventional ALF means, N≧2.

[0072] Means 2 may transmit multiple groups of filtering coefficients in each region, and the filter shapes of each group may be the same or different.

[0073] Means 3: adaptively selecting a group of filtering coefficients based on each LCU, and LCUs in the same region may select filtering coefficients of adjacent regions.

[0074] Means 4: Only one group of filtering coefficients can be transmitted in each region, but the filter shapes of each region can be different.

[0075] Means 5 includes changing the symmetric filter into an asymmetric filter, optimizing that the filtering coefficients at the symmetric positions are the same, and that the filtering coefficients at the symmetric positions satisfy a certain ratio relationship, such as 0.5:1.5 or 0.6:1.4.

[0076] Means 6: Optimization is performed on the boundary sample values ​​during filtering.

[0077] In order to make the above objectives, features and advantages of the embodiments of the present invention more clearly comprehensible, the following provides a more detailed description of the technical solutions in the embodiments of the present invention in conjunction with the accompanying drawings.

[0078] The following takes as an example the implementation of the means provided by the embodiment of the present invention for performing ALF filtering with the size of an LCU; however, the embodiment of the present invention may instead use other sizes or methods for representing image blocks, for example an image block of size N*M, where N is a positive integer less than or equal to the width of the image frame, and M is a positive integer less than or equal to the height of the image frame. Example 1

[0079] An embodiment of the present invention provides a filtering method applied to a decoding device, where the filtering method includes the following steps.

[0080] In T600, segmentation is performed on the luminance component of the current image frame.

[0081] For segmentation of the luminance component of an image frame, see the above description of "segmentation."

[0082] In T610, the area class to which the LCU belongs is determined based on the area class identifier of the LCU obtained by analyzing the bitstream.

[0083] In order to optimize the ALF filtering effect and improve the encoding / decoding performance, when a fixed region division method is used to divide a luminance component of an image frame into a plurality of regions, for each region, the LCUs in the region are divided into at least one class based on the pixel characteristics of each pixel in the region, that is, one region may be divided into at least one sub-region or region class according to an LCU classification method. For any LCU, the region class to which the LCU belongs may be determined based on the region to which the LCU belongs and the class in the region to which the LCU belongs. Exemplarily, when the encoding device transmits a bitstream to the decoding device, a region class identifier for identifying the region class to which each LCU belongs may be added to the bitstream and transmitted to the decoding device. For any LCU, the decoding device may analyze the region class identifier of the LCU from the bitstream, and determine the region class to which the LCU belongs based on the region class identifier of the LCU obtained by the analysis.

[0084] In T620, a filtering coefficient of the LCU is determined based on the region class to which the LCU belongs and the filtering coefficient obtained by analyzing the bitstream.

[0085] In the embodiment of the present invention, when classifying the LCUs in each region in the above manner, the encoding device performs region integration for each region class, obtains at least one integrated region (which may be called an integrated region), and determines the filtering coefficient of each integrated region. The implementation manner of performing region integration for each region class is similar to the above description of "region integration", so detailed description is omitted here.

[0086] Illustratively, for any region class, the encoding device may assign one coefficient index based on the aggregate region to which it belongs, where the coefficient index corresponds to the filtering coefficients of one of the aggregate regions.

[0087] The encoding device may write the filtering coefficients for each aggregated region and an index for each region class into a bitstream and send it to the decoding device.

[0088] For example, for any LCU, the decoding device may determine a coefficient index of the area class to which the LCU belongs based on the area class to which the LCU belongs, and determine a filtering coefficient of the LCU based on the coefficient index and a filtering coefficient obtained by analyzing the bitstream.

[0089] In T630, ALF filtering is performed on the pixels of the LCU one by one based on the filtering coefficients of the LCU.

[0090] In an embodiment of the present invention, when the filtering coefficient of any LCU is determined, ALF filtering may be performed on the pixels of the LCU one by one based on the filtering coefficient of the LCU.

[0091] As can be seen, by classifying the LCUs in the regions obtained by partitioning using the fixed region partitioning method, the region partitioning can be tailored to the pixel characteristics of each LCU, thereby optimizing the ALF filtering effect and improving the encoding / decoding performance.

[0092] In one embodiment, in T610, determining the area class to which the LCU belongs based on the area class identifier of the LCU obtained by parsing the bitstream includes determining the area class to which the LCU belongs based on the area to which the LCU belongs and the area class identifier of the LCU.

[0093] For example, for any LCU, the area class to which the LCU belongs may be determined based on the area to which the LCU belongs (the area obtained by the fixed area division method) and the area class identifier of the LCU.

[0094] In one example, the region class identifier of an LCU is used to identify the class of the LCU in the region to which the LCU belongs, and the class of the LCU in the region to which the LCU belongs is determined by classifying each LCU in the region to which the LCU belongs.

[0095] Determining the area class to which the LCU belongs based on the area to which the LCU belongs and the area class identifier of the LCU may include determining the area class to which the LCU belongs based on the number of classes in each area, the area to which the LCU belongs, and the area class identifier of the LCU.

[0096] For any LCU, the decoding device may determine the class of the LCU in the region to which it belongs based on the region class identifier of the LCU parsed from the bitstream. For example, assuming that the LCUs in one region are divided into at most two classes, the region class identifier of the LCU divided into the first class may be 0, and the region class identifier of the LCU divided into the second class may be 1.

[0097] For any LCU in any region, if the value of the region class identifier for that LCU obtained by analysis of the bitstream is 0, it may be determined that the class of that LCU in that region is the first class, and if the value of the region class identifier for that LCU obtained by analysis of the bitstream is 1, it may be determined that the class of that LCU in that region is the second class.

[0098] For example, for any LCU, the decoding device may determine the region class to which the LCU belongs based on the class number of each region, the region to which the LCU belongs, and the region class to which the LCU belongs.

[0099] As an example, determining the region class to which the LCU belongs based on the number of classes in each region, the region to which the LCU belongs, and the region class identifier of the LCU may include determining the total number of classes in each region before the region to which the LCU belongs based on the number of classes in each region before the region to which the LCU belongs, and determining the region class to which the LCU belongs based on the total number of classes in each region before the region to which the LCU belongs and the region class identifier of the LCU.

[0100] For example, for any LCU, the total number of classes in each area preceding the area to which the LCU belongs may be determined based on the number of classes in each area, and the area class to which the LCU belongs may be determined based on the total number of classes in each area preceding the area to which the LCU belongs and the area class identifier of the LCU.

[0101] For example, assuming that the luminance of the current image frame is divided into L regions and the LCUs in each region are divided into N classes, for any LCU in region K, if the region class identifier value of the LCU obtained by analyzing the bitstream is m, it may be determined that the region class to which the LCU belongs is N*K+m, where m∈[0,N-1], N≧1, and K∈[0,L-1].

[0102] In some embodiments, in T620, before determining the filtering coefficient of the LCU based on the region class to which the LCU belongs and the filtering coefficient obtained by analyzing the bitstream, the method may further include determining whether to start ALF filtering for the LCU, and if it is determined to start ALF filtering for the LCU, determining to perform the above-mentioned operation of determining the filtering coefficient of the LCU based on the region class to which the LCU belongs and the filtering coefficient obtained by analyzing the bitstream.

[0103] For any LCU, the encoding device may determine whether to start ALF filtering for that LCU based on the RDO decision.

[0104] Before performing ALF filtering on an LCU, the decoding device may determine in advance whether to start ALF filtering on the LCU. For example, the decoding device may determine whether to start ALF filtering on the LCU based on an identifier for identifying whether to start ALF filtering on the LCU, the identifier being obtained by analyzing the bitstream.

[0105] When the decoding device determines to start ALF filtering for an LCU, it may determine a filtering coefficient for the LCU based on the region class to which the LCU belongs and the filtering coefficient obtained by analyzing the bitstream in the manner described in the above embodiment.

[0106] In one example, determining whether to initiate ALF filtering for the LCU includes parsing an LCU coefficient identifier of the LCU from the bitstream, where the LCU coefficient identifier is used to identify filtering coefficients used for the LCU within at least one group of filtering coefficients used for the aggregated region to which the LCU belongs, and determining to initiate ALF filtering for the LCU if a value of the LCU coefficient identifier of the LCU is a non-first value.

[0107] For example, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, the filtering coefficients used in one integrated region are not limited to one group of filtering coefficients, and one or more groups of filtering coefficients may be selected and used according to actual situations.

[0108] Exemplarily, for any consolidated region, the encoding device trains multiple groups of filtering coefficients, and determines that the consolidated region uses one or more of the filtering coefficients based on the RDO determination. For any LCU of the region, the encoding device determines a filtering coefficient to be used for the LCU among the one or more groups of filtering coefficients used for the consolidated region by an LCU coefficient identifier.

[0109] For any LCU, when the value of the LCU coefficient identifier of the LCU is a first value, it indicates that ALF filtering is not started for the LCU.

[0110] For any LCU, if the value of the LCU coefficient identifier of the LCU parsed from the bitstream by the decoding device is a non-first value, it may be determined to start ALF filtering for the LCU.

[0111] For example, assuming that the first value is 0, for any LCU, if the value of the LCU coefficient identifier of the LCU obtained by parsing the bitstream by the decoding device is 0, it may be determined not to start ALF filtering for the LCU, and if the value of the LCU coefficient identifier of the LCU obtained by parsing the bitstream by the decoding device is not 0, it may be determined to start ALF filtering for the LCU, and a filtering coefficient to be used for the LCU may be determined based on the LCU coefficient identifier of the LCU.

[0112] When the value of the LCU coefficient identifier of an LCU is a non-first value, if the integrated region to which the LCU belongs uses one group of filtering coefficients, the filtering coefficient of the LCU is the filtering coefficient of the group; when the integrated region to which the LCU belongs uses multiple groups of filtering coefficients, it is further necessary to determine the filtering coefficient of the LCU based on the specific value of the LCU coefficient identifier of the LCU.

[0113] In one example, determining the filtering coefficient of the LCU based on the region class to which the LCU belongs and the filtering coefficient obtained by analyzing the bitstream may include determining the filtering coefficient of the LCU based on the region class to which the LCU belongs, the filtering coefficient obtained by analyzing the bitstream, and a region coefficient identifier of the consolidated region to which the LCU belongs that is obtained by analyzing the bitstream. The region coefficient identifier is used to identify the filtering coefficient used for the consolidated region to which the LCU belongs, among a plurality of groups of filtering coefficients set in advance.

[0114] For example, for any integrated region, the encoding device may train multiple groups of filtering coefficients, determine based on an RDO decision that the integrated region will use one or more of the multiple groups of filtering coefficients, and write a region coefficient identifier into the bitstream to identify the filtering coefficients used for the integrated region.

[0115] For example, for any LCU of any consolidated region, the decoding device may determine filtering coefficients to be used for the consolidated region based on a region coefficient identifier of the consolidated region obtained by parsing the bitstream.

[0116] For example, assuming that the preset multiple groups of filtering coefficients include two groups of filtering coefficients (assuming filtering coefficient A and filtering coefficient B), for any integrated region, if the encoding device determines that the integrated region uses filtering coefficient A, the encoding device determines that the value of the integrated region's region coefficient identifier is 0; if the encoding device determines that the integrated region uses filtering coefficient B, the encoding device determines that the value of the integrated region's region coefficient identifier is 1; and if the encoding device determines that the integrated region uses filtering coefficient A and filtering coefficient B, the encoding device determines that the value of the integrated region's region coefficient identifier is 2.

[0117] For any integrated region, if the value of the region coefficient identifier of the integrated region obtained by the decoding device analyzing the bitstream is 0, it is determined that the integrated region uses filtering coefficient A, if the value of the region coefficient identifier of the integrated region obtained by the decoding device analyzing the bitstream is 1, it is determined that the integrated region uses filtering coefficient B, and if the value of the region coefficient identifier of the integrated region obtained by the decoding device analyzing the bitstream is 2, it is determined that the integrated region uses filtering coefficient A and filtering coefficient B.

[0118] For example, for any integrated region, when the decoding device determines that the region will use one group of filtering coefficients based on the region coefficient identifier of the integrated region obtained by analysis from the bitstream, and for any LCU of the integrated region, when the decoding device determines to start ALF filtering for the LCU, for example, when the value of the LCU coefficient identifier of the LCU is a non-first value, the decoding device may determine that the filtering coefficients to be used for the LCU are the filtering coefficients to be used for the integrated region; and when the decoding device determines that the region will use multiple groups of filtering coefficients based on the region coefficient identifier of the integrated region obtained by analysis from the bitstream, and when the decoding device determines to start ALF filtering for the LCU, the decoding device may determine the filtering coefficients to be used for the LCU (one group of filtering coefficients among the multiple groups of filtering coefficients used for the integrated region) based on the LCU coefficient identifier of the LCU.

[0119] Determining the filtering coefficient of the LCU based on the region class to which the LCU belongs, the filtering coefficient obtained by analysis from the bitstream, and the region coefficient identifier of the consolidated region to which the LCU belongs obtained by analysis from the bitstream may include determining the filtering coefficient of the LCU based on the region class to which the LCU belongs, the filtering coefficient obtained by analysis from the bitstream, and the LCU coefficient identifier of the LCU when it is determined that the consolidated region to which the LCU belongs uses multiple sets of filtering coefficients based on the region coefficient identifier of the consolidated region to which the LCU belongs.

[0120] For any LCU, when the decoding device determines the region class to which the LCU belongs based on the region class identifier of the LCU obtained by analyzing the bitstream, it may further determine the consolidated region to which the LCU belongs based on the region class to which the LCU belongs, and determine the filtering coefficients to be used for the region class based on the region coefficient identifier of the consolidated region to which the region class belongs, obtained by analyzing the bitstream.

[0121] For example, assuming that the luminance components of a current image frame are divided into 16 regions using a fixed region division method, and then a total of 32 region classes are obtained by classifying the LCUs in the regions, after the region classes are integrated, an index table may be obtained based on the integration status of the region classes, and the index table may be a 32-dimensional one-dimensional vector, each element of which is an index of the integrated region to which each region class belongs, in order.

[0122] Assuming that the 32-dimensional one-dimensional vector is {a1, a2, a3, ..., a32}, a1 is the index of the integrated region to which area class 0 belongs, ... a32 is the index of the integrated region to which area class 32 belongs. Assuming that a1 to a5 are all 0 and a6 to a11 are all 1, this indicates that area classes 0 to 4 are integrated into integrated region 0, and area classes 5 to 10 are integrated into integrated region 1.

[0123] The encoding device may transmit the index table to the decoding device in the bitstream, so that the decoding device determines the consolidated area to which each area class belongs based on the index table obtained by analyzing the bitstream, and so that, for any LCU, the area class to which the LCU belongs may be determined based on the area class identifier of the LCU, and the consolidated area to which the LCU belongs may be determined based on the area class to which the LCU belongs.

[0124] If the decoding device determines that the integrated region to which the LCU belongs uses multiple groups of filtering coefficients, the decoding device may determine the filtering coefficients to be used for the LCU based on an LCU coefficient identifier for the LCU obtained by parsing the bitstream.

[0125] For any one of the integrated regions, the filter shapes of the multiple groups of filtering coefficients used in the integrated region may be the same or may not be the same. For example, assuming that the integrated region 1 uses filtering coefficients A, B, and C, the filter shapes of the filtering coefficients A, B, and C may be the same, may be different, or may be partially the same, for example, the filter shapes of the filtering coefficients A and B are the same, but the filter shapes of the filtering coefficients A and C are different.

[0126] In some embodiments, in T620, determining a filtering coefficient of the LCU based on a region class to which the LCU belongs and a filtering coefficient obtained by analyzing the bitstream may include determining a filtering coefficient of the LCU based on a region class to which the LCU belongs, a filtering coefficient obtained by analyzing the bitstream, and a coefficient selection identifier of the LCU, where the coefficient selection identifier is used to identify a filtering coefficient to be selected and used by the LCU from a plurality of groups of filtering coefficient candidates.

[0127] In order to optimize the ALF filtering effect and improve the encoding / decoding performance, an LCU is not limited to selecting the filtering coefficients of the integrated region to which it belongs, but may adaptively select a group of filtering coefficients from multiple groups of filtering coefficients to perform ALF filtering.

[0128] For example, for any LCU, the filtering coefficient candidates for the LCU include, but are not limited to, the filtering coefficients of the consolidated region to which the LCU belongs and the filtering coefficients of consolidated regions adjacent to the consolidated region to which the LCU belongs, so that when one group of filtering coefficients is transmitted in each consolidated region, there may be multiple groups of filtering coefficient candidates in one LCU, thereby increasing the flexibility of LCU filtering coefficient selection, optimizing the ALF filtering effect, and improving encoding / decoding performance.

[0129] For any LCU, the encoding device may determine a filtering coefficient that the LCU uses in the multiple groups of filtering coefficients based on the RDO determination, and write a coefficient selection identifier corresponding to the filtering coefficient into a bitstream and transmit the bitstream to the decoding device. The decoding device may determine the filtering coefficient of the LCU based on the region class to which the LCU belongs, the filtering coefficient obtained by analyzing the bitstream, and the coefficient selection identifier of the LCU.

[0130] In one example, determining the filtering coefficient of the LCU based on the area class to which the LCU belongs, the filtering coefficient obtained by analyzing the bitstream, and the coefficient selection identifier of the LCU may include: when the value of the coefficient selection identifier of the LCU is a first value, determining the filtering coefficient of the integrated area immediately before the integrated area to which the LCU belongs as the filtering coefficient of the LCU; when the value of the coefficient selection identifier of the LCU is a second value, determining the filtering coefficient of the integrated area to which the LCU belongs as the filtering coefficient of the LCU; and when the value of the coefficient selection identifier of the LCU is a third value, determining the filtering coefficient of the integrated area immediately after the integrated area to which the LCU belongs as the filtering coefficient of the LCU.

[0131] For any LCU, the filtering coefficient candidates may include a filtering coefficient of the consolidated region to which the LCU belongs, a filtering coefficient of the consolidated region immediately before the consolidated region to which the LCU belongs, and a filtering coefficient of the consolidated region immediately after the consolidated region to which the LCU belongs. Exemplarily, the consolidated region immediately before the consolidated region to which the LCU belongs is a consolidated region corresponding to an adjacent index immediately before the index of the consolidated region to which the LCU belongs. The consolidated region immediately after the consolidated region to which the LCU belongs is a consolidated region corresponding to an adjacent index immediately after the index of the consolidated region to which the LCU belongs.

[0132] For example, assuming that the consolidated area to which an LCU belongs is consolidated area 2 and its corresponding index is 2, the consolidated area immediately before the consolidated area to which the LCU belongs is the consolidated area corresponding to the adjacent index immediately before index 2 (i.e., 1) (i.e., consolidated area 1), and the consolidated area immediately after the consolidated area to which the LCU belongs is the consolidated area corresponding to the adjacent index immediately after index 2 (i.e., 3) (i.e., consolidated area 3).

[0133] For any LCU, the encoding device may determine the filtering coefficient to be used for it based on the RDO determination, and if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region immediately before the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a first value, such as 0, if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a second value, such as 1, and if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region immediately after the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a third value, such as 2.

[0134] For example, for any LCU, if the value of the coefficient selection identifier for that LCU obtained by analyzing the bitstream by the decoding device is a first value, the filtering coefficient of the integrated region immediately preceding the integrated region to which the LCU belongs may be determined as the filtering coefficient of that LCU; if the value of the coefficient selection identifier for that LCU obtained by analyzing the bitstream is a second value, the filtering coefficient of the integrated region to which the LCU belongs may be determined as the filtering coefficient of that LCU; and if the value of the coefficient selection identifier for that LCU obtained by analyzing the bitstream is a third value, the filtering coefficient of the integrated region immediately following the integrated region to which the LCU belongs may be determined as the filtering coefficient of that LCU.

[0135] Parsing the filtering coefficients from the bitstream may include, for any integrated region, parsing a filter shape for that integrated region from the bitstream, and parsing filtering coefficients for that integrated region from the bitstream based on the filter shape.

[0136] Illustratively, in order to increase the flexibility of filtering coefficients, optimize the ALF filtering effect, and improve the encoding / decoding performance, each integrated region is not limited to using the same filter shape, but selectively uses different filter shapes, that is, the filter shapes used for different integrated regions may be the same or different.

[0137] For example, for any integrated region, the encoding device may train multiple groups of filtering coefficients with different filter shapes, determine the filter shape and filtering coefficients to be used for that integrated region based on an RDO decision, and write the filter shape and filtering coefficients into a bitstream to send to the decoding device.

[0138] For example, for any integrated region, when the decoding device obtains the filtering coefficients for that integrated region, it may parse the filter shape of that integrated region from the bitstream, and based on the filter shape, parse the filtering coefficients for that region class from the bitstream.

[0139] In one example, determining the filtering coefficients of the LCU based on the region class to which the LCU belongs and the filtering coefficients obtained by analyzing the bitstream may include determining the filter shape and filtering coefficients of the LCU based on the region class to which the LCU belongs and the filter shape and filtering coefficients obtained by analyzing the bitstream.

[0140] Performing ALF filtering on the pixels of the LCU one by one based on the filtering coefficient of the LCU may include performing ALF filtering on the pixels of the LCU one by one based on the filter shape and filtering coefficient of the LCU. For example, for any LCU, a consolidated region to which the LCU belongs may be determined based on a region class to which the LCU belongs, a filter shape and filtering coefficient of the consolidated region may be analyzed from a bitstream, the filter shape and filtering coefficient may be determined as the filter shape and filtering coefficient of the LCU, and ALF filtering may be performed on the pixels of the LCU one by one based on the filter shape and filtering coefficient.

[0141] In an embodiment of the present invention, a filter shape may be selected for an image frame, or for a component (e.g., luma component and / or chroma component) of an image frame. For example, if image frame A selects the central symmetric filter shape of 7*7 cross+5*5 square shown in FIG. 4A, each LCU that starts ALF filtering in image frame A uses the central symmetric filter shape of 7*7 cross+5*5 square.

[0142] In some embodiments, in T630, performing ALF filtering on the pixels of the LCU one by one based on the filtering coefficients of the LCU may include performing ALF filtering on the pixels of the LCU one by one based on the filtering coefficients of the LCU and weighting coefficients of each reference pixel position corresponding to the integrated region to which the LCU belongs, obtained by analyzing the bitstream.

[0143] For example, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, the filter used when performing ALF filtering is not limited to a symmetric filter, but may also adopt an asymmetric filter, that is, the filtering coefficients at symmetric positions are different and may satisfy a certain ratio relationship, such as 0.5:1.5 or 0.6:1.4.

[0144] When performing ALF filtering based on the determined filtering coefficients, All filtering coefficients each and Since the filtered pixel value needs to be obtained based on the sum of products with the reference pixel at the corresponding position, the above ratio may be the ratio between the filtering coefficients at symmetric positions, or may be the ratio of weights (also called weight ratio) when the pixel values ​​of the reference pixels corresponding to the filtering coefficients at symmetric positions participate in the ALF filtering calculation. That is, the above asymmetric filter means that the filtering coefficients at symmetric positions are different, or the weights when the pixel values ​​of the reference pixels corresponding to the filtering coefficients at symmetric positions participate in the ALF filtering calculation are different.

[0145] For example, the filtering coefficients of a 7*7 cross + 5*5 square central symmetric filter are C i and the filtering coefficient at the symmetric position is C 28-i Therefore, C i :C 28-i =A i :(2-A i ), or P i and P 28-i The weight ratio when participates in the ALF filtering calculation is A i :(2-Ai ), and P i C i is the pixel value of the reference pixel position corresponding to P 28-i C 28-i For the current filtering pixel of the LCU, the filtered pixel value of the pixel may be determined in the following manner:

number

[0146] C i is the (i+1)-th filtering coefficient in the filtering coefficients of the integrated region to which the LCU belongs, and P i is the filtering coefficient C i is the pixel value of the reference pixel position corresponding to P 28-i and the corresponding reference pixel position P i The reference pixel position corresponding to A is center-symmetric with respect to the pixel position of the current filtering pixel, i P i is the weighting factor of the pixel value at the reference pixel position corresponding to P 14 is the pixel value of the current filtering pixel, and C 14 is the filtering coefficient of the current filtering pixel, and 0 i <2.

[0147] Exemplarily, for any integrated region, the encoding device may determine the filtering coefficients and filtering performance of the integrated region under each position corresponding to a different weighting factor, select a group of filtering coefficients with the best filtering performance, record the filtering coefficients and the weighting factors corresponding to each position of the corresponding filter, and write it into a bitstream to send to the decoding device.

[0148] Exemplarily, a weighting factor set (e.g., A i ​Alternatively, a weighting coefficient set (a set of values ​​of the weighting coefficients) may be pre-constructed, each weighting coefficient may be selected from the set, an optimal filtering coefficient for filtering performance and a weighting coefficient corresponding to each position of the corresponding filter may be obtained, and an index of the weighting coefficient in the weighting coefficient set may be written into a bitstream to be transmitted to the decoding device.

[0149] For any LCU, the decoding device may analyze from the bitstream the filtering coefficients of the integrated region to which the LCU belongs and the weighting coefficients of each reference pixel position corresponding to the integrated region to which the LCU belongs, and perform ALF filtering on the pixels of the LCU one by one.

[0150] In some embodiments, in T630, performing ALF filtering on the pixels of the LCU one by one based on the filtering coefficients of the LCU may include, for a current filtering pixel of the LCU, in the process of performing ALF filtering on the pixel, updating a pixel value of the pixel based on pixel values ​​of neighboring pixels of the pixel, and performing ALF filtering on the pixel based on the updated pixel value of the pixel.

[0151] For example, for any pixel position, when the pixel value of the pixel position is too large or too small, in consideration of the degradation of filtering performance of filtering the pixel position according to the conventional ALF technique, in order to optimize the ALF filtering effect, for the current filtering pixel, in the process of performing ALF filtering on the pixel, the pixel value of the pixel may be updated based on the pixel values ​​of the surrounding pixels of the pixel, so as to make the pixel value of the pixel position more smooth relative to the pixel values ​​of the surrounding pixels.

[0152] In one example, updating the pixel value of the pixel with respect to the pixel values of the surrounding pixels of the pixel may include determining the maximum and minimum values of the pixel values of each pixel except the central position in the target pixel block, where the target pixel block is a 3×3 pixel block with the pixel as the central position, updating the pixel value of the pixel to the maximum value when the pixel value of the pixel is greater than the maximum value, and updating the pixel value of the pixel to the minimum value when the pixel value of the pixel is less than the minimum value.

[0153] Taking the eight adjacent pixels of the pixel as an example of the surrounding pixels of the pixel, that is, the other pixels except the central position from a 3×3 pixel block (referred to as the target pixel block in this specification) with the pixel as the central position.

[0154] For any pixel in any LCU, the pixel values of each pixel except the central position in the target pixel block may be determined, and the maximum and minimum values within each pixel value may be determined. When the pixel value of the pixel is greater than the maximum value, the pixel value of the pixel is updated to the maximum value, and when the pixel value of the pixel is less than the minimum value, the pixel value of the pixel is updated to the minimum value.

[0155] Taking the 3×3 pixel block shown in FIG. 12 as an example, if the current filtering pixel is pixel 0 and its surrounding pixels include the eight adjacent pixels of the pixel, that is, pixels 1 to 8, when performing filtering on pixel 0, the pixel values of pixels 1 to 8 may be obtained respectively, and the maximum and minimum values of the pixel values of the eight pixels may be determined. Assuming that the pixel value of pixel 1 is the largest and the pixel value of pixel 8 is the smallest, the maximum value of the pixel values of the eight pixels is the pixel value of pixel 1 (assumed to be p1), and the minimum value is the pixel value of pixel 8 (assumed to be p8). Therefore, comparing the pixel value of pixel 0 (assumed to be p0) with p1 and p8, when p0>p1, the pixel value of pixel 0 is updated to p1, and when p0<p8, the pixel value of pixel 0 is updated to p8. (Example 2)

[0156] FIG. 6A shows a flowchart of a filtering method provided by an embodiment of the present invention, in which the filtering method may be applied to an encoding / decoding device, and as shown in FIG. 6A, the filtering method may include the following steps:

[0157] In step S600a, in the process of performing ALF filtering on a current filtering pixel in a current adaptive correction filtering unit, for any reference pixel of the current filtering pixel, if the reference pixel is not located within the current adaptive correction filtering unit, proceed to step S610a.

[0158] In step S610a, it is determined whether the pixel value of the reference pixel can be obtained, and if so, proceed to step S630a, otherwise proceed to step S620a.

[0159] In step S620a, filtering is performed using a pixel that is closest to the position of the reference pixel in the current adaptive correction filtering unit and the boundary region, instead of the reference pixel.

[0160] In step S630a, filtering is performed using the reference pixels.

[0161] The filtering unit may be an LCU or an image block obtained based on the LCU, for example, an image block obtained by clipping or extending the LCU.

[0162] For the implementation of obtaining a filtering unit based on the LCU, please refer to the relevant description of "adaptive correction filtering unit" above.

[0163] In an embodiment of the present invention, for a boundary pixel of a filtering unit, it is considered that some of the reference pixels of the boundary pixel may be located outside the filtering unit, i.e., not within the filtering unit. In this case, it may be impossible to obtain the pixel values ​​of the reference pixels.

[0164] In one example, when the pixel value of a reference pixel cannot be obtained, the reference pixel may be located outside the image boundary, outside the patch boundary and filtering across the patch boundary is not allowed, or outside the upper or lower boundary of the current adaptive correction filtering unit, but this is not limited to the above.

[0165] For example, considering that for any pixel position, the other pixel position closest to the pixel in question is also generally the pixel position whose pixel value is closest to the pixel value of the pixel position in question, in order to optimize the ALF filtering effect, when the pixel value of the reference pixel cannot be obtained, filtering may be performed using a pixel in the current adaptive correction filtering unit and boundary area that is closest to the reference pixel position instead of the reference pixel.

[0166] Illustratively, the distance between pixel locations may be a Euclidean distance.

[0167] For example, the boundary area includes the left outer boundary or the right outer boundary of the current adaptive compensation filtering unit, where the left outer boundary of the current adaptive compensation filtering unit includes some or all of the areas of the filtering units adjacent to the left side of the current adaptive compensation filtering unit, and the right outer boundary of the current adaptive compensation filtering unit includes some or all of the areas of the filtering units adjacent to the right side of the current adaptive compensation filtering unit.

[0168] Taking the filtering unit shown in FIG. 5 (i.e., the sample filtering compensation unit in FIG. 5) as the current adaptive correction filtering unit as an example, the boundary area of ​​the current adaptive correction filtering unit may include three columns of pixels to the left of the left boundary of the sample filtering compensation unit shown in FIG. 5 (i.e., three columns of pixels adjacent to the current adaptive correction filtering unit among the filtering units to the left of the current adaptive correction filtering unit, which may also be referred to as outside the left boundary), and the boundary area of ​​the current adaptive correction filtering unit may include three columns of pixels to the right of the right boundary of the sample filtering compensation unit shown in FIG. 5 (i.e., three columns of pixels adjacent to the current adaptive correction filtering unit among the filtering units to the right of the current adaptive correction filtering unit, which may also be referred to as outside the right boundary).

[0169] In the method flow shown in FIG. 6A , in the process of performing ALF filtering on each pixel in the current adaptive correction filtering unit, for a reference pixel position that is not located within the current adaptive correction filtering unit, if the pixel value of the reference pixel position cannot be obtained, filtering is performed using a pixel that is closest to the reference pixel position in the current adaptive correction filtering unit and the boundary area instead of the reference pixel, thereby optimizing the ALF filtering performance and improving the encoding / decoding performance.

[0170] In some embodiments, when a pixel value of the reference pixel cannot be obtained, before performing filtering using a pixel in the current adaptive correction filtering unit and the boundary region that is closest to the position of the reference pixel instead of the reference pixel, the method may further include determining whether the reference pixel corresponds to a specified position of the filter shape, and if so, determining to perform an operation of filtering using a pixel in the current adaptive correction filtering unit and the boundary region that is closest to the position of the reference pixel instead of the reference pixel.

[0171] Considering a reference pixel at a certain position, if the pixel value of the reference pixel is unavailable, then generally the pixel value of the nearest pixel position in the boundary region is also unavailable, such as the reference pixel located directly to the left, right, above or below the current filtering pixel position.

[0172] For example, assuming that the current filtering pixel position (i.e., the pixel position corresponding to C14) is located at the left boundary of the current adaptive correction filtering unit, as for the reference pixel position corresponding to C11, the reference pixel position is located to the left of the current filtering pixel position and is three pixels away from the current filtering pixel position. However, since the width of one filtering unit is generally greater than three pixels, if the pixel value of the reference pixel position corresponding to C11 cannot be obtained, it may be determined that the filtering unit to the left of the current adaptive correction filtering unit is located outside the boundary of the current image frame (i.e., the image frame in which the current adaptive correction filtering unit is located) or is located outside the patch boundary of the current patch (i.e., the patch in which the current adaptive correction filtering unit is located), and filtering beyond the patch boundary is not allowed. In this case, the pixel value of the pixel position in the boundary area that is closest to the reference pixel position, i.e., the pixel position corresponding to C12, cannot be obtained either. In this case, instead of the reference pixel, filtering needs to be performed using the pixel in the current adaptive correction filtering unit that is closest to the reference pixel position (the reference pixel position corresponding to C11).

[0173] Taking the scenario shown in FIG. 14A as an example, if the pixel value of the reference pixel position corresponding to C11 cannot be obtained, the reference pixel position corresponding to C12 cannot be obtained either.

[0174] Furthermore, if the pixel value of a reference pixel located at the upper left, upper right, lower left, or lower right of the current filtering pixel position cannot be obtained, the cause may be that the pixel value is outside the upper boundary or lower boundary of the current adaptive correction filtering unit (the pixel value of a pixel position outside the upper boundary or lower boundary of the current adaptive correction filtering unit cannot be obtained), in which case the pixel position closest to the reference pixel position may be located outside the left boundary or right boundary of the current adaptive correction filtering unit, and it may be possible to obtain that pixel value.

[0175] For example, assuming that the current filtering pixel position (i.e., the pixel position corresponding to C14) is located at the upper left of the current adaptive correction filtering unit, as for the reference pixel position corresponding to C1, since the reference pixel position is located at the upper left of the current filtering pixel position, if the current filtering pixel position is relatively close to the upper left vertex of the current adaptive correction filtering unit, the reference pixel position corresponding to C1 may be located outside the upper boundary of the current adaptive correction filtering unit, and therefore the pixel value of the reference pixel position cannot be obtained; in this case, the pixel position corresponding to C6 may be located outside the left boundary of the current adaptive correction filtering unit, and its pixel value may be obtained.

[0176] Taking the scenario shown in FIG. 14B as an example, the reference pixel position corresponding to C1 is located outside the upper boundary of the current adaptive correction filtering unit, and therefore the pixel value of the reference pixel position corresponding to C1 cannot be obtained, but the reference pixel position corresponding to C6 is located outside the left boundary of the current adaptive correction filtering unit, and the pixel value outside the left boundary of the current adaptive correction filtering unit can be obtained. For example, if the left boundary of the current adaptive correction filtering unit is not an image boundary or a patch boundary, the pixel value of the reference pixel position corresponding to C6 can be obtained. Therefore, in this case, for the reference pixel position whose pixel value cannot be obtained, filtering may be performed using the pixel value of the closest pixel position in the current adaptive correction filtering unit or the boundary area instead of the reference pixel.

[0177] In order to optimize the ALF filtering effect, when a pixel value of a reference pixel located at a specified position of the filter shape cannot be obtained, filtering may be performed using a pixel in the current adaptive correction filtering unit and boundary region that is closest to the position of the reference pixel instead of the reference pixel.

[0178] For example, if the reference pixel does not correspond to a specified position of the filter shape, filtering may be performed using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel, i.e., pixels within the boundary region are not taken into account.

[0179] In one example, the specified positions may include, but are not limited to, a first position, a second position, a third position, and symmetric positions of the first position, the second position, and the third position in the first filter, where the first filter is a centrally symmetric filter of 7*7 cross + 5*5 square, the first position is the upper left corner position of the first filter, the second position is a right adjacent position of the first position, and the third position is a lower adjacent position of the first position, and the symmetric positions include axially symmetric positions and centrally symmetric positions.

[0180] For example, for the first filter shown in FIG. 4A, the first position is the C1 position, its axially symmetric position is the C5 position, the second position is the C2 position, its axially symmetric position is the C4 position, the third position is the C6 position, its axially symmetric position is the C10 position, i.e., the specified positions may include C1, C2, C6, C4, C5 and C10.

[0181] In some embodiments, when a pixel value of the reference pixel cannot be obtained, before performing filtering using a pixel in the current adaptive correction filtering unit and the boundary region that is closest to the position of the reference pixel instead of the reference pixel, the method may further include determining whether the current adaptive correction filtering unit allows the use of extended adaptive correction filtering, and if so, determining to perform an operation of filtering using a pixel in the current adaptive correction filtering unit and the boundary region that is closest to the position of the reference pixel instead of the reference pixel.

[0182] For example, it is considered that the filter to be used is usually different between a case where the use of enhanced adaptive correction filtering (enhanced ALF) is permitted and a case where the use of enhanced adaptive correction filtering is not permitted.

[0183] By way of example, the filter used when the use of advanced adaptive correction filtering is permitted may be that shown in FIG. 4A, whereas the filter used when the use of advanced adaptive correction filtering is not permitted may be that shown in FIG.

[0184] 9, when the pixel value of the reference pixel cannot be obtained, generally, the pixel value of the pixel position closest to the reference pixel position other than the current adaptive correction filtering unit cannot be obtained, and therefore, when the use of extended adaptive correction filtering is not permitted, filtering using a pixel in the boundary area instead of the reference pixel whose pixel value cannot be obtained may be considered, and filtering using a pixel in the current adaptive correction filtering unit instead of the reference pixel whose pixel value cannot be obtained may be considered. Therefore, for any reference pixel, when the pixel value of the reference pixel cannot be obtained, it may be determined whether the current adaptive correction filtering unit allows the use of extended adaptive correction filtering. Exemplarily, it may be determined whether the current adaptive correction filtering unit allows the use of extended adaptive correction filtering based on the value of EalfEnableFlag, and when EalfEnableFlag is 1, it indicates that extended adaptive correction filtering can be used, and when EalfEnableFlag is 0, it indicates that extended adaptive correction filtering should not be used.

[0185] Exemplarily, the value of EalfEnableFlag may be derived from the decoding side, or may be obtained from the bitstream on the decoding side, or the value of EalfEnableFlag may be a constant value. Exemplarily, the value of EalfEnableFlag may be determined based on the value of an extended adaptive correction filtering enable flag (ealf_enable_flag) obtained by analyzing the bitstream.

[0186] The "extended adaptive correction filtering enable flag" may be a sequence level parameter, that is, a value of one "extended adaptive correction filtering enable flag" may be used to indicate whether an image sequence allows the use of extended adaptive correction filtering. Exemplarily, when the decoding device determines that the current adaptive correction filtering unit allows the use of extended adaptive correction filtering and cannot obtain a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit, the decoding device may use a pixel of the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel to perform filtering.

[0187] For example, when the decoding device determines that the current adaptive correction filtering unit allows the use of extended adaptive correction filtering and the pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, the decoding device may perform filtering using a pixel in the boundary area that is closest to the reference pixel position instead of the reference pixel.

[0188] For example, when the decoding device determines that the current adaptive correction filtering unit allows the use of extended adaptive correction filtering and the pixel value of the pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, the adaptive correction filtering may be performed using a pixel in the current adaptive correction filtering unit and the boundary area that is closest to the position of the reference pixel instead of the reference pixel.

[0189] For example, when the decoding device determines that the current adaptive correction filtering unit does not allow the use of extended adaptive correction filtering and the pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, the adaptive correction filtering may be performed using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel, i.e., the pixels within the boundary area are not considered.

[0190] FIG. 6B shows a flowchart of a filtering method provided by an embodiment of the present invention, in which the filtering method may be applied to an encoding / decoding device, and as shown in FIG. 6B, the filtering method may include the following steps:

[0191] In step S600b, determine whether the current adaptive correction filtering unit allows the use of extended adaptive correction filtering, if so, proceed to step S610b, otherwise proceed to step S620b.

[0192] In step S610b, the first filter is used to perform adaptive correction filtering on the current adaptive correction filtering unit.

[0193] In step S620b, the second filter is used to perform adaptive correction filtering on the current adaptive correction filtering unit.

[0194] In the embodiment of the present invention, in order to increase the flexibility of filter selection, optimize filtering performance, and improve encoding / decoding performance, the filter used in the adaptive correction filtering unit may be different when the adaptive correction filtering unit allows the use of extended adaptive correction filtering and when the adaptive correction filtering unit does not allow the use of extended adaptive correction filtering.Exemplarily, when the decoding device determines that the current adaptive correction filtering unit allows the use of extended adaptive correction filtering, the filter used for performing adaptive correction filtering for the current adaptive correction filtering unit may be a first filter.For example, the first filter may be the filter shown in FIG. 4A.

[0195] For example, when the decoding device determines that the current adaptive compensation filtering unit does not allow the use of the extended adaptive compensation filtering, the filter used for performing the adaptive compensation filtering for the current adaptive compensation filtering unit may be a second filter. For example, the second filter may be the filter shown in FIG.

[0196] In some embodiments, in step S600b, determining whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering may include determining a value of a flag bit to indicate whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and if the value of the flag bit is a first value, determining that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and if the value of the flag bit is a second value, determining that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering.

[0197] A flag bit may indicate whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering. Illustratively, when the value of the flag bit is a first value (e.g., 0), it indicates that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering. When the value of the flag bit is a second value (e.g., 1), it indicates that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering.

[0198] Illustratively, the decoding device may obtain the value of the flag bit, and determine whether the current adaptive corrective filtering unit is allowed to use the extended adaptive corrective filtering based on the value of the flag bit.

[0199] In the process of performing adaptive correction filtering on a current filtering pixel in a current adaptive correction filtering unit, when any of the reference pixels of the current filtering pixel is not located in the current adaptive correction filtering unit and the pixel value of the reference pixel cannot be obtained, adaptive correction filtering is performed using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel, and when the pixel value of the reference pixel is obtained, adaptive correction filtering is performed using the pixel value of the reference pixel. For example, considering that some reference pixels in the reference pixels of the filtering unit may be located outside the filtering unit, i.e., not located within the filtering unit, in this case, the pixel values ​​of the some reference pixels may not be obtained.

[0200] In one example, when the pixel value of a reference pixel cannot be obtained, the reference pixel may be located outside the image boundary of the current image frame, outside the patch boundary of the current patch and filtering across the patch boundary is not allowed, or outside the upper or lower boundary of the current adaptive correction filtering unit, but this is not limited to this.

[0201] For example, considering that for any pixel position, the other pixel position closest to the pixel in question is generally also the pixel position whose pixel value is closest to the pixel value of the pixel position in question, therefore, in order to optimize the filtering effect, when the pixel value of the reference pixel cannot be obtained, filtering may be performed using the pixel closest to the reference pixel position in the current adaptive correction filtering unit and boundary area instead of the reference pixel.

[0202] Illustratively, the distance between pixel locations may be a Euclidean distance.

[0203] For example, the boundary area includes the left outer boundary or the right outer boundary of the current adaptive compensation filtering unit, where the left outer boundary of the current adaptive compensation filtering unit includes some or all of the areas of the filtering units adjacent to the left side of the current adaptive compensation filtering unit, and the right outer boundary of the current adaptive compensation filtering unit includes some or all of the areas of the filtering units adjacent to the right side of the current adaptive compensation filtering unit.

[0204] For example, when it is determined that the current adaptive correction filtering unit allows the use of extended adaptive correction filtering and a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, adaptive correction filtering is performed using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel; when it is determined that the current adaptive correction filtering unit does not allow the use of extended adaptive correction filtering and a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, adaptive correction filtering is performed using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel. Example 3

[0205] An embodiment of the present invention provides a filtering method applied to a decoding device, where the filtering method may include the following steps.

[0206] In T700, when it is determined to start ALF filtering for the current LCU of the current image frame, a region coefficient identifier of the integrated region to which the current LCU belongs is obtained.

[0207] At T710, a filtering coefficient of the current LCU is obtained based on a region coefficient identifier of the integrated region to which the current LCU belongs, and the region coefficient identifier is used to identify a filtering coefficient to be used for the integrated region to which the LCU belongs among a plurality of groups of filtering coefficients that have been preset.

[0208] In the embodiment of the present invention, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, the filtering coefficients used in one integrated region are not limited to one group of filtering coefficients, and one or more groups of filtering coefficients may be selected and used according to actual circumstances.

[0209] For example, for any integrated region, the encoding device may train multiple groups of filtering coefficients, determine that the integrated region uses one or more of the multiple groups of filtering coefficients based on an RDO decision, and write a region coefficient identifier into the bitstream to identify the filtering coefficients used for the integrated region.

[0210] For example, when the decoding device determines to start ALF filtering for a current LCU of a current image frame, the decoding device may obtain a region coefficient identifier of the consolidated region to which the current LCU belongs from information obtained by parsing the bitstream, and determine filtering coefficients to be used for the consolidated region to which the current LCU belongs based on the region coefficient identifier.

[0211] When the filtering coefficients used for the consolidated region to which the current LCU belongs are determined, the filtering coefficients for the current LCU may be determined from the filtering coefficients used for the consolidated region.

[0212] For example, when the consolidated region to which the current LCU belongs uses one group of filtering coefficients, the filtering coefficients used in the consolidated region may be determined as the filtering coefficients of the current LCU.

[0213] In T720, ALF filtering is performed on the pixels of the current LCU one by one based on the filtering coefficients of the current LCU.

[0214] In an embodiment of the present invention, when the filtering coefficient of the current LCU is determined, ALF filtering may be performed on the pixels of the current LCU one by one based on the filtering coefficient of the current LCU.

[0215] In the method flow described in Example 3, multiple groups of filtering coefficients are trained for each region, and based on the RDO decision, it is determined that each integrated region will use one or more groups of the trained multiple groups of filtering coefficients, and the decision result is notified to the decoding device by a region coefficient identifier, so that one region is not limited to using one group of filtering coefficients, and one or more groups of filtering coefficients may be selected according to performance, thereby optimizing the ALF filtering performance and improving the encoding / decoding performance.

[0216] In some embodiments, in T700, determining to initiate ALF filtering for a current LCU of a current image frame includes parsing an LCU coefficient identifier of the current LCU from the bitstream, where the LCU coefficient identifier is used to identify a filtering coefficient to be used for the current LCU from at least one group of filtering coefficients used for an integrated region to which the current LCU belongs, and determining to initiate ALF filtering for the current LCU if a value of the LCU coefficient identifier of the LCU is a non-first value.

[0217] Exemplarily, the encoding device may inform the decoding device that the consolidated region uses one or more groups of filtering coefficients through a region coefficient identifier, and for any LCU of the consolidated region, the encoding device may identify a filtering coefficient to be used for the LCU from among the one or more groups of filtering coefficients used for the consolidated region through an LCU coefficient identifier.

[0218] For example, for any LCU, the decoding device may determine, based on an LCU coefficient identifier for that LCU obtained by parsing from the bitstream, whether to start ALF filtering for that LCU and the filtering coefficient at which to start ALF filtering for that LCU.

[0219] Exemplarily, for any LCU, when the value of the LCU coefficient identifier of the LCU is a first value, it indicates that ALF filtering is not started for the LCU.

[0220] For any LCU, if the value of the LCU coefficient identifier of the LCU parsed from the bitstream by the decoding device is a non-first value, it may be determined to start ALF filtering for the LCU.

[0221] For example, assuming that the first value is 0, for any LCU, if the value of the LCU coefficient identifier of the LCU obtained by parsing the bitstream by the decoding device is 0, it may be determined not to initiate ALF filtering for the LCU, and if the value of the LCU coefficient identifier of the LCU obtained by parsing the bitstream by the decoding device is not 0, it may be determined to initiate ALF filtering for the LCU, and the decoding device may determine a filtering coefficient to be used for the LCU based on the LCU coefficient identifier of the LCU.

[0222] When the value of the LCU coefficient identifier of an LCU is a non-first value, if the integrated region to which the LCU belongs uses one group of filtering coefficients, the filtering coefficient of the LCU is the filtering coefficient of the group; when the integrated region to which the LCU belongs uses multiple groups of filtering coefficients, it is further necessary to determine the filtering coefficient of the LCU based on the specific value of the LCU coefficient identifier of the LCU.

[0223] In one example, in T710, obtaining a filtering coefficient for the current LCU based on a region coefficient identifier of the consolidated region to which the current LCU belongs may include, when it is determined based on the region coefficient identifier of the consolidated region to which the current LCU belongs that the consolidated region to which the LCU belongs uses multiple groups of filtering coefficients, determining a filtering coefficient for the current LCU from the multiple groups of filtering coefficients used for the consolidated region to which the LCU belongs based on an LCU coefficient identifier of the current LCU.

[0224] For any LCU, when the decoding device determines that the consolidated region to which the LCU belongs uses multiple groups of filtering coefficients, the decoding device may determine filtering coefficients to be used for the LCU based on the LCU coefficient identifier of the LCU obtained by analyzing the bitstream. For any consolidated region, the filter shapes of the multiple groups of filtering coefficients used for the consolidated region may be the same or may not be the same. Example 4

[0225] An embodiment of the present invention provides a filtering method applied to a decoding device, where the filtering method may include the following steps.

[0226] In T800, if it is determined to start ALF filtering for a current LCU of a current image frame, a coefficient selection identifier for the current LCU is obtained.

[0227] In T810, a filtering coefficient of the current LCU is determined based on an aggregated region to which the current LCU belongs and a coefficient selection identifier of the current LCU, where the coefficient selection identifier is used to identify a filtering coefficient that the current LCU selects and uses from a plurality of groups of filtering coefficient candidates.

[0228] In an embodiment of the present invention, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, an LCU is not limited to selecting the filtering coefficients of the integrated region to which it belongs, but may adaptively select one group of filtering coefficients from multiple groups of filtering coefficients to perform ALF filtering.

[0229] For any LCU, the filtering coefficient candidates for the LCU include, but are not limited to, the filtering coefficients of the consolidated region to which the LCU belongs and the filtering coefficients of the regions adjacent to the consolidated region to which the LCU belongs, so that when one group of filtering coefficients is transmitted in each region, there may be multiple groups of filtering coefficient candidates in one LCU, thereby increasing the flexibility of LCU filtering coefficient selection, optimizing the ALF filtering effect, and improving encoding / decoding performance.

[0230] For any LCU, the encoding device may determine a filtering coefficient that the LCU uses in the multiple groups of filtering coefficients based on the RDO determination, and write a coefficient selection identifier corresponding to the filtering coefficient into a bitstream and send it to the decoding device. The decoding device may determine a filtering coefficient of the current LCU based on the aggregate region to which the current LCU belongs and the coefficient selection identifier of the current LCU obtained by analyzing the bitstream.

[0231] In T820, ALF filtering is performed on the pixels of the current LCU one by one based on the filtering coefficients of the current LCU.

[0232] In an embodiment of the present invention, when the decoding device determines the filtering coefficients of the current LCU, the decoding device may perform ALF filtering on the pixels of the current LCU one by one based on the filtering coefficients of the current LCU.

[0233] In the method flow described in the embodiment, multiple groups of filtering coefficients are set for each LCU, the filtering coefficients to be used for each LCU are determined based on an RDO decision, and the decision result is notified to the decoding device by a coefficient selection identifier, thereby increasing the flexibility of the filtering coefficients to be used for each LCU, optimizing ALF filtering performance, and improving encoding / decoding performance.

[0234] In some embodiments, in T810, determining a filtering coefficient of the LCU based on the consolidated region to which the LCU belongs and the coefficient selection identifier of the LCU may include: determining, when the value of the coefficient selection identifier of the current LCU is a first value, a filtering coefficient of the consolidated region immediately before the consolidated region to which the current LCU belongs as the filtering coefficient of the current LCU; determining, when the value of the coefficient selection identifier of the current LCU is a second value, a filtering coefficient of the consolidated region to which the current LCU belongs as the filtering coefficient of the current LCU; and determining, when the value of the coefficient selection identifier of the current LCU is a third value, a filtering coefficient of the consolidated region immediately after the consolidated region to which the current LCU belongs as the filtering coefficient of the current LCU.

[0235] For example, for any LCU in any consolidated region, the candidate filtering coefficients for that LCU may include a filtering coefficient of that consolidated region, a filtering coefficient of the consolidated region immediately before that consolidated region, and a filtering coefficient of the consolidated region immediately after that consolidated region.

[0236] For example, the consolidated area immediately before the consolidated area to which the LCU belongs is a consolidated area corresponding to an adjacent index immediately before the index of the consolidated area to which the LCU belongs. The consolidated area immediately after the consolidated area to which the LCU belongs is a consolidated area corresponding to an adjacent index immediately after the index of the consolidated area to which the LCU belongs.

[0237] Regarding the integrated areas (assuming the order is integrated area 0 to integrated area 15) obtained by performing area integration on 16 areas obtained by the fixed area division method, the integrated area immediately after integrated area 15 may be integrated area 0, and the integrated area immediately before integrated area 0 may be area 15.

[0238] For example, for any LCU, the encoding device may determine the filtering coefficient to be used for it based on the RDO determination, and if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region immediately before the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a first value, such as 0, if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a second value, such as 1, and if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region immediately after the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a third value, such as 2.

[0239] For example, for any LCU, if the value of the coefficient selection identifier for that LCU obtained by analyzing the bitstream by the decoding device is a first value, the filtering coefficient of the integrated region immediately preceding the integrated region to which the LCU belongs may be determined as the filtering coefficient of that LCU; if the value of the coefficient selection identifier for that LCU obtained by analyzing the bitstream is a second value, the filtering coefficient of the integrated region to which the LCU belongs may be determined as the filtering coefficient of that LCU; and if the value of the coefficient selection identifier for that LCU obtained by analyzing the bitstream is a third value, the filtering coefficient of the integrated region immediately following the integrated region to which the LCU belongs may be determined as the filtering coefficient of that LCU.

[0240] As can be seen from this, the filtering coefficients of the integrated region to which the LCU belongs, the integrated region immediately before the integrated region to which the LCU belongs, and the integrated region immediately after the integrated region to which the LCU belongs are all set as filtering coefficient candidates for the LCU, and one group of filtering coefficients is selected as the filtering coefficients of the LCU based on the RDO decision. Thus, even if only one group of filtering coefficients is trained in one integrated region, there are multiple groups of filtering coefficients for the LCU in the integrated region, and there is no need to train multiple groups of filtering coefficients for one integrated region. This increases the flexibility of the filtering coefficients of the LCU, thereby optimizing the ALF filtering performance and improving the encoding / decoding performance. Example 5

[0241] FIG. 7 shows a flowchart of a filtering method provided by an embodiment of the present invention, in which the filtering method may be applied to a decoding device, and as shown in FIG. 7, the filtering method may include the following steps:

[0242] In step S700, when it is determined to start ALF filtering for the current LCU of the current image frame, a filter shape of the integrated region to which the current LCU belongs is obtained based on the integrated region to which the current LCU belongs.

[0243] In step S710, a filtering coefficient of the integrated region to which the current LCU belongs is obtained based on a filter shape.

[0244] In the embodiment of the present invention, in order to increase the flexibility of the filtering coefficients, optimize the ALF filtering effect, and improve the encoding / decoding performance, each region is not limited to using the same filter shape, but selectively uses different filter shapes, that is, the filter shapes used for different integrated regions may be the same or different.

[0245] For example, for any integrated region, the encoding device may train multiple groups of filtering coefficients with different filter shapes, determine the filter shape and filtering coefficients to be used for that integrated region based on an RDO decision, and write the filter shape and filtering coefficients into a bitstream to send to the decoding device.

[0246] For example, for any integrated region, when the decoding device obtains the filtering coefficients for that integrated region, it may parse the filter shape of that integrated region from the bitstream, and parse the filtering coefficients for that integrated region from the bitstream based on the filter shape.

[0247] In step S720, ALF filtering is performed on the pixels of the current LCU one by one based on the filter shape and the filtering coefficients.

[0248] In an embodiment of the present invention, when the decoding device determines the filtering coefficients of the current LCU, the decoding device may perform ALF filtering on the pixels of the current LCU one by one based on the filtering coefficients of the current LCU.

[0249] It can be seen from this that in the method flow shown in FIG. 7, multiple groups of filtering coefficients with different filter shapes are trained for each region, and the filter shapes and filtering coefficients used for each integrated region are determined based on the RDO determination, and the determination result is notified to the decoding device in the bitstream, so that the decoding device can analyze and obtain the filter shapes and filtering coefficients of each region from the bitstream, thereby optimizing the ALF filtering effect and improving the encoding / decoding performance.

[0250] In an embodiment of the present invention, a filter shape may be selected for an image frame, or for a component (e.g., luma component and / or chroma component) of an image frame. For example, if image frame A selects a centrosymmetric filter shape of 7*7 cross+5*5 square, then each LCU that initiates ALF filtering in image frame A uses the centrosymmetric filter shape of 7*7 cross+5*5 square. Example 6

[0251] FIG. 8 shows a flowchart of a filtering method provided by an embodiment of the present invention, in which the filtering method may be applied to a decoding device, and as shown in FIG. 8, the filtering method may include the following steps:

[0252] In step S800, if it is determined to start ALF filtering for the current LCU of the current image frame, a filtering coefficient for the integrated region to which the current LCU belongs and a weighting coefficient for each reference pixel position are obtained based on the integrated region to which the current LCU belongs.

[0253] In step S810, ALF filtering is performed on the pixels of the current LCU one by one based on the filtering coefficients and the weighting coefficients of each reference pixel position.

[0254] In an embodiment of the present invention, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, the filter used when performing ALF filtering is not limited to a symmetric filter, and an asymmetric filter may also be adopted, that is, the filtering coefficients at symmetric positions are different and may satisfy a certain ratio relationship, such as 0.5:1.5 or 0.6:1.4.

[0255] When performing ALF filtering based on the determined filtering coefficients, All filtering coefficients each andSince the filtered pixel value needs to be obtained based on the sum of products with the reference pixel at the corresponding position, the above ratio may be the ratio between the filtering coefficients at symmetric positions, or may be the ratio of weights (also called weight ratio) when the pixel values ​​of the reference pixels corresponding to the filtering coefficients at symmetric positions participate in the ALF filtering calculation. That is, the above asymmetric filter means that the filtering coefficients at symmetric positions are different, or the weights of the pixel values ​​of the reference pixels corresponding to the filtering coefficients at symmetric positions are different.

[0256] For example, the filtering coefficients of a 7*7 cross + 5*5 square central symmetric filter are C i and the filtering coefficient at the symmetric position is C 28-i Therefore, C i :C 28-i =A i :(2-A i ), or P i and P 28-i The weight ratio when participates in the ALF filtering calculation is A i :(2-A i ), and P i C i is the pixel value of the reference pixel position corresponding to P 28-i C 28-i For the current filtering pixel of the LCU, the filtered pixel value of the pixel may be determined in the following manner:

number

[0257] C i is the (i+1)-th filtering coefficient in the filtering coefficients of the integrated region to which the LCU belongs, and P i is the filtering coefficient C i is the pixel value of the reference pixel position corresponding to P 28-i and the corresponding reference pixel position P i The reference pixel position corresponding to A is center-symmetric with respect to the pixel position of the current filtering pixel, iP i is the weighting factor of the pixel value at the reference pixel position corresponding to P 14 is the pixel value of the current filtering pixel, and C 14 is the filtering coefficient of the current filtering pixel, and 0 i <2.

[0258] In an embodiment of the present invention, for any aggregated region, the encoding device may determine the filtering coefficients and filtering performance of the aggregated region, where each position corresponds to a different weighting factor, select a group of filtering coefficients with the best filtering performance, record the filtering coefficients and the weighting factors corresponding to each position of the corresponding filter, and write them into a bitstream to send to a decoding device.

[0259] Exemplarily, a weighting factor set (e.g., A i Alternatively, a weighting coefficient set (a set of values ​​of the weighting coefficients) may be pre-constructed, each weighting coefficient may be selected from the set, an optimal filtering coefficient for filtering performance and a weighting coefficient corresponding to each position of the corresponding filter may be obtained, and an index of the weighting coefficient in the weighting coefficient set may be written into a bitstream to be transmitted to the decoding device.

[0260] For any LCU, the decoding device may analyze from the bitstream the filtering coefficients of the integrated region to which the LCU belongs and the weighting coefficients of each reference pixel position corresponding to the integrated region to which the LCU belongs, and perform ALF filtering on the pixels of the LCU one by one.

[0261] In the method flow shown in Figure 8, the filters used in each integrated region are not limited to being symmetric filters, and the filtering coefficients of reference pixels at symmetric positions are not limited to being the same and may satisfy a certain ratio relationship, and the filtering coefficients at symmetric positions satisfy the ratio relationship without increasing the number of required filtering coefficients. This increases the flexibility of the filtering coefficients, optimizes the ALF filtering performance, and improves the encoding / decoding performance. Example 7 ​

[0262] An embodiment of the present invention provides a filtering method applied to an encoding device, the filtering method may include the following steps.

[0263] In T100, segmentation is performed on the luminance component of the current image frame.

[0264] For segmentation of the luminance component of an image frame, see the above description of "Segmentation".

[0265] In T110, for any region, classification is performed for each LCU in the region, and the region is divided into a plurality of region classes based on the class of each LCU.

[0266] In an embodiment of the present invention, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, when performing region division on the luminance component of an image frame using a fixed region division method to obtain multiple regions, for each region, the LCUs in the region are divided into at least one class based on the pixel characteristics of each pixel in the region, that is, a region may be divided into at least one sub-region or region class according to an LCU classification method.

[0267] In T120, region integration is performed for each region class, and a filtering coefficient for each integrated region is determined.

[0268] At T130, the filtering coefficients of each integrated region and the region class identifier of each LCU are written to the bitstream.

[0269] In an embodiment of the present invention, when the encoding device classifies the LCUs in each region as described above, the encoding device performs region integration for each region class to obtain at least one integrated region, and determines a filtering coefficient for each integrated region.

[0270] The method of implementing area integration for each area class is similar to the related explanation of the "area integration" section above, so a detailed explanation will be omitted here.

[0271] For example, for any region class, the encoding device may assign one coefficient index based on the aggregated region to which it belongs, and the coefficient index corresponds to the filtering coefficients of one of the aggregated regions.

[0272] In an embodiment of the present invention, the encoding device may write filtering coefficients for each integrated region, an index for each region class, and a region class identifier for identifying the region class to which each LCU belongs into a bitstream and transmit it to the decoding device.

[0273] The processing flow of the decoding device may refer to the relevant explanation in the above embodiment, and a detailed explanation will be omitted here. Example 8

[0274] An embodiment of the present invention provides a filtering method applied to an encoding device, the filtering method may include the following steps.

[0275] In T200, for any integrated region of the current image frame, the filtering coefficients to be used for that integrated region are determined based on the RDO determination.

[0276] At T210, a region coefficient identifier for the integrated region is determined based on a filtering coefficient used for the region, where the region coefficient identifier is used to identify a filtering coefficient used for the integrated region among a plurality of pre-defined groups of filtering coefficients.

[0277] At T220, the filtering coefficients used for each consolidated region and the region coefficient identifiers for each consolidated region are written to the bitstream.

[0278] In the embodiment of the present invention, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, the filtering coefficients used in one integrated region are not limited to one group of filtering coefficients, and one or more groups of filtering coefficients may be selected and used according to actual circumstances.

[0279] For any integrated region, the encoding device may train multiple groups of filtering coefficients, determine based on an RDO decision that the integrated region will use one or more of the multiple groups of filtering coefficients, and write a region coefficient identifier into the bitstream to identify the filtering coefficients used for the integrated region.

[0280] The processing flow of the decoding device may refer to the relevant explanation in the above embodiment, and a detailed explanation will be omitted here.

[0281] The above filtering method may further include, for any integrated region of the current image frame, when the filtering coefficients used for the integrated region include multiple groups, determining an LCU coefficient identifier for each LCU based on the filtering coefficients used for each LCU in the integrated region, and writing the LCU coefficient identifier for each LCU to the bitstream.

[0282] Exemplarily, the encoding device may inform the decoding device that the aggregated region uses one or more groups of filtering coefficients via a region coefficient identifier, and for any LCU of the aggregated region, the encoding device may identify a filtering coefficient to be used for the LCU within the one or more groups of filtering coefficients used for the aggregated region via an LCU coefficient identifier.

[0283] For any consolidated region, if the encoding device determines that the consolidated region uses multiple groups of filtering coefficients, then, for any LCU of the consolidated region, the encoding device may inform the decoding device of the filtering coefficients in the multiple groups of filtering coefficients to be used for that LCU via an LCU coefficient identifier.

[0284] For any LCU, if the encoding device determines not to start ALF filtering for the LCU, the value of the LCU coefficient identifier for the possible LCU written to the bitstream by the encoding device is a first value. For example, assuming that the first value is 0, for any LCU, if the encoding device determines not to start ALF filtering for the LCU, the value of the LCU coefficient identifier for the LCU written to the bitstream is 0. Example 9

[0285] An embodiment of the present invention provides a filtering method applied to an encoding device, the filtering method may include the following steps.

[0286] In T300, for any integrated region of the current image frame, a filtering coefficient to be used for the integrated region is determined from the multiple groups of filtering coefficients based on the RDO determination.

[0287] At T310, a coefficient selection identifier for each LCU in the aggregated region is determined based on the filtering coefficients used for the region, where the coefficient selection identifier is used to identify a filtering coefficient that each LCU selects to use from multiple groups of filtering coefficients.

[0288] At T320, the filtering coefficients used for each integrated region and the coefficient selection identifiers for each LCU are written into the bitstream.

[0289] In an embodiment of the present invention, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, an LCU is not limited to selecting the filtering coefficients of the integrated region to which it belongs, but may adaptively select one group of filtering coefficients from multiple groups of filtering coefficients to perform ALF filtering.

[0290] For example, for any LCU, the filtering coefficient candidates for the LCU include, but are not limited to, the filtering coefficients of the consolidated region to which the LCU belongs and the filtering coefficients of the regions adjacent to the consolidated region to which the LCU belongs, so that when one group of filtering coefficients is transmitted in each region, there may be multiple groups of filtering coefficient candidates in one LCU, thereby increasing the flexibility of LCU filtering coefficient selection, optimizing the ALF filtering effect, and improving encoding / decoding performance.

[0291] For example, for any LCU, the encoding device may determine a filtering coefficient that the LCU uses in the multiple groups of filtering coefficients based on the RDO decision, and write a coefficient selection identifier corresponding to the filtering coefficient into a bitstream and send it to the decoding device.

[0292] The processing flow of the decoding device may refer to the relevant explanation in the above embodiment, and a detailed explanation will be omitted here.

[0293] For any LCU in any consolidated region, the filtering coefficient candidates for that LCU may include the filtering coefficient of that consolidated region, the filtering coefficient of the consolidated region immediately before that consolidated region, and the filtering coefficient of the consolidated region immediately after that consolidated region.

[0294] When integrating the 16 regions obtained by the fixed region division method to include 16 integrated regions (assuming the order is integrated region 0 to integrated region 15), the integrated region immediately after integrated region 15 may be integrated region 0, and the integrated region immediately before integrated region 0 may be region 15.

[0295] For any LCU, the encoding device may determine the filtering coefficient to be used for it based on the RDO determination, and if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region immediately before the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a first value, such as 0, if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a second value, such as 1, and if it determines that the filtering coefficient to be used for the LCU is the filtering coefficient of the consolidated region immediately after the consolidated region to which the LCU belongs, it may determine that the value of the coefficient selection identifier for the LCU is a third value, such as 2. Example 10

[0296] An embodiment of the present invention provides a filtering method applied to an encoding device, the filtering method may include the following steps.

[0297] In T400, for any integrated region of the current image frame, the filter shape and filtering coefficients to be used for that integrated region are determined based on the RDO determination.

[0298] At T410, the filter shapes and filtering coefficients used for each integrated region are written to the bitstream.

[0299] In the embodiment of the present invention, in order to increase the flexibility of the filtering coefficients, optimize the ALF filtering effect, and improve the encoding / decoding performance, each integrated region is not limited to using the same filter shape, but selectively uses different filter shapes, that is, the filter shapes used for different integrated regions may be the same or different.

[0300] For example, for any integrated region, the encoding device may train multiple groups of filtering coefficients with different filter shapes, determine the filter shape and filtering coefficients to be used for that integrated region based on an RDO decision, and write the filter shape and filtering coefficients into a bitstream to send to the decoding device.

[0301] The processing flow of the decoding device may refer to the relevant explanation in the above embodiment, and a detailed explanation will be omitted here.

[0302] In an embodiment of the present invention, a filter shape may be selected for an image frame, or for a component (e.g., luma component and / or chroma component) of an image frame. For example, if image frame A selects a centrosymmetric filter shape of 7*7 cross+5*5 square, then each LCU that initiates ALF filtering in image frame A uses the centrosymmetric filter shape of 7*7 cross+5*5 square. Example 11

[0303] An embodiment of the present invention provides a filtering method applied to an encoding device, the filtering method including the following steps.

[0304] In T500, for any integrated region of the current image frame, the filtering coefficients to be used for the integrated region and the weighting coefficients for each corresponding reference pixel position are determined based on the RDO determination.

[0305] At T510, the filtering coefficients used for each integrated region and the corresponding weighting coefficients for each reference pixel position are written to the bitstream.

[0306] In an embodiment of the present invention, in order to optimize the ALF filtering effect and improve the encoding / decoding performance, the filter used when performing ALF filtering is not limited to a symmetric filter, and an asymmetric filter may also be adopted, that is, the filtering coefficients at symmetric positions are different and may satisfy a certain ratio relationship, such as 0.5:1.5 or 0.6:1.4.

[0307] For example, taking the filter shown in FIG. 13 as an example, in the filter shown in FIG. 13, the filtering coefficients that are centrally symmetric with respect to the position of C14 are not limited to being the same, and may satisfy a certain ratio relationship, such as C1:C27=0.5:1.5, C6:C22=0.6:1.4, etc.

[0308] When performing ALF filtering based on the determined filtering coefficients, All filtering coefficients each and It is necessary to obtain the pixel value after filtering based on the sum of the products with the reference pixels at the corresponding positions. Therefore, the ratio may be the ratio between the filtering coefficients at symmetric positions, or the ratio of weights (also called weight ratios) when the pixel values ​​of the reference pixels corresponding to the filtering coefficients at symmetric positions participate in the ALF filtering calculation. That is, the asymmetric filter means that the filtering coefficients at symmetric positions are different, or the weights of the pixel values ​​of the reference pixels corresponding to the filtering coefficients at symmetric positions are different.

[0309] For example, the filtering coefficients of the central symmetric filter shape of 7*7 cross + 5*5 square shown in Figure 13 are C i and the filtering coefficient at the symmetric position is C 28-i Therefore, C i :C 28-i =A i :(2-A i ), or P i and P 28-i The weight ratio when participates in the ALF filtering calculation is A i :(2-A i ), and P i C iis the pixel value of the reference pixel position corresponding to P 28-i C 28-i For the current filtering pixel of the LCU, the filtered pixel value of the pixel may be determined in the following manner:

number

[0310] C i is the (i+1)-th filtering coefficient in the filtering coefficients of the integrated region to which the LCU belongs, and P i is the filtering coefficient C i is the pixel value of the reference pixel position corresponding to P 28-i and the corresponding reference pixel position P i The reference pixel position corresponding to A is center-symmetric with respect to the pixel position of the current filtering pixel, i P i is the weighting factor of the pixel value at the reference pixel position corresponding to P 14 is the pixel value of the current filtering pixel, and C 14 is the filtering coefficient of the current filtering pixel, and 0 i <2.

[0311] As shown in Figure 13, the filter C i :C 28-i =A i (2-A i ), in the case where the filtering coefficients at symmetric positions (centrosymmetric with respect to C14) are different, it is only necessary to train 15 coefficients C0 to C14, and other coefficients may be determined based on weighting coefficients. For example, if A1=0.5, C1:C27=0.5:1.5, and if A0=0.6, C0:C28=0.6:1.4.

[0312] ​In an embodiment of the present invention, for any aggregated region, the encoding device may determine the filtering coefficients and filtering performance of the aggregated region, where each position corresponds to a different weighting factor, select a group of filtering coefficients with the best filtering performance, record the filtering coefficients and the weighting factors corresponding to each position of the corresponding filter, and write them into a bitstream to send to a decoding device.

[0313] Exemplarily, a weighting factor set (e.g., A i Alternatively, a weighting coefficient set (a set of values ​​of the weighting coefficients) may be pre-constructed, each weighting coefficient may be selected from the set, an optimal filtering coefficient for filtering performance and a weighting coefficient corresponding to each position of the corresponding filter may be obtained, and an index of the weighting coefficient in the weighting coefficient set may be written into a bitstream to be transmitted to the decoding device.

[0314] The processing flow of the decoding device may refer to the relevant explanation in the above embodiment, and a detailed explanation will be omitted here.

[0315] In order to facilitate those skilled in the art to understand the technical solutions provided by the embodiments of the present invention, the technical solutions provided by the embodiments of the present invention are described below with specific examples.

[0316] In response to the shortcomings of conventional ALF techniques, embodiments of the present invention provide the following optimization measures.

[0317] Method 1: We propose to adaptively divide each frame into multiple regions using LCU as the smallest unit, and each region may contain one or more LCUs, and therefore classify each LCU and classify LCUs in the same region into N classes (N is a positive integer).

[0318] Means 2 may transmit multiple groups of filtering coefficients in each region, and the filter shapes of each group may be the same or different.

[0319] Means 3: adaptively selecting a group of filtering coefficients based on each LCU, and LCUs in the same region may select filtering coefficients of adjacent regions.

[0320] Means 4: Only one group of filtering coefficients can be transmitted in each region, but the filter shapes of each region can be different.

[0321] Means 5 includes changing the symmetric filter into an asymmetric filter, optimizing that the filtering coefficients at the symmetric positions are the same, and that the filtering coefficients at the symmetric positions satisfy a certain ratio relationship, such as 0.5:1.5 or 0.6:1.4.

[0322] Means 6: Optimization is performed on the boundary sample values ​​during filtering.

[0323] Below, the main improvements of the present invention will be described first from the encoding side and the decoding side. I. Encoding method and encoding device

[0324] For the encoding device, obtain the ALF switch sequence header and judge whether it is necessary to start the ALF technique for the current sequence. If the ALF switch sequence header is off, the ALF technique is off, and the optimization of the ALF technique (i.e., the optimization of the ALF filtering means provided by the embodiment of the present invention including one or more optimization means among the above means 1 to means 6 for the conventional ALF technique) is also off, and send the ALF switch sequence header to the decoding device. If the ALF switch sequence header is on, it can enter the ALF technique encoding and obtain the ALF technique optimization sequence header.

[0325] If the ALF technique optimization is off, the original ALF technique is used for filtering. The ALF switch sequence header, the optimization technique sequence header, and the parameters required for the ALF technique are transmitted to the decoding device.

[0326] If the optimization of the ALF technique is on, it may be optimized in the following manner, and the ALF switch sequence header, the optimization technique sequence header, and the parameters required for the optimized ALF technique are sent to the decoding device.

[0327] Illustratively, the optimization technique sequence header may not be present, in which case the ALF switch sequence header being on determines to use the optimized ALF technique solution.

[0328] 1.1. Adaptive segmentation using LCU as the smallest unit

[0329] A fixed region division is performed on the luminance component to obtain a plurality of regions, and the LCUs belonging to the same region are divided again (i.e., each LCU in the same region is classified), and the same region is further divided into a maximum of N1 classes (N1 is a positive integer). For example, when N1=2, the total number of regions is a maximum of twice the original, and when N1=1, it is the original fixed region division means.

[0330] The encoding device may mark the results of the LCU partitioning in each region and transmit the mark to the decoding device (i.e., transmit the region class identifier of each LCU to the decoding device).

[0331] 1.2, each region may transmit multiple groups of filtering coefficients means

[0332] For any aggregated region, up to n groups of filtering coefficients may be transmitted. Mark each LCU in the aggregated region, where 0 indicates off, i.e., do not start ALF filtering, and i indicates that the current LCU uses a group of filtering coefficients in the region, with the value of i ranging from [1,n].

[0333] Exemplarily, the method of obtaining each set of filtering coefficients is as follows: When the filtering coefficients are trained for the first time, all LCUs default to starting ALF filtering, and after the determination, for the off LCUs (i.e., LCUs that do not start ALF filtering), they do not participate in the second filtering coefficient training, and LCUs with the same mark train the same group of filtering coefficients together.

[0334] Similarly, the training of the third filtering coefficients is performed based on the results of the second determination.

[0335] Finally, based on the frame level or the region level, it is determined that the image frame or the consolidated region uses at most n groups of filtering coefficients, and finally, the filtering coefficients corresponding to each consolidated region are written into the bitstream.

[0336] 1.3. Each LCU adaptively selects a group of filtering coefficients

[0337] For the luminance component, for any LCU, the filtering coefficient of the region where the current LCU is located or the filtering coefficient of another region may be selected and used at the time of decision, and the maximum number of selectable filters for each LCU is N2 (i.e., N2 groups of filtering coefficients, N2≧2), and RDO decision is made with the N2 groups of filtering coefficients, and one group of filtering coefficients with the best performance is selected, and the best selection result of the current LCU is sent to the decoding device (i.e., the coefficient selection identifier is sent to the decoding device). Exemplarily, N2 is equal to or less than the number of regions after integration.

[0338] 1.4, Select filters with different shapes for each region

[0339] Since each region conveys one group of filtering coefficients, for any LCU, the encoding device can inform the decoding device via one flag bit whether to start or not start (i.e., turn off) ALF filtering for that LCU.

[0340] When calculating the filtering coefficients of each region, the filtering coefficients of N3 (N3≧2) different filter shapes may be calculated for any one of the integrated regions, the filter performances of the N3 filter shapes may be calculated, and one filter shape with the optimal performance may be selected. After that, the optimal filter shape and filtering coefficients with the optimal performance in each integrated region are notified to the decoding device by the bit stream.

[0341] In addition, the encoding device may select filters with different shapes based on the frame level, or may select filters with different shapes based on the Y, U, and V components. For example, for any image frame, the encoding device may calculate filtering coefficients for N4 different filter shapes, calculate the filtering performance of the image frame with N4 (N4≧2) filter shapes, and select one filter shape with the optimal performance. Then, the optimal filter shape and the filtering coefficients of each region for the performance of the image frame are notified to the decoding device by a bit stream.

[0342] 1.5. Change the symmetric filter to an asymmetric filter.

[0343]

number

[0344] For example, after changing the symmetric filter to the asymmetric filter, the filtering coefficients at the symmetric positions satisfy different ratio relationships, so that when performing coefficient training,

number

[0345] For example, for the filter shape shown in Figure 4A, C i and C. 28-i is symmetric position. The ratio relationship of the filtering coefficient of each symmetric position can be selected by RDO determination, and the ratio of the filtering coefficient of each position and the filtering coefficient of the symmetric position is sent to the decoding device in bitstream. Illustratively, when the ratio of the filtering coefficient of all symmetric positions is 1:1, the filter obtained by training is still a symmetric filter. II. Decoding method and device

[0346] For a decoding device, it may read the ALF switch sequence header from the bitstream to determine whether it is necessary to start the ALF technique for the current sequence. If the ALF switch sequence header is off, the ALF technique is off. If the ALF switch sequence header is on, it may subsequently read the ALF technique optimization sequence header.

[0347] If the ALF technique optimization sequence header is off, obtain the filtering parameters required for the original ALF technique, and if the ALF technique optimization sequence header is on, read the filtering parameters required for the optimized ALF technique.

[0348] Illustratively, the ALF optimization technique sequence header may not be present, in which case, if the ALF switch sequence header is on, it will read the filtering parameters required for the optimized ALF technique.

[0349] 2.1. Adaptive segmentation using LCU as the smallest unit

[0350] A fixed region division is performed on the luminance component to obtain multiple regions, filtering coefficients for all regions are read from the bitstream, region class identifiers of all LCUs for starting ALF filtering are read from the bitstream, the region class to which the LCU belongs is determined based on the fixed region division result and the region class identifier of the LCU, corresponding filtering coefficients are obtained based on the region class to which the LCU belongs, and ALF filtering is performed on the pixels of the LCU one by one.

[0351] 2.2, each region may transmit multiple groups of filtering coefficients means

[0352] A frame level or region level coefficient identifier is read from the bitstream, multiple groups of filtering coefficients in each integrated region are obtained from the bitstream based on the frame level or region level coefficient identifier, and the number of filters (i.e., the number of groups of filtering coefficients) selectable by the frame level or region level coefficient identifier is determined.

[0353] The LCU coefficient identifier of each LCU is obtained from the bitstream, and a group of filtering coefficients is selected based on the LCU coefficient identifier of each LCU. When filtering is performed on the current LCU, ALF filtering is performed on the pixels of the LCU one by one using the filtering coefficients of the group.

[0354] 2.3. Each LCU adaptively selects a group of filtering coefficients

[0355] The filtering coefficients for each region and the ALF flag bit for each LCU (i.e., whether to start ALF filtering for the LCU) are read from the bitstream, and for each LCU for which ALF filtering is to be started, the coefficient selection identifier for that LCU is read from the bitstream.

[0356] For any LCU, the number of selectable filters is at most N2 (i.e., the number of filtering coefficient candidates is at most N2 groups).

[0357] 2.4, Select filters with different shapes for each region

[0358] For any one of the integrated regions, a filter shape of the integrated region may be read from the bitstream, and a filtering coefficient of the integrated region may be read based on the filter shape. ALF filtering is performed on the pixels of each LCU in the integrated region one by one based on the filter shape and the filtering coefficient.

[0359] 2.5. Change the symmetric filter to an asymmetric filter.

[0360] The filtering coefficients of each integrated region are read from the bit stream, and the ratio coefficients of the filtering coefficients in the symmetrical positions are read.

[0361] A filtering coefficient at each position of the integrated region is derived according to a ratio coefficient between the filtering coefficient at each position and the filtering coefficient at a symmetric position, and ALF filtering is performed on the pixels of each LCU in the integrated region one by one.

[0362] In the following, a means for optimizing the sample values ​​of the filtering boundaries will be described. Example 12 Optimization method 1 for filtering boundary sample values

[0363] Assume that the filter shape is as shown in Fig. 4A. If the sample used in the adaptive compensation filtering process (i.e., the reference pixel when filtering the current filtering pixel in the adaptive compensation filtering unit) is a sample in the adaptive compensation filtering unit (i.e., the reference pixel is located in the adaptive compensation filtering unit), filtering is performed using the sample; if the sample used in the adaptive compensation filtering process does not belong to the sample in the adaptive compensation filtering unit (i.e., the reference pixel is not located in the adaptive compensation filtering unit), filtering is performed according to the following method:

[0364] 12.1. If the sample lies outside the image boundary, or outside a patch boundary, and filtering across patch boundaries is not allowed,

[0365] 12.1.1. If the sample corresponds to the C1, C2, C6, C4, C5 or C10 position of the filter shape, the adaptive correction filtering unit and the sample closest to the sample in the boundary area are used instead of the sample for filtering.

[0366] 12.1.2. If the sample does not correspond to the C1, C2, C6, C4, C5 or C10 position of the filter shape, the sample closest to the sample in the adaptive correction filtering unit is used instead of the sample.

[0367] 12.2, if the sample is outside the upper or lower boundary of the adaptive correction filtering unit;

[0368] 12.2.1. If the sample corresponds to the C1, C2, C6, C4, C5 or C10 position of the filter shape, the adaptive correction filtering unit and the closest sample in the boundary area to the sample are used instead of the sample for filtering.

[0369] 12.2.2. If the sample does not correspond to the C1, C2, C6, C4, C5 or C10 position of the filter shape, the sample closest to the sample in the adaptive correction filtering unit is used instead of the sample.

[0370] 12.3. If the sample does not satisfy either the conditions in 12.1 or 12.2, filtering is performed using the sample. Example 13 Optimization method 2 for filtering boundary sample values

[0371] Assume that the filter shape is as shown in Fig. 4A. If the sample used in the adaptive compensation filtering process (i.e., the reference pixel when filtering the current filtering pixel in the adaptive compensation filtering unit) is a sample in the adaptive compensation filtering unit (i.e., the reference pixel is located in the adaptive compensation filtering unit), filtering is performed using the sample; if the sample used in the adaptive compensation filtering process does not belong to the sample in the adaptive compensation filtering unit (i.e., the reference pixel is not located in the adaptive compensation filtering unit), filtering is performed according to the following method:

[0372] 13.1. If the sample is located outside the image boundary, or outside the patch boundary and filtering across the patch boundary is not allowed, the sample is filtered using the closest sample in the adaptive correction filtering unit and boundary area instead of the sample.

[0373] 13.2. If the sample is outside the upper or lower boundary of the adaptive compensation filtering unit, the closest sample in the adaptive compensation filtering unit and boundary area to the sample is used instead of the sample for filtering.

[0374] 13.3. If the sample does not satisfy either the conditions in 13.1 or 13.2, filtering is performed using the sample. Example 14 Optimization of filtering boundary sample values ​​3

[0375] Assume that the filter shape is as shown in Fig. 4A. If the sample used in the adaptive correction filtering process (i.e., the reference pixel when filtering the current filtering pixel in the adaptive correction filtering unit) is a sample in the adaptive correction filtering unit (i.e., the reference pixel is located in the adaptive correction filtering unit), filtering is performed using the sample; if the sample used in the adaptive correction filtering process does not belong to the sample in the adaptive correction filtering unit (i.e., the reference pixel is not located in the adaptive correction filtering unit), filtering is performed according to the following method.

[0376] 14.1. If the sample lies outside the image boundary, or outside a patch boundary, and filtering across patch boundaries is not allowed,

[0377] 14.1.1. If EalfEnableFlag (enable flag bit for extended adaptive correction filtering) is 1, filtering is performed using the sample closest to the sample in the adaptive correction filtering unit and boundary area instead of the sample.

[0378] 14.1.2. If EalfEnableFlag is 0, filtering is performed using the sample closest to the sample in the adaptive correction filtering unit instead of the sample in question.

[0379] 14.2, if the sample is outside the upper or lower boundary of the adaptive correction filtering unit;

[0380] 14.2.1. If EalfEnableFlag is 1, filtering is performed using the sample closest to the sample in the adaptive correction filtering unit and the boundary area instead of the sample.

[0381] 14.2.2. If EalfEnableFlag is 0, filtering is performed using the sample closest to the sample in the adaptive correction filtering unit instead of the sample in question.

[0382] 14.3. If the sample does not satisfy either the conditions in 14.1 or 14.2, filtering is performed using the sample.

[0383] EalfEnableFlag is a flag whose value may include "1" or "0". When EalfEnableFlag is 1, it indicates that extended adaptive compensation filtering can be used, and when EalfEnableFlag is 0, it indicates that extended adaptive compensation filtering should not be used. Exemplarily, the value of EalfEnableFlag may be derived from the decoding side or may be obtained from a bitstream at the decoding side, and the value of EalfEnableFlag may be a constant value. The value of EalfEnableFlag may be equal to the value of ealf_enable_flag (i.e., extended adaptive compensation filtering enable flag), and when EalfEnableFlag is 1, it indicates that extended adaptive compensation filtering can be used, and when EalfEnableFlag is 0, it indicates that extended adaptive compensation filtering should not be used. Example 15 Filtering boundary sample value optimization method 4

[0384] If a sample is located outside the image boundary, or outside the patch boundary and the value of CplfEnableFlag is 0, or if the sample is located outside the upper or lower boundary of the current adaptive compensation filtering unit, the true value of the sample cannot be obtained, and filtering is performed using the sample in the current adaptive compensation filtering unit that is closest to the sample instead of the sample.

[0385] The current adaptive correction filtering unit may perform filtering using a first filter shown in FIG. 4A, and the current adaptive correction filtering unit may perform filtering using a second filter shown in FIG.

[0386] Assuming that the current adaptive correction filtering unit performs filtering using the first filter shown in FIG. 4A, the filter shape is as shown in FIG. 4A.

[0387] If any of the samples used in the adaptive correction filtering process (reference pixel samples when filtering the current filtering pixel in the current adaptive correction filtering unit) is a sample in the current adaptive correction filtering unit, filtering is performed directly using that sample, and if any of the samples used in the adaptive correction filtering process does not belong to a sample in the current adaptive correction filtering unit, filtering is performed according to the following method.

[0388] 15.1. If the sample is located outside the image boundary or outside the patch boundary and the value of CplfEnableFlag is 0, the sample closest to the sample in the adaptive compensation filtering unit is used instead of the sample, and CplfEnableFlag is used to indicate whether adaptive compensation filtering can be performed across the patch boundary.

[0389] 15.2. If the sample is outside the upper or lower boundary of the current adaptive compensation filtering unit, the closest sample to the sample in the current adaptive compensation filtering unit is used instead of the sample.

[0390] 15.3. If not, filter using the sample directly.

[0391] Illustratively, CplfEnableFlag indicates whether values ​​are allowed to cross patch boundaries and may be called cross_patch_loopfilter_enable_flag.

[0392] As shown in FIG. 4C , the pixel position for performing adaptive compensation filtering in the current adaptive compensation filtering unit is the 14 sample position, and it is necessary to obtain reference pixel samples outside the current adaptive compensation filtering unit. As shown in FIG. 4C , as an example, reference pixel samples 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, and 10 are located outside the upper boundary of the current adaptive compensation filtering unit. If the sample values ​​at these positions cannot be obtained, other sample values ​​need to be found and substituted.

[0393] When the filtering sample is in the upper left corner of the current adaptive correction filtering unit, for example, if the sample values ​​at the positions of reference pixel samples 1, 2, 6, and 7 cannot be obtained, filtering is performed using the sample value of the sample position in the current adaptive correction filtering unit that is closest to the samples 1, 2, 6, and 7, and the 14th sample position is the position in the current adaptive correction filtering unit that is closest to these four samples, so filtering can be performed using the sample value of the 14th sample position as the value of each of these four samples.

[0394] When the sample values ​​at the positions of the reference pixel samples 4, 5, 9, and 10 cannot be obtained, filtering may be performed using the sample values ​​at the sample positions closest to 4, 5, 9, and 10 in the current adaptive correction filtering unit, where the sample position 15 is the sample position closest to the 4 and 9 samples in the current adaptive correction filtering unit, and the sample value at the sample position 15 may be used as the value of each of the 4 and 9 samples, and the 16 sample position is the sample position closest to the 5 and 10 samples in the current adaptive correction filtering unit, and the sample value at the 16 sample position may be used as the value of each of the 5 and 10 samples. When the sample values ​​at the positions of the reference pixel samples 0, 3, and 8 cannot be obtained, filtering may be performed using the sample values ​​at the sample positions closest to the samples 0, 3, and 8 in the current adaptive correction filtering unit, where the 14 sample position is the sample position closest to these three samples in the current adaptive correction filtering unit, and the sample value at the 14 sample position may be used as the value of each of these three samples.

[0395] The above is merely an example of a method for obtaining values ​​when some reference pixel samples cannot be obtained, and does not represent all cases, nor does it limit the scope of protection of the present invention.

[0396] The ALF filtering optimization procedure will now be described. (Example 16) Adaptively divide the region into LCUs as the smallest unit Encoding Device

[0397] Taking the fixed region segmentation scheme shown in Figure 2 as an example, the luma component of an image frame may be segmented into fixed regions in the manner described in the "Region Segmentation" section above. The luma component is segmented into 16 regions, each marked as K (K ∈ [0,15]), and there are one or more LCUs in each region.

[0398] LCUs that belong to the same region are divided again.

[0399] For example, the LCU division method within the region may use the method of LCU merging, calculate the cost of merging two LCUs at a time, and merge the two LCUs with the smallest cost; by analogy, calculate all the costs that leave only the [1,N6] class after merging, and select the division method with the smallest cost. Mark the final selection of each LCU.

[0400] Take the division into a maximum of two classes as an example, that is, the above N6=2, therefore, each LCU is marked as 1 or 0, that is, the value of the region class identifier of the above LCU includes 1 or 0.

[0401] For example, for an LCU marked as 0 (i.e., the area class identifier value is 0), the area class to which it belongs is 2K, and for an LCU marked as 1 (i.e., the area class identifier value is 1), the class to which it belongs is 2K+1.

[0402] For example, the luminance component is divided into a maximum of 32 regions. After the region division, the 32 regions are integrated, and the filtering coefficients of each integrated region are calculated. The LCU region division result (i.e., the region class identifier of each LCU) and the filtering coefficients obtained after the region division are transmitted to the decoding device in a bitstream. Decryption Device

[0403] The luminance component of the image frame may be subjected to fixed region segmentation as described in the "Region Segmentation" section above. The luminance component may be segmented into 16 regions, the schematic of which is shown in Figure 2.

[0404] For any LCU in area K, the area class identifier of that LCU is obtained, and the area class to which an LCU whose area class identifier value is 0 belongs is 2K, and the area class to which an LCU whose area class value is 1 belongs is 2K+1.

[0405] A filtering coefficient for each LCU is determined based on the region class of each LCU and the filtering coefficient obtained by analyzing the bitstream, and ALF filtering is performed on the pixels of each LCU one by one based on the filtering coefficient of each LCU. (Example 17) In each region two groups of filtering coefficients means may be transmitted Encoding Device

[0406] Assuming that each LCU is marked with 0 indicating that ALF filtering is turned off, 1 indicating that a first group of filtering coefficients is used, and 2 indicating that a second group of filtering coefficients is used, the value of the LCU coefficient identifier of the LCU includes 0, 1, or 2, where the first value is 0 and the non-first value includes 1 or 2.

[0407] For each region, the coefficients are marked with 0 indicating that only the first group of filtering coefficients is used, 1 indicating that only the second group of filtering coefficients is used, and 2 indicating that two groups of filtering coefficients are used.

[0408] By way of example, the filter shape of the first group of filtering coefficients may be that shown in FIG. 4A, and the filter shape of the second group of filtering coefficients may be that shown in FIG. 9 (a centrally symmetric filter shape of 7*7 cross + 3*3 square).

[0409] In the filtering coefficient training process, when the filtering coefficient is calculated for the first time, the filtering parameters use the pixels of all LCUs in the current region. After the determination, the first group of coefficients is trained, and only LCUs with an identifier value of 1 are used to participate in the training. When the second group of coefficients is trained, only LCUs with an identifier value of 2 are used to participate in the training. Finally, the performance of using only one group of filters in the current region or the performance of using two groups of filters is determined by the RDO determination.

[0410] If the performance is optimal when using only the first group of filtering coefficients, then determine and write to the bitstream a value of 0 for the region coefficient identifier, write the first group of filtering coefficients, and write the LCU coefficient identifier for each LCU to the bitstream, where the value of the LCU coefficient identifier for each LCU is 0 or 1; if the performance is optimal when using only the second group of filtering coefficients, then determine and write to the bitstream a value of 1 for the region coefficient identifier, write the second group of filtering coefficients, and write the LCU coefficient identifier for each LCU to the bitstream, where the value of the LCU coefficient identifier for each LCU is 0 or 1; if the performance is optimal when using two groups of filtering, then determine and write to the bitstream a value of 2 for the region coefficient identifier, write the two groups of filtering coefficients, and write the LCU coefficient identifier for each LCU to the bitstream, where the value of the LCU coefficient identifier for each LCU is 0, 1 or 2. Decryption Device

[0411] For any integrated region, a region coefficient identifier of the integrated region is read from the bitstream, and if the value of the region coefficient identifier is 0, the integrated region obtains 15 filtering coefficients (i.e., the first group of filtering coefficients), if the value of the region coefficient identifier is 1, the integrated region obtains 9 filtering coefficients (i.e., the second group of filtering coefficients), and if the value of the region coefficient identifier is 2, the integrated region obtains 9 filtering coefficients and 15 filtering coefficients, respectively.

[0412] Exemplarily, when the value of the region coefficient identifier is 0, the LCU coefficient identifiers of all LCUs in the consolidated region are obtained, and when the value of the LCU coefficient identifier is 0, it indicates that the LCU turns off ALF filtering, i.e., does not start ALF filtering for the LCU, and when the value of the LCU coefficient identifier is 1, it indicates that the LCU turns on ALF filtering, i.e., starts ALF filtering for the LCU, and uses filtering coefficients of the first group.

[0413] When the value of the region coefficient identifier is 1, the LCU coefficient identifiers of all LCUs in the consolidated region are obtained; when the value of the LCU coefficient identifier is 0, it indicates that the LCU turns off ALF filtering, i.e., does not start ALF filtering for the LCU; when the value of the LCU coefficient identifier is 1, it indicates that the LCU turns on ALF filtering, i.e., starts ALF filtering for the LCU, and uses filtering coefficients of the second group.

[0414] When the value of the region coefficient identifier is 2, the LCU coefficient identifiers of all LCUs in the integrated region are obtained; when the value of the LCU coefficient identifier is 0, it indicates that the LCU turns off ALF filtering, i.e., does not start ALF filtering for the LCU; when the value of the LCU coefficient identifier is 1, it indicates that the LCU turns on ALF filtering, i.e., starts ALF filtering for the LCU and uses filtering coefficients of the first group; when the value of the LCU coefficient identifier is 2, it indicates that the LCU turns on ALF filtering, i.e., starts ALF filtering for the LCU and uses filtering coefficients of the second group. (Example 18) Each LCU adaptively selects a group of filtering coefficients Encoding Device

[0415] For example, each LCU can select up to three groups of filtering coefficients. For any LCU, the filtering coefficient candidates of the LCU may include a filtering coefficient of the consolidated area to which the LCU belongs (which may be called a filtering coefficient of the current consolidated area), a filtering coefficient of the consolidated area immediately before the consolidated area to which the LCU belongs (which may be called a filtering coefficient of the previous consolidated area), and a filtering coefficient of the consolidated area immediately after the consolidated area to which the LCU belongs (which may be called a filtering coefficient of the immediately following consolidated area).

[0416] For any LCU, the performance for each of the three groups of filtering coefficients may be calculated (RDO determination), and one group of filtering coefficients with the optimal performance may be selected.

[0417] For example, if the filtering coefficients of one group having the optimal performance are the filtering coefficients of the previous integrated region, the value of the coefficient selection identifier of the LCU is 0 (i.e., take the above first value as an example, 0); if the filtering coefficients of the optimal performance are the filtering coefficients of the current integrated region, the value of the coefficient selection identifier of the LCU is 1 (i.e., take the above second value as an example, 1); and if the filtering coefficients of the optimal performance are the filtering coefficients of the next integrated region, the value of the coefficient selection identifier of the LCU is 2 (i.e., take the above third value as an example, 2).

[0418] For example, assuming that the integrated regions of the current image frame are as shown in FIG. 10, that is, the number of integrated regions is 16, when making the determination, if the currently processed LCU belongs to integrated region 2, the candidate filtering coefficients for the LCU may include the filtering coefficient of integrated region 1, the filtering coefficient of integrated region 2, and the filtering coefficient of integrated region 3, and the performance-optimized filtering coefficient may be determined based on the RDO determination, and may be marked for the LCU based on the determination result.

[0419] Since a chrominance component (U component or V component) has only one group of filtering coefficients, its LCU may not participate in the selection of filtering coefficients, or the LCUs of the two chrominance components may select filtering coefficients in the other component, i.e., the LCU of the U component may select filtering coefficients for the V component, and the LCU of the V component may select filtering coefficients for the U component. Decryption Device

[0420] The filtering coefficient of the integrated region to which the current LCU belongs (i.e., the filtering coefficient of the current region) and the filtering coefficients of the two adjacent regions (i.e., the filtering coefficient of the previous integrated region and the filtering coefficient of the next integrated region) are obtained, and the filtering coefficient of the current LCU is selected based on the coefficient selection identifier of the LCU.

[0421] Since each of the two chrominance components has only one group of filtering coefficients, its LCU may not participate in the selection of filtering coefficients, or when the two chrominance components both turn on the ALF filtering switch, the LCUs of the two chrominance components may select the filtering coefficients in the other component, that is, the LCU of the U component may select the filtering coefficients of the V component, and the LCU of the V component may select the filtering coefficients of the U component. (Example 19) Select a filter with different shapes for each region Encoding Device

[0422] For example, the filter shape may be the filter shape shown in FIG. 4A or FIG. 9, or two or more of the four filter shapes shown in FIGS. 11A to 11D may be selected, or a filter shape other than the filter shapes shown in FIGS. 4A, 9, and 11A to 11D may be selected.

[0423] For any integrated region, N3 groups of filtering coefficients may be trained, and the filter shapes of the N3 groups of filtering coefficients are different, and in each region, the performance after the integrated region uses one of the filter shapes is calculated, one group of filtering coefficients with the optimal performance is selected, the corresponding filter shape is sent to the decoding device in a bitstream, and the filtering coefficients with the optimal performance of the integrated region are sent to the decoding device. Decryption Device

[0424] For any LCU, when it is determined to start ALF filtering for that LCU, a filter shape for that integrated region is obtained based on the integrated region to which the LCU belongs, and a filtering coefficient for that integrated region is obtained based on the filter shape.

[0425] After determining the filtering coefficients of the current LCU, ALF filtering may be performed on the pixels of the current LCU one by one based on the filtering coefficients of the current LCU. (Example 20) Change a symmetric filter to an asymmetric filter Encoding Device

[0426] Taking the filter shape shown in Fig. 4A as an example, i Weighting coefficient A of the pixel value of the reference pixel at the position (i=0,1,...,13) i Then, the symmetric position C 28-i The weight of the reference pixel value corresponding to i It is.

[0427] For example, A i ∈[0.5,0.6,0.8,1.2,1.4,1.5,1].

[0428] As shown in Figure 4A, there are a total of 14 symmetrical positions, and each position corresponds to a different weighting factor, and the filtering coefficients and filtering performance of the region may be calculated. A group of filtering coefficients with the best filtering performance may be selected, and the filtering coefficients and the weighting factors corresponding to each position of the corresponding filter may be calculated.

[0429] Illustratively, for any weighting factor, the position number (also called index) of that weighting factor in the weighting factor set may be communicated to the decoding device.

[0430] The decoding device obtains filtering coefficients for each region and weighting coefficients corresponding to each filtering coefficient.

[0431] For any integrated region, the filtering coefficients and the weighting coefficients corresponding to each filtering coefficient are obtained to derive the filtering coefficients at the corresponding position.

[0432] For a current filtering pixel of an LCU, the filtered pixel value of the pixel may be determined in the following manner.

number

[0433] C i is the (i+1)-th filtering coefficient in the filtering coefficients of the integrated region to which the LCU belongs, and P i is the filtering coefficient C i is the pixel value of the reference pixel position corresponding to P 28-i and the corresponding reference pixel position P i The reference pixel position corresponding to A is center-symmetric with respect to the pixel position of the current filtering pixel, i P i is the weighting factor of the pixel value at the reference pixel position corresponding to P 14 is the pixel value of the current filtering pixel, and C 14is the filtering coefficient of the current filtering pixel, and 0 i <2. Example 21 Each LCU adaptively selects a group of filtering coefficients

[0434] In the process of filtering pixels, for any pixel to be filtered, the maximum and minimum pixel values ​​within a 3*3 pixel block (a 3*3 pixel block centered on the current pixel to be filtered and not including the current pixel to be filtered), i.e., the maximum and minimum pixel values ​​of the eight pixels other than the central position in the 3*3 pixel block centered on the current pixel to be filtered, are extracted.

[0435] If the pixel value of the current pixel to be filtered is greater than the maximum value or less than the minimum value, the pixel value of the current pixel to be filtered is replaced with the maximum value or minimum value and participates in the filtering, i.e., if the pixel value of the current pixel to be filtered is greater than the maximum value, the pixel value of the current pixel to be filtered is replaced with the maximum value and participates in the filtering, and if the pixel value of the current pixel to be filtered is less than the minimum value, the pixel value of the current pixel to be filtered is replaced with the minimum value and participates in the filtering.

[0436] The decoding flow of the adaptive correction filtering will be described below. Example 22 Adaptive correction filter decoding flow 1. Adaptive correction filtering parameter definition:

[0437] Parameter 1, adaptive correction filtering enable flag (alf_enable_flag): This is a binary variable. A value of "1" indicates that adaptive correction filtering can be used, and a value of "0" indicates that adaptive correction filtering should not be used.

[0438] ​Exemplarily, the value of AlfEnableFlag is equal to the value of alf_enable_flag, which can be obtained from the sequence header, i.e., before starting compression of the entire sequence, a value of "1" indicates that the ALF technique of the entire video sequence is on, and a value of "0" indicates that the ALF technique of the entire video sequence is off, and the flag is a sequence header flag.

[0439] Parameter 2, Extended Adaptive Filtering Enable Flag (ealf_enable_flag): This is a binary variable. A value of "1" indicates that Extended Adaptive Filtering can be used, and a value of "0" indicates that Extended Adaptive Filtering should not be used.

[0440] Exemplarily, the value of EalfEnableFlag is equal to the value of ealf_enable_flag, and its syntax is described as follows: [Table 1]

[0441] If the value of AlfEnableFlag is 1, read the extended adaptive correction filtering enable flag from the bitstream, which is a sequence header flag.

[0442] Parameter 3, picture level adaptive compensation filtering enable flag (picture_alf_enable_flag[compIdx]): a binary variable. A value of "1" indicates that the compIdx-th component of the current image can use adaptive compensation filtering, and a value of "0" indicates that the compIdx-th component of the current image should not use adaptive compensation filtering.

[0443] Exemplarily, the value of PictureAlfEnableFlag[compIdx] is equal to the value of picture_alf_enable_flag[compIdx], and its syntax is described as follows: [Table 2]

[0444] If the value of AlfEnableFlag is 1, read the picture level adaptive correction filtering enable flags for the three components Y, U, and V from the bitstream, which are picture header flags.

[0445] Parameter 4, image luminance component sample adaptive correction filtering coefficient (alf_coeff_luma[i][j]): alf_coeff_luma[i][j] denotes the jth coefficient of the ith adaptive correction filter for the luminance component.

[0446] Illustratively, the value of AlfCoeffLuma[i][j] is equal to the value of alf_coeff_luma[i][j].

[0447] For example, when the value of ElfEnableFlag is 0, the value range of AlfCoeffLuma[i][j] (j=0 to 7) should be −64 to 63, and the value range of AlfCoeffLuma[i][8] should be −1088 to 1071.

[0448] If the value of EalfEnableFlag is 1, the value range of AlfCoeffLuma[i][j] (j=0~13) should be -64~63, and the value range of AlfCoeffLuma[i]

[14] should be -1088~1071.

[0449] Parameter x: the precision of the image luminance component sample adaptive correction filtering coefficient for each group. If x=0, the value range of AlfCoeffLuma[i][j] (j=0~13) should be -32~32; if x=1, the value range of AlfCoeffLuma[i][j] (j=0~13) should be -64~63; if x=2, the value range of AlfCoeffLuma[i][j] (j=0~13) should be -128~128.

[0450] Parameter 5, image chromaticity component adaptive correction filtering coefficient (alf_coeff_chroma[0][j], alf_coeff_chroma[1][j]): alf_coeff_chroma[0][j] indicates the jth adaptive correction filtering coefficient for the Cb component, and alf_coeff_chroma[1][j] indicates the jth adaptive correction filtering coefficient for the Cr component.

[0451] Illustratively, the value of AlfCoeffChroma[0][j] is equal to the value of alf_coeff_chroma[0][j], and the value of AlfCoeffChroma[1][j] is equal to the value of alf_coeff_chroma[1][j].

[0452] For example, when the value of ElfEnableFlag is 0, the value range of AlfCoeffChroma[i][j] (i=0 to 1, j=0 to 7) should be −64 to 63, and the value range of AlfCoeffChroma[i][8] (i=0 to 1) should be −1088 to 1071.

[0453] If the value of EalfEnableFlag is 1, the value range of AlfCoeffChroma[i][j] (i=0~1, j=0~13) should be -64~63, and the value range of AlfCoeffChroma[i]

[14] (i=0~1) should be -1088~1071.

[0454] Parameter y: the accuracy of the image chromaticity component adaptive correction filtering coefficient of each group. When y=0, the value range of AlfCoeffLuma[i][j] (j=0~13) should be -32~32, when y=1, the value range of AlfCoeffLuma[i][j] (j=0~13) should be -64~63, when y=2, the value range of AlfCoeffLuma[i][j] (j=0~13) should be -128~128.

[0455] Parameter 6, the number of adjacent adaptive compensation filtering regions of the image luminance component (alf_region_distance[i]): alf_region_distance[i] indicates the difference value between the i-th adaptive compensation filtering region basic unit start number and the i-1-th adaptive compensation filtering region basic unit start number of the luminance component.

[0456] Exemplarily, the value range of alf_region_distance[i] should be 1 to FilterNum-1.

[0457] Illustratively, if alf_region_distance[i] does not exist in the bitstream, if i is 0, the value of alf_region_distance[i] is 0, and if i is not 0 and the value of alf_filter_num_minus1 is FilterNum-1, the value of alf_region_distance[i] is 1.

[0458] Exemplarily, the sum of alf_region_distance[i] (i=0 to alf_filter_num_minus1) should be less than or equal to FilterNum-1.

[0459] Parameter 7, adaptive compensation filtering enable flag of the largest coding unit (alf_lcu_enable_flag[compIdx][LcuIndex]): a binary variable. A value of "1" indicates that the sample of the LcuIndex-th largest coding unit compIdx component should use adaptive compensation filtering, and a value of "0" indicates that the sample of the LcuIndex-th largest coding unit compIdx component should not use adaptive compensation filtering.

[0460] Exemplarily, the value of AlfLCUEnableFlag[compIdx][LcuIndex] is equal to the value of alf_lcu_enable_flag[compIdx][LcuIndex], and its syntax is described as follows: [Table 3]

[0461] When one flag value in the image level adaptive correction filtering enable flag on the three components is 1, the following adaptive correction filtering parameters are obtained, that is, when EalfEnableFlag=1, the number of filtering coefficients is 15, and the luminance component is divided into 64 regions, otherwise, the number of filtering coefficients is 9, and the luminance component is divided into 16 regions. In addition, when the filtering coefficients on the three components are obtained respectively, and the image level adaptive correction filtering enable flag is on, it is necessary to obtain the filtering coefficient alf_coeff_chroma on the corresponding component for chromaticity, and it is necessary to obtain the region integration method flag alf_region_order_idx, the number of filtering coefficients reduced by one (alf_filter_num_minus1), the region integration result alf_region_distance[i], and each filtering coefficient alf_coeff_luma for luminance.

[0462] The syntax of the adaptive correction filtering parameters is described as follows: [Table 4] II. The specific process of decoding adaptive compensation filtering

[0463] If the value of PictureAlfEnableFlag[compIdx] is 0, the value of the offset sample component is directly used as the value of the reconstructed sample component, otherwise, adaptive correction filtering is performed on the corresponding offset sample component. For example, for the value of compIdx, 0 indicates the luminance component, 1 indicates the Cb component, and 2 indicates the Cr component.

[0464] The unit of adaptive compensation filtering is the adaptive compensation filtering unit derived by the maximum coding unit, which is processed sequentially in the order of raster scan. Firstly, obtain the adaptive compensation filtering coefficient of each component according to the decoding process of the adaptive compensation filtering coefficient, then derive the adaptive compensation filtering unit, determine the adaptive compensation filtering coefficient index of the luminance component of the current adaptive compensation filtering unit, and finally perform adaptive compensation filtering on the luminance and chrominance components of the adaptive compensation filtering unit to obtain a reconstructed sample.

[0465] Decoding process of adaptive correction filtering coefficients:

[0466] 22.1.1, if EalfEnableFlag is 0, analyze the filtering coefficient AlfCoeffLuma[i][j] (i=0 to alf_filter_num_minus1, j=0 to 7) of the i-th group of luma samples from the bitstream. Perform the following processing on the coefficient AlfCoeffLuma[i][8] (i.e., C8 in the filter shown in FIG. 9).

number

[0467] The bit width of AlfCoeffLuma[i][j] (j=0 to 7) in the formula is 7 bits and the value range is -64 to 63, and the value range of AlfCoeffLuma[i][8] processed as described above is 0 to 127.

[0468] If EalfEnableFlag is 1, analyze the filtering coefficients AlfCoeffLuma[i][j] (i = 0 to alf_filter_num_minus1, j = 0 to 13) of the i-th group of luma samples from the bitstream. Perform the following processing on the coefficient AlfCoeffLuma[i]

[14] (i.e., C14 in the filter shown in FIG. 4A).

number

[0469] The bit width of AlfCoeffLuma[i][j] (j=0 to 13) in the formula is 7 bits and the value range is −64 to 63, and the value range of AlfCoeffLuma[i]

[14] processed as described above is 0 to 127.

[0470] 22.1.2, obtain a luminance component adaptive correction filtering coefficient index array (denoted as alfCoeffIdxTab[FilterNum]) based on alf_region_distance[i] (i>1). count=0 alfCoeffIdxTab[0]=0 for(i=1;i <alf_filter_num_minus1+1;i++){ for(j=0;j <alf_region_distance[i]-1;j++){ alfCoeffIdxTab[count+1]=alfCoeffIdxTab[count] count=count+1 } alfCoeffIdxTab[count+1]=alfCoeffIdxTab[count]+1 count=count+1 } for(i=count;i <FilterNum;i++){ alfCoeffIdxTab[i]=alfCoeffIdxTab[count]

[0471] 22.1.3, when ElfEnableFlag is 0, analyze the filtering coefficients AlfCoeffChroma[0][j] and AlfCoeffChroma[1][j] (j=0 to 7) of the chromaticity samples from the bitstream. The following processing is performed on the coefficients AlfCoeffChroma[0][8] and AlfCoeffChroma[1][8] (i.e., C8 in the filter shown in Figure 9), respectively.

number

[0472] The bit width of AlfCoeffChroma[i][j] (j=0 to 7) in the formula is 7 bits and the value range is -64 to 63, and the value range of AlfCoeffChroma[i][8] processed as described above is 0 to 127.

[0473] When EalfEnableFlag is 1, the filtering coefficients AlfCoeffChroma[0][j] and AlfCoeffChroma[1][j] (j=0 to 13) of the chromaticity samples are analyzed from the bitstream. The following processing is performed on the coefficients AlfCoeffChroma[0]

[14] and AlfCoeffChroma[1]

[14] (i.e., C14 in the filter shown in FIG. 4A), respectively.

number

[0474] The bit width of AlfCoeffChroma[i][j] (j=0 to 13) in the formula is 7 bits and the value range is -64 to 63, and the value range of AlfCoeffChroma[i]

[14] processed as described above is 0 to 127.

[0475] Derive an adaptive correction filtering unit

[0476] Derive an adaptive correction filtering unit (which may be the one shown in FIG. 5) according to the current maximum coding unit according to the following steps:

[0477] In 22.2.1, the part of the sample area in which the current largest coding unit C is located that exceeds the image boundary is deleted to obtain sample area D.

[0478] In 22.2.2, if the sample on which the lower boundary of sample area D is located does not belong to the lower boundary of the image, the lower boundary of sample area D for luma and chroma components is reduced upwards by 4 rows to obtain sample area E1, otherwise sample area E1 is made equal to sample area D. The sample of the last row of sample area D is the lower boundary of area E1.

[0479] In 22.2.3, if the sample where the upper boundary of sample area E1 is located belongs to the upper boundary of the image, or belongs to the patch boundary and the value of cross_patch_loopfilter_enable_flag is "0", make sample area E2 equal to sample area E1, otherwise, extend the upper boundary of sample area E1 of luma and chroma components upward by four rows to obtain sample area E2. The sample in the first row of sample area E1 is the upper boundary of area E2.

[0480] In 22.2.4, let sample region E2 be the current adaptive correction filtering unit. The samples in the first row of the image are the upper boundary of the image, and the samples in the last row are the lower boundary of the image.

[0481] An adaptive compensation filtering coefficient index of the luminance component adaptive compensation filtering unit is determined.

[0482] If the value of EalfEnableFlag is 0, calculate the adaptive compensation filtering coefficient index (denoted as filterIdx) of the luminance component adaptive compensation filtering unit according to the following method. xInterval=(((horizontal_size+(1<<LcuSizeInBit)-1)> >LcuSizeInBit)+1)>>2)< <LcuSizeInBit yInterval=(((vertical_size+(1<<LcuSizeInBit)-1)> >LcuSizeInBit)+1)>>2)< <LcuSizeInBit if(xInterval==0&&yInterval==0){ index=15 } else if(xInterval==0){ index=Min(3,y / yInterval)*4+3 } else if(yInterval==0){ index=Min(3,x / xInterval)+12 } else { index=Min(3,y / yInterval)*4+Min(3,x / xInterval) } filterIdx=alfCoeffIdxTab[regionTable[index]]

[0483] Here, (x, y) is the coordinate in the image of the upper left corner sample of the maximum coding unit of the current adaptive correction filtering unit, and the regionTable is defined as follows: regionTable

[16] ={0,1,4,5,15,2,3,6,14,11,10,7,13,12,9,8}

[0484] If the value of EalfEnableFlag is 1, calculate the adaptive compensation filtering coefficient index (denoted as filterIdx) of the current luminance component adaptive compensation filtering unit according to the following method. lcu_width=1< <LcuSizeInBit lcu_height=1< <LcuSizeInBit y_interval=(((vertical_size+lcu_height-1) / lcu_height)+4) / 8*lcu_height) x_interval=(((horizontal_size+lcu_width-1) / lcu_width)+4) / 8*lcu_width) if(yInterval==0) { y_st_offset=0 } else { y_cnt=Clip3(0,8,(vertical_size+y_interval-1) / y_interval) y_st_offset=vertical_size-y_interval*(y_cnt-1) y_st_offset=(y_st_offset+lcu_height / 2) / lcu_height*lcu_height } if(xInterval==0) { x_st_offset=0 } else { x_cnt=Clip3(0,8,(horizontal_size+x_interval-1) / x_interval) x_st_offset=horizontal_size-x_interval*(x_cnt-1) x_st_offset=(x_st_offset+lcu_width / 2) / lcu_width*lcu_width } y_index=(y_interval==0)?7:Clip3(0,7,y / y_interval) y_index_offset=y_index<<3 y_index2=(y_interval==0||y<y_st_offset)?0:Clip3(-1,6,(y-y_st_offset) / y_interval)+1 y_index_offset2=y_index2<<3 x_index=(x_interval==0)?7:Clip3(0,7,x / x_interval) x_index2=(x_interval==0||x<x_st_offset)?0:Clip_post(-1,6,(x-x_st_offset) / x_interval)+1 if(AlfRegionOrderIndex==0){ filterIdx=alfCoeffIdxTab[regionTable[0][y_index_offset+x_index]] } else if(AlfRegionOrderIndex==1) filterIdx=alfCoeffIdxTab[regionTable[1][y_index_offset+x_index2]] } else if(AlfRegionOrderIndex==2) filterIdx=alfCoeffIdxTab[regionTable[2][y_index_offset2+x_index2]] } else if(AlfRegionOrderIndex==3) filterIdx=alfCoeffIdxTab[regionTable[3][y_index_offset2+x_index]] }

[0485] Here, (x, y) are the coordinates in the image of the upper left corner sample of the maximum coding unit of the derived current adaptive correction filtering unit, and the regionTable is defined as follows: regionTable[4]

[64] ={ {63,60,59,58,5,4,3,0,62,61,56,57,6,7,2,1,49,50,55,54,9,8,13,14,48,51,52,53,10,11,12,15,47,46,33,32,31,30,17,16,44,45,34,35,28,29,18,19,43,40,39,36,27,24,23,20,42,41,38,37,26,25,22,21}, {42, 43, 44, 47, 48, 49, 62, 63, 41, 40, 45, 46, 51, 50, 61, 60, 38, 39, 34, 33, 52, 55, 56, 59, 37, 36, 35, 32, 53, 54, 57, 58, 26, 27, 28, 31, 10, 9, 6, 5, 25, 24, 29, 30, 11, 8, 7, 4, 22, 23, 18, 17, 12, 13, 2, 3, 21, 20, 19, 16, 15, 14, 1, 0}, {21, 22, 25, 26, 37, 38, 41, 42, 20, 23, 24, 27, 36, 39, 40, 43, 19, 18, 29, 28, 35, 34, 45, 44, 16, 17, 30, 31, 32, 33, 46, 47, 15, 12, 11, 10, 53, 52, 51, 48, 14, 13, 8, 9, 54, 55, 50, 49, 1, 2, 7, 6, 57, 56, 61, 62, 0, 3, 4, 5, 58, 59, 60, 63}, {0,1,14,15,16,19,20,21,3,2,13,12,17,18,23,22,4,7,8,11,30,29,24,25,5,6,9,10,31,28,27,26,58,57,54,53,32,35,36,37,59,56,55,52,33,34,39,38,60,61,50,51,46,45,40,41,63,62,49,48,47,44,43,42}} Adaptive Corrective Filtering Operation

[0486] The left outside boundary of the current adaptive correction filtering unit is the image boundary, or if it is located outside the patch boundary and the value of CplfEnableFlag is 0, there is no left outside boundary; otherwise, the left outside boundary area is the area from the current adaptive correction filtering unit shifted three sample points to the left to the current adaptive leveling filtering unit.

[0487] The right outside boundary of the current adaptive correction filtering unit is the image boundary, or if it is located outside the patch boundary and the value of CplfEnableFlag is 0, then there is no right outside boundary; otherwise, the right outside boundary area is the area from the current adaptive correction filtering unit shifted three sample points to the right to the current adaptive leveling filtering unit.

[0488] Illustratively, the boundary region includes a left outbound region and a right outbound region.

[0489] If AlfLCUEnableFlag[compIdx][LcuIndex] is 1, adaptive correction filtering is performed on the compIdx component, and if not, adaptive correction filtering is not performed.

[0490] When EalfEnableFlag is 0, if the sample used in the adaptive compensation filtering process is a sample in the adaptive compensation filtering unit, the sample is directly used for filtering; if the sample used in the adaptive compensation filtering process does not belong to the sample in the adaptive compensation filtering unit, filtering is performed according to the following method.

[0491] 22.3.1. If the sample is outside the image boundary, or outside the patch boundary and the value of CplfEnableFlag is 0, the sample closest to the sample in the adaptive correction filtering unit is used instead of the sample.

[0492] 22.3.2. If the sample is outside the upper or lower boundary of the adaptive compensation filtering unit, the closest sample to the sample in the adaptive compensation filtering unit is used instead of the sample.

[0493] If none of the conditions in 22.3.3, 22.3.1, and 22.3.2 are met, filtering is performed using the sample.

[0494] Illustratively, the adaptive compensation filtering operation of the luminance component of the adaptive compensation filtering unit is as follows: ptmp=AlfCoeffLuma[filterIdx][8]*p(x,y) for(j=0;j<8;j++) ptmp+=AlfCoeffLuma[filterIdx][j]*(p(x-Hor[j],y-Ver[j])+p(x+Hor[j],y+Ver[j]) } ptmp=(ptmp+32)>>6 p'(x,y)=Clip3(0,(1< <BitDepth)-1,ptmp)

[0495] where p(x,y) is the offset sample, p'(x,y) is the reconstructed sample, and Hor[j] and Ver[j] (j=0 to 7).

[0496] Illustratively, the adaptive correction filtering operation of the adaptive correction filtering unit for the chrominance components is as follows: ptmp=AlfCoeffChroma[i][8]*p(x,y) for(j=0;j<8;j++) ptmp+=AlfCoeffChroma[i][j]*(p(x-Hor[j],y-Ver[j])+p(x+Hor[j],y+Ver[j]) } ptmp=(ptmp+32)>>6 p'(x,y)=Clip3(0,(1< <BitDepth)-1,ptmp)

[0497] Here, p(x,y) is the offset sample, p'(x,y) is the reconstructed sample, and Hor[j] and Ver[j] (j=0 to 7) may be as shown in Table 1. [Table 5]

[0498] When EalfEnableFlag is 1, if the sample used in the adaptive compensation filtering process is a sample in the adaptive compensation filtering unit, the sample is directly used for filtering; if the sample used in the adaptive compensation filtering process does not belong to the sample in the adaptive compensation filtering unit, filtering is performed according to the following method.

[0499] 22.4.1. If the sample is outside the image boundary, or outside the patch boundary and the value of CplfEnableFlag is 0,

[0500] 22.4.1.1. Taking the filter shown in FIG. 4A as an example, if the sample corresponds to the C1, C2, C6, C4, C5 or C10 position of the filter shape, the adaptive correction filtering unit and the sample closest to the sample in the boundary area are used to filter the sample instead of the sample.

[0501] 22.4.1.2. If not, the sample in question is replaced with the sample closest to the sample in the adaptive correction filtering unit for filtering.

[0502] 22.4.2, if the sample is outside the upper or lower boundary of the adaptive correction filtering unit;

[0503] 22.4.2.1. Taking the filter shown in FIG. 4A as an example, if the sample corresponds to the C1, C2, C6, C4, C5 or C10 position of the filter shape, the adaptive correction filtering unit and the sample closest to the sample in the boundary area are used to filter the sample instead of the sample.

[0504] 22.4.2.2. If not, the sample is replaced with the closest sample from the adaptive correction filtering unit for filtering.

[0505] If none of the conditions in 22.4.3, 22.4.1, and 22.4.2 are met, filtering is performed using the sample.

[0506] Illustratively, the adaptive compensation filtering operation of the luminance component of the adaptive compensation filtering unit is as follows: ptmp=AlfCoeffLuma[filterIdx]

[14] *p(x,y) for(j=0;j<14;j++) ptmp+=AlfCoeffLuma[filterIdx][j]*(p(x-Hor[j],y-Ver[j])+p(x+Hor[j],y+Ver[j]) } ptmp=(ptmp+32)>>6 p'(x,y)=Clip3(0,(1< <BitDepth)-1,ptmp)

[0507] Here, as shown in Table 2, p(x, y) is an offset sample, p'(x, y) is a reconstructed sample, and Hor[j] and Ver[j] (j=0 to 13).

[0508] Illustratively, the adaptive correction filtering operation of the adaptive correction filtering unit for the chrominance components is as follows: ptmp=AlfCoeffChroma[i]

[14] *p(x,y) for(j=0;j<14;j++) ptmp+=AlfCoeffChroma[i][j]*(p(x-Hor[j],y-Ver[j])+p(x+Hor[j],y+Ver[j]) } ptmp=(ptmp+32)>>6 p'(x,y)=Clip3(0,(1< <BitDepth)-1,ptmp) [Table 6] Example 23

[0509] First, the image may be divided into fixed regions, and the result of the fixed region division may be as shown in Fig. 2, and index values ​​for each region are obtained. For each region, eight types of division as shown in Fig. 15A may be performed, or a part of the division method shown in Fig. 15A may be retained as shown in Fig. 15B.

[0510] For each region, the encoding device may determine a final division method based on the RDO decision, and transmit the division method of each region to the decoding device in a bitstream. Take the final division method in Fig. 15A as an example. The regions obtained by the maximum 16 fixed division methods can be divided into 64 regions.

[0511] In the decoding flow, the decoding device may first perform a fixed region division, and then read the specific division method of each region from the bitstream to obtain the final division method of the whole frame. Exemplarily, for each division method in Fig. 15A, the region number after division may be as shown in Fig. 15C. Exemplarily, the value of J is the maximum index value of the previous region + 1. (Example 24)

[0512] For example, the minimum unit of fixed region segmentation is LCU. When the image resolution is low, only numbers are left in a certain region, and no image information is contained in the region. In such a case, after the fixed region segmentation result is determined, it may be determined which class does not have image information.

[0513] Exemplarily, it may be determined based on the number of LCUs included in the width and height of the image. When a fixed region is divided into fixed 4*4 regions, each region index may be as shown in FIG. 2, if the number of LCUs in the width or height is less than 4, the region in a certain column or row may not contain image information. All these regions that do not contain image information are denoted as set G. The size of set G is N7, where N7 is a positive integer.

[0514] For any index value i among all index values,

[0515] 24.1, if i is equal to any element in set G, then i=0,

[0516] 24.2, if i is not equal to any element in set G, then if i is greater than n elements in set G, then i=ik and k≦N7.

[0517] The above embodiments are merely specific examples of the realization of the embodiments of the present invention, and do not limit the scope of protection of the present invention. Based on the above embodiments, new embodiments can be obtained by combining the embodiments or modifying the embodiments, all of which belong to the scope of protection of the present invention.

[0518] Moreover, the implementation flows on the encoding side and the decoding side of each of the above embodiments can refer to each other.

[0519] Having described the method provided by the present invention, the following describes an apparatus provided by an embodiment of the present invention.

[0520] An embodiment of the present invention provides a filtering device applied to an encoding / decoding device, the device may include a filtering unit, the filtering unit is used for determining whether a current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and when the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, a first filter is used to perform adaptive compensation filtering for the current adaptive compensation filtering unit, and when the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering, a second filter is used to perform adaptive compensation filtering for the current adaptive compensation filtering unit, where the first filter is a 7*7 cross+5*5 square centrosymmetric filter, and the second filter is a 7*7 cross+3*3 square centrosymmetric filter.

[0521] In one possible implementation form, the filtering unit is further used to, in the process of performing adaptive correction filtering on a current filtering pixel in a current adaptive correction filtering unit, perform adaptive correction filtering using a pixel value of a reference pixel of the current filtering pixel if the reference pixel is located within the current adaptive correction filtering unit, and if the reference pixel is not located within the current adaptive correction filtering unit and the pixel value of the reference pixel cannot be obtained, perform adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel, and if the pixel value of the reference pixel is obtained, perform adaptive correction filtering using the pixel value of the reference pixel.

[0522] In one possible implementation form, the case in which the pixel value of the reference pixel cannot be obtained includes one of the following: the reference pixel is located outside the image boundary of the current image frame; the reference pixel is located outside the patch boundary of the current patch and filtering across the patch boundary is not allowed; the reference pixel is located outside the upper boundary of the current adaptive correction filtering unit; and the reference pixel is located outside the lower boundary of the current adaptive correction filtering unit.

[0523] In one possible implementation form, the filtering unit is further configured to perform adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel when the current adaptive correction filtering unit determines that the use of extended adaptive correction filtering is permitted and a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, and to perform adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel when the current adaptive correction filtering unit determines that the use of extended adaptive correction filtering is not permitted and a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained.

[0524] In one possible implementation form, the filtering unit determining whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering includes determining a value of a flag bit to indicate whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and if the value of the flag bit is a first value, determining that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and if the value of the flag bit is a second value, determining that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering.

[0525] In one possible implementation form, a flag bit for indicating whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering is EalfEnableFlag, and the value of EalfEnableFlag is derived from the decoding device, or the value of EalfEnableFlag is obtained from a bitstream in the decoding device, or the value of EalfEnableFlag is a constant value.

[0526] In one possible implementation form, obtaining the value of the EalfEnableFlag from the bitstream in the decoding device includes determining the value of the EalfEnableFlag based on the value of an extended adaptive correction filtering enable flag obtained by parsing the bitstream, the extended adaptive correction filtering enable flag being a sequence level parameter.

[0527] Refer to Figure 16, which is a schematic diagram showing the structure of a filtering device provided by an embodiment of the present invention, which may be applied to an encoding / decoding device, and which may include a filtering unit 1610, which is used in the process of performing ALF filtering on a current filtering pixel in a current adaptive correction filtering unit, for any reference pixel of the current filtering pixel, if the reference pixel is located within the current adaptive correction filtering unit, then adaptive correction filtering is performed using the pixel value of the reference pixel; if the reference pixel is not located within the current adaptive correction filtering unit, then when the pixel value of the reference pixel cannot be obtained, then filtering is performed using the pixel closest to the position of the reference pixel in the current adaptive correction filtering unit instead of the reference pixel; and when the pixel value of the reference pixel is obtained, filtering is performed using the pixel value of the reference pixel.

[0528] In one possible embodiment, when the pixel value of the reference pixel cannot be obtained, it includes one of the following: the reference pixel is located outside the image boundary of the current image frame; the reference pixel is located outside the patch boundary of the current patch and filtering across patch boundaries is not allowed; and the reference pixel is located outside the upper boundary or lower boundary of the current adaptive correction filtering unit.

[0529] Refer to Fig. 17, Fig. 17 is a schematic diagram showing the structure of a filtering device provided by an embodiment of the present invention, where the filtering device can be applied to an encoding / decoding device, and the device can include a filtering unit 1710, which is used to determine whether a current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and when the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, a first filter is used to perform adaptive compensation filtering for the current adaptive compensation filtering unit, and when the current adaptive compensation filtering unit determines that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering, a second filter is used to perform adaptive compensation filtering for the current adaptive compensation filtering unit, where the first filter is a 7*7 cross+5*5 square central symmetric filter, and the second filter is a 7*7 cross+3*3 square central symmetric filter.

[0530] In one possible embodiment, the filtering unit 1710 determining whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering includes determining a value of a flag bit to indicate whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and if the value of the flag bit is a first value, determining that the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering, and if the value of the flag bit is a second value, determining that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering.

[0531] In one possible embodiment, the filtering unit 1710 is further used in the process of performing adaptive correction filtering on a current filtering pixel in a current adaptive correction filtering unit, for any reference pixel of the current filtering pixel, if the reference pixel is located within the current adaptive correction filtering unit, to perform adaptive correction filtering using a pixel value of the reference pixel; if the reference pixel is not located within the current adaptive correction filtering unit, if the pixel value of the reference pixel cannot be obtained, to perform adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel; and if the pixel value of the reference pixel is obtained, to perform adaptive correction filtering using the pixel value of the reference pixel.

[0532] In one possible embodiment, when the pixel value of the reference pixel cannot be obtained, it includes one of the following: the reference pixel is located outside the image boundary of the current image frame; the reference pixel is located outside the patch boundary of the current patch and filtering across patch boundaries is not allowed; and the reference pixel is located outside the upper boundary or lower boundary of the current adaptive correction filtering unit.

[0533] In one possible embodiment, the filtering unit 1710 further determines that the current adaptive correction filtering unit allows the use of extended adaptive correction filtering and, when a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, performs adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel; and determines that the current adaptive correction filtering unit does not allow the use of extended adaptive correction filtering and, when a pixel value of a pixel position for performing adaptive correction filtering of the current adaptive correction filtering unit cannot be obtained, performs adaptive correction filtering using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel.

[0534] Please refer to Figure 18, which is a schematic diagram showing a hardware structure of a decoding device provided by an embodiment of the present invention. The decoding device may include a processor 1801 and a machine-readable storage medium 1802 in which machine-executable instructions are stored. The processor 1801 and the machine-readable storage medium 1802 can communicate with each other via a system bus 1803. In addition, the processor 1801 can read and execute the machine-executable instructions corresponding to the filtering control logic in the machine-readable storage medium 1802, thereby performing the filtering method applied to the above-mentioned decoding device.

[0535] The machine-readable storage medium 1802 referred to herein may be any electronic, magnetic, optical, or other physical storage device capable of containing or storing information such as executable commands, data, etc. For example, the machine-readable storage medium may be, for example, a random access memory (RAM), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard disk drive), a solid-state drive, any type of storage disk (such as an optical disk, a DVD, etc.), or a similar storage medium, or a combination thereof.

[0536] In some embodiments, a machine-readable storage medium is further provided having machine-executable instructions stored thereon, which, when executed by a processor, realizes the above filtering method applied to a decoding device. For example, the machine-readable storage medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0537] Please refer to Fig. 19, which is a schematic diagram showing a hardware structure of an encoding device provided by an embodiment of the present invention. The encoding device may include a processor 1901 and a machine-readable storage medium 1902 in which machine-executable instructions are stored. The processor 1901 and the machine-readable storage medium 1902 can communicate with each other via a system bus 1903. In addition, the processor 1901 can read and execute the machine-executable instructions corresponding to the filtering control logic in the machine-readable storage medium 1902 to perform the filtering method applied to the above-mentioned encoding device.

[0538] The machine-readable storage medium 1902 referred to herein may be any electronic, magnetic, optical, or other physical storage device capable of containing or storing information such as executable commands, data, etc. For example, the machine-readable storage medium may be, for example, a random access memory (RAM), a volatile memory, a non-volatile memory, a flash memory, a storage drive (such as a hard disk drive), a solid-state drive, any type of storage disk (such as an optical disk, a DVD, etc.), or a similar storage medium, or a combination thereof.

[0539] In some embodiments, a machine-readable storage medium is further provided having machine-executable instructions stored thereon, which, when executed by a processor, implements the above filtering method applied to the encoding device. For example, the machine-readable storage medium may be a ROM, a RAM, a CD-ROM, a magnetic tape, a floppy disk, an optical data storage device, etc.

[0540] In some embodiments there is further provided a camera device including the filtering apparatus of any of the above embodiments.

[0541] It should be noted that, in this specification, relational terms such as first and second, etc., are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that any actual relationship or sequence exists between those entities or operations. Also, the terms "comprise", "contains", or any other variation thereof, are intended to include a non-exclusive inclusion, whereby a process, method, article, or device that includes a set of elements not only includes those elements, but also includes other elements not expressly listed, or includes the inherent elements of such process, method, article, or device. Absent more limitations, an element qualified by the phrase "comprises a ..." does not exclude the presence of further identical elements in the process, method, article, or device that includes said element.

[0542] The above description is only a preferred embodiment of the present invention, and is not intended to limit the present invention. Any amendments, equivalent replacements, or improvements made within the spirit and principle of the present invention should be included within the protection scope of the present invention. [Explanation of symbols]

[0543] 1610 Filtering Unit 1710 Filtering Unit 1801 Processor 1802 Machine-readable storage medium 1803 System Bus 1901 Processor 1902 Machine-readable storage medium 1903 System Bus

Claims

1. 1. A filtering method applied in an encoding or decoding device, comprising: determining whether a current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering; If the current adaptive compensation filtering unit determines that the use of the extended adaptive compensation filtering is permitted, performing adaptive compensation filtering on the current adaptive compensation filtering unit using a first filter; if the current adaptive compensation filtering unit determines that the use of extended adaptive compensation filtering is not permitted, performing adaptive compensation filtering on the current adaptive compensation filtering unit using a second filter; The first filter is a centrosymmetric filter of 7*7 cross + 5*5 square, and the second filter is a centrosymmetric filter of 7*7 cross + 3*3 square, The step of determining whether the current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering comprises: determining a value of a flag bit for indicating whether a current adaptive compensation filtering unit is permitted to use extended adaptive compensation filtering; determining that the current adaptive compensation filtering unit is permitted to use extended adaptive compensation filtering if the value of the flag bit is a first value; if the value of the flag bit is a second value, determining that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering; the value of the flag bit is a value derived from the decoding side, or a value obtained from the bitstream at the decoding side, or a constant value; Obtaining the value of the flag bit from a bit stream at a decoding side includes: determining a value of the flag bit based on a value of an extended adaptive correction filtering enable flag obtained by analyzing the bitstream; The extended adaptive correction filtering enable flag is a sequence level parameter.

13. A filtering method comprising:

2. In a process of performing adaptive correction filtering on a current filtering pixel in a current adaptive correction filtering unit, for any reference pixel of the current filtering pixel, If the reference pixel is not located within the current adaptive correction filtering unit, When the pixel value of the reference pixel cannot be obtained, adaptive correction filtering is performed using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel; When the pixel values ​​of the reference pixels are acquired, adaptive correction filtering is performed using the pixel values ​​of the reference pixels.

2. The filtering method according to claim 1 .

3. If the pixel value of the reference pixel cannot be obtained, the reference pixel is located outside an image boundary of the current image frame; and the reference pixel is located outside the patch boundary of the current patch and filtering across the patch boundary is not allowed; the reference pixel is located outside the upper boundary of the current adaptive correction filtering unit; the reference pixel is located outside the lower boundary of the current adaptive correction filtering unit; 3. The filtering method according to claim 2.

4. When it is determined that the current adaptive compensation filtering unit is permitted to use the extended adaptive compensation filtering and the pixel value of the reference pixel for performing the adaptive compensation filtering of the current adaptive compensation filtering unit cannot be obtained, the adaptive compensation filtering is performed using the pixel closest to the position of the reference pixel in the current adaptive compensation filtering unit instead of the reference pixel; When it is determined that the current adaptive compensation filtering unit does not allow the use of the extended adaptive compensation filtering and a pixel value of a reference pixel for performing the adaptive compensation filtering of the current adaptive compensation filtering unit cannot be obtained, the method further includes performing the adaptive compensation filtering using a pixel in the current adaptive compensation filtering unit that is closest to the position of the reference pixel instead of the reference pixel.

4. The filtering method according to claim 2 or 3.

5. A filtering device applied to an encoding device or a decoding device, comprising: a filtering unit for determining whether a current adaptive compensation filtering unit allows the use of extended adaptive compensation filtering; The filtering unit further performs adaptive compensation filtering on the current adaptive compensation filtering unit using a first filter when the current adaptive compensation filtering unit determines that the use of extended adaptive compensation filtering is permitted; if the current adaptive compensation filtering unit determines that the use of the extended adaptive compensation filtering is not permitted, a second filter is used to perform adaptive compensation filtering on the current adaptive compensation filtering unit; The first filter is a centrosymmetric filter of 7*7 cross + 5*5 square, and the second filter is a centrosymmetric filter of 7*7 cross + 3*3 square, The determining by the filtering unit whether the current adaptive compensation filtering unit is allowed to use extended adaptive compensation filtering may include: determining a value of a flag bit for indicating whether the current adaptive compensation filtering unit is enabled to use extended adaptive compensation filtering; determining that the current adaptive compensation filtering unit is permitted to use extended adaptive compensation filtering if the value of the flag bit is a first value; determining that the current adaptive compensation filtering unit does not allow the use of extended adaptive compensation filtering if the value of the flag bit is a second value; the value of the flag bit is a value derived from the decoding side, or a value obtained from the bitstream at the decoding side, or a constant value; Obtaining the value of the flag bit from a bit stream at a decoding side includes: determining a value of the flag bit based on a value of an extended adaptive correction filtering enable flag obtained by analyzing the bitstream; The extended adaptive correction filtering enable flag is a sequence level parameter. A filtering device comprising:

6. The filtering unit further includes, in a process of performing adaptive correction filtering on a current filtering pixel in a current adaptive correction filtering unit, for any reference pixel of the current filtering pixel, If the reference pixel is located within the current adaptive correction filtering unit, perform adaptive correction filtering using a pixel value of the reference pixel; If the reference pixel is not located within the current adaptive correction filtering unit, When the pixel value of the reference pixel cannot be obtained, adaptive correction filtering is performed using a pixel in the current adaptive correction filtering unit that is closest to the position of the reference pixel instead of the reference pixel; When the pixel values ​​of the reference pixels are acquired, the pixel values ​​of the reference pixels are used to perform adaptive correction filtering.

6. The filtering device according to claim 5.

7. If the pixel value of the reference pixel cannot be obtained, the reference pixel is located outside an image boundary of the current image frame; and the reference pixel is located outside the patch boundary of the current patch and filtering across the patch boundary is not allowed; the reference pixel is located outside the upper boundary of the current adaptive correction filtering unit; the reference pixel is located outside the lower boundary of the current adaptive correction filtering unit; 7. The filtering device according to claim 6.

8. The filtering unit further comprises: When it is determined that the current adaptive compensation filtering unit is permitted to use the extended adaptive compensation filtering and the pixel value of the reference pixel for performing the adaptive compensation filtering of the current adaptive compensation filtering unit cannot be obtained, the adaptive compensation filtering is performed using the pixel closest to the position of the reference pixel in the current adaptive compensation filtering unit instead of the reference pixel; When it is determined that the current adaptive compensation filtering unit does not allow the use of the extended adaptive compensation filtering, and the pixel value of the reference pixel for performing the adaptive compensation filtering of the current adaptive compensation filtering unit cannot be obtained, a pixel closest to the position of the reference pixel in the current adaptive compensation filtering unit is used instead of the reference pixel to perform the adaptive compensation filtering.

8. A filtering device according to claim 6 or 7.

9. A method for filtering a signal from a computer-readable storage medium, the method comprising: a processor; and a machine-readable storage medium having machine-executable instructions stored thereon that are executable by the processor; the processor being adapted to execute the machine-executable instructions to perform the filtering method according to any one of claims 1 to 4.

13. A decoding device comprising:

10. A method for filtering a signal from a computer-readable storage medium, the method comprising: a processor; and a machine-readable storage medium having machine-executable instructions stored thereon that are executable by the processor; the processor being adapted to execute the machine-executable instructions to perform the filtering method according to any one of claims 1 to 4.

13. An encoding device comprising:

11. A non-volatile storage medium having machine executable instructions stored thereon, the machine executable instructions, when executed by a processor, causing the processor to perform a filtering method according to any one of claims 1 to 4. Non-volatile storage media.

12. A camera device comprising a filtering apparatus according to any one of claims 5 to 8.

Citation Information

Patent Citations

  • Adaptive loop filtering using multiple filter shapes

    US20120189064A1

  • Method for encoding / decoding image and device thereof

    US20140355695A1

  • Systems and methods for coding in super-block based video coding framework

    US20180324420A1

  • Image encoding / decoding method and device employing in-loop filtering

    WO2019107994A1

  • Bidirectional optical flow based video coding and decoding

    WO2020200270A1