Filtering method, device and equipment

By increasing filter coefficients and implementing a two-stage Wiener filtering process with optimized center-symmetric filters, the underfitting issue in ALF technology is addressed, leading to enhanced video encoding/decoding performance and image quality.

JP7618783B2Active Publication Date: 2025-01-21HANGZHOU HIKVISION DIGITAL TECHNOLOGY CO LTD
View PDF 5 Cites 0 Cited by

Patent Information

Application Number
JP2023513515
Authority / Receiving Office
JP · JP
Patent Type
Patents
Current Assignee / Owner
Priority Date
2020-08-24
Filing Date
2021-08-24
Publication Date
2025-01-21
Estimated Expiration
2041-08-24

AI Technical Summary

Technical Problem

The existing ALF technology in video encoding/decoding suffers from underfitting due to a small number of filter coefficients being trained on the encoding side and transmitted, leading to suboptimal image quality when processing large numbers of images.

Method used

The proposed solution involves increasing the number of filter coefficients and introducing a second Wiener filtering process to improve image quality, along with optimizing filter coefficients using a center-symmetric filter shape and additional CTU decisions to enhance encoding/decoding performance.

Benefits of technology

This approach alleviates underfitting issues and enhances image reconstruction quality by applying a 7*7 cross plus 5*5 square Wiener filter and performing two-stage filtering, resulting in improved encoding/decoding performance.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure 0007618783000001
    Figure 0007618783000001
  • Figure 0007618783000002
    Figure 0007618783000002
  • Figure 0007618783000003
    Figure 0007618783000003
Patent Text Reader

Abstract

The present invention provides a filtering method, device and equipment, which includes the following steps: when it is determined to start Wiener filtering for an adaptive filtering unit of a current frame image, deriving the adaptive filtering unit based on a current largest coding unit (LCU) of the current frame image; obtaining reference pixels of the adaptive filtering unit and filter coefficients of a Wiener filter; and performing the Wiener filtering based on sample pixels of the adaptive filtering unit according to the obtained reference pixels and filter coefficients of the Wiener filter, wherein the Wiener filter is a centrosymmetric filter with a shape of a 7*7 cross plus a 5*5 square, and the value of the reference pixel is derived from the pixel value of the reconstructed image before filtering.
Need to check novelty before this filing date? Find Prior Art

Description

[Technical field]

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

[0002] Complete video coding typically includes operations such as prediction, transformation, quantization, entropy coding, filtering, etc.

[0003] The existence of quantization operation after block-based motion compensation will generate coding noise, which will cause video quality distortion. Loop post-processing techniques are used to reduce the impact of such distortion. The loop post-processing techniques include three techniques: Deblocking Filter (DBF), Sample Adaptive Offset (SAO) and Adaptive Leveling Filter (ALF).

[0004] The ALF technique used in the coding framework of the Audio Video coding Standard (AVS) is based on the Wiener filter principle and calculates the optimal linear filter that can achieve the mean-squared relationship between the original signal and the distorted signal.

[0005] However, through practice, it has been found that the ALF technique is based on the principle of the Wiener filter, and achieves the effect of filtering the reconstructed image sequence to improve image quality by training a very small number of filter coefficients at the encoding side and transmitting them to the decoding side. Because the number of image pixels is very large but the filter coefficients are very small, there exists an underfitting situation when the model created by the ALF technique processes a large number of images. Summary of the Invention [Means for solving the problem]

[0006] In view of this, the present invention provides a filtering method, apparatus and device.

[0007] Specifically, the present invention is realized by the following technical solutions:

[0008] According to a first aspect of an embodiment of the present invention, there is provided a filtering method applied to an encoding / decoding device, comprising: When it is determined that the adaptive compensation filtering unit of the current frame image starts Wiener filtering, deriving the adaptive compensation filtering unit according to a current maximum coding unit (LCU) of the current frame image; obtaining reference pixels and filter coefficients of a Wiener filter of the adaptive compensation filtering unit; performing the Wiener filtering based on the sample pixels of the adaptive compensation filtering unit according to the obtained reference pixels and filter coefficients of a Wiener filter; The Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross added with a 5*5 square, and the value of the reference pixel is derived from the pixel value of the reconstructed image before filtering.

[0009] According to a second aspect of an embodiment of the present invention, a filtering device applied to an encoding / decoding device includes a determining unit and a filtering unit, among which: The filtering unit is used for, when the determining unit determines to start Wiener filtering for the adaptive filtering unit of the current frame image, deriving the adaptive filtering unit according to a current maximum coding unit LCU of the current frame image, obtaining reference pixels and filter coefficients of a Wiener filter of the adaptive filtering unit, and performing the Wiener filtering based on sample pixels of the adaptive filtering unit according to the obtained reference pixels and filter coefficients of the Wiener filter; Here, a filtering device is provided in which the Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross plus a 3*3 square, and the value of the reference pixel is derived from the pixel value of the reconstructed image before filtering.

[0010] According to a third aspect of the present invention, there is provided a decoding device including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to: When it is determined that the adaptive compensation filtering unit of the current frame image starts Wiener filtering, Derive the adaptive compensation filtering unit according to a current maximum coding unit (LCU) of the current frame image; Obtaining reference pixels and filter coefficients of a Wiener filter of the adaptive compensation filtering unit; According to the obtained reference pixels and filter coefficients of a Wiener filter, the adaptive compensation filtering unit is prompted to perform the Wiener filtering based on the sample pixels; Here, a filtering method is provided in which the Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross added to a 5*5 square, and the value of the reference pixel is derived from the pixel value of the reconstructed image before filtering.

[0011] According to a fourth aspect of an embodiment of the present invention, there is provided a coding device including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being adapted to execute the machine-executable instructions to perform the method provided in the first aspect.

[0012] According to a fifth aspect of an embodiment of the present invention, there is provided a decoding device including a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being adapted to execute the machine-executable instructions to perform the method provided in the first aspect.

[0013] According to a sixth aspect of an embodiment of the present invention there is provided a non-transitory machine-readable storage medium having stored thereon machine-readable instructions which, when executed by a processor, perform the method provided in the first aspect.

[0014] In the filtering method according to an embodiment of the present invention, a first Wiener filter is a centrally symmetric filter having a window shape obtained by adding a 3*3 rectangle to a 7*7 cross shape, and a second Wiener filter is obtained by performing shape extension on the first Wiener filter. When it is determined to start Wiener filtering for a current LCU of a current frame image, a reference pixel of the current LCU and a filter coefficient of the second Wiener filter are obtained, and Wiener filtering is performed on current pixels one by one based on the reference pixel and the filter coefficient of the second Wiener filter, thereby optimizing the filtering effect and improving the encoding and decoding performance. [Brief description of the drawings]

[0015] [Figure 1] 1 is a flowchart of video encoding and decoding. [Diagram 2] FIG. 1 is a schematic diagram of region division. [Diagram 3] FIG. 1 is a schematic diagram of region merging. [Figure 4] FIG. 2 is a schematic diagram of a reference pixel position. [Diagram 5] FIG. 2 is a schematic diagram of a first Wiener filter. [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] FIG. 4 is a schematic diagram of a second Wiener filter as shown in an exemplary embodiment of the present invention. [Figure 8] FIG. 2 is a schematic diagram of reference pixel positions shown in an exemplary embodiment of the present invention; [Figure 9] 4 is a flow chart of a filtering method according to an exemplary embodiment of the present invention. [Figure 10] 4 is a flow chart of a filtering method according to an exemplary embodiment of the present invention. [Figure 11] 4 is a flowchart of a decoding process according to an exemplary embodiment of the present invention; [Figure 12] 4 is a flowchart of two filter decoding steps according to an exemplary embodiment of the present invention; [Figure 13] 4 is a flowchart of a CTU determination process according to an exemplary embodiment of the present invention. [Figure 14] FIG. 2 is a schematic diagram of a sample filter offset unit as shown in an exemplary embodiment of the present invention. [Figure 15] 1 is a schematic diagram of a structure of a filtering device shown in an exemplary embodiment of the present invention; [Figure 16] 1 is a schematic diagram of a structure of a filtering device shown in an exemplary embodiment of the present invention; [Figure 17] 1 is a schematic diagram of a structure of a filtering device shown in an exemplary embodiment of the present invention; [Figure 18] FIG. 2 is a schematic diagram of the structure of a decoding device according to an exemplary embodiment of the present invention; [Figure 19] FIG. 2 is a schematic diagram of the structure of an encoding device according to an exemplary embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS

[0016] Exemplary embodiments will now be described in detail, examples of which are shown in the drawings. Where the following description refers to the drawings, the same numerals in different figures represent the same or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not representative of 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.

[0017] The terms used in the present invention are merely for the purpose of describing specific embodiments, and are not intended to limit the present invention. As used in the present invention and the appended claims, the singular forms "a kind," "the," and "the" are also intended to include the plural forms unless the context clearly dictates otherwise.

[0018] In order to help those skilled in the art to better understand the technical solutions provided in the embodiments of the present invention, the technical terms related to the embodiments of the present invention, the main flow of existing video encoding and decoding, and the realization of Wiener Filter technology (ALF technology) will be briefly described below.

[0019] 1. Technical terms 1. Rate-Distortion Optimized (RDO): An index for evaluating the coding efficiency, including 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.

[0020] The cost corresponding to a mode is: J(mode)=D+λ*R, where D stands for distortion, commonly measured using the SSE (Sum of Squared Errors) metric, which is the mean sum of the squared differences 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 this mode, which includes the sum of the number of bits required to code the mode information, motion information, residual, etc.

[0021] When selecting a mode, if the coding modes are compared and determined according to the RDO principle, the optimum coding performance can usually be guaranteed.

[0022] 2. Coding Tree Unit (CTU): Traditional video coding is based on macroblocks. For a video with 4:2:0 sampling format, a macroblock includes a 16x16 luma block and two 8x8 chroma blocks. Considering the characteristics of HD video / Super HD video, a CTU is introduced in Versatile Video Coding (VVC), whose size is specified by the coding device and allowed to be larger than the macroblock size. A co-located luma coding tree block (CTB) and two chroma CTBs are further added with corresponding syntax elements to form a CTU. For a luma CTB with LxL size in VVC, L∈{8, 16, 32, 64, 128}.

[0023] The value range for the luminance CTB is {8x8, 16x16, 32x32, 64x64, 128x128}.

[0024] The chromaticity CTB value ranges are {4x4, 8x8, 16x16, 32x32, 64x64}.

[0025] In the process of encoding high definition video, a larger CTB can achieve better compression effect.

[0026] 3. Deblocking filtering: The image coding process is based on different blocks, and each block has a relatively independent coding, and each block uses different parameters, so the distribution characteristics within the blocks are independent of each other, which causes discontinuity at the edges of the blocks, which is called the blocking effect. Deblocking filtering is mainly used to smooth the boundaries of the blocks and eliminate the blocking effect.

[0027] 4. Sample Adaptive Offset: Starting from the pixel domain, the reconstructed image is classified based on its features, and then offset processing is performed in the pixel domain, mainly to reduce the ringing effect.

[0028] 5. Adaptive Leveling Filtering: It is applied after DBF and SAO, and its main purpose is to further improve image quality under objective conditions. ALF technology builds a least-squares-based multiple linear regression model based on the characteristics of the reference pixels, and performs filter offset in the pixel domain.

[0029] 6. Wiener filtering: Essentially, it is about minimizing the mean square of the estimation error (defined as the difference between the desired response and the actual output of the filter).

[0030] II. Main flow of video encoding and decoding Taking video encoding as an example, as shown in (a) of Figure 1, video encoding generally includes processes such as prediction, transformation, quantization, and entropy coding, and further, the encoding process can be realized according to the framework in (b) of Figure 1.

[0031] Among them, prediction can be divided into intra prediction and inter prediction, where intra prediction is to predict a current uncoded block based on surrounding coded blocks, effectively removing redundancy in the spatial domain, and inter prediction is to predict a current image using adjacent coded images, effectively removing redundancy in the temporal domain.

[0032] Transformation refers to converting an image from the spatial domain to the transform domain and using transform coefficients to represent the image. Most images contain many flat and slowly changing regions, and a suitable transformation can transform the image from a distributed distribution in the spatial domain to a relatively concentrated distribution in the transform domain, eliminating the frequency domain correlation between signals, and in conjunction with the quantization process, can effectively compress the bitstream.

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

[0034] The above takes encoding as an example, and the process of video decoding and the process of video encoding are relative, that is, video decoding generally includes processes such as entropy decoding, prediction, inverse quantization, inverse transform, and filtering, and the realization principle of each process is the same or similar to that of video encoding.

[0035] 3. Realization of Wiener filtering technology The ALF encoding process includes: region division → obtaining reference pixels → region merging and calculating filter coefficients → determining whether each LCU starts filtering by determining CTU.

[0036] The parameters that need to be calculated and obtained in the whole process are: 1) the number of filter parameters, 2) region integration flag, 3) filter coefficients for each group, 4) flag for whether LCU starts filtering or not, 5) flag for whether current component (Y,U,V) starts filtering or not.

[0037] Some processes and concepts in the ALF process are explained in detail below.

[0038] 1. Region division In the ALF flow, for the acquired reconstructed video data, region segmentation processing is performed on the data on the luminance component, but region segmentation processing is not performed on the data on the chromaticity component.

[0039] As an example, a specific realization process of region division may be to divide an image into 16 regions that are essentially equal in size and aligned based on LCUs. The width of the non-rightmost region is (((pic_width_InLcus+1) / 4)×Lcu_Width), where pic_width_InLcus indicates the number of LCUs in the width of the image, and Lcu_Width indicates 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 total width of the three non-rightmost regions).

[0040] Similarly, the height of the non-bottom regions is (((pic_height_InLcus+1) / 4)*Lcu_Height), where pic_height_InLcus is the number of LCUs in the image height and Lcu_Height is 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 total height of the three non-bottom regions).

[0041] After obtaining the region segmentation result of the whole image, an index value is assigned to each region, and the schematic diagram may be as shown in FIG.

[0042] 2. Area integration The region merging operation is to judge whether to merge adjacent regions based on the order of index values. The purpose of merging is to reduce the coding coefficient. A merge flag needs to be used to indicate whether the current region is merged with the adjacent region.

[0043] For example, when region division is performed according to the above region division method, 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 during the first integration, the integration of regions 0 and 1, region 1 and 2, region 2 and 3, ..., region 13 and 14, and region 14 and 15 are attempted in that order, and the first region integration is performed according to the integration method that minimizes the error, and the 16 regions are integrated into 15 regions.

[0044] For the 15 regions after the first integration (assuming that regions 2 and 3 are integrated to obtain region 2+3), we sequentially try 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, and then perform the second integration according to the integration method that minimizes the error.As a result, the 15 regions are integrated into 14 regions.

[0045] For the 14 regions after the second integration (assuming that regions 14 and 15 are integrated to obtain region 14+15, i.e. the integrated region includes regions 2+3 and 14+15), we sequentially try integrating region 0 with region 1, integrating region 1 with region 2+3, integrating region 2+3 with region 4, ..., integrating region 12 with region 13, and integrating region 13 with region 14+15, and perform the third integration according to the integration method that minimizes the error, and the 14 regions will be integrated into 13 regions.

[0046] The same applies below until the regions are integrated into one region, and the schematic diagram thereof may be as shown in FIG.

[0047] After the above region integration operation is completed, the error when performing Wiener filtering on images of all frames is calculated in the following order: no region integration (16 regions in total), one region integration (15 regions in total), ..., 14 regions integration (2 regions in total), and 15 regions integration (1 region in total). The region integration method that produces the smallest error can then be determined as the final region integration method.

[0048] 3. Reference pixels and filter coefficients After performing region division according to the above method, filter coefficients can be calculated according to the principle of the Wiener filter based on the reference pixels of each pixel in each region.

[0049] For example, take the first Wiener filter as an example, the selection of reference pixels is shown in FIG. 4, and since the filter meets the central symmetry property, the selection of reference pixels is as follows: E[i]=(P i +P 16-i ) E[8]=P8 P i belongs to the pixel value in the reconstructed image before filtering, and E[i] is the value of the reference pixel, where i=0, 1, 2, 3, 4, 5, 6, 7.

[0050] Wiener filtering targets a linear combination of reference pixel values ​​and makes the result of the linear combination approximate the pixel value of the original image.

[0051] Take the first Wiener filter as an example, the filter shape of which is shown in Figure 5, which is a filter formed by adding a 3x3 square to a 7x7 cross. The filter is designed as a centrally symmetric filter, and the encoding device only needs to transmit 9 filter coefficients to the decoding device.

[0052] Of these, C0 to C7 are 7-bit signed numbers with a value range of [-1, 1), and C8 is a 7-bit unsigned number with a value range of [0, 2).

[0053] The ALF technique performs processing based on the Largest Coding Unit (LCU), and LCUs that belong to the same integrated region are filtered using filter coefficients from the same group.

[0054] 4. Adaptive correction filtering unit As shown in FIG. 14, the adaptive compensation filtering unit is derived based on the current maximum coding unit in the following steps:

[0055] 4.1. Delete the part of the sample area where the current largest coding unit C is located that exceeds the image boundary to obtain sample area D.

[0056] 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 luma and chroma component sample area D by four rows upward to obtain sample area E1; otherwise, make sample area E1 equal to sample area D. The sample in the last row of sample area D is the lower boundary of sample area E1.

[0057] 4.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 sample area E2.

[0058] 4.4Let sample region E2 be the current adaptive compensation 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.

[0059] 5. Adaptive correction filtering operation 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; otherwise, filtering is performed according to the following method.

[0060] 5.1. If the sample is outside the image boundary or outside the patch boundary and the value of cross_patch_loopfilter_enable_flag is "0", the closest sample to the sample in the adaptive compensation filtering unit is used instead of the sample for filtering.

[0061] 5.2. Otherwise, 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 for filtering.

[0062] 5.3. If the sample is neither outside the upper boundary of the adaptive compensation filtering unit nor outside the lower boundary of the adaptive compensation filtering unit, the sample is directly used for filtering.

[0063] 6. Determining the coding tree unit (CTU) After integrating regions and calculating the filter coefficients for each region, CTU decision must be performed. CTU decision also uses LCUs as the basic unit and determines whether each LCU in the current image uses ALF (i.e., whether to start Wiener filtering).

[0064] 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 to use ALF, Wiener filter each pixel in the LCU.

[0065] In the related technology, based on the Wiener filtering principle, the filter coefficients of a very small number of filters are trained at the encoding side and transmitted to the decoding side, thereby filtering the reconstructed image sequence to achieve the effect of improving image quality. Because the number of image pixels is large but the filter coefficients are small, the model created by the ALF technology has an underfitting situation when processing a large number of images. Therefore, the use of the ALF technology still has room for improving image quality.

[0066] As an example, the encoding device may perform intra / inter prediction, and then perform transform, quantization, inverse quantization and inverse transform processes on the prediction result in order to obtain a reconstructed image sequence.

[0067] For a decoding device, the bitstream may be sequentially subjected to entropy decoding, inverse quantization and inverse transformation to obtain a reconstructed image sequence.

[0068] In order to optimize the Wiener filtering effect and improve the encoding and decoding performance, the embodiment of the present invention considers improving the conventional Wiener filtering technique in the following aspects:

[0069] 1. By using finer region division or increasing the filter coefficients, the degree of underfitting when the model created by ALF technology processes an image can be mitigated. However, at the same time, more information needs to be transmitted to the decoding side, and in order to increase the bit rate, filtering is performed by appropriately increasing the filter coefficients.

[0070] 2. ALF technology can improve the reconstruction quality of images. Since the first ALF has an underfitting situation, by introducing the method of second-order Wiener filtering, a group of filter coefficients is newly trained for the image after the first filtering, and then filtered again, so as to further improve the image quality.

[0071] 3. Because the shape of the filter is fixed, the relationship between the reference pixels and the pixels to be filtered at some positions may be small, or there may be collinearity of the reference pixels, so that the trained coefficients may not be optimal. Therefore, using the idea of ​​stepwise regression, after three CTU determinations, one CTU determination is added, and the reference pixels at the positions where the coefficient is 0 are not involved in the calculation of the filter coefficients.

[0072] In order to make the above objectives, features and advantages of the embodiments of the present invention more apparent, the technical solutions in the embodiments of the present invention will be described in more detail below with reference to the drawings.

[0073] Example 1, Increasing the filter coefficients Filtering is performed by changing the shape of the filter and appropriately increasing the filter coefficients, thereby reducing the degree of underfitting when the model created by ALF technology processes an image.

[0074] The filtering method described in the first embodiment can be applied to both the encoding device and the decoding device.

[0075] As shown in FIG. 6A, it is a flowchart of a filtering method provided in an embodiment of the present invention. As shown in FIG. 6A, the filtering method may include the following step S600.

[0076] In step S600, when it is determined to start Wiener filtering for the adaptive compensation filtering unit of the current frame image, the adaptive compensation filtering unit is derived based on the current maximum coding unit LCU of the current frame image, a reference pixel and a filter coefficient of the Wiener filter of the adaptive compensation filtering unit are obtained, and the Wiener filtering is performed based on the sample pixel of the adaptive compensation filtering unit according to the obtained reference pixel and filter coefficient of the Wiener filter, where the Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross added to a 5*5 square, and the value of the reference pixel is derived by the pixel value of the reconstructed image before Wiener filtering.

[0077] As shown in FIG. 6B, it is a flowchart of another filtering method provided in an embodiment of the present invention. As shown in FIG. 6B, the filtering method may include step S601.

[0078] In step S601, when it is determined to start Wiener filtering for the current LCU of the current frame image, a reference pixel of the current LCU and a filter coefficient of a Wiener filter are obtained, and Wiener filtering is performed on the pixels of the current LCU one by one based on them. As an example, the Wiener filter is a second Wiener filter, which is obtained by performing shape extension based on the first Wiener filter, and the first Wiener filter is a centrally symmetric filter having a shape in which a 3*3 square is added to a 7*7 cross shape, and the value of the reference pixel is determined based on the pixel value of the reconstructed image before filtering.

[0079] It should be noted that in the embodiments of the present invention, unless otherwise specified, the current frame image referred to refers to a reconstructed image.

[0080] In addition, before performing Wiener filtering on the current frame image, it is possible to select whether to perform DBF processing and / or SAO processing on the current frame image according to needs, and a detailed implementation thereof will not be described here.

[0081] If DBF processing and / or SAO processing is performed on the current frame, the current frame image referred to in the embodiments of the present invention may be a reconstructed image subjected to DBF processing and / or SAO processing, and if DBF processing and / or SAO processing is not performed on the current frame, the current frame image referred to in the embodiments of the present invention may be a reconstructed image obtained after the above-mentioned inverse quantization and inverse transform processing.

[0082] Unless otherwise specified, performing Wiener filtering on the LCU described below may include performing Wiener filtering on the luminance component (Y component) and chromaticity components (U component and V component) of each pixel of the LCU. However, when filtering the former (Y component), processing such as region segmentation and region integration is required, whereas when filtering the latter (U component and V component), there is no need to perform region segmentation and region integration.

[0083] In the embodiment of the present invention, in order to optimize the filtering effect and improve the encoding and decoding performance, the filter coefficients of the Wiener filter are appropriately increased to obtain a new Wiener filter, which can alleviate the under-fitting situation that exists when the ALF technology processes images.

[0084] As an example, a new Wiener filter (referred to as a second Wiener filter in this specification) may be obtained by a shape extension method based on a centrally symmetric filter (referred to as a first Wiener filter in this specification, and a schematic diagram thereof may be as shown in Figure 5) having a shape of a 7*7 cross with a 3*3 square added thereto.

[0085] When it is determined to start Wiener filtering for a current LCU of a current frame image, the encoding / decoding device can obtain reference pixels of the current LCU and filter coefficients of a second Wiener filter, and perform Wiener filtering on the pixels of the current LCU one by one based on the obtained reference pixels and filter coefficients.

[0086] In one example, the second Wiener filter is a centrally symmetric filter with a 7*7 cross shape plus a 5*5 square shape.

[0087] As an example, as shown in FIG. 7, the second Wiener filter includes 15 filter coefficients.

[0088] As an example, corresponding to the second Wiener filter shown in FIG. 7, the position of the reference pixel may be as shown in FIG. 8, and the reference pixel position of the reconstructed image for obtaining the reference pixel value matches the shape of the filter coefficient of the second Wiener filtering.

[0089] In one example, in step S601, before deciding to perform Wiener filtering on the current LCU of the current frame image, the following may be included: determining whether to perform filtering on the current frame image; when it is decided to perform filtering on the current frame image, determining whether to start Wiener filtering on the current LCU; and when it is decided to start Wiener filtering on the current LCU, obtaining reference pixels and filter coefficients of the Wiener filter for the current LCU and performing Wiener filtering on pixels of the current LCU one by one based on them.

[0090] As an example, before performing Wiener filtering on the current LCU, it may be determined whether or not to perform filtering on the current frame image.

[0091] As an example, for an encoding device, determining whether or not to filter an image of a certain frame may involve determining whether or not to filter the image of the frame based on the rate-distortion cost of the image of the frame before and after filtering, and a detailed implementation thereof will not be described here.

[0092] When it is determined to perform filtering on the current frame image, it may be determined whether to start Wiener filtering for each LCU in the current frame image.

[0093] As an example, the encoding device may determine whether to initiate Wiener filtering for a certain LCU based on the CTU decision.

[0094] For a decoding device, a decision may be made as to whether or not to perform filtering on the current frame image based on the value of a frame-level filter flag bit added to the encoded bitstream of the received current frame image, and when it is decided to perform filtering on the current frame image, a decision may be made as to whether or not to perform filtering on the corresponding LCU based on the value of an LCU-level filter flag bit in the bitstream.

[0095] As an example, when it is determined to start Wiener filtering for the current LCU, Wiener filtering may be performed on the current LCU according to the method described in the above embodiment.

[0096] Example 2: Adding a filtering process once By introducing the method of double filtering, a group of filter coefficients is newly trained for the image after the first filtering, and then filtering is performed again, so that the image quality is further improved.

[0097] The filtering method described in the second embodiment can be applied to both the encoding device and the decoding device.

[0098] As shown in FIG. 9, it is a flowchart of a filtering method provided in an embodiment of the present invention. As shown in FIG. 9, the filtering method may include the following step S900.

[0099] In step S900, when it is determined to start Wiener filtering for the current LCU of the current image, a first Wiener filtering and a second Wiener filtering are performed on the current LCU.

[0100] In an embodiment of the present invention, for an LCU where Wiener filtering is initiated, two Wiener filterings (referred to herein as first Wiener filtering and second Wiener filtering) may be performed.

[0101] When it is determined to start Wiener filtering for a current LCU of a current frame image, a first Wiener filtering and a second Wiener filtering can be performed on the current LCU.

[0102] As an example, performing a first Wiener filtering and a second Wiener filtering on the current LCU is

[0103] The filter coefficients and reference pixels of a Wiener filter that performs a first Wiener filtering on the current LCU, and the filter coefficients and reference pixels of a Wiener filter that performs a second Wiener filtering on the current LCU are obtained, and based on them, the first Wiener filtering and the second Wiener filtering are performed on the pixels of the current LCU one by one.

[0104] As an example, for an encoding device, the filter coefficients of the Wiener filter may be determined by calculation, and for a decoding device, the filter coefficients of the Wiener filter may be obtained from the bitstream.

[0105] In one example, before performing the first Wiener filtering and the second Wiener filtering on the current LCU in step S900, further determining whether to perform filtering on the current frame image; The method may include a step of determining whether to start Wiener filtering for the current LCU when it is determined to perform filtering on the current frame image, and determining to perform a step of performing a first Wiener filtering and a second Wiener filtering on the current LCU when it is determined to start Wiener filtering on the current LCU.

[0106] As an example, one frame-level filter flag may identify whether an image requires filtering, and one LCU-level filter flag may identify whether an LCU initiates a Wiener filter.

[0107] The encoding device may inform the decoding device of whether or not to perform filtering on the current image using the frame-level filter flag, and the decoding device may determine whether or not to perform filtering on the current frame image based on the value of the frame-level filter flag in the bitstream.

[0108] Similarly, the encoding device may indicate whether the current LCU initiates a Wiener filter via a filter flag at that LCU level, and the decoding device may determine whether the current LCU initiates a Wiener filter based on the value of the filter flag at that LCU level in the bitstream.

[0109] As an example, the encoding device may determine whether to perform filtering on an image of a certain frame by referring to a conventional filtering method, for example, by determining whether to perform filtering on the image of the frame based on the rate-distortion cost of the image of the frame before and after filtering. A detailed description of the specific implementation will not be repeated here.

[0110] When it is determined to perform filtering on the current frame image, it may be determined whether to start Wiener filtering for each LCU in the current frame image.

[0111] As an example, the encoding device may determine whether to initiate Wiener filtering for a certain LCU based on the CTU decision.

[0112] When the encoding / decoding device performs filtering on the current frame image and determines to start Wiener filtering on the current LCU, it may obtain filter coefficients and reference pixels of a Wiener filter for performing a first Wiener filtering on the current LCU, and Wiener filter coefficients and reference pixels for performing a second Wiener filtering on the current LCU, and perform the first Wiener filtering and the second Wiener filtering on the pixels of the current LCU one by one based on the obtained filter coefficients and reference pixels.

[0113] In addition, in order to improve filtering efficiency, when performing Wiener filtering on the current LCU, after performing the first Wiener filtering and the second Wiener filtering on the current pixel, the first Wiener filtering and the second Wiener filtering on the next pixel may be performed, so that when a pixel is read once, Wiener filtering is performed twice on each pixel, thereby reducing the number of times the pixel is read.

[0114] In another example, in step S900, before performing the first Wiener filtering and the second Wiener filtering on the current LCU, determining whether to perform a first filtering on the current frame image, and whether to perform a second filtering on the current frame image; performing a first filtering on the current frame image, and when determining to perform a second filtering on the current frame image, determining whether to start a first Wiener filtering on the current LCU and whether to start a second Wiener filtering on the current LCU; When it is determined to start a first Wiener filtering for the current LCU and to start a second Wiener filtering for the current LCU, it may include a step of determining to perform a step of performing a first Wiener filtering and a second Wiener filtering for the current LCU.

[0115] As an example, it is necessary to determine whether to perform a first filtering on a current frame image, and whether to perform a second filtering on the current frame image, and when it is determined to perform the first filtering and / or the second filtering on the current frame, it is necessary to determine whether to start a first Wiener filtering on a current LCU, and whether to start a second Wiener filtering on the current LCU, respectively.

[0116] As an example, two frame-level filter flags may identify whether an image requires first and second filtering, respectively, and two LCU-level filter flags may identify whether an LCU starts first and second Wiener filtering, respectively.

[0117] The encoding device may inform the decoding device whether or not to perform first and second filtering on the current image using the frame-level filter flag, and the decoding device may determine whether or not to perform first and second filtering on the current frame image based on the value of the frame-level filter flag in the bitstream.

[0118] Similarly, the encoding device may indicate whether the current LCU will start first and second filtering via the filter flag at that LCU level, and the decoding device may determine whether the current LCU will start first and second filtering based on the value of the filter flag at that LCU level in the bitstream.

[0119] As an example, the encoding device may determine whether to perform a first filtering and a second filtering on the image of the frame based on the rate-distortion cost of the image of the frame before and after filtering, and a detailed implementation thereof will not be described here.

[0120] When it is determined to perform the first filtering and the second filtering on the current frame image, it may be determined whether to start the first Wiener filtering on the current LCU and whether to start the second Wiener filtering on the current LCU.

[0121] As an example, the encoding device may determine whether to start the first filtering and the second filtering for a certain LCU based on the CTU decision.

[0122] In addition, in an embodiment of the present invention, it is also possible to perform a first filtering on the current frame image and not a second filtering, or to perform a second filtering on the current frame image and not a first filtering, or to perform neither the first filtering nor the second filtering on the current frame image.

[0123] For an LCU, it may be possible to start a first Wiener filtering for the current LCU and not start a second Wiener filtering, or to start a second Wiener filtering for the current LCU and not start the first Wiener filtering, or to not start either the first Wiener filtering or the second Wiener filtering for the current LCU.

[0124] The encoding device instructs the decoding device, using the above two frame-level filter flags and the two LCU-level filter flags, whether to perform a first filtering or / and a second filtering on the current frame image, and, if the first filtering or / and a second filtering is performed on the current frame image, whether to start a first Wiener filtering or / and a second Wiener filtering on the current LCU.

[0125] In one example, the Wiener filter that performs the first Wiener filtering on the current LCU and the Wiener filter that performs the second Wiener filtering on the current LCU are both first Wiener filters; or The Wiener filter that performs the first Wiener filtering on the current LCU and the Wiener filter that performs the second Wiener filtering on the current LCU are both second Wiener filters; or the Wiener filter that performs the first Wiener filtering on the current LCU is a first Wiener filter, and the Wiener filter that performs the second Wiener filtering on the current LCU is a second Wiener filter; or The Wiener filter that performs the first Wiener filtering on the current LCU is the second Wiener filter, and the Wiener filter that performs the second Wiener filtering on the current LCU is the first Wiener filter.

[0126] As an example, when performing the first Wiener filtering or the second Wiener filtering on the current LCU, the Wiener filter to be used may be selected from the first Wiener filter or the second Wiener filter, and the specific Wiener filter to be used may be indicated by a configured instruction.

[0127] As an example, the second Wiener filter is obtained by performing shape extension on the basis of the first Wiener filter, and the first Wiener filter is a centrally symmetric filter in which a 3*3 square is added to a 7*7 cross, and its schematic diagram may be as shown in FIG. 5.

[0128] As an example, the second Wiener filter may be a centrally symmetric filter of a 7*7 cross plus a 5*5 square, the schematic diagram of which is as shown in FIG.

[0129] In one example, the values ​​of the reference pixels for performing the first Wiener filtering on the current LCU are obtained from a first reconstructed image according to a first scheme, and the first reconstructed image is a reconstructed image before the first Wiener filtering.

[0130] The pixel values ​​of the reference pixels for performing the second Wiener filtering on the current LCU are obtained from the first reconstructed image according to a second scheme.

[0131] As an example, the values ​​of reference pixels for performing the first Wiener filtering on the current LCU and the values ​​of reference pixels for performing the second Wiener filtering on the current LCU may both be obtained from a reconstructed image before the first Wiener filtering (referred to as the first reconstructed image in this specification).

[0132] As an example, the values ​​of the reference pixels for performing the first Wiener filtering on the current LCU may be obtained from the first reconstructed image according to a first scheme.

[0133] The values ​​of the reference pixels for performing the first Wiener filtering on the current LCU may be obtained from the first reconstructed image according to a second scheme.

[0134] As an example, the first method may be to obtain a reference pixel value from a reference pixel position of a first reconstructed image based on the reference pixel position shown in FIG. 4 and the shape of a first Wiener filter shown in FIG. 5. E[i]=P i +P 16-i E[8]=P8 Here, P i belongs to the pixel value in the reconstructed image before filtering, and E[i] is the value of the reference pixel, where i=0, 1, 2, 3, 4, 5, 6, 7.

[0135] As an example, the second scheme may be as follows: The value of a reference pixel corresponding to each pixel in the current LCU is determined based on the absolute value of the difference between the pixel value at each reference pixel position and the pixel value at the center position in the first reconstructed image.

[0136] For example, taking the reference pixel positions shown in FIG. 4 as an example, obtaining the reference pixel values ​​from the first reconstructed image according to the second method may be achieved by the following policy. E[i] = abs(P i -P8)+abs(P 16-i -P8) E[8]=1 Pi is the pixel value in the first reconstructed image, and E[i] is the value of the reference pixel, i=0, 1, 2, 3, 4, 5, 6, 7.

[0137] Also, for example, taking the reference pixel positions shown in FIG. 8 as an example, obtaining the reference pixel values ​​from the first reconstructed image according to the second method may be achieved by the following policy. E[i] = abs(P i -P 14 )+abs(P 28-i -P 14 ) E

[14] =1 P i is the pixel value in the first reconstructed image, and E[i] is the value of the reference pixel, for i=0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.

[0138] It should be noted that E[8]=1 or E

[14] =1 is simply a way of obtaining the value of the reference pixel, and is not limited to this in the embodiment of the present invention. That is, in the embodiment of the present invention, the value of E[8] (or E

[14] ) can be other pixel values ​​(not exceeding the maximum pixel value), or the value of E[8] (or E

[14] ) can be P8 (P 14 ) may also be used.

[0139] As an example, when performing the second Wiener filtering, the value of the reference pixel is determined based on the absolute value of the difference between the pixel value of each reference pixel position in the first reconstructed image and the pixel value of the central position, thereby realizing a linear combination for the reference pixel value by the second Wiener filtering, and approximating the result of the linear combination to the difference in pixel value between the pixel of the original image and the pixel of the image after the first filtering.

[0140] For any pixel, when the first Wiener filtering and the second Wiener filtering are completed for that pixel, if both of the reconstructed images are the first reconstructed images, the sum of the pixel value of that pixel after the first Wiener filtering and the pixel value of that pixel after the second Wiener filtering may be determined as the filtered pixel value of that pixel.

[0141] When the first Wiener filtering and the second Wiener filtering for any pixel are completed, if the first filtering uses a first method to obtain the value of the reference pixel (approximating the original value) and the second filtering uses a second method to obtain the value of the reference pixel (approximating the difference between the first filtering and the original value), the final filtering result may be obtained by superimposing the filtering results of the first filtering and the second filtering.

[0142] For example, when performing the first Wiener filtering and the second Wiener filtering on an LCU, if the values ​​of the reference pixels are both obtained from the first reconstructed image, the first Wiener filtering on the current LCU and the second Wiener filtering on the current LCU may be performed in parallel to improve filtering efficiency.

[0143] In another example, the values ​​of the reference pixels for performing the first Wiener filtering on the current LCU are determined based on pixel values ​​in a first reconstructed image, and the first reconstructed image is a reconstructed image before the first Wiener filtering.

[0144] The values ​​of the reference pixels for performing the second Wiener filtering on the current LCU are determined by the pixel values ​​in the second reconstructed image, and the second reconstructed image is the reconstructed image after the first Wiener filtering.

[0145] As an example, the values ​​of reference pixels for performing the first Wiener filtering on the current LCU and the values ​​of reference pixels for performing the second Wiener filtering on the current LCU may be obtained from a reconstructed image before the first Wiener filtering (i.e., the first reconstructed image) and a reconstructed image after the first Wiener filtering (referred to as the second reconstructed image in this specification), respectively.

[0146] As an example, the values ​​of the reference pixels for performing the second Wiener filtering on the current LCU are determined based on the absolute value of the difference between the pixel value of each reference pixel position and the pixel value of the center position in the second reconstructed image.

[0147] As an example, when performing the second Wiener filtering, the value of the reference pixel is determined based on the absolute value of the difference between the pixel value of each reference pixel position in the second reconstructed image and the pixel value of the central position, thereby realizing a linear combination for the reference pixel value by the second Wiener filtering, and approximating the result of the linear combination to the difference in pixel value between the pixel of the original image and the pixel of the image after the first filtering.

[0148] For any pixel, when the first Wiener filtering and the second Wiener filtering for that pixel are completed, the sum of the pixel value of that pixel after the first Wiener filtering and the pixel value of that pixel after the second Wiener filtering may be determined as the filtered pixel value of that pixel.

[0149] In one example, before performing the first Wiener filtering and the second Wiener filtering on the current LCU in step S900, further The method may include a step of dividing the current frame image into regions based on the LCU standard, and arranging the same filter parameters in the LCU divided into one region, where the filter parameters include a filter and filter coefficients for performing Wiener filtering, as well as a position index of a reference pixel, and the division method includes, but is not limited to, one type.

[0150] For example, the specific implementation of performing region segmentation on an image can refer to the related implementation in the conventional filtering method, and the embodiment of the present invention will not repeat the description thereof.

[0151] In addition, in an embodiment of the present invention, when the first filtering and the second filtering are performed on the current frame image, the method of performing region division may be different, and the Wiener filter selected to perform Wiener filtering on each LCU in the image may be different.

[0152] In one example, the filtering method shown in FIG. 9, when applied to a coding device, further comprises: When the three CTU determinations are completed, for an LCU for which it is determined to start Wiener filtering after the three CTU determinations, obtain a first group of filter coefficients obtained by performing Wiener filtering on the LCU reserved after the three CTU determinations, set values ​​of reference pixels at reference pixel positions where the filter coefficients are 0 to 0, and calculate a second group of filter coefficients based on the updated reference pixel values; The method may further include making a fourth CTU decision based on the second group of filter coefficients to determine whether each LCU of the current frame image starts Wiener filtering.

[0153] As an example, when performing the first or second filtering on the current frame image, the encoding device may determine the LCU at which to start Wiener filtering in the current frame image by making three CTU decisions, that is, the encoding device can determine whether an LCU starts the first Wiener filtering by making three CTU decisions, and can determine whether the LCU starts the second Wiener filtering by making three CTU decisions.

[0154] Considering that the relationship between the reference pixels and the pixels to be filtered at some positions may be small, or there may be collinearity of the reference pixels, so that the trained coefficients may not be optimal coefficients, and therefore, in order to optimize the training effect of the filter coefficients, in the process of determining whether each LCU will start the first Wiener filtering (or the second Wiener filtering) through the CTU decision, when three CTU decisions are completed, the encoding device can determine the LCU to start the first Wiener filtering (or the second Wiener filtering) based on the CTU decision, and based on the filter coefficients (referred to in this specification as the first group of filter coefficients) that perform Wiener filtering on the LCU reserved after the three CTU decisions, set the values ​​of the reference pixels at the reference pixel positions where the filter coefficients are 0 to 0, do not change the values ​​of the reference pixels at the reference pixel positions where the filter coefficients are not 0, update the values ​​of the reference pixels, and calculate new filter coefficients (referred to in this specification as the second group of filter coefficients) based on the updated values ​​of the reference pixels.

[0155] When the second group of filter coefficients is obtained, a fourth CTU decision may be made based on the second group of filter coefficients to determine whether each LCU of the current frame image starts Wiener filtering.

[0156] In another example, the filtering method shown in FIG. 9, when applied to a coding device, further comprises: Each time one CTU determination is completed, for an LCU for which it is determined that Wiener filtering is to be started after the current CTU determination, obtaining a first group of filter coefficients for performing Wiener filtering on the LCU reserved after the current CTU determination, setting values ​​of reference pixels at reference pixel positions where the filter coefficients are 0 to 0, and calculating a second group of filter coefficients based on the updated values ​​of the reference pixels; The method may further include making a next CTU decision based on the filter coefficients of the second group, and determining whether each LCU of the current frame image starts Wiener filtering.

[0157] As an example, it is taken into consideration that the relationship between the reference pixels and the pixels to be filtered at some positions is small or there is collinearity of the reference pixels, so that the trained coefficients may not be optimal coefficients, and therefore, in order to optimize the training effect of the filter coefficients, after each CTU determination, for an LCU that has been determined to start the first Wiener filtering (or the second Wiener filtering) based on the current CTU determination, the encoding device sets the value of the reference pixel at the reference pixel position where the filter coefficient is 0 to 0 based on the filter coefficient (which may be referred to as the first group of filter coefficients) that perform Wiener filtering on the LCU reserved by the current CTU determination, updates the value of the reference pixel without changing the value of the reference pixel at the reference pixel position where the filter coefficient is not 0, and calculates a new filter coefficient (which may be referred to as the second group of filter coefficients) based on the updated value of the reference pixel.

[0158] When the second group of filter coefficients is obtained, the next CTU decision may be made based on the second group of filter coefficients to determine whether each LCU of the current frame image starts Wiener filtering.

[0159] In addition, in an embodiment of the present invention, when the second group of filter coefficients are obtained through calculation each time, the rate-distortion cost of filtering the current frame image based on the filter coefficients of the first group may be compared with the rate-distortion cost of filtering the current frame image based on the filter coefficients of the second group. If the former is smaller, the filter coefficients of the first group are reserved; otherwise, the filter coefficients of the second group are reserved.

[0160] Example 3: Add one CTU decision Using the idea of ​​stepwise regression, after three CTU determinations, one additional CTU determination is performed, and the reference pixels at positions where the coefficient is 0 are not involved in the calculation of the filter coefficients, and the filter coefficients obtained by training are optimized.

[0161] The filtering method described in the third embodiment can be applied to an encoding device.

[0162] As shown in FIG. 10, it is a flowchart of a filtering method provided in an embodiment of the present invention. As shown in FIG. 10, the filtering method may include the following steps S1000 and S1010.

[0163] In step S1000, when three CTU decisions are completed, for an LCU for which it has been determined that Wiener filtering should be started after three CTU decisions, a first group of filter coefficients is obtained by performing Wiener filtering on the LCU that has been reserved after three CTU decisions, and the values ​​of the reference pixels at the reference pixel positions where the filter coefficient is 0 are set to 0, and a second group of filter coefficients is calculated based on the updated reference pixel values.

[0164] In step S1010, a fourth CTU decision is made based on the second group of filter coefficients to determine whether each LCU of the current frame image starts Wiener filtering.

[0165] In an embodiment of the present invention, it is taken into consideration that the relationship between reference pixels and pixels to be filtered at some positions may be small, or there may be collinearity of reference pixels, so that the coefficients obtained by training may not be optimal coefficients. Therefore, in order to optimize the training effect of filter coefficients, in the process of determining whether each LCU will start Wiener filtering through CTU determination, when three CTU determinations are completed, the encoding device can determine the LCU to start Wiener filtering based on the CTU determination, and based on the filter coefficients (referred to in this specification as the first group of filter coefficients) that perform Wiener filtering on the LCU reserved after the three CTU determinations, set the values ​​of reference pixels at filter coefficient positions whose filter coefficients are 0 to 0, do not change the values ​​of reference pixels at reference pixel positions whose filter coefficients are not 0, update the values ​​of the reference pixels, and calculate new filter coefficients (referred to in this specification as the second group of filter coefficients) based on the updated values ​​of the reference pixels.

[0166] When the second group of filter coefficients is obtained, a fourth CTU decision may be made based on the second group of filter coefficients to determine whether each LCU of the current frame image starts Wiener filtering.

[0167] In addition, in an embodiment of the present invention, after the second group of filter coefficients are calculated, the rate-distortion cost of filtering the current frame image based on the first group of filter coefficients may be compared with the rate-distortion cost of filtering the current frame image based on the second group of filter coefficients. If the former is smaller, the first group of filter coefficients are reserved; otherwise, the second group of filter coefficients are reserved.

[0168] In addition, when the updated filter coefficients are reserved, the encoding device can further update the region integration result based on the updated filter coefficients, and the specific implementation thereof will not be described here.

[0169] In one example, the filtering method shown in FIG. When it is determined that the current LCU in the current frame image should start Wiener filtering, the method includes a step of obtaining filter coefficients and reference pixels of a Wiener filter that performs Wiener filtering on the current LCU, and performing Wiener filtering on the pixels in the current LCU one by one based on the filter coefficients and reference pixels.

[0170] In an embodiment of the present invention, when it is determined that the current LCU in the current frame image starts Wiener filtering, the filter coefficients and reference pixels of the Wiener filter for performing Wiener filtering on the current LCU are obtained, and Wiener filtering can be performed on the pixels in the current LCU one by one.

[0171] In one example, in order to optimize the filtering effect and improve the encoding and decoding performance, the filter coefficients of the Wiener filter may be appropriately increased to obtain a new Wiener filter, thereby alleviating the under-fitting situation that exists when the ALF technology processes an image. For a specific implementation, refer to the relevant description in Example 1 or Example 2. The embodiments of the present invention will not be described here.

[0172] In one example, a method of introducing two-time filtering is used to newly train a group of filter coefficients for the image after the first filtering, and then filtering is performed again to further improve the image quality. For specific implementation, please refer to the relevant description in Example 2. The embodiments of the present invention will not repeat the description here.

[0173] In one example, before completing the three CTU determinations in step S1000, further Each time one CTU determination is completed, for an LCU for which it is determined that Wiener filtering is to be started after the current CTU determination, obtaining a first group of filter coefficients for performing Wiener filtering on the LCU reserved after the current CTU determination, setting values ​​of reference pixels at reference pixel positions where the filter coefficients are 0 to 0, and calculating a second group of filter coefficients based on the updated values ​​of the reference pixels; The method may further include making a next CTU decision based on the filter coefficients of the second group, and determining whether each LCU of the current frame image starts Wiener filtering.

[0174] As an example, it is taken into consideration that the relationship between reference pixels and pixels to be filtered at some positions is small or there is collinearity of reference pixels, so that the trained coefficients may not be optimal coefficients, and therefore, in order to optimize the training effect of the filter coefficients, after each CTU determination, for an LCU that has been determined to start Wiener filtering based on the current CTU determination, the encoding device sets the value of the reference pixel at the reference pixel position where the filter coefficient is 0 to 0 based on the filter coefficient (which may be referred to as a first group of filter coefficients) that performs Wiener filtering on the LCU reserved for the current CTU determination, updates the value of the reference pixel without changing the value of the reference pixel at the reference pixel position where the filter coefficient is not 0, and calculates an updated filter coefficient (which may be referred to as a second group of filter coefficients) based on the updated value of the reference pixel.

[0175] When the second group of filter coefficients is obtained, the next CTU decision may be made based on the second group of filter coefficients to determine whether each LCU of the current frame image starts Wiener filtering.

[0176] In addition, in an embodiment of the present invention, when the second group of filter coefficients are obtained through calculation each time, the rate-distortion cost of filtering the current frame image based on the first group of filter coefficients may be further compared with the rate-distortion cost of filtering the current frame image based on the second group of filter coefficients. If the former is smaller, the first group of filter coefficients are reserved; otherwise, the second group of filter coefficients are reserved.

[0177] In addition, when the filter coefficients of the second group are reserved, the encoding device can further update the region integration result based on the updated filter coefficients, and the specific implementation thereof will not be described here.

[0178] In order to facilitate understanding of those skilled in the art of the technical solutions provided in the embodiments of the present invention, the technical solutions provided in the embodiments of the present invention will be described below with reference to specific examples.

[0179] In view of the shortcomings of the traditional ALF technique, the present invention proposes to increase the number of filter coefficients in each group based on the traditional ALF parameters, or to keep the number of filter coefficients in each group unchanged and increase the number of groups of filter coefficients. Based on the RDO policy, it is finally controlled whether more groups of filter coefficients need to be added.

[0180] Hereinafter, the main improvements of the present invention will be described first from the encoding side and the decoding side.

[0181] 1. Coding method and coding device 1.1. Changing the filter shape As shown in FIG. 7, an encoding method for increasing filter coefficients extends a filter shape (which may be as shown in FIG. 5) in which a 3*3 square is added to a 7*7 cross based on the reference pixel position shown in FIG. 8, to obtain a filter shape in which a 5*5 square is added to a 7*7 cross, and six filter coefficients are added on top of the conventional filter coefficients.

[0182] 1.2. Add one filtering step The present solution builds on the traditional ALF technique and further trains a set of filter parameters.

[0183] The process of training the second set of filter parameters is consistent with the conventional ALF technique, with the following differences:

[0184] 1.2.1. Region division methods for pixels may include: 1.2.1.1, A segmentation method similar to the region segmentation shown in FIG. 2 and the region merging method shown in FIG. 1.2.1.2. A division method different from the region division shown in FIG. 2 and the region merging method shown in FIG. 3 (for example, further subdividing the region shown in FIG. 2 into multiple regions).

[0185] 1.2.2. The filter shape may remain as shown in FIG. 5, or another filter shape (for example, the filter shape shown in FIG. 7) may be used.

[0186] 1.2.3. The selection of reference pixels for the second filtering is different from that for the first filtering in the conventional solution.

[0187] 1.2.3.1. The reference pixel for the second filtering is composed of the absolute value of the difference in pixel value between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image before the first filtering (i.e., the first reconstructed image).

[0188] 1.2.3.2. The reference pixel for the second filtering is composed of the absolute value of the difference between the reference pixel value and the center value in the reconstructed image, and the reconstructed image refers to the reconstructed image after the first filtering (i.e., the second reconstructed image).

[0189] 1.2.3.3. The reference pixels for the second filtering are selected in the same manner as the first filtering, but the reference pixels P iis obtained from the reconstructed image after the first filtering (i.e., the second reconstructed image).

[0190] Note that 1.2.3.1, 1.2.3.2, and 1.2.3.3 are all improvements to the methods of calculating and obtaining reference pixels, and the three are mutually exclusive. 1.2.1 and 1.2.2 are independent of (1.2.3.1, 1.2.3.2, and 1.2.3.3) and can be combined with each other.

[0191] 1.3. Add one CTU decision to the encoding side Before each CTU determination, a group of filter coefficients is calculated and obtained, and this group of filter coefficients can reflect the weight of each reference pixel position, and there are some reference positions whose coefficient is 0, which are considered to have low correlation with the target value. When calculating the filter coefficients, the positions with high correlation are retained as much as possible, and the positions with low correlation and even no correlation are deleted, and the filter effect obtained in this way is higher.

[0192] Therefore, after the final CTU determination, one more CTU determination is added, and when the final CTU determination is completed, according to the currently reserved filter coefficients, if the coefficient is 0, the reference pixel value at this current position is marked as 0. If the coefficient is not 0, the reference pixel value at the position is kept as it is, and the last group of filter coefficients is trained to realize the update of the filter coefficients.

[0193] The rate-distortion cost of the last two groups of filter coefficients (filter coefficients before and after the update) is calculated, and the coefficients with the smaller rate-distortion cost are retained and coded.

[0194] 1.4. Improvements to the calculation of filter coefficients on the encoding side In this solution, when it is necessary to recalculate filter coefficients, for example, each time one CTU determination is completed, for a position where the coefficient of the previously reserved filter coefficients is 0, the reference pixel at that position is not involved in the filter calculation, and the value of the reference pixel is directly set to 0.

[0195] In addition, for the encoding device, the improvements described in 1.1 (i.e., changing the filter shape), 1.2 (adding one filtering process), 1.3 (adding one CTU determination on the encoding side) and 1.4 (improvements to the calculation of filter coefficients on the encoding side) may be used independently, or two or more may be used in combination.

[0196] For example, one filtering process may be added, and a new filter shape may be used in the first filtering process or / and the second filtering process; or one CTU may be added, and after the LCU on which Wiener filtering is to be started is determined by CTU determination, two Wiener filtering processes may be performed on the LCU on which Wiener filtering is to be started, and a new filter shape may be used in the first Wiener filtering process or / and the second Wiener filtering process.

[0197] 2. Decryption method and device 2.1. Changing the filter shape As shown in FIG. 7, an encoding method for increasing filter coefficients extends a filter shape (which may be as shown in FIG. 5) in which a 3*3 square is added to a 7*7 cross based on the reference pixel positions shown in FIG. 8, to obtain a filter shape in which a 5*5 square is added to a 7*7 cross, and six filter coefficients are added on top of the conventional filter coefficients.

[0198] 2.2. Add one filtering step The improvement of the ALF decoding process corresponds to the above encoding process. If the reference pixels for the first filtering and the second filtering are both determined by the reconstructed image before the first filtering (i.e., the first reconstructed image), the second filtering can be performed in parallel with the first filtering, and if the reference pixels for the second filtering are determined by the reconstructed image after the first filtering (i.e., the second reconstructed image), the second filtering needs to be performed after the first filtering.

[0199] 2.2.1. The region division of the second filtering and the region division of the first filtering can be the same or different, and should match the encoding side.

[0200] 2.2.2. The filter shape of the second filtering and the filter shape of the first filtering may be the same or different, and should match the encoding side.

[0201] 2.2.3. If the reference pixels of the second filtering on the encoding side are determined by the reconstructed image before the first filtering (i.e., the first reconstructed image), and the values ​​of the reference pixels of the second filtering are obtained from the first reconstructed image according to the second method, the reference pixels of the second filtering and the first filtering are determined by the same reconstructed image, and two groups of filter coefficients are obtained for the same LCU, the filtering process is performed in parallel, and the filtering results are superimposed.

[0202] 2.2.4. If the reference pixels for the second filtering on the encoding side are determined by the reconstructed image after the first filtering (i.e., the second reconstructed image), the reference pixels for the second filtering and the first filtering are determined by different reconstructed images, and the value of the reference pixel for the second filtering is obtained from the second reconstructed image according to the second method, and the reference pixel for the second filtering needs to be obtained after the first filtering is completed. For the same LCU, two filterings are performed one after the other, and the filtering results are superimposed.

[0203] 2.2.5. If the first filtering and the second filtering on the encoding side use the first method to obtain reference pixel values ​​from the first reconstructed image and the second reconstructed image, respectively, the reference pixels for the second filtering need to be obtained after the first filtering is completed, and the two filterings are performed one after the other on the same LCU.

[0204] It should be noted that for a decoding device, the improvements described in 2.1 (i.e., changing the filter shape) and 2.2 (adding one filtering step) may be used independently, or two or more may be used in combination.

[0205] Moreover, in order to adopt the above improvements, it is necessary to maintain consistency between the encoding device and the decoding device.

[0206] Below, some of the realization methods for adopting each improvement point independently or in combination will be described by way of example in accordance with each embodiment.

[0207] Example 4 The filter shape is changed, and the encoding flow on the encoding side remains unchanged as follows: region division → acquisition of reference pixels → region integration and calculation of filter coefficients → CTU determination to determine whether each LCU will start filtering.

[0208] The parameters that need to be calculated are: 1) the number of filter parameters (no change), 2) the region merge flag (no change), 3) the filter coefficients of each group (change the coefficients of each group from the original 9 to 15), 4) the flag for whether the LCU starts filtering (no change), and 5) the flag for whether the current component (Y,U,V) starts filtering.

[0209] The decoding side obtains the bit stream, and the filter coefficients are changed from the original 9 to 15. The decoding flow by ALF on the decoding side is as follows: The filter flag of the current frame (i.e., Frame_flag) is obtained, and if filtering should be performed on the frame (i.e., the value of the filter flag of the frame is true, and if it is false, filtering is not performed), the LCU is further treated as the smallest unit, and it is determined whether or not ALF is required based on the filter flag of the current LCU (i.e., LCU_flag). If it is required, a filter coefficient (Filter_coeff) is obtained for the current LCU. Each group has 15 coefficients, and filtering is performed on all pixels in the LCU according to the filter shape in FIG. 7 using the filter coefficients. The filtering process of decoding is shown in FIG. 11.

[0210] As an example, for an encoding device, a CTU decision is made to determine whether or not each LCU in the current frame image should start Wiener filtering, and based on the final decision result, a value of LCU_flag corresponding to each LCU is determined, which is added to the encoded bitstream and notified to a decoding device, and the decoding device determines whether or not to perform Wiener filtering on the corresponding LCU based on the value of LCU_flag corresponding to each LCU.

[0211] Example 5 One filtering process is added, and the same region division method and filter shape as those of the first ALF are used. However, the selection of the reference pixel for the second filtering is different from that of the first filtering in the original method. The reference pixel for the second filtering is composed of the absolute value of the difference in pixel value between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image before the first filtering (i.e., the first reconstructed image).

[0212] The filter shape is as shown in FIG. 5, and the reference pixels at each position are as shown in FIG. E[i] = abs(Pi -P8)+abs(P 16-i -P8) E[8]=1 P i is the pixel value in the first reconstructed image, and E[i] is the value of the reference pixel, i=0, 1, 2, 3, 4, 5, 6, 7.

[0213] The second filtering aims at a linear combination of the reference pixel values, and the result of the linear combination is made to approximate the difference in pixel value between the pixel of the original image and the pixel of the image after the first filtering.

[0214] The specific implementation process on the decoding side is as follows: The filter flags of the two filterings of the current frame (including the filter flag Frame_flag[0] of the first filtering and the filter flag Frame_flag[1] of the second filtering) are obtained, and if one filter flag is true, the LCU is taken as the smallest unit, and it is determined whether there is a filter flag that is true among the two groups of filter flags of the current LCU (including the filter flag LCU_flag[0] of the first filtering and the filter flag LCU_flag[1] of the second filtering). If there is, the decoding side obtains the filter coefficient (the filter coefficient Filter_coeff[0] of the first filtering or / and the filter coefficient Filter_coeff[1] of the second filtering) corresponding to the filter flag that is determined to be true among the two sets of filter flags, and performs point-by-point filtering on all pixels in the LCU. The specific process is shown in FIG. 12. Since the reference pixels for the two filterings only need to read the same pixel, the two filterings can be performed in parallel on the decoding side.

[0215] Example 6 One filtering process is added, and the second ALF uses a different region division method from the first ALF, in which the two filterings of the same LCU may be located in different regions. Also, the second ALF uses the same filter shape as the first ALF, but the selection of the reference pixel in the second ALF is different from that of the first filtering in the original method, and the reference pixel in the second ALF is composed of the absolute value of the difference in pixel value between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image before the first filtering (i.e., the first reconstructed image).

[0216] The filter shape is as shown in FIG. 5, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P8)+abs(P 16-i -P8) E[8]=1 P i is the pixel value in the first reconstructed image, and E[i] is the value of the reference pixel, i=0, 1, 2, 3, 4, 5, 6, 7.

[0217] The second ALF aims at a linear combination of the reference pixel values, and the result of the linear combination is made to approximate the difference in pixel value between the pixel of the original image and the pixel of the image after the first ALF.

[0218] The specific implementation process of the decoding side is as follows: obtain the filter flags of the two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a true filter flag among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12. The reference pixels of the two filterings only need to read the same pixels, so the two filterings can be performed in parallel on the decoding side.

[0219] As an example, for an encoding device, a CTU decision is made to determine whether each LCU in the current frame image will start the first Wiener filtering and the second Wiener filtering, and based on the final decision result, values ​​of LCU_flag[0] and LCU_flag[1] corresponding to each LCU are determined, and these are added to the encoded bitstream and notified to the decoding device. Based on the values ​​of LCU_flag[0] and LCU_flag[1] corresponding to each LCU, the decoding device determines whether to perform the first Wiener filtering on the corresponding LCU and whether to perform the second Wiener filtering on the corresponding LCU.

[0220] Example 7 One filtering process is added, and the same region segmentation method as in the first ALF is used, but the filter shape is different from that of the first ALF. The reference pixel in the second ALF is composed of the absolute value of the difference in pixel value between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image before the first ALF (i.e., the first reconstructed image).

[0221] The filter shape is as shown in FIG. 7, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P 14 )+abs(P 28-i -P 14 ) E

[14] =1 P i is the pixel value in the first reconstructed image, and E[i] is the value of the reference pixel, for i=0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.

[0222] The second ALF aims at a linear combination of the reference pixel values, and the result of the linear combination is made to approximate the difference in pixel value between the pixel of the original image and the pixel of the image after the first ALF.

[0223] The specific implementation process of the decoding side is as follows: obtain the filter flags of the two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12. The reference pixels for the two filterings only need to read the same pixels, so the two filterings can be performed in parallel on the decoding side.

[0224] Example 8 One filtering process is added, a different region division method and filter shape from that of the first ALF are used, the reference pixel of the second ALF is composed of the absolute value of the pixel difference between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image before the first ALF (i.e., the first reconstructed image).

[0225] The filter shape is as shown in FIG. 7, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P 14 )+abs(P 28-i -P 14 ) E

[14] =1 P i is the pixel value in the first reconstructed image, and E[i] is the value of the reference pixel, for i=0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.

[0226] The second ALF aims at a linear combination of the reference pixel values, and the result of the linear combination is made to approximate the difference in pixel value between the pixel of the original image and the pixel of the image after the first ALF.

[0227] The specific implementation process of the decoding side is as follows: obtain the filter flags of the two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12. The reference pixels for the two filterings only need to read the same pixels, so the two filterings can be performed in parallel on the decoding side.

[0228] Example 9 One filtering process is added, and the same region division method and filter shape as those of the first ALF are used. However, the selection of the reference pixel in the second ALF is different from that of the first ALF in the original method. The reference pixel in the second ALF is composed of the absolute value of the pixel difference between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0229] The filter shape is as shown in FIG. 5, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P8)+abs(P 16-i -P8) E[8]=1 P is the pixel value in the second reconstructed image, and E[i] is the value of the reference pixel, i=0, 1, 2, 3, 4, 5, 6, 7.

[0230] The second ALF aims at a linear combination of the reference pixel values, and the result of the linear combination is made to approximate the difference in pixel value between the pixel of the original image and the pixel of the image after the first ALF.

[0231] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0232] Example 10 One filtering process is added, a different region division method is used from the first ALF, and the same filter shape is used as the first ALF, but the selection of the reference pixel in the second ALF is different from that of the first ALF in the original method, the reference pixel in the second ALF is composed of the absolute value of the pixel difference between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0233] The filter shape is as shown in FIG. 5, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P8)+abs(P 16-i -P8) E[8]=1 P is the pixel value in the second reconstructed image, and E[i] is the value of the reference pixel, i=0, 1, 2, 3, 4, 5, 6, 7.

[0234] The second ALF aims at a linear combination of the reference pixel values, and the result of the linear combination is made to approximate the difference in pixel value between the pixel of the original image and the pixel of the image after the first ALF.

[0235] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0236] Example 11 One filtering process is added, and the same region division method as the first ALF is used, but the filter shape is different from that of the first ALF. The reference pixel of the second ALF is composed of the absolute value of the pixel difference between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0237] The filter shape is as shown in FIG. 7, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P 14 )+abs(P 28-i -P 14 ) E

[14] =1 P i is the pixel value in the second reconstructed image, and E[i] is the value of the reference pixel, for i=0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13.

[0238] The second ALF aims at a linear combination of the reference pixel values, and the result of the linear combination is made to approximate the difference in pixel value between the pixel of the original image and the pixel of the image after the first ALF.

[0239] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0240] Example 12 One filtering process is added, a different region division method is used from that of the first ALF, and a different filter shape is used from that of the first ALF. The reference pixel of the second ALF is composed of the absolute value of the pixel difference between the reference pixel position and the center position in the reconstructed image, and the reconstructed image refers to the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0241] The filter shape is as shown in FIG. 7, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P 14 )+abs(P 28-i -P 14 ) E

[14] =1 P is the pixel value in the second reconstructed image 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.

[0242] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0243] Example 13 One filtering process is added, the same region division method as in the first ALF is used, the same filter shape as in the first ALF is used, and the selection of reference pixels in the second ALF is the same as in the first ALF in the original method, and the value of the reference pixel in the second ALF is determined by the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0244] The filter shape is as shown in FIG. 5, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P8)+abs(P 16-i -P8) E[8]=P8 Here, P i belongs to a pixel in the second reconstructed image, and E[i] is the value of the reference pixel, i=0,1,2,3,4,5,6,7.

[0245] The second Wiener filtering aims at a linear combination of the reference pixel values, and makes the result of the linear combination approximate the pixel value of the original image.

[0246] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0247] Example 14 One filtering process is added, a different region division method is used from that of the first ALF, the same filter shape is used as that of the first ALF, and the selection of reference pixels in the second ALF is the same as that of the first ALF in the original method, and the value of the reference pixel in the second ALF is determined by the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0248] The filter shape is as shown in FIG. 5, and the reference pixels at each position are as shown in FIG. E[i] = abs(P i -P8)+abs(P 16-i -P8) E[8]=P8 Here, P i belongs to a pixel in the second reconstructed image, and E[i] is the value of the reference pixel, i=0,1,2,3,4,5,6,7.

[0249] The second Wiener filtering aims at a linear combination of the reference pixel values, and makes the result of the linear combination approximate the pixel value of the original image.

[0250] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0251] Example 15 One filtering process is added, the same region division method as in the first ALF is used, a filter shape different from that in the first ALF is used, the selection of reference pixels in the second ALF is the same as that in the first ALF in the original method, and the value of the reference pixel in the second ALF is determined by the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0252] The filter shape is as shown in FIG. 7, and the reference pixels at each position are as shown in FIG. E[i]=P i +P 28-i E

[14] =P 14 Here, P iis the pixel in the second reconstructed image 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.

[0253] The second Wiener filtering aims at a linear combination of the reference pixel values, and makes the result of the linear combination approximate the pixel value of the original image.

[0254] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0255] Example 16 One filtering process is added, a different region division method is used from that of the first ALF, a different filter shape is used from that of the first ALF, the selection of reference pixels in the second ALF is the same as that of the first ALF in the original method, and the value of the reference pixels in the second ALF is determined by the reconstructed image after the first ALF (i.e., the second reconstructed image).

[0256] The filter shape is as shown in FIG. 7, and the reference pixels at each position are as shown in FIG. E[i]=P i +P 28-i E

[14] =P 14 Here, P i is the pixel in the second reconstructed image 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.

[0257] The second Wiener filtering aims at a linear combination of the reference pixel values, and makes the result of the linear combination approximate the pixel value of the original image.

[0258] The specific implementation process of the decoding side is as follows: obtain the filter flags of two filterings of the current frame, if one filter flag is true, take the LCU as the smallest unit, and judge whether there is a filter flag that is true among the two groups of filter flags of the current LCU, if there is, the decoding side obtains the filter coefficients that are judged to be true among the two sets of filter flags, and performs point-by-point filtering for all pixels in the LCU, the specific process is shown in Figure 12.

[0259] Example 17 The encoding side adds one CTU decision, and the flow of CTU decision on the encoding side in the conventional method is shown in Figure 13. The number of CTU decisions is changed to four, but after completing the third CTU decision, new filter coefficients are recalculated instead of the original filter coefficients for LCUs where the flag is true, and when calculating new filter coefficients, for positions where the previous coefficients were 0, the values ​​of the reference pixels at these positions are set to 0 when the coefficients are finally calculated, that is, the dashed frame portion in Figure 13 is changed.

[0260] As shown in FIG. 13, the flow of CTU determination may include:

[0261] When making the first CTU determination, the filter coefficient of the current LCU of the current frame image can be obtained, and on the one hand, for any pixel in the current LCU, weighted addition is performed based on the filter coefficient and the value of the reference pixel at the corresponding position to obtain a weighted addition result corresponding to the pixel, and further, the weighted addition results of each pixel of the current LCU are added, and the result can be denoted as cost1 (which can be understood as an estimate of the loss of filtering for the current LCU).

[0262] On the other hand, for any pixel in the current LCU, a filter with a center value of 1 and the remaining values of 0 is used to perform weighted addition based on the filter coefficient and the value of the reference pixel at the corresponding position to obtain the weighted addition result corresponding to the pixel. Further, the weighted addition results of each pixel in the current LCU are added, and the result can be denoted as cost0 (which can be understood as an estimated value of the loss without performing filtering on the current LCU).

[0263] If cost1 < cost0, it is determined to start Wiener filtering for the current LCU; otherwise, it is determined not to start Wiener filtering for the current LCU.

[0264] According to the above method, after determining whether each LCU in the current frame image starts Wiener filtering, the loss cost2 of starting the filter flag and the loss cost3 of turning off the filter flag for the entire frame of the image can be calculated.

[0265] If cost2 < cost3, it is determined to perform filtering on the current frame image; otherwise, it is determined not to perform filtering on the current frame image.

[0266] Thus, one CTU decision is completed.

[0267] When the number of completed CTU decisions is 3 or less, according to the filter coefficient corresponding to the LCU where Wiener filtering is started, the value of the reference pixel at the reference pixel position where the filter coefficient is 0 is set to 0. Based on the updated value of the reference pixel, a new filter coefficient can be calculated instead of the original filter coefficient, and the next CTU decision can be performed based on the new filter coefficient.

[0268] If the number of completed CTU decisions is greater than 3 (i.e., reaches 4), filtering is performed on the current LCU using the current filter coefficient to obtain cost4, and cost4 is compared with cost5, which is obtained without performing filtering on the current LCU.

[0269] If cost4 < cost5, start Wiener filtering on the current LCU or decide not to start Wiener filtering on the current LCU.

[0270] Example 18 After each CTU decision, for the LCU with the flag being true, it is necessary to recalculate the new filter coefficient instead of the original filter coefficient. Therefore, every time the new filter coefficient is calculated, for the position where the previous coefficient is 0, when calculating the next coefficient, the value of the reference pixel at that position is set to 0.

[0271] Example 19, Correction of Adaptive Filtering Operation For the sample of the filter with a 5x5 square added to a 7x7 cross shape, it can be obtained by the adaptive correction filtering operation described in 5.1 to 5.3 or by the following method.

[0272] Regarding the boundary region: If the outside of the left boundary of the current adaptive correction filtering unit is the image boundary, or is located outside the patch boundary and the value of cross_patch_loopfilter_enable_flag is "0", there is no outside of the left boundary; otherwise, the outside of the left boundary is the region from the position where the current adaptive correction filtering unit is shifted 3 sample points to the left to the current adaptive correction filtering unit.

[0273] Similarly, if the right outside boundary of the current adaptive compensation filtering unit is the image boundary or is located outside the patch boundary and the value of cross_patch_loopfilter_enable_flag is "0", then there is no right outside boundary; otherwise, the right outside boundary area is the area from the point where the current adaptive compensation filtering unit is shifted three sample points to the left to the current adaptive compensation filtering unit.

[0274] As an example, the bounded region includes a left outbounded region and a right outbounded region.

[0275] If the sample used in the adaptive filtering process is a sample in the adaptive filtering unit, the sample is directly used for filtering; otherwise, filtering is performed according to the following method.

[0276] 19.1, if the sample is outside the image boundary or outside the patch boundary and cross_patch_loopfilter_enable_flag is set (Crosspatch boundary filter flag) If the value of is "0", 19.1.1. If the sample is the first sample point located at the upper left corner, lower left corner, upper right corner or lower right corner of the adaptive compensation filtering unit, use the sample closest to the sample in the adaptive compensation filtering unit instead of the sample; 19.1.2. If not, the closest sample to the sample in the boundary region in the adaptive compensation filtering unit is used instead of the sample to be filtered.

[0277] 19.2. If the sample is not outside the image boundary and does not satisfy the condition "outside the patch boundary and the value of cross_patch_loopfilter_enable_flag is '0'", when the sample is outside the upper boundary or lower boundary of the adaptive compensation filtering unit, 19.2.1. If the sample is the first sample point located at the upper left corner, lower left corner, upper right corner or lower right corner of the adaptive compensation filtering unit, the sample closest to the sample in the adaptive compensation filtering unit is used instead of the sample; 19.2.2. If not, the sample is replaced by the closest sample in the boundary region in the adaptive compensation filtering unit for filtering.

[0278] 19.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.

[0279] As an example, any one of the first to eighteenth embodiments may perform an adaptive correction filtering operation using the method in the nineteenth embodiment.

[0280] Having described the method provided by the present invention, the apparatus provided by the present invention will now be described.

[0281] As shown in FIG. 15, FIG. 15 is a structural schematic diagram of a filtering device provided in an embodiment of the present invention, where the filtering device can be applied to an encoding / decoding device, and the device may include: a determining unit 1510 and a filtering unit 1520; When the determination unit 1510 determines to start Wiener filtering on the current LCU of the current frame image, the filtering unit 1520 is used to obtain the reference pixels of the current LCU and the filter coefficients of a Wiener filter, and perform Wiener filtering on the pixels of the current LCU one by one based on the reference pixels and the filter coefficients of the Wiener filter; As an example, the Wiener filter is a second Wiener filter obtained by performing shape expansion on the basis of the first Wiener filter, and the first Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross to which a 3*3 square is added, and the value of the reference pixel is determined based on the pixel value of the reconstructed image before filtering.

[0282] In one possible embodiment, the second Wiener filter is a centrosymmetric filter with a shape of a 7*7 cross plus a 5*5 square.

[0283] In one possible implementation, the second Wiener filter comprises 15 filter coefficients.

[0284] In one possible embodiment, the determining unit 1510 is used to determine whether to perform filtering on the current frame image, Specifically, when the determination unit 1510 determines to perform filtering on the current frame image, the filtering unit 1520 is used to determine whether to start Wiener filtering for the current LCU, and when it determines to start Wiener filtering for the current LCU, to obtain reference pixels of the current LCU and filter coefficients of a Wiener filter, and perform Wiener filtering on the pixels of the current LCU one by one based on them.

[0285] As shown in FIG. 16, FIG. 16 is a structural schematic diagram of a filtering device provided in an embodiment of the present invention, where the filtering device can be applied to an encoding / decoding device, and the device may include: a determining unit 1610 and a filtering unit 1620; the filtering unit 1620 is used for performing a first Wiener filtering and a second Wiener filtering on the current LCU when the determining unit 1610 determines to start Wiener filtering on the current LCU of the current image; Specifically, the filtering unit 1620 is used to obtain filter coefficients and reference pixels of a Wiener filter for performing a first Wiener filtering on the current LCU, and Wiener filter coefficients and reference pixels for performing a second Wiener filtering on the current LCU, and perform a first Wiener filtering and a second Wiener filtering on the pixels of the current LCU one by one based on them.

[0286] In one possible embodiment, the determining unit 1610 is used to determine whether to perform filtering on the current frame image, Specifically, the filtering unit 1620 is used to determine whether to start Wiener filtering for the current LCU when the decision unit 1610 decides to perform filtering on the current frame image, and to perform a first Wiener filtering and a second Wiener filtering on the current LCU when the decision unit 1610 decides to start Wiener filtering on the current LCU.

[0287] In one possible embodiment, the determining unit 1610 is used to determine whether to perform a first filtering on the current frame image, and whether to perform a second filtering on the current frame image; The determining unit 1610 is further used for determining whether to start a first Wiener filtering for a current LCU and whether to start a second Wiener filtering for a current LCU when determining to perform a first filtering on a current frame image and a second filtering on the current frame image; The filtering unit 1620 is specifically used for performing a first Wiener filtering and a second Wiener filtering on the current LCU when the determination unit 1610 determines to perform a first Wiener filtering on the current LCU and start a second Wiener filtering on the current LCU.

[0288] In one possible embodiment, the Wiener filter that performs the first Wiener filtering on the current LCU and the Wiener filter that performs the second Wiener filtering on the current LCU are both first Wiener filters; or The Wiener filter that performs the first Wiener filtering on the current LCU and the Wiener filter that performs the second Wiener filtering on the current LCU are both second Wiener filters; or A Wiener filter that performs a first Wiener filtering on the current LCU is a first Wiener filter, and a Wiener filter that performs a second Wiener filtering on the current LCU is a second Wiener filter; or The Wiener filter that performs a first Wiener filtering on the current LCU is a second Wiener filter, and the Wiener filter that performs a second Wiener filtering on the current LCU is a first Wiener filter.

[0289] Here, the second Wiener filter is obtained by performing shape expansion based on the first Wiener filter, and the first Wiener filter is a centrally symmetric filter in which a 3*3 square is added to a 7*7 cross.

[0290] In one possible embodiment, the second Wiener filter is a centrally symmetric filter consisting of a 7*7 cross plus a 5*5 square.

[0291] In one possible embodiment, values ​​of reference pixels for performing a first Wiener filtering on the current LCU are obtained from a first reconstructed image according to a first manner, and the first reconstructed image is a reconstructed image before a first Wiener filtering; Values ​​of reference pixels for performing a second Wiener filtering on the current LCU are obtained from the first reconstructed image according to a second scheme.

[0292] In one possible embodiment, the second scheme is as follows: The value of a reference pixel corresponding to each pixel in the current LCU is determined based on the absolute value of the difference between the pixel value at each reference pixel position and the pixel value at the center position in the first reconstructed image.

[0293] In one possible embodiment, a first Wiener filtering on the current LCU and a second Wiener filtering on the current LCU are performed in parallel.

[0294] In one possible embodiment, values ​​of reference pixels for performing a first Wiener filtering on the current LCU are determined based on pixel values ​​in a first reconstructed image, the first reconstructed image being a reconstructed image before a first Wiener filtering; The values ​​of the reference pixels for performing a second Wiener filtering on the current LCU are determined by pixel values ​​in a second reconstructed image, and the second reconstructed image is a reconstructed image after a first Wiener filtering.

[0295] In one possible embodiment, values ​​of reference pixels for performing a second Wiener filtering on the current LCU are determined based on the absolute value of the difference between the pixel value of each reference pixel position and the pixel value of the center position in the second reconstructed image.

[0296] In one possible embodiment, the filtering unit is further used to perform region division on the current frame image based on the standard of an LCU, and to assign the same filter parameters to the LCU divided into one region, where the filter parameters include a filter and filter coefficients for performing Wiener filtering, and reference pixels, where the division method includes but is not limited to one type.

[0297] In one possible embodiment, when the filtering device is applied in a coding device, The determination unit 1610 further obtains, when completing three CTU decisions, a first group of filter coefficients for performing Wiener filtering on an LCU that is determined to start Wiener filtering after the three CTU decisions, sets the value of a reference pixel at a reference pixel position where the filter coefficient is 0 to 0, and calculates a second group of filter coefficients based on the updated reference pixel value.

[0298] The decision unit 1610 is further used to make a fourth CTU decision based on the second group of filter coefficients, for determining whether each LCU of the current frame image starts Wiener filtering.

[0299] In one possible embodiment, when the filtering device is applied in a coding device, The determination unit 1610 further obtains, each time completing one CTU determination, a first group of filter coefficients for performing Wiener filtering on an LCU that is determined to start Wiener filtering after the current CTU determination, sets the value of a reference pixel at a reference pixel position where the filter coefficient is 0 to 0, and calculates a second group of filter coefficients based on the updated reference pixel value.

[0300] The decision unit 1610 is further used to make a next CTU decision based on the second group of filter coefficients, and determine whether each LCU of the current frame image starts Wiener filtering.

[0301] As shown in FIG. 17, FIG. 17 is a structural schematic diagram of a filtering device provided in an embodiment of the present invention, where the filtering device can be applied to an encoding / decoding device, and the device may include: a filtering unit 1710 and a determining unit 1720; When completing three CTU determinations, the filtering unit 1710 obtains a first group of filter coefficients obtained by performing Wiener filtering on an LCU that is reserved after the three CTU determinations for the LCU that is determined to start Wiener filtering after the three CTU determinations, sets values ​​of reference pixels at reference pixel positions where the filter coefficients are 0 to 0, and calculates a second group of filter coefficients based on the updated reference pixel values; The decision unit 1720 makes a fourth CTU decision based on the second group of filter coefficients, and is used to determine whether each LCU of the current frame image starts Wiener filtering.

[0302] In one possible embodiment, the determining unit 1720 further performs, each time a CTU determination is completed, for an LCU determined to start Wiener filtering after the current CTU determination, obtaining a first group of filter coefficients for performing Wiener filtering on the LCU reserved after the current CTU determination, setting values ​​of reference pixels at reference pixel positions where the filter coefficients are 0 to 0, and calculating a second group of filter coefficients based on the updated values ​​of the reference pixels; The decision unit 1720 is further used to make a next CTU decision based on the second group of filter coefficients, and determine whether each LCU of the current frame image starts Wiener filtering.

[0303] In one possible embodiment, the filtering unit 1710 is further used, when the determining unit 1720 determines to start Wiener filtering on a current LCU of a current frame image, to obtain reference pixels of the current LCU and filter coefficients of a Wiener filter, and perform Wiener filtering on pixels of the current LCU one by one based on the reference pixels and filter coefficients of the current LCU; Here, the Wiener filter is a second Wiener filter obtained by performing shape expansion based on the first Wiener filter, the first Wiener filter is a centrosymmetric filter having a shape of a 7*7 cross added to a 3*3 square, the value of the reference pixel is determined based on the pixel value of the reconstructed image before filtering, and the second Wiener filter is a centrosymmetric filter having a shape of a 7*7 cross added to a 5*5 square.

[0304] As shown in Figure 18, it is a schematic diagram of a hardware structure of a decoding device provided in 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 to perform the filtering method of the decoding device described above.

[0305] The machine-readable storage medium 1802 referred to herein may be any electronic, magnetic, optical, or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (e.g., a hard disk drive), a solid-state hard disk, any type of storage disk (e.g., an optical disk, a DVD, etc.), or a similar storage medium, or a combination thereof.

[0306] In some embodiments, there is further provided a machine-readable storage medium having machine-executable instructions stored thereon, the machine-executable instructions, when executed by a processor, causing the decoding device to perform the filtering method described above. 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.

[0307] As shown in Figure 19, it is a schematic diagram of a hardware structure of an encoding device provided in 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 of the encoding device described above.

[0308] The machine-readable storage medium 1902 referred to herein may be any electronic, magnetic, optical, or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the machine-readable storage medium may be a RAM (Random Access Memory), a volatile memory, a non-volatile memory, a flash memory, a storage drive (e.g., a hard disk drive), a solid-state hard disk, any type of storage disk (e.g., an optical disk, a DVD, etc.), or a similar storage medium, or a combination thereof.

[0309] In some embodiments, there is further provided a machine-readable storage medium having machine-executable instructions stored thereon, the machine-executable instructions, when executed by a processor, causing the filtering method of the encoding device described above to be performed. 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.

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

[0311] It should be noted that, in this specification, relational terms such as first and second, etc., are merely intended to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that any such actual relationship or order exists between those entities or operations. Also, the terms "comprise", "include", or any other variation thereof are intended to cover 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 recited, or includes elements inherent in such process, method, article, or device. In the absence of further limitations, an element qualified by the phrase "comprises a ..." does not exclude the presence of other identical elements in the process, method, article, or device that includes said element.

[0312] The above are only preferred embodiments of the present invention, and are not intended to limit the present invention. Any modifications, equivalent replacements, and 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]

[0313] 1510 Decision Unit 1520 Filtering Unit 1610 Decision Unit 1620 Filtering Unit 1710 Filtering Unit 1720 Decision Unit

Claims

1. 1. A filtering method applied to an encoding / decoding device, comprising: When it is determined that the adaptive compensation filtering unit of the current frame image starts Wiener filtering, deriving the adaptive compensation filtering unit based on a current largest coding unit (LCU) of the current frame image; obtaining reference pixels and filter coefficients of a Wiener filter of the adaptive compensation filtering unit; performing the Wiener filtering based on the sample pixels of the adaptive compensation filtering unit according to the obtained reference pixels and filter coefficients of a Wiener filter; the Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross with a 5*5 square added thereto, and the value of the reference pixel is derived from the pixel value of the reconstructed image before filtering; The step of performing the Wiener filtering based on the sample pixels of the adaptive compensation filtering unit according to the obtained reference pixels and filter coefficients of a Wiener filter includes: If the samples used in the adaptive compensation filtering process are samples in the adaptive compensation filtering unit, filtering is performed using the samples; If the sample used in the adaptive compensation filtering process is not a sample in the adaptive compensation filtering unit, if the sample is outside the image boundary or outside the patch boundary and the value of the cross patch boundary filter flag is 0, if the sample is the first sample point located at the upper left corner, the lower left corner, the upper right corner or the lower right corner of the adaptive compensation filtering unit, then use the sample closest to the sample in the adaptive compensation filtering unit instead of the sample; If the sample is not outside the image boundary, and the sample is outside the patch boundary and the cross patch boundary filter flag does not satisfy the value 0, and the sample is outside the upper boundary or the lower boundary of the adaptive compensation filtering unit, if the sample is the first sample point located at the upper left corner, the lower left corner, the upper right corner, or the lower right corner of the adaptive compensation filtering unit, use the sample closest to the sample in the adaptive compensation filtering unit instead of the sample; performing filtering using the sample if the sample is not outside the image boundary, and the sample is not outside the patch boundary and the cross patch boundary filter flag does not satisfy the value of 0, and 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; 13. A filtering method comprising:

2. The Wiener filter includes 15 filter coefficients.

2. The method of claim 1 .

3. before determining to start Wiener filtering for the adaptive compensation filtering unit of the current frame image, determining whether to perform filtering on the current frame image; When it is determined to perform filtering on the current frame image, determining whether to start Wiener filtering for the adaptive compensation filtering unit; when it is determined to start Wiener filtering for the adaptive compensation filtering unit, deriving the adaptive compensation filtering unit based on a current maximum coding unit LCU of the current frame image, obtaining reference pixels and a filter coefficient of a Wiener filter of the adaptive compensation filtering unit, and performing a step of performing Wiener filtering based on a sample pixel of the adaptive compensation filtering unit according to the obtained reference pixels and the filter coefficient of the Wiener filter.

3. The method according to claim 1 or 2.

4. before determining to start Wiener filtering for the adaptive compensation filtering unit of the current frame image, A step of dividing the current frame image into regions based on an LCU standard and arranging the same filter parameters in the LCUs belonging to one region, the filter parameters including a filter coefficient for the Wiener filter to perform Wiener filtering, further comprising:

4. The method according to claim 1, wherein the first and second electrodes are connected to a first electrode.

5. Segmenting the current frame image into regions based on an LCU standard includes: The number of regions obtained by performing region division on the current frame image is 16 or more.

5. The method of claim 4.

6. A filtering device applied to an encoding / decoding device, comprising: a determining unit and a filtering unit, The filtering unit is used for, when the determining unit determines to start Wiener filtering for the adaptive compensation filtering unit of the current frame image, deriving the adaptive compensation filtering unit according to a current maximum coding unit LCU of the current frame image, obtaining reference pixels and filter coefficients of a Wiener filter of the adaptive compensation filtering unit, and performing the Wiener filtering based on sample pixels of the adaptive compensation filtering unit according to the obtained reference pixels and filter coefficients of the Wiener filter; the Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross with a 5*5 square added thereto, and the value of the reference pixel is derived from the pixel value of the reconstructed image before filtering; The filtering unit further comprises: If the sample used in the adaptive compensation filtering process is a sample in the adaptive compensation filtering unit, the sample is used for filtering; If the sample used in the adaptive compensation filtering process is not a sample in the adaptive compensation filtering unit, if the sample is outside the image boundary or outside the patch boundary and the value of the cross patch boundary filter flag is 0, if the sample is the first sample point located at the upper left corner, the lower left corner, the upper right corner or the lower right corner of the adaptive compensation filtering unit, then use the sample closest to the sample in the adaptive compensation filtering unit instead of the sample; If the sample is not outside the image boundary, and the sample is outside the patch boundary and the cross patch boundary filter flag does not satisfy the value 0, and the sample is outside the upper boundary or the lower boundary of the adaptive compensation filtering unit, if the sample is the first sample point located at the upper left corner, the lower left corner, the upper right corner, or the lower right corner of the adaptive compensation filtering unit, use the sample closest to the sample in the adaptive compensation filtering unit instead of the sample; A filtering device characterized in that the sample is used for filtering when the sample is not outside the image boundary, and the sample is outside the patch boundary and does not satisfy the condition that the value of the cross patch boundary filter flag is 0, and the sample is not outside the upper boundary of an adaptive compensation filtering unit and is not outside the lower boundary of an adaptive compensation filtering unit.

7. 1. A decoding device comprising: a processor; and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to: When it is determined that the adaptive compensation filtering unit of the current frame image starts Wiener filtering, Derive the adaptive compensation filtering unit according to a current maximum coding unit (LCU) of the current frame image; Obtaining reference pixels and filter coefficients of a Wiener filter of the adaptive compensation filtering unit; Perform the Wiener filtering based on the sample pixels of the adaptive compensation filtering unit according to the obtained reference pixels and filter coefficients of a Wiener filter; the Wiener filter is a centrally symmetric filter having a shape of a 7*7 cross with a 5*5 square added thereto, and the value of the reference pixel is derived from the pixel value of the reconstructed image before filtering; When performing the Wiener filtering based on the sample pixels of the adaptive compensation filtering unit according to the obtained reference pixels and the filter coefficients of a Wiener filter, the processor further comprises: If the sample used in the adaptive compensation filtering process is a sample in the adaptive compensation filtering unit, the sample is used for filtering; If the sample used in the adaptive compensation filtering process is not a sample in the adaptive compensation filtering unit, if the sample is outside the image boundary or outside the patch boundary and the value of the cross patch boundary filter flag is 0, if the sample is the first sample point located at the upper left corner, the lower left corner, the upper right corner or the lower right corner of the adaptive compensation filtering unit, then use the sample closest to the sample in the adaptive compensation filtering unit instead of the sample; If the sample is not outside the image boundary, and the sample is outside the patch boundary and the cross patch boundary filter flag does not satisfy the value 0, and the sample is outside the upper boundary or the lower boundary of the adaptive compensation filtering unit, if the sample is the first sample point located at the upper left corner, the lower left corner, the upper right corner, or the lower right corner of the adaptive compensation filtering unit, use the sample closest to the sample in the adaptive compensation filtering unit instead of the sample; If the sample is not outside the image boundary, and the sample is not outside the patch boundary and the cross patch boundary filter flag is not set to 0, and 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, filtering is performed using the sample. A decoding device characterized by:

8. The second Wiener filter contains 15 filter coefficients.

8. A decoding device according to claim 7.

9. Before determining to start Wiener filtering for the adaptive compensation filtering unit of the current frame image, the processor further comprises: Determine whether to perform filtering on the current frame image; When it is determined to perform filtering on the current frame image, determine whether to start Wiener filtering for the adaptive compensation filtering unit; when it is determined to start Wiener filtering for the adaptive compensation filtering unit, derive the adaptive compensation filtering unit based on a current maximum coding unit LCU of the current frame image, obtain reference pixels and filter coefficients of a Wiener filter of the adaptive compensation filtering unit, and perform Wiener filtering based on sample pixels of the adaptive compensation filtering unit according to the obtained reference pixels and filter coefficients of the Wiener filter.

9. A decoding device according to claim 7 or 8.

10. Before determining to start Wiener filtering for the adaptive compensation filtering unit of the current frame image, the processor further comprises: Dividing the current frame image into regions based on an LCU standard, and arranging the same filter parameters in the LCUs belonging to one region; the filter parameters include filter coefficients that cause the Wiener filter to perform Wiener filtering; A decoding device according to any one of claims 7 to 9.

11. Segmenting the current frame image into regions based on an LCU standard includes: The number of regions obtained by performing region division on the current frame image is 16 or more. A decoding device according to claim 10.

12. 6. An encoding device comprising a processor and a machine-readable storage medium, the machine-readable storage medium storing machine-executable instructions executable by the processor, the processor executing the machine-executable instructions to cause the device to perform a method according to any one of claims 1 to 5.

1. An encoding device comprising:

13. A method for implementing a method according to any one of claims 1 to 5, comprising: A non-transitory machine-readable storage medium comprising:

Citation Information

Patent Citations

  • Boundary treatment method and device for adaptive loop filter

    CN104702963A

  • Adaptive loop filtering method and device

    CN105306957A

  • Adaptive loop filtering method and apparatus

    CN105357538A

  • Method and apparatus for improved loop-type filtering process

    JP2014506061A

  • Image Filtering Method and Apparatus

    US20200021822A1