Fast algorithms for adaptive motion vector resolution in affine mode
A method for video processing is provided. The method includes determining, based on a coding mode of a parent coding unit of a current coding unit that uses an affine coding mode or a rate-distortion (RD) cost of the affine coding mode, a usage of an adaptive motion vector resolution (AMVR) for a conversion between a coded representation of a current block of a video and the current block; and performing the conversion according to a result of the determining.
1. A method of video processing, comprising:
determining, for a conversion between a bitstream of a current block of a video and the current block, a set of MV (Motion Vector) precisions using a 4-parameter affine model or 6-parameter affine model;
determining a usage of an adaptive motion vector resolution (AMVR) for the conversion between the bitstream of the current block of the video and the current block that uses an advanced motion vector prediction (AMVP) coding mode, the determining based on a rate-distortion (RD) cost of the AMVP coding mode,
wherein, in case that the RD cost of the AMVP coding mode is greater than a multiplication of a positive threshold and an RD cost of an affine coding mode, the determining disables the usage of the AMVR, and
wherein, in case that a minimum RD cost is greater than a multiplication of the positive threshold and an RD cost of a merge mode, the determining disables the usage of the AMVR, and wherein the minimum RD cost is a minimum of the RD cost of the affine coding mode and the RD cost of the AMVP coding mode; and
performing the conversion based on the set of MV precisions and a result of the determining.
2. The method of claim 1 , wherein the 4-parameter affine model or the 6-parameter affine model obtained in a single MV precision is used as a candidate start search point for other MV precisions.
3. The method of claim 2 , wherein the single MV precision comprises 1/16 MV accuracy or ¼ MV accuracy.
4. The method of claim 2 , wherein the single MV precision comprises ¼ MV accuracy.
5. The method of claim 1 , the method further comprising:
determining, based on a coding mode of a parent block of the current block that uses the affine coding mode, whether an adaptive motion vector resolution (AMVR) tool is used for the conversion, wherein the AMVR tool is used to refine motion vector resolution during decoding; and
performing the conversion according to a result of the determining and the set of MV precisions.
6. The method of claim 5 , wherein, in case that the parent block of the current block is not coded with the affine coding mode, the determining causes not to check the AMVR for the current block.
7. The method of claim 1 , the method further comprising:
determining, based on a usage of MV precisions for previous blocks that have been previously coded using the affine coding mode, a termination of a rate-distortion (RD) calculations of MV precisions for the current block that uses the affine coding mode for the conversion between the bitstream of the current block of the video and the current block; and
performing the conversion according to a result of the determining and the set of MV precisions.
8. The method of claim 7 , wherein the current block and the previous blocks are included in a current image segment and a previous image segment, respectively, and the current image segment and the previous image segments are pictures, slices, tiles, or CTU (Coding Tree Unit) rows.
9. The method of claim 1 , the method further comprising:
determining, based on a coding mode of a parent coding unit of a current coding unit that uses the affine coding mode or a rate-distortion (RD) cost of the affine coding mode, a usage of an adaptive motion vector resolution (AMVR) for the conversion between the bitstream of the current block of the video and the current block; and
performing the conversion according to a result of the determining and the set of MV precisions.
10. The method of claim 9 , wherein, in case that the coding mode of the parent coding unit is not AF_Inter mode or AF_MERGE mode, then the determining disables the usage of the AMVR for the current coding unit.
11. The method of claim 9 , wherein, in case that the RD of the affine coding mode is greater than a multiplication of a positive threshold and an RD cost of an advanced motion vector prediction (AMVP) mode, then the determining disables the usage of the AMVR for the current coding unit.
12. The method of claim 11 , wherein the determination is applied for ¼-pel MV precision.
13. The method of claim 9 , wherein, in case that a minimum RD cost is greater than a multiplication of a positive threshold and an RD cost of a merge mode, then the determining disables the usage of the AMVR for the current coding unit, wherein the minimum RD cost is a minimum of the RD cost of the affine coding mode and an RD cost of an advanced motion vector prediction (AMVP) mode.
14. The method of claim 1 , wherein the performing of the conversion includes generating the bitstream from the current block.
15. The method of claim 1 , wherein the performing of the conversion includes generating the current block from the bitstream.
16. An apparatus in a video system comprising a processor and a non-transitory memory with instructions thereon, wherein the instructions upon execution by the processor, cause the processor to implement the method recited in claim 1 .
17. A computer program product stored on a non-transitory computer readable media, the computer program product including program code for carrying out the method recited in claim 1 .
18. The method of claim 1 , wherein the single MV precision comprises 1/16 MV accuracy.