Method and apparatus for entropy-encoding and entropy-decoding video signal
The present invention relates to a method for performing entropy decoding on a video signal including a current block. The method comprises the steps of: deriving affine coding information and/or affine prediction mode information of a left block and/or an upper block which are adjacent to the current block; determining a context index of a syntax element associated with an affine prediction of the current block on the basis of at least one of the affine coding information and/or the affine prediction mode information of the left block and/or the upper block; and entropy decoding the syntax element associated with the affine prediction of the current block on the basis of the context index.
1. An apparatus of decoding a video signal including a current block, the apparatus comprising:
at least one processor; and
at least one memory connected to the at least one processor and storing instructions that, when executed by the at least one processor, perform operations comprising:
deriving affine coding information of a left block and/or a top block of the current block, wherein the affine coding information includes an affine flag indicating whether an affine motion prediction has been performed,
determining a context index of the affine flag of the current block based on the affine coding information of at least one of the left block and/or the top block,
entropy decoding the affine flag of the current block based on the context index,
parsing an affine parameter flag representing whether 4 parameters or 6 parameters are used for an affine motion model based on the affine flag of the current block,
obtaining a motion vector predictor based on the 4 parameters or the 6 parameters being used for the affine motion model, and
performing a prediction for the current block based on the motion vector predictor,
wherein the context index of the affine flag of the current block is determined based on a sum of the affine coding information of the left block and the affine coding information of the top block.
2. The apparatus of claim 1 ,
wherein the affine parameter flag is obtained based on a merge flag representing that motion parameters are not inferred from a neighboring block.
3. The apparatus of claim 1 ,
wherein the affine flag is obtained based on a width and a height of the current block are equal or greater than a predetermined value.
4. The apparatus of claim 1 ,
wherein a context index of the affine parameter flag is determined based on a sum of a first value determined by the affine coding information and affine prediction mode information of the left block and a second value determined by the affine coding information and affine prediction mode information of the top block.
5. An apparatus of encoding a video signal including a current block, the apparatus comprising:
at least one processor; and
at least one memory connected to the at least one processor and storing instructions that, when executed by the at least one processor, perform operations comprising:
generating a motion vector predictor based on 4 parameters or 6 parameters being used for an affine motion model,
performing a prediction for the current block based on the motion vector predictor,
generating an affine flag representing whether an affine motion prediction has been performed,
generating an affine parameter flag representing whether the 4 parameters or the 6 parameters are used for the affine motion model,
deriving affine coding information of a left block and/or a top block of the current block, wherein the affine coding information includes the affine flag,
determining a context index of the affine flag of the current block based on the affine coding information of at least one of the left block and/or the top block, and
entropy encoding the affine flag of the current block based on the context index,
wherein the context index of the affine flag of the current block is determined based on a sum of the affine coding information of the left block and the affine coding information of the top block.
6. The apparatus of claim 5 ,
wherein the affine parameter flag is generated based on a merge flag representing that motion parameters are not inferred from a neighboring block.
7. The apparatus of claim 5 ,
wherein the affine flag is generated based on a width and a height of the current block are equal or greater than a predetermined value.
8. The apparatus of claim 5 ,
wherein a context index of the affine parameter flag is determined based on a sum of a first value determined by the affine coding information and affine prediction mode information of the left block and a second value determined by the affine coding information and affine prediction mode information of the top block.
9. An apparatus of transmitting data for an image, comprising:
a transmitter;
at least one processor; and
at least one memory connected to the at least one processor and storing instructions that, when executed by the at least one processor, perform operations comprising:
obtaining a bitstream for the image; and
transmitting, via the transmitter, the data comprising the bitstream,
wherein the operations further comprise:
generating a motion vector predictor based on 4 parameters or 6 parameters being used for an affine motion model,
performing a prediction for the current block based on the motion vector predictor,
generating an affine flag representing whether an affine motion prediction has been performed,
generating an affine parameter flag representing whether the 4 parameters or the 6 parameters are used for the affine motion model,
deriving affine coding information of a left block and/or a top block of the current block, wherein the affine coding information includes the affine flag,
determining a context index of the affine flag of the current block based on the affine coding information of at least one of the left block and/or the top block, and
entropy encoding the affine flag of the current block based on the context index,
wherein the context index of the affine flag of the current block is determined based on a sum of the affine coding information of the left block and the affine coding information of the top block.