Moving image processing method and stream generation method
The method optimizes in-loop filtering by determining target filters and coefficients for chrominance components in video encoding, addressing high complexity in ALF and enhancing image quality and efficiency.
Patent Information
- Application Number
- JP2024134329
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2024-08-09
- Publication Date
- 2024-11-06
- Estimated Expiration
- 2039-12-31
AI Technical Summary
Current video encoding standards like VVC and HEVC suffer from high computational complexity in adaptive loop filtering (ALF), which affects encoding quality and efficiency due to block effects and ringing artifacts.
Implement a method and apparatus for in-loop filtering that reduces complexity by determining a target filter and coefficient for chrominance components based on adaptive loop filter (ALF) processing, encoding these filters as a syntax element, and optimizing the filtering process.
Enhances encoding and decoding performance by improving filtering effectiveness and reducing computational complexity in video encoding, thereby increasing the quality of decoded images.
Smart Images

Figure 2024156976000001_ABST
Abstract
Description
[Technical field]
[0001] Copyright Statement The subject matter disclosed by this patent document contains material protected by copyright, which copyright is owned by the Copyright Owner. The Copyright Owner has no objection to anyone copying this patent document or the disclosure of this patent in any form contained in the official records and public archives of the Trademark Office.
[0002] The present invention relates to the field of digital video coding technology, and more particularly to a method and apparatus for in-loop filtering. [Background technology]
[0003] At present, in order to reduce the bandwidth occupied by video storage and transmission, video data needs to be encoded and compressed. At present, in normal encoding technology, the video encoding and compression process includes block division, prediction, transformation, quantization and entropy coding processes to form a mixed video encoding frame. Based on this mixed video encoding frame, after more than ten years of development, video encoding and decoding technology standards have been gradually formed, and currently several mainstream video encoding and decoding standards include the international video encoding standard H.264 / MPEG-AVC, H.265 / MEPG-HEVC, the domestic audio and video encoding standard AVS2, and the H.266 / VVC international standard and the AVS3 domestic standard that are currently being prepared.
[0004] In the coding process of block division, prediction, transformation, quantization and entropy coding, due to the existence of quantization, the decoded reconstructed video will have compression distortion such as block effect, ringing effect, etc., and in inter-frame prediction mode, the compression distortion in the reconstructed video will affect the coding quality of subsequent images. Therefore, in order to reduce the compression distortion, an in-loop filter technology is introduced into the coding / decoding structure frame to improve the quality of the current decoded image, provide a high-quality reference image for subsequent coded images, and improve the compression efficiency.
[0005] In the currently under development Versatile Video Coding (VVC) standard and High Efficiency Video Coding (HEVC) standard, the loop filter includes a deblocking filter (DBF), a sample adaptive offset (SAO), and an adaptive loop filter (ALF), where there is still room for improvement in the filtering process. Summary of the Invention [Means for solving the problem]
[0006] The present invention provides a method and apparatus for in-loop filtering, which can reduce the complexity of in-loop filtering and improve the filtering effect compared with the prior art.
[0007] In a first aspect, there is provided a method of in-loop filtering, the method comprising: determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient of a chrominance component of the current block according to a chrominance component of the current block that has undergone ALF and a luma component of the current block that has not undergone ALF; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining a filtered chrominance component of the current block according to the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF; and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters.
[0008] In a second aspect, there is provided a method of in-loop filtering, the method comprising: Decode a total number of cross-component ALF filters and an index of a target filter from the bitstream, the target filter being an ALF filter adopted for a chrominance component of a current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; determining a target filtering coefficient of a chrominance component of the current block according to a chrominance component of the current block that has undergone ALF and a luma component of the current block that has not undergone ALF; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining a filtered chrominance component of the current block based on the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF.
[0009] In a third aspect, there is provided an apparatus for in-loop filtering, the apparatus comprising: a memory for storing a code; Executing the code stored in the memory, determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient of a chrominance component of the current block according to a chrominance component of the current block that has undergone ALF and a luma component of the current block that has not undergone ALF; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining a filtered chrominance component of the current block according to the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF; and a processor for encoding the total number of the cross-component ALF filters based on the filtered chrominance components of the current block, and encoding the total number of the cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the cross-component ALF filters.
[0010] In a fourth aspect, there is provided an apparatus for in-loop filtering, the apparatus comprising: a memory for storing a code; Executing the code stored in the memory, Decode a total number of cross-component ALF filters and an index of a target filter from the bitstream, the target filter being an ALF filter adopted for a chrominance component of a current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; determining a target filtering coefficient of a chrominance component of the current block according to a chrominance component of the current block that has undergone ALF and a luma component of the current block that has not undergone ALF; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; and determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF.
[0011] The technical method of the embodiments of the present application improves the encoding / decoding performance by optimizing the encoding scheme in the encoding / decoding in-loop filtering process. [Brief description of the drawings]
[0012] [Figure 1] FIG. 1 is a block diagram of a technical solution using an embodiment of the present application. [Diagram 2] 1 is a schematic diagram of a video coding frame according to an embodiment of the present application; [Diagram 3] FIG. 2 is a schematic diagram of a video decoding frame according to an embodiment of the present application; [Figure 4] FIG. 2 is a schematic diagram of a Wiener filter according to an embodiment of the present application. [Figure 5a] FIG. 1 is a schematic diagram of an ALF filter according to an embodiment of the present application. [Figure 5b] FIG. 13 is a schematic diagram of another ALF filter according to another embodiment of the present application. [Figure 6] 1 is a schematic flow chart of a method for in-loop filtering in an embodiment of the present application; [Figure 7] FIG. 2 is a schematic diagram showing the shape of a CC-ALF filter according to an embodiment of the present application. [Figure 8] 4 is a schematic flowchart of a method for in-loop filtering in another embodiment of the present application; [Figure 9] 4 is a schematic flowchart of a method for in-loop filtering in another embodiment of the present application; [Figure 10] 4 is a schematic flow chart of an apparatus for in-loop filtering in another embodiment of the present application; [Figure 11] 4 is a schematic flow chart of an apparatus for in-loop filtering in another embodiment of the present application; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0013] The technical solutions in the embodiments of the present application are described below with reference to the drawings.
[0014] The embodiments of the present application can be applied to standard or non-standard image or video encoders, for example encoders of the VVC standard.
[0015] It will be understood that the specific examples in this specification are intended to aid those skilled in the art in better understanding the embodiments of the present application, and are not intended to limit the scope of the embodiments of the present application.
[0016] Furthermore, it should be understood that the formulas in the embodiments of the present application are merely illustrative and do not limit the scope of the embodiments of the present application, and that each formula can be modified, and these modifications also fall within the scope of protection of the present application.
[0017] Furthermore, in each embodiment of the present application, the size of the numbers of each process does not indicate the order of execution, and the execution order of each process is determined by its function and inherent logic, and it should be understood that this does not impose any limitations on the implementation process of the embodiments of the present application.
[0018] Furthermore, it is to be understood that the various embodiments described herein can be practiced alone or in combination, and that this application is not limited in this respect.
[0019] Unless otherwise stated, all technical and scientific terms used in the examples of this application have the same meaning as commonly understood by those skilled in the art of this application. The technical terms used in the specification of this application are only for the purpose of describing specific examples and are not intended to limit the scope of this application. The term "at least one" as used in this application includes any combination of one or more of the associated listed items.
[0020] FIG. 1 is a block diagram of a technical solution using an embodiment of the present application.
[0021] As shown in FIG. 1, the system 100 can receive data to be processed 102, process the data to be processed 102, and generate processed data 108. For example, the system 100 can receive data to be encoded, encode the data to be encoded, and generate encoded data, or the system 100 can receive data to be decoded, and decode the data to be decoded, and generate decoded data. In some embodiments, the components in the system 100 can be implemented by one or more processors, which may be a processor in a computer facility or a processor in a mobile facility (e.g., a drone). The processor may be any type of processor, and the embodiments of the present invention are not limited thereto. In some possible designs, the processor may include an encoder, a decoder, or a coder-decoder. The system 100 can further include one or more memories. The memory can store commands and data, such as computer-executable commands for implementing the technical solutions of the embodiments of the present invention, the data to be processed 102, and the processed data 108. The memory may be any type of memory, and the embodiments of the present invention are not limited thereto.
[0022] The data to be encoded may include documents, images, graphic objects, video sequences, audio, video, or any other data that needs to be encoded. In some situations, the data to be encoded may include sensing data from a sensor, which may be a visual sensor (e.g., camera, infrared sensor), microphone, close-range sensor (e.g., ultrasonic sensor, radar), position sensor, temperature sensor, touch sensor, etc. In some situations, the data to be encoded may include information from a user, for example, bio-information, which may include facial features, fingerprint scans, retina scans, voice recordings, DNA samples, etc.
[0023] FIG2 is a schematic diagram of a video coding frame 2 according to an embodiment of the present application. As shown in FIG2, after receiving a video to be coded, each frame in the video to be coded is coded sequentially starting from the first frame of the video to be coded. Here, the currently coded frame mainly undergoes processes such as prediction, transformation, quantization, and entropy coding, and finally outputs a bitstream of the currently coded frame. Correspondingly, the decoding process generally follows the reverse process of the above process to decode the received bitstream and recover the video frame information before decoding.
[0024] Specifically, as shown in Fig. 2, the video coding frame 2 has a coding control module 201 for determining control operations and selecting parameters in the coding process. For example, as shown in Fig. 2, the coding control module 201 controls parameters used in transform, quantization, dequantization, and inverse transform, controls the selection of intraframe or interframe mode, and controls parameters of motion prediction and filters, and the control parameters of the coding control module 201 are also input into the entropy coding module to be coded and formed as a part of the coded bitstream.
[0025] Starting with the current frame to be coded, the frame to be coded is divided 202, specifically, firstly divided into slices and then divided into blocks. Optionally, in one example, the frame to be coded is divided into a plurality of non-overlapping maximum coding tree units (CTUs), and each CTU is further divided into a series of smaller coding units (CUs) iteratively according to a quadtree, binary tree, or ternary tree scheme, respectively. In some examples, a CU may further have a prediction unit (PU) and a transform unit (TU) associated therewith, where a PU is a basic unit of prediction, and a TU is a basic unit of transformation and quantization. In some examples, a PU and a TU are each obtained by dividing a PU into one or more blocks based on a CU, where a PU has a plurality of prediction blocks (PBs) and associated syntax elements. In some examples, a PU and a TU may be the same or may be obtained by different division schemes according to a CU. In some examples, at least two of the CU, PU, and TU are the same, for example, the CU, PU, and TU are not distinguished, and prediction, quantization, and transformation are all performed on the CU as a unit. For ease of explanation, hereinafter, the CTU, CU, or other formed data unit is referred to as a coding block.
[0026] It should be understood that in the embodiments of the present application, the data targeted by the video coding may be a frame, a slice, a coding tree unit, a coding unit, a coding block, or any group thereof. In different embodiments, the size of the data unit may vary.
[0027] Specifically, as shown in Fig. 2, a frame to be coded is divided into a number of coding blocks, and then a prediction process is performed to remove spatial and temporal redundant information of a currently coded frame. Currently, relatively commonly used predictive coding methods include intraframe prediction and interframe prediction. Intraframe prediction is to predict a currently coded block using only reconstructed information in a current frame image, while interframe prediction is to predict a currently coded block using information in other previously reconstructed frame images (also called reference frames). Specifically, in the embodiment of the present application, the coding control module 201 is for determining the selection of intraframe prediction or interframe prediction.
[0028] When the intra prediction mode is selected, the intra prediction 203 process obtains the reconstructed block of the coded neighboring block around the current coding block as a reference block, and based on the pixel value of the reference block, adopts a prediction mode method to calculate a predicted value to generate a predicted block, and subtracts the corresponding pixel value of the current coding block and the predicted block to obtain the residual of the current coding block, which is transformed 204, quantized 205, and entropy coded 210 to form the bit stream of the current coding block. Furthermore, all the coding blocks of the current coding target frame form a part of the coding bit stream of the coding target frame after going through the above coding process. In addition, the control and parameter data generated in the intra prediction 203 are also coded by entropy coding 210 to form a part of the coding bit stream.
[0029] Specifically, the transform 204 is for removing correlation of residuals of image blocks, thereby improving coding efficiency. The transform of residual data of the current coding block is usually performed by adopting Discrete Cosine Transform (DCT) or Discrete Sine Transform (DST). For example, the coding side multiplies the residual information of the coding target block by an N×M transform matrix and its transpose matrix, respectively, and obtains the transform coefficients of the current coding block after multiplication.
[0030] After generating the transform coefficients, the transform coefficients are quantized to further improve compression efficiency, and the transform coefficients are quantized to obtain quantized coefficients, which are then entropy coded to obtain a residual bitstream of the current coding block, where the entropy coding method includes, but is not limited to, Context Adaptive Binary Arithmetic Coding (CABAC) entropy coding.
[0031] Specifically, the coded neighboring block in the intra prediction 203 process is a coded neighboring block before coding the current coding block, and is a reconstructed block obtained by adding the residual generated in the coding process of the neighboring block to the predicted block of the neighboring block after transforming 204, quantizing 205, inverse quantizing 206, and inverse transforming 207. Correspondingly, the inverse quantization 206 and inverse transform 207 are the inverse processes of the quantization 206 and transforming 204, and are for recovering the residual data before quantization and transformation.
[0032] As shown in FIG. 2, when the inter-frame prediction mode is selected, the inter-frame prediction process includes motion prediction 208 and motion compensation 209. Specifically, motion prediction 208 is performed based on a reference image in a reconstructed image frame, and an image block that is most similar to the current coding block is searched for in one or more reference frame images based on a certain matching criterion, and the image block is determined as a matching block, and the relative shift between the matching block and the current coding block is the motion vector (Motion Vector, MV) of the current coding target block. After performing motion prediction on all coding blocks in the coding target frame, motion compensation 209 is performed on the current coding target frame based on the motion vector and the reference frame to obtain a prediction value of the current coding target frame. The original value of the coding target frame pixel is subtracted from the corresponding prediction value to obtain a residual of the coding target frame. The residual of the current coding target frame is transformed 204, quantized 205, and entropy coded 210, and then forms a part of the coding bit stream of the coding target frame. In addition, the control and parameter data generated in the motion compensated prediction 209 is also encoded by the entropy coding 210 and forms part of the encoded bitstream.
[0033] Here, as shown in FIG. 2, the reconstructed video frame is a video frame obtained after filtering 211. The filtering 211 is for reducing compression distortions such as block effects and ringing effects generated in the encoding process. In the encoding process, the reconstructed video frame is for providing a reference frame for inter-frame prediction, and in the decoding process, the reconstructed video frame is output as a final decoded video after post-processing. In an embodiment of the present application, the filtering 211 includes at least one filtering technique of deblocking DB filtering, sample adaptive offset SAO filtering, adaptive loop filter ALF, and cross-component ALF (CC-ALF). In the example, the ALF is provided after at least one of DB and SAO. In the example, the luminance component before ALF is filtered to the chrominance component after ALF. The filtering parameters in the filtering 211 process are also transmitted to the entropy coding and coded to form a part in the coded bitstream.
[0034] FIG. 3 is a schematic diagram of a video decoding frame 3 according to another embodiment of the present application. As shown in FIG. 3, video decoding performs operation steps corresponding to video coding. First, use entropy coding 301 to obtain one or more data information of residual data, prediction syntax, intraframe prediction syntax, motion compensation syntax, and filtering syntax in the coded bitstream. Here, the residual data is inverse quantized 302 and inverse transformed 303 to obtain original residual data information. In addition, determine whether intraframe prediction or interframe prediction is used for the current decoded block according to the prediction syntax. If it is intraframe prediction 304, use the reconstructed image block in the current frame to construct prediction information according to the intraframe prediction manner according to the intraframe prediction syntax obtained by decoding. If it is interframe prediction, determine a reference block in the reconstructed image according to the motion compensation syntax obtained by decoding to obtain prediction information. Then, combine the prediction information and the residual information, and obtain a reconstructed video frame through a filtering 311 operation, and obtain a decoded video after the reconstructed video frame is post-processed 306.
[0035] Specifically, in the embodiment of the present application, the filtering 311 may be the same as the filtering 211 in Fig. 2, and includes at least one of DB filtering, sample adaptive offset SAO filtering, adaptive loop filter ALF, and cross-component ALF (CC-ALF). Here, the filtering parameters and control parameters in the filtering 311 may be obtained by entropy decoding the encoded bitstream, and filtering is performed according to the obtained filtering parameters and control parameters.
[0036] In the example, the DB filtering is for processing the pixels at the edge of the prediction unit PU and the transformation unit TU, and the low-pass filter obtained by training performs nonlinear weighting of the edge pixels, thereby reducing the blocking effect. In the example, the SAO filtering is for classifying the pixel values in the coding block in the frame image as a unit, and adding compensation values to each type of pixel, and different coding blocks adopt different filtering formats, and different types of pixel compensation values in different coding blocks are different, so that the reconstructed frame image is closer to the original frame image and ringing effect is avoided. In the example, the ALF filtering is a Wiener filtering process, and based on the principle of Wiener filtering, the filtering coefficient is calculated and filtered, and the Mean-square Error (MSE) between the reconstructed frame image and the original frame image is mainly minimized, thereby further improving the image quality of the reconstructed frame, improving the accuracy of motion prediction and motion compensation, and effectively improving the coding efficiency of the entire coding system. However, the ALF filtering is highly complex and time-consuming to calculate, and has certain defects in the actual application process.
[0037] For ease of understanding, an example of the ALF filtering process will now be described in light of Figs. 4, 5a and 5b.
[0038] Calculation principle of ALF filtering coefficients First, the calculation method of the ALF filtering coefficient is described based on the Wiener filtering principle. As shown in Figure 4, the pixel signal in the original coding frame of the current coding is X, the reconstructed pixel signal after coding, DB filtering and SAO filtering is Y, and the noise or distortion introduced by Y in this process is e. After the reconstructed pixel signal is filtered by the filtering coefficient f in Wiener filtering, the ALF reconstructed signal is
number
number
number
[0039] Alternatively, in a possible embodiment, a filter consisting of a set of ALF filtering coefficients has 13 filtering coefficients symmetrically distributed C0 to C12, with a filter length L of 7, as shown in Figures 5a and 5b, or has 7 filtering coefficients symmetrically distributed C0 to C6, with a filter length L of 5. Alternatively, the filter shown in Figure 5a, also called a 7*7 filter, is applied to the coding frame luma component, and the filter shown in Figure 5b, also called a 5*5 filter, is applied to the coding frame chroma component.
[0040] In the embodiments of the present application, the filter consisting of the ALF filtering coefficients may further be other types of filters, such as a symmetrically distributed filter type with a filter length of 9, and it should be understood that the embodiments of the present application are not limited thereto.
[0041] Alternatively, in the linear ALF filtering process, for a pixel point to be filtered in the reconstructed image frame, the filtered result of the current point is obtained by weighted average of surrounding pixel points, that is, the corresponding pixel point in the ALF reconstructed image frame. Specifically, the pixel point I(x,y) in the reconstructed image frame is the pixel point to be filtered currently, (x,y) is the position coordinate of the pixel point to be filtered currently in the encoding frame, the filtering coefficient of the filter center corresponds thereto, and the other filtering coefficients in the filter correspond to the pixel points surrounding I(x,y) one by one, the filtering coefficient value in the filter is the weight, and the filtering coefficient value in the filter is multiplied by the corresponding pixel point and the average value obtained is the filtered pixel value O(x,y) of the current pixel point to be filtered I(x,y), and the specific formula is as follows:
number
[0042] According to this method, each pixel point in the reconstructed image frame is filtered sequentially to obtain a filtered ALF reconstructed image frame.
[0043] Alternatively, in a possible embodiment, the filtering coefficients w(i,j) of the filter are integers between [-1,1).
[0044] Alternatively, in a possible embodiment, the filtering coefficient w(i,j) of the filter is extended by 128 times and then truncated to obtain w'(i,j), where w'(i,j) is an integer between [-128,128). Specifically, the extended w'(i,j) is encoded and transmitted, and the hardware encoding / decoding is easy to realize, and the calculation formula for filtering using the extended w'(i,j) to obtain O(x,y) is as follows:
number
[0045] Alternatively, in other nonlinear ALF filtering processes, a filter is not directly used as the weight, but a weighted average of multiple pixel points is used to obtain the filtered result. A nonlinear parameter element is introduced to optimize the filtering effect. Specifically, the calculation formula for filtering I(x,y) to calculate O'(x,y) by using nonlinear ALF filtering is as follows:
number
number
[0046] Specifically, in the k(d,b)clip operation, k(i,j) represents the in-loop filtering ALF modified clip parameter, hereinafter referred to as modified parameter or clip parameter, and each filtering coefficient w(i,j) corresponds to a parameter of one clip. For the coding frame luminance component, the clip parameter is selected from {1024, 181, 32, 6}, and for the coding frame chrominance component, the clip parameter is selected from {1024, 161, 25, 4}, and an index corresponding to each clip parameter, that is, a modified (clip) index parameter, needs to be written into the bitstream. When the clip parameter is 1024, the clip index parameter 0 is written into the bitstream, and for the same reason, when it is 181, 1 is written into the bitstream. Therefore, it can be seen that the clip index parameters of the coding frame luminance classification and the coding frame chrominance classification are all integers between 0 and 3.
[0047] Pixel classification and division Secondly, a set of corresponding ALF filtering coefficients is calculated for each pixel point, which is very complex and time-consuming. Moreover, writing all the ALF coefficients for each pixel point into the bitstream will incur a huge expense. Therefore, it is necessary to classify and divide the pixel points in the reconstructed image, and each type of pixel point adopts the same set of ALF filtering coefficients (a type of filter), thus reducing the computational complexity and improving the coding efficiency.
[0048] There may be multiple pixel classification methods to choose from. For example, only the luminance Y component of a pixel may be classified, and the color UV component may not be classified. For example, the luminance Y component may be divided into 25, and the color UV component may not be divided, resulting in only one type. In other words, for one frame image, the encoded frame of the luminance Y component can correspond to a maximum of 25 sets of filters, and the encoded frame of the color UV component corresponds to one set of filters.
[0049] In the embodiment of the present application, the pixel type may be a type corresponding to the luminance Y component, but the embodiment of the present application is not limited thereto, and it is understood that the pixel type may be a type corresponding to other components or all components. For ease of explanation, the following will classify and divide the coded frame of the luminance Y component, and take ALF filtering as an example.
[0050] Optionally, in a possible embodiment, the reconstructed image frame after DB filtering and SAO filtering is divided into a number of 4*4 pixel blocks, and the 4*4 blocks are classified.
[0051] For example, each 4*4 block can be classified into Laplace directions.
number
[0052] C represents the type to which the pixel block belongs; D is the Laplace direction;
number
number
[0053] The calculation method of method D is as follows. First, calculate the Laplace gradients of the current 4*4 block in different directions. The calculation formula is as follows:
number
[0054] R(k,l) is the reconstructed pixel value located at position (k,l) in the 4*4 block. Vk,l represents the Laplacian gradient in the vertical direction of the pixel point located at the (k,l) coordinate in the 4*4 block. H k,l represents the horizontal Laplacian gradient of the pixel point located at coordinate (k,l) in the 4*4 block. k,l D2 represents the 135 degree Laplacian gradient of the pixel point located at the (k,l) coordinate in the 4*4 block. k、l represents the 45 degree Laplacian gradient of the pixel point located at the (k,l) coordinate in the 4*4 block.
[0055] Correspondingly, the calculated g v represents the Laplace gradient in the vertical direction of the current 4*4 block. g h represents the horizontal Laplace gradient of the current 4*4 block. g d1 represents the Laplace gradient of the current 4*4 block in the 135 degree direction. g d2 represents the Laplace gradient in the 45 degree direction of the current 4*4 block.
[0056] Then, the direction D is determined based on the extreme value ratio of the Laplace gradients of the four directions. The specific calculation formula is as follows:
number
number
number
number
number
number
[0057] Alternatively, in a possible embodiment,
number
number
[0058] Quantize A to get an integer between 0 and 4,
number
[0059] Therefore, taking the values of D and A together, the value range of C is an integer between 0 and 24, and in the embodiment of the present application, at most, 4*4 blocks in one frame image are divided into 25 types.
[0060] Alternatively, in a possible embodiment, in a coding frame, there are N types of 4*4 blocks, and each type of 4*4 block has a set of ALF filtering coefficients, where N is an integer between 1 and 25.
[0061] In the embodiments of the present application, the entire frame image can be divided into multiple 4*4 blocks, or can be divided into blocks of other pixel sizes, for example, multiple 8*8 or 16*16 sized blocks, and it should be understood that the embodiments of the present application are not limited thereto.
[0062] Furthermore, in the embodiments of the present application, in addition to classification based on the Laplace direction described above, other classification methods can also be adopted to classify blocks, and it should be understood that the embodiments of the present application are not limited thereto.
[0063] Furthermore, in the examples of the present application, the number of classifications can be any other number besides 25, and it is understood that the examples of the present application are not limited thereto.
[0064] Block-Based ALF Filtering ALF filtering can be divided into frame-based ALF, block-based ALF, and quadtree-based ALF. Here, frame-based ALF employs a set of filtering coefficients to filter the entire frame. Block-based ALF divides an encoding frame into image blocks of the same size, and judges whether to perform ALF filtering for the image blocks. Quadtree-based ALF divides an encoding frame into image blocks of different sizes based on a quadtree division method, and judges whether to perform ALF filtering. Here, frame-based ALF is simple to calculate, but has poor filtering effect. Meanwhile, quadtree-based ALF has high calculation complexity. Therefore, in some standards or technologies, for example, in the latest VVC standard under consideration for creation, its reference software VTM adopts block-based ALF.
[0065] Take block-based ALF in VTM as an example. In VTM, a coding frame has a frame-level ALF filtering marker bit and a block-level ALF filtering marker bit. Optionally, this block level can be a CTU, a CU or other division scheme image block, but the embodiment of the present application is not limited thereto, and for ease of explanation, the following takes the CTU-level ALF filtering marker bit as an example.
[0066] Specifically, if the frame-level ALF filtering marker bit identifies that ALF filtering is not performed, the CTU-level ALF filtering marker bit in the coded frame is not identified, and if the frame-level ALF filtering marker bit identifies that ALF filtering is performed, the CTU-level ALF filtering marker bit in the coded frame is identified to indicate whether the current CTU performs ALF filtering.
[0067] Optionally, the encoding frame includes Z CTUs, and the manner of calculating N sets of ALF filtering coefficients in the encoding frame is as follows: Regarding whether Z CTUs in the encoding frame are ALF filtered and combined, for each type of combination manner, N sets of ALF filtering coefficients in this manner and a rate-distortion cost (RD Cost) of the encoding frame are calculated and obtained. Here, the calculation manner of the i-th set of ALF filtering coefficients in each set of ALF filtering coefficients is as follows: In the combination manner of the current CTU, f is calculated for the i-th type pixels in the CTU that performs ALF filtering, and f is not calculated for the i-th type pixels in the other CTUs that do not perform ALF filtering, and the i-th set of ALF coefficients in the current combination manner are calculated and obtained. It should be understood that in different combination manners, the calculated N sets of ALF filtering coefficients may be different from each other.
[0068] The RD Costs of multiple combinations are compared, and the combination method with the smallest RD Cost is determined as the final combination method, and the N sets of ALF filtering coefficients calculated using the different combination methods are the ALF filtering coefficients with the best adaptability.
[0069] If the combination scheme with the smallest RD cost is to ALF filter at least one CTU among the Z CTUs, then the frame-level ALF marker bit of the coding frame identifies that ALF filtering is to be performed, and the ALF marker bits at the CTU level sequentially identify whether ALF filtering is to be performed in the CTU data. For example, when the marker bit identifies as 0, it indicates that ALF filtering is not to be performed, and when the marker bit identifies as 1, it indicates that ALF filtering is to be performed.
[0070] In particular, if the combination scheme with the smallest RD cost is to not ALF filter any of the Z CTUs, then the coding frame does not undergo ALF filtering, and the frame-level ALF marker bit of the coding frame indicates that ALF filtering is not performed, and the ALF marker bit at the CTU level does not indicate this.
[0071] It should be understood that the ALF in the embodiments of the present application not only applies to the VVC standard, but also to other ALF technical solutions or standards based on blocks.
[0072] Cross-Component ALF (CC-ALF) In the example, CC-ALF is for adjusting chrominance components using the value of luma component to improve the quality of chrominance components. For easy understanding, an example of CC-ALF and ALF process will be described below with reference to FIG. 6. A current block has a luma component and a chrominance component, where the chrominance component has a first chrominance component (e.g., Cb in FIG. 6) and a second chrominance component (e.g., Cr in FIG. 6).
[0073] The luma component is filtered sequentially by SAO and ALF. The first chroma component is filtered sequentially by SAO and ALF. The second chroma component is filtered sequentially by SAO and ALF. In addition, a CC-ALF filter is further adopted to perform CC-ALF on the chroma components.
[0074] In the example, the shape of the CC-ALF filter can be as shown in Figure 7. This CC-ALF filter adopts a 3x4 diamond shape, with a total of eight coefficients. The location of label 2 in the figure is the current pixel point of the first or second chromaticity component, and the weighted average of the surrounding seven points is used to obtain the filtered result of the pixel point of the location of intermediate label 2.
[0075] A single frame image may have a total of multiple sets of filters, where the first chromaticity component and the second chromaticity component may be filtered by selecting the same or different target filters from the same set of CC-ALF filters, or may be filtered by selecting target filters from different sets of CC-ALF filters.
[0076] The total number of CC-ALF filters used for the current image needs to be written into the bitstream, where the total number of CC-ALF filters can include at least one of the total number of CC-ALF filters of the first chrominance component and the total number of CC-ALF filters of the second chrominance component. In the situation where the total number of CC-ALF filters of the first chrominance component and the total number of CC-ALF filters of the second chrominance component are the same, or the first chrominance component and the second chrominance component can select target filters from the same set of CC-ALF filters, only one total number of CC-ALF filters can be used to indicate.
[0077] For the current block, further code an index of the target filter selected for the current block into the bitstream. In a situation where the indexes of the target filters selected by the first chrominance component and the second chrominance component are the same or different, the indexes of the target filters of the two chrominance components can be coded into the bitstream respectively. Or, in a situation where the indexes of the target filters selected by the first chrominance component and the second chrominance component are the same, only one index can be coded into the bitstream, which index is for indicating the target filters of the two chrominance components.
[0078] Next, we will provide a more specific interpretation based on Figure 6.
[0079] Specifically, for a first chrominance component, a target filter for the first chrominance component of the current block is determined from a plurality of CC-ALF filters, and a target filtering coefficient for the first chrominance component is determined based on a luma component that has not been subjected to ALF (e.g., after SAO, but not ALF) and the first chrominance component of the current block that has been subjected to ALF. The first chrominance component is filtered based on the target filter for the first chrominance component and the target filtering coefficient. Then, a filtering result for the first chrominance component is determined based on the first chrominance component filtered by the target filter and the target filtering coefficient, and the first chrominance component after being subjected to ALF (e.g., after being subjected to SAO and ALF in sequence).
[0080] For a second chrominance component, a target filter of the second chrominance component of the current block is determined from the multiple CC-ALF filters, and a target filtering coefficient of the second chrominance component is determined based on the luma component that has not been subjected to ALF (e.g., after SAO, not subjected to ALF) and the second chrominance component of the current block that has been subjected to ALF. The second chrominance component is filtered based on the target filter of the second chrominance component and the target filtering coefficient. Then, a filtering result of the second chrominance component is determined based on the second chrominance component filtered by the target filter and the target filtering coefficient, and the second chrominance component after being subjected to ALF (e.g., after being subjected to SAO and ALF in sequence).
[0081] When encoding the current block, the total number of multiple CC-ALF filters is encoded into the bitstream as a syntax element, and the index of the target filter selected for the first chrominance component of the current block and the index of the target filter selected for the second chrominance component are encoded into the bitstream as syntax elements.
[0082] In an example, in a bitstream of one frame image, there is only one syntax element for indicating the total number of multiple CC-ALF filters. In an example, the syntax element for indicating the total number of multiple CC-ALF filters is located in an adaptation parameter set syntax of the image. In an example, the syntax element for indicating the total number of multiple cross-component ALF filters is not present in at least one of a picture header and a slice header.
[0083] In an example, a syntax element for indicating a total quantity of a plurality of CC-ALF filters can be encoded using a truncated binary encoding. In an example, a syntax element for indicating a total quantity of a plurality of CC-ALF filters can be encoded using a truncated binary encoding. In an example, an index of the target filter can be encoded using a truncated binary encoding.
[0084] For the current block, further encode the target filtering coefficients of the first chrominance component and the target filtering coefficients of the second chrominance component of the current block into the bitstream.
[0085] After receiving the bitstream, the decoding side decodes the index of the target filter selected for the current chrominance component and the total number of CC-ALF filters from the bitstream, and determines the CC-ALF filter of the chrominance component of the current block according to the index and the total number. The decoding side further decodes the target filtering coefficient of the chrominance component of the current block from the bitstream, and filters the chrominance component that has passed through the ALF of the current block according to the target filter and the target filtering coefficient.
[0086] The technical solutions of the embodiments of the present application can be used on the encoding side and the decoding side. The following describes the technical solutions of the embodiments of the present application from the encoding side and the decoding side respectively.
[0087] 8 shows a schematic flow chart of a method 200 of in-loop filtering according to an embodiment of the present application. The method 200 can be performed by the encoding side, for example, by the system 100 shown in FIG. 1 during the encoding operation.
[0088] S210, determining a target filter for a chrominance component of a current block from a plurality of cross-component adaptive loop filters ALF filters.
[0089] S220, determining a target filtering coefficient of the chrominance component of the current block according to the chrominance component that has undergone ALF and the luma component that has not undergone ALF of the current block.
[0090] S230 filters the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients.
[0091] S240, determining a filtered chrominance component of the current block according to the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF.
[0092] S250, encoding based on the filtered chrominance components of the current block, and encoding a total number of the plurality of cross-component ALF filters as a syntax element, where only one syntax element is included in the bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters.
[0093] Optionally, a syntax element for indicating a total quantity of the plurality of cross-component ALF filters is located within an Adaptation parameter set syntax for the image.
[0094] Optionally, a syntax element for indicating a total quantity of the plurality of cross-component ALF filters is not present in at least one of an image header and a slice header.
[0095] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.
[0096] Optionally, the non-ALF luminance component of the current block specifically refers to the non-ALF luminance component of the current block after SAO.
[0097] Optionally, encoding the total quantity of the plurality of cross-component ALF filters as a syntax element includes encoding the total quantity of the plurality of cross-component ALF filters employing a truncated binary encoding.
[0098] Optionally, the method further comprises encoding an index of the target filter as a syntax element.
[0099] Optionally, encoding the target filter index as a syntax element includes encoding the target filter index employing a truncated binary encoding.
[0100] Optionally, the method further comprises encoding target filtering coefficients for chrominance components of the current block into a bitstream.
[0101] 9 shows a schematic flow chart of the method 200 of in-loop filtering in an embodiment of the present application. The method 300 can be performed by the encoding side, for example, when the system 100 shown in FIG. 1 performs the encoding operation.
[0102] S310, decoding a total number of cross-component ALF filters and an index of a target filter from the bitstream, the target filter being an ALF filter adopted for a chrominance component of a current block, where only one syntax element is included for indicating the total number of cross-component ALF filters in a bitstream of one frame image.
[0103] S320, decoding target filtering coefficients of chrominance components of the current block from a bitstream, the target filtering coefficients being coefficients in the target filter.
[0104] S330 cross-component filters the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients.
[0105] S340, determining a filtered chrominance component of the current block according to the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF.
[0106] Optionally, a syntax element for indicating the total number of cross-component ALF filters is located within the adaptation parameter set syntax for the image.
[0107] Optionally, a syntax element for indicating the total number of cross-component ALF filters is not present in at least one of the image header and the slice header.
[0108] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.
[0109] Optionally, the non-ALF luminance component of the current block specifically refers to the non-ALF luminance component of the current block after SAO.
[0110] Optionally, decoding the total number of cross-component ALF filters and the target filter indexes from the bitstream includes decoding at least one of the total number of cross-component ALF filters and the target filter indexes employing truncated binary encoding.
[0111] FIG. 10 is a schematic frame diagram of another encoding side in-loop filtering apparatus 30 in an embodiment of the present application, which is an in-loop filtering apparatus on the video encoding side, and optionally, the in-loop filtering apparatus 20 can correspond to the in-loop filtering method 100.
[0112] As shown in FIG. 10, the in-loop filtering device 30 includes a processor 31 and a memory 32. The memory 32 can be used to store a program, and the processor 31 executes the program stored in the memory to: determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient of a chrominance component of the current block according to a chrominance component of the current block that has undergone ALF and a luma component of the current block that has not undergone ALF; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining a filtered chrominance component of the current block according to the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF; and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters.
[0113] A syntax element for indicating the total number of the multiple cross-component ALF filters is located in the adaptation parameter set syntax of the image.
[0114] Optionally, a syntax element for indicating a total quantity of the plurality of cross-component ALF filters is not present in at least one of an image header and a slice header.
[0115] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.
[0116] Optionally, the non-ALF luminance component of the current block specifically refers to the non-ALF luminance component of the current block after SAO.
[0117] Optionally, encoding a total number of the plurality of cross-component ALF filters as a syntax element includes: and encoding a total quantity of the plurality of cross-component ALF filters using truncated binary encoding.
[0118] Optionally, the processor further comprises: and for encoding the index of the target filter as a syntax element.
[0119] Optionally, encoding the index of the target filter as a syntax element comprises: and encoding the target filter index using truncated binary encoding.
[0120] It shall be understood that the apparatus embodiments correspond to the method embodiments mutually, and similar descriptions may refer to the method embodiments.
[0121] 11 is a schematic frame diagram based on the apparatus 40 for in-loop filtering at the decoding side of an embodiment of the present application. Optionally, the apparatus 40 for in-loop filtering can correspond to the method 200 for in-loop filtering.
[0122] As shown in FIG. 11, the in-loop filtering device 40 includes a processor 41 and a memory 42. The memory 42 can be used to store a program, and the processor 41 executes the program stored in the memory to: Decode a total number of cross-component ALF filters and an index of a target filter from the bitstream, the target filter being an ALF filter adopted for a chrominance component of a current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; Decoding target filtering coefficients of chrominance components of the current block from a bitstream, the target filtering coefficients being coefficients in the target filter; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; and determining the filtered chrominance components of the current block based on the chrominance components after filtering by the target filtering coefficients and the chrominance components of the current block after ALF.
[0123] Optionally, a syntax element for indicating the total number of cross-component ALF filters is located within the adaptation parameter set syntax for the image.
[0124] Optionally, a syntax element for indicating the total number of cross-component ALF filters is not present in at least one of the image header and the slice header.
[0125] Optionally, the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence.
[0126] Optionally, the non-ALF luminance component of the current block specifically refers to the non-ALF luminance component of the current block after SAO.
[0127] Optionally, decoding a total number of cross-component ALF filters and a target filter index from the bitstream includes: employing truncated binary encoding to decode at least one of the total number of the cross-component ALF filters and the index of the target filter.
[0128] An embodiment of the present application further provides an electronic device, which may include the in-loop filtering apparatus of each embodiment of the present application described above.
[0129] It should be understood that the processor in the embodiments of the present application may be an integrated circuit chip and has the ability to process signals. In the process of realization, each step of the above-mentioned method embodiments can be completed by a hardware integrated logic circuit in the processor or a command in the form of software. The above-mentioned processor includes, but is not limited to, a general-purpose processor, a CPU, a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component. Each method, step, and logic block diagram disclosed in the embodiments of the present application can be realized or executed. The general-purpose processor may be a microprocessor, or the processor may be any ordinary processor, etc. In accordance with the steps of the method disclosed in the embodiments of the present application, they can be directly embodied as a hardware decoder processor to complete the execution, or can be completed by a combination of hardware and software modules in the decoder processor to complete the execution. The software module may be located in a storage medium known in the art, such as a random memory, a flash memory, a read-only memory, a programmable read-only memory, or an electrically erasable programmable memory, a register, etc. The storage medium is located in the memory, and the processor reads the information in the memory and combines the hardware to complete the steps of the above-mentioned method.
[0130] It can be understood that the memory of the embodiments of the present application can be a volatile memory or a non-volatile memory, or can include both volatile and non-volatile memory. Here, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), or a flash memory. The volatile memory can be a random access memory (RAM) and is used as an external high-speed buffer memory. By way of example and not limitation, many forms of RAM may be used, such as static RAM (SRAM), dynamic random access memory (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchlink DRAM (SLDRAM), and direct rambus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein includes, but is not limited to, these and any other suitable types of memory.
[0131] An embodiment of the present application further provides a computer-readable storage medium storing one or more programs, the one or more programs having commands that, when executed on a portable electronic device including a plurality of application programs, can cause the portable electronic device to perform the method of the embodiment shown in Figures 6 to 11.
[0132] An embodiment of the present application further provides a computer program, which has instructions, when the computer program is executed on a computer, causing the computer to perform the method of the embodiment shown in FIGS.
[0133] An embodiment of the present application further provides a chip having input / output ports, at least one processor, at least one memory, and a bus, the at least one memory for storing commands, and the at least one processor for executing the methods of the embodiments shown in Figures 6 to 11 by invoking the commands in the at least one memory.
[0134] Those skilled in the art can recognize that each exemplary unit and algorithm step described in the embodiments disclosed herein can be realized by electronic hardware or a combination of computer software and electronic hardware. Whether these functions are finally implemented in a hardware or software manner is determined by the specific application of the technical solution and design constraints. Those skilled in the art can realize the described functions by using different methods for each specific application, but such realization should not be recognized as going beyond the scope of this application.
[0135] Those skilled in the art can clearly understand that for ease of explanation and simplicity, the specific operating processes of the systems, devices, and units described above can refer to the corresponding processes in the aforementioned method embodiments, and will not be described here.
[0136] In the multiple embodiments provided by the present application, it is to be understood that the disclosed system, device, and method can be realized in other ways. For example, the device embodiment described above is merely exemplary. For example, the division of the units is merely a division of logic functions, and in actual implementation, there may be other division ways, for example, multiple units or components can be combined or integrated into other systems, or some features can be omitted or not implemented. In addition, the coupling or direct coupling or communication connection between each other shown or discussed may be by some interfaces, and the indirect coupling or communication connection of the devices or units may be electrical, mechanical, or other forms.
[0137] The units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, i.e., they may be located in one place or distributed among multiple network units, among which some or all of the units may be selected to achieve the objective of the solution of the present embodiment according to the actual needs.
[0138] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, each unit may exist physically alone, or two or more units may be integrated into one unit.
[0139] When the functions are realized in the form of a software functional unit and sold or used as an independent product, they can be stored in one computer-readable storage medium. Based on this understanding, the technical solution of the present application essentially or the part that contributes to the prior art or a part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium and has a number of commands for making a computer device (which may be a personal computer, a server, or a network device, etc.) execute all or part of the steps of the method described in each embodiment of the present application. Meanwhile, the aforementioned storage medium includes various media capable of storing program code, such as a USB memory, a portable hard disk, a read only memory (ROM), a random access memory (RAM), a magnetic disk, or an optical disk.
[0140] The above are only specific embodiments of the present application, and the scope of protection of the present application is not limited thereto, and any person skilled in the art can easily think of modifications or replacements within the technical scope disclosed by the present application, which are all within the scope of protection of the present application. Therefore, the scope of protection of the present application shall be based on the scope of protection of the claims. [Item 1] 1. A method of in-loop filtering comprising: determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient of a chrominance component of the current block according to a chrominance component of the current block that has undergone ALF and a luma component of the current block that has not undergone ALF; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining a filtered chrominance component of the current block according to the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF; and encoding the total number of the plurality of cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the plurality of cross-component ALF filters. [Item 2] 2. The method of in-loop filtering according to item 1, wherein a syntax element for indicating a total quantity of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax of the image. [Item 3] 3. The method of in-loop filtering according to item 1 or 2, wherein a syntax element for indicating a total number of the plurality of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 4] The method according to item 1, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence. [Item 5] 2. The method according to item 1, wherein the luminance component of the current block that has not undergone ALF is specifically a luminance component of the current block that has not undergone ALF after undergoing SAO. [Item 6] Encoding a total number of the plurality of cross-component ALF filters as a syntax element includes: 2. The method of claim 1, comprising employing truncated binary encoding to encode a total quantity of the plurality of cross-component ALF filters. [Item 7] The method comprises: Item 10. The method of item 1, further comprising encoding the index of the target filter as a syntax element. [Item 8] encoding an index of the target filter as a syntax element, 8. The method of claim 7, comprising encoding the target filter index using truncated binary encoding. [Item 9] 1. A method of in-loop filtering comprising: Decode a total number of cross-component ALF filters and an index of a target filter from the bitstream, the target filter being an ALF filter adopted for a chrominance component of a current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; Decoding target filtering coefficients of chrominance components of the current block from a bitstream, the target filtering coefficients being coefficients in the target filter; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF. [Item 10] 10. The method of in-loop filtering according to item 9, wherein a syntax element for indicating the total number of cross-component ALF filters is located in an adaptation parameter set syntax for the image. [Item 11] 11. The method of in-loop filtering according to item 9 or 10, wherein a syntax element for indicating a total number of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 12] 10. The method according to item 9, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence. [Item 13] 10. The method according to item 9, wherein the luminance component of the current block that has not undergone ALF is specifically a luminance component of the current block that has not undergone ALF after undergoing SAO. [Item 14] Decoding a total number of cross-component ALF filters and an index of a target filter from the bitstream includes: 10. The method of claim 9, comprising employing truncated binary encoding to decode at least one of the total number of cross-component ALF filters and the index of the target filter. [Item 15] 1. An apparatus for in-loop filtering, comprising: a memory for storing a code; Executing the code stored in the memory, determining a target filter for a chrominance component of the current block from a plurality of cross-component adaptive loop filters (ALF filters); determining a target filtering coefficient of a chrominance component of the current block according to a chrominance component of the current block that has undergone ALF and a luma component of the current block that has not undergone ALF; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining a filtered chrominance component of the current block according to the chrominance component filtered by the target filtering coefficient and the chrominance component of the current block after ALF; and encoding the total number of the cross-component ALF filters as a syntax element, wherein only one syntax element is included in a bitstream of one frame image to indicate the total number of the cross-component ALF filters. [Item 16] Item 16. The in-loop filtering apparatus according to item 15, wherein a syntax element for indicating a total quantity of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax for the image. [Item 17] 17. The apparatus for in-loop filtering according to item 15 or 16, wherein a syntax element for indicating a total number of the plurality of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 18] Item 16. The device according to item 15, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence. [Item 19] Item 16. The device according to item 15, wherein the luminance component of the current block that has not undergone ALF is specifically a luminance component of the current block that has not undergone ALF after undergoing SAO. [Item 20] Encoding a total number of the plurality of cross-component ALF filters as a syntax element includes: Item 16. The apparatus of item 15, further comprising: encoding a total quantity of the plurality of cross-component ALF filters using truncated binary encoding. [Item 21] The processor further comprises: Item 16. The apparatus according to item 15, for encoding the index of the target filter as a syntax element. [Item 22] encoding an index of the target filter as a syntax element, 22. The apparatus of claim 21, further comprising encoding the target filter index using truncated binary encoding. [Item 23] 1. An apparatus for in-loop filtering, comprising: a memory for storing a code; Executing the code stored in the memory, Decode a total number of cross-component ALF filters and an index of a target filter from the bitstream, the target filter being an ALF filter adopted for a chrominance component of a current block, where only one syntax element is included in the bitstream of one frame image to indicate the total number of cross-component ALF filters; Decoding target filtering coefficients of chrominance components of the current block from a bitstream, the target filtering coefficients being coefficients in the target filter; filtering the ALF-processed chrominance components of the current block based on the target filter and the target filtering coefficients; determining filtered chrominance components of the current block based on the chrominance components filtered by the target filtering coefficients and the chrominance components of the current block after ALF. [Item 24] 24. The apparatus for in-loop filtering according to item 23, wherein a syntax element for indicating the total number of the cross-component ALF filters is located in an adaptation parameter set syntax for the image. [Item 25] 25. The apparatus for in-loop filtering according to item 23 or 24, wherein a syntax element for indicating the total number of cross-component ALF filters is not present in at least one of an image header and a slice header. [Item 26] Item 24. The device according to item 23, wherein the chrominance components of the current block that have undergone ALF are specifically chrominance components of the current block that have undergone sample adaptive offset (SAO) and ALF in sequence. [Item 27] 24. The apparatus according to item 23, wherein the luminance component of the current block that has not undergone ALF is specifically a luminance component of the current block that has not undergone ALF after undergoing SAO. [Item 28] Decoding a total number of cross-component ALF filters and an index of a target filter from the bitstream includes: 24. The apparatus of claim 23, further comprising employing truncated binary encoding to decode at least one of the total number of cross-component ALF filters and the index of the target filter.
Claims
1. determining a target cross-component adaptive loop filtering (ALF) filter for a chrominance component of a current block of an image from a plurality of cross-component ALF filters; determining target cross-component ALF filter coefficients for the chrominance components of the current block based on the chrominance components that have undergone ALF and a luma component of the current block that has not undergone ALF; filtering the chrominance components that have undergone ALF based on the target cross-component ALF filter and the target cross-component ALF filter coefficients; determining a filtered chrominance component of the current block according to the chrominance component filtered by the target cross-component ALF filter coefficient and the chrominance component after passing through the ALF, where a weighted average of seven pixels around a pixel of the chrominance component of the current block is used to obtain a filtered result of the pixel of the chrominance component of the current block; encoding the filtered chrominance components of the current block, and encoding the filtered chrominance components of the current block using a total number of the plurality of cross-component ALF filters, an index of the target cross-component ALF filter, and the target cross-component ALF filter as syntax elements.
2. 2. The video processing method of claim 1, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax for the image, but is not present in at least one of a picture header and a slice header.
3. The moving image processing method according to claim 1 , wherein the chrominance components that have undergone ALF are the chrominance components that have undergone sample adaptive offset (SAO) filtering and ALF in sequence.
4. The moving image processing method according to claim 1 , wherein the luminance component that has not been subjected to ALF is the luminance component that has not been subjected to ALF after being subjected to Sample Adaptive Offset (SAO).
5. encoding the total number of the plurality of cross-component ALF filters using a syntax element, 2. The method of claim 1, comprising encoding the total number of the plurality of cross-component ALF filters using a truncated binary code.
6. encoding the index of the target cross-component ALF filter using a syntax element, The method of claim 1 , further comprising encoding the index of the target cross-component ALF filter using a truncated binary code.
7. The video processing method of claim 1 , wherein a 3×4 diamond is used in the target cross-component ALF filter.
8. Decoding a total number of a plurality of cross-component adaptive loop filtering (ALF) filters from the stream and an index of a target cross-component ALF filter, the target cross-component ALF filter being a cross-component ALF filter to be adopted for a chrominance component of a current block of an image; Decoding a target cross-component ALF filter coefficient for the chrominance component of the current block from the stream, the target cross-component ALF filter coefficient being a coefficient in the target cross-component ALF filter and being determined on an encoding side based on the chrominance component that has been subjected to ALF and the luminance component of the current block that has not been subjected to ALF; filtering the chrominance components that have undergone ALF based on the target cross-component ALF filter and the target cross-component ALF filter coefficients; determining a filtered chrominance component of the current block based on the chrominance component after filtering by the target cross-component ALF filter coefficient and the chrominance component after ALF, wherein a weighted average of seven pixels surrounding a pixel of the chrominance component of the current block is used to obtain a filtered result of the pixel of the chrominance component of the current block.
9. 9. The video processing method of claim 8, wherein a syntax element for indicating the total number of the plurality of cross-component ALF filters is located in an adaptation parameter set syntax for the image, but is not present in at least one of a picture header and a slice header.
10. determining a target cross-component adaptive loop filtering (ALF) filter for a chrominance component of a current block of an image from a plurality of cross-component ALF filters; determining target cross-component ALF filter coefficients for the chrominance components of the current block based on the chrominance components that have undergone ALF and a luma component of the current block that has not undergone ALF; filtering the chrominance components that have undergone ALF based on the target cross-component ALF filter and the target cross-component ALF filter coefficients; determining a filtered chrominance component of the current block according to the chrominance component filtered by the target cross-component ALF filter coefficient and the chrominance component after passing through the ALF, where a weighted average of seven pixels around a pixel of the chrominance component of the current block is used to obtain a filtered result of the pixel of the chrominance component of the current block; and encoding the filtered chrominance components of the current block, and generating a stream by using a total number of the plurality of cross-component ALF filters, an index of the target cross-component ALF filter, and the target cross-component ALF filter as syntax elements.
