In-loop filtering-based video or image coding
According to the disclosure of the present disclosure, the index of an alternative filter is derived from ALF information, and an ALF procedure for a chroma component of a current block can be performed on the basis of the alternative filter.
1. An image decoding method performed by a decoding apparatus, the method comprising:
obtaining image information including adaptive loop filter (ALF) information and prediction-related information from a bitstream;
deriving prediction samples for a current block based on the prediction-related information;
generating reconstructed samples based on the prediction samples; and
performing an ALF process on the reconstructed samples based on the ALF information,
wherein the ALF information includes alternative filter information for a chroma component of the current block,
wherein an index of an alternative filter applied to the chroma component of the current block is derived based on the alternative filter information,
wherein the alternative filter information includes information on a number of alternative filters for the chroma component of the current block and index information of an alternative filter for the chroma component of the current block,
wherein based on the information on the number of the alternative filters for the chroma component of the current block, absolute value information of coefficients included in the alternative filters for the chroma component of the current block is included in the alternative filter information,
wherein based on the absolute value information of the coefficients included in the alternative filers for the chroma component of the current block, sign information of the coefficients included in the alternative filters for the chroma component of the current block is included in the alternative filter information,
wherein the ALF process is performed on the chroma component of the current block based on the index of the alternative filter,
wherein the index information of the alternative filter is based on truncated rice binarization,
wherein a maximum value (cMax) of the index information of the alternative filter is equal to a value that is one less than the number of alternative filters for the chroma component of the current block, and the truncated rice binarization is performed based on a rice parameter (cRiceParam) value of 0,
wherein bins of a bin string for the index information of the alternative filter are entropy-decoded based on a context model,
wherein the context model for the bins of the bin string related to the index information of the alternative filter is determined based on a context index increment for the bins,
wherein the context index increment is determined based on the chromia component of the current block, and
wherein a context index increment based on the chroma component of the current block being cb is different from a context index increment based on the chroma component of the current block being cr.
2. The method of claim 1 , wherein the image information includes information on ALF clipping, and the information on ALF clipping includes a flag indicating whether clipping is applied to the chroma component of the current block and clipping index information indicating a clipping value.
3. A video encoding method performed by an encoding apparatus, the method comprising:
determining a prediction mode of a current block;
deriving prediction samples based on the prediction mode;
generating reconstructed samples based on the prediction samples;
performing an adaptive loop filter (ALF) process on the reconstructed samples; and
encoding image information including ALF information and prediction-related information,
wherein the ALF information includes alternative filter information for a chroma component of the current block,
wherein the alternative filter information indicates an index of an alternative filter applied to the chroma component of the current block,
wherein the alternative filter information includes information on a number of alternative filters for the chroma component of the current block and index information of an alternative filter for the chroma component of the current block,
wherein based on the information on the number of the alternative filters for the chroma component of the current block, absolute value information of coefficients included in the alternative filters for the chroma component of the current block is included in the alternative filter information,
wherein based on the absolute value information of the coefficients included in the alternative filters for the chromia component of the current block, sign information of the coefficients included in the alternative filters for the chroma component of the current block is included in the alternative filter information,
wherein the index information of the alternative filter is based on truncated rice binarization,
wherein a maximum value (cMax) of the index information of the alternative filter is equal to a value that is one less than the number of alternative filters for the chroma component of the current block, and the truncated rice binarization is performed based on a rice parameter (cRiceParam) value of 0,
wherein bins of a bin string for the index information of the alternative filter are entropy-encoded based on a context model,
wherein the context model for the bins of the bin string related to the index information of the alternative filter is determined based on a context index increment for the bins,
wherein the context index increment is determined based on the chroma component of the current block, and
wherein a context index increment based on the chroma component of the current block being cb is different from a context index increment based on the chroma component of the current block being cr.
4. The method of claim 3 , wherein the image information includes information on ALF clipping, and the information on ALF clipping includes a flag indicating whether clipping is applied to the chroma component to which an alternative filter of the current block is applied and clipping index information indicating a clipping value.
5. A non-transitory computer-readable storage medium storing a bitstream generated by a method, the method comprising:
determining a prediction mode of a current block;
deriving prediction samples based on the prediction mode;
generating reconstructed samples based on the prediction samples;
performing an adaptive loop filter (ALF) process on the reconstructed samples; and
encoding image information including ALF information and prediction-related information to output the bitstream,
wherein the ALF information includes alternative filter information for a chroma component of the current block,
wherein the alternative filter information indicates an index of an alternative filter applied to the chroma component of the current block,
wherein the alternative filter information includes information on a number of alternative filters for the chroma component of the current block and index information of an alternative filter for the chroma component of the current block,
wherein based on the information on the number of the alternative filters for the chroma component of the current block absolute value information of coefficients included in the alternative filters for the chroma component of the current block is included in the alternative filter information,
wherein based on the absolute value information of the coefficients included in the alternative filters for the chroma component of the current block, sign information of the coefficients included in the alternative filters for the chroma component of the current block is included in the alternative filter information,
wherein the index information of the alternative filter is based on truncated rice binarization,
wherein a maximum value (cMax) of the index information of the alternative filter is equal to a value that is one less than the number of alternative filters for the chroma component of the current block, and the truncated rice binarization is performed based on a rice parameter (cRiceParam) value of 0, and
wherein bins of a bin string for the index information of the alternative tilter are entropy-encoded based on a context model,
wherein the context model for the bins of the bin string related to the index information of the alternative filter is determined based on a context index increment for the bins,
wherein the context index increment is determined based on the chroma component of the current block, and
wherein a context index increment based on the chroma component of the current block being cb is different from a context index increment based on the chroma component of the current block being cr.