Loop filtering method and device

The filter coefficients and correction index parameters of the loop filter are encoded and decoded by non-differential coding and non-exponential Golomb coding, which solves the problem of high ALF calculation complexity and improves the encoding and decoding efficiency of video coding.

CN115604488BActive Publication Date: 2025-09-23PEKING UNIV +1
View PDF 1 Cites 0 Cited by

Patent Information

Application Number
CN202211195062.3
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2019-06-25
Publication Date
2025-09-23
Estimated Expiration
2039-06-25

AI Technical Summary

Technical Problem

Existing loop filters such as ALF have high computational complexity and are time-consuming in video coding, which affects coding efficiency.

Method used

Non-differential coding and non-exponential Golomb coding are used to encode and decode the filter coefficients and correction index parameters of the loop filter. The calculation complexity is reduced by selecting the filter parameters of the luminance and chrominance components of the image frame.

Benefits of technology

The computational complexity of loop filtering is reduced, the encoding and decoding performance is improved, and the computational speed is accelerated.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115604488B_ABST
    Figure CN115604488B_ABST
Patent Text Reader

Abstract

A method and apparatus for loop filtering are provided, which reduce the computational complexity of loop filtering, accelerate the computational speed, and improve the encoding and decoding performance by optimizing the encoding method in the encoding and decoding loop filtering process. A method for loop filtering includes: determining multiple sets of filter coefficients for loop filtering; and encoding the multiple sets of filter coefficients using a non-differential encoding method. Another method for loop filtering includes: determining correction index parameters for loop filtering; and encoding the correction index parameters using a non-exponential Golomb encoding method. A method for loop filtering is also provided, including: determining loop filtering correction parameters for the luminance component and loop filtering correction parameters for the chrominance component of an image frame; wherein the loop filtering correction parameters for the luminance component and the loop filtering correction parameters for the chrominance component are parameters selected from the same parameter list.
Need to check novelty before this filing date? Find Prior Art

Description

[0001] This application is a divisional application of the PCT invention patent application with application number No. 201980010538.1 and invention name “Method and Device for Loop Filtering”, which was submitted to the International Bureau on June 25, 2019 and to the State Intellectual Property Office on August 4, 2020.

[0002] Copyright Notice

[0003] The disclosure of this patent document contains material that is subject to copyright protection. The copyright is reserved by the copyright owner. The copyright owner has no objection to the facsimile reproduction by anyone of the patent document or the patent disclosure, as it appears in the official records and files of the Patent and Trademark Office. Technical Field

[0004] The present invention relates to the technical field of digital video coding, and more particularly, to a method and device for loop filtering. Background Art

[0005] Currently, video data needs to be encoded and compressed to reduce the bandwidth consumed by video storage and transmission. Commonly used coding technologies include block partitioning, prediction, transform, quantization, and entropy coding, forming a hybrid video coding framework. Based on this hybrid video coding framework, video codec technology standards have gradually emerged after decades of development. Currently, mainstream video codec standards include the international video coding standards H.264 / MPEG-AVC and H.265 / MEPG-HEVC, the domestic audio and video coding standard AVS2, and the currently under-development international standard H.266 / VVC and the domestic standard AVS3.

[0006] During the encoding process of block partitioning, prediction, transformation, quantization, and entropy coding, compression artifacts such as blocking and ringing artifacts can appear in the decoded and reconstructed video due to quantization. Furthermore, in inter-frame prediction mode, compression artifacts in the reconstructed video can affect the encoding quality of subsequent images. Therefore, to reduce compression artifacts, in-loop filtering technology is introduced into the codec architecture to improve the quality of the current decoded image and provide high-quality reference images for subsequent encoding, thereby enhancing compression efficiency.

[0007] In the Versatile Video Coding (VVC) standard and some High Efficiency Video Coding (HEVC) standards currently under development, loop filters include a deblocking filter (DBF), an adaptive sample offset (SAO), and an adaptive loop filter (ALF). Based on the principles of the Wiener filter, the ALF calculates adaptive filter coefficients based on the different pixels in the image and performs filtering. While the ALF can achieve good filtering effects and improve coding efficiency, it is highly complex and computationally time-consuming, resulting in certain drawbacks in practical applications. Summary of the Invention

[0008] The present invention provides a loop filtering method and device, which can reduce the complexity of loop filtering and shorten the operation time compared with the prior art.

[0009] In a first aspect, a method for loop filtering is provided, comprising: determining a plurality of groups of filter coefficients for loop filtering; and encoding the plurality of groups of filter coefficients using a non-differential coding method.

[0010] In a second aspect, a method for loop filtering is provided, comprising: obtaining a code stream for loop filtering; decoding indication information indicating the number of filter coefficient groups in the code stream to determine that the filter coefficients are multiple groups; and decoding the filter coefficient code stream in the code stream using a non-differential decoding method to obtain multiple groups of filter coefficients.

[0011] In a third aspect, a method for loop filtering is provided, comprising: determining a modified index parameter for loop filtering; and encoding the modified index parameter using a non-exponential Golomb coding method.

[0012] In a fourth aspect, a method for loop filtering is provided, comprising: obtaining a code stream for loop filtering; decoding a code stream of a correction index parameter in the code stream using a non-exponential Golomb decoding method to obtain a correction index parameter for loop filtering.

[0013] In a fifth aspect, a method for nonlinear loop filtering is provided, including: determining loop filtering correction parameters of the luminance component and the loop filtering correction parameters of the chrominance component of an image frame; the loop filtering correction parameters of the luminance component and the loop filtering correction parameters of the chrominance component are parameters selected from the same parameter list.

[0014] In a sixth aspect, a loop filtering device is provided, comprising: a processor, wherein the processor is configured to: determine multiple groups of filter coefficients for loop filtering; and encode the multiple groups of filter coefficients using a non-differential encoding method.

[0015] In the seventh aspect, a device for loop filtering is provided, comprising: a processor, wherein the processor is used to: obtain a code stream for loop filtering; decode indication information indicating the number of filter coefficient groups in the code stream to determine that the filter coefficients are multiple groups; and use a non-differential decoding method to decode the filter coefficient code stream in the code stream to obtain multiple groups of filter coefficients.

[0016] In an eighth aspect, a loop filtering apparatus is provided, comprising: a processor, wherein the processor is configured to: determine a modified index parameter of the loop filtering; and encode the modified index parameter using a non-exponential Golomb coding method.

[0017] In a ninth aspect, a loop filtering device is provided, comprising: a processor, the processor being configured to: obtain a code stream for loop filtering; and decode a code stream of a correction index parameter in the code stream using a non-exponential Golomb decoding method to obtain a correction index parameter for loop filtering.

[0018] In the tenth aspect, a device for nonlinear loop filtering is provided, comprising: a processor, wherein the processor is used to determine loop filtering correction parameters of a luminance component and a chrominance component of an image frame; the loop filtering correction parameters of the luminance component and the loop filtering correction parameters of the chrominance component are parameters selected from the same parameter list.

[0019] The technical method of the embodiment of the present application reduces the computational complexity of loop filtering, speeds up the calculation speed, and improves the encoding and decoding performance by optimizing the encoding method in the encoding and decoding loop filtering process. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 It is an architectural diagram of the technical solution of the embodiment of the present application.

[0021] Figure 2 2 is a schematic diagram of a video encoding framework according to an embodiment of the present application.

[0022] Figure 3 2 is a schematic diagram of a video decoding framework according to an embodiment of the present application.

[0023] Figure 4 Schematic diagram of a Wiener filter according to an embodiment of the present application.

[0024] Figure 5a Schematic diagram of an ALF filter according to an embodiment of the present application.

[0025] Figure 5b is a schematic diagram of another ALF filter according to an embodiment of the present application.

[0026] Figure 6 It is a schematic flow chart of a loop filtering method according to an embodiment of the present application.

[0027] Figure 7 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0028] Figure 8 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0029] Figure 9 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0030] Figure 10 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0031] Figure 11 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0032] Figure 12 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0033] Figure 13 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0034] Figure 14 It is a schematic flowchart of a loop filtering method according to another embodiment of the present application.

[0035] Figure 15 It is a schematic block diagram of a loop filtering device according to an embodiment of the present application.

[0036] Figure 16 It is a schematic block diagram of a loop filtering device according to another embodiment of the present application.

[0037] Figure 17 It is a schematic block diagram of a loop filtering device according to another embodiment of the present application.

[0038] Figure 18 It is a schematic block diagram of a loop filtering device according to another embodiment of the present application.

[0039] Figure 19 It is a schematic block diagram of a nonlinear loop filtering device according to an embodiment of the present application. DETAILED DESCRIPTION

[0040] The technical solutions in the embodiments of the present application will be described below with reference to the accompanying drawings.

[0041] The embodiments of the present application may be applicable to standard or non-standard image or video encoders, for example, encoders of the VVC standard.

[0042] It should be understood that the specific examples in this article are only intended to help those skilled in the art better understand the embodiments of the present application, and are not intended to limit the scope of the embodiments of the present application.

[0043] It should also be understood that the formulas in the embodiments of the present application are merely examples and do not limit the scope of the embodiments of the present application. The formulas can be modified, and these modifications should also fall within the scope of protection of the present application.

[0044] It should also be understood that in the various embodiments of the present application, the size of the serial number of each process does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.

[0045] It should also be understood that the various implementation methods described in this specification can be implemented individually or in combination, and the embodiments of the present application are not limited to this.

[0046] Unless otherwise indicated, all technical and scientific terms used in the embodiments of this application have the same meaning as those commonly understood by those skilled in the art in the art of this application. The terms used in this application are only for the purpose of describing specific embodiments and are not intended to limit the scope of this application. The term "and / or" used in this application includes any and all combinations of one or more related listed items.

[0047] Figure 1 It is an architectural diagram of the technical solution of the embodiment of the present application.

[0048] like Figure 1As shown, system 100 can receive data to be processed 102, process the data to be processed 102, and generate processed data 108. For example, system 100 can receive data to be encoded and encode the data to generate encoded data, or system 100 can receive data to be decoded and decode the data to generate decoded data. In some embodiments, the components of system 100 can be implemented by one or more processors, which can be a processor in a computing device or a processor in a mobile device (e.g., a drone). The processor can be any type of processor, and the embodiments of the present invention are not limited in this regard. In some possible designs, the processor can include an encoder, a decoder, or a codec. System 100 can also include one or more memories. The memories can be used to store instructions and data, such as computer-executable instructions for implementing the technical solutions of the embodiments of the present invention, data to be processed 102, and processed data 108. The memories can be any type of memory, and the embodiments of the present invention are not limited in this regard.

[0049] The data to be encoded may include text, images, graphic objects, animation sequences, audio, video, or any other data that needs to be encoded. In some cases, the data to be encoded may include sensory data from a sensor, which may be a visual sensor (e.g., a camera, an infrared sensor), a microphone, a near-field sensor (e.g., an ultrasonic sensor, a radar), a position sensor, a temperature sensor, a touch sensor, etc. In some cases, the data to be encoded may include information from a user, such as biometric information, which may include facial features, fingerprint scans, retinal scans, voice recordings, DNA samples, etc.

[0050] Figure 2 2 is a schematic diagram of a video coding framework according to an embodiment of the present application. Figure 2 As shown in the figure, after receiving the video to be encoded, each frame in the video to be encoded is encoded sequentially, starting from the first frame. The current encoded frame undergoes the following processes: prediction, transformation, quantization, and entropy coding, and finally outputs the bitstream of the current encoded frame. Correspondingly, the decoding process usually decodes the received bitstream in the reverse of the above process to recover the pre-decoded video frame information.

[0051] Specifically, if Figure 2 As shown, the video encoding framework 2 includes an encoding control module 201 for making decisions and controlling actions during the encoding process, as well as selecting parameters. Figure 2As shown, the coding control module 202 controls the parameters used in transformation, quantization, inverse quantization, and inverse transformation, controls the selection of intra-frame or inter-frame mode, and controls the parameters of motion estimation and filtering. The control parameters of the coding control module 202 will also be input into the entropy coding module for encoding to form a part of the encoded code stream.

[0052] When encoding begins for the current frame to be encoded, the frame is divided. Specifically, it is first divided into slices and then into blocks. Optionally, in one example, the frame to be encoded is divided into multiple non-overlapping largest coding tree units (CTUs). Each CTU can be iteratively divided into a series of smaller coding units (CUs) using a quadtree, binary tree, or ternary tree. In some examples, a CU can also contain associated prediction units (PUs) and transform units (TUs), where a PU is the basic unit of prediction and a TU is the basic unit of transform and quantization. In some examples, PUs and TUs are each derived from a CU divided into one or more blocks, where a PU contains multiple prediction blocks (PBs) and related syntax elements. In some examples, PUs and TUs can be the same, or derived from a CU using different partitioning methods. In some examples, at least two of the CUs, PUs, and TUs are the same. For example, no distinction is made between CUs, PUs, and TUs, and prediction, quantization, and transform are all performed on the CU. For the convenience of description, CTU, CU or other formed data units are referred to as coding blocks hereinafter.

[0053] It should be understood that in the embodiments of the present application, the data unit targeted by video coding can be a frame, a slice, a coding tree unit, a coding unit, a coding block, or a group of any of the above. In different embodiments, the size of the data unit can vary.

[0054] Specifically, if Figure 2 As shown, after the frame to be encoded is divided into multiple coding blocks, a prediction process is performed to remove the spatial and temporal redundant information of the current frame to be encoded. Currently, the more commonly used predictive coding methods include intra-frame prediction and inter-frame prediction. Intra-frame prediction only uses the reconstructed information in the current frame image to predict the current coding block, while inter-frame prediction uses the information in other previously reconstructed frame images (also known as reference frames) to predict the current coding block. Specifically, in this embodiment of the present application, the encoding control module 202 is used to decide whether to select intra-frame prediction or inter-frame prediction.

[0055] When the intra-frame prediction mode is selected, the intra-frame prediction process 203 includes obtaining a reconstructed block of the encoded adjacent blocks surrounding the current coding block as a reference block. Based on the pixel values ​​of the reference block, a prediction value is calculated using the prediction mode method to generate a prediction block. The corresponding pixel values ​​of the current coding block and the prediction block are subtracted to obtain the residual of the current coding block. The residual of the current coding block is transformed 204, quantized 205, and entropy encoded 210 to form the code stream of the current coding block. Furthermore, after all the coding blocks of the current frame to be encoded undergo the above encoding process, they form part of the encoded code stream of the frame to be encoded. In addition, the control and reference data generated in the intra-frame prediction 203 are also encoded through entropy coding 210 to form part of the encoded code stream.

[0056] Specifically, transformation 204 is used to remove the correlation of the residuals of the image block to improve coding efficiency. The transformation of the residual data of the current coding block generally uses a two-dimensional discrete cosine transform (DCT) and a two-dimensional discrete sine transform (DST). For example, at the encoding end, the residual information of the block to be coded is multiplied by an N×M transformation matrix and its transposed matrix respectively, and the transform coefficients of the current coding block are obtained after the multiplication.

[0057] After the transform coefficients are generated, quantization 205 is used to further improve compression efficiency. The transform coefficients can be quantized to obtain quantized coefficients, and then the quantized coefficients are entropy coded 210 to obtain a residual bit stream of the current coding block, wherein the entropy coding method includes but is not limited to Context Adaptive Binary Arithmetic Coding (CABAC) entropy coding.

[0058] Specifically, the coded adjacent block in the intra-frame prediction process 203 is the adjacent block that was coded before the current coding block was coded. The residual generated during the coding process of this adjacent block is transformed 204, quantized 205, inverse quantized 206, and inverse transformed 207, and then added to the predicted block of the adjacent block to obtain the reconstructed block. Correspondingly, inverse quantization 206 and inverse transform 207 are the inverse processes of quantization 206 and transform 204, used to recover the residual data before quantization and transformation.

[0059] like Figure 2As shown, when inter-frame prediction mode is selected, the inter-frame prediction process includes motion estimation 208 and motion compensation 209. Specifically, motion estimation 208 is performed based on the reference frame image in the reconstructed video frame. The image block most similar to the current coding block is searched for in one or more reference frames according to a certain matching criterion as a matching block. The relative displacement between the matching block and the current coding block is the motion vector (MV) of the current coding block. After motion estimation is performed on all coding blocks in the coding frame, motion compensation 209 is performed on the current coding frame based on the motion vector and the reference frame to obtain the predicted value of the current coding frame. The original value of the pixel in the coding frame is subtracted from the corresponding predicted value to obtain the residual of the coding frame. The residual of the current coding frame undergoes transformation 204, quantization 205, and entropy coding 210, forming part of the coded bitstream of the coding frame. In addition, the control and reference data generated by motion compensation 209 are also encoded through entropy coding 210 to form part of the coded bitstream.

[0060] Among them, such as Figure 2 As shown, the reconstructed video frame is obtained after filtering 211. Filtering 211 is used to reduce compression distortions such as blocking effects and ringing effects generated during the encoding process. The reconstructed video frame is used to provide a reference frame for inter-frame prediction during the encoding process. During the decoding process, the reconstructed video frame is output as the final decoded video after post-processing. In the embodiment of the present application, filtering 211 includes three filtering technologies: deblocking DB filtering 2111, adaptive sample value compensation offset SAO filtering 2112 and adaptive loop filtering ALF 2113, wherein ALF 2113 is arranged after DB 2111 and SAO 2112. The filtering parameters in the filtering process of filtering 211 are also transmitted to entropy coding for encoding, forming a part of the encoded bitstream.

[0061] Figure 3 3 is a schematic diagram of a video decoding framework according to an embodiment of the present application. Figure 3As shown, video decoding performs the same operational steps as video encoding. First, entropy decoding 301 is used to obtain one or more data information from the coded bitstream, including residual data, prediction syntax, intra-frame prediction syntax, motion compensation syntax, and filtering syntax. The residual data is then dequantized 302 and inverse transformed 303 to obtain the original residual data information. Furthermore, the prediction syntax is used to determine whether the current decoded block uses intra-frame prediction or inter-frame prediction. If intra-frame prediction is used 304, prediction information is constructed using the reconstructed image block in the current frame according to the decoded intra-frame prediction syntax. If inter-frame prediction is used, a reference block is determined in the reconstructed image according to the decoded motion compensation syntax to obtain prediction information. Next, the prediction information is superimposed on the residual information and filtered 311 to obtain a reconstructed video frame. The reconstructed video frame is then post-processed 306 to obtain the decoded video.

[0062] Specifically, in the embodiment of the present application, the filtering 311 can be Figure 2 The filtering 211 in FIG2 is the same as that in FIG2 , including a deblocking DB filter 3111, an adaptive sample value compensation offset SAO filter 3112, and an adaptive loop filter ALF 3113. The filtering parameters and control parameters in the filtering 311 can be obtained by entropy decoding the encoded bit stream, and three types of filtering are performed based on the obtained filtering parameters and control parameters.

[0063] Specifically, DB filtering is used to process pixels at the boundary of prediction unit PU and transform unit TU, and uses the trained low-pass filter to perform nonlinear weighting of boundary pixels, thereby reducing block effects. SAO filtering uses the coding block in the frame image as a unit, and is used to classify the pixel values ​​in the coding block and add compensation values ​​to each type of pixel. Different coding blocks use different filtering forms and the compensation values ​​of different types of pixels in different coding blocks are different, so that the reconstructed frame image is closer to the original frame image and avoids ringing effects. ALF filtering is a Wiener filtering process. According to the principle of Wiener filtering, the filter coefficient is calculated for filtering. It is mainly used to minimize the mean square error (MSE) between the reconstructed frame image and the original frame image, thereby further improving the image quality of the reconstructed frame, improving the accuracy of motion estimation and motion compensation, and effectively improving the coding efficiency of the entire coding system. However, at the same time, ALF filtering is highly complex and time-consuming to operate, and has certain defects in actual application.

[0064] For ease of understanding, the following Figure 4 、 Figure 5a and Figure 5b Describe the ALF filtering process in detail.

[0065] ALF filter coefficient calculation principle

[0066] First, according to the Wiener filtering principle, the calculation method of the ALF filter coefficient is explained, such as Figure 4 As shown, a pixel signal in the current encoded original frame is X, and the reconstructed pixel signal after encoding, DB filtering and SAO filtering is Y. The noise or distortion introduced by Y in this process is e. The reconstructed pixel signal is filtered by the filter coefficient f in the Wiener filter to form an ALF reconstructed signal The ALF reconstructs the signal The mean square error with the original pixel signal is minimized, and f is the ALF filter coefficient. Specifically, the calculation formula of f is as follows:

[0067]

[0068] Optionally, in a possible implementation, a filter composed of a set of ALF filter coefficients is as follows: Figure 5a and Figure 5b As shown, there are 13 filter coefficients C0 to C12 that are symmetrically distributed, and the filter length L is 7; or there are 7 filter coefficients C0 to C6 that are symmetrically distributed, and the filter length L is 5. Optionally, Figure 5a The filter shown is also called a 7*7 filter, which is suitable for encoding the brightness component of the frame. Figure 5b The filter shown is also called a 5*5 filter and is suitable for encoding the chrominance component of the frame.

[0069] It should be understood that in the embodiment of the present application, the filter composed of the ALF filter coefficients can also be a filter in other forms, such as a filter with a symmetrical distribution and a filter length of 9, and the embodiment of the present application does not limit this.

[0070] Optionally, in a linear ALF filtering process, for a pixel point to be filtered in a reconstructed image frame, a weighted average of the surrounding pixels is used to obtain the result after filtering of the current point, i.e., the corresponding pixel point in the ALF reconstructed image frame. Specifically, the pixel point I(x, y) in the reconstructed image frame is the current pixel point to be filtered, (x, y) is the position coordinate of the current pixel point to be filtered in the encoded frame, the filter coefficient at the center of the filter corresponds to it, and the other filter coefficients in the filter correspond one-to-one to the pixels around I(x, y). The filter coefficient value in the filter is the weight value. The filter coefficient value in the filter is multiplied by the corresponding pixel point and then added. The average value obtained is the pixel value O(x, y) after filtering of the current pixel point I(x, y). The specific calculation formula is as follows:

[0071]

[0072] Where w(i, j) represents any filter coefficient in the filter, (i, j) represents the relative position of the filter coefficient from the center point, i and j are both integers less than L / 2 and greater than -L / 2, where L is the length of the filter. For example, Figure 5a As shown in the filter in , the filter coefficient C12 at the center of the filter is expressed as w(0, 0), the filter coefficient C6 above C12 is expressed as w(0, 1), and the filter coefficient C11 to the right of C12 is expressed as w(1, 0).

[0073] In this way, each pixel in the reconstructed image frame is filtered in turn to obtain a filtered ALF reconstructed image frame.

[0074] Optionally, in a possible implementation manner, the filter coefficient w(i, j) of the filter is an integer between [-1, 1).

[0075] Optionally, in one possible implementation, the filter coefficient w(i, j) is amplified by 128 times and then rounded to obtain w'(i, j), where w'(i, j) is an integer between [-128, 128). Specifically, encoding and transmitting the amplified w'(i, j) is easy to implement in hardware encoding and decoding, and the calculation formula for filtering O(x, y) using the amplified w'(i, j) is as follows:

[0076]

[0077] Alternatively, in another nonlinear ALF filtering process, instead of directly using the filter as the weight, the weighted average of multiple pixels is used to obtain the filtered result. Instead, a nonlinear parameter factor is introduced to optimize the filtering effect. Specifically, the calculation formula for calculating O'(x, y) by filtering I(x, y) using a nonlinear ALF filter is as follows:

[0078]

[0079] The filter coefficient w(i, j) of the filter is an integer between [-1, 1]. K(d, b) is a clipping operation, K(d, b) = min(b, max(-b, d)).

[0080] Specifically, in the K(d, b) clip operation, k(i, j) represents the ALF correction clip parameter of the loop filter, hereinafter referred to as the correction parameter or clip parameter. Each filter coefficient w(i, j) corresponds to a clip parameter. For the coded frame luma component, a clip parameter is selected from {1024, 181, 32, 6}, and for the coded frame chroma component, a clip parameter is selected from {1024, 161, 25, 4}. The index corresponding to each clip parameter, i.e., the correction (clip) index parameter, needs to be written into the bitstream. If the clip parameter is 1024, the clip index parameter 0 must be written into the bitstream. Similarly, if it is 181, the clip index parameter 1 must be written into the bitstream. Therefore, it can be seen that the clip index parameters for the coded frame luma classification and the coded frame chroma classification are both integers between 0 and 3.

[0081] Pixel classification

[0082] Secondly, if a set of corresponding ALF filter coefficients is calculated for each pixel point, the computational complexity is large and time-consuming. In addition, if the ALF coefficients of each pixel point are written into the bitstream, it will incur huge overhead. Therefore, it is necessary to classify the pixels in the reconstructed image and use the same set of ALF filter coefficients (a filter) for each type of pixel point. This can reduce computational complexity and improve coding efficiency.

[0083] Optionally, pixel classification can be performed in a variety of ways. For example, only the luma Y component of a pixel can be classified, while the chroma UV components remain unclassified. For example, the luma Y component can be classified into 25 categories, while the chroma UV components remain unclassified, resulting in a single category. In other words, for a single image frame, the coded frame of the luma Y component can correspond to up to 25 filter groups, while the coded frame of the chroma UV components corresponds to one filter group.

[0084] It should be understood that in the embodiment of the present application, the pixel category may be a category corresponding to the luma Y component, but the embodiment of the present application is not limited to this. The pixel category may also be a category corresponding to other components or all components. For ease of description, the following description uses the classification and ALF filtering of the coded frame of the luma Y component as an example.

[0085] Optionally, in a possible implementation, the reconstructed image frame after DB filtering and SAO filtering is divided into a plurality of 4*4 pixel blocks, and the plurality of 4*4 pixel blocks are classified.

[0086] For example, each 4*4 block can be classified according to the Laplace direction:

[0087]

[0088] C represents the category to which the pixel block belongs. D is the Laplace direction. It is the result of detailed classification after direction D (Direction) classification. There are many ways to obtain , here only represents the results of sub-classification.

[0089] The calculation method of direction D is as follows. First, the Laplace gradient of the current 4*4 block in different directions is calculated. The calculation formula is:

[0090]

[0091]

[0092]

[0093]

[0094] Among them, i and j are the coordinates of the upper left pixel of the current 4*4 block.

[0095] R(k, l) represents the reconstructed pixel value at position (k, l) in the 4*4 block. k,l Represents the vertical Laplace gradient of the pixel at (k, l) in the 4*4 block. k,l Represents the horizontal Laplace gradient of the pixel at (k, l) in the 4*4 block. D1 k,l Represents the Laplace gradient of the pixel at (k, l) in the 4*4 block in the 135-degree direction. D2 k,l Represents the 45-degree Laplace gradient of the pixel at the (k, l) coordinate in the 4*4 block.

[0096] Correspondingly, the calculated g v Represents the Laplace gradient of the current 4*4 block in the vertical direction. g h Represents the Laplace gradient of the current 4*4 block in the horizontal direction. g d1 Represents the Laplace gradient of the current 4*4 block in the 135-degree direction. g d2 Represents the Laplace gradient of the current 4*4 block in the 45-degree direction.

[0097] Then, the direction D is determined based on the extreme value ratio of the Laplace gradient in the four directions. The specific calculation formula is as follows:

[0098]

[0099]

[0100]

[0101]

[0102] in, Represents the maximum value of the Laplace gradient in the horizontal and vertical directions. Represents the minimum value of the Laplace gradient in the horizontal and vertical directions. Represents the maximum value of the Laplace gradient value in the 45 and 135 directions. Represents the minimum value of the Laplace gradient value in the 45 and 135 directions. h,v Represents the ratio of the horizontal and vertical Laplace gradients. d0,d1 Represents the ratio of the Laplace gradient in the 45 and 135 directions.

[0103] if and D is set to 0.

[0104] if and D is set to 1.

[0105] if and D is set to 2.

[0106] if and D is set to 3.

[0107] if and D is set to 4.

[0108] t1 and t2 represent preset thresholds.

[0109] Optionally, in one possible implementation, The calculation method is as follows,

[0110]

[0111] Quantize A to get an integer between 0 and 4, and we get

[0112] Therefore, considering the values ​​of D and A, the value range of C is an integer between 0 and 24. In the embodiment of the present application, a 4*4 block in a frame of image is divided into 25 categories at most.

[0113] Optionally, in a possible implementation manner, there are N types of 4*4 blocks in the coded frame, and each type of 4*4 blocks has a set of ALF filter coefficients, where N is an integer between 1 and 25.

[0114] It should be understood that in the embodiment of the present application, in addition to being divided into multiple 4*4 blocks, the entire frame image can also be divided into blocks of other pixel sizes, for example, into multiple 8*8 or 16*16 blocks. The embodiment of the present application does not impose any restrictions on this.

[0115] It should also be understood that in the embodiment of the present application, in addition to the above classification based on the Laplace direction, other classification methods can also be used to classify blocks, and the embodiment of the present application does not limit this.

[0116] It should also be understood that in the embodiment of the present application, the number of categories can be classified into any other number besides 25, and the embodiment of the present application does not limit this.

[0117] Block-based ALF filtering

[0118] ALF filtering can be divided into frame-based ALF, block-based ALF, and quadtree-based ALF. Frame-based ALF uses a set of filter coefficients to filter the entire frame. Block-based ALF divides the coded frame into image blocks of equal size and determines whether to perform ALF filtering on each image block. Quadtree-based ALF divides the coded frame into image blocks of different sizes based on a quadtree partitioning method and determines whether to perform ALF filtering. Frame-based ALF is computationally simple but has poor filtering effects, while quadtree-based ALF is computationally complex. Therefore, in some standards or technologies, such as the recently developed VVC standard, its reference software VTM uses block-based ALF.

[0119] The block-based ALF in VTM is used as an example. In VTM, the coded frame has a frame-level ALF filter flag and a block-level ALF filter flag. Optionally, the block level can be a CTU, CU, or other image block division method. This embodiment of the application is not limited to this. For ease of description, the CTU-level ALF filter flag is used as an example below.

[0120] Specifically, when the frame-level ALF filtering flag indicates that ALF filtering is not performed, the CTU-level ALF filtering flag in the coded frame is not marked. When the frame-level ALF filtering flag indicates that ALF filtering is performed, the CTU-level ALF filtering flag in the coded frame is marked to indicate whether ALF filtering is performed on the current CTU.

[0121] Optionally, a coded frame includes Z CTUs, and a method for calculating N sets of ALF filter coefficients in the coded frame is as follows: combining whether or not ALF filtering is performed on the Z CTUs in the coded frame, and for each combination, calculating N sets of ALF filter coefficients and the rate-distortion cost (RD cost) of the coded frame under that combination. The i-th set of ALF filter coefficients in each set of ALF filter coefficients is calculated as follows: in the current CTU combination, f is calculated for the i-th type of pixels in the CTU that undergoes ALF filtering, while f is not calculated for the i-th type of pixels in other CTUs that do not undergo ALF filtering, thereby calculating the i-th set of ALF coefficients under the current combination. It should be understood that the N sets of ALF filter coefficients calculated under different combinations may be different.

[0122] The RD costs of multiple combinations are compared, and the combination with the lowest RD cost is determined as the final combination. The N groups of ALF filter coefficients calculated under this combination are the ALF filter coefficients with the best adaptability.

[0123] When the combination with the lowest RD Cost is one in which at least one of the Z CTUs undergoes ALF filtering, the frame-level ALF flag of the coded frame indicates that ALF filtering is performed. The CTU-level ALF flag, in turn, indicates whether ALF filtering is performed in the CTU data. For example, a flag of 0 indicates that ALF filtering is not performed, and a flag of 1 indicates that ALF filtering is performed.

[0124] In particular, when the combination with the lowest RD Cost is when none of the Z CTUs performs ALF filtering, the coded frame does not perform ALF filtering, and the frame-level ALF flag of the coded frame indicates that ALF filtering is not performed. In this case, the CTU-level ALF flag is not set.

[0125] It should be understood that the ALF in the embodiments of the present application is not only applicable to the VVC standard, but also applicable to other block-based ALF technical solutions or standards.

[0126] ALF filter coefficient coding decision

[0127] Optionally, after calculating N groups of ALF filter coefficients under the current CTU combination mode, ALF can decide whether to adopt coefficient merging and other technologies based on RDCost. Without affecting the quality of the reconstructed image frame, encoding based on the above technologies can further improve compression performance and reduce the number of bits required for the filter coefficients.

[0128] Optionally, the following three decisions are made for the N groups of ALF filter coefficients:

[0129] (1) Whether different ALF filter coefficients are merged;

[0130] (2) Whether the ALF filter coefficient is set to 0;

[0131] (3) ALF filter coefficients are encoded using a differential encoding method or a non-differential encoding method.

[0132] Specifically, merging different ALF filter coefficients means using the same ALF filter coefficients for different types of image blocks in the reconstructed frame. If certain types use the same filter coefficients, fewer filter coefficient values ​​can be transmitted in the bitstream, thereby improving coding efficiency.

[0133] Zeroing ALF filter coefficients: The reconstructed frame may contain some pixel types that are better without ALF filtering. In other words, the RD cost of not using ALF filtering is lower than that of using ALF filtering. In this case, the filter coefficients corresponding to these pixel types can be directly set to zero, or fewer filter coefficient values ​​can be transmitted in the bitstream, thereby improving coding efficiency.

[0134] Coding method: There are two encoding methods for ALF filter coefficients. The first non-differential encoding method is to directly write the filter coefficients into the bitstream. The other differential encoding method is to write the first set of filter coefficients into the bitstream, then write the result of subtracting the first set of coefficients from the second set into the bitstream, then write the result of subtracting the second set of coefficients from the third set into the bitstream, and so on.

[0135] Optionally, the decision on whether to merge the ALF filter coefficients, the decision on whether to set them to 0, and the decision on the encoding method are performed in sequence. The embodiment of the present application does not limit the order of the three decisions.

[0136] Optionally, in a preferred embodiment, a decision on whether to merge is made first, and then a decision on whether to set to 0 and an encoding method is made.

[0137] Specifically, in each decision, the RD Cost of the coded frame is calculated according to the current conditions, and the condition corresponding to the minimum RDCost is determined to obtain the decision result.

[0138] For example, first, when deciding whether to merge the ALF filter coefficients, different pixel categories are merged, and the merged pixel categories are calculated based on the Wiener filter principle to obtain multiple groups of merged filter coefficients. For example, there are N types of pixels in the coded frame, corresponding to N groups of initial filter coefficients, where N is a positive integer not greater than 25. Two or more groups of the N groups of pixel categories are combined to obtain new merged filter coefficients. For example, two groups of categories are combined into one category to obtain N-1 groups of categories, and then the filter coefficients of these categories are calculated to obtain N-1 filters.

[0139] Optionally, the N groups of initial filter coefficients are merged using different merging methods, and finally N different merged combinations are obtained. The i-th merged combination includes i groups of merged filter coefficients, wherein each group of merged filter coefficients corresponds to at least one group of initial filter coefficients, and i is a positive integer not greater than N.

[0140] Optionally, in an embodiment of the present application, a new merged filter coefficient is calculated for each merged combination. Under the merged combination form, it is judged whether the merged filter coefficients in multiple groups of merged filter coefficients are set to 0 and the encoding method.

[0141] Specifically, different selection methods are used to select one or more groups of combined filter coefficients from multiple groups of combined filter coefficients and set them to zero, or none of the combined filter coefficients are selected to set them to zero, thereby obtaining multiple different combinations of filter coefficients set to zero. RD Costs are then calculated for these different combinations of filter coefficients set to zero. A specific filter coefficient combination with the lowest RD Cost is calculated, along with multiple groups of filter coefficients set to zero and not set to zero under this combination.

[0142] Specifically, a first flag is used to indicate whether the filter coefficients are set to zero. If so, a second flag is used for each set of filter coefficients to indicate whether the set of filter coefficients is set to zero. When a set of filter coefficients is set to zero, ALF filtering is not performed on the pixel types corresponding to the set of filter coefficients. The flag indicates that the set of filter coefficients is set to zero, and the set of filter coefficients is no longer written into the bitstream. When a set of filter coefficients is not set to zero, ALF filtering is performed on the pixel types corresponding to the set of filter coefficients. The flag indicates that the set of filter coefficients is not set to zero. If the first flag indicates that the coefficients are not set to zero, the second flag is no longer passed.

[0143] Finally, based on the calculated RD Cost, a decision is made between differential encoding and non-differential encoding for multiple groups of filter coefficients that are not set to zero, and the encoding method with the minimum RD Cost is obtained. For example, if the calculated RD Cost is small under differential encoding, differential encoding is selected.

[0144] Under a merging combination, the minimum RD Cost is calculated to obtain the non-zero filter coefficients and differential / non-differential encoding methods for that merging combination. Based on this, the RD Costs of multiple merging combinations are compared to determine the specific merging combination that achieves the minimum RDCost, as well as the multiple sets of filter coefficients and clip parameters and other related filtering parameters under that combination.

[0145] After determining how to merge multiple groups of filter coefficients, whether to set them to 0, and the encoding method, during the encoding process, it is necessary to mark the filter coefficients corresponding to multiple pixel categories in sequence, which specific groups of filter coefficients are set to 0, and whether the differential or non-differential encoding method is used in the syntax flag. During the decoding process, the corresponding information is obtained by decoding the syntax flag, and then the corresponding decoding operation is performed.

[0146] Differential encoding is currently used to reduce the number of bits required to encode multiple filter coefficients and improve compression performance. Specifically, when there is regular variation between the ALF filter coefficients, for example, when the difference between two adjacent filter coefficients is smaller than that of one of the filter coefficients, the number of bits required for encoding can be reduced. However, when the difference between the two filter coefficients is larger than that of one of the filter coefficients, or when the values ​​of the two filter coefficients are irregular, differential encoding fails to reduce the number of bits required. In this case, non-differential encoding should be used to directly encode the filter coefficients.

[0147] In current ALF technology, there's no strong numerical regularity between multiple sets of filter coefficients, and filter coefficients can be negative or integer. This means the difference between two sets of filter coefficients can be partially or completely greater than the difference between any two sets of filter coefficients. Therefore, when choosing between differential and non-differential coding, the probability of choosing differential coding is very low. Furthermore, differential coding creates dependencies between filter coefficients. During decoding, if one coefficient experiences an error during transmission, all dependent coefficients will also experience errors, resulting in reduced filtered image quality.

[0148] At the same time, it is necessary to calculate the RD Cost to decide whether to use differential coding or non-differential coding. In the process of deciding whether to merge the filter coefficients and whether to set them to 0, there are many combination types involved. Each combination type needs to be decided by RD Cost calculation to determine whether the coding method is differential coding or non-differential coding. Therefore, the calculation amount of RD Cost is large, which affects the decision calculation time of the encoding end.

[0149] More importantly, if it is necessary to select a coding mode between differential coding and non-differential coding, syntax flags need to be used to convey coding mode information during the coding process, which increases the number of bits in the code stream and is not conducive to compression.

[0150] Therefore, the current ALF filter coefficient encoding method has redundancy and high complexity, which affects compression efficiency and running time. In view of this, the embodiment of the present application provides an improved technical solution.

[0151] The technical solution of the embodiment of the present application can be applied to both the encoding end and the decoding end. The technical solution of the embodiment of the present application is described below from the perspectives of the encoding end and the decoding end respectively.

[0152] Figure 6 FIG2 shows a schematic flow chart of a loop filtering method 200 according to an embodiment of the present application. The method 200 may be executed by an encoding end. For example, Figure 1 The illustrated system 100 is executed while performing an encoding operation.

[0153] S210: Determine multiple groups of filter coefficients for loop filtering.

[0154] Optionally, as mentioned above, the multiple groups of filter coefficients of the in-loop filter ALF are coefficient values ​​in a Wiener filter obtained according to the Wiener filtering principle that minimize the mean square error between the reconstructed image frame and the original encoded image frame.

[0155] Optionally, the filter can be of various shapes. For example, in the VVC standard, the luminance component of the coded frame is filtered as follows: Figure 5a The filter shown in FIG. 1 includes 13 filter coefficients, wherein the 13 filter coefficients constitute a set of filter coefficients. Figure 5b The filter shown includes 7 filter coefficients, wherein the 7 filter coefficients constitute a group of filter coefficients.

[0156] Optionally, during the ALF loop filtering process, pixels in the coded frame are classified. Different categories may have different ALF filter coefficients, and each category of pixels corresponds to a corresponding set of ALF filter coefficients for filtering calculation. For example, in the VVC standard, pixels in the coded frame can be divided into up to 25 categories, and the number of ALF coefficients obtained for loop filtering is N, where N is an integer less than or equal to 25.

[0157] Optionally, a block-based loop filtering approach is further employed to calculate the filter coefficients. As previously described, by controlling the block-level loop filtering switch, one or more sets of filter coefficients are calculated for different blocks. For example, in the VVC standard, the CTU level is used as the block-level control unit, and N sets of filter coefficients are calculated.

[0158] It should be understood that in the embodiment of the present application, the multiple sets of filter coefficients of the loop filter ALF can be the filter coefficients of the luminance component of the encoded frame, or the filter coefficients of the chrominance component of the encoded frame, and the embodiment of the present application does not limit this.

[0159] It should also be understood that in the embodiment of the present application, the multiple sets of filter coefficients of the loop filter can be loop filter coefficients obtained based on frame calculation, or loop filter coefficients obtained based on block calculation, or loop filter coefficients obtained based on quadtree calculation, and the embodiment of the present application does not limit this.

[0160] S220: Encode the multiple groups of filter coefficients using a non-differential encoding method.

[0161] As previously mentioned, when encoding multiple sets of filter coefficients, differential encoding may be used to reduce the number of bits used during encoding. However, differential encoding does not always reduce the number of bits, and in practical situations, differential encoding is rarely used. Furthermore, in some cases, such as when the difference between two sets of filter coefficients is greater than that of any of the previous sets of filter coefficients, differential encoding can increase the number of bits. Therefore, in the embodiments of the present application, non-differential encoding is used directly to encode the multiple sets of filter coefficients, which can improve encoding efficiency.

[0162] In addition, the non-differential coding method is used, and there is no dependency between multiple groups of filter coefficients, which can prevent errors in multiple groups of dependent filter coefficients during transmission, affecting the decoded image quality at the decoding end.

[0163] Optionally, the non-differential encoding method includes an exponential Golomb encoding method, a fixed-length encoding method, a unary code encoding method, and the like.

[0164] Preferably, in the embodiment of the present application, Exponential Golomb Coding is used to encode multiple groups of filter coefficients and then write them into the bitstream, which can achieve lossless compression of multiple groups of ALF filter coefficients.

[0165] Optionally, Figure 7 A schematic flowchart of a method 500 for encoding-side loop filtering according to another embodiment of the present application is shown.

[0166] The loop filtering method 300 includes:

[0167] S310: Determine multiple groups of filter coefficients for loop filtering.

[0168] S320: Do not select an encoding method for the multiple groups of filter coefficients.

[0169] S330: Encode the multiple groups of filter coefficients using a non-differential encoding method.

[0170] In the embodiment of the present application, steps S310 and S330 can be combined with Figure 6The steps S210 and S220 in FIG are the same. After the multiple sets of filter coefficients are determined, no encoding method is selected for the multiple sets of filter coefficients. The multiple sets of filter coefficients are directly encoded and written into the bitstream using a non-differential encoding method.

[0171] No encoding method is selected for multiple groups of filter coefficients, that is, the encoding end does not select the best one among multiple encoding methods through calculation and decision-making. In other words, the decision-making calculation process is avoided, computing resources and encoding time are saved, and the encoding speed is accelerated without affecting the encoding efficiency.

[0172] For example, in one possible method of selecting encoding methods for multiple sets of filter coefficients, the RD Cost of encoded frames under multiple encoding methods is calculated, and the minimum RD Cost is selected as the optimal encoding method. However, the embodiment of the present application does not perform the above RD Cost calculation and selection.

[0173] It should be understood that the selection of encoding methods for the multiple groups of filter coefficients includes but is not limited to the selection between differential encoding and non-differential encoding, and can also be the selection between multiple encoding methods such as a specific exponential Columbus encoding method, which is not limited in this embodiment of the present application.

[0174] Optionally, in the loop filtering method 200 and the loop filtering method 300, the syntax elements of the loop filtering do not include syntax elements indicating encoding methods of the multiple groups of filter coefficients.

[0175] If a coding method needs to be selected from multiple coding methods, at least one bit will be reserved in the coded syntax element to identify the coding method of the filter coefficient, and the syntax element identifying the coding method of the filter coefficient will be encoded and written into the bitstream.

[0176] Optionally, in a possible implementation manner, the syntax elements of the loop filtering do not include syntax elements indicating whether the encoding method of the multiple groups of filter coefficients is a differential encoding method or a non-differential encoding method.

[0177] For example, in the VVC standard, the "alf_luma_coeff_delta_prediction_flag" syntax flag is used to identify whether the encoding method of the filter coefficient of the loop filter ALF in the luminance component coding frame is differential coding or non-differential coding. Specifically, the syntax flag is an unsigned integer, occupying one bit. When alf_luma_coeff_delta_prediction_flag = 0, the ALF filter coefficient is encoded using non-differential coding. When alf_luma_coeff_delta_prediction_flag = 1, the ALF filter coefficient is encoded using differential coding.

[0178] However, in the embodiment of the present application, it is not necessary to decide between multiple encoding modes. Therefore, the encoding mode of the multiple sets of filter coefficients is not indicated in the syntax element of the loop filter. For example, in the VVC standard, the syntax element "alf_luma_coeff_delta_prediction_flag" is deleted to reduce the encoding by 1 bit and improve the encoding compression efficiency.

[0179] It should be understood that the syntax elements for loop filtering described in the embodiments of the present application may be syntax elements for coding the luma component of a frame, without indicating the encoding method for the multiple sets of filter coefficients for the luma component, or may be syntax elements for coding the chroma component of a frame, without indicating the encoding method for the multiple sets of filter coefficients for the chroma component. The embodiments of the present application are not limited to this.

[0180] It should also be understood that the embodiments of the present application can also be applied to other coding standards or coding technology solutions that use loop filtering ALF in addition to VVC, and the flag used to identify the filter coefficient encoding method of the loop filtering ALF is deleted in the syntax element.

[0181] Optionally, in the loop filtering method 200 and the loop filtering method 300, determining the multiple sets of filter coefficients for loop filtering in step S210 and step S310 may specifically include: merging and setting the multiple sets of initial filter coefficients to 0 to obtain the multiple sets of filter coefficients. Specifically, Figure 8 As shown, the loop filtering method 300 is taken as an example for description.

[0182] S311: merging filter coefficients in a plurality of groups of initial filter coefficients by adopting a plurality of merging and combining methods, and calculating to obtain a plurality of groups of merged filter coefficients in each of the plurality of merging and combining methods.

[0183] In an embodiment of the present application, the multiple groups of initial filter coefficients are multiple groups of initial filter coefficients corresponding to the pixel types calculated based on the Wiener filtering principle and the pixel types. Optionally, the initial filter coefficients can be multiple groups of initial filter coefficients calculated based on the CTU block, or multiple groups of initial filter coefficients calculated based on the frame or based on the quadtree. This process can refer to the aforementioned specific ALF filtering process and will not be repeated here.

[0184] For example, if the calculated pixel types are N, then the corresponding initial filter coefficients are N groups, that is, the i-th group of initial filter coefficients among the N groups of initial filter coefficients is used to filter the i-th type of pixels among the N types, where i is a positive integer less than or equal to N. Alternatively, in a possible implementation, N may be a positive integer not greater than 25.

[0185] At least two of the N groups of initial filter coefficients are merged into one group, and pixels corresponding to the at least two groups of initial filter coefficients are filtered using the merged filter coefficients. Optionally, the at least two groups of initial filter coefficients that are merged are adjacent filter coefficients. For example, in one possible combination, groups 1-3 of the 25 groups of initial filter coefficients are merged, groups 4-8 are merged, groups 9-15 are merged, and groups 16-25 are merged.

[0186] Optionally, N groups of filter coefficients are combined and preliminarily judged in different ways, and a total of V types of combined combinations are obtained. According to the Wiener filtering principle, multiple groups of combined filter coefficients under the V types of combined combinations are recalculated. Among them, the combined filter coefficients in the V types of combined combinations are K1~K y Group, K1~K v are all positive integers less than or equal to N, K1~K v Each set of combined filter coefficients in the group corresponds to one or more types of pixels. In particular, when there is no filter coefficient combination in the N groups of filter coefficients, the combined filter coefficients are the same as the initial filter coefficients, and one set of filter coefficients corresponds to one type of pixel.

[0187] S312: Determine whether to set the filter coefficients in the multiple groups of combined filter coefficients to 0, and obtain multiple groups of combined filter coefficients that are not set to 0 in each of the multiple combined combinations.

[0188] Specifically, when a set of filter coefficients is set to 0, the filter coefficients are not used to perform filtering operations on the pixel, and the pixel value remains unchanged. Specifically, a syntax element flag is used to identify whether a filter coefficient set is set to 0 among the multiple sets of filter coefficients. Furthermore, when a filter coefficient set to 0 exists among the multiple sets of filter coefficients, another flag is used to identify whether each set of the multiple sets of filter coefficients is set to 0.

[0189] Specifically, in a plurality of groups of combined filter coefficients under a merging combination mode, none of the plurality of groups of combined filter coefficients are set to 0, and one or more groups of combined filter coefficients in the plurality of groups of combined filter coefficients are set to 0, thereby obtaining a plurality of zero-setting combinations.

[0190] Optionally, based on rate distortion optimization (RDO) technology, it is determined whether to set the filter coefficients in the multiple groups of combined filter coefficients to zero. That is, the rate distortion cost RD Cost is calculated for the coded frames under the multiple zero-setting combinations, and the zero-setting combination with the smallest RD cost is the final determined zero-setting combination mode. For example, in one possible implementation, there are 10 groups of combined filter coefficients under the current merging combination mode. According to the RD Cost calculation, under the condition of the minimum RDCost, it is determined that the 1st to 3rd groups and the 5th to 7th groups of the 10 groups of combined filter coefficients are set to 0, and the other groups are not set to 0.

[0191] Specifically, the calculation method of the rate-distortion cost RD cost is as follows:

[0192] RD cost = D + A * R

[0193] Where D (distortion) represents the distortion between the reconstructed image frame and the original coded image frame under current technology, typically expressed as the sum of squared errors (SSE), the sum of absolute difference (SAD), or the sum of absolute transformed difference (SATD) after the Hadamard transform. R (rate) represents the number of bits required for encoding under current technology. R represents the degree of data compression. Lower R indicates higher data compression but greater distortion. Higher R reduces distortion, but requires more storage space and increases network transmission pressure. Therefore, it is necessary to find a balance between R and D to achieve the optimal compression effect. Therefore, a Lagrangian method is used to measure the contribution of R and D to the RD cost. The Lagrangian multiplier A is multiplied by R to weigh the weight of the number of bits in the RD cost. It represents the coding distortion generated by reducing the bit rate by one.

[0194] After determining whether to set the filter coefficients to 0, the filter coefficient groups set to 0 are not encoded. Therefore, the number of bits for encoding the filter coefficients can be reduced, thereby improving the encoding compression efficiency.

[0195] S313: Determine a specific merging and combining method from the multiple merging and combining methods, and obtain a plurality of groups of specific merging and filtering coefficients that are not set to 0 under the specific merging and combining method.

[0196] From the above explanation, it can be seen that under each merging combination method, an optimal setting 0 combination method and its RD Cost value are obtained through RD Cost calculation. By comparing the RD Cost values ​​of the optimal setting 0 combination methods of V merging combination methods, the merging combination method corresponding to the minimum RD Cost is determined to be the optimal specific merging combination method, and multiple groups of specific merging filter coefficients that are not set to 0 under this specific merging combination method are obtained.

[0197] In the merging and combining mode, the number of groups of merged filter coefficients is smaller than the number of groups of initial filter coefficients, and the number of coding bits of the filter coefficients is greatly reduced, further improving the coding compression efficiency.

[0198] Optionally, in the embodiment of the present application, the multiple sets of specific merged filter coefficients are the multiple sets of filter coefficients in the loop filtering method 400 and the loop filtering method 500. Optionally, no encoding method is selected for the multiple sets of specific merged filter coefficients, and the multiple sets of specific merged filter coefficients are directly encoded using a non-differential encoding method.

[0199] Optionally, the pixel type corresponding to each set of filter coefficients in the multiple sets of specific combined filter coefficients is identified.

[0200] For example, after RD cost calculation, 7 groups of combined filter coefficients are determined, and pixels of categories 1 to 5 correspond to the first group of combined filter coefficients, pixels of categories 6 to 9 correspond to the second group of filter coefficients, pixels of category 10 correspond to the third group of filter coefficients, pixels of categories 11 to 14 correspond to the fourth group of filter coefficients, pixels of categories 15 to 21 correspond to the fifth group of filter coefficients, pixels of categories 22 to 23 correspond to the sixth group of filter coefficients, and pixels of categories 24 to 25 correspond to the seventh group of filter coefficients. During the encoding process, the filter coefficient groups corresponding to the 25 pixel categories can be encoded as [1, 1, 1, 1, 2, 2, 2, 2, 3, 4, 4, 4, 4, 5, 5, 5, 5, 5, 5, 6, 6, 7, 7].

[0201] Optionally, it is identified whether there is a merged filter coefficient group set to 0 in the multiple groups of merged filter coefficients under the specific merge combination mode. If so, it is further identified whether each group of merged filter coefficients in the multiple groups of merged filter coefficients is set to 0.

[0202] For example, after RD cost calculation, 7 groups of merged filter coefficients are determined, among which the first and second groups of filter coefficients are set to 0, and the other 5 groups of filter coefficients are not set to 0. The syntax element indicating whether there is a merged filter coefficient group set to 0 is encoded as 1, and the syntax element indicating whether each group of merged filter coefficients is set to 0 is encoded as [1, 1, 0, 0, 0, 0].

[0203] For another example, after RD cost calculation of 7 groups of filter coefficients, it is finally determined that all 7 groups of filter coefficients are not set to 0, then the syntax element indicating whether there is a group of filter coefficients set to 0 is encoded as 0, and the syntax element indicating whether each group of filter coefficients is set to 0 is not encoded.

[0204] Since in the technical solution of the embodiment of the present application, there is no need to select a coding method from a plurality of coding methods including differential coding methods and non-differential coding methods, there is no need to calculate the RD cost of multiple groups of combined filter coefficients based on the two coding methods of non-differential coding methods and differential coding methods. Therefore, the time for calculating the specific combined combination method with the minimum RD cost is greatly reduced.

[0205] At the same time, when calculating the RD cost, due to the reduction of the flag bits used to identify the coding mode, the number of bits required for the image coding frame does not include the number of bits of the syntax element indicating the coding mode for the multiple sets of filter coefficients, for example, the number of bits of the syntax element indicating whether the coding mode for encoding the multiple sets of filter coefficients is a differential coding mode or the non-differential coding mode. Optionally, the number of bits of the syntax element indicating the coding mode for the multiple sets of filter coefficients is at least 1.

[0206] From the above, it can be seen that in the nonlinear ALF filtering process, when multiple sets of initial filter coefficients are merged and judged, the correction parameters corresponding to the merged filter coefficients are calculated based on the RD Cost, and the correction (clip) index parameters corresponding to the correction parameters need to be encoded and written into the bitstream. The clip index parameter is an integer between 0 and 3.

[0207] In the current VVC standard reference software VTM, the exponential Golomb coding method is used to encode the clip index parameters and write them into the bitstream. This requires complex calculation of the exponential Golomb order and the number of bits required for encoding is large, which affects the coding efficiency.

[0208] To solve the above problems, Figure 9 FIG1 shows a schematic flow chart of a loop filtering method 400 according to another embodiment of the present invention. The method 400 may be executed by an encoding end. For example, Figure 1 The illustrated system 100 is executed while performing an encoding operation.

[0209] S410: Determine a modified index parameter of the loop filter.

[0210] In the embodiment of the present application, the correction index parameter for the loop filtering is a correction index parameter corresponding to the correction parameter in the clip correction operation in the nonlinear loop filtering. During the encoding process, the correction index parameter corresponding to the correction parameter needs to be encoded and written into the bitstream. The specific nonlinear loop filtering process can be referred to the aforementioned specific solution and will not be repeated here.

[0211] It should be understood that in the embodiment of the present application, the number of correction index parameters is equal to the number of correction parameters. Therefore, when there are N correction parameters, different correction index parameters can be used to identify and distinguish different correction parameters. The value range of the correction index parameter includes but is not limited to integers between 0 and N-1, and the numerical range is not limited in the embodiment of the present application.

[0212] It should also be understood that in the embodiment of the present application, the correction index parameter may be only the brightness correction index parameter of the luminance component of the coding frame, or only the chrominance correction index parameter of the chrominance component of the coding frame, or a common correction index parameter of the luminance component of the coding frame and the chrominance component of the coding frame.

[0213] For example, as mentioned above, in the VVC standard, for the luminance component of the coded frame, the luminance correction parameter is selected from {1024, 181, 32, 6}, and for the chrominance component of the coded frame, the chrominance correction parameter is selected from {1024, 161, 25, 4}. At this time, both the luminance component of the coded frame and the chrominance component of the coded frame need to be encoded with the correction index corresponding to their correction parameters and written into the bitstream.

[0214] In addition to the above case, optionally, the brightness correction parameter of the luminance component of the coded frame and the chrominance correction parameter of the chrominance component of the coded frame are the same. Optionally, the brightness correction parameter of the luminance component of the coded frame and the chrominance correction parameter set of the chrominance component of the coded frame are both {1024, 181, 32, 6} or {1024, 161, 25, 4}.

[0215] Optionally, the luminance correction parameter for the luminance component of the coded frame and the chrominance correction parameter for the chrominance component of the coded frame are parameters selected from the same parameter list. Optionally, the parameter list includes at least one of the following values: 1024, 181, 32, 6. Alternatively, the parameter list includes at least one of the following values: 1024, 161, 25, 4.

[0216] Optionally, the correction parameters of the luminance component of the coding frame and the chrominance component of the coding frame can both be selected from {1024, 181, 32, 6} or both be selected from {1024, 181, 32}. In particular, the same correction index parameter corresponds to the same correction parameter, that is, when the correction index parameter of the luminance component of the coding frame is the same as the correction index parameter of the chrominance component of the coding frame, the correction parameter of the luminance component of the coding frame is correspondingly the same as the correction parameter of the chrominance component of the coding frame.

[0217] For example, when the brightness correction index parameter and the chroma correction index parameter are 1, the correction parameter of the brightness component of the coded frame and the correction parameter of the chroma component of the coded frame are both 181; when the brightness correction index parameter and the chroma correction index parameter are 2, the correction parameter of the brightness component of the coded frame and the correction parameter of the chroma component of the coded frame are both 32.

[0218] This approach can unify the design of correction parameters for chrominance and luminance components, reduce the complexity of codec design, and improve coding performance.

[0219] S420: Encode the modified index parameter using a non-exponential Golomb coding method.

[0220] Exponential Golomb coding is a variable-length coding scheme that uses certain rules to construct codewords. It divides all numbers into groups of equal size. Groups with smaller symbol values ​​are assigned shorter code lengths, while symbols within a group are essentially equal in length. Group sizes increase exponentially. Exponential Golomb coding can also be extended to order K, known as K-order Exponential Golomb coding. The following table shows an example of K-order Exponential Golomb coding, where x represents the value to be encoded.

[0221] Table 1

[0222] X K=0 K=1 K=2 K=3 0 1 10 100 1000 1 010 11 101 1001 2 011 0100 110 1010 3 00100 0101 111 1011 4 00101 0110 01000 1100 5 00110 0111 01001 1101 6 00111 001000 01010 1110 7 0001000 001001 01011 1111 8 0001001 001010 01100 010000 9 0001010 001011 01101 010001

[0223] As shown in Table 1, for smaller values, as the value to be encoded increases, the number of bits of the exponential Golomb coding increases accordingly, and the increase is obvious. Therefore, the exponential Golomb coding method is not suitable for encoding smaller values. Compared with non-exponential Golomb coding methods such as fixed-length code encoding, it requires more coding bits and also requires order calculation in the encoding and decoding stage. The calculation is complex and is not conducive to improving coding efficiency.

[0224] Therefore, in an embodiment of the present application, a non-exponential Golomb coding method is used to encode the modified index parameter, and the encoded parameter is written into the code stream, avoiding the order judgment of the exponential Golomb coding method, reducing the coding complexity and improving the calculation speed of the RD Cost at the encoding end.

[0225] Optionally, the non-exponential Golomb coding method includes but is not limited to a fixed-length code coding method, a unary code (Unary) coding method or a truncated unary (TU) coding method.

[0226] The following description takes the VVC standard where the number of the correction index parameter and the corresponding correction index parameters are both 4 as an example.

[0227] The correction index parameter can adopt 4 values ​​to distinguish different correction parameters.

[0228] Optionally, the four values ​​are any four different values. Preferably, the range of the four values ​​is small, including but not limited to any one of 0 to 3, 1 to 4, -1 to 2, -2 to 1 or -3 to 0.

[0229] In a possible implementation, a fixed-length code encoding method is used to encode and distinguish the four numbers.

[0230] For example, a 2-bit fixed-length code is used to encode the four numbers 0, 1, 2, and 3. 0 is encoded as 00, 1 is encoded as 01, 2 is encoded as 10, and 3 is encoded as 11.

[0231] It should be understood that the encoded 00, 01, 10, 11 are used to distinguish four numerical values. 00, 01, 10, 11 can also identify other numerical values. For example, 00 can also be encoded as 1, 2 or 3, 01 can also be encoded as 0, 2 or 3, and so on. The embodiments of the present application do not limit this.

[0232] Optionally, in addition to using the 2-bit fixed-length code to encode the four numbers 0, 1, 2, and 3 as mentioned above, a 3-bit or other number of bits fixed-length code can also be used to encode the other four numerical values. For example, a 3-bit fixed-length code can be used to encode 1 to 4, and so on. The embodiments of the present application do not limit this.

[0233] In another possible implementation, a unary code encoding method is used to encode and distinguish the four numbers.

[0234] Optionally, the four numbers 0, 1, 2, and 3 are encoded using a unary encoding method. For a non-binary unsigned integer value x ≥ 0, the unary codeword consists of x "1" bits plus a trailing "0" bit. For example, the four numbers 0, 1, 2, and 3 are encoded using a unary encoding method to obtain 0, 10, 110, and 1110.

[0235] In another possible implementation, a truncated unary code encoding method is used to encode and distinguish the four numbers.

[0236] Optionally, a truncated unary encoding scheme is used to encode the four numbers 0, 1, 2, and 3. Given a truncation value S, a non-binary unsigned integer value symbol 0≤x<S is binarized using a unary code. For a non-binary unsigned integer value symbol x=S, the binarization result consists entirely of 1s and has a length of S. For example, when the truncation value S=3, the four numbers 0, 1, 2, and 3 are encoded using the truncated unary encoding scheme to obtain 0, 10, 110, and 111.

[0237] In particular, when a correction parameter is selected from 1024, 181, 32, and 6, the four index parameters correspond to a number among 1024, 181, 32, and 6. Optionally, the four index parameters may be identified in a certain order, for example, index parameter 0 corresponds to 1024, index parameter 1 corresponds to 181, index parameter 2 corresponds to 32, and index parameter 3 corresponds to 6; or index parameter 3 corresponds to 1024, index parameter 2 corresponds to 181, index parameter 1 corresponds to 32, and index parameter 0 corresponds to 6.

[0238] Optionally, the four index parameters may not be identified in a certain order, but may be randomly identified. For example, index parameter 0 corresponds to 1024, index parameter 2 corresponds to 181, index parameter 1 corresponds to 32, and index parameter 3 corresponds to 6; or index parameter 2 corresponds to 1024, index parameter 3 corresponds to 181, index parameter 0 corresponds to 32, index parameter 1 corresponds to 6, and so on. This embodiment of the present application does not limit this.

[0239] It should be understood that when a correction parameter is selected from 1024, 161, 25, and 4, the four index parameters correspond to a number among 1024, 161, 25, and 4 respectively. The identification corresponding method can refer to the above identification method and will not be repeated here.

[0240] It should also be understood that in other video standards or technical solutions, the number of loop filtering correction parameters is N, and the correction index parameter can use N values ​​to distinguish different correction parameters. The N values ​​can be encoded and distinguished using any one of a fixed-length code encoding method, a unary code encoding method, or a truncated unary code encoding method. The encoding method of the N values ​​and the correspondence between the N values ​​and the correction parameters can refer to the encoding method of the four values ​​and the correspondence with the correction parameters in the above-mentioned VVC standard, and will not be repeated here.

[0241] Optionally, in one possible implementation, the number of encoding bits of a non-exponential Golomb coding scheme, such as a fixed-length code encoding scheme, a unary code encoding scheme, or a truncated unary code encoding scheme, is no greater than 4. When the number of bits of the non-exponential Golomb coding scheme is smaller than the number of bits of the exponential Golomb coding scheme, the encoding efficiency of the codec can be improved, thereby accelerating the encoding speed.

[0242] Alternatively, as Figure 10 As shown, in the embodiment of the present application, determining the modified index parameter of the loop filter in step S410 includes:

[0243] S411: Perform RD Cost calculation according to the non-exponential Golomb coding method to determine a modified index parameter of the loop filter.

[0244] Specifically, RD Cost calculation is performed according to the non-exponential Golomb coding method to determine the correction parameter corresponding to each filter coefficient of the loop filter and its corresponding correction index parameter.

[0245] As previously mentioned, in nonlinear loop filtering, each filter coefficient corresponds to a correction parameter. During the coefficient merging decision process, N groups of filter coefficients are combined and preliminarily determined in various ways, resulting in V merging combinations. Based on the Wiener filtering principle, multiple groups of combined filter coefficients are recalculated based on these V merging combinations. Optionally, N can be a positive integer not greater than 25.

[0246] In the embodiment of the present application, based on the recalculated V groups of combined filter coefficients under the combined combination mode, the correction parameter corresponding to each filter coefficient in the multiple groups of combined filter coefficients is obtained according to the RD Cost calculation. During the RDCost calculation process, the encoding method of the correction index parameter corresponding to the correction parameter is a non-exponential Golomb encoding method, such as a fixed-length code encoding method.

[0247] In the RD Cost calculation process, the number of bits calculated based on the non-exponential Golomb coding method is less than that calculated based on the exponential Golomb coding method, and there is no need to judge the order of the exponential Golomb coding, which reduces the calculation time of the RD Cost and is conducive to improving the coding efficiency.

[0248] Alternatively, as Figure 11 As shown, in an embodiment of the present application, a loop filtering method 500 includes:

[0249] S510: Determine multiple groups of filter coefficients for loop filtering;

[0250] S520: Determine a correction index parameter for loop filtering;

[0251] S530: Encoding the plurality of filter coefficients using a non-differential encoding method;

[0252] S540: Encode the modified index parameter using a non-exponential Golomb coding method.

[0253] Optionally, step S510 may be the same as or similar to step S210 and step S310 in the aforementioned loop filtering method 200 and loop filtering method 300; step S520 may be the same as or similar to step S220 and step 330. Optionally, step S530 and step S540 may be the same as or similar to step S410 and step S420 in the aforementioned loop filtering method 400. For detailed implementation, please refer to the aforementioned technical solution and will not be repeated here.

[0254] In the embodiment of the present application, the encoding method of multiple groups of filter coefficients in the loop filtering and the encoding method of the correction index parameter are optimized, which improves the encoding efficiency and speeds up the encoding in two aspects without affecting the encoding quality.

[0255] The above describes the technical solutions of the embodiments of the present application from the perspective of the encoding end. The following describes the technical solutions of the embodiments of the present application from the perspective of the decoding end. It should be understood that, except for the following description, the common description of the encoding end and the decoding end can refer to the previous description, and for the sake of brevity, it is not repeated here.

[0256] Figure 12 FIG1 shows a schematic flow chart of a loop filtering method 600 according to an embodiment of the present application. The method 600 may be executed by a decoding end. For example, Figure 1 The illustrated system 100 is executed while performing a decoding operation.

[0257] S610: Obtaining loop-filtered bitstream;

[0258] S620: Decode the indication information indicating the number of filter coefficient groups in the bitstream to determine that the filter coefficients are multiple groups;

[0259] In the embodiment of the present application, since the pixels in the decoded frame are divided into multiple classes, and each class of pixels corresponds to a group of filter coefficients, the code stream of the loop filter includes indication information indicating the number of filter coefficient groups. For example, in the reference software VTM of the VVC standard, the indication information of MAX_NUM_ALF_CLASSES is decoded to obtain the number of filter coefficient groups in the loop filter. When the number of groups is greater than 1, that is, when it is determined that there are multiple groups of filter coefficients, step S630 is executed.

[0260] S630: Decoding the filter coefficient code stream in the code stream using a non-differential decoding method to obtain multiple groups of filter coefficients.

[0261] Specifically, since the encoding end directly uses non-differential encoding for encoding, the decoding end correspondingly uses non-differential decoding to directly decode the filter coefficient code stream. The multiple sets of filter coefficients obtained do not require any other calculations and can be directly used for filtering operations. However, when decoding using differential decoding, the decoded values ​​still need to be calculated and processed to obtain the multiple sets of filter coefficients used for filtering. In addition, the multiple sets of filter coefficients are highly dependent on each other. When errors occur during data transmission, they will have a significant impact on the multiple sets of filter coefficients on the decoding end, which is not conducive to the filtering effect and image quality. Therefore, compared to using differential decoding, using non-differential decoding to filter the filter coefficient code stream can improve the quality of the loop filtered image on the decoding end.

[0262] Optionally, the non-differential decoding method includes an exponential Golomb decoding method, a fixed-length decoding method, a unary code decoding method, and the like.

[0263] Preferably, in the embodiment of the present application, the exponential Golomb decoding method is used to decode the multiple groups of filter coefficients.

[0264] Optionally, before the filter coefficient code stream in the code stream is decoded using the non-differential decoding method, the encoding method of the filter coefficient code stream is not decoded.

[0265] In a possible implementation manner, the code stream includes a syntax element code stream indicating an encoding method of the filter coefficient code stream, but the syntax element code stream is not decoded.

[0266] In another possible implementation manner, the code stream does not include a syntax element code stream indicating the encoding method of the filter coefficient code stream.

[0267] In this embodiment, optionally, the code stream does not include a syntax element code stream indicating whether the encoding mode of the filter coefficient code stream is a differential encoding mode or a non-differential encoding mode.

[0268] For example, in the VVC standard, the "alf_luma_coeff_delta_prediction_flag" syntax flag is used to identify whether the encoding method of the filter coefficients of the loop filter ALF in the luminance component of the image frame is differential encoding or non-differential encoding. This syntax flag is an unsigned integer and occupies one bit.

[0269] In the embodiment of the present application, the code stream does not include the code stream of the "alf_luma_coeff_delta_prediction_flag" syntax element, and the code stream of the syntax element does not need to be decoded, thereby reducing decoding time.

[0270] It should be understood that the syntax element code stream indicating the encoding method of the filter coefficient code stream in the embodiment of the present application can be the syntax element code stream of the luminance component of the decoded frame, or can also be the syntax element code stream of the chrominance component of the decoded frame. This embodiment of the present application does not limit this.

[0271] It should also be understood that the embodiments of the present application can also be applied to other coding standards or coding technology solutions that use loop filtering ALF in addition to VVC, and the embodiments of the present application are not limited to this.

[0272] Optionally, the multiple groups of filter coefficients correspond to the multiple groups of filter coefficients in the aforementioned in-loop filtering method 200 and the in-loop filtering method at the encoding end, and are not described in detail here.

[0273] Optionally, Figure 13A schematic flow chart of a method 700 for loop filtering at a decoding end according to another embodiment of the present application is shown. The loop filtering method 700 is a nonlinear loop filtering method.

[0274] The loop filtering method 700 includes:

[0275] S710: Obtaining a loop-filtered bitstream;

[0276] S720: Decode the bitstream of the modified index parameter in the bitstream using a non-exponential Golomb decoding method to obtain a modified index parameter for loop filtering.

[0277] In the embodiment of the present application, the correction index parameter of the loop filtering is a correction index parameter corresponding to the correction (clip) parameter in the correction clip operation in the nonlinear loop filtering.

[0278] Optionally, in the embodiment of the present application, the modified index parameter obtained by decoding may refer to the modified index parameter in the aforementioned encoding-side loop filtering method 400, which will not be described in detail here.

[0279] It should be understood that in the embodiment of the present application, the number of correction index parameters is equal to the number of correction parameters. Therefore, when the correction parameters are N, the correction index parameters obtained by decoding are also N. The value range of the correction index parameters includes but is not limited to integers between 0 and N-1, and the numerical range is not limited in the embodiment of the present application.

[0280] It should also be understood that in an embodiment of the present application, the correction index parameter obtained by decoding may be only the luminance correction index parameter of the decoded frame luminance component, or only the chrominance correction index parameter of the decoded frame chrominance component, or a common correction index parameter of the decoded frame luminance component and the decoded frame chrominance component.

[0281] For example, in the VVC standard, the brightness correction index parameter bitstream of the luminance component of the decoded frame is decoded to obtain a corresponding brightness correction parameter of one of {1024, 181, 32, 6}, and the chroma correction index parameter bitstream of the chroma component of the decoded frame is decoded to obtain a corresponding chroma correction parameter of one of {1024, 161, 25, 4}.

[0282] In addition to the above case, optionally, the luminance correction parameter of the decoded frame luminance component and the chrominance correction parameter of the decoded frame chrominance component are the same. Optionally, the luminance correction parameter of the decoded frame luminance component and the chrominance correction parameter set of the decoded frame chrominance component are both {1024, 181, 32, 6} or {1024, 161, 25, 4}.

[0283] Optionally, the luminance correction parameter of the decoded frame luminance component and the chrominance correction parameter of the decoded frame chrominance component are parameters in the same parameter list. Optionally, the parameter list may include at least one of the following values: 1024, 181, 32, 6. Alternatively, the parameter list may further include at least one of the following values: 1024, 161, 25, 4.

[0284] Optionally, the correction parameters of the decoded frame luminance component and the decoded frame chrominance component can both be one of {1024, 181, 32, 6} or both be one of {1024, 181, 32}. In particular, when the correction index parameter of the decoded frame luminance component is the same as the correction index parameter of the decoded frame chrominance component, correspondingly, the correction parameter of the decoded frame luminance component is the same as the correction parameter of the decoded frame chrominance component.

[0285] For example, when the decoded brightness correction index parameter and the chroma correction index parameter are 1, the correction parameter of the brightness component of the encoded frame and the correction parameter of the chroma component of the encoded frame are both 181; when the decoded brightness correction index parameter and the chroma correction index parameter are 2, the correction parameter of the brightness component of the encoded frame and the correction parameter of the chroma component of the encoded frame are both 32.

[0286] Using this method for decoding can simplify the decoding process, speed up the decoding speed, and improve the decoding performance.

[0287] In the embodiment of the present application, the non-exponential Golomb decoding method is used for decoding, which can avoid the calculation of the exponential Golomb order at the decoding end, improve the decoding speed, and optimize the decoding performance.

[0288] Optionally, the non-exponential Golomb decoding method includes, but is not limited to, a fixed-length code decoding method, a unary code decoding method, or a truncated unary code decoding method. The fixed-length code decoding, unary code decoding, and truncated unary code decoding are the inverse processes of the aforementioned fixed-length code encoding, unary code encoding, and truncated unary code encoding.

[0289] Specifically, in the VVC standard, the number of the correction index parameter and the corresponding correction index parameter is 4 as an example for description.

[0290] In a possible implementation, a fixed-length code decoding method is used to decode the modified index parameter code stream.

[0291] For example, a correction index parameter code stream corresponding to a correction index parameter is a 2-bit code stream, and the 2-bit code stream is one of 00, 01, 10, and 11. 00, 01, 10, and 11 are decoded using a fixed-length code to obtain corresponding correction index parameters of 0, 1, 2, and 3.

[0292] Optionally, according to specific fixed-length code decoding rules, 00 can also be decoded as 1, 2 or 3, 01 can also be decoded as 0, 2 or 3, and so on. This embodiment of the present application does not limit this.

[0293] Optionally, in addition to the above-mentioned modified index parameter code stream being a 2-bit code stream, the modified index parameter code stream can also be 3 bits or other number of bits. For example, decoding a 3-bit code stream obtains 1 to 4, etc., which is not limited in this embodiment of the present application.

[0294] In another possible implementation, the modified index parameter code stream is decoded using a unary code decoding method.

[0295] Optionally, a correction index parameter code stream corresponding to a correction index parameter is one of 0, 10, 110, and 1110. The corresponding correction index parameters obtained by decoding 0, 10, 110, and 1110 using a unary code are 0, 1, 2, and 3.

[0296] In another possible implementation, a truncated unary code decoding method is used to decode the modified index parameter code stream.

[0297] Optionally, a modified index parameter code stream corresponding to a modified index parameter is one of 0, 10, 110, and 111. 0, 10, 110, and 111 are decoded using a truncated unary code to obtain corresponding modified index parameters of 0, 1, 2, and 3.

[0298] In particular, when the correction parameter is one of 1024, 181, 32, and 6, the four index parameters correspond to one of 1024, 181, 32, and 6. Optionally, the four index parameters can be identified in a certain order, for example, index parameter 0 corresponds to 1024, index parameter 1 corresponds to 181, index parameter 2 corresponds to 32, and index parameter 3 corresponds to 6; or index parameter 3 corresponds to 1024, index parameter 2 corresponds to 181, index parameter 1 corresponds to 32, and index parameter 0 corresponds to 6.

[0299] Optionally, the four index parameters may not be identified in a certain order, but may be randomly identified. For example, index parameter 0 corresponds to 1024, index parameter 2 corresponds to 181, index parameter 1 corresponds to 32, and index parameter 3 corresponds to 6; or index parameter 2 corresponds to 1024, index parameter 3 corresponds to 181, index parameter 0 corresponds to 32, index parameter 1 corresponds to 6, and so on. This embodiment of the present application does not limit this.

[0300] It should be understood that when the correction parameter is one of 1024, 161, 25, and 4, the four index parameters correspond to a number among 1024, 161, 25, and 4 respectively. The identification corresponding method can refer to the above identification method and will not be repeated here.

[0301] It should also be understood that in other video standards or technical solutions, decoding a modified index parameter bitstream corresponding to a modified index parameter to obtain one of N values ​​can employ any of fixed-length code decoding, unary code decoding, or truncated unary code decoding to decode the modified index parameter bitstream. The decoding method for these N values ​​and the correspondence between these N values ​​and the modified parameters can refer to the decoding method for the four values ​​and their correspondence with the modified parameters in the aforementioned VVC standard, and will not be further described here.

[0302] Optionally, in one possible implementation, the number of decoding bits of a non-exponential Golomb decoding method, such as the fixed-length code decoding method, the unary code decoding method, or the truncated unary code decoding method, is no greater than 4. When the number of bits of the non-exponential Golomb decoding method is smaller than the number of bits of the exponential Golomb decoding method, the decoding efficiency of the codec can be improved, thereby accelerating the decoding speed.

[0303] Optionally, Figure 14 A schematic flow chart of a method 800 for loop filtering at a decoding end according to another embodiment of the present application is shown.

[0304] like Figure 14 As shown, in an embodiment of the present application, a loop filtering method 800 includes:

[0305] S810: Obtaining a loop-filtered bitstream;

[0306] S820: Decode the indication information indicating the number of filter coefficient groups in the bitstream to determine that the filter coefficients are multiple groups;

[0307] S830: Decoding the filter coefficient code stream in the code stream using a non-differential decoding method to obtain multiple groups of filter coefficients;

[0308] S840: Decode the bitstream of the modified index parameter in the bitstream using a non-exponential Golomb decoding method to obtain a modified index parameter for loop filtering.

[0309] Optionally, steps S810, S820, and S830 may be identical or similar to steps S610, S620, and 630 of the aforementioned loop filtering method 600; and step S840 may be identical or similar to step S720 of the aforementioned loop filtering method 700. For detailed implementation, please refer to the aforementioned technical solution and will not be repeated here.

[0310] In the embodiment of the present application, the decoding method of multiple groups of filter coefficients in loop filtering and the decoding method of the correction index parameter are optimized, which improves the decoding efficiency and speeds up the decoding from two aspects.

[0311] Combined with the above Figures 6 to 11 , describes in detail the embodiment of the method for encoding side loop filtering of the present application, and the following is combined with Figures 15 and 16 , the coding loop filtering device embodiment of the present application is described in detail. It should be understood that the device embodiment and the method embodiment correspond to each other, and similar descriptions can refer to the method embodiment.

[0312] Figure 15 is a schematic block diagram of an apparatus 20 for loop filtering at an encoding end according to an embodiment of the present application. Optionally, the apparatus 20 for loop filtering may correspond to the loop filtering method 200 or 300; alternatively, the apparatus 20 for loop filtering may correspond to a loop filtering method combining the loop filtering methods 200 and 400, or a loop filtering method combining the loop filtering methods 300 and 400, or the loop filtering method 500.

[0313] like Figure 15 Said loop filtering device 20 comprises: a processor 21 and a memory 22;

[0314] The memory 22 may be used to store programs, and the processor 21 may be used to execute the programs stored in the memory to perform the following operations:

[0315] Determine multiple groups of filter coefficients for loop filtering; and encode the multiple groups of filter coefficients using a non-differential encoding method.

[0316] Optionally, in one embodiment of the present application, the processor 21 may be a processor or a controller of an electronic device where the loop filtering device 20 is located.

[0317] Optionally, the processor 21 is specifically configured to: not select an encoding method for the multiple groups of filter coefficients before encoding the multiple groups of filter coefficients in the non-differential encoding method.

[0318] Optionally, the syntax elements of the loop filtering do not include syntax elements indicating an encoding method of the multiple groups of filter coefficients.

[0319] Optionally, the syntax elements of the loop filtering do not include syntax elements indicating whether the encoding method of the multiple groups of filter coefficients is the differential encoding method or the non-differential encoding method.

[0320] Optionally, the flag bit of the syntax element indicating whether the encoding method of the multiple groups of filter coefficients is the differential encoding method or the non-differential encoding method is 0 or 1.

[0321] Optionally, the processor 21 is specifically configured to: calculate the rate-distortion cost of the coded frame not based on the coding mode of the multiple groups of filter coefficients, and select the coding mode of the multiple groups of filter coefficients not based on a minimum rate-distortion cost.

[0322] Optionally, the processor 21 is specifically configured to: calculate the rate-distortion cost of the encoded frame not based on the differential encoding mode and the non-differential encoding mode, and select the differential encoding mode or the non-differential encoding mode not based on a minimum rate-distortion cost.

[0323] Optionally, the processor 21 is specifically configured to: after encoding the multiple groups of filter coefficients using the exponential Golomb coding method, write the encoded values ​​of the multiple groups of filter coefficients into a bitstream.

[0324] Optionally, the processor 21 is specifically configured to: merge filter coefficients in a plurality of groups of initial filter coefficients using a plurality of merging combination modes, and calculate and obtain a plurality of groups of merged filter coefficients in each of the plurality of merging combination modes;

[0325] Determining whether to set the filter coefficients in the plurality of combined filter coefficients to 0, and obtaining a plurality of combined filter coefficients that are not set to 0 in each of the plurality of combined combination modes;

[0326] A specific merging and combining method is determined from the multiple merging and combining methods, and the multiple groups of specific merging and filtering coefficients that are not set to 0 under the specific merging and combining method are obtained.

[0327] Optionally, the processor 21 is specifically configured to: select a combined filter coefficient from the multiple groups of combined filter coefficients and set it to 0 using different selection methods to obtain different combinations of filter coefficients set to 0;

[0328] Based on the non-differential coding mode, the rate-distortion cost of the coded frame under different combinations of zero-setting filter coefficients is calculated, and multiple groups of filter coefficients not set to zero under the zero-setting filter coefficient combination with the minimum rate-distortion cost are determined.

[0329] Optionally, the processor 21 is specifically used to: calculate the rate-distortion cost of the encoded frame under the multiple merging combination modes based on the non-differential encoding mode, and determine the multiple groups of specific merging filter coefficients that are not set to 0 under the specific merging combination mode with the minimum rate-distortion cost.

[0330] Optionally, the processor 21 is specifically used to: calculate the rate-distortion cost based on the number of bits required for encoding the coded frame, wherein the number of bits required for encoding the coded frame does not include the number of bits of the syntax elements indicating whether the encoding method of the multiple groups of filter coefficients is the differential encoding method or the non-differential encoding method.

[0331] Optionally, the multiple groups of filter coefficients are N groups of filter coefficients of the luminance component of the encoded frame, where N is a positive integer less than or equal to 25.

[0332] Optionally, the multiple groups of filter coefficients are filter coefficients calculated based on the coding tree unit CTU.

[0333] Optionally, each set of filter coefficients in the multiple sets of filter coefficients includes 13 values.

[0334] Optionally, the loop filtering is nonlinear loop filtering, and the processor 21 is further configured to:

[0335] Determine the modified index parameter of the nonlinear loop filter; and encode the modified index parameter using a non-exponential Golomb coding method.

[0336] Optionally, the value of the correction index parameter is an integer between 0 and 3.

[0337] Optionally, the number of coding bits of the non-exponential Golomb coding method is not greater than 4.

[0338] Optionally, the non-exponential Golomb coding method is a fixed-length code coding method, a unary code coding method, or a truncated unary code coding method.

[0339] Optionally, the non-exponential Golomb coding method is the fixed-length code coding method, and the number of coding bits of the fixed-length code coding method is 2.

[0340] Optionally, the non-exponential Golomb coding method is the truncated unary code coding method, and the number of coding bits of the truncated unary code coding method is not greater than 3.

[0341] Optionally, the processor 21 is specifically configured to: before adopting the non-exponential Golomb coding method to encode the modified index parameter, calculate a rate-distortion cost of the encoded frame based on the non-exponential Golomb coding method.

[0342] Optionally, the processor 21 is specifically configured to: before encoding the modified index parameter using the non-exponential Golomb coding method, calculate the rate-distortion cost of the encoded frame not based on the exponential Golomb coding method.

[0343] Optionally, the processor 21 is specifically configured to: after encoding the modified index parameter using the non-exponential Golomb coding method, write the encoded value of the modified index parameter into the bitstream.

[0344] Optionally, one correction index parameter corresponds to one loop filtering correction parameter, and one loop filtering correction parameter corresponds to one filter coefficient in the multiple groups of filter coefficients;

[0345] Loop filtering is performed based on the plurality of loop filtering correction parameters and the plurality of groups of filter coefficients.

[0346] Optionally, the correction index parameter includes a luminance correction index parameter of a luminance component of the coding frame and a chrominance correction index parameter of a chrominance component of the coding frame;

[0347] The luma correction index parameter corresponds to a luma loop filter correction parameter of a luma component of a coded frame, and the chroma correction index parameter corresponds to a chroma loop filter correction parameter of a chroma component of a coded frame;

[0348] When the luma correction index parameter is the same as the chroma correction index parameter, the luma loop filter correction parameter is the same as the chroma loop filter correction parameter.

[0349] Optionally, the luminance loop filter correction parameter and the chrominance loop filter correction parameter are parameters selected from the same parameter list.

[0350] Optionally, the parameter list includes at least one of the following values: 1024, 181, 32, 6.

[0351] Figure 16 This is a schematic block diagram of another loop filtering device 30 at an encoding end according to an embodiment of the present application. The loop filtering device 30 is a loop filtering device at a video encoding end. Optionally, the loop filtering device 20 may correspond to the loop filtering method 400; optionally, the loop filtering device 30 may also correspond to a loop filtering method that combines the loop filtering methods 400 and 200, or a loop filtering method that combines the loop filtering methods 400 and 300, or a loop filtering method 500.

[0352] like Figure 16 Said loop filtering device 30 comprises: a processor 31 and a memory 32;

[0353] The memory 32 may be used to store programs, and the processor 31 may be used to execute the programs stored in the memory to perform the following operations:

[0354] Determine a modified index parameter of the loop filter; and encode the modified index parameter using a non-exponential Golomb coding method.

[0355] Optionally, the value of the correction index parameter is an integer between 0 and 3.

[0356] Optionally, the number of coding bits of the non-exponential Golomb coding method is not greater than 4.

[0357] Optionally, the non-exponential Golomb coding method is a fixed-length code coding method, a unary code coding method, or a truncated unary code coding method.

[0358] Optionally, the non-exponential Golomb coding method is the fixed-length code coding method, and the number of coding bits of the fixed-length code coding method is 2.

[0359] Optionally, the non-exponential Golomb coding method is the truncated unary code coding method, and the number of coding bits of the truncated unary code coding method is not greater than 3.

[0360] Optionally, the processor 31 is specifically configured to: before adopting the non-exponential Golomb coding method to encode the modified index parameter, calculate a rate-distortion cost of the encoded frame based on the non-exponential Golomb coding method.

[0361] Optionally, the processor 31 is specifically configured to: before encoding the modified index parameter using the non-exponential Golomb coding method, calculate the rate-distortion cost of the encoded frame not based on the exponential Golomb coding method.

[0362] Optionally, the processor 31 is specifically configured to: after encoding the modified index parameter using the non-exponential Golomb coding method, write the encoded value of the modified index parameter into the bitstream.

[0363] Optionally, the processor 31 is further configured to: determine multiple groups of filter coefficients for loop filtering;

[0364] The multiple groups of filter coefficients are encoded using a non-differential encoding method.

[0365] Optionally, the processor 31 is specifically configured to: not select an encoding method for the multiple groups of filter coefficients before encoding the multiple groups of filter coefficients in the non-differential encoding method.

[0366] Optionally, the syntax elements of the loop filtering do not include syntax elements indicating an encoding method of the multiple groups of filter coefficients.

[0367] Optionally, the syntax elements of the loop filtering do not include syntax elements indicating whether the encoding method of the multiple groups of filter coefficients is the differential encoding method or the non-differential encoding method.

[0368] Optionally, the flag bit of the syntax element indicating whether the encoding method of the multiple groups of filter coefficients is the differential encoding method or the non-differential encoding method is 0 or 1.

[0369] Optionally, the processor 31 is specifically configured to: calculate the rate-distortion cost of the coded frame not based on the coding mode of the multiple groups of filter coefficients, and select the coding mode of the multiple groups of filter coefficients not based on a minimum rate-distortion cost.

[0370] Optionally, the processor 31 is specifically configured to: calculate the rate-distortion cost of the encoded frame not based on the differential encoding mode and the non-differential encoding mode, and select the differential encoding mode and the non-differential encoding mode not based on a minimum rate-distortion cost.

[0371] Optionally, the processor 31 is specifically configured to: after encoding the multiple groups of filter coefficients using the exponential Golomb coding method, write the encoded values ​​of the multiple groups of filter coefficients into the bitstream.

[0372] Optionally, the processor 31 is specifically configured to: merge filter coefficients in a plurality of groups of initial filter coefficients using a plurality of merging combination modes, and calculate and obtain a plurality of groups of merged filter coefficients in each of the plurality of merging combination modes;

[0373] Determining whether to set the filter coefficients in the plurality of combined filter coefficients to 0, and obtaining a plurality of combined filter coefficients that are not set to 0 in each of the plurality of combined combination modes;

[0374] A specific merging and combining method is determined from the multiple merging and combining methods, and the multiple groups of specific merging and filtering coefficients that are not set to 0 under the specific merging and combining method are obtained.

[0375] Optionally, the processor 31 is specifically configured to: select a combined filter coefficient from the multiple groups of combined filter coefficients and set it to 0 using different selection methods to obtain different combinations of filter coefficients set to 0;

[0376] Based on the non-differential coding mode, the rate-distortion cost of the coded frame under different combinations of zero-setting filter coefficients is calculated, and multiple groups of filter coefficients not set to zero under the zero-setting filter coefficient combination with the minimum rate-distortion cost are determined.

[0377] Optionally, the processor 31 is specifically used to: calculate the rate-distortion cost of the encoded frame under the multiple merging combination modes based on the non-differential encoding mode, and determine the multiple groups of specific merging filter coefficients that are not set to 0 under the specific merging combination mode with the minimum rate-distortion cost.

[0378] Optionally, the processor 31 is specifically used to: calculate the rate-distortion cost based on the number of bits required for encoding the coded frame, wherein the number of bits required for encoding the coded frame does not include the number of bits of the syntax elements indicating whether the encoding method of the multiple groups of filter coefficients is the differential encoding method or the non-differential encoding method.

[0379] Optionally, the multiple groups of filter coefficients are N groups of filter coefficients of the luminance component of the encoded frame, where N is a positive integer less than or equal to 25.

[0380] Optionally, the multiple groups of filter coefficients are filter coefficients calculated based on the coding tree unit CTU.

[0381] Optionally, each set of filter coefficients in the multiple sets of filter coefficients includes 13 values.

[0382] Optionally, one correction index parameter corresponds to one loop filtering correction parameter, and one loop filtering correction parameter corresponds to one filter coefficient in the multiple groups of filter coefficients;

[0383] Loop filtering is performed based on the plurality of loop filtering correction parameters and the plurality of groups of filter coefficients.

[0384] Optionally, the loop filtering is a nonlinear loop filtering, and the correction index parameters include a luminance correction index parameter of a luminance component of the coding frame and a chrominance correction index parameter of a chrominance component of the coding frame;

[0385] The luma correction index parameter corresponds to a luma loop filter correction parameter of a luma component of a coded frame, and the chroma correction index parameter corresponds to a chroma loop filter correction parameter of a chroma component of a coded frame;

[0386] When the luma correction index parameter is the same as the chroma correction index parameter, the luma loop filter correction parameter is the same as the chroma loop filter correction parameter.

[0387] Optionally, the luminance loop filter correction parameter and the chrominance loop filter correction parameter are parameters selected from the same parameter list.

[0388] Optionally, the parameter list includes at least one of the following values: 1024, 181, 32, 6.

[0389] Combined with the above Figures 12 to 14 , describes in detail the decoding side loop filtering method embodiment of the present application, and the following is combined with Figures 17 and 18 , the decoding loop filtering device embodiment of the present application is described in detail. It should be understood that the device embodiment and the method embodiment correspond to each other, and similar descriptions can refer to the method embodiment.

[0390] Figure 17 is a schematic block diagram of an apparatus 40 for loop filtering at a decoding end according to an embodiment of the present application. Optionally, the apparatus 40 for loop filtering may correspond to the loop filtering method 600; alternatively, the apparatus 40 for loop filtering may correspond to a loop filtering method combining the loop filtering methods 600 and 700, or to the loop filtering method 800.

[0391] like Figure 17 Said loop filtering device 40 comprises: a processor 41 and a memory 42;

[0392] The memory 42 may be used to store programs, and the processor 41 may be used to execute the programs stored in the memory to perform the following operations:

[0393] Get the code stream of loop filtering;

[0394] Decoding the indication information indicating the number of filter coefficient groups in the code stream to determine that the filter coefficients are multiple groups;

[0395] A filter coefficient code stream in the code stream is decoded in a non-differential decoding manner to obtain multiple groups of filter coefficients.

[0396] Optionally, the processor 41 is specifically configured to: before decoding the filter coefficient code stream in the code stream using the non-differential decoding method, not decode the encoding method of the filter coefficient code stream.

[0397] Optionally, the code stream does not include a syntax element code stream indicating an encoding method of the filter coefficient code stream.

[0398] Optionally, the code stream does not include a syntax element code stream indicating that the encoding mode of the filter coefficient code stream is the differential encoding mode or the non-differential encoding mode.

[0399] Optionally, the flag bit of the syntax element code stream indicating that the encoding mode of the filter coefficient code stream is the differential encoding mode or the non-differential encoding mode is 0 or 1.

[0400] Optionally, the non-differential decoding method is an exponential Golomb decoding method.

[0401] Optionally, the multiple groups of filter coefficients are N groups of filter coefficients of the luminance component of the decoded frame, where N is a positive integer less than or equal to 25.

[0402] Optionally, the multiple groups of filter coefficients are filter coefficients calculated based on the coding tree unit CTU.

[0403] Optionally, each set of filter coefficients in the multiple sets of filter coefficients includes 13 values.

[0404] Optionally, the loop filtering is nonlinear loop filtering, and the processor 41 is further configured to:

[0405] A non-exponential Golomb decoding method is used to decode the code stream of the modified index parameter in the code stream to obtain the modified index parameter of the loop filter.

[0406] Optionally, the value of the correction index parameter is an integer between 0 and 3.

[0407] Optionally, the number of decoding bits of the non-exponential Golomb decoding method is no more than 4.

[0408] Optionally, the non-exponential Golomb decoding method is one of a fixed-length code decoding method, a unary code decoding method, or a truncated unary code decoding method.

[0409] Optionally, the non-exponential Golomb decoding method is the fixed-length code decoding method, and the number of decoding bits of the fixed-length code decoding method is 2.

[0410] Optionally, the non-exponential Golomb decoding method is the truncated unary code decoding method, and the number of decoding bits of the truncated unary code decoding method is not greater than 3.

[0411] Optionally, one correction index parameter corresponds to one loop filtering correction parameter, and one loop filtering correction parameter corresponds to one filter coefficient in the multiple groups of filter coefficients;

[0412] Loop filtering is performed based on the plurality of loop filtering correction parameters and the plurality of groups of filter coefficients.

[0413] Optionally, the correction index parameter includes a luminance correction index parameter of a decoded frame luminance component and a chrominance correction index parameter of a decoded frame chrominance component;

[0414] The luma correction index parameter corresponds to a luma loop filter correction parameter of a luma component of a decoded frame, and the chroma correction index parameter corresponds to a chroma loop filter correction parameter of a chroma component of a decoded frame;

[0415] When the luma correction index parameter is the same as the chroma correction index parameter, the luma loop filter correction parameter is the same as the chroma loop filter correction parameter.

[0416] Optionally, the luminance loop filter correction parameter and the chrominance loop filter correction parameter are parameters selected from the same parameter list.

[0417] Optionally, the parameter list includes at least one of the following values: 1024, 181, 32, 6.

[0418] Figure 18 is a schematic block diagram of another loop filtering apparatus 50 at a decoding end according to an embodiment of the present application. Optionally, the loop filtering apparatus 50 may correspond to the loop filtering method 700; alternatively, the loop filtering apparatus 50 may also correspond to a loop filtering method combining the loop filtering methods 700 and 600, or to the loop filtering method 800.

[0419] like Figure 18 Said loop filtering device 50 comprises: a processor 51 and a memory 52;

[0420] The memory 52 may be used to store programs, and the processor 51 may be used to execute the programs stored in the memory to perform the following operations:

[0421] Get the code stream of loop filtering;

[0422] A non-exponential Golomb decoding method is used to decode the code stream of the modified index parameter in the code stream to obtain the modified index parameter of the loop filter.

[0423] Optionally, the value of the correction index parameter is an integer between 0 and 3.

[0424] Optionally, the number of decoding bits of the non-exponential Golomb decoding method is no more than 4.

[0425] Optionally, the non-exponential Golomb decoding method is one of a fixed-length code decoding method, a unary code decoding method, or a truncated unary code decoding method.

[0426] Optionally, the non-exponential Golomb decoding method is the fixed-length code decoding method, and the number of decoding bits of the fixed-length code decoding method is 2.

[0427] Optionally, the non-exponential Golomb decoding method is the truncated unary code decoding method, and the number of decoding bits of the truncated unary code decoding method is not greater than 3.

[0428] Optionally, the processor 51 is further configured to: decode indication information indicating the number of filter coefficient groups in the code stream, and determine that the filter coefficients are multiple groups;

[0429] A filter coefficient code stream in the code stream is decoded in a non-differential decoding manner to obtain multiple groups of filter coefficients.

[0430] Optionally, the processor 51 is specifically configured to: before decoding the filter coefficient code stream in the code stream using the non-differential decoding method, not decode the encoding method of the filter coefficient code stream.

[0431] Optionally, the code stream does not include a syntax element code stream indicating an encoding method of the filter coefficient code stream.

[0432] Optionally, the code stream does not include a syntax element code stream indicating that the encoding mode of the filter coefficient code stream is the differential encoding mode or the non-differential encoding mode.

[0433] Optionally, the flag bit of the syntax element code stream indicating that the encoding mode of the filter coefficient code stream is the differential encoding mode or the non-differential encoding mode is 0 or 1.

[0434] Optionally, the non-differential decoding method is an exponential Golomb decoding method.

[0435] Optionally, the multiple groups of filter coefficients are N groups of filter coefficients of the luminance component of the decoded frame, where N is a positive integer less than or equal to 25.

[0436] Optionally, the multiple groups of filter coefficients are filter coefficients calculated based on the coding tree unit CTU.

[0437] Optionally, each set of filter coefficients in the multiple sets of filter coefficients includes 13 values.

[0438] Optionally, one correction index parameter corresponds to one loop filtering correction parameter, and one loop filtering correction parameter corresponds to one filter coefficient in the multiple groups of filter coefficients;

[0439] Loop filtering is performed based on the plurality of loop filtering correction parameters and the plurality of groups of filter coefficients.

[0440] Optionally, the correction index parameter includes a luminance correction index parameter of a decoded frame luminance component and a chrominance correction index parameter of a decoded frame chrominance component;

[0441] The luma correction index parameter corresponds to a luma loop filter correction parameter of a luma component of a decoded frame, and the chroma correction index parameter corresponds to a chroma loop filter correction parameter of a chroma component of a decoded frame;

[0442] When the luma correction index parameter is the same as the chroma correction index parameter, the luma loop filter correction parameter is the same as the chroma loop filter correction parameter.

[0443] Optionally, the luminance loop filter correction parameter and the chrominance loop filter correction parameter are parameters selected from the same parameter list.

[0444] Optionally, the parameter list includes at least one of the following values: 1024, 181, 32, 6.

[0445] Figure 19 FIG2 is a schematic block diagram of a nonlinear loop filtering apparatus 60 according to an embodiment of the present application. The loop filtering apparatus 60 can be configured in a video encoding apparatus or a video decoding apparatus.

[0446] like Figure 19 As shown, the nonlinear loop filtering device 60 includes: a processor 61 and a memory 62;

[0447] The memory 62 may be used to store programs, and the processor 61 may be used to execute the programs stored in the memory to perform the following operations:

[0448] Determining loop filter correction parameters for a luminance component and a chrominance component of the image frame;

[0449] The loop filter correction parameter of the luminance component and the loop filter correction parameter of the chrominance component are parameters selected from the same parameter list.

[0450] Optionally, the parameter list includes at least one of the following values: 1024, 181, 32, 6.

[0451] Optionally, the processor 61 is specifically configured to: determine a brightness correction index parameter of the brightness component and a chroma index parameter of the chroma component;

[0452] Determining a loop filter correction parameter of the luminance component according to the luminance correction index parameter, wherein the chrominance index parameter corresponds to the loop filter correction parameter of the chrominance component;

[0453] When the luma correction index parameter is the same as the chroma correction index parameter, the loop filter correction parameter of the chroma component is the same as the loop filter correction parameter of the luma component.

[0454] Optionally, the image frame is an encoded frame, and the nonlinear loop filtering device 60 is provided in a video encoding device; or, the image frame is a decoded frame, and the nonlinear loop filtering device 60 is provided in a video decoding device.

[0455] An embodiment of the present application further provides an electronic device, which may include the loop filtering device of the various embodiments of the present application described above.

[0456] It should be understood that the processor in the embodiments of the present application can be an integrated circuit chip with signal processing capabilities. During implementation, each step of the above-mentioned method embodiment can be completed by hardware integrated logic circuits in the processor or by software instructions. The above-mentioned processors include, but are not limited to, the following: general-purpose processors, central processing units (CPUs), digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components. The methods, steps, and logic block diagrams disclosed in the embodiments of the present application can be implemented or executed. The general-purpose processor can be a microprocessor or any conventional processor. The steps of the methods disclosed in the embodiments of the present application can be directly implemented and executed by a hardware decoding processor, or by a combination of hardware and software modules in the decoding processor. The software modules can be located in a storage medium well-known in the art, such as random access memory, flash memory, read-only memory, programmable read-only memory, electrically erasable programmable memory, registers, etc. The storage medium is located in the memory, and the processor reads the information in the memory and, in conjunction with its hardware, completes the steps of the above-mentioned method.

[0457] It is understood that the memory of the embodiments of the present application may be a volatile memory or a non-volatile memory, or may include both volatile and non-volatile memories. Among them, the non-volatile memory may 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 may be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), and direct RAM bus RAM (DR RAM). It should be noted that the memory of the systems and methods described herein is intended to include, but is not limited to, these and any other suitable types of memory.

[0458] The embodiment of the present application also provides a computer-readable storage medium, which stores one or more programs, wherein the one or more programs include instructions, which, when executed by a portable electronic device including multiple application programs, can enable the portable electronic device to execute Figures 6 to 14 The method of the embodiment shown.

[0459] The present application also provides a computer program comprising instructions, which, when executed by a computer, enables the computer to execute Figures 6 to 14 The method of the embodiment shown.

[0460] The embodiment of the present application also provides a chip, which includes an input and output interface, at least one processor, at least one memory and a bus, wherein the at least one memory is used to store instructions, and the at least one processor is used to call the instructions in the at least one memory to execute Figures 6 to 14 The method of the embodiment shown.

[0461] Those skilled in the art will appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professional and technical personnel can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.

[0462] Those skilled in the art will clearly understand that, for the convenience and brevity of description, the specific working processes of the systems, devices and units described above can refer to the corresponding processes in the aforementioned method embodiments and will not be repeated here.

[0463] In the several embodiments provided in this application, it should be understood that the disclosed systems, devices and methods can be implemented in other ways. For example, the device embodiments described above are merely schematic. For example, the division of the units is merely a logical function division. In actual implementation, there may be other division methods, such as multiple units or components can be combined or integrated into another system, or some features can be ignored or not executed. Another point is that the mutual coupling or direct coupling or communication connection shown or discussed can be through some interfaces, indirect coupling or communication connection of devices or units, which can be electrical, mechanical or other forms.

[0464] The units described as separate components may or may not be physically separate, and the components shown as units may or may not be physical units, that is, they may be located in one place or distributed across multiple network units. Some or all of these units may be selected to achieve the purpose of this embodiment according to actual needs.

[0465] In addition, each functional unit in each embodiment of the present application may be integrated into one processing unit, or each unit may exist physically separately, or two or more units may be integrated into one unit.

[0466] If the functions are implemented in the form of software functional units and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application, or the part that contributes to the prior art, or the 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, including a number of instructions for enabling a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the method described in each embodiment of the present application. The aforementioned storage medium includes various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.

[0467] The above description is merely a specific embodiment of the present application, but the scope of protection of the present application is not limited thereto. Any changes or substitutions that can be easily conceived by a person skilled in the art within the technical scope disclosed in the present application should be included in the scope of protection of the present application. Therefore, the scope of protection of the present application should be based on the scope of protection of the claims.

Claims

1. A video encoding method, characterized in that: include: Determining multiple sets of filter coefficients for loop filtering; Encoding the plurality of groups of filter coefficients using a non-differential encoding method; Determining loop filter correction parameters for a luminance component and a chrominance component of the image frame; The loop filter correction parameter of the luminance component and the loop filter correction parameter of the chrominance component are parameters selected from the same parameter list; The luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component and the chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component are encoded.

2. The method according to claim 1, characterized in that The determining of the loop filtering correction parameters of the luminance component and the chrominance component of the image frame includes: Determining a luminance correction index parameter of the luminance component and a chrominance index parameter of the chrominance component; Determining a loop filter correction parameter of the luminance component according to the luminance correction index parameter, wherein the chrominance index parameter corresponds to the loop filter correction parameter of the chrominance component; When the luma correction index parameter is the same as the chroma correction index parameter, the loop filter correction parameter of the chroma component is the same as the loop filter correction parameter of the luma component.

3. The method according to claim 1 or 2, characterized in that The encoding of the luminance correction index parameter corresponding to the loop filtering correction parameter of the luminance component and the chrominance correction index parameter corresponding to the loop filtering correction parameter of the chrominance component includes: The luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component and the chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component are encoded using a non-exponential Golomb coding method.

4. The method according to claim 2, characterized in that The values ​​of the brightness correction index parameter and the chroma correction index parameter are integers between 0 and 3.

5. The method according to claim 3, characterized in that The non-exponential Golomb coding method is a fixed-length code coding method, and the number of coding bits of the fixed-length code coding method is 2.

6. A video decoding method, characterized in that: include: Get the code stream of loop filtering; Decoding the indication information indicating the number of filter coefficient groups in the code stream to determine that the filter coefficients are multiple groups; Decoding the filter coefficient code stream in the code stream using a non-differential decoding method to obtain multiple groups of filter coefficients; Decoding the code stream to obtain a luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component of the image frame and a chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component; The loop filter correction parameter of the luminance component and the loop filter correction parameter of the chrominance component are parameters selected from the same parameter list.

7. The method according to claim 6, characterized in that The obtaining of the loop filtering correction parameters of the luminance component and the chrominance component of the image frame includes: Obtaining a luminance correction index parameter of the luminance component and a chrominance index parameter of the chrominance component; Determining a loop filter correction parameter of the luminance component according to the luminance correction index parameter, wherein the chrominance index parameter corresponds to the loop filter correction parameter of the chrominance component; When the luma correction index parameter is the same as the chroma correction index parameter, the loop filter correction parameter of the chroma component is the same as the loop filter correction parameter of the luma component.

8. The method according to claim 6 or 7, characterized in that Decoding the code stream to obtain a luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component of the image frame and a chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component, including: A non-exponential Golomb coding method is used to decode the luminance correction index parameter corresponding to the loop filtering correction parameter of the luminance component and the chrominance correction index parameter corresponding to the loop filtering correction parameter of the chrominance component.

9. The method according to claim 6, characterized in that The values ​​of the brightness correction index parameter and the chroma correction index parameter are integers between 0 and 3.

10. The method according to claim 8, characterized in that The non-exponential Golomb coding method is a fixed-length code coding method, and the number of coding bits of the fixed-length code coding method is 2.

11. An encoder, characterized in that: include: processor, The processor is configured to: Determining multiple sets of filter coefficients for loop filtering; Encoding the plurality of groups of filter coefficients using a non-differential encoding method; Determining loop filter correction parameters for a luminance component and a chrominance component of the image frame; The loop filter correction parameter of the luminance component and the loop filter correction parameter of the chrominance component are parameters selected from the same parameter list; The luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component and the chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component are encoded.

12. A decoder, characterized in that: include: processor, The processor is configured to: Decoding the indication information indicating the number of filter coefficient groups in the bit stream to determine that the filter coefficients are multiple groups; Decoding the filter coefficient code stream in the code stream using a non-differential decoding method to obtain multiple groups of filter coefficients; Decoding the code stream to obtain a luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component of the image frame and a chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component; The loop filter correction parameter of the luminance component and the loop filter correction parameter of the chrominance component are parameters selected from the same parameter list.

13. A computer-readable storage medium for storing a code stream, wherein: The code stream is formed by a computer program, wherein the computer program is executed by a processor to implement the following method: Determining multiple sets of filter coefficients for loop filtering; Encoding the plurality of groups of filter coefficients using a non-differential encoding method; Determining loop filter correction parameters for a luminance component and a chrominance component of the image frame; The loop filter correction parameter of the luminance component and the loop filter correction parameter of the chrominance component are parameters selected from the same parameter list; Encoding a luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component and a chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component; The code stream includes indication information indicating the number of filter coefficient groups and the filter coefficients.

14. A method for generating a bit stream, characterized in that: include: Determining multiple sets of filter coefficients for loop filtering; Encoding the plurality of groups of filter coefficients using a non-differential encoding method; Determining loop filter correction parameters for a luminance component and a chrominance component of the image frame; The loop filter correction parameter of the luminance component and the loop filter correction parameter of the chrominance component are parameters selected from the same parameter list; The luminance correction index parameter corresponding to the loop filter correction parameter of the luminance component and the chrominance correction index parameter corresponding to the loop filter correction parameter of the chrominance component are encoded to generate a bit stream.

Citation Information

Patent Citations

  • Geometry transformation-based adaptive loop filtering

    CN109565594A