Method for coding and decoding, device, and storage medium
By combining context model and bypass binary arithmetic coding, the image encoding and decoding process is optimized, and the problem of large storage overhead is solved and more efficient encoding and decoding performance is achieved.
Patent Information
- Application Number
- JP2024196154
- Authority / Receiving Office
- JP · JP
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2019-06-21
- Filing Date
- 2024-11-08
- Publication Date
- 2025-02-04
AI Technical Summary
In the process of image encoding and decoding, the prior art requires adaptive binary arithmetic encoding and decoding based on different context models, resulting in large storage overhead and high process complexity.
Using a combination of adaptive binary arithmetic coding and bypass binary arithmetic coding based on context model, the number of context models required during encoding and decoding is reduced through different processing methods of ISP instruction information and other prediction mode instruction information.
It effectively reduces the storage overhead and complexity of the encoding and decoding process, while maintaining encoding performance and reducing memory requirements.
Smart Images

Figure 2025016784000001_ABST
Abstract
Description
[Technical field]
[0001] This invention claims priority to a Chinese patent application, application number 201910545251.0, filed on June 21, 2019, entitled "ENCODED AND DECODING METHOD, APPARATUS, AND STORAGE MEDIUM," the entire contents of which are incorporated herein by reference.
[0002] The present invention relates to the field of image processing technology, and in particular to an encoding / decoding method, apparatus, and storage medium. [Background technology]
[0003] Currently, in the field of image coding and decoding technology, when the coding side codes an image block, it usually needs to transmit these syntax elements to the coding stream of the image block to the decoding side by coding some syntax elements using a context model. After the decoding side receives the coding stream of the image block, it needs to reconstruct the image based on these syntax elements by analyzing these syntax elements according to the same context model as the coding side. These syntax elements may be various indication information such as first ISP indication information or second ISP indication information, where the first ISP indication information is used to indicate whether to activate the intra sub-block prediction mode, and the second ISP indication information is used to indicate the sub-block division method of the intra sub-block prediction mode.
[0004] However, for different syntax elements, the context-based adaptive binary arithmetic encoding / decoding may need to be performed based on different context models, and for the same syntax element, the context-based adaptive binary arithmetic encoding / decoding may need to be performed based on different context models in different situations, in which case the encoding / decoding process needs to use more context models, which increases the complexity of the encoding / decoding process and increases the memory overhead. Summary of the Invention [Means for solving the problem]
[0005] The embodiments of the present invention provide an encoding / decoding method and a storage medium for solving the problem that many context models are required in the encoding / decoding process in the related art, and the memory overhead is large. The technical solution is as follows:
[0006] In one aspect, when it is determined to perform encoding or decoding of a first ISP indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the first ISP indication information based on a context model, and the first ISP indication information is used to indicate whether to activate an intra sub-block prediction mode;
[0007] When it is determined to perform encoding or decoding of the second ISP indication information, performing binary arithmetic encoding or decoding based on a bypass on the second ISP indication information, and the second ISP indication information is used to indicate a sub-block division manner of an intra sub-block prediction mode. This relates to encoding and decoding methods.
[0008] In one aspect, when it is determined to perform encoding or decoding of the first ISP indication information, performing bypass-based binary arithmetic encoding or decoding on the first ISP indication information, the first ISP indication information being used to indicate whether to activate an intra sub-block prediction mode; When it is determined to perform encoding or decoding of the second ISP indication information, performing bypass-based binary arithmetic encoding or decoding on the second ISP indication information, the second ISP indication information being used to indicate a sub-block division type of an intra sub-block prediction mode. This relates to encoding and decoding methods.
[0009] In one aspect, the method includes: if a width and height size of a current block is M*N, and if M is less than 64 and N is less than 64, the current block does not support multi-row prediction mode; This relates to encoding and decoding methods.
[0010] In one possible embodiment of the present invention, if the width and height size of the current block is 4*4, the current block does not support multi-row prediction mode.
[0011] In one aspect, when a current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 3, and reference row indication information corresponding to the multi-row prediction mode occupies up to 2 bits, and the reference row indication information is used to indicate index information of a target reference row used when predicting the current block based on the multi-row prediction mode, performing context-based adaptive binary arithmetic coding or adaptive binary arithmetic decoding on a first bit of the reference row indication information based on a context model; When the second bit of the reference row indication information needs to be encoded or decoded, performing bypass-based binary arithmetic encoding or decoding on the second bit of the reference row indication information. This relates to encoding and decoding methods.
[0012] In one aspect, when a current block supports a multi-row prediction mode, the number of candidate reference rows corresponding to the multi-row prediction mode is 3, the reference row indication information corresponding to the multi-row prediction mode occupies up to 3 bits, and the reference row indication information is used to indicate index information of a target reference row used when predicting the current block based on the multi-row prediction mode, performing context-based adaptive binary arithmetic coding or adaptive binary arithmetic decoding on a first bit of the reference row indication information based on a context model; When the second bit of the reference row indication information needs to be encoded or decoded, performing binary arithmetic encoding or decoding based on a bypass on the second bit of the reference row indication information; When the third bit of the reference row indication information needs to be encoded or decoded, performing bypass-based binary arithmetic encoding or decoding on the third bit of the reference row indication information. This relates to encoding and decoding methods.
[0013] In one aspect, if a current block supports a multi-row prediction mode, and a number of candidate reference rows corresponding to the multi-row prediction mode is 3, a candidate reference row having index information of 0 is row 0, which is a row adjacent to a boundary of the current block, a candidate reference row having index information of 1 is row 1, which is a row next adjacent to a boundary of the current block, and a candidate reference row having index information of 2 is row 2, which is a row adjacent to the row 1; predicting the current block based on the multi-row prediction mode includes predicting the current block based on a target reference row; Wherein, the target reference row is determined based on the reference row indication information; When the index information indicated by the reference row indication information is 0, the target reference row is the 0th row; When the index information indicated by the reference row indication information is 1, the target reference row is the first row; When the index information indicated by the reference row indication information is 2, the target reference row is the second row. This relates to encoding and decoding methods.
[0014] In one aspect, when it is determined that a current block is to activate a multi-row prediction mode, and a number of candidate reference rows corresponding to the multi-row prediction mode is 3, a candidate reference row having index information of 0 is row 0, the row 0 being adjacent to a boundary of the current block, a candidate reference row having index information of 1 is row 1, the row 1 being next adjacent to a boundary of the current block, a candidate reference row having index information of 2 is row 2, the row 2 being adjacent to the row 1, and a candidate reference row having index information of 3 is row 3, the row 3 being adjacent to the row 2; predicting the current block based on the multi-row prediction mode includes predicting the current block based on a target reference row; Wherein, the target reference row is determined based on the reference row indication information; When the index information indicated by the reference row indication information is 0, the target reference row is the 0th row; When the index information indicated by the reference row indication information is 1, the target reference row is the second row; When the index information indicated by the reference row indication information is 2, the target reference row is the third row. This relates to encoding and decoding methods.
[0015] In one aspect, if the current block supports a multi-row prediction mode, Before predicting the current block based on the multi-row prediction mode, a row number indication information is decoded, and the row number indication information is used to indicate a row number of a candidate reference row corresponding to the multi-row prediction mode; determining a number of candidate reference rows corresponding to the multi-row prediction mode based on the row number indication information; determining a target reference row based on the number of candidate reference rows corresponding to the multi-row prediction mode and the reference row indication information, the reference row indication information being used to indicate index information of a target reference row used when predicting the current block based on the multi-row prediction mode; predicting the current block based on the target reference row; Including, This relates to a method of decoding.
[0016] In one possible embodiment of the invention, the row number indication information is present in a sequence parameter set, an image parameter set, at slice level or at tile level.
[0017] When the current block activates an affine prediction mode or activates another prediction mode other than the affine prediction mode, when encoding or decoding a motion vector difference of the current block, if the current block supports an adaptive motion vector precision AMVR mode, when encoding or decoding a first AMVR indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the first AMVR indication information based on a first context model, and the first AMVR indication information is used to indicate whether to activate an AMVR mode; When the first AMVR indication information indicates that the current block activates an AMVR mode, performing context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the second AMVR indication information based on a second context model, the second AMVR indication information is used to indicate pixel-precision index information used when encoding or decoding a motion vector differential in the AMVR mode, and the first context model and the second context model are different. This relates to encoding and decoding methods.
[0018] In one aspect, when a current block activates an affine prediction mode, when encoding or decoding a motion vector differential of the current block, if the current block supports an AMVR mode, when encoding or decoding a first AMVR indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the first AMVR indication information based on a first context model, and when the first AMVR indication information indicates that the current block activates an AMVR mode, perform bypass-based binary arithmetic coding or decoding on the second AMVR indication information; When the current block activates a prediction mode other than an affine prediction mode, when encoding or decoding a motion vector differential of the current block, if the current block supports an AMVR mode, when encoding or decoding a first AMVR indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the first AMVR indication information based on a second context model, and when the first AMVR indication information indicates that the current block activates an AMVR mode, perform bypass-based binary arithmetic coding or decoding on the second AMVR indication information; Including, wherein the first context model and the second context model are different, the first AMVR indication information is used to indicate whether to activate an AMVR mode, and the second AMVR indication information is used to indicate pixel-precision index information used when encoding or decoding a motion vector differential in the AMVR mode. The present invention relates to an encoding / decoding method comprising the steps of:
[0019] In one aspect, when a current block activates an affine prediction mode or activates another prediction mode other than an affine prediction mode, if the current block supports an adaptive motion vector precision AMVR mode when encoding or decoding a motion vector difference of the current block, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the first AMVR indication information based on a first context model when encoding or decoding a first AMVR indication information, and the first AMVR indication information is used to indicate whether to activate an AMVR mode; When the first AMVR indication information indicates that the current block activates an AMVR mode, a bypass-based binary arithmetic coding or decoding is performed on a second AMVR indication information, and the second AMVR indication information is used to indicate pixel-precision index information used when coding or decoding a motion vector differential in the AMVR mode. This relates to encoding and decoding methods.
[0020] In one aspect, when a current block activates intra sub-block prediction, and a target prediction mode of the intra sub-block prediction is in a most probable intra prediction mode MPM list, and the current block is a luminance block, when predicting the current block based on the intra sub-block prediction, decoding is performed on prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a first context model, and other bits are obtained by performing bypass-based binary arithmetic decoding; Determine a target prediction mode of intra sub-block prediction activated by the current block from the MPM list based on prediction mode index information, the prediction mode index information being used to indicate index information of the target prediction mode in the MPM list; predicting the current block based on the target prediction mode; or When a current block activates conventional intra prediction, and a target prediction mode of conventional intra prediction is from an MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, and other bits are obtained by performing bypass-based binary arithmetic decoding, and the second context model and the first context model are the same context model; Determine a target prediction mode of conventional intra prediction activated by the current block from the MPM list based on prediction mode index information, the prediction mode index information being used to indicate index information of the target prediction mode in the MPM list; predicting the current block based on the target prediction mode; The present invention relates to a method for decoding, comprising:
[0021] In one aspect, when a current block activates intra sub-block prediction, if a target prediction mode of intra sub-block prediction exists in the MPM list and the current block is a luminance block, when predicting the current block based on intra sub-block prediction, decoding is performed on prediction mode index information, where all bits of the prediction mode index information are obtained by performing binary arithmetic decoding based on bypass; Determine a target prediction mode of intra sub-block prediction activated by the current block from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode in the MPM list; predicting a current block based on the target prediction mode; or When a current block initiates conventional intra prediction, if a target prediction mode of conventional intra prediction is from the MPM list and the current block is a luminance block, when predicting the current block based on conventional intra prediction, decoding is performed on prediction mode index information, where all bits of the prediction mode index information are obtained by performing binary arithmetic decoding based on bypass; Determine a target prediction mode of conventional intra prediction activated by the current block from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode in the MPM list; predicting a current block based on the target prediction mode; The present invention relates to a method for decoding, comprising:
[0022] In one aspect, when a current block initiates intra sub-block prediction, if a target prediction mode of intra sub-block prediction exists in an MPM list and the current block is a luminance block, when predicting the current block based on intra sub-block prediction, decoding is performed on prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model, and another bit is obtained by performing bypass-based binary arithmetic decoding; Determine a target prediction mode of intra sub-block prediction activated by the current block from the MPM list based on the prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode in the MPM list; predicting a current block based on the target prediction mode; or When a current block activates conventional intra prediction, and a target prediction mode of conventional intra prediction is from an MPM list, and the current block is a luminance block, when predicting the current block based on conventional intra prediction, decoding is performed on prediction mode index information, where all bits of the prediction mode index information are obtained by performing binary arithmetic decoding based on bypass; Determine a target prediction mode of conventional intra prediction activated by the current block from the MPM list based on the prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode in the MPM list; predicting the current block based on the target prediction mode. This relates to a method of decoding.
[0023] In one aspect, when the current block is a luminance block, when predicting the current block based on intra sub-block prediction, a prediction mode index information is decoded, and all bits of the prediction mode index information are obtained by performing binary arithmetic decoding based on bypass; Determine a target prediction mode of intra sub-block prediction activated by the current block from the MPM list based on the prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode in the MPM list; predicting the current block based on the target prediction mode; or When a current block activates conventional intra prediction, and a target prediction mode of conventional intra prediction is from an MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a context model, and another bit of the prediction mode index information is obtained by performing bypass-based binary arithmetic decoding; Determine a target prediction mode of conventional intra prediction activated by the current block from the MPM list based on the prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode in the MPM list; predicting the current block based on the target prediction mode. This relates to a method of decoding.
[0024] In one aspect, when a current block triggers intra sub-block prediction, if a target prediction mode of intra sub-block prediction exists in an MPM list and the current block is a luminance block, when predicting the current block based on intra sub-block prediction, decoding is performed on planar indication information, where the planar indication information is used to indicate whether a target prediction mode of intra sub-block prediction triggered by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic decoding based on a first context model; predicting the current block based on a planar prediction mode when determining, based on the planar indication information, that a target prediction mode of intra sub-block prediction initiated by the current block is a planar prediction mode; When it is determined based on the planar indication information that the target prediction mode of the intra sub-block prediction initiated by the current block is not a planar prediction mode, based on prediction mode index information, determine a target prediction mode of the intra sub-block prediction initiated by the current block from the MPM list, and predict the current block based on the target prediction mode; or When the current block activates conventional intra prediction, if a target prediction mode of conventional intra prediction is from an MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on planar indication information, where the planar indication information is used to indicate whether a target prediction mode activated by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, and the first context model and the second context model are the same; predicting the current block based on a planar prediction mode when determining, based on the planar indication information, that a target prediction mode activated by the current block is a planar prediction mode; When it is determined based on the planar indication information that the target prediction mode activated by the current block is not a planar prediction mode, determining a target prediction mode activated by the current block from the MPM list based on prediction mode index information, and predicting the current block based on the target prediction mode. This relates to a method of decoding.
[0025] In one aspect, when a current block initiates intra sub-block prediction, if a target prediction mode of the intra sub-block prediction exists in the MPM list and the current block is a luminance block, when predicting the current block based on the intra sub-block prediction, decoding is performed on planar indication information, where the planar indication information is used to indicate whether a target prediction mode of the intra sub-block prediction initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing binary arithmetic decoding based on bypass; predicting the current block based on a planar prediction mode when determining, based on the planar indication information, that a target prediction mode of intra sub-block prediction initiated by the current block is a planar prediction mode; When it is determined based on the planar indication information that the target prediction mode of the intra sub-block prediction initiated by the current block is not a planar prediction mode, based on prediction mode index information, determine a target prediction mode of the intra sub-block prediction initiated by the current block from the MPM list, and predict the current block based on the target prediction mode; or When the current block activates conventional intra prediction, if a target prediction mode of conventional intra prediction is from an MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on planar indication information, where the planar indication information is used to indicate whether a target prediction mode activated by the current block is a planar prediction mode, and the planar indication information is obtained by performing binary arithmetic decoding based on bypass; predicting the current block based on a planar prediction mode when determining, based on the planar indication information, that a target prediction mode activated by the current block is a planar prediction mode; When it is determined based on the planar indication information that the target prediction mode activated by the current block is not a planar prediction mode, based on prediction mode index information, determining a target prediction mode activated by the current block from the MPM list, and predicting the current block based on the target prediction mode. The present invention relates to a method for decoding a digital signal, comprising the steps of:
[0026] In one aspect, if a current block supports a cross-component prediction mode, the current block initiates a cross-component prediction mode, and the current block is a chrominance block, When predicting the current block based on a cross-component prediction mode, decoding is performed on chroma prediction mode index information, and the chroma prediction mode index information is used to indicate an index of a target prediction mode of the current block in a corresponding candidate prediction mode list, where a first bit of the chroma prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a first context model, a second bit of the chroma prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, the first context model and the second context model are different, and a third bit and a fourth bit of the chroma prediction mode index information are obtained by performing bypass-based binary arithmetic decoding; determining a target prediction mode for the current block from the candidate prediction mode list according to the chrominance prediction mode index information; predicting a current block based on the target prediction mode; Including, This relates to a method of decoding.
[0027] In one aspect, if a current block supports a cross-component prediction mode, the current block initiates a cross-component prediction mode, and the current block is a chrominance block, When predicting the current block based on a cross-component prediction mode, decoding is performed on chroma prediction mode index information, and the chroma prediction mode index information is used to indicate an index of a target prediction mode of the current block in a corresponding candidate prediction mode list, where a first bit of the chroma prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a context model, and a second bit, a third bit and a fourth bit of the chroma prediction mode index information are obtained by performing bypass-based binary arithmetic decoding; determining a target prediction mode for the current block from the candidate prediction mode list according to the chrominance prediction mode index information; predicting the current block based on the target prediction mode; Including, This relates to a method of decoding.
[0028] In one aspect, if a current block supports a cross-component prediction mode, the current block initiates a cross-component prediction mode, and the current block is a chrominance block, When predicting the current block based on a cross-component prediction mode, decoding is performed on chroma prediction mode index information, and the chroma prediction mode index information is used to indicate an index of a target prediction mode of the current block in a corresponding candidate prediction mode list; determining a target prediction mode for the current block from the candidate prediction mode list based on the chrominance prediction mode index information; where, when the chrominance prediction mode index information is 10, the target prediction mode is a first cross-component prediction mode; If the chrominance prediction mode index information is 110, the target prediction mode is a second cross-component prediction mode; If the chrominance prediction mode index information is 111, the target prediction mode is a second cross-component prediction mode; If the chromaticity prediction mode index information is 11110, the target prediction mode is a planar prediction mode; if the chrominance prediction mode index information is 111110, the target prediction mode is a vertical prediction mode; if the chrominance prediction mode index information is 1111110, the target prediction mode is a horizontal prediction mode; If the chrominance prediction mode index information is 1111111, the target prediction mode is a DC prediction mode; predicting the current block based on the target prediction mode; Including, This relates to encoding and decoding methods.
[0029] In one aspect, if a current block supports a cross-component prediction mode, the current block initiates a cross-component prediction mode, and the current block is a chrominance block, When predicting the current block based on a cross-component prediction mode, decoding is performed on chroma prediction mode index information, and the chroma prediction mode index information is used to indicate an index of a target prediction mode of the current block in a corresponding candidate prediction mode list; determining a target prediction mode for the current block from the candidate prediction mode list based on the chrominance prediction mode index information; where, when the chrominance prediction mode index information is 10, the target prediction mode is a first cross-component prediction mode; If the chrominance prediction mode index information is 110, the target prediction mode is a second cross-component prediction mode; If the chrominance prediction mode index information is 111, the target prediction mode is a second cross-component prediction mode; If the chromaticity prediction mode index information is 111100, the target prediction mode is a planar prediction mode; If the chrominance prediction mode index information is 111101, the target prediction mode is a vertical prediction mode; if the chrominance prediction mode index information is 111110, the target prediction mode is a horizontal prediction mode; If the chrominance prediction mode index information is 111111, the target prediction mode is a DC prediction mode; predicting the current block based on the target prediction mode. This relates to a method of decoding.
[0030] In one aspect, when luma and chroma of a current block share one partition tree, if a luma block corresponding to the current block has a width and height size of 64*64 and a chroma block corresponding to the current block has a size of 32*32, the current block does not support a cross-component prediction mode. This relates to encoding and decoding methods.
[0031] In one aspect, when a current block supports an adaptive loop filter ALF and the current block is a luminance block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on ALF indication information based on a target context model, where the ALF indication information is used to indicate whether the current block activates ALF, and the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF; or performing context-based adaptive binary arithmetic decoding on ALF indication information based on a target context model before performing a filtering process on the current block based on an ALF mode, when the current block supports ALF and the current block is a chrominance block, where the target context model is one context model selected from three different context models included in a second context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF, and the three context models included in the second context model set and the three context models included in the first context model set are different. This relates to a method of decoding.
[0032] In one aspect, if a current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on ALF indication information based on a target context model, where the ALF indication information is used to indicate whether the current block activates ALF, and the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF; or performing context-based adaptive binary arithmetic decoding on ALF indication information based on a target context model before performing a filtering process on the current block based on an ALF mode, when the current block supports ALF and the current block is a chrominance block, where the target context model is one context model selected from three different context models included in a second context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF, and the three context models included in the second context model set and the three context models included in the first context model set are the same. This relates to a method of decoding.
[0033] In one aspect, if a current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on ALF indication information based on a first context model, the ALF indication information being used to indicate whether the current block activates ALF; or If the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, where the second context model and the first context model are different. This relates to a method of decoding.
[0034] In one aspect, if a current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on ALF indication information based on a target context model, where the ALF indication information is used to indicate whether the current block activates ALF, and the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF; or When the current block supports ALF and the current block is a CB chrominance block, performing context-based adaptive binary arithmetic decoding on ALF indication information according to a first context model before performing a filtering process on the current block based on an ALF mode; or If the current block supports ALF and the current block is a CR chrominance block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, and a context model included in the first context model set, the first context model, and the second context model are different context models. This relates to a method of decoding.
[0035] In one aspect, when a current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on ALF indication information based on a first context model, the ALF indication information being used to indicate whether the current block activates ALF; or If the current block supports ALF and the current block is a CB chrominance block, performing context-based adaptive binary arithmetic decoding on ALF indication information based on a second context model before performing a filtering process on the current block based on an ALF mode; or If the current block supports ALF and the current block is a CR chrominance block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a third context model, where the first context model, the second context model and the third context model are different context models. The present invention relates to a method for decoding a digital signal, comprising the steps of:
[0036] In one aspect, if a current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on ALF indication information based on a first context model, the ALF indication information being used to indicate whether the current block activates ALF; or If the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on an ALF mode, performing context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, where the second context model and the first context model are the same context model. This relates to a method of decoding.
[0037] In one aspect, if a current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, performing a bypass-based binary arithmetic decoding on ALF indication information, the ALF indication information being used to indicate whether the current block activates ALF; or If the current block supports ALF and the current block is a chrominance block, performing bypass-based binary arithmetic decoding on the ALF indication information before performing a filtering process on the current block based on an ALF mode. This relates to a method of decoding.
[0038] In one aspect, if a current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic decoding on ALF indication information based on a context model, and the ALF indication information is used to indicate whether the current block activates ALF; or performing bypass-based binary arithmetic decoding on ALF indication information before performing a filtering process on the current block based on an ALF mode when the current block supports ALF, the current block activates ALF, and the current block is a chrominance block. This relates to a method of decoding.
[0039] In one aspect, if a current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, performing a bypass-based binary arithmetic decoding on ALF indication information, the ALF indication information being used to indicate whether the current block activates ALF; or If the current block supports ALF and the current block is a chrominance block, performing context-based adaptive binary arithmetic decoding on the ALF indication information according to a context model before performing a filtering process on the current block based on an ALF mode. This relates to a method of decoding.
[0040] In one aspect, if the width and height size of the current block is 32*32, the current block does not support matrix-based intra prediction mode. This relates to encoding and decoding methods.
[0041] In one aspect, if the current block supports a matrix-based intra-prediction mode, Before predicting the current block based on a matrix-based intra-prediction mode, perform context-based adaptive binary arithmetic decoding on MIP indication information based on a target context model, where the MIP indication information is used to indicate whether the current block activates a matrix-based intra-prediction mode, and the target context model is one context model selected from three different context models according to whether an upper block of the current block activates a matrix-based intra-prediction mode and whether a left block of the current block activates a matrix-based intra-prediction mode; When it is determined according to the MIP indication information that the current block is to initiate a matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block. This relates to a method of decoding.
[0042] In one aspect, if the current block supports a matrix-based intra-prediction mode, Before predicting the current block based on a matrix-based intra-prediction mode, perform context-based adaptive binary arithmetic decoding on MIP indication information based on a target context model, where the MIP indication information is used to indicate whether the current block activates a matrix-based intra-prediction mode, and the target context model is a context model selected from two different context models according to whether the current block satisfies a preset size condition; When it is determined according to the MIP indication information that the current block is to initiate a matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block. This relates to a method of decoding.
[0043] In one aspect, if the current block supports a matrix-based intra-prediction mode, Before predicting the current block based on a matrix-based intra-prediction mode, perform context-based adaptive binary arithmetic decoding on MIP indication information based on the same context model, and the MIP indication information is used to indicate whether the current block activates a matrix-based intra-prediction mode; When it is determined according to the MIP indication information that the current block is to initiate a matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block. This relates to a method of decoding.
[0044] In one aspect, if the current block supports a matrix-based intra-prediction mode, Before predicting the current block based on a matrix-based intra-prediction mode, perform a bypass-based binary arithmetic decoding on MIP indication information, and the MIP indication information is used to indicate whether the current block activates a matrix-based intra-prediction mode; When it is determined according to the MIP indication information that the current block is to initiate a matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block. This relates to a method of decoding.
[0045] In one aspect, decoding is performed on a first BDPCM indication information, and the first BDPCM indication information is used to indicate whether a current processing unit supports a BDPCM mode; performing decoding for the current processing unit based on the first BDPCM indication information; This relates to a method of decoding.
[0046] In one possible embodiment of the invention, the first BDPCM indication is present in a sequence parameter set, a picture parameter set, at the slice level or at the tile level.
[0047] In one aspect, encoding or decoding is performed on second BDPCM indication information, the second BDPCM indication information being used to indicate a size range of a processing unit that supports a BDPCM mode; determining whether the current block enables BDPCM encoding or decoding based on the second BDPCM indication information and a size of the current block; This relates to encoding and decoding methods.
[0048] In one possible embodiment of the invention, the second BDPCM indication is present in a sequence parameter set, a picture parameter set, at the slice level or at the tile level.
[0049] In one aspect, if the current block supports BDPCM mode, Performing context-based adaptive binary arithmetic decoding on third BDPCM indication information based on a context model, the third BDPCM indication information being used to indicate whether the current block activates a BDPCM mode; When the third BDPCM indication information indicates that the current block is to start a BDPCM mode, performing a bypass-based binary arithmetic decoding on a fourth BDPCM indication information, the fourth BDPCM indication information being used to indicate index information of a prediction direction of a BDPCM mode; performing BDPCM processing on the current block according to a prediction direction indicated by the fourth BDPCM indication information; This relates to a method of decoding.
[0050] In one aspect, if the current block supports BDPCM mode, performing bypass-based binary arithmetic decoding on third BDPCM indication information, the third BDPCM indication information being used to indicate whether the current block activates a BDPCM mode; When the third BDPCM indication information indicates that the current block is to start a BDPCM mode, performing a bypass-based binary arithmetic decoding on a fourth BDPCM indication information, the fourth BDPCM indication information being used to indicate index information of a prediction direction of a BDPCM mode; performing BDPCM processing on the current block according to a prediction direction indicated by the fourth BDPCM indication information; This relates to a method of decoding.
[0051] In one aspect, when it is determined that the current block activates intra sub-block prediction and the CBF indication information is to be encoded or decoded, the CBF indication information is subjected to context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding based on a target context model, in which the CBF indication information is used to indicate whether a transform block of the current block has a non-zero transform coefficient, and the target context model is a context model selected from two different context models included in a first context model set according to whether a transform block preceding the current block has a non-zero transform coefficient; or When the current block activates conventional intra prediction or activates a BDPCM mode, when it is determined to perform encoding or decoding of CBF indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the CBF indication information based on a target context model, where the target context model is a context model selected from two different context models included in a second context model set according to a division depth of a transform block of the current block, and the two context models included in the second context model set are different from the two context models included in the first context model set. This relates to encoding and decoding methods.
[0052] In one aspect, when the current block activates intra sub-block prediction, or activates conventional intra prediction, or activates a BDPCM mode, when it is determined to perform encoding or decoding of CBF indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the CBF indication information based on a target context model, where the CBF indication information is used to indicate whether a transform block of the current block has a non-zero transform coefficient, and the target context model is one context model selected from two different context models according to a division depth of the transform block of the current block. This relates to encoding and decoding methods.
[0053] In one aspect, when a current block activates intra sub-block prediction or conventional intra prediction, when it is determined to perform encoding or decoding of CBF indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the CBF indication information based on a target context model, where the CBF indication information is used to indicate whether a transform block of the current block has a non-zero transform coefficient, and the target context model is a context model selected from two different context models included in a first context model set according to a division depth of the transform block of the current block; or When the current block activates a BDPCM mode, when it is determined to encode or decode CBF indication information, perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the CBF indication information based on a target context model, where the target context model is a context model in the first context model set. This relates to encoding and decoding methods.
[0054] In one aspect, decoding a JCCR indication, the JCCR indication being used to indicate whether the current processing unit supports a JCCR mode; According to the JCCR indication information, determine that the current block supports a JCCR mode, and if the current block activates a JCCR mode, perform decoding on the current block according to a correlation between a blue chrominance CB component and a red chrominance CR component of the current block to obtain a chrominance residual coefficient of the current block. This relates to a method of decoding.
[0055] In one possible embodiment of the present invention, the JCCR indication information is present in a sequence parameter set, a picture parameter set, at slice level or at tile level.
[0056] In one aspect, a processor; a memory for storing processor-executable instructions; wherein the processor is configured to execute any of the encoding and decoding methods or the decoding method described above, The present invention relates to an encoding / decoding device comprising:
[0057] In one aspect, the present invention relates to a computer readable storage medium having instructions stored thereon which, when executed by a processor, implements the encoding / decoding method or the decoding method according to any of the above.
[0058] In one aspect, the present invention relates to a computer program product comprising instructions which, when run on a computer, cause the computer to carry out any of the encoding and decoding methods or the decoding method described above.
[0059] The beneficial effects of the technical solutions according to the embodiments of the present invention are as follows:
[0060] In an embodiment of the present invention, when it is determined that a first ISP indication information is to be encoded or decoded, context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding is performed on the first ISP indication information based on one context model, and when it is determined that a second ISP indication information is to be encoded or decoded, bypass-based binary arithmetic coding or decoding is performed on the second ISP indication information, thereby reducing the number of context models required for the encoding / decoding process, reducing the complexity of the encoding / decoding process, and reducing memory overhead.
[0061] In order to more clearly explain the technical solutions in the embodiments of the present invention, the drawings used in the description of the embodiments will be briefly described below. The drawings in the following description are only some embodiments of the present invention, and it is obvious to those skilled in the art that other drawings can be obtained based on these drawings without any creative work. [Brief description of the drawings]
[0062] [Figure 1] 1 is a structural schematic diagram of an encoding and decoding system according to an embodiment of the present invention; [Diagram 2] 4 is a flowchart of encoding and decoding according to an embodiment of the present invention. [Diagram 3] FIG. 2 illustrates exemplary directions corresponding to intra-prediction modes according to an embodiment of the present invention. [Figure 4] 11A-11C are diagrams illustrating exemplary directions corresponding to angle modes according to an embodiment of the present invention. [Diagram 5] FIG. 2 is a schematic diagram illustrating the division of an image block according to an embodiment of the present invention; [Figure 6] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 7] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 8] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 9]4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 10] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 11] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 12] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 13] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 14] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 15] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 16] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 17] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 18] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 19] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 20] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 21] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 22] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 23] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 24] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 25] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 26] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 27]4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 28] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 29] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Diagram 30] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 31] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Diagram 32] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 33] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Diagram 34] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 35] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Diagram 36] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 37] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 38] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 39] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Diagram 40] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 41] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Diagram 42] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 43] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Diagram 44] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Diagram 45]4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Diagram 46] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 47] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 48] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 49] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 50] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 51] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 52] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 53] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 54] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 55] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 56] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 57] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 58] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 59] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 60] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 61] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 62] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 63]2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 64] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 65] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 66] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 67] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 68] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 69] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 70] 2 is a flowchart of an encoding / decoding method according to an embodiment of the present invention. [Figure 71] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 72] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 73] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 74] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 75] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 76] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 77] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 78] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 79] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 80] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 81] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 82] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 83] 4 is a flow chart of a method for encoding according to an embodiment of the present invention; [Figure 84] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 85] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 86] 4 is a flow chart of a method for decoding according to an embodiment of the present invention; [Figure 87] FIG. 2 is a structural schematic diagram of the encoding side according to an embodiment of the present invention; [Figure 88] FIG. 2 is a structural schematic diagram of a decoding side according to an embodiment of the present invention; DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS
[0063] In order to make the objectives, technical solutions and advantages of the present invention clearer, the following describes the embodiments of the present invention in more detail with reference to the drawings.
[0064] Before describing the embodiments of the present invention in detail, first, application scenes according to the embodiments of the present invention will be described.
[0065] FIG 1 is a structural schematic diagram of an encoding-decoding system according to an embodiment of the present invention. As shown in FIG 1, the encoding-decoding system includes an encoder 01, a decoder 02, a storage device 03, and a link 04. The encoder 01 can communicate with the storage device 03, and the encoder 01 can also communicate with the decoder 02 via the link 04. The decoder 02 can also communicate with the storage device 03.
[0066] The encoder 01 is used to obtain a data source, encode the data source, and transfer the encoded code stream to the storage device 03 for storage or directly to the decoder 02 via the link 04. The decoder 02 can obtain the data source by obtaining the code stream from the storage device 03 and decoding it, or can obtain the data source by receiving the code stream transferred by the encoder 01 via the link 04 and decoding it. Here, the data source may be a captured image or a captured video. The encoder 01 and the decoder 02 can both be used as an electronic device alone. The storage device 03 can include any of a number of types of distributed or locally accessed data storage media. For example, hard disk drives, Blu-ray discs, read-only discs, flash memories, or other suitable digital storage media for storing encoded data. The link 04 can include at least one communication medium, and the at least one communication medium can include wireless and / or wired communication media, such as the RF (Radio Frequency) spectrum or one or more physical transmission lines.
[0067] Referring to FIG. 2, FIG. 2 is a flowchart of encoding and decoding according to an exemplary embodiment, where encoding includes several processes of prediction, transformation, quantization, and entropy coding, and decoding includes several processes of decoding, inverse transformation, inverse quantization, and prediction. Currently, binary arithmetic encoding and decoding techniques are usually used to perform encoding and decoding on current syntax elements. Prediction in encoding and decoding generally includes intra prediction, multi-row prediction, cross-component prediction, and matrix-based intra prediction, etc., and encoding and decoding also includes intra luminance candidate list, adaptive loop filter, adaptive motion vector precision encoding and decoding techniques, and BD (Block-based quantized residual Differential) PCM (Pulse Code Modulation) encoding and decoding techniques, etc., and these prediction methods and encoding and decoding techniques will be briefly described below.
[0068] "Binary Arithmetic Coding"
[0069] Binary arithmetic coding refers to obtaining the final code stream by performing arithmetic coding on each bin (bit) after the current syntax element is binarized based on its probability model parameters. It includes two coding methods: context-based adaptive arithmetic coding and bypass-based binary arithmetic coding.
[0070] CABAC (Context-based Adaptive Binary Arithmetic Coding) is a method obtained by combining adaptive binary arithmetic coding with a well-designed context model. In coding, the coding of each symbol is related to the previously coded result, and a code word is adaptively assigned to each symbol according to the statistical characteristics of the symbol stream, especially for symbols with unequal occurrence probabilities, so that the code rate can be further compressed. Each bit of a syntax element is input sequentially to a context modeler, and the encoder assigns an appropriate probability model to each input bit based on the previously coded syntax element or bit, and the process is called context modeling. The bits and their assigned probability models are sent to a binary arithmetic encoder for coding. The encoder updates the context model according to the bit value, which is the coding adaptation.
[0071] Bypass-based Binary Arithmetic Coding is a binary arithmetic coding mode based on equal probability (also called bypass coding mode). Compared with CABAC, Bypass lacks the probability update process and does not need to adaptively update the probability state. It codes with a fixed probability of 50% for 0 and 1, respectively. This coding method is simpler, has lower coding complexity, consumes less memory, and is suitable for symbols with equal probability.
[0072] "Intra prediction"
[0073] Intra prediction refers to using the correlation of the image space domain to predict pixels of the current image block using pixels of neighboring blocks that are coded and reconstructed around the current image block, thereby achieving the purpose of removing redundancy in the image space domain. Intra prediction is provided with a number of intra prediction modes, each of which corresponds to one texture direction (except DC mode). For example, if the texture of an image is arranged horizontally, the image information can be better predicted by selecting a horizontal prediction mode. For example, in HEVC (High Efficiency Video Coding), the luma component can support five different sizes of prediction units (image blocks or sub-blocks), and each size of prediction unit corresponds to 35 different intra prediction modes, including Planar mode, DC mode, and 33 different angle modes, as shown in Table 1. [Table 1]
[0074] The prediction directions corresponding to the multiple types of intra prediction modes are as shown in FIG. 3. The planar mode is applied to an area where pixel values change gradually, and in an embodiment, a filtering process is performed using two linear filters in the horizontal and vertical directions, and the average value of both can be used as the predicted value of the current image block. The DC mode is applied to a flat area having a large area, and the average pixel value of the neighboring blocks that are encoded and reconstructed around the current image block can be used as the predicted value of the current image block. As an example, the planar mode and the DC mode are also called non-angular modes. Continuing with FIG. 3, in the angular mode, the intra prediction modes corresponding to the mode numbers 26 and 10 indicate the vertical and horizontal directions, respectively, and in one possible embodiment of the present invention, the intra prediction modes corresponding to the mode numbers adjacent to the mode number 26 can be collectively referred to as vertical prediction modes, and the intra prediction modes corresponding to the mode numbers adjacent to the mode number 10 can be collectively referred to as horizontal prediction modes, and illustratively, the vertical prediction modes include mode numbers 2 to 18, and the horizontal prediction modes can include mode numbers 19 to 34. In addition, in the next-generation encoding / decoding standard VVC (Versatile Video Coding), the angle mode is divided more finely as shown in FIG.
[0075] "Conventional intra prediction"
[0076] The method adopted in conventional intra prediction is to predict the current block using surrounding pixels to remove redundancy in the spatial domain. In conventional intra prediction modes, the adopted target prediction mode can be from the MPM (Most probable mode) list or from a non-MPM list.
[0077] "ISP (Intra Sub-block-Partitions)"
[0078] In the method adopted in the ISP technology for intra prediction, an image block is divided into a number of sub-blocks for prediction, and the division methods that can be supported for an image block that supports the ISP technology include horizontal division and vertical division. For the decoding side, when a current block activates the ISP mode, if the size of the current block supports only one division method by default, the current block is divided in a default division direction, and processing such as prediction, inverse transform, and inverse quantization is performed; if the size of the current block supports two division methods, the division direction needs to be further analyzed, and the current block is divided in a determined division direction, and processing such as prediction, inverse transform, and inverse quantization is performed.
[0079] "MRL (Multi-Reference Line)"
[0080] In the method adopted in the MRL technique, prediction is based on reference pixels of the current block, and the reference pixels may be from adjacent rows of the current block. For example, the reference pixels may be from Reference line 0 (row 0), Reference line 1 (row 1), Reference line 2 (row 2), and Reference line 3 (row 3) shown in FIG. 5. Here, row 0 is the row adjacent to the boundary of the current block, row 1 is the row next adjacent to the boundary of the current block, row 2 is the row adjacent to row 1, and row 3 is the row adjacent to row 2. Currently, in VVC, which is the next-generation encoding and decoding standard, the reference pixels are from Reference line 0, Reference line 1, and Reference line 3, and Reference line 2 is unused. Here, the line may be the upper row of the current block or the left column of the current block.
[0081] "MPM"
[0082] In HEVC, the number of MPMs is 3, and currently in VVC, the number of MPMs is 6. For ISP and MRL modes, the intra prediction mode must be from an MPM, and for conventional intra prediction, the intra prediction mode can be from either an MPM or a non-MPM.
[0083] "CCLM (Cross-Component Linear Model Prediction)"
[0084] The method adopted in CCLM technology is to reconstruct pixel values from the luminance component using a linear prediction model, and obtain chrominance component predicted pixel values by utilizing a linear equation, which can remove redundancy between image components and further improve coding performance. Currently, there are three types of cross-component prediction modes, namely, MDLM_L mode, MDLM_T mode, and DM mode. MDLM_L mode is a cross-component prediction mode that obtains linear parameters using only the left template information, MDLM_T is a cross-component prediction mode that derives linear model parameters using only the top template information, and DM uses the same prediction mode for chrominance as for luminance.
[0085] "Adaptive Loop Filtering"
[0086] For the adaptive loop filter (ALF), one type of filter can be selected from fixed filters according to the gradient direction, and the CTU-level flag can indicate whether the block turns on ALF filtering, and chrominance and luma can be controlled separately.
[0087] "AMVR (adaptive motion vector resolution)"
[0088] AMVR is used to indicate that different precisions can be adopted when encoding the motion vector differentials, which can be integer pixel precision such as 4 pixel precision or non-integer pixel precision such as 1 / 16 pixel precision. The technique can be applied to encoding motion vector data in conventional intra prediction and also in affine prediction modes.
[0089] "MIP (Matrix Based Intra Prediction)"
[0090] The matrix-based intra prediction technique refers to taking the upper and left neighboring pixels of the current block as reference pixels, sending them to a matrix vector multiplier, and adding a bias to determine the predicted pixel value of the current block.
[0091] "BDPCM"
[0092] BDPCM refers to directly copying the pixel value of the corresponding reference pixel in the vertical direction or copying the pixel value of the corresponding reference pixel in the horizontal direction when predicting a pixel in the prediction step, which is similar to vertical prediction and horizontal prediction. Then, the residual value between the predicted pixel and the original pixel is quantized, and the quantized residual is differentially encoded.
[0093] For example, if the size of the current block is M*N,
number
number
number
[0094] For vertical RDPCM mode,
number
[0095] For horizontal RDPCM mode,
number
[0096] Finally
number
[0097] For the decoding side, the inverse accumulation process is used to obtain the residual data after quantization.
[0098] For vertical prediction,
number
[0099] For horizontal forecasts,
number
[0100] The quantized residual is then dequantized and added to the prediction to obtain a reconstructed pixel value.
[0101] "Joint Coding of Chrominance Residuals (JCCR)"
[0102] JCCR is a method for jointly encoding the CB (blue chromaticity) component and the CR (red chromaticity) component. By observing the distribution of chromaticity residuals, it is easy to see that CB and CR tend to always show a negative correlation. Therefore, JCCR proposes a method for jointly encoding CB and CR by utilizing this phenomenon. For example, it is sufficient to encode (CB-CR) / 2, i.e., the average value of the CB component and the CR component.
[0103] In the related art, in different prediction modes or encoding / decoding techniques, the decoding side needs to transmit different syntax elements to the encoding side, and many context models are required to transmit the syntax elements, which makes the encoding / decoding process more complex and increases the memory overhead. In view of the above, the present invention provides an encoding / decoding method that can reduce the number of required context models, thereby reducing the complexity of the encoding / decoding process and reducing the memory overhead.
[0104] "ISP mode"
[0105] In the ISP mode, syntax elements that need to be transmitted between the decoding side and the encoding side may include first ISP indication information and second ISP indication information, where the first ISP indication information is used to indicate whether to activate an intra sub-block prediction mode, and the second ISP indication information is used to indicate a sub-block division scheme of the intra sub-block prediction mode. Exemplarily, the first indication information is intra_subpartitions_mode_flag, and the second indication information is intra_subpartitions_split_flag.
[0106] Then, when it is determined to encode or decode the first ISP indication information, it is necessary to perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the first ISP indication information based on one context model, and when it is determined to encode or decode the second ISP indication information, it is necessary to perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the second ISP indication information based on another different context model. That is, as shown in Table 2 below, it is necessary to encode / decode the first ISP indication information and the second ISP indication information using two context models. [Table 2]
[0107] "First embodiment of ISP mode"
[0108] FIG. 6 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 6, the method includes the following steps:
[0109] In step 601, when it is determined that the first ISP indication information is to be encoded, a context-based adaptive binary arithmetic coding is performed on the first ISP indication information based on one context model, and the first ISP indication information is used to indicate whether to activate an intra sub-block prediction mode.
[0110] As an example, if the current block meets the conditions for supporting the sub-block division technique, the current block may attempt to use the sub-block division technique, and the encoding side may finally determine whether to use the sub-block division technique through RDO (Rate Distortion Optimization), and perform encoding of the first ISP indication information, and the first ISP indication information indicates whether the current block activates the intra sub-block prediction mode. Here, the conditions for supporting the sub-block division technique include: the current block is a luminance block; the current block does not activate the multi-row prediction mode; and the size of the current block meets a certain restriction condition. Of course, the conditions for supporting the sub-block division technique are not limited to the above three conditions, but may also include other conditions.
[0111] Exemplarily, the first ISP indication information is intra_subpartitions_mode_flag, which is a flag indicating whether the current block activates the intra sub-block prediction mode. When intra_subpartitions_mode_flag is 0, it indicates that the current block does not activate the intra sub-block prediction mode, and when intra_subpartitions_mode_flag is 1, it indicates that the current block activates the intra sub-block prediction mode.
[0112] In step 602, when it is determined that the second ISP indication information is to be encoded, a bypass-based binary arithmetic encoding is performed on the second ISP indication information, and the second ISP indication information is used to indicate a sub-block division method of the intra sub-block prediction mode.
[0113] Here, the sub-block division manner includes a horizontal division direction and a vertical division direction. If the current block supports two division directions, it is necessary to determine the division direction to be finally used, and continue to encode the second ISP indication information according to the division direction to be used. If the current block only supports one division direction, it is not necessary to continue to encode the second ISP indication information.
[0114] Here, the second ISP indication information may be intra_subpartitions_split_flag, which is a flag indicating a sub-block division manner of the ISP mode of the current block. Exemplarily, when intra_subpartitions_split_flag is 0, it indicates that the sub-block division manner of the ISP mode of the current block is horizontal division, and when intra_subpartitions_split_flag is 1, it indicates that the sub-block division manner of the ISP mode of the current block is vertical division.
[0115] As an example, the syntax element encoding method in the ISP mode is as shown in Table 3. [Table 3]
[0116] In other words, by modifying the encoding method of the second ISP indication information in the related technology and replacing the complex CABAC encoding method with a bypass encoding method, the memory overhead can be reduced and the encoding complexity can be reduced, and the performance of the encoding is basically unchanged.
[0117] FIG. 7 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side and corresponds to the encoding method according to the embodiment of FIG. 6. As shown in FIG. 7, the method includes the following steps:
[0118] In step 701, when it is determined to decode the first ISP indication information, a context-based adaptive binary arithmetic decoding is performed on the first ISP indication information based on one context model, and the first ISP indication information is used to indicate whether to activate an intra sub-block prediction mode.
[0119] As an example, the coding stream of the current block can be received first, and if the current block satisfies the analysis condition, the first ISP indication information in the coding stream is decoded to analyze whether the current block activates intra sub-block prediction mode. Here, the analysis condition includes: the current block is a luminance block, the current block does not activate multi-row prediction mode, and the size of the current block satisfies a certain limiting condition. Of course, the analysis condition is not limited to the above three conditions, and may include other conditions.
[0120] Exemplarily, the first ISP indication information is intra_subpartitions_mode_flag, where intra_subpartitions_mode_flag is 0 to indicate that the current block does not activate the intra sub-block prediction mode, and intra_subpartitions_mode_flag is 1 to indicate that the current block activates the intra sub-block prediction mode.
[0121] In step 702, when it is determined to decode the second ISP indication information, a bypass-based binary arithmetic decoding is performed on the second ISP indication information, and the second ISP indication information is used to indicate a sub-block division method of the intra sub-block prediction mode.
[0122] Exemplarily, it is determined that if the first ISP indication information indicates that the current block activates an intra sub-block prediction mode and the current block supports two partition directions, it is necessary to decode the second ISP indication information; if the first ISP indication information indicates that the current block does not activate an intra sub-block prediction mode, or if the first ISP indication information indicates that the current block activates an intra sub-block prediction mode and the current block supports only one partition direction, it is determined that it is not necessary to decode the second ISP indication information.
[0123] For example, if intra_subpartitions_mode_flag is 1 and the current block supports two split directions, it is necessary to further analyze the split direction flag intra_subpartitions_split_flag. If intra_subpartitions_mode_flag is 0 or intra_subpartitions_mode_flag is 1 but the current block supports only a certain split direction, it is not necessary to analyze the flag indicating the split direction.
[0124] Based on the above two ISP indication information, the decoding side can determine whether the current block activates the ISP mode and the corresponding partition direction, and then predict the current block according to the determined partition direction to obtain the predicted value of the current block, which is used in the subsequent reconstruction process.
[0125] "Second embodiment of ISP mode"
[0126] FIG. 8 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 8, the method includes the following steps:
[0127] In step 801, when it is determined that the first ISP indication information is to be encoded, a bypass-based binary arithmetic encoding is performed on the first ISP indication information, and the first ISP indication information is used to indicate whether to activate an intra sub-block prediction mode.
[0128] As an example, if the current block meets the conditions for supporting the sub-block division technique, the current block may try to use the sub-block division technique, and the encoding side may finally determine whether to use the sub-block division technique through the RDO, and perform encoding of the first ISP indication information, and the first ISP indication information indicates whether the current block activates the intra sub-block prediction mode. Here, the conditions for supporting the sub-block division technique include: the current block is a luminance block; the current block does not activate the multi-row prediction mode; and the size of the current block meets certain restriction conditions. Of course, the conditions for supporting the sub-block division technique are not limited to the above three conditions, but may also include other conditions.
[0129] Exemplarily, the first ISP indication information is intra_subpartitions_mode_flag, which is a flag indicating whether the current block activates the intra sub-block prediction mode. When intra_subpartitions_mode_flag is 0, it indicates that the current block does not activate the intra sub-block prediction mode, and when intra_subpartitions_mode_flag is 1, it indicates that the current block activates the intra sub-block prediction mode.
[0130] In step 802, when it is determined that the second ISP indication information is to be encoded, a bypass-based binary arithmetic encoding is performed on the second ISP indication information, and the second ISP indication information is used to indicate a sub-block division method of the intra sub-block prediction mode.
[0131] Here, the sub-block division manner includes a horizontal division direction and a vertical division direction. If the current block supports two division directions, it is necessary to determine the division direction to be finally used, and continue to encode the second ISP indication information according to the division direction to be used. If the current block only supports one division direction, it is not necessary to continue to encode the second ISP indication information.
[0132] Here, the second ISP indication information may be intra_subpartitions_split_flag, which is a flag indicating a sub-block division manner of the ISP mode of the current block. Exemplarily, when intra_subpartitions_split_flag is 0, it indicates that the sub-block division manner of the ISP mode of the current block is horizontal division, and when intra_subpartitions_split_flag is 1, it indicates that the sub-block division manner of the ISP mode of the current block is vertical division.
[0133] As an example, the encoding method of syntax elements in ISP mode is as shown in Table 4. [Table 4]
[0134] In other words, by modifying the encoding method of the intra_subpartitions_mode_flag flag and the intra_subpartitions_split_flag flag in the related technology and replacing the original complex CABAC encoding method with a bypass encoding method, the memory overhead can be further reduced and the encoding complexity can be reduced, and the performance of the encoding performance is basically unchanged.
[0135] FIG. 9 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side and corresponds to the encoding method according to the embodiment of FIG. 8. As shown in FIG. 9, the method includes the following steps:
[0136] In step 901, when it is determined to decode the first ISP indication information, a bypass-based binary arithmetic decoding is performed on the first ISP indication information, and the first ISP indication information is used to indicate whether to activate an intra sub-block prediction mode.
[0137] As an example, the coding stream of the current block can be received first, and if the current block satisfies the analysis condition, the first ISP indication information in the coding stream is decoded to analyze whether the current block activates intra sub-block prediction mode. Here, the analysis condition includes: the current block is a luminance block, the current block does not activate multi-row prediction mode, and the size of the current block satisfies a certain limiting condition. Of course, the analysis condition is not limited to the above three conditions, and may include other conditions.
[0138] Exemplarily, the first ISP indication information is intra_subpartitions_mode_flag, where intra_subpartitions_mode_flag is 0 to indicate that the current block does not activate the intra sub-block prediction mode, and intra_subpartitions_mode_flag is 1 to indicate that the current block activates the intra sub-block prediction mode.
[0139] In step 902, when it is determined to decode the second ISP indication information, a bypass-based binary arithmetic decoding is performed on the second ISP indication information, and the second ISP indication information is used to indicate a sub-block division method of the intra sub-block prediction mode.
[0140] Exemplarily, it is determined that if the first ISP indication information indicates that the current block activates an intra sub-block prediction mode and the current block supports two partition directions, it is necessary to decode the second ISP indication information; if the first ISP indication information indicates that the current block does not activate an intra sub-block prediction mode, or if the first ISP indication information indicates that the current block activates an intra sub-block prediction mode and the current block supports only one partition direction, it is determined that it is not necessary to decode the second ISP indication information.
[0141] For example, if intra_subpartitions_mode_flag is 1 and the current block supports two split directions, it is necessary to further analyze the split direction flag intra_subpartitions_split_flag. If intra_subpartitions_mode_flag is 0 or intra_subpartitions_mode_flag is 1 but the current block supports only a certain split direction, it is not necessary to analyze the flag indicating the split direction.
[0142] Based on the above two ISP indication information, the decoding side can determine whether the current block activates the ISP mode and the corresponding partition direction, and then predict the current block according to the determined partition direction to obtain the predicted value of the current block, which is used in the subsequent reconstruction process.
[0143] "MRL mode"
[0144] "First embodiment of MRL mode"
[0145] FIG. 10 is a flowchart of an encoding / decoding method according to an embodiment of the present invention, the method is applied to the encoding side or the decoding side. As shown in FIG. 10, the method includes the following steps:
[0146] In step 1001, the width and height size of the current block is M*N, and if M is less than 64 and N is less than 64, then the current block does not support multi-row prediction mode.
[0147] Exemplarily, if the width and height size of the current block is M*N, the current block does not support multi-row prediction mode.
[0148] "Second embodiment of MRL mode"
[0149] In the MRL mode, the syntax elements that need to be transmitted between the decoding side and the encoding side may include reference row indication information, which is used to indicate index information of a target reference row used when predicting a current block based on a multi-row prediction mode. Exemplarily, the reference row indication information is intra_luma_ref_idx.
[0150] In the related technology, when it is determined that the current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 3, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 2 bits, these 2 bits need to be encoded and decoded using two different context models, as shown in Tables 5 and 6 below. [Table 5]
[0151] Here, the first bin refers to the first bit of the reference row indication information, which needs to be encoded and decoded based on the first context model, and the second bin refers to the second bit of the reference row indication information, which needs to be encoded and decoded based on the second context model, and the first context model and the second context model are different. [Table 6]
[0152] Table 7 shows the correspondence between the index information of the target reference row and the row number of the target reference row. [Table 7]
[0153] As can be seen from Table 7, when the index information indicated by the reference row indication information is 0, the target reference row is the 0th row, when the index information indicated by the reference row indication information is 1, the target reference row is the 1st row, and when the index information indicated by the reference row indication information is 2, the target reference row is the 3rd row.
[0154] It should be noted that the row in the embodiment of the present invention may be the upper row of the current block, or the left column of the current block.
[0155] FIG. 11 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 10, when it is determined that the current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 3, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 2 bits, the method includes the following steps:
[0156] In step 1101, a context-based adaptive binary arithmetic coding is performed on a first bit of the reference row indication information based on one context model.
[0157] As an example, it can be determined whether the current block meets the condition for supporting the multi-row prediction technique, and if the current block meets the condition for supporting the multi-row prediction technique, it is determined that the current block can attempt to be coded using each reference row. The coding side can determine the final reference pixel source by the RDO, and code the reference row index information into the coding stream. Here, the conditions for supporting the multi-row prediction technique include: the current block is a luminance intra block; the size of the current block meets a certain restriction condition; and the current block does not include the first row of the coding tree unit. Of course, the conditions for supporting the multi-row prediction technique are not limited to the above three conditions, and may include other conditions.
[0158] For example, when a multi-row prediction technique can be used, all reference rows are traversed, and a final target reference row is determined by RDO, and reference row indication information is encoded. In the encoding stream, reference row indication information can be encoded according to a specific situation. For example, the reference row indication information can be intra_luma_ref_idx.
[0159] It should be noted that the row in the embodiment of the present invention may be the upper row of the current block, or the left column of the current block.
[0160] In step 1102, when the second bit of the reference row indication information needs to be encoded, the second bit of the reference row indication information is subjected to bypass-based binary arithmetic encoding.
[0161] In an embodiment of the present invention, when it is determined that a current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 3, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 2 bits, the first bit of the 2 bits can be encoded using one context model, and the second bit can be encoded based on a bypass encoding mode. In this way, only one context model is needed to encode all bits of the reference row indication information, thereby reducing the number of context models used, further reducing the encoding complexity and memory consumption, and the encoding performance is not significantly changed.
[0162] For example, the context model used by the reference line indication information is as shown in Tables 8 and 9 below. [Table 8] [Table 9]
[0163] FIG. 12 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to a decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 11. As shown in FIG. 12, when it is determined that a current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 3, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 2 bits, the method includes the following steps:
[0164] In step 1201, a context-based adaptive binary arithmetic decoding is performed on a first bit of the reference row indication information based on one context model.
[0165] In step 1202, when decoding needs to be performed on the second bit of the reference row indication information, a bypass-based binary arithmetic decoding is performed on the second bit of the reference row indication information.
[0166] By decoding the reference row indication information, a target reference row to be used when predicting the current block based on a multi-row prediction mode can be determined based on the reference row indication information, and then the target reference row is used to predict the current block.
[0167] For example, the coding stream of the current block can be received first, and if the current block satisfies the analysis condition, the reference pixel source of the current block is determined by decoding the reference row indication information. The analysis condition includes: the current block is a luminance intra block, the size of the current block satisfies a certain restriction condition, and the current block is not the first row of the coding tree unit. Of course, the analysis condition is not limited to the above three conditions, and may include other conditions.
[0168] As an example, if the current block can use multi-row prediction, it is necessary to analyze intra_luma_ref_idx to obtain a predicted value of the current block to be used in the subsequent reconstruction process by determining reference pixels of the current block based on the value of intra_luma_ref_idx.
[0169] "Third embodiment of MRL mode"
[0170] In the related technology, when it is determined that the current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 4, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 3 bits, these 3 bits need to be encoded and decoded using three different context models, as shown in Tables 10 and 11 below. [Table 10] [Table 11]
[0171] Here, the first bin refers to the first bit of the reference row indication information, which needs to be encoded and decoded based on the first context model, the second bin refers to the second bit of the reference row indication information, which needs to be encoded and decoded based on the second context model, and the third bin refers to the third bit of the reference row indication information, which needs to be encoded and decoded based on the third context model, and these three context models are different.
[0172] Table 12 shows the index information of the target reference row and the row number of the corresponding target reference row. [Table 12]
[0173] As can be seen from Table 12, when the index information indicated by the reference row indication information is 0, the target reference row is the 0th row; when the index information indicated by the reference row indication information is 1, the target reference row is the 1st row; when the index information indicated by the reference row indication information is 2, the target reference row is the 2nd row; and when the index information indicated by the reference row indication information is 3, the target reference row is the 3rd row.
[0174] FIG. 13 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 13, when it is determined that the current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 4, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 3 bits, the method includes the following steps:
[0175] In step 1301, a context-based adaptive binary arithmetic coding is performed on a first bit of the reference row indication information based on one context model.
[0176] As an example, it can be determined whether the current block meets the condition for supporting the multi-row prediction technique, and if the current block meets the condition for supporting the multi-row prediction technique, it is determined that the current block can attempt to be coded using each reference row. The coding side can determine the final reference pixel source by RDO, and code the reference row index information into the coding stream. Here, the conditions for supporting the multi-row prediction technique include: the current block is a luminance intra block; the size of the current block meets a certain restriction condition; and the current block is not the first row of the coding tree unit. Of course, the conditions for supporting the multi-row prediction technique are not limited to the above three conditions, and may include other conditions.
[0177] For example, when a multi-row prediction technique can be used, all reference rows are traversed, and a final target reference row is determined by RDO, and reference row indication information is encoded. In the encoding stream, reference row indication information can be encoded according to a specific situation. For example, the reference row indication information can be intra_luma_ref_idx.
[0178] In step 1302, when the second bit of the reference row indication information needs to be encoded, the second bit of the reference row indication information is subjected to bypass-based binary arithmetic encoding.
[0179] In step 1303, when the third bit of the reference row indication information needs to be encoded, the third bit of the reference row indication information is subjected to bypass-based binary arithmetic encoding.
[0180] In an embodiment of the present invention, when it is determined that a current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 4, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 3 bits, the first bit of the 3 bits can be encoded using one context model, and the second and third bits can be encoded based on a bypass encoding mode. In this way, only one context model is needed to encode all bits of the reference row indication information, thereby reducing the number of context models used, further reducing the encoding complexity and memory consumption, and the encoding performance is not significantly changed.
[0181] For example, the context model used by the reference line indication information is as shown in Tables 13 and 14 below. [Table 13] [Table 14]
[0182] FIG. 14 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side and corresponds to the encoding method according to the embodiment of FIG. 13. As shown in FIG. 14, when it is determined that the current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 4, and the reference row indication information corresponding to the multi-row prediction mode occupies a maximum of 3 bits, the method includes the following steps:
[0183] In step 1401, a context-based adaptive binary arithmetic decoding is performed on a first bit of the reference row indication information based on one context model.
[0184] In step 1402, when decoding needs to be performed on the second bit of the reference row indication information, a bypass-based binary arithmetic decoding is performed on the second bit of the reference row indication information.
[0185] In step 1403, when the third bit of the reference row indication information needs to be decoded, a bypass-based binary arithmetic decoding is performed on the third bit of the reference row indication information.
[0186] For example, the coding stream of the current block can be received first, and if the current block satisfies the analysis condition, the reference pixel source of the current block is determined by decoding the reference row indication information. The analysis condition includes: the current block is a luminance intra block, the size of the current block satisfies a certain restriction condition, and the current block is not the first row of the coding tree unit. Of course, the analysis condition is not limited to the above three conditions, and may include other conditions.
[0187] As an example, if the current block can use multi-row prediction, it is necessary to analyze intra_luma_ref_idx to obtain a predicted value of the current block to be used in the subsequent reconstruction process by determining reference pixels of the current block based on the value of intra_luma_ref_idx.
[0188] "Fourth embodiment of MRL mode"
[0189] FIG. 15 is a flowchart of an encoding / decoding method according to an embodiment of the present invention, which is applied to the encoding side or the decoding side. As shown in FIG. 15, when it is determined that the current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 3, where the candidate reference row having index information 0 is row 0, the candidate reference row having index information 1 is row 1, and the candidate reference row having index information 2 is row 2, the method includes the following steps:
[0190] In step 1501, when predicting a current block based on a multi-row prediction mode, predicting the current block based on a target reference row, and the target reference row is determined based on reference row indication information.
[0191] Here, when the index information indicated by the reference row indication information is 0, the target reference row is the 0th row.
[0192] When the index information indicated by the reference row indication information is 1, the target reference row is the first row.
[0193] When the index information indicated by the reference row indication information is 2, the target reference row is the second row.
[0194] For example, the index information indicated by the reference row indication information and the corresponding target reference row are as shown in Table 15 below. [Table 15]
[0195] In an embodiment of the present invention, the closest 3 rows and 3 columns can be selected as the candidate target reference row, that is, the target reference row is a row selected from the candidate reference rows, where the number of the candidate reference rows corresponding to the multi-row prediction mode is 3, and the closest 3 rows and 3 columns to the boundary of the current block are used as the candidate reference row.
[0196] "Fifth embodiment of MRL mode"
[0197] FIG. 16 is a flowchart of an encoding / decoding method according to an embodiment of the present invention, which is applied to the encoding side or the decoding side. As shown in FIG. 16, when it is determined that the current block supports a multi-row prediction mode, and the number of candidate reference rows corresponding to the multi-row prediction mode is 3, where the candidate reference row having index information 0 is row 0, the candidate reference row having index information 1 is row 1, and the candidate reference row having index information 2 is row 2, the method includes the following steps:
[0198] In step 1601, when predicting a current block based on a multi-row prediction mode, predicting the current block based on a target reference row, and the target reference row is determined based on reference row indication information.
[0199] Here, when the index information indicated by the reference row indication information is 0, the target reference row is the 0th row.
[0200] When the index information indicated by the reference row indication information is 1, the target reference row is the second row.
[0201] When the index information indicated by the reference row indication information is 2, the target reference row is the third row.
[0202] For example, the index information indicated by the reference row indication information and the corresponding target reference row are as shown in Table 16 below. [Table 16]
[0203] In an embodiment of the present invention, the 0th, 2nd and 3rd rows can be selected as candidates for the target reference row.
[0204] "Sixth embodiment of MRL mode"
[0205] Figure 17 is a flowchart of an encoding method according to an embodiment of the present invention, the method is applied to the encoding side, and as shown in Figure 17, when it is determined that the current block supports multi-row prediction mode, the method includes the following steps:
[0206] In step 1701, before predicting the current block based on the multi-row prediction mode, decoding is performed on row number indication information based on the row number of candidate reference rows corresponding to the multi-row prediction mode, and the row number indication information is used to indicate the row number of candidate reference rows corresponding to the multi-row prediction mode.
[0207] In step 1702, a target reference row to be used when predicting the current block based on the multi-row prediction mode is encoded with reference row indication information, and the reference row indication information is used to indicate index information of a target reference row to be used when predicting the current block based on the multi-row prediction mode.
[0208] In step 1703, the current block is predicted based on the target reference row.
[0209] In the embodiment of the present invention, by adding line number indication information capable of indicating the number of candidate reference lines corresponding to the multi-line prediction mode, the multi-line prediction mode can select the number of reference lines.
[0210] For example, the row number indication information may be present in a sequence parameter set (SPS), a picture parameter set, a slice level, or a Tile level. Preferably, the row number indication information is present in a sequence parameter set, that is, a syntax used to indicate the row number of candidate reference rows corresponding to a multi-row prediction mode may be added to the SPS level.
[0211] Figure 18 is a flowchart of a decoding method according to an embodiment of the present invention, the method is applied to the decoding side, and as shown in Figure 18, when it is determined that the current block supports multi-row prediction mode, the method includes the following steps:
[0212] In step 1801, before predicting a current block based on a multi-row prediction mode, the row number indication information is decoded, and the row number indication information is used to indicate the row number of candidate reference rows corresponding to the multi-row prediction mode.
[0213] In step 1802, the number of candidate reference lines corresponding to the multi-line prediction mode is determined based on the line number indication information.
[0214] In step 1803, a target reference row is determined based on the number of candidate reference rows corresponding to the multi-row prediction mode and reference row indication information, and the reference row indication information is used to indicate index information of the target reference row to be used when predicting the current block based on the multi-row prediction mode.
[0215] In step 1804, the current block is predicted based on the target reference row.
[0216] In the embodiment of the present invention, by adding line number indication information capable of indicating the number of candidate reference lines corresponding to the multi-line prediction mode, the multi-line prediction mode can select the number of reference lines.
[0217] For example, the row number indication information may be present in a sequence parameter set (SPS), a picture parameter set, a slice level, or a Tile level. Preferably, the row number indication information is present in a sequence parameter set, that is, a syntax used to indicate the row number of candidate reference rows corresponding to a multi-row prediction mode may be added to the SPS level.
[0218] "AMVR mode"
[0219] In the AMVR mode, syntax elements that require transmission between the decoding side and the encoding side may include first AMVR indication information and second AMVR indication information, where the first AMVR indication information is used to indicate whether to activate the AMVR mode, and the second AMVR indication information is used to indicate pixel precision index information used when encoding or decoding a motion vector differential in the AMVR mode. As an example, the first AMVR indication information is amvr_flag, and the second AMVR indication information is amvr_precision_flag.
[0220] In the related technology, for affine prediction mode and non-affine prediction mode, the non-affine prediction mode refers to other prediction modes other than the affine prediction mode, and for the first AMVR indication information and the second AMVR indication information, a total of four context models are required for encoding and decoding, as shown in Tables 17 and 18. [Table 17] [Table 18]
[0221] As can be seen from Tables 17 and 18, when the current block activates the affine prediction mode, the first AMVR indication information needs to be coded or decoded based on the third context model for the first AMVR indication information, and when the second AMVR indication information indicates that the current block activates the AMVR mode, the second AMVR indication information needs to be coded or decoded based on the fourth context model for the second AMVR indication information. When the current block activates the non-affine prediction mode, the first AMVR indication information needs to be coded or decoded based on the first context model for the first AMVR indication information, and when the second AMVR indication information indicates that the current block activates the AMVR mode, the second AMVR indication information needs to be coded or decoded based on the second context model for the first AMVR indication information. In other words, in order to encode or decode the AMVR indication information, a total of four different context models are required, which results in a large memory consumption.
[0222] "First embodiment of AMVR mode"
[0223] FIG. 19 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 19, the method includes the following steps:
[0224] In step 1901, if the current block activates an affine prediction mode or another prediction mode other than the affine prediction mode, when encoding the motion vector differential of the current block, if the current block supports AMVR mode, when encoding the first AMVR indication information, context-based adaptive binary arithmetic coding is performed on the first AMVR indication information based on a first context model.
[0225] In step 1902, when the first AMVR indication information indicates that the current block activates an AMVR mode, context-based adaptive binary arithmetic coding is performed on the second AMVR indication information based on a second context model, where the first context model and the second context model are different.
[0226] As an example, if the current block satisfies the condition that adaptive motion vector precision can be used, the current block may attempt to be coded using multiple motion vector precisions. Exemplarily, the coding side may determine whether to activate AMVR by RDO and the adopted motion vector precision, and code corresponding syntax information into the coding stream. Here, the conditions for using adaptive motion vector precision include: the current block is an intra-prediction block, and the motion information of the current block includes a non-zero motion vector differential. Of course, the conditions for using adaptive motion vector precision are not limited to the above conditions, and may include other conditions.
[0227] FIG. 20 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 19. As shown in FIG. 20, the method includes the following steps:
[0228] In step 2001, if the current block activates an affine prediction mode or another prediction mode other than the affine prediction mode, when decoding the motion vector differential of the current block, if the current block supports the AMVR mode, when decoding the first AMVR indication information, context-based adaptive binary arithmetic decoding is performed on the first AMVR indication information based on the first context model.
[0229] As an example, when the decoding side can first receive the coding stream of the current block and determine that the current block meets the analysis condition, the first AMVR is analyzed to determine whether the current block activates AMVR, i.e., whether adaptive motion vector precision is used. Here, the analysis condition includes: the current block is an inter-frame block, and the motion information of the current block includes a non-zero motion vector difference. Of course, the analysis condition is not limited to the above condition, and may include other conditions.
[0230] In step 2002, when the first AMVR indication information indicates that the current block activates an AMVR mode, context-based adaptive binary arithmetic decoding is performed on the second AMVR indication information based on a second context model, and the first context model and the second context model are different.
[0231] When it is determined that the current block has activated the AMVR mode, it is also necessary to determine the used precision by further analyzing the second AMVR indication information. The decoding side can obtain the prediction value of the current block used in the subsequent reconstruction process by uniquely determining the motion vector precision of the motion information of the current block according to the first AMVR indication information and the second AMVR indication information.
[0232] Exemplarily, for the affine prediction mode and the non-affine prediction mode, the context models used in the first AMVR indication information and the second AMVR indication information are as shown in Table 19 below. [Table 19]
[0233] In an embodiment of the present invention, the AMVR indication information can share a context model in the affine prediction mode and the non-affine prediction mode, thereby reducing the number of context models required in the AMVR to two, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0234] "Second embodiment of AMVR mode"
[0235] FIG. 21 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 21, the method includes the following steps:
[0236] In step 2101, if the current block activates the affine prediction mode, when encoding the motion vector differential of the current block, if the current block supports the AMVR mode, when encoding the first AMVR indication information, context-based adaptive binary arithmetic coding is performed on the first AMVR indication information based on a first context model, and when the first AMVR indication information indicates that the current block activates the AMVR mode, bypass-based binary arithmetic coding is performed on the second AMVR indication information.
[0237] In step 2102, if the current block activates a prediction mode other than the affine prediction mode, when encoding the motion vector differential of the current block, if the current block supports AMVR mode, when encoding the first AMVR indication information, context-based adaptive binary arithmetic coding is performed on the first AMVR indication information based on the second context model, and when the first AMVR indication information indicates that the current block activates AMVR mode, bypass-based binary arithmetic coding is performed on the second AMVR indication information.
[0238] FIG. 22 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side and corresponds to the encoding method shown in FIG. 21. As shown in FIG. 22, the method includes the following steps:
[0239] In step 2201, if the current block activates the affine prediction mode, when decoding the motion vector differential of the current block, if the current block supports the AMVR mode, when decoding the first AMVR indication information, context-based adaptive binary arithmetic decoding is performed on the first AMVR indication information based on a first context model, and when the first AMVR indication information indicates that the current block activates the AMVR mode, bypass-based binary arithmetic decoding is performed on the second AMVR indication information.
[0240] In step 2202, if the current block activates a prediction mode other than the affine prediction mode, when decoding the motion vector differential of the current block, if the current block supports AMVR mode, when decoding the first AMVR indication information, context-based adaptive binary arithmetic decoding is performed on the first AMVR indication information based on the second context model, and when the first AMVR indication information indicates that the current block activates AMVR mode, bypass-based binary arithmetic decoding is performed on the second AMVR indication information.
[0241] Exemplarily, for the affine prediction mode and the non-affine prediction mode, the context models used in the first AMVR indication information and the second AMVR indication information are as shown in Table 20 below. [Table 20]
[0242] In an embodiment of the present invention, in the affine prediction mode and the non-affine prediction mode, the second AMVR indication information is modified to perform bypass-based binary arithmetic encoding or decoding, thereby reducing the context models required in the AMVR to two, thereby reducing the encoding / decoding complexity and reducing memory overhead.
[0243] "Third embodiment of AMVR mode"
[0244] FIG. 23 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 23, the method includes the following steps:
[0245] In step 2301, if the current block activates an affine prediction mode or another prediction mode other than the affine prediction mode, when encoding the motion vector differential of the current block, if the current block supports an adaptive motion vector precision AMVR mode, when encoding the first AMVR indication information, context-based adaptive binary arithmetic coding is performed on the first AMVR indication information based on the first context model.
[0246] In step 2302, when the first AMVR indication information indicates that the current block activates the AMVR mode, a bypass-based binary arithmetic decoding is performed on the second AMVR indication information.
[0247] FIG. 24 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side and corresponds to the encoding method shown in FIG. 23. As shown in FIG. 24, the method includes the following steps:
[0248] In step 2401, if the current block activates an affine prediction mode or another prediction mode other than the affine prediction mode, when decoding the motion vector differential of the current block, if the current block supports adaptive motion vector precision AMVR mode, when decoding the first AMVR indication information, context-based adaptive binary arithmetic decoding is performed on the first AMVR indication information based on the first context model.
[0249] In step 2402, when the first AMVR indication information indicates that the current block activates the AMVR mode, perform bypass-based binary arithmetic decoding on the second AMVR indication information.
[0250] Exemplarily, for the affine prediction mode and the non-affine prediction mode, the context models used in the first AMVR indication information and the second AMVR indication information are as shown in Table 21 below. [Table 21]
[0251] In an embodiment of the present invention, the first AMVR indication information is modified to share one context model in the affine prediction mode and the non-affine prediction mode, and to perform bypass-based binary arithmetic encoding or decoding for the second AMVR indication information, thereby reducing the context model required in the AMVR to one, thereby reducing the encoding / decoding complexity and reducing memory overhead.
[0252] "Fourth embodiment of AMVR mode"
[0253] In another embodiment, there is further provided a method of encoding applied to an encoding side, the method including the following steps:
[0254] In step 1, if the current block activates the affine prediction mode, when encoding the motion vector differential of the current block, if the current block supports the AMVR mode, when encoding the first AMVR indication information, context-based adaptive binary arithmetic coding is performed on the first AMVR indication information based on a first context model, and when the first AMVR indication information indicates that the current block activates the AMVR mode, context-based adaptive binary arithmetic coding is performed on the second AMVR indication information based on a second context model.
[0255] In step 2, if the current block activates a prediction mode other than the affine prediction mode, when encoding the motion vector differential of the current block, if the current block supports AMVR mode, when encoding the first AMVR indication information, context-based adaptive binary arithmetic coding is performed on the first AMVR indication information based on a third context model, and when the first AMVR indication information indicates that the current block activates AMVR mode, context-based adaptive binary arithmetic coding is performed on the second AMVR indication information based on a second context model.
[0256] Here, the first context model, the second context model, and the third context model are different.
[0257] In another embodiment, there is further provided a decoding method applied on a decoding side, which is a decoding method corresponding to the encoding method above, and which includes the following steps:
[0258] In step 1, if the current block activates the affine prediction mode, when decoding the motion vector differential of the current block, if the current block supports the AMVR mode, when decoding the first AMVR indication information, context-based adaptive binary arithmetic decoding is performed on the first AMVR indication information based on a first context model, and when the first AMVR indication information indicates that the current block activates the AMVR mode, context-based adaptive binary arithmetic decoding is performed on the second AMVR indication information based on a second context model.
[0259] In step 2, if the current block activates a prediction mode other than the affine prediction mode, when decoding the motion vector differential of the current block, if the current block supports AMVR mode, when decoding the first AMVR indication information, context-based adaptive binary arithmetic decoding is performed on the first AMVR indication information based on a third context model, and when the first AMVR indication information indicates that the current block activates AMVR mode, context-based adaptive binary arithmetic decoding is performed on the second AMVR indication information based on a second context model.
[0260] Here, the first context model, the second context model, and the third context model are different.
[0261] Exemplarily, for the affine prediction mode and the non-affine prediction mode, the context models used in the first AMVR indication information and the second AMVR indication information are as shown in Table 22 below. [Table 22]
[0262] In an embodiment of the present invention, the first AMVR indication information enables one context model to be shared in the affine prediction mode and the non-affine prediction mode, thereby reducing the number of context models required in the AMVR mode to three, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0263] "Brightness MPM"
[0264] If the current block is a luminance block, prediction mode index information needs to be transmitted between the encoding side and the decoding side, and the prediction mode index information is used to indicate the index information of the target prediction mode of the current block in the MPM list. The encoding side and the decoding side store the most probable intra prediction mode MPM list, and the conventional intra prediction mode, the intra sub-block prediction mode and the multi-row prediction mode can share the MPM list.
[0265] In the related art, when the reference row of the target prediction mode of the current block is an adjacent row of the current block, two different context models are required to perform context-based adaptive binary arithmetic coding or decoding on the first bit of the prediction mode index information, and the specific context model to be used depends on whether the current block activates an intra sub-block prediction mode.
[0266] Exemplarily, the context model used for the prediction mode index information is as shown in Table 23 below. [Table 23]
[0267] Here, the prediction mode index information is intra_luma_mpm_idx. If intra_luma_ref_idx is equal to 0, it indicates that the reference row of the target prediction mode of the current block is the adjacent row of the current block, i.e., the current block does not activate the multi-row prediction mode. If intra_luma_ref_idx is not equal to 0, it indicates that the reference row of the target prediction mode of the current block is not the adjacent row of the current block, i.e., the current block activates the multi-row prediction mode.
[0268] As can be seen from Table 23, if intra_luma_ref_idx is equal to 0, the first bit of intra_luma_mpm_idx needs to select one context model from two different context models for encoding and decoding depending on whether the current block activates an intra subblock prediction mode or not. And if intra_luma_ref_idx is not equal to 0, it indicates that the current block activates a multi-row prediction mode, and the multi-row prediction mode activated by the current block is also from the MPM list.
[0269] "First embodiment of luminance MPM"
[0270] FIG. 25 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 25, the method includes the following steps:
[0271] In step 2501, if the current block initiates intra sub-block prediction, the target prediction mode of the intra sub-block prediction exists in the MPM list, and the current block is a luminance block, when predicting the current block based on the intra sub-block prediction, determine the index information of the target prediction mode of the intra sub-block prediction initiated by the current block in the MPM list.
[0272] In step 2502, prediction mode index information is encoded based on index information of a target prediction mode of intra sub-block prediction initiated by a current block in the MPM list, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic coding based on a first context model, and other bits are obtained by performing bypass-based binary arithmetic decoding.
[0273] In step 2503, if the current block initiates conventional intra prediction, and the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, if the target prediction mode initiated by the current block is from the MPM list, determine the index information of the target prediction mode initiated by the current block in the MPM list.
[0274] In step 2504, prediction mode index information is encoded based on index information of a target prediction mode activated by a current block in the MPM list, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic coding based on a second context model, and other bits are obtained by performing bypass-based binary arithmetic decoding.
[0275] As an example, when a current block activates a conventional intra-prediction mode, a flag is required to indicate whether the target prediction mode of the conventional prediction activated by the current block is from the MPM list, and if it is determined that the target prediction mode is from the MPM list, then index information of the target prediction mode in the MPM list is determined; if the target prediction mode is not from the MPM list, there is no need to determine the index information of the target prediction mode in the MPM list.
[0276] As an example, the encoding side can construct an MPM list, and the intra sub-block prediction mode, the multi-row prediction mode, and the conventional intra prediction can share the MPM list.
[0277] As an example, the encoding side can determine the prediction mode finally used by the RDO, i.e., the target prediction mode. If the target prediction mode is an intra sub-block prediction mode or a multi-row prediction mode, the target prediction mode is necessarily a prediction mode selected from the MPM list, and prediction mode index information (intra_luma_mpm_idx) needs to be coded to inform the decoding side of which prediction mode has been selected. If the target prediction mode is a conventional intra prediction, a flag needs to be coded to indicate whether the target prediction mode of the conventional prediction activated by the current block is from the MPM list. If it is determined that the target prediction mode is from the MPM list, then the index information of the target prediction mode in the MPM list is determined, and if the target prediction mode is not from the MPM list, there is no need to determine the index information of the target prediction mode in the MPM list.
[0278] FIG. 26 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 25. As shown in FIG. 26, the method includes the following steps:
[0279] In step 2601, when the current block triggers intra sub-block prediction, if the target prediction mode of the intra sub-block prediction is present in the MPM list and the current block is a luma block, when predicting the current block based on the intra sub-block prediction, decoding is performed on the prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a first context model, and the other bits are obtained by performing bypass-based binary arithmetic decoding.
[0280] In step 2602, a target prediction mode of intra sub-block prediction initiated by the current block is determined from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode in the MPM list.
[0281] In step 2603, the current block is predicted based on the target prediction mode.
[0282] In step 2604, when the current block triggers conventional intra prediction, if the target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, and the other bits are obtained by performing bypass-based binary arithmetic decoding, and the second context model and the first context model are the same context model.
[0283] In step 2605, a target prediction mode activated by the current block is determined from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode in the MPM list.
[0284] In step 2606, the current block is predicted based on the target prediction mode.
[0285] As an example, on the premise that the decoding side can first receive the encoded stream and construct the same MPM list based on conventional intra prediction, intra sub-block prediction mode and multi-row prediction mode, when the current block activates intra sub-block prediction mode or multi-row prediction mode, the adopted target prediction mode must be from the MPM list, and the final target prediction mode can be obtained by only analyzing the index value in the list. When the current block activates conventional intra prediction, a flag needs to be analyzed to determine whether the target prediction mode is from the MPM list, and if it is from the MPM list, the index value in the MPM list is analyzed.
[0286] The decoding side can uniquely determine the prediction mode of the current block based on the values of the above flags, thereby obtaining a predicted value of the current block to be used in the subsequent reconstruction process.
[0287] In an embodiment of the present invention, when a reference row of a target prediction mode of a current block is an adjacent row of the current block, instead of selecting a context model from two different context models based on a condition of whether the current block activates an intra sub-block prediction mode when encoding or decoding the first bit of the prediction mode index information, the same context model can be used to perform context-based adaptive binary arithmetic encoding or decoding on the first bit of the prediction mode index information under two different conditions, that is, a condition that the current block activates an intra sub-block prediction mode and a condition that the current block does not activate an intra sub-block prediction mode, thereby reducing the number of required context models to one, reducing the complexity of encoding and decoding, and reducing memory overhead.
[0288] As an example, a context model used for prediction mode index information is as shown in Table 24 below. [Table 24]
[0289] That is, when intra_luma_ref_idx is equal to 0, context-based adaptive binary arithmetic coding or decoding can be performed on the first bit of intra_luma_mpm_idx based on the same context model when the current block activates intra sub-block prediction mode and when the current block does not activate intra sub-block prediction mode.
[0290] "Second embodiment of the luminance MPM"
[0291] FIG. 27 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 27, the method includes the following steps:
[0292] In step 2701, if the current block initiates intra sub-block prediction, the target prediction mode of the intra sub-block prediction exists in the MPM list, and the current block is a luminance block, when predicting the current block based on the intra sub-block prediction, determine the index information of the target prediction mode of the intra sub-block prediction initiated by the current block in the MPM list.
[0293] In step 2702, prediction mode index information is encoded based on index information of a target prediction mode of intra sub-block prediction initiated by a current block in the MPM list, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0294] In step 2703, when the current block initiates conventional intra prediction, if the target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, if the target prediction mode initiated by the current block exists in the MPM list, the index information of the target prediction mode initiated by the current block in the MPM list is determined.
[0295] In step 2704, prediction mode index information is encoded based on index information of a target prediction mode activated by a current block in the MPM list, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0296] As an example, when a current block triggers a conventional intra-prediction block, a flag is required to indicate whether the target prediction mode of the conventional prediction triggered by the current block is from the MPM list, and if it is determined that the target prediction mode is from the MPM list, index information of the target prediction mode in the MPM list is determined; if the target prediction mode is not from the MPM list, there is no need to determine the index information of the target prediction mode in the MPM list.
[0297] FIG. 28 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 27. As shown in FIG. 28, the method includes the following steps:
[0298] In step 2801, when the current block triggers intra sub-block prediction, if the target prediction mode of the intra sub-block prediction is present in the MPM list and the current block is a luminance block, when predicting the current block based on the intra sub-block prediction, decoding is performed on the prediction mode index information, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0299] In step 2802, a target prediction mode of intra sub-block prediction initiated by the current block is determined from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode in the MPM list.
[0300] In step 2803, the current block is predicted based on the target prediction mode.
[0301] In step 2804, when the current block triggers conventional intra prediction, if the target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the prediction mode index information, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0302] In step 2805, a target prediction mode to be activated by the current block is determined from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode to be activated by the current block in the MPM list.
[0303] In step 2806, the current block is predicted based on the target prediction mode.
[0304] In an embodiment of the present invention, when the reference row of the target prediction mode of the current block is an adjacent row of the current block, i.e., intra_luma_ref_idx is equal to 0, when encoding or decoding the first bit of the prediction mode index information, it is possible to perform bypass-based binary arithmetic encoding or decoding without considering whether the current block activates the intra sub-block prediction mode, i.e., in two different cases, that is, when the current block activates the intra sub-block prediction mode and when the current block does not activate the intra sub-block prediction mode. In this way, it is not necessary to use a context model for the first bit of the prediction mode index information, and the number of required context models is reduced to zero, which in turn reduces the complexity of encoding and decoding and reduces memory overhead.
[0305] As an example, a context model used for prediction mode index information is as shown in Table 25 below. [Table 25]
[0306] That is, when intra_luma_ref_idx is equal to 0, the first bit of intra_luma_mpm_idx can perform bypass-based binary arithmetic encoding or decoding when the current block initiates intra sub-block prediction mode and when the current block does not initiate intra sub-block prediction mode.
[0307] "Third embodiment of luminance MPM"
[0308] FIG. 29 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 29, the method includes the following steps:
[0309] In step 2901, if the current block initiates intra sub-block prediction, the target prediction mode of the intra sub-block prediction exists in the MPM list, and the current block is a luminance block, when predicting the current block based on the intra sub-block prediction, determine the index information of the target prediction mode of the intra sub-block prediction initiated by the current block in the MPM list.
[0310] In step 2902, prediction mode index information is encoded based on index information of a target prediction mode of intra sub-block prediction initiated by a current block in the MPM list, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model, and other bits are obtained by performing bypass-based binary arithmetic decoding.
[0311] In step 2903, if the current block initiates conventional intra prediction, the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, if the target prediction mode of the conventional prediction initiated by the current block exists in the MPM list, the index information of the target prediction mode initiated by the current block in the MPM list is determined.
[0312] In step 2904, prediction mode index information is encoded based on index information of a target prediction mode activated by a current block in the MPM list, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0313] As an example, when a current block initiates conventional intra prediction, one flag is required to indicate whether the target prediction mode of the conventional prediction initiated by the current block is from the MPM list, and if it is determined that the target prediction mode is from the MPM list, index information of the target prediction mode in the MPM list is determined, and if the target prediction mode is not from the MPM list, there is no need to determine the index information of the target prediction mode in the MPM list.
[0314] FIG. 30 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the decoding method shown in FIG. 29. As shown in FIG. 30, the method includes the following steps:
[0315] In step 3001, if a current block triggers intra sub-block prediction, a target prediction mode of the intra sub-block prediction is present in the MPM list, and the current block is a luma block, when predicting the current block based on the intra sub-block prediction, decoding is performed on prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model, and other bits are obtained by performing bypass-based binary arithmetic decoding.
[0316] In step 3002, a target prediction mode of intra sub-block prediction initiated by the current block is determined from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode in the MPM list.
[0317] In step 3003, the current block is predicted based on a target prediction mode.
[0318] In step 3004, when the current block triggers conventional intra prediction, if the target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the prediction mode index information, where all bits of the prediction mode index information are obtained by performing binary arithmetic decoding based on bypass.
[0319] In step 3005, a target prediction mode to be activated by the current block from the MPM list is determined based on prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode to be activated by the current block in the MPM list.
[0320] In step 3006, the current block is predicted based on the target prediction mode.
[0321] In an embodiment of the present invention, when the reference row of the target prediction mode of the current block is an adjacent row of the current block, i.e., intra_luma_ref_idx is equal to 0, when encoding or decoding the prediction mode index information, if the current block activates an intra sub-block prediction mode, then context-based adaptive binary arithmetic encoding or decoding is performed on the first bit of the prediction mode index information based on one context model, and if the current block does not activate an intra sub-block prediction mode, then bypass-based binary arithmetic encoding or decoding is performed on the first bit of the prediction mode index information. In this way, only one context model is required for encoding and decoding the prediction mode index information, reducing the number of required context models to one, reducing the complexity of encoding and decoding, and reducing memory overhead.
[0322] As an example, a context model used for prediction mode index information is as shown in Table 26 below. [Table 26]
[0323] That is, if intra_luma_ref_idx is equal to 0 and the current block activates ISP mode, one context model is used to encode or decode the first bit of intra_luma_mpm_idx, and if the current block does not activate ISP mode, Bypass is used to encode or decode the first bit of intra_luma_mpm_idx.
[0324] "Fourth embodiment of the luminance MPM"
[0325] FIG. 31 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 31, the method includes the following steps:
[0326] In step 3101, if the current block initiates intra sub-block prediction, the target prediction mode of the intra sub-block prediction exists in the MPM list, and the current block is a luminance block, when predicting the current block based on the intra sub-block prediction, determine the index information of the target prediction mode of the intra sub-block prediction initiated by the current block in the MPM list.
[0327] In step 3102, prediction mode index information is encoded based on index information of a target prediction mode of intra sub-block prediction initiated by a current block in the MPM list, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0328] In step 3103, when the current block initiates conventional intra prediction, if the target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, if the target prediction mode initiated by the current block exists in the MPM list, the index information of the target prediction mode initiated by the current block in the MPM list is determined.
[0329] In step 3104, prediction mode index information is encoded based on index information of a target prediction mode activated by a current block in the MPM list, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model, and other bits are obtained by performing bypass-based binary arithmetic decoding.
[0330] As an example, when a current block triggers a conventional intra-prediction block, a flag is required to indicate whether the target prediction mode of the conventional prediction triggered by the current block is from the MPM list, and if it is determined that the target prediction mode is from the MPM list, index information of the target prediction mode in the MPM list is determined; if the target prediction mode is not from the MPM list, there is no need to determine the index information of the target prediction mode in the MPM list.
[0331] FIG. 32 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 31. As shown in FIG. 32, the method includes the following steps:
[0332] In step 3201, if a current block initiates intra sub-block prediction, a target prediction mode of the intra sub-block prediction is present in the MPM list, and the current block is a luminance block, when predicting the current block based on intra sub-block prediction, decoding is performed on prediction mode index information, where all bits of the prediction mode index information are obtained by performing binary arithmetic decoding based on bypass.
[0333] In step 3202, a target prediction mode of intra sub-block prediction initiated by the current block is determined from the MPM list based on prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode in the MPM list.
[0334] In step 3203, the current block is predicted based on the target prediction mode.
[0335] In step 3204, when the current block triggers conventional intra prediction, if the target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model, and the other bits are obtained by performing bypass-based binary arithmetic decoding.
[0336] In step 3205, a target prediction mode to be activated by the current block is determined from the MPM list based on the prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode to be activated by the current block in the MPM list.
[0337] In step 3206, the current block is predicted based on the target prediction mode.
[0338] In an embodiment of the present invention, when the reference row of the target prediction mode of the current block is an adjacent row of the current block, i.e., intra_luma_ref_idx is equal to 0, when encoding or decoding the prediction mode index information, if the current block activates an intra sub-block prediction mode, bypass-based binary arithmetic encoding or decoding is performed on the first bit of the prediction mode index information, and if the current block does not activate an intra sub-block prediction mode, context-based adaptive binary arithmetic encoding or decoding is performed on the first bit of the prediction mode index information based on one context model. In this way, only one context model is required for encoding and decoding the prediction mode index information, reducing the number of required context models to one, reducing the complexity of encoding and decoding, and reducing memory overhead.
[0339] As an example, a context model used for prediction mode index information is as shown in Table 27 below. [Table 27]
[0340] That is, if intra_luma_ref_idx is equal to 0 and the current block does not activate ISP mode, one context model is used to encode or decode the first bit of intra_luma_mpm_idx, and if the current block activates ISP mode, Bypass is used to encode or decode the first bit of intra_luma_mpm_idx.
[0341] "Fifth embodiment of luminance MPM"
[0342] The syntax elements transmitted between the encoding side and the decoding side may include planar indication information, which is used to indicate whether the target prediction mode of the current block is a planar prediction mode, and occupies 1 bit. Exemplarily, the planar indication information is intra_luma_not_planar_flag.
[0343] In the related art, the encoding and decoding method of planar indication information is as shown in Table 28 below. [Table 28]
[0344] As shown in Table 29 above, the planar indication information intra_luma_not_planar_flag adopts context-based adaptive binary arithmetic coding, and the context selection depends on whether the current block activates intra sub-block prediction mode, that is, two different context models are required for encoding and decoding of the planar indication information.
[0345] FIG. 33 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 33, the method includes the following steps:
[0346] In step 3301, if the current block initiates intra sub-block prediction, a target prediction mode of the intra sub-block prediction is present in the MPM list, and the current block is a luma block, when predicting the current block based on the intra sub-block prediction, encode planar indication information according to whether the target prediction mode of the intra sub-block prediction initiated by the current block is a planar prediction mode, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic decoding based on a first context model.
[0347] In step 3302, if the current block initiates conventional intra prediction, the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, encode planar indication information according to whether the target prediction mode of the conventional intra prediction initiated by the current block is a planar prediction mode, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, and the first context model and the second context model are the same.
[0348] FIG. 34 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 33. As shown in FIG. 34, the method includes the following steps:
[0349] In step 3401, if the current block initiates intra sub-block prediction, a target prediction mode of the intra sub-block prediction is present in the MPM list, and the current block is a luma block, when predicting the current block based on the intra sub-block prediction, decode planar indication information, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic decoding based on a first context model.
[0350] In step 3402, when it is determined based on the planar indication information that the target prediction mode of the intra sub-block prediction initiated by the current block is the planar prediction mode, the current block is predicted based on the planar prediction mode.
[0351] In step 3403, when it is determined based on the planar indication information that the target prediction mode of the intra sub-block prediction initiated by the current block is not a planar prediction mode, a target prediction mode of the intra sub-block prediction initiated by the current block is determined from the MPM list based on the prediction mode index information, and the current block is predicted based on the target prediction mode.
[0352] In step 3404, if the current block initiates conventional intra prediction, and the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the planar indication information, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, and the first context model and the second context model are the same.
[0353] In step 3405, when it is determined based on the planar indication information that the target prediction mode activated by the current block is the planar prediction mode, the current block is predicted based on the planar prediction mode.
[0354] In step 3406, when it is determined based on the planar indication information that the target prediction mode activated by the current block is not a planar prediction mode, a target prediction mode activated by the current block is determined from the MPM list based on the prediction mode index information, and the current block is predicted based on the target prediction mode.
[0355] In an embodiment of the present invention, when encoding or decoding planar indication information without considering whether the current block activates intra sub-block prediction mode, the context-based adaptive binary arithmetic coding or decoding is performed on the planar indication information based on the same context model in two cases, that is, when the current block activates intra sub-block prediction mode and when the current block activates conventional intra prediction. In this way, the number of context models required for the planar indication information is reduced to one, and the complexity of encoding and decoding and memory overhead are reduced.
[0356] As an example, the encoding and decoding method of the planar indication information is as shown in Table 29 below. [Table 29]
[0357] As shown in Table 29 above, the planar indication information intra_luma_not_planar_flag still employs context-based adaptive binary arithmetic coding / decoding, but the context selection does not depend on whether the current block activates intra sub-block prediction mode or not, and encoding / decoding is performed using one fixed context model in the two cases of when the current block activates intra sub-block prediction mode and when the current block activates conventional intra prediction.
[0358] "Sixth embodiment of the luminance MPM"
[0359] FIG. 35 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 35, the method includes the following steps:
[0360] In step 3501, if the current block initiates intra sub-block prediction, the target prediction mode of the intra sub-block prediction is present in the MPM list, and the current block is a luma block, when predicting the current block based on the intra sub-block prediction, encode planar indication information according to whether the target prediction mode of the intra sub-block prediction initiated by the current block is a planar prediction mode, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing bypass-based binary arithmetic coding.
[0361] In step 3502, if the current block initiates conventional intra prediction, the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, encode planar indication information according to whether the target prediction mode of the conventional intra prediction initiated by the current block is a planar prediction mode, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing bypass-based binary arithmetic coding.
[0362] FIG. 36 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 35. As shown in FIG. 36, the method includes the following steps:
[0363] In step 3601, if the current block initiates intra sub-block prediction, the target prediction mode of the intra sub-block prediction is present in the MPM list, and the current block is a luma block, when predicting the current block based on the intra sub-block prediction, decode planar indication information, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing bypass-based binary arithmetic decoding.
[0364] In step 3602, when it is determined based on the planar indication information that the target prediction mode of the intra sub-block prediction initiated by the current block is the planar prediction mode, the current block is predicted based on the planar prediction mode.
[0365] In step 3603, when it is determined based on the planar indication information that the target prediction mode of the intra sub-block prediction initiated by the current block is not a planar prediction mode, a target prediction mode of the intra sub-block prediction initiated by the current block is determined from the MPM list based on the prediction mode index information, and the current block is predicted based on the target prediction mode.
[0366] In step 3604, if the current block initiates conventional intra prediction, and the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the planar indication information, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing bypass-based binary arithmetic decoding.
[0367] In step 3605, when it is determined based on the planar indication information that the target prediction mode activated by the current block is the planar prediction mode, the current block is predicted based on the planar prediction mode.
[0368] In step 3606, when it is determined based on the planar indication information that the target prediction mode activated by the current block is not a planar prediction mode, a target prediction mode activated by the current block is determined from the MPM list based on the prediction mode index information, and the current block is predicted based on the target prediction mode.
[0369] In an embodiment of the present invention, when encoding or decoding is performed on the planar indication information without considering whether the current block activates the intra sub-block prediction mode, bypass-based binary arithmetic encoding or decoding is performed on the planar indication information in two cases: when the current block activates the intra sub-block prediction mode and when the current block activates the conventional intra prediction mode. In this way, the context model required for the planar indication information is reduced to zero, and the encoding / decoding complexity and memory overhead are reduced.
[0370] As an example, the encoding and decoding method of the planar indication information is as shown in Table 30 below. [Table 30]
[0371] As shown in Table 30 above, the planar indication information intra_luma_not_planar_flag does not adopt the context-based adaptive binary arithmetic coding / decoding method, but adopts the bypass-based binary arithmetic coding or decoding method in two cases: when the current block activates intra sub-block prediction mode and when the current block activates conventional intra prediction.
[0372] It should be noted that the above method can also be applied to scenes that only consider conventional intra prediction.
[0373] "Example 1"
[0374] In another embodiment, there is further provided an encoding method applied to an encoding side, the encoding method including the following steps:
[0375] In step 1, when a current block initiates conventional intra prediction, and a target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, if the target prediction mode initiated by the current block is from the MPM list, determine the index information of the target prediction mode initiated by the current block in the MPM list.
[0376] In step 2, prediction mode index information is encoded based on index information of a target prediction mode activated by a current block in an MPM list, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model, and other bits are obtained by performing bypass-based binary arithmetic decoding.
[0377] As an example, when a current block triggers a conventional intra-prediction block, a flag is required to indicate whether the target prediction mode of the conventional prediction triggered by the current block is from the MPM list, and if it is determined that the target prediction mode is from the MPM list, then index information of the target prediction mode in the MPM list is determined; if the target prediction mode is not from the MPM list, there is no need to determine the index information of the target prediction mode in the MPM list.
[0378] In another embodiment, a decoding method applied on a decoding side is further provided, which corresponds to the encoding method above, and the decoding method includes the following steps:
[0379] In step 1, when a current block triggers conventional intra prediction, if a target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on prediction mode index information, where a first bit of the prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, and the other bits are obtained by performing bypass-based binary arithmetic decoding, and the second context model and the first context model are the same context model.
[0380] In step 2, a target prediction mode activated by a current block is determined from an MPM list based on prediction mode index information, and the prediction mode index information is used to indicate index information of the target prediction mode in the MPM list.
[0381] In step 3, the current block is predicted based on the target prediction mode.
[0382] "Example 2"
[0383] In another embodiment, there is further provided an encoding method applied to an encoding side, the encoding method including the following steps:
[0384] In step 1, when the current block initiates conventional intra prediction, the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block. When predicting the current block based on conventional intra prediction, if the target prediction mode initiated by the current block exists in the MPM list, determine the index information of the target prediction mode initiated by the current block in the MPM list.
[0385] In step 2, prediction mode index information is encoded based on index information of a target prediction mode activated by a current block in the MPM list, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0386] As an example, when a current block triggers a conventional intra-prediction block, a flag is required to indicate whether the target prediction mode of the conventional prediction triggered by the current block is from the MPM list, and if it is determined that the target prediction mode is from the MPM list, index information of the target prediction mode in the MPM list is determined; if the target prediction mode is not from the MPM list, there is no need to determine the index information of the target prediction mode in the MPM list.
[0387] In another embodiment, a decoding method applied on a decoding side is further provided, which corresponds to the encoding method above, and the decoding method includes the following steps:
[0388] In step 1, when the current block triggers conventional intra prediction, if the target prediction mode of the conventional intra prediction is from the MPM list and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the prediction mode index information, where all bits of the prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0389] In step 2, a target prediction mode to be activated by the current block from the MPM list is determined based on prediction mode index information, and the prediction mode index information is used to indicate the index information of the target prediction mode to be activated by the current block in the MPM list.
[0390] In step 3, the current block is predicted based on the target prediction mode.
[0391] "Example 3"
[0392] In another embodiment, there is further provided an encoding method applied to an encoding side, the encoding method including the following steps:
[0393] In step 1, if the current block initiates conventional intra prediction, the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, encode planar indication information according to whether the target prediction mode of the conventional intra prediction initiated by the current block is a planar prediction mode, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic coding based on one context model.
[0394] In another embodiment, a decoding method applied on a decoding side is further provided, which corresponds to the encoding method above, and the decoding method includes the following steps:
[0395] In step 1, if the current block triggers conventional intra prediction, and the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the planar indication information, where the planar indication information is used to indicate whether the target prediction mode triggered by the current block is a planar prediction mode, and the planar indication information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model.
[0396] In step 2, when it is determined based on the planar indication information that the target prediction mode activated by the current block is the planar prediction mode, the current block is predicted based on the planar prediction mode.
[0397] In step 3, when it is determined based on the planar indication information that the target prediction mode initiated by the current block is not a planar prediction mode, a target prediction mode initiated by the current block is determined from the MPM list based on the prediction mode index information, and the current block is predicted based on the target prediction mode.
[0398] "Example 4"
[0399] In another embodiment, there is further provided an encoding method applied to an encoding side, the encoding method including the following steps:
[0400] In step 1, if the current block initiates conventional intra prediction, the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, encode planar indication information according to whether the target prediction mode of the conventional intra prediction initiated by the current block is a planar prediction mode, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing bypass-based binary arithmetic coding.
[0401] In another embodiment, a decoding method applied on a decoding side is further provided, which corresponds to the encoding method above, and the decoding method includes the following steps:
[0402] In step 1, if the current block initiates conventional intra prediction, and the target prediction mode of the conventional intra prediction is from the MPM list, and the current block is a luma block, when predicting the current block based on conventional intra prediction, decoding is performed on the planar indication information, where the planar indication information is used to indicate whether the target prediction mode initiated by the current block is a planar prediction mode, and the planar indication information is obtained by performing bypass-based binary arithmetic coding.
[0403] In step 2, when it is determined based on the planar indication information that the target prediction mode activated by the current block is the planar prediction mode, the current block is predicted based on the planar prediction mode.
[0404] In step 3, when it is determined based on the planar indication information that the target prediction mode initiated by the current block is not a planar prediction mode, a target prediction mode initiated by the current block is determined from the MPM list based on the prediction mode index information, and the current block is predicted based on the target prediction mode.
[0405] "Chromaticity MPM"
[0406] The syntax element transmitted between the encoding side and the decoding side further includes chrominance prediction mode index information, which is used to indicate the index information of a target prediction mode of the current block in the corresponding candidate prediction mode list.
[0407] In the related art, the chrominance prediction mode index information and the corresponding prediction modes are as shown in Table 31 below. [Table 31]
[0408] As can be seen from Table 31 above, if the current block supports cross-component prediction mode and the current block activates cross-component prediction mode, the chrominance prediction mode index information occupies a maximum of 4 bits, and if the current block supports cross-component prediction mode and the current block does not activate cross-component prediction mode, the chrominance prediction mode index information occupies a maximum of 5 bits.
[0409] In the related art, when the current block supports the cross-component prediction mode and the current block activates the cross-component prediction mode, the encoding and decoding method of the chrominance prediction mode index information is as shown in Table 32 below. [Table 32]
[0410] As can be seen from Table 32 above, when the current block supports a cross-component prediction mode and the current block activates the cross-component prediction mode, the first bit of the chroma prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding according to a first context model, the second bit of the chroma prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding according to a second context model, the third bit and the fourth bit of the chroma prediction mode index information are obtained by performing context-based adaptive binary arithmetic decoding according to a third context model, and these three context models are different context models. That is, the chroma prediction mode index information needs to use three context models, which causes a large memory overhead.
[0411] "First embodiment of chromaticity MPM"
[0412] Figure 37 is a flowchart of an encoding method according to an embodiment of the present invention, the method is applied to the encoding side, as shown in Figure 37, the current block supports cross-component prediction mode, the current block activates cross-component prediction mode, the current block is a chrominance block, and the method includes the following steps:
[0413] In step 3701, when predicting a current block based on a cross-component prediction mode, determine index information of a target prediction mode of the current block in a corresponding candidate prediction mode list.
[0414] Here, the encoding side can select the final target prediction mode by the rate-distortion cost, and then inform the decoding side which prediction mode was selected by encoding index information.
[0415] In step 3702, chrominance prediction mode index information is encoded based on index information of a target prediction mode of a current block in a corresponding candidate prediction mode list.
[0416] Wherein, the chroma prediction mode index information is used to indicate index information of a target prediction mode of a current block in a corresponding candidate prediction mode list, where a first bit of the chroma prediction mode index information is obtained by performing context-based adaptive binary arithmetic coding based on a first context model, a second bit of the chroma prediction mode index information is obtained by performing context-based adaptive binary arithmetic coding based on a second context model, and the first context model and the second context model are different, and a third bit and a fourth bit of the chroma prediction mode index information are obtained by performing bypass-based binary arithmetic coding.
[0417] As an example, the encoding side stores a candidate chromaticity prediction mode list, and the encoding side can determine the target prediction mode that will ultimately be used by the RDO, and then informs the decoding side which prediction mode has been selected by encoding an index value, i.e., encoding the chromaticity prediction mode index information.
[0418] For example, the chrominance prediction mode includes the same prediction mode as the luminance prediction mode and a cross-component prediction mode, where the cross-component prediction mode includes a mode of deriving linear model parameters using both side templates, a mode of deriving linear model parameters using an upper template, a mode of deriving linear model parameters using a left template, a planar prediction mode, a DC prediction mode, a vertical prediction mode, and a horizontal prediction mode.
[0419] Figure 38 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side and is a decoding method corresponding to the encoding method shown in Figure 37 above. As shown in Figure 38, the current block supports cross-component prediction mode, the current block activates the cross-component prediction mode, and the current block is a chrominance block, and the method includes the following steps:
[0420] In step 3801, when predicting a current block based on a cross-component prediction mode, decoding is performed on chrominance prediction mode index information.
[0421] Here, the first bit of the chromaticity prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a first context model, the second bit of the chromaticity prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on a second context model, the first context model and the second context model are different, and the third bit and the fourth bit of the chromaticity prediction mode index information are obtained by performing bypass-based binary arithmetic decoding.
[0422] In step 3802, a target prediction mode for a current block is determined from the candidate prediction mode list based on the chrominance prediction mode index information.
[0423] In step 3803, the current block is predicted based on the target prediction mode.
[0424] As an example, the decoding side can receive the encoding stream and then parse the syntax related to the chrominance prediction mode from it. Each prediction mode has a different coding bit overhead, and the decoding side can parse the chrominance prediction mode index information to uniquely determine the chrominance prediction mode of the current block, thereby obtaining the predicted value of the current block to be used in the subsequent reconstruction process.
[0425] In an embodiment of the present invention, when the current block supports a cross-component prediction mode and the current block activates the cross-component prediction mode, the third bit and the fourth bit of the chrominance prediction mode index information are obtained by performing bypass-based binary arithmetic decoding, thereby reducing the number of context models required for the chrominance prediction mode index information to two, thereby reducing the complexity of encoding and decoding, and reducing memory overhead.
[0426] For example, if the current block supports a cross-component prediction mode and the current block activates the cross-component prediction mode, the encoding and decoding method of the chrominance prediction mode index information is as shown in Tables 33 and 34 below. [Table 33] [Table 34]
[0427] "Second embodiment of chromaticity MPM"
[0428] Figure 39 is a flowchart of an encoding method according to an embodiment of the present invention, the method is applied to the encoding side, as shown in Figure 39, the current block supports cross-component prediction mode, the current block activates cross-component prediction mode, the current block is a chrominance block, and the method includes the following steps:
[0429] In step 3901, when predicting a current block based on a cross-component prediction mode, determine index information of a target prediction mode of the current block in a corresponding candidate prediction mode list.
[0430] Here, the encoding side can select the final target prediction mode by the rate-distortion cost, and then inform the decoding side which prediction mode was selected by encoding index information.
[0431] In step 3902, chrominance prediction mode index information is encoded based on index information of a target prediction mode of a current block in a corresponding candidate prediction mode list.
[0432] Wherein, the chrominance prediction mode index information is used to indicate index information of a target prediction mode of a current block in a corresponding candidate prediction mode list, and a first bit of the chrominance prediction mode index information is obtained by performing context-based adaptive binary arithmetic coding based on one context model, and a second bit, a third bit and a fourth bit of the chrominance prediction mode index information are obtained by performing binary arithmetic coding based on bypassing.
[0433] Figure 40 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side and is a decoding method corresponding to the encoding method shown in Figure 39 above. As shown in Figure 40, the current block supports cross-component prediction mode, the current block activates cross-component prediction mode, and the current block is a chrominance block, and the method includes the following steps:
[0434] In step 4001, when predicting a current block based on a cross-component prediction mode, the chrominance prediction mode index information is decoded.
[0435] Here, the first bit of the chromaticity prediction mode index information is obtained by performing context-based adaptive binary arithmetic decoding based on one context model, and the second, third and fourth bits of the chromaticity prediction mode index information are obtained by performing bypass-based binary arithmetic decoding.
[0436] In step 4002, a target prediction mode for a current block is determined from the candidate prediction mode list based on chrominance prediction mode index information.
[0437] In step 4003, the current block is predicted based on the target prediction mode.
[0438] In an embodiment of the present invention, when the current block supports a cross-component prediction mode and the current block activates the cross-component prediction mode, the first bit of the chrominance prediction mode index information uses one context model, and the second bit, the third bit and the fourth bit all adopt a bypass-based binary arithmetic encoding / decoding scheme, thereby reducing the number of context models required for the chrominance prediction mode index information to one, thereby reducing the complexity of encoding / decoding and reducing memory overhead.
[0439] As an example, if the current block supports a cross-component prediction mode and the current block activates the cross-component prediction mode, the encoding and decoding method of the chrominance prediction mode index information is as shown in Tables 35 and 36 below. [Table 35] [Table 36]
[0440] "Third embodiment of chromaticity MPM"
[0441] Figure 41 is a flowchart of an encoding method according to an embodiment of the present invention, the method is applied to the encoding side, as shown in Figure 41, when the current block supports cross-component prediction mode and the current block is a chrominance block, the method includes the following steps:
[0442] In step 4101, when predicting a current block based on a cross-component prediction mode, determine index information of a target prediction mode of the current block in a corresponding candidate prediction mode list.
[0443] Here, the encoding side can select the final target prediction mode by the rate-distortion cost, and then inform the decoding side which prediction mode was selected by encoding index information.
[0444] In step 4102, chrominance prediction mode index information is encoded based on the index information of a target prediction mode of a current block in a corresponding candidate prediction mode list.
[0445] Here, the chrominance prediction mode index information is used to indicate the index information of the target prediction mode of the current block in the corresponding candidate prediction mode list.
[0446] For example, when the chrominance prediction mode index information is 10, the target prediction mode is a first cross-component prediction mode; If the chrominance prediction mode index information is 110, the target prediction mode is a second cross-component prediction mode; If the chrominance prediction mode index information is 111, the target prediction mode is a second cross-component prediction mode; If the chromaticity prediction mode index information is 11110, the target prediction mode is a planar prediction mode; if the chrominance prediction mode index information is 111110, the target prediction mode is a vertical prediction mode; if the chrominance prediction mode index information is 1111110, the target prediction mode is a horizontal prediction mode; If the chrominance prediction mode index information is 1111111, the target prediction mode is a DC prediction mode.
[0447] Exemplarily, the chrominance prediction mode index information and corresponding prediction modes are as shown in Table 37 below. [Table 37]
[0448] As can be seen from Table 37 above, if the current block supports cross-component prediction mode and the current block activates cross-component prediction mode, the chroma prediction mode index information indicates the cross-component prediction mode, in which case the chroma prediction mode index information occupies up to 3 bits, reducing bit overhead and thus memory overhead. However, if the current block supports cross-component prediction mode and the current block does not activate cross-component prediction mode, the chroma prediction mode index information indicates conventional intra prediction, in which case the chroma prediction mode index information occupies up to 6 bits.
[0449] In another embodiment, when the chrominance prediction mode index information is 10, the target prediction mode is a first cross-component prediction mode; If the chrominance prediction mode index information is 110, the target prediction mode is a second cross-component prediction mode; If the chrominance prediction mode index information is 111, the target prediction mode is a second cross-component prediction mode; If the chromaticity prediction mode index information is 11110, the target prediction mode is a planar prediction mode; if the chrominance prediction mode index information is 111110, the target prediction mode is a vertical prediction mode; if the chrominance prediction mode index information is 1111110, the target prediction mode is a horizontal prediction mode; If the chrominance prediction mode index information is 1111111, the target prediction mode is a DC prediction mode.
[0450] In step 4103, the current block is predicted based on the target prediction mode.
[0451] Exemplarily, the chrominance prediction mode index information and corresponding prediction modes are as shown in Table 38 below. [Table 38]
[0452] As can be seen from Table 38 above, if the current block supports cross-component prediction mode and the current block activates cross-component prediction mode, the chroma prediction mode index information indicates the cross-component prediction mode, in which case the chroma prediction mode index information occupies up to 3 bits, reducing bit overhead and thus reducing memory overhead. However, if the current block supports cross-component prediction mode and the current block does not activate cross-component prediction mode, the chroma prediction mode index information indicates conventional intra prediction, in which case the chroma prediction mode index information occupies up to 7 bits.
[0453] Figure 42 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 41. As shown in Figure 42, when the current block supports cross-component prediction mode and the current block is a chrominance block, the method includes the following steps:
[0454] In step 4201, when predicting a current block based on a cross-component prediction mode, the chrominance prediction mode index information is decoded.
[0455] In step 4202, a target prediction mode for a current block is determined from the candidate prediction mode list based on the chrominance prediction mode index information.
[0456] For example, when the chrominance prediction mode index information is 10, the target prediction mode is a first cross-component prediction mode;
[0457] If the chrominance prediction mode index information is 110, the target prediction mode is a second cross-component prediction mode; If the chrominance prediction mode index information is 111, the target prediction mode is a second cross-component prediction mode; If the chromaticity prediction mode index information is 11110, the target prediction mode is a planar prediction mode; if the chrominance prediction mode index information is 111110, the target prediction mode is a vertical prediction mode; if the chrominance prediction mode index information is 1111110, the target prediction mode is a horizontal prediction mode; If the chrominance prediction mode index information is 1111111, the target prediction mode is a DC prediction mode.
[0458] In another embodiment, when the chrominance prediction mode index information is 10, the target prediction mode is a first cross-component prediction mode; If the chrominance prediction mode index information is 110, the target prediction mode is a second cross-component prediction mode; If the chrominance prediction mode index information is 111, the target prediction mode is a second cross-component prediction mode; If the chromaticity prediction mode index information is 11110, the target prediction mode is a planar prediction mode; if the chrominance prediction mode index information is 111110, the target prediction mode is a vertical prediction mode; if the chrominance prediction mode index information is 1111110, the target prediction mode is a horizontal prediction mode; If the chrominance prediction mode index information is 1111111, the target prediction mode is a DC prediction mode.
[0459] Predict the current block based on the target prediction mode.
[0460] In step 4203, the current block is predicted based on the target prediction mode.
[0461] In an embodiment of the present invention, if the current block supports cross-component prediction mode and the current block activates the cross-component prediction mode, the bit overhead of the chrominance prediction mode index information can be reduced, thereby reducing the memory overhead.
[0462] "CCLM mode"
[0463] FIG. 43 is a flowchart of an encoding / decoding method according to an embodiment of the present invention, the method is applied to the encoding side or the decoding side, and as shown in FIG. 43, the method includes the following steps:
[0464] In step 4301, when the luma and chroma of the current block share one partitioning tree, if the width and height size of the luma block corresponding to the current block is 64*64 and the size of the chroma block corresponding to the current block is 32*32, the current block does not support cross-component prediction mode.
[0465] In an embodiment of the present invention, the dependency of luma and chroma in CCLM mode can be reduced, and the chroma block needs to wait for the reconstructed value of the 64*64 luma block can be avoided.
[0466] "ALF mode"
[0467] The syntax elements transmitted between the encoding side and the decoding side further include ALF indication information, which is used to indicate whether the current block activates ALF. Exemplarily, the ALF indication information is alf_ctb_flag.
[0468] In the related art, the encoding and decoding method of the ALF indication information is as shown in Table 39 below. [Table 39]
[0469] Here, the formula selected by the context model is
number
[0470] As can be seen from Table 39 and the above formula, the selection of the context model for encoding and decoding the ALF indication information depends on whether the block above the current block uses ALF, whether the block to the left of the current block uses ALF, and the index of the current component, and a total of nine context models need to be used.
[0471] Specifically, if the current block supports ALF and the current block is a luminance block, perform context-based adaptive binary arithmetic encoding / decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in the first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0472] If the current block supports ALF and the current block is a CB chromaticity block, perform context-based adaptive binary arithmetic encoding-decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in the second context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0473] If the current block supports ALF and the current block is a CR chrominance block, perform context-based adaptive binary arithmetic coding-decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a third context model set according to whether the block above the current block activates ALF and whether the block to the left of the current block activates ALF, where the above nine context models are different.
[0474] "First embodiment of ALF mode"
[0475] FIG. 44 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 44, the method includes the following steps:
[0476] In step 4401, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0477] As an example, the first context model set includes a first context model, a second context model, and a third context model, where if a block above the current block initiates ALF and a block to the left of the current block initiates ALF, the target context model is the first context model, if a block above the current block initiates ALF and a block to the left of the current block does not initiate ALF, or if a block above the current block does not initiate ALF and a block to the left of the current block initiates ALF, the target context model is the second context model, and if a block above the current block does not initiate ALF and a block to the left of the current block does not initiate ALF, the target context model is the third context model.
[0478] In step 4402, if the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a second context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF, and the three context models included in the second context model set and the three context models included in the first context model set are different.
[0479] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0480] As an example, the second context model set includes a fourth context model, a fifth context model, and a sixth context model: if the block above the current block initiates ALF and the block to the left of the current block initiates ALF, the goal context model is the fourth context model, if the block above the current block initiates ALF and the block to the left of the current block does not initiate ALF, or if the block above the current block does not initiate ALF and the block to the left of the current block initiates ALF, the goal context model is the fifth context model, and if the block above the current block does not initiate ALF and the block to the left of the current block does not initiate ALF, the goal context model is the sixth context model.
[0481] As an example, the encoding side can determine whether the current block activates ALF through RDO, i.e., whether to use adaptive loop filtering, and then inform the decoding side whether to activate ALF by encoding ALF indication information in the codestream, thus informing the decoding side whether to perform adaptive loop filtering. Then, when activating ALF, it is also necessary to encode syntax elements related to ALF, and the encoding side will perform filtering as well.
[0482] FIG. 45 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 44. As shown in FIG. 45, the method includes the following steps:
[0483] In step 4501, if the current block supports the adaptive loop filter ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0484] In step 4502, if the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a second context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF, and the three context models included in the second context model set and the three context models included in the first context model set are different.
[0485] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0486] After receiving the encoded stream, the decoding side can analyze whether the current block activates adaptive loop filtering by decoding the ALF indication information. If the ALF indication information indicates that the current block activates ALF, the decoding side can obtain the reconstructed pixels after filtering by continuing to decode the syntax elements related to ALF to perform adaptive loop filtering on the current block.
[0487] As an example, the encoding and decoding method of the ALF indication information is as shown in Table 40 below. [Table 40]
[0488] Here, the formula selected by the context model is
number
[0489] In an embodiment of the present invention, for the ALF indication information, the CB chrominance block and the CR chrominance block can share three different context models, and in this way, the number of context models used for the ALF indication information can be reduced to six, thereby reducing the encoding and decoding complexity and reducing memory overhead.
[0490] "Second embodiment of ALF mode"
[0491] FIG. 46 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 46, the method includes the following steps:
[0492] In step 4601, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0493] As an example, the first context model set includes a first context model, a second context model, and a third context model, where if a block above the current block initiates ALF and a block to the left of the current block initiates ALF, the target context model is the first context model, if a block above the current block initiates ALF and a block to the left of the current block does not initiate ALF, or if a block above the current block does not initiate ALF and a block to the left of the current block initiates ALF, the target context model is the second context model, and if a block above the current block does not initiate ALF and a block to the left of the current block does not initiate ALF, the target context model is the third context model.
[0494] In step 4602, if the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a second context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF, and the three context models included in the second context model set and the three context models included in the first context model set are the same.
[0495] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0496] As an example, the second context model set includes a fourth context model, a fifth context model, and a sixth context model: if the block above the current block initiates ALF and the block to the left of the current block initiates ALF, the goal context model is the fourth context model, if the block above the current block initiates ALF and the block to the left of the current block does not initiate ALF, or if the block above the current block does not initiate ALF and the block to the left of the current block initiates ALF, the goal context model is the fifth context model, and if the block above the current block does not initiate ALF and the block to the left of the current block does not initiate ALF, the goal context model is the sixth context model.
[0497] FIG. 47 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 46. As shown in FIG. 47, the method includes the following steps:
[0498] In step 4701, if the current block supports the adaptive loop filter ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0499] In step 4702, if the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a second context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF, and the three context models included in the second context model set and the three context models included in the first context model set are different.
[0500] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0501] As an example, the encoding and decoding method of the ALF indication information is as shown in Table 41 below. [Table 41]
[0502] Here, the formula selected by the context model is
number
[0503] In an embodiment of the present invention, for the ALF indication information, the luma block, the CB chroma block and the CR chroma block can share three different context models, and in this way, the number of context models used for the ALF indication information can be reduced to three, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0504] "Third embodiment of ALF mode"
[0505] FIG. 48 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 48, the method includes the following steps:
[0506] In step 4801, if the current block supports ALF and the current block is a luminance block, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a first context model before performing a filtering process on the current block based on the ALF mode.
[0507] In step 4802, if the current block supports ALF and the current block is a CB chrominance block, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a second context model before performing a filtering process on the current block based on the ALF mode.
[0508] In step 4803, if the current block supports ALF and the current block is a CR chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a third context model, where the first context model, the second context model and the third context model are different context models.
[0509] FIG. 49 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in FIG. 48. As shown in FIG. 49, the method includes the following steps:
[0510] In step 4901, if the current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a first context model, where the ALF indication information is used to indicate whether the current block activates ALF.
[0511] In step 4902, if the current block supports ALF and the current block is a CB chrominance block, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model before performing a filtering process on the current block based on the ALF mode.
[0512] In step 4903, if the current block supports ALF and the current block is a CR chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a third context model, where the first context model, the second context model and the third context model are different context models.
[0513] As an example, the encoding and decoding method of the ALF indication information is as shown in Table 42 below. [Table 42]
[0514] Here, the formula selected by the context model is
number
[0515] In an embodiment of the present invention, for the ALF indication information, the luma block shares one context model, the CB chroma block shares one context model, and the CR chroma block shares one context model, so that the number of context models used for the ALF indication information can be reduced to three, thereby reducing the encoding / decoding complexity and reducing the memory overhead.
[0516] "Fourth embodiment of ALF mode"
[0517] FIG. 50 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 50, the method includes the following steps:
[0518] In step 5001, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a first context model.
[0519] In step 5002, if the current block supports ALF and the current block is a chrominance block, then perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model before performing a filtering process on the current block based on the ALF mode.
[0520] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0521] Figure 51 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 50. As shown in Figure 51, the method includes the following steps:
[0522] In step 5101, if the current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a first context model, where the ALF indication information is used to indicate whether the current block activates ALF.
[0523] In step 5102, if the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, where the first context model and the second context model are different.
[0524] As an example, the encoding and decoding method of the ALF indication information is as shown in Table 43 below. [Table 43]
[0525] Here, the formula selected by the context model is
number
[0526] In an embodiment of the present invention, for the ALF indication information, the luma block shares one context model, and the CB chroma block and the CR chroma block share one context model, so that the number of context models used for the ALF indication information can be reduced to two, thereby reducing the coding / decoding complexity and the memory overhead.
[0527] "Fifth embodiment of ALF mode"
[0528] FIG. 52 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 52, the method includes the following steps:
[0529] In step 5201, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic coding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0530] As an example, the first context model set includes a first context model, a second context model, and a third context model, where if a block above the current block initiates ALF and a block to the left of the current block initiates ALF, the target context model is the first context model, if a block above the current block initiates ALF and a block to the left of the current block does not initiate ALF, or if a block above the current block does not initiate ALF and a block to the left of the current block initiates ALF, the target context model is the second context model, and if a block above the current block does not initiate ALF and a block to the left of the current block does not initiate ALF, the target context model is the third context model.
[0531] In step 5202, if the current block supports ALF and the current block is a CB chrominance block, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a first context model before performing a filtering process on the current block based on the ALF mode.
[0532] In step 5203, if the current block supports ALF and the current block is a CR chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, and the context models included in the first context model set, the first context model and the second context model are different context models.
[0533] Figure 53 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 52. As shown in Figure 53, the method includes the following steps:
[0534] In step 5301, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a target context model, where the target context model is one context model selected from three different context models included in a first context model set according to whether an upper block of the current block activates ALF and whether a left block of the current block activates ALF.
[0535] As an example, the first context model set includes a first context model, a second context model, and a third context model, where if a block above the current block initiates ALF and a block to the left of the current block initiates ALF, the target context model is the first context model, if a block above the current block initiates ALF and a block to the left of the current block does not initiate ALF, or if a block above the current block does not initiate ALF and a block to the left of the current block initiates ALF, the target context model is the second context model, and if a block above the current block does not initiate ALF and a block to the left of the current block does not initiate ALF, the target context model is the third context model.
[0536] In step 5302, if the current block supports ALF and the current block is a CB chrominance block, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a first context model before performing a filtering process on the current block based on an ALF mode.
[0537] In step 5303, if the current block supports ALF and the current block is a CR chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, and the context models included in the first context model set, the first context model and the second context model are different context models.
[0538] As an example, for a luminance block, the encoding and decoding method of the ALF indication information is as shown in Table 44 below. [Table 44]
[0539] Here, the formula selected by the context model is
number
[0540] As an example, for a chrominance block, the encoding and decoding method of the ALF indication information is as shown in Table 45 below. [Table 45]
[0541] Here, the formula selected by the context model is
number
[0542] In an embodiment of the present invention, for the ALF indication information, the luma block needs to use three different context models, the CB chroma block shares one context model, and the CR chroma block shares one different context model; in this way, the number of context models used for the ALF indication information can be reduced to five, which reduces the coding and decoding complexity and reduces the memory overhead.
[0543] "Sixth embodiment of ALF mode"
[0544] FIG. 54 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 54, the method includes the following steps:
[0545] In step 5401, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a first context model.
[0546] In step 5402, if the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, where the second context model and the first context model are the same context model.
[0547] Figure 55 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 54. As shown in Figure 55, the method includes the following steps:
[0548] In step 5501, if the current block supports ALF and the current block is a luma block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a first context model, and the ALF indication information is used to indicate whether the current block activates ALF.
[0549] In step 5502, if the current block supports ALF and the current block is a chrominance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on a second context model, where the second context model and the first context model are the same context model.
[0550] In an embodiment of the present invention, for the ALF indication information, the luma block, the CB chroma block and the CR chroma block can share one context model, and in this way, the number of context models used for the ALF indication information can be reduced to one, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0551] "Seventh embodiment of ALF mode"
[0552] FIG. 56 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 56, the method includes the following steps:
[0553] In step 5601, if the current block supports ALF and the current block is a luminance block, bypass-based binary arithmetic coding is performed on the ALF indication information before performing a filtering process on the current block based on the ALF mode.
[0554] In step 5602, if the current block supports ALF and the current block is a chrominance block, bypass-based binary arithmetic coding is performed on the ALF indication information before performing a filtering process on the current block based on the ALF mode.
[0555] Figure 57 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 56. As shown in Figure 57, the method includes the following steps:
[0556] In step 5701, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform bypass-based binary arithmetic decoding on the ALF indication information, where the ALF indication information is used to indicate whether the current block activates ALF.
[0557] In step 5702, if the current block supports ALF and the current block is a chrominance block, a bypass-based binary arithmetic decoding is performed on the ALF indication information before performing a filtering process on the current block based on the ALF mode.
[0558] In an embodiment of the present invention, for the ALF indication information, if the current block is a luma block, a CB chroma block, and a CR chroma block, a bypass-based binary arithmetic decoding method can be adopted to encode or decode the ALF indication information, in which case the number of context models used for the ALF indication information can be reduced to 0, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0559] "Eighth embodiment of ALF mode"
[0560] FIG. 58 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 58, the method includes the following steps:
[0561] In step 5801, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on an ALF mode, perform context-based adaptive binary arithmetic coding on the ALF indication information based on one context model, and the ALF indication information is used to indicate whether the current block activates ALF.
[0562] In step 5802, if the current block supports ALF, the current block activates the adaptive loop filter ALF, and the current block is a chrominance block, then a bypass-based binary arithmetic decoding is performed on the ALF indication information before performing a filtering process on the current block based on the ALF mode.
[0563] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0564] Figure 59 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 58. As shown in Figure 59, the method includes the following steps:
[0565] In step 5901, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on one context model, and the ALF indication information is used to indicate whether the current block activates ALF.
[0566] In step 5902, if the current block supports ALF, the current block activates the adaptive loop filter ALF, and the current block is a chrominance block, then a bypass-based binary arithmetic decoding is performed on the ALF indication information before performing a filtering process on the current block based on the ALF mode.
[0567] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0568] In an embodiment of the present invention, for the ALF indication information, the luminance block uses one context model, and the CB chrominance block and the CR chrominance block adopt a bypass-based binary arithmetic encoding / decoding method to encode or decode, so that the number of context models used for the ALF indication information can be reduced to 1, thereby reducing the complexity of encoding / decoding and reducing the memory overhead.
[0569] "Ninth embodiment of ALF mode"
[0570] FIG. 60 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 60, the method includes the following steps:
[0571] In step 6001, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, a bypass-based binary arithmetic coding is performed on the ALF indication information, and the ALF indication information is used to indicate whether the current block activates ALF.
[0572] In step 6002, if the current block supports ALF and the current block is a chrominance block, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on one context model before performing a filtering process on the current block based on the ALF mode.
[0573] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0574] Figure 61 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 60. As shown in Figure 61, the method includes the following steps:
[0575] In step 6101, if the current block supports ALF and the current block is a luminance block, before performing a filtering process on the current block based on the ALF mode, perform bypass-based binary arithmetic decoding on the ALF indication information, where the ALF indication information is used to indicate whether the current block activates ALF.
[0576] In step 6102, if the current block supports ALF and the current block is a chrominance block, perform context-based adaptive binary arithmetic decoding on the ALF indication information based on one context model before performing filtering processing on the current block based on the ALF mode.
[0577] Here, the chromaticity blocks include a CB chromaticity block and a CR chromaticity block.
[0578] In an embodiment of the present invention, for the ALF indication information, the luma block adopts a bypass-based binary arithmetic encoding / decoding method to encode or decode the ALF indication information, and the CB chroma block and the CR chroma block share one context model. In this way, the number of context models used for the ALF indication information can be reduced to 1, thereby reducing the complexity of encoding / decoding and reducing the memory overhead.
[0579] "MIP mode"
[0580] In MIP mode, the syntax element transmitted between the encoding side and the decoding side further includes MIP indication information, and the MIP indication information is used to indicate whether the current block activates the matrix-based intra prediction mode. Exemplarily, the MIP indication information is Intra_MIP_flag.
[0581] In the related technology, when a current block supports a matrix-based intra prediction mode, before predicting the current block based on the matrix-based intra prediction mode, a context-based adaptive binary arithmetic decoding can be performed on the MIP indication information based on a target context model, where the target context model is one context model selected from four different context models according to whether an upper block of the current block activates a matrix-based intra prediction mode, whether a left block of the current block activates a matrix-based intra prediction mode, and whether the current block satisfies a preset size condition.
[0582] As an example, the preset size condition may be that the width of the current block is greater than twice the height, or that the height of the current block is greater than twice the width, although the preset size condition may be other conditions and the embodiment of the present invention is not limited thereto.
[0583] Specifically, it is assumed that the above four different context models include a first context model, a second context model, a third context model and a fourth context model. If the block above the current block activates a matrix-based intra prediction mode, the block to the left of the current block activates a matrix-based intra prediction mode, and the current block does not satisfy the preset size condition, the target context model is a first context model; if the block above the current block activates a matrix-based intra prediction mode, the block to the left of the current block does not activate a matrix-based intra prediction mode, and the current block does not satisfy the preset size condition, or if the block above the current block does not activate a matrix-based intra prediction mode, the block to the left of the current block activates a matrix-based intra prediction mode, and the current block does not satisfy the preset size condition, the target context model is a second context model; if the block above the current block does not activate a matrix-based intra prediction mode, the block to the left of the current block does not activate a matrix-based intra prediction mode, and the current block does not satisfy the preset size condition, the target context model is a third context model; and if the current block satisfies the preset size condition, the target context model is a fourth context model.
[0584] As can be seen from the above, in the MIP mode, the MIP indication information needs to use four different context models, which results in a large memory overhead.
[0585] "First embodiment in MIP mode"
[0586] Figure 62 is a flowchart of an encoding / decoding method according to an embodiment of the present invention, the method is applied to the encoding side or the decoding side, and as shown in Figure 62, the method includes the following steps:
[0587] In step 6201, if the width and height size of the current block is 32*32, the current block does not support matrix-based intra prediction mode.
[0588] Wherein, the current block is a luma block or a chroma block. Exemplarily, if the current block is a luma block and the width and height size of the current block is 32*32, the current block does not support matrix-based intra prediction mode.
[0589] As another example, if the width and height size of the current block is 32*16, the current block does not support a matrix-based intra prediction mode. Illustratively, the current block is a luma block or a chroma block.
[0590] As another example, if the width and height size of the current block is 4*4, the current block does not support a matrix-based intra prediction mode. Illustratively, the current block is a luma block or a chroma block.
[0591] In an embodiment of the present invention, if the current block is a large-sized block, it is guaranteed that the current block does not support a matrix-based intra-prediction mode, i.e., the current block cannot enable a matrix-based intra-prediction mode, which can reduce the computational complexity.
[0592] "Second embodiment in MIP mode"
[0593] Figure 63 is a flowchart of an encoding and decoding method according to an embodiment of the present invention, the method is applied to the encoding side, and as shown in Figure 63, when the current block supports a matrix-based intra prediction mode, the method includes the following steps:
[0594] In step 6301, context-based adaptive binary arithmetic coding is performed on the MIP indication information based on a target context model depending on whether the current block initiates a matrix-based intra-prediction mode, where the target context model is one context model selected from three different context models depending on whether the block above the current block initiates a matrix-based intra-prediction mode and whether the block to the left of the current block initiates a matrix-based intra-prediction mode.
[0595] As an example, suppose that the above three different context models include a first context model, a second context model, and a third context model. If the block above the current block activates a matrix-based intra prediction mode and the block to the left of the current block activates a matrix-based intra prediction mode, the target context model is the first context model; if the block above the current block activates a matrix-based intra prediction mode and the block to the left of the current block does not activate a matrix-based intra prediction mode, or if the block above the current block does not activate a matrix-based intra prediction mode and the block to the left of the current block activates a matrix-based intra prediction mode, the target context model is the second context model; if the block above the current block does not activate a matrix-based intra prediction mode and the block to the left of the current block does not activate a matrix-based intra prediction mode, the target context model is the third context model.
[0596] As an example, when the encoding side determines that the current block meets the conditions for matrix-based intra prediction, it can determine through the RDO whether the current block should activate MIP mode, i.e., whether to use the matrix-based intra prediction method, and notify the decoding side of whether to activate MIP mode by encoding MIP indication information in the encoding stream.
[0597] The above MIP indication information is coded according to specific circumstances in the coding stream, and if the current block activates the MIP mode, other syntax elements related to MIP also need to be coded.
[0598] Figure 64 is a flowchart of an encoding and decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 63. As shown in Figure 64, when the current block supports a matrix-based intra prediction mode, the method includes the following steps:
[0599] In step 6401, before predicting the current block based on a matrix-based intra-prediction mode, context-based adaptive binary arithmetic decoding is performed on the MIP indication information based on a target context model, where the target context model is one context model selected from three different context models depending on whether an upper block of the current block activates a matrix-based intra-prediction mode and whether a left block of the current block activates a matrix-based intra-prediction mode.
[0600] As an example, suppose that the above three different context models include a first context model, a second context model, and a third context model. If the block above the current block activates a matrix-based intra prediction mode and the block to the left of the current block activates a matrix-based intra prediction mode, the target context model is the first context model; if the block above the current block activates a matrix-based intra prediction mode and the block to the left of the current block does not activate a matrix-based intra prediction mode, or if the block above the current block does not activate a matrix-based intra prediction mode and the block to the left of the current block activates a matrix-based intra prediction mode, the target context model is the second context model; if the block above the current block does not activate a matrix-based intra prediction mode and the block to the left of the current block does not activate a matrix-based intra prediction mode, the target context model is the third context model.
[0601] In step 6402, if it is determined based on the MIP indication information that the current block activates the matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block.
[0602] As an example, when the decoding side receives the encoded stream and determines that the current block meets the analysis condition, it analyzes the MIP indication information to determine whether the current block activates MIP mode.The analysis condition includes that the current block is a luminance block and that the size of the current block meets a certain condition.Of course, the analysis condition is not limited to the above condition and may include other conditions.
[0603] Using the MIP indication information, the decoding side can determine whether the prediction mode of the current block is a matrix-based intra-prediction mode, and if so, can continue to parse other syntax related to the mode to obtain the information of the prediction mode, and thus obtain the predicted value.
[0604] In an embodiment of the present invention, in MIP mode, one context model is selected from three different context models only according to whether the block above the current block initiates a matrix-based intra-prediction mode and whether the block to the left of the current block initiates a matrix-based intra-prediction mode, without considering the size condition of the current block. In this way, the number of context models required for the MIP indication information can be reduced to three, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0605] "Third embodiment in MIP mode"
[0606] Figure 65 is a flowchart of an encoding and decoding method according to an embodiment of the present invention, the method is applied to the encoding side, and as shown in Figure 65, when the current block supports a matrix-based intra prediction mode, the method includes the following steps:
[0607] In step 6501, context-based adaptive binary arithmetic coding is performed on the MIP indication information based on a target context model depending on whether the current block activates a matrix-based intra prediction mode, where the target context model is one context model selected from two different context models depending on whether the current block satisfies a preset size condition.
[0608] Here, the preset size condition may be that the width of the current block is greater than twice its height, or that the height of the current block is greater than twice its width.
[0609] As an example, assume that the above two different context models include a first context model and a second context model. If the size of the current block meets the preset size condition, the target context model is the first context model, and if the size of the current block does not meet the preset size condition, the target context model is the second context model.
[0610] Figure 66 is a flowchart of an encoding and decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 65 above. As shown in Figure 66, if the current block supports a matrix-based intra prediction mode, the method includes the following steps:
[0611] In step 6601, before predicting the current block based on a matrix-based intra-prediction mode, a context-based adaptive binary arithmetic decoding is performed on the MIP indication information based on a target context model, where the target context model is one context model selected from two different context models depending on whether the current block satisfies a preset size condition.
[0612] Here, the preset size condition may be that the width of the current block is greater than twice its height, or that the height of the current block is greater than twice its width.
[0613] As an example, assume that the above two different context models include a first context model and a second context model. If the size of the current block meets the preset size condition, the target context model is the first context model, and if the size of the current block does not meet the preset size condition, the target context model is the second context model.
[0614] In step 6602, if it is determined based on the MIP indication information that the current block activates the matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block.
[0615] In an embodiment of the present invention, in MIP mode, when selecting a context model for MIP instruction information, the context model can be selected only according to size conditions, without considering whether the block above the current block initiates a matrix-based intra prediction mode and whether the block to the left of the current block initiates a matrix-based intra prediction mode. In this way, the number of context models required for the MIP instruction information can be reduced to two, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0616] "Fourth embodiment in MIP mode"
[0617] Figure 67 is a flowchart of an encoding and decoding method according to an embodiment of the present invention, the method is applied to the encoding side, and as shown in Figure 67, when the current block supports a matrix-based intra prediction mode, the method includes the following steps:
[0618] In step 6701, depending on whether the current block activates a matrix-based intra prediction mode, a context-based adaptive binary arithmetic coding is performed on the MIP indication information according to the same context model.
[0619] Figure 68 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 67 above. As shown in Figure 68, if the current block supports a matrix-based intra-prediction mode, the method includes the following steps:
[0620] In step 6801, before predicting the current block based on the matrix-based intra prediction mode, a context-based adaptive binary arithmetic decoding is performed on the MIP indication information based on the same context model.
[0621] In step 6802, if it is determined based on the MIP indication information that the current block activates the matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block.
[0622] In an embodiment of the present invention, in MIP mode, for the selection of the context model of the MIP indication information, regardless of whether the block above the current block initiates a matrix-based intra prediction mode, whether the block to the left of the current block initiates a matrix-based intra prediction mode, and the size condition, context-based adaptive binary arithmetic coding or decoding is performed on the MIP indication information based on the same context model under different conditions, thereby reducing the number of context models required for the MIP indication information to 1, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0623] "Fifth embodiment in MIP mode"
[0624] Figure 69 is a flowchart of an encoding and decoding method according to an embodiment of the present invention, the method is applied to the encoding side, and as shown in Figure 69, when the current block supports a matrix-based intra prediction mode, the method includes the following steps:
[0625] In step 6901, the MIP indication information is subjected to bypass-based binary arithmetic coding depending on whether the current block activates a matrix-based intra prediction mode.
[0626] Figure 70 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 69 above. As shown in Figure 70, if the current block supports a matrix-based intra-prediction mode, the method includes the following steps:
[0627] In step 7001, before predicting a current block based on a matrix-based intra prediction mode, a bypass-based binary arithmetic decoding is performed on the MIP indication information.
[0628] In step 7002, if it is determined based on the MIP indication information that the current block activates the matrix-based intra-prediction mode, the matrix-based intra-prediction mode predicts the current block.
[0629] In an embodiment of the present invention, in MIP mode, regardless of whether the block above the current block initiates a matrix-based intra prediction mode, whether the block to the left of the current block initiates a matrix-based intra prediction mode, and the size condition, bypass-based binary arithmetic coding or decoding is performed on the MIP indication information under different conditions, that is, context-based adaptive binary arithmetic coding or decoding is not used, and in this way, the number of context models required for the MIP indication information can be reduced to zero, thereby reducing the complexity of encoding and decoding and reducing memory overhead.
[0630] "BDPCM mode"
[0631] In the related art, the BDPCM technique lacks SPS-level syntax for turning BDPCM mode on or off, and also lacks SPS-level syntax for controlling the switch of the size of the largest encoded block for which BDPCM mode can be enabled, resulting in low flexibility.
[0632] "First embodiment in BDPCM mode"
[0633] Figure 71 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in Figure 71, if the current block supports BDPCM mode, the method includes the following steps:
[0634] In step 7101, before performing BDPCM encoding on the current block, first BDPCM indication information is encoded, and the first BDPCM indication information is used to indicate whether the current processing unit supports the BDPCM mode.
[0635] For example, the first BDPCM indication information may be present in a sequence parameter set, a picture parameter set, a slice level, or a tile level. Preferably, the first BDPCM indication information is present in a sequence parameter set, that is, the first BDPCM indication information is an SPS level syntax.
[0636] In another embodiment, the encoding side may encode range indication information, which is used to indicate the range of processing units that support the BDPCM mode. The range indication information may be present in a sequence parameter set, a picture parameter set, a slice level, or a tile level.
[0637] Figure 72 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 71 above. As shown in Figure 72, if the current block supports BDPCM mode, the method includes the following steps:
[0638] In step 7201, before performing BDPCM decoding on the current block, a first BDPCM indication information is decoded, and the first BDPCM indication information is used to indicate whether the current processing unit supports the BDPCM mode.
[0639] In step 7202, the current processing unit is decoded based on the first BDPCM indication information.
[0640] As an example, if the first BDPCM indication information indicates that the current processing unit supports the BDPCM mode, process the current processing unit according to the BDPCM mode.
[0641] For example, the first BDPCM indication information may be present in a sequence parameter set, a picture parameter set, a slice level, or a tile level. Preferably, the first BDPCM indication information is present in a sequence parameter set, that is, the first BDPCM indication information is an SPS level syntax.
[0642] In another embodiment, the decoding side may decode range indication information, which is used to indicate the range of processing units that support the BDPCM mode. The range indication information may be present in a sequence parameter set, a picture parameter set, a slice level, or a tile level.
[0643] In an embodiment of the present invention, a syntax for turning on or off the BDPCM mode is added to improve the flexibility of the encoding and decoding process. Also, a syntax is added that can be used to indicate the range of processing units that support the BDPCM mode.
[0644] "Second embodiment in BDPCM mode"
[0645] Figure 73 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in Figure 73, if the current block supports BDPCM mode, the method includes the following steps:
[0646] In step 7301, before performing BDPCM processing on the current block, second BDPCM indication information is encoded, where the second BDPCM indication information is used to indicate a size range of processing units that support the BDPCM mode.
[0647] Here, the scope of the unit in the current processing unit may be a sequence level, a picture parameter set, or a block level, etc. For example, the current processing unit may be a current image block.
[0648] Illustratively, the size range may be a size range smaller than 32*32.
[0649] For example, the second BDPCM indication information is used to indicate the maximum size of a processing unit that can support the BDPCM mode, i.e., the maximum size of a processing unit that can use the BDPCM mode. Exemplarily, the maximum size is 32*32.
[0650] For example, the second BDPCM indication information may be present in a sequence parameter set (SPS), a picture parameter set, a slice level, or a tile level. Preferably, the second BDPCM indication information is present in a sequence parameter set, that is, the second BDPCM indication information is a syntax added to the SPS level.
[0651] Figure 74 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 73 above. As shown in Figure 74, if the current block supports BDPCM mode, the method includes the following steps:
[0652] In step 7401, before performing BDPCM processing on the current block, the second BDPCM indication information is decoded, and the second BDPCM indication information is used to indicate the size range of the processing unit that supports the BDPCM mode.
[0653] In step 7402, it is determined whether the current block can perform BDPCM processing based on the second BDPCM indication information and the size of the current block.
[0654] For example, if the size of the current block is within the size range of the processing unit supporting the BDPCM mode indicated in the second BDPCM indication information, it is determined that the current block can perform BDPCM processing, and if the size of the current block is not within the size range of the processing unit supporting the BDPCM mode indicated in the second BDPCM indication information, it is determined that the current block cannot perform BDPCM processing.
[0655] For example, the second BDPCM indication is used to indicate the maximum size of a processing unit that can support the BDPCM mode, and if the size of the current block is equal to or smaller than the maximum size indicated by the second BDPCM indication, it is determined that the current block can perform BDPCM processing, and if the size of the current block is larger than the maximum size indicated by the second BDPCM indication, it is determined that the current block cannot perform BDPCM processing.
[0656] For example, the second BDPCM indication information may be present in a sequence parameter set (SPS), a picture parameter set, a slice level, or a tile level. Preferably, the second BDPCM indication information is present in a sequence parameter set, that is, the second BDPCM indication information is a syntax added to the SPS level.
[0657] In the embodiment of the present invention, a syntax for controlling the size range in which the BDPCM mode can be used is added to improve the flexibility of the encoding and decoding process.
[0658] "Third embodiment in BDPCM mode"
[0659] In the BDPCM mode, the syntax elements transmitted between the encoding side and the decoding side may include a third BDPCM indication information and a fourth BDPCM indication information. The third BDPCM indication information is used to indicate whether the current processing unit activates the BDPCM mode, and the fourth BDPCM indication information is used to indicate the index information of the prediction direction of the BDPCM mode. Exemplarily, the third BDPCM indication information is Intra_bdpcm_flag, and the fourth BDPCM indication information is Intra_bdpcm_dir_flag.
[0660] In the related technology, when the current block supports the BDPCM mode, when it is determined to encode or decode the third BDPCM indication information, it is necessary to perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the third BDPCM indication information based on one context model, and when it is determined to encode or decode the fourth BDPCM indication information, it is necessary to perform context-based adaptive binary arithmetic coding or context-based adaptive binary arithmetic decoding on the fourth BDPCM indication information based on another different context model. That is, as shown in Table 46 below, it is necessary to encode and decode the third BDPCM indication information and the fourth BDPCM indication information using two context models. [Table 46]
[0661] Figure 75 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in Figure 75, if the current block supports BDPCM mode, the method includes the following steps:
[0662] In step 7501, before performing BDPCM encoding on the current block, context-based adaptive binary arithmetic encoding is performed on the third BDPCM indication information based on one context model depending on whether the current block activates a BDPCM mode.
[0663] As an example, if the current block satisfies the condition of block-based quantized residual differential PCM coding, it can be determined whether to activate the BDPCM mode by the RDO, i.e., whether to use the method of quantized residual differential PCM coding, and a third BDPCM indication information is coded in the coding stream to indicate whether the current block activates the BDPCM mode.
[0664] In step 7502, if it is determined that the current block initiates a BDPCM mode, then perform bypass-based binary arithmetic coding on the fourth BDPCM indication information according to the index information of the prediction direction of the BDPCM mode.
[0665] Here, the prediction direction of the BDPCM mode includes a horizontal prediction direction and a vertical prediction direction.
[0666] As an example, the encoding side can determine the prediction direction by the RDO, and based on the selected prediction direction, indicate the prediction direction of the BDPCM mode by encoding a fourth BDPCM indication information in the encoded stream.
[0667] Figure 76 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 75 above. As shown in Figure 76, if the current block supports BDPCM mode, the method includes the following steps:
[0668] In step 7601, before performing block-based quantized residual differential PCM decoding for the current block, a context-based adaptive binary arithmetic decoding is performed on the third BDPCM indication information based on one context model.
[0669] As an example, the decoding side may receive the encoded stream of the current block, and if the current block satisfies the analysis condition, determine whether the current block activates the BDPCM mode by analyzing the third BDPCM indication information.
[0670] Here, the analysis condition includes that the size of the current block satisfies a certain size condition. Of course, the analysis condition is not limited to the above condition and may include other conditions.
[0671] In step 7602, when the third BDPCM indication information indicates that the current block activates a BDPCM mode, bypass-based binary arithmetic decoding is performed on the fourth BDPCM indication information, and the fourth BDPCM indication information is used to indicate index information of the prediction direction of the BDPCM mode.
[0672] If the current block activates the BDPCM mode, the prediction direction needs to be determined by further analyzing the fourth BDPCM indication information.
[0673] In step 7603, BDPCM processing is performed on the current block according to the prediction direction indicated by the fourth BDPCM indication information.
[0674] As an example, the decoding side can obtain the quantized residual data through an inverse accumulation process, and then inverse quantize and add it with the predicted value to obtain the reconstructed pixel value.
[0675] As an example, the encoding and decoding methods of the third BDPCM indication information and the fourth BDPCM indication information are as shown in Table 47 below. [Table 47]
[0676] In an embodiment of the present invention, the third BDPCM indication information uses one context model, and the fourth BDPCM indication information adopts a bypass-based binary arithmetic encoding / decoding method, in which the number of context models required for the third BDPCM indication information and the fourth BDPCM indication information can be reduced to one, thereby reducing the complexity of encoding / decoding and reducing memory overhead.
[0677] "Fourth embodiment in BDPCM mode"
[0678] Figure 77 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in Figure 77, if the current block supports BDPCM mode, the method includes the following steps:
[0679] In step 7701, before performing BDPCM encoding on the current block, a bypass-based binary arithmetic encoding is performed on the third BDPCM indication information depending on whether the current block activates the BDPCM mode.
[0680] As an example, if the current block meets the condition of block-based quantized residual differential PCM coding, it can determine whether the current block uses the method of quantized residual differential PCM coding according to rate distortion, and indicates whether the current block activates BDPCM mode by encoding third BDPCM indication information in the encoding stream.
[0681] In step 7702, if it is determined that the current block initiates a BDPCM mode, then perform bypass-based binary arithmetic coding on the fourth BDPCM indication information according to the index information of the prediction direction of the BDPCM mode.
[0682] Here, the prediction direction of the BDPCM mode includes a horizontal prediction direction and a vertical prediction direction.
[0683] As an example, the encoding side can determine the prediction direction according to the rate distortion, and indicates the prediction direction of the BDPCM mode by encoding a fourth BDPCM indication information in the encoded stream.
[0684] Figure 78 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 77 above. As shown in Figure 78, if the current block supports BDPCM mode, the method includes the following steps:
[0685] In step 7801, a bypass-based binary arithmetic decoding is performed on the third BDPCM indication before performing BDPCM decoding on the current block.
[0686] As an example, the decoding side may receive the encoded stream of the current block, and if the current block satisfies the analysis condition, determine whether the current block activates the BDPCM mode by analyzing the third BDPCM indication information.
[0687] Here, the analysis condition includes that the size of the current block satisfies a certain size condition. Of course, the analysis condition is not limited to the above condition and may include other conditions.
[0688] In step 7802, when the third BDPCM indication information indicates that the current block activates a BDPCM mode, bypass-based binary arithmetic decoding is performed on the fourth BDPCM indication information, and the fourth BDPCM indication information is used to indicate index information of the prediction direction of the BDPCM mode.
[0689] If the current block activates the BDPCM mode, the prediction direction needs to be determined by further analyzing the fourth BDPCM indication information.
[0690] In step 7803, BDPCM processing is performed on the current block according to the prediction direction indicated by the fourth BDPCM indication information.
[0691] As an example, the decoding side can obtain the quantized residual data through an inverse accumulation process, and then inverse quantize and add it with the predicted value to obtain the reconstructed pixel value.
[0692] As an example, the encoding and decoding methods of the third BDPCM indication information and the fourth BDPCM indication information are as shown in Table 48 below. [Table 48]
[0693] In an embodiment of the present invention, the third BDPCM indication information and the fourth BDPCM indication information adopt a bypass-based binary arithmetic encoding / decoding scheme, in which the number of context models required for the third BDPCM indication information and the fourth BDPCM indication information can be reduced to zero, thereby reducing the encoding / decoding complexity and reducing memory overhead.
[0694] "Fifth embodiment in BDPCM mode"
[0695] In the BDPCM mode, the syntax elements transmitted between the encoding side and the decoding side further include CBF indication information, which is used to indicate whether the transform block of the current block has non-zero transform coefficients. Exemplarily, the CBF indication information is cbf_flag or Tu_cbf_luma.
[0696] In the related technology, before predicting a current block based on intra sub-block prediction, a context-based adaptive binary arithmetic coding or a context-based adaptive binary arithmetic decoding may be performed on the CBF indication information based on a target context model, where the target context model is one context model selected from five different context models according to the conditions of whether the current block activates an intra sub-block prediction mode, whether the transform block before the current block has a non-zero transform coefficient, the division depth of the transform block of the current block, and whether the current block activates a BDPCM mode.
[0697] Specifically, it is assumed that the five different context models include a first context model, a second context model, a third context model, a fourth context model and a fifth context model. If the current block activates intra sub-block prediction, the target context model is one of the context models selected from the first context model and the second context model according to whether the transform block before the current block has a non-zero transform coefficient. Exemplarily, if the transform block before the current block has a non-zero transform coefficient, the target context model is the first context model, and if the transform block before the current block does not have a non-zero transform coefficient, the target context model is the second context model. If the current block does not activate intra sub-block prediction, that is, the current block activates conventional intra prediction, the target context model is one of the context models selected from the third context model and the fourth context model according to the division depth of the transform block of the current block. Exemplarily, when the partition depth of the transform block of the current block is greater than the preset partition depth, the target context model is the third context model, when the partition depth of the transform block of the current block is equal to or less than the preset partition depth, the target context model is the fourth context model, when the current block activates the BDPCM mode, the target context model is the fifth context model.
[0698] In the related art, the CBF indication information requires the use of five context models, and the number of required context models is large, resulting in high coding / decoding complexity and large memory overhead.
[0699] FIG. 79 is a flowchart of a method for encoding according to an embodiment of the present invention, which is applied to the decoding side. As shown in FIG. 79, the method includes the following steps:
[0700] In step 7901, if the current block activates intra sub-block prediction, when it is determined that CBF indication information is to be encoded, context-based adaptive binary arithmetic encoding is performed on the CBF indication information based on a target context model, where the target context model is one context model selected from two different context models included in a first context model set depending on whether the previous transform block of the current block has non-zero transform coefficients.
[0701] As an example, assuming that the first context model set includes a first context model and a second context model, if the transform block preceding the current block has non-zero transform coefficients, the target context model is the first context model, and if the transform block preceding the current block does not have non-zero transform coefficients, the target context model is the second context model.
[0702] In step 7902, when it is determined that the current block activates conventional intra prediction or BDPCM mode, to encode the CBF instruction information, context-based adaptive binary arithmetic encoding is performed on the CBF instruction information based on a target context model, where the target context model is one context model selected from two different context models included in a second context model set according to a division depth of the transform block of the current block, and the two context models included in the second context model set and the two context models included in the first context model set are different.
[0703] As an example, assuming that the second context model set includes a third context model and a fourth context model, if the partition depth of the transform block of the current block is greater than the preset partition depth, the target context model is the third context model, and if the partition depth of the transform block of the current block is less than or equal to the preset partition depth, the target context model is the fourth context model.
[0704] Figure 80 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 79 above. As shown in Figure 80, the method includes the following steps:
[0705] In step 8001, if the current block activates intra sub-block prediction, when it is determined that CBF indication information is to be decoded, context-based adaptive binary arithmetic decoding is performed on the CBF indication information based on a target context model, where the target context model is one context model selected from two different context models included in a first context model set depending on whether the transform block preceding the current block has non-zero transform coefficients.
[0706] As an example, assuming that the first context model set includes a first context model and a second context model, if the transform block preceding the current block has non-zero transform coefficients, the target context model is the first context model, and if the transform block preceding the current block does not have non-zero transform coefficients, the target context model is the second context model.
[0707] In step 8002, when it is determined that the current block activates conventional intra prediction or BDPCM mode, to decode the CBF instruction information, perform context-based adaptive binary arithmetic decoding on the CBF instruction information based on a target context model, where the target context model is one context model selected from two different context models included in a second context model set according to the division depth of the transform block of the current block, and the two context models included in the second context model set and the two context models included in the first context model set are different.
[0708] As an example, assuming that the second context model set includes a third context model and a fourth context model, if the partition depth of the transform block of the current block is greater than the preset partition depth, the target context model is the third context model, and if the partition depth of the transform block of the current block is less than or equal to the preset partition depth, the target context model is the fourth context model.
[0709] In an embodiment of the present invention, when the current block activates the BDPCM mode, the selection of the context model for encoding and decoding the CBF indication information also depends on the division depth of the transform block of the current block, and when the current block activates the BDPCM mode and when the current block activates the conventional intra prediction, two context models are shared. In this way, the number of context models required for the CBF indication information is reduced to four, thereby reducing the complexity of encoding and decoding and reducing the content overhead.
[0710] "Sixth embodiment in BDPCM mode"
[0711] FIG. 81 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 81, the method includes the following steps:
[0712] In step 8101, when it is determined that the current block initiates intra sub-block prediction, or initiates conventional intra prediction, or initiates BDPCM mode, context-based adaptive binary arithmetic coding is performed on the CBF indication information based on a target context model, where the target context model is one context model selected from two different context models according to the division depth of the transform block of the current block.
[0713] As an example, assuming that the two different context models are a first context model and a second context model, if the partition depth of the transform block of the current block is greater than the preset partition depth, the target context model is the first context model, and if the partition depth of the transform block of the current block is less than or equal to the preset partition depth, the target context model is the second context model.
[0714] Figure 82 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 81 above. As shown in Figure 82, the method includes the following steps:
[0715] In step 8201, if the current block initiates intra sub-block prediction, or initiates conventional intra prediction, or initiates BDPCM mode, when it is determined that CBF indication information is to be decoded, perform context-based adaptive binary arithmetic decoding on the CBF indication information based on a target context model, where the target context model is one context model selected from two different context models according to the division depth of the transform block of the current block.
[0716] As an example, assuming that the two different context models are a first context model and a second context model, if the partition depth of the transform block of the current block is greater than the preset partition depth, the target context model is the first context model, and if the partition depth of the transform block of the current block is less than or equal to the preset partition depth, the target context model is the second context model.
[0717] In an embodiment of the present invention, when the current block activates the BDPCM mode or the intra sub-block prediction mode, the selection of the context model for encoding and decoding the CBF indication information also depends on the partition depth of the transform block of the current block. When the current block activates the BDPCM mode, activates the conventional intra prediction, and activates the intra sub-block partition mode, the two context models are shared. In this way, the number of context models required for the CBF indication information is reduced to two, thereby reducing the complexity of encoding and decoding and reducing the content overhead.
[0718] "Seventh embodiment in BDPCM mode"
[0719] FIG. 83 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 83, the method includes the following steps:
[0720] In step 8301, if the current block initiates intra sub-block prediction or conventional intra prediction, when it is determined that CBF indication information is to be encoded, context-based adaptive binary arithmetic coding is performed on the CBF indication information based on a target context model, and the target context model is one context model selected from two different context models included in the first context model set according to the division depth of the transform block of the current block.
[0721] As an example, assuming that the first context model set includes a first context model and a second context model, if the partition depth of the transform block of the current block is greater than the preset partition depth, the target context model is the first context model, and if the partition depth of the transform block of the current block is less than or equal to the preset partition depth, the target context model is the second context model.
[0722] In step 8302, if the current block activates the BDPCM mode, when it is determined that CBF indication information is to be encoded, context-based adaptive binary arithmetic coding is performed on the CBF indication information based on a target context model, where the target context model is a context model included in the first context model set.
[0723] Figure 84 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in the embodiment of Figure 83 above. As shown in Figure 84, the method includes the following steps:
[0724] In step 8401, when it is determined that the current block triggers intra sub-block prediction or conventional intra prediction, before predicting the current block based on the intra sub-block prediction, context-based adaptive binary arithmetic decoding is performed on the CBF indication information based on a target context model, where the target context model is one context model selected from two different context models included in the first context model set according to the division depth of the transform block of the current block.
[0725] As an example, assuming that the first context model set includes a first context model and a second context model, if the partition depth of the transform block of the current block is greater than the preset partition depth, the target context model is the first context model, and if the partition depth of the transform block of the current block is less than or equal to the preset partition depth, the target context model is the second context model.
[0726] In step 8402, if the current block activates the BDPCM mode, when it is determined to decode the CBF indication information, perform context-based adaptive binary arithmetic decoding on the CBF indication information based on a target context model, where the target context model is a context model included in the first context model set.
[0727] In an embodiment of the present invention, in intra sub-block prediction and conventional intra prediction, the CBF indication information shares two context models based on the division depth of the transform block of the current block, and in the BDPCM mode, the context model for encoding and decoding the CBF indication information can select one from the two context models used in the conventional intra prediction and intra sub-block prediction modes, thereby reducing the number of context models required for the CBF indication information to two, thereby reducing the complexity of encoding and decoding and reducing content overhead.
[0728] "JCCR mode"
[0729] FIG. 85 is a flowchart of an encoding method according to an embodiment of the present invention, which is applied to the encoding side. As shown in FIG. 85, the method includes the following steps:
[0730] In step 8501, before encoding the current block based on the JCCR mode, JCCR indication information is encoded depending on whether the current block supports the JCCR mode, and the JCCR indication information is used to indicate whether the current processing unit supports the JCCR mode.
[0731] Here, the scope of the unit in the current processing unit may be a sequence level, an image parameter set, or a block level, etc. For example, the current processing unit is a current image block.
[0732] Here, whether the current processing unit supports the JCCR mode refers to whether the JCCR mode can be enabled, that is, whether the JCCR mode is turned on. Exemplarily, the JCCR indication information is sps_jccr_enable_flag, which is an enable flag of the JCCR. For example, if sps_jccr_enable_flag is true, it indicates that the current block supports the JCCR mode. For example, the current block may be a chrominance residual block.
[0733] As an example, the JCCR indication may be present in a sequence parameter set (SPS), a picture parameter set, a slice level, or a tile level. Preferably, the JCCR indication is present in a sequence parameter set, i.e., the JCCR indication is a syntax added at the SPS level.
[0734] As an example, the encoding side may encode range indication information, which is used to indicate the range of processing units that support the JCCR mode. As an example, the range indication information may be present in a sequence parameter set (SPS), a picture parameter set, a slice level, or a tile level.
[0735] After this, the decoding side determines whether the current block activates the JCCR mode based on the JCCR indication information.
[0736] As an example, if the JCCR mode indicates that the current block supports the JCCR mode, the determination of the CBF value of the current block can be continued, and the encoding side can activate the JCCR mode if the CBF values of the CB component and the CR component of the current block are both true, i.e., the residual coefficients of the CB component and the CR component of the current block are not both 0. Exemplarily, whether the current block activates the JCCR mode can be determined by the RDO at the encoding side.
[0737] Figure 86 is a flowchart of a decoding method according to an embodiment of the present invention, which is applied to the decoding side, and which is a decoding method corresponding to the encoding method shown in Figure 85 above. As shown in Figure 86, the method includes the following steps:
[0738] In step 8601, before decoding the current block based on the JCCR mode, decode the JCCR indication information, which is used to indicate whether the current processing unit supports the JCCR mode.
[0739] In step 8602, it is determined that the current block supports the JCCR mode based on the JCCR indication information, and if the current block activates the JCCR mode, the chrominance residual coefficients of the current block are obtained by decoding the current block according to the correlation between the CB component and the CR component of the current block.
[0740] For example, if it is determined that the current block supports the JCCR mode according to the JCCR indication information, it can continue to determine the CBF value of the current block, and if the CBF values of the CB component and the CR component of the current block are both true, that is, the CB component and the CR component of the current block both have non-zero transform coefficients, it continues to analyze whether the current block activates the JCCR mode. If it is determined that the current block activates the JCCR mode, the current block is decoded according to the correlation between the CB component and the CR component of the current block to obtain the chrominance residual coefficient of the current block.
[0741] Here, the CBF value of the current block is used to indicate whether the transform block of the current block has a non-zero transform coefficient, i.e., whether the transform block of the current block includes one or more transform coefficients not equal to zero. The CBF value of the current block may include a CBF value of a CB component of the current block and a CBF value of a CR component of the current block. Here, the CBF value of the CB component of the current block is used to indicate whether the CB transform block of the current block has a non-zero transform coefficient, i.e., whether the CB transform block of the current block includes one or more transform coefficients not equal to zero. The CBF value of the CR component of the current block is used to indicate whether the CR transform block of the current block has a non-z...
Claims
1. When the current block supports a multi-row prediction mode, predicting the current block based on the multi-row prediction mode includes predicting the current block based on a target reference row, and the target reference row is determined based on reference row indication information; Here, the reference row indication information is used to indicate index information of a target reference row used when predicting a current block based on a multi-row prediction mode, and the target reference row is one row selected from candidate reference rows, where the number of candidate reference rows corresponding to the multi-row prediction mode is three, and three rows and three columns closest to a boundary of the current block are used as the candidate reference rows; The reference line indication information occupies a maximum of two bits, and the two bits are decoded using two context models, where a first bit of the reference line indication information is decoded based on a first context model, and when a second bit of the reference line indication information needs to be decoded, the second bit of the reference line indication information is decoded based on a second context model, and the first context model and the second context model are different.
13. A method of video decoding comprising:
2. 2. The method of claim 1, wherein the row is a row above a current block or a column to the left of a current block.
3. using the three rows and three columns closest to the boundary of the current block as the candidate reference rows includes using the 0th row, the 1st row, and the 2nd row as the candidate reference rows; where the 0th row is a row adjacent to a boundary of the current block, the 1st row is a row next adjacent to the boundary of the current block, and the 2nd row is a row adjacent to the 1st row.
2. The method of claim 1 .
4. When the candidate reference row having index information 0 is the 0th row, the candidate reference row having index information 1 is the 1st row, and the candidate reference row having index information 2 is the 2nd row, the target reference row is determined based on the reference row indication information. When the index information indicated by the reference row indication information is 0, the target reference row is the 0th row; When the index information indicated by the reference row indication information is 1, the target reference row is the first row; When the index information indicated by the reference row indication information is 2, the target reference row is the second row; and Including, 2. The method of claim 1 .
5. Using the three rows and three columns closest to the boundary of the current block as the candidate reference rows includes using the 0th row, the 1st row, the 2nd row, the 0th column, the 1st column, and the 2nd column as the candidate reference rows, where the 0th row is a row adjacent to a top boundary of the current block, the 1st row is a row next adjacent to the top boundary of the current block, the 2nd row is a row adjacent to the 1st row, the 0th column is a column adjacent to a left boundary of the current block, and the 1st column is a column next adjacent to the left boundary of the current block. the second column is a column adjacent to the first column, and the determination of the target reference row based on the reference row indication information includes: when index information indicated by the reference row indication information is 0, the target reference row is the 0th row and 0th column; when index information indicated by the reference row indication information is 1, the target reference row is the 1st row and 1st column; and when index information indicated by the reference row indication information is 2, the target reference row is the 2nd row and 2nd column.
2. The method of claim 1 .
6. 6. The method of claim 5, wherein the multi-row prediction mode is used for prediction based on reference pixels of a current block, where if the target reference row is the 0th row and 0th column, the reference pixels used for predicting the current block are obtained from the 0th row or 0th column, if the target reference row is the 1st row and 1st column, the reference pixels used for predicting the current block are obtained from the 1st row or 1st column, and if the target reference row is the 2nd row and 2nd column, the reference pixels used for predicting the current block are obtained from the 2nd row or 2nd column.
7. determining whether the current block satisfies a condition for supporting a multi-row prediction technique; and determining that the current block supports a multi-row prediction mode if the current block satisfies the condition for supporting the multi-row prediction technique, where the conditions for supporting the multi-row prediction technique include: the current block is a luma intra block; the size of the current block satisfies a certain restriction condition; and the current block does not include a first row of a coding tree unit; or The multi-row prediction mode is used for prediction based on reference pixels of a current block, where the reference pixels used for predicting the current block are obtained from the target reference row of the current block; or The index information of the target reference row is represented as intra_luma_ref_idx.
2. The method of claim 1 .
8. determining a target reference row to be used when making a prediction of the current block based on a multi-row prediction mode; encoding a first bit of the reference row indication information based on a first context model; When it is necessary to encode a second bit of the reference row indication information, encoding the second bit of the reference row indication information based on a second context model; Including, Wherein, the reference row indication information occupies a maximum of 2 bits, and the 2 bits are encoded using two context models, the first context model and the second context model are different, the reference row indication information is used to indicate index information of a target reference row used when predicting the current block based on a multi-row prediction mode, and the target reference row is selected from candidate reference rows based on index information in the reference row indication information, where the number of candidate reference rows corresponding to the multi-row prediction mode is 3, and the 3 rows and 3 columns closest to the boundary of the current block are used as the candidate reference rows.
13. A method of video encoding comprising:
9. The method of claim 8 , wherein the target reference row is a row above the current block or a column to the left of the current block.
10. Row 0 is a row adjacent to the boundary of the current block, row 1 is a row next adjacent to the boundary of the current block, and row 2 is a row adjacent to row 1; When a candidate reference row whose index information is 0 is the 0th row, a candidate reference row whose index information is 1 is the 1st row, and a candidate reference row whose index information is 2 is the 2nd row, the target reference row is selected from the candidate reference rows based on the index information in the reference row indication information, When the index information indicated by the reference row indication information is 0, the target reference row is the 0th row; When the index information indicated by the reference row indication information is 1, the target reference row is the first row; When the index information indicated by the reference row indication information is 2, the target reference row is the second row; and Including, 9. The method of claim 8.
11. Using the three rows and three columns closest to the boundary of the current block as the candidate reference rows includes using the 0th row, the 1st row, the 2nd row, the 0th column, the 1st column, and the 2nd column as the candidate reference rows, where the 0th row is a row adjacent to a top boundary of the current block, the 1st row is a row next adjacent to the top boundary of the current block, the 2nd row is a row adjacent to the 1st row, the 0th column is a column adjacent to a left boundary of the current block, and the 1st column is a column next adjacent to the left boundary of the current block. the second column is a column adjacent to the first column, and the determination of the target reference row based on the reference row indication information includes: when index information indicated by the reference row indication information is 0, the target reference row is the 0th row and 0th column; when index information indicated by the reference row indication information is 1, the target reference row is the 1st row and 1st column; and when index information indicated by the reference row indication information is 2, the target reference row is the 2nd row and 2nd column.
9. The method of claim 8.
12. 12. The method of claim 11, wherein the multi-row prediction mode is used for prediction based on reference pixels of a current block, where if the target reference row is the 0th row and 0th column, the reference pixels used for predicting the current block are obtained from the 0th row or 0th column, if the target reference row is the 1st row and 1st column, the reference pixels used for predicting the current block are obtained from the 1st row or 1st column, and if the target reference row is the 2nd row and 2nd column, the reference pixels used for predicting the current block are obtained from the 2nd row or 2nd column.
13. determining whether the current block satisfies a condition for supporting a multi-row prediction technique; If the current block satisfies a condition for supporting a multi-row prediction technique, determining that the current block supports a multi-row prediction mode; Further comprising: Wherein, the conditions of the multi-row prediction technique include: the current block is a luma intra block; the size of the current block satisfies a certain restriction condition; and the current block does not include the first row of a coding tree unit.
9. The method of claim 8.
14. Decoding device, characterized in that it is adapted to carry out the method according to any one of claims 1 to 7.
15. Coding device, characterized in that it is arranged to carry out the method according to any one of claims 8 to 13.
16. a processor and a computer-readable storage medium, the computer-readable storage medium storing computer-executable instructions executable by the processor; The processor is used to execute computer-executable instructions to implement the method of any one of claims 1 to 7.
13. A decoding device comprising:
17. a processor and a computer-readable storage medium, the computer-readable storage medium storing computer-executable instructions executable by the processor; The processor is used to execute computer-executable instructions to implement the method of any one of claims 8 to 13.
13. A coding device comprising:
18. A computer readable storage medium having instructions stored thereon, the instructions, when executed by a processor, implementing a method according to any one of claims 1 to 13 above.
Citation Information
Patent Citations
Intra-picture prediction using non-adjacent reference lines of sample values
WO2017190288A1
Intra-prediction with multiple reference lines
WO2018205950A1