Method and device for processing video signal by using adaptive color space transform
A method for processing a video signal, the method comprising: acquiring a transform skip active flag indicating whether a transform skip flag can exist in a transform unit syntax, the transform skip flag indicating whether a transform skip is applied to a transform block included in a current block; acquiring a palette active flag indicating whether a palette mode is applied; when the transform skip active flag indicates existence of the transform skip flag in the transform unit syntax or the palette active flag indicates application of the palette mode, acquiring information related to a minimum quantization parameter which is allowed in a transform skip mode; acquiring the minimum quantization parameter on the basis of the information related to the minimum quantization parameter; correcting a quantization parameter on the basis of the acquired minimum quantization parameter; and reconstructing the current block on the basis of the corrected quantization parameter.
1 . A device for decoding a video signal, the device comprising a processor,
wherein the processor is configured to:
obtain information related to a minimum allowed quantization parameter for a transform skip mode based on whether a transform skip flag is present in a transform unit syntax or whether a palette mode is enabled,
wherein the transform skip flag indicates whether the transform skip mode is applied to a transform block included in a current block,
wherein when the transform skip mode is applied to the transform block, no transform is applied to the transform block,
obtain the minimum allowed quantization parameter based on the information related to the minimum allowed quantization parameter,
obtain a first modified quantization parameter by adding a quantization parameter and a quantization parameter offset,
wherein the quantization parameter offset is determined based on whether a color space conversion is applied to the current block,
obtain a second modified quantization parameter by clipping the first modified quantization parameter,
wherein when the transform skip flag indicates that the transform skip mode is not applied to the transform block and the first modified quantization parameter is less than 0, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to 0,
wherein when the transform skip flag indicates that the transform skip mode is applied to the transform block and the first modified quantization parameter is less than the minimum allowed quantization parameter, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to the minimum allowed quantization parameter,
reconstruct the current block based on the second modified quantization parameter.
2 . The device of claim 1 ,
wherein whether the transform skip flag is present in the transform unit syntax is indicated by a transform skip enabled flag,
wherein whether the palette mode is enabled is indicated by a palette enabled flag,
wherein the information related to the minimum allowed quantization parameter for the transform skip mode is obtained when the transform skip enabled flag indicates that the transform skip flag is present in the transform unit syntax, or when the palette enabled flag indicates that the palette mode is enabled.
3 . The device of claim 2 ,
wherein the processor is configured to:
obtain a color space conversion enabled flag indicating whether the color space conversion is applied to the current block,
wherein when the color space conversion enabled flag indicates that the color space conversion is not applied to the current block, the quantization parameter offset is determined to be 0,
wherein when the color space conversion enabled flag indicates that the color space conversion is applied to the current block, the quantization parameter offset is determined to be a predetermined offset for each color component of the transform block.
4 . The device of claim 2 ,
wherein the transform skip enabled flag, the palette enabled flag, and the information related to the minimum allowed quantization parameter are obtained from a sequence parameter set (SPS).
5 . The device of claim 3 ,
wherein the processor is configured to:
when a prediction mode of the current block is an intra prediction mode other than an intra sub-partition mode, obtain a first transform coefficient flag indicating whether one or more non-zero transform coefficients are present in a luma transform block of the current block based on the color space conversion enabled flag.
6 . The device of claim 5 ,
wherein when the color space conversion enabled flag indicates that the color space conversion is not applied to the current block, the first transform coefficient flag is obtained.
7 . The device of claim 5 ,
wherein the first transform coefficient flag is obtained when at least one of following conditions is satisfied:
the color space conversion enabled flag indicates that the color space conversion is not applied to the current block,
one or more non-zero transform coefficients are present in a chroma transform block of Cb color component of the current block,
one or more non-zero transform coefficients are present in a chroma transform block of Cr color component of the current block,
a width of the current block is greater than a luma maximum transform size
a height of the current block is greater than the luma maximum transform size.
8 . The device of claim 5 ,
wherein when the first transform coefficient flag is not obtained, the first transform coefficient flag is inferred to indicate that one or more non-zero transform coefficients are present in the luma transform block of the current block.
9 . A device for encoding a video signal, the device comprising a processor,
wherein the processor is configured to:
obtain information related to a minimum allowed quantization parameter for a transform skip mode based on whether a transform skip flag is present in a transform unit syntax or whether a palette mode is enabled,
wherein the transform skip flag indicates whether the transform skip mode is applied to a transform block included in a current block,
wherein when the transform skip mode is applied to the transform block, no transform is applied to the transform block,
obtain the minimum allowed quantization parameter based on the information related to the minimum allowed quantization parameter,
obtain a first modified quantization parameter by adding a quantization parameter and a quantization parameter offset,
wherein the quantization parameter offset is determined based on whether a color space conversion is applied to the current block,
obtain a second modified quantization parameter by clipping the first modified quantization parameter,
wherein when the transform skip flag indicates that the transform skip mode is not applied to the transform block and the first modified quantization parameter is less than 0, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to 0,
wherein when the transform skip flag indicates that the transform skip mode is applied to the transform block and the first modified quantization parameter is less than the minimum allowed quantization parameter, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to the minimum allowed quantization parameter,
reconstruct the current block based on the second modified quantization parameter, and
obtain a bitstream including information for reconstructing the current block.
10 . The device of claim 9 ,
wherein whether the transform skip flag is present in the transform unit syntax is indicated by a transform skip enabled flag,
wherein whether the palette mode is enabled is indicated by a palette enabled flag,
wherein the information related to the minimum allowed quantization parameter for the transform skip mode is obtained when the transform skip enabled flag indicates that the transform skip flag is present in the transform unit syntax, or when the palette enabled flag indicates that the palette mode is enabled.
11 . The device of claim 10 ,
wherein the processor is configured to:
obtain a color space conversion enabled flag indicating whether the color space conversion is applied to the current block,
wherein when the color space conversion enabled flag indicates that the color space conversion is not applied to the current block, the quantization parameter offset is determined to be 0,
wherein when the color space conversion enabled flag indicates that the color space conversion is applied to the current block, the quantization parameter offset is determined to be a predetermined offset for each color component of the transform block.
12 . The device of claim 10 ,
wherein the transform skip enabled flag, the palette enabled flag, and the information related to the minimum allowed quantization parameter are obtained from a sequence parameter set (SPS).
13 . The device of claim 11 ,
wherein the processor is configured to:
when a prediction mode of the current block is an intra prediction mode other than an intra sub-partition mode, obtain a first transform coefficient flag indicating whether one or more non-zero transform coefficients are present in a luma transform block of the current block based on the color space conversion enabled flag.
14 . The device of claim 13 ,
wherein when the color space conversion enabled flag indicates that the color space conversion is not applied to the current block, the first transform coefficient flag is obtained.
15 . The device of claim 13 ,
wherein the first transform coefficient flag is obtained when at least one of following conditions is satisfied;
the color space conversion enabled flag indicates that the color space conversion is not applied to the current block,
one or more non-zero transform coefficients are present in a chroma transform block of Cb color component of the current block,
one or more non-zero transform coefficients are present in a chroma transform block of Cr color component of the current block,
a width of the current block is greater than a luma maximum transform size,
a height of the current block is greater than the luma maximum transform size.
16 . The device of claim 13 ,
wherein when the first transform coefficient flag is not obtained, the first transform coefficient flag is inferred to indicate that one or more non-zero transform coefficients are present in the luma transform block of the current block.
17 . A non-transitory computer-readable medium storing a bitstream, the bitstream being decoded by a decoding method, the decoding method comprising:
obtaining information related to a minimum allowed quantization parameter for a transform skip mode based on whether a transform skip flag is present in a transform unit syntax or whether a palette mode is enabled,
wherein the transform skip flag indicates whether the transform skip mode is applied to a transform block included in a current block;
wherein when the transform skip mode is applied to the transform block, no transform is applied to the transform block;
obtaining the minimum allowed quantization parameter based on the information related to the minimum allowed quantization parameter;
obtaining a first modified quantization parameter by adding a quantization parameter and a quantization parameter offset,
wherein the quantization parameter offset is determined based on whether a color space conversion is applied to the current block;
obtaining a second modified quantization parameter by clipping the first modified quantization parameter,
wherein when the transform skip flag indicates that the transform skip mode is not applied to the transform block and the first modified quantization parameter is less than 0, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to 0,
wherein when the transform skip flag indicates that the transform skip mode is applied to the transform block and the first modified quantization parameter is less than the minimum allowed quantization parameter, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to the minimum allowed quantization parameter; and
reconstructing the current block based on the second modified quantization parameter.
18 . The non-transitory computer-readable medium of claim 17 ,
wherein whether the transform skip flag is present in the transform unit syntax is indicated by a transform skip enabled flag,
wherein whether the palette mode is enabled is indicated by a palette enabled flag,
wherein the information related to the minimum allowed quantization parameter for the transform skip mode is obtained when the transform skip enabled flag indicates that the transform skip flag is present in the transform unit syntax, or when the palette enabled flag indicates that the palette mode is enabled.
19 . The non-transitory computer-readable medium of claim 18 , the decoding method further comprising:
obtaining a color space conversion enabled flag indicating whether the color space conversion is applied to the current block,
wherein when the color space conversion enabled flag indicates that the color space conversion is not applied to the current block, the quantization parameter offset is determined to be 0,
wherein when the color space conversion enabled flag indicates that the color space conversion is applied to the current block, the quantization parameter offset is determined to be a predetermined offset for each color component of the transform block.
20 . A method for decoding a video signal, comprising:
obtaining information related to a minimum allowed quantization parameter for a transform skip mode based on whether a transform skip flag is present in a transform unit syntax or whether a palette mode is enabled,
wherein the transform skip flag indicates whether the transform skip mode is applied to a transform block included in a current block;
wherein when the transform skip mode is applied to the transform block, no transform is applied to the transform block;
obtaining the minimum allowed quantization parameter based on the information related to the minimum allowed quantization parameter;
obtaining a first modified quantization parameter by adding a quantization parameter and a quantization parameter offset,
wherein the quantization parameter offset is determined based on whether a color space conversion is applied to the current block;
obtaining a second modified quantization parameter by clipping the first modified quantization parameter,
wherein when the transform skip flag indicates that the transform skip mode is not applied to the transform block and the first modified quantization parameter is less than 0, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to 0,
wherein when the transform skip flag indicates that the transform skip mode is applied to the transform block and the first modified quantization parameter is less than the minimum allowed quantization parameter, the second modified quantization parameter is obtained by clipping the first modified quantization parameter to the minimum allowed quantization parameter;
reconstructing the current block based on the second modified quantization parameter.