CN-121986493-A - Encoding/decoding method, encoder, decoder, and storage medium
Abstract
The application discloses a coding and decoding method, a coder, a decoder and a storage medium, wherein at least two residual scaling parameters of a current block are determined at a coding and decoding end (S501), sample residual errors of the current block are determined according to pre-filtering reconstructed samples and post-filtering reconstructed samples of the current block (S502), the sample residual errors of the current block are classified and scaled according to the at least two residual scaling parameters to obtain first scaled residual errors of the current block (S503), and the first reconstructed samples of the current block are determined according to the pre-filtering reconstructed samples and the first scaled residual errors of the current block (S504). In this way, by classifying samples and scaling sample residuals of different sample types by adopting different residual scaling parameters, the accuracy of the scaled residuals is improved, and therefore, the quality of reconstructed images and the coding and decoding efficiency are improved.
Inventors
- XIE ZHIHUANG
Assignees
- OPPO广东移动通信有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20230927
Claims (20)
- A decoding method applied to a decoder, the method comprising: decoding the code stream, and determining at least two residual scaling parameters of the current block; Determining a sample residual error of the current block according to the pre-filtering reconstructed sample and the post-filtering reconstructed sample of the current block; Classifying and scaling the sample residual of the current block according to the at least two residual scaling parameters to obtain a first scaled residual of the current block; And determining a first reconstructed sample of the current block according to the pre-filtering reconstructed sample of the current block and the first scaled residual error.
- The method of claim 1, wherein the decoding the bitstream, determining at least two residual scaling parameters for the current block, comprises decoding the bitstream, determining a first residual scaling parameter.
- The method according to claim 1 or2, wherein said decoding a bitstream, determining at least two residual scaling parameters of a current block, comprises: Decoding the code stream to obtain an index value of a second residual scaling parameter; and determining the second residual scaling parameter from a residual scaling parameter list according to the index value of the second residual scaling parameter.
- The method of claim 1, wherein the decoding a bitstream, determining at least two residual scaling parameters for a current block, comprises: Decoding the code stream, and determining at least two residual scaling parameters of an image unit where the current block is located.
- The method according to any of claims 1 to 4, wherein said decoding a bitstream, determining at least two residual scaling parameters for a current block, comprises: decoding the code stream and determining first indication information; If the residual scaling technology of the current block is determined according to the first indication information, decoding the code stream, and determining at least two residual scaling parameters of the current block.
- The method of claim 5, wherein the first indication information is at least one of: A frame-level first syntax element identification for indicating whether the residual scaling technique is used for the frame in which the current block is located; A slice-level first syntax element identification for indicating whether a slice in which a current block is located uses the residual scaling technique; the first syntax element identification at the coding tree unit level is used for indicating whether the residual scaling technology is used for the coding tree unit where the current block is located.
- The method according to claim 1 or 5, wherein said decoding a bitstream, determining at least two residual scaling parameters of a current block, comprises: Decoding the code stream and determining second indication information; And if the at least two residual scaling parameters are determined to be decoded according to the second indication information, decoding the code stream, and determining the at least two residual scaling parameters of the current block.
- The method of claim 7, wherein the method further comprises: if a single residual scaling parameter is determined to be decoded according to the second indication information, a code stream is decoded, and a third residual scaling parameter is determined; scaling the sample residual of the current block according to the third residual scaling parameter to obtain a second scaled residual of the current block; And determining a second reconstructed sample of the current block according to the pre-filter reconstructed sample of the current block and the second scaled residual error.
- The method according to claim 7 or 8, wherein the method further comprises: If the index value of the single residual scaling parameter is determined to be decoded according to the second indication information, the code stream is decoded, and the index value of the fourth residual scaling parameter is determined; determining the fourth residual scaling parameter from a residual scaling parameter list according to the index value of the fourth residual scaling parameter; scaling the sample residual of the current block according to the fourth residual scaling parameter to obtain a third scaled residual of the current block; and determining a third reconstruction sample of the current block according to the pre-filtering reconstruction sample of the current block and the third scaled residual error.
- The method of any of claims 7 to 9, wherein the second indication information comprises a second syntax element identification; The decoding the code stream, determining second indication information, including: Decoding the code stream, and determining the second syntax element identification; If the second syntax element is identified as a first value, determining to decode at least two residual scaling parameters; and if the second syntax element identifier is not the first numerical value, determining an index value of a single residual scaling parameter to be decoded, and determining an index value of the fourth residual scaling parameter according to the second syntax element identifier.
- The method of claim 10, wherein the second indication information further comprises a third syntax element identification; The decoding the code stream, determining second indication information, including: If the second syntax element identifier is the first value, decoding a code stream, and determining the third syntax element identifier; If the third syntax element is identified as a second value, determining a decoding single residual scaling parameter; And if the third syntax element is identified as a third value, determining to decode at least two residual scaling parameters.
- The method of claim 1, wherein the method further comprises: acquiring sample classification information; And classifying samples of the current block according to the sample classification information, and determining the sample type of each sample in the current block, wherein one sample type corresponds to one residual scaling parameter.
- The method of claim 12, wherein the sample classification information comprises an edge image of a current block, wherein the edge image comprises edge information for each sample; The obtaining sample classification information includes: Acquiring a reconstructed image of a current block; and carrying out edge detection on the reconstructed image based on the first edge detection operator to determine an edge image.
- The method of claim 13, wherein the obtaining sample classification information when the reconstructed samples are chroma component reconstructed samples, further comprises: Determining an edge image of the luminance component and an edge image of the chrominance component; And determining a final edge image of the chrominance component according to the edge image of the chrominance component and the edge image of the luminance component.
- The method of claim 13, wherein the edge information comprises edge strength, The step of classifying samples of the current block according to the sample classification information, and determining the sample type of each sample in the current block comprises the following steps: When the edge intensity of a first sample is in a first threshold range, determining that the first sample is of a first sample type; and when the edge intensity of the second sample is in a second threshold range, determining that the second sample is of a second sample type.
- The method of claim 12, wherein the sample classification information comprises one of image partition information of the current block, a prediction mode of the current block, and a sample residual of the current block.
- An encoding method applied to an encoder, the method comprising: Determining at least two residual scaling parameters of the current block; Determining a sample residual error of the current block according to the pre-filtering reconstructed sample and the post-filtering reconstructed sample of the current block; Classifying and scaling the sample residual of the current block according to the at least two residual scaling parameters to obtain a first scaled residual of the current block; determining a first reconstructed sample of the current block according to the pre-filter reconstructed sample of the current block and the first scaled residual error; Performing cost calculation according to the original sample of the current block and the first reconstructed sample, and determining first generation values corresponding to the at least two residual scaling parameters; And if the first generation value is the minimum generation value, encoding the at least two residual scaling parameters.
- The method of claim 17, wherein the determining at least two residual scaling parameters for the current block comprises: Sample classification is carried out on the original sample, the pre-filtering reconstructed sample and the post-filtering reconstructed sample according to sample classification information, and at least two sample types are determined; And carrying out residual scaling parameter calculation according to the original sample, the pre-filtering reconstructed sample and the post-filtering reconstructed sample of the first sample type, and determining a first residual scaling parameter of the first sample type.
- The method of claim 18, wherein the determining at least two residual scaling parameters for the current block comprises: Traversing a residual scaling parameter list, determining a second residual scaling parameter of the first sample type.
- The method of claim 19, wherein the encoding the at least two residual scaling parameters comprises encoding the first residual scaling parameter and/or encoding an index value of the second residual scaling parameter.
Description
Encoding/decoding method, encoder, decoder, and storage medium Technical Field The embodiment of the application relates to the technical field of video encoding and decoding, in particular to an encoding and decoding method, an encoder, a decoder and a storage medium. Background The residual scaling technique is an important technique in image coding and decoding, and is mainly used for improving the compression efficiency and reconstruction quality of images. The principle of the residual scaling technique is to calculate the residual between the filtered reconstructed image and the unfiltered reconstructed image, then scale the residual and add the scaled residual back to the unfiltered reconstructed image. The existing residual scaling technology generally uses the same residual scaling parameter for a whole frame of image, and the mode can bring a certain coding performance gain, but does not consider the conditions of different areas or different texture degrees in the image, and uses the same residual scaling parameter for the areas with larger texture variation and the areas with smaller texture variation, so that the residual is not adjusted in place, and the reconstruction quality of the final image is affected. Disclosure of Invention The embodiment of the application provides a coding and decoding method, a coder, a decoder and a storage medium, which can improve the accuracy of residual errors after scaling, thereby improving the quality of reconstructed images and coding and decoding efficiency. The technical scheme of the embodiment of the application can be realized as follows: in a first aspect, an embodiment of the present application provides a decoding method, applied to a decoder, including: decoding the code stream, and determining at least two residual scaling parameters of the current block; Determining a sample residual error of the current block according to the pre-filtering reconstructed sample and the post-filtering reconstructed sample of the current block; Classifying and scaling the sample residual of the current block according to the at least two residual scaling parameters to obtain a first scaled residual of the current block; And determining a first reconstructed sample of the current block according to the pre-filtering reconstructed sample of the current block and the first scaled residual error. In a second aspect, an embodiment of the present application provides an encoding method, applied to an encoder, including: Determining at least two residual scaling parameters of the current block; Determining a sample residual error of the current block according to the pre-filtering reconstructed sample and the post-filtering reconstructed sample of the current block; Classifying and scaling the sample residual of the current block according to the at least two residual scaling parameters to obtain a first scaled residual of the current block; determining a first reconstructed sample of the current block according to the pre-filter reconstructed sample of the current block and the first scaled residual error; Performing cost calculation according to the original sample of the current block and the first reconstructed sample, and determining first generation values corresponding to the at least two residual scaling parameters; And if the first generation value is the minimum generation value, encoding the at least two residual scaling parameters. In a third aspect, an embodiment of the present application provides an encoder, including a first determining unit, a first processing unit, and an encoding unit, where: The first determining unit is configured to determine at least two residual scaling parameters of the current block; the first processing unit is configured to determine a sample residual error of the current block according to the pre-filtering reconstructed sample and the post-filtering reconstructed sample of the current block; the first processing unit is further configured to perform classified scaling on the sample residual of the current block according to the at least two residual scaling parameters to obtain a first scaled residual of the current block; the first processing unit is further configured to determine a first reconstructed sample of the current block according to the pre-filter reconstructed sample of the current block and the first scaled residual; The first processing unit is further configured to perform cost calculation according to the original sample of the current block and the first reconstructed sample, and determine a first generation value corresponding to the at least two residual scaling parameters; The encoding unit is configured to encode the at least two residual scaling parameters if the first generation value is a minimum generation value. In a fourth aspect, an embodiment of the present application provides an encoder, the encoder comprising a first memory and a first processor, wherein, A first memory for storing a computer