# US 2024/0187634 A1 · Method and apparatus for affine based inter prediction of chroma subblocks

> Agents: this data is available as JSON from the patentgrep API and MCP server — see https://patentgrep.com/llms.txt

- Number: US 2024/0187634 A1
- Document ID: US20240187634A1
- Status: Published application
- Kind: A1
- Application number: 18/427,975
- Filed: 2024-01-31
- Published: 2024-06-06
- Earliest claimed: 2019-02-22
- Assignees: Huawei Technologies Co., Ltd.
- Applicants: Huawei Technologies Co., Ltd.
- Inventors: Vasily Alexeevich RUFITSKIY; Timofey Mikhailovich Solovyev; Alexey Konstantinovich FILIPPOV; Jianle Chen
- Web page: https://patentgrep.com/patent/US20240187634A1

## CPC

- H04N 19/513: Processing of motion vectors
- H04N 19/52: by predictive encoding
- H04N 19/159: Prediction type, e.g. intra-frame, inter-frame or bidirectional frame prediction
- H04N 19/176: the region being a block, e.g. a macroblock
- H04N 19/186: the unit being a colour or a chrominance component
- H04N 19/30: using hierarchical techniques, e.g. scalability (H04N19/63 takes precedence)
- H04N 19/54: using feature points or meshes
- H04N: PICTORIAL COMMUNICATION, e.g. TELEVISION

## Abstract

The present invention relates to method and apparatus for motion vector derivation for affine based inter prediction of chroma subblocks based on chroma format. The method includes: determining chroma scaling factors in horizontal and vertical directions based on chroma format information, wherein the chroma format information indicates a chroma format of a current picture which the current image block belongs to; determining a set (S) of luma subblocks of the luma block based on values of the chroma scaling factors; determining a motion vector for a chroma subblock of the chroma block based on motion vectors of one or more luma subblocks in the set (S) of luma subblocks.

## Claims

### Claim 1

An image encoding method, wherein the method comprises:
performing an image encoding process for an image block coded in an inter prediction mode, to output an encoded bitstream, wherein the image block comprises a luma block and a co-located chroma block, and wherein the performing the image encoding process comprises a chroma motion vector derivation process, comprising:
obtaining an averaged luma motion vector, mvAvgLX by:
determining (1501, 1601) chroma scaling factors in horizontal and vertical directions based on chroma format information, wherein the chroma format information indicates a chroma format of a current picture which the image block belongs to, wherein the chroma format comprises one of a YUV 4:2:2 format, a YUV 4:2:0 format or a YUV 4:4:4 format;
determining (1503) a set (S) of luma subblocks of the luma block based on values of the chroma scaling factors; and
generating the averaged luma motion vector, mvAvgLX by averaging (1605) motion vectors of the luma subblocks in the set S, in the case that more than one luma subblocks in the set (S);
deriving (1607) a chroma motion vector for a chroma subblock, mvCLX[xSbIdx][ySbIdx] of the chroma block based on the averaged luma motion vector, mvAvgLX; wherein the derivation process for the chroma motion vector is invoked with the mvAvgLX as inputs, and the chroma motion vector, mvCLX[xSbIdx][ySbIdx] as output, the following applies:
mvCLX[0]=mvLX[0]*2/SubWidthC
mvCLX[1]=mvLX[1]*2/SubHeightC, wherein a reference picture corresponding to the refIdxLX for the image block is not a current picture; or
mvCLX[0]=((mvLX[0]>>(3+SubWidthC))*32
mvCLX[1]=((mvLX[1]>>(3+SubHeightC))*32, wherein the reference picture corresponding to the refIdxLX for the image block is the current picture.

### Claim 2 (depends on 1)

The method of claim 1, wherein each of the one or more luma subblocks in the set(S) is represented by a subblock index in a horizontal direction and a subblock index in a vertical direction.

### Claim 3 (depends on 1)

The method of claim 1, wherein the number of the chroma subblocks in the chroma block along the horizontal direction and the vertical direction are the same with the number of the luma subblocks in the luma block along the horizontal and vertical directions, respectively.

### Claim 4 (depends on 1)

The method of claim 1,
wherein when the chroma format is 4:4:4, the set (S) comprise one luma subblock co-located with the chroma subblock;
wherein when the chroma format is 4:2:2, the set (S) comprise two luma subblocks horizontally adjacent to each other;
wherein when the chroma format is 4:2:0, the set (S) comprise two luma subblocks which are diagonal.

### Claim 5 (depends on 1)

The method of claim 1, wherein averaging motion vectors of the luma subblocks in the set S comprise one or more of:
averaging horizontal component of the motion vectors of the luma subblocks in the set S; or, averaging vertical component of the motion vectors of the luma subblocks in the set S.

### Claim 6 (depends on 1)

The method of claim 1, wherein the generating an averaged luma motion vector by averaging motion vectors of the luma subblocks in the set S comprises:
ΣimvLX[Six][Siy]mvAvgLX=Σi>mvLX[Six][Siy] when mvAvgLX[0] is greater or equal to 0,mvAvgLX[0](mvAvgLX[0]+(N>>1)−1)>>log 2(N),otherwise,
ΣimvLX[Six][Siy]mvAvgLX[0]=−((−mvAvgLX[0]+(N>>1)−1)>>log 2(N));
ΣimvLX[Six][Siy] when mvAvgLX[1] is greater or equal to 0,mvAvgLX[1](mvAvgLX[1]+(N>>1)−1)>>log 2(N),otherwise,
ΣimvLX[Six][Siy]mvAvgLX[1]=−((−mvAvgLX[1]+(N>>1)−1)>>log 2(N)),
ΣimvLX[Six][Siy] wherein:
mvAvgLX is a resulting motion vector of the averaging;
mvAvgLX[0] is a horizontal component of the resulting motion vector mvAvgLX, and
mvAvgLX[1] is a vertical component of the resulting motion vector mvAvgLX;
Six and Siy are horizontal and vertical indices of subblock Si in the set of luma subblocks (S) in motion vector array,
mvLX[Six][Siy] is a motion vector of a luma subblock with indices Six and Siy, N is a number of elements in the set (S) of luma subblocks, log 2(N) represents the logarithm of N to the base 2 and is the power to which the number 2 is raised to obtain the value N, and “>>” represents a right arithmetic shift.

### Claim 7 (depends on 1)

The method of claim 1, wherein the averaging of motion vectors of the luma subblocks in the set S comprises:
mvAvgLX=mvLX[(xSbIdx>>(SubWidthC−1)<<(SubWidthC−1))]
[(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))]+mvLX[(xSbIdx>>(SubWidthC−1)<<(SubWidthC−1))+(SubWidthC−1)]
[(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))+(SubHeightC−1)]
if mvAvgLX[0]>=0 then
mvAvgLX[0]=(mvAvgLX[0]+1−(mvAvgLX[0]>=0))>>1
if mvAvgLX[1]>=0 then
mvAvgLX[1]=(mvAvgLX[1]+1−(mvAvgLX[1]>=0))>>1
wherein mvAvgLX[0] is a horizontal component of the averaged motion vector mvAvgLX, mvAvgLX[1] is a vertical component of the averaged motion vector mvAvgLX; wherein SubWidthC and SubHeightC represent the chroma scaling factors in horizontal and vertical directions respectively; xSbIdx and ySbIdx represent a subblock index in horizontal direction and a subblock index in the vertical direction, respectively, for a luma subblock in the set(S), “<<” is a left arithmetic shift and “>>” is a right arithmetic shift.

### Claim 8 (depends on 1)

The method of claim 1, wherein the determining chroma scaling factors in horizontal and vertical directions respectively based on chroma format information, comprises:
determining the chroma scaling factors in the horizontal and vertical directions based on a mapping between the chroma format information and a pair of chroma scaling factors in the horizontal and vertical directions respectively.

### Claim 9 (depends on 1)

The method of claim 1, wherein the performing the image encoding process further comprises:
generating a prediction of the chroma subblock based on the determined chroma motion vector;
obtaining a residual of the chroma subblock according to a prediction of the chroma subblock, wherein a residual of the image block comprises the residual of the chroma subblock of the chroma block; and
performing transformation, quantization, and entropy coding on the residual of the image block, to output the encoded bitstream.

### Claim 10 (depends on 1)

The method of claim 1, wherein the image block is coded in an affine based inter prediction mode.

### Claim 11 (depends on 1)

The method of claim 1, wherein when both SubWidthC and SubHeightC are equal to 1, the set of luma subblocks (S) is a luma subblock indexed by S0=(xSbIdx, ySbIdx);
when at least one of SubWidthC and SubHeightC is not equal to 1, the set of luma subblocks (S) is: a first luma subblock indexed by S0=
((xSbIdx>>(SubWidthC−1)<<(SubWidthC−1)),
(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))), and a second luma subblock indexed by
S1=((xSbIdx>>(SubWidthC−1)<<(SubWidthC−1))+(SubWidthC−1),
(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))+(SubHeightC−1))
wherein SubWidthC and SubHeightC represent the chroma scaling factors in horizontal and vertical directions, respectively;
xSbIdx and ySbIdx represent a subblock index in the horizontal direction and a subblock index in the vertical direction, respectively, for a luma subblock in the set(S);
“<<” represents a left arithmetic shift;
“>>” represents a right arithmetic shift;
xSbIdx is an integer number ranging from 0 to numSbX−1 and ySbIdx is an integer ranging from 0 to numSbY−1;
numSbX indicates the number of luma subblocks in the luma block along the horizontal direction; and
numSbY indicates the number of luma subblocks in the luma block along the vertical direction.

### Claim 12

An encoding apparatus, comprising:
a video data memory; and
a video encoder, wherein the video encoder is configured to:
perform an image encoding process for an image block coded in an inter prediction mode, to output an encoded bitstream, wherein the image block comprises a luma block and a co-located chroma block, and wherein the performing the image encoding process comprises a chroma motion vector derivation process, comprising:
obtain an averaged luma motion vector, mvAvgLX by:
determining (1501, 1601) chroma scaling factors in horizontal and vertical directions based on chroma format information, wherein the chroma format information indicates a chroma format of a current picture which the image block belongs to, wherein the chroma format comprises one of a YUV 4:2:2 format, a YUV 4:2:0 format or a YUV 4:4:4 format;
determining (1503) a set (S) of luma subblocks of the luma block based on values of the chroma scaling factors; and
generating the averaged luma motion vector, mvAvgLX by averaging (1605) motion vectors of the luma subblocks in the set S, in the case that more than one luma subblocks in the set (S); and
derive (1607) a chroma motion vector for a chroma subblock, mvCLX[xSbIdx][ySbIdx] of the chroma block based on the averaged luma motion vector, mvAvgLX; wherein the derivation process for the chroma motion vector is invoked with the mvAvgLX as inputs, and the chroma motion vector, mvCLX[xSbIdx][ySbIdx] as output, the following applies:
mvCLX[0]=mvLX[0]*2/SubWidthC
mvCLX[1]=mvLX[1]*2/SubHeightC, wherein a reference picture corresponding to the refIdxLX for the image block is not a current picture; or
mvCLX[0]=((mvLX[0]>>(3+SubWidthC))*32
mvCLX[1]=((mvLX[1]>>(3+SubHeightC))*32, wherein the reference picture corresponding to the refIdxLX for the image block is the current picture.

### Claim 13 (depends on 12)

The apparatus of claim 12, wherein each of the one or more luma subblocks in the set(S) is represented by a subblock index in a horizontal direction and a subblock index in a vertical direction.

### Claim 14 (depends on 12)

The apparatus of claim 12, wherein the number of the chroma subblocks in the chroma block along the horizontal direction and the vertical direction are the same with the number of the luma subblocks in the luma block along the horizontal and vertical directions, respectively.

### Claim 15 (depends on 12)

The apparatus of claim 12,
wherein when the chroma format is 4:4:4, the set (S) comprises one luma subblock co-located with the chroma subblock;
wherein when the chroma format is 4:2:2, the set (S) comprise two luma subblocks horizontally adjacent to each other;
wherein when the chroma format is 4:2:0, the set (S) comprise two luma subblocks which are diagonal.

### Claim 16 (depends on 12)

The apparatus of claim 12, wherein the video coder is further configured to:
averaging horizontal component of the motion vectors of the luma subblocks in the set S; or,
averaging vertical component of the motion vectors of the luma subblocks in the set S.

### Claim 17 (depends on 12)

The apparatus of claim 12, wherein the video coder is further configured to generate an averaged luma motion vector by averaging motion vectors of the luma subblocks in the set S as follows:
mvAvgLX=ΣimvLX[Six][Siy]
when mvAvgLX[0] is greater or equal to 0,mvAvgLX[0]=(mvAvgLX[0]+(N>>1)−1)>>log 2(N),otherwise,
mvAvgLX[0]=−((−mvAvgLX[0]+(N>>1)−1)>>log 2(N));
when mvAvgLX[1] is greater or equal to 0,mvAvgLX[1]=(mvAvgLX[1]+(N>>1)−1)>>log 2(N),otherwise,
mvAvgLX[1]=−((−mvAvgLX[1]+(N>>1)−1)>>log 2(N)),
wherein:
mvAvgLX is a resulting motion vector of the averaging;
mvAvgLX[0] is a horizontal component of the resulting motion vector mvAvgLX, and
mvAvgLX[1] is a vertical component of the resulting motion vector mvAvgLX;
Six and Siy are horizontal and vertical indices of subblock Si in the set of luma subblocks (S) in motion vector array,
mvLX[Six][Siy] is a motion vector of a luma subblock with indices Six and Siy, N is a number of elements in the set (S) of luma subblocks, log 2(N) represents the logarithm of N to the base 2 and is the power to which the number 2 is raised to obtain the value N, and “>>” represents a right arithmetic shift.

### Claim 18 (depends on 12)

The apparatus of claim 12, wherein the video coder is further configured to generate an averaged luma motion vector by averaging motion vectors of the luma subblocks in the set S as follows:
mvAvgLX=mvLX[(xSbIdx>>(SubWidthC−1)<<(SubWidthC−1))]
[(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))]+mvLX[(xSbIdx>>(SubWidthC−1)<<(SubWidthC−1))+(SubWidthC−1)]
[(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))+(SubHeightC−1)]
if mvAvgLX[0]>=0 then
mvAvgLX[0]=(mvAvgLX[0]+1−(mvAvgLX[0]>=0))>>1
if mvAvgLX[1]>=0 then
mvAvgLX[1]=(mvAvgLX[1]+1−(mvAvgLX[1]>=0))>>1
wherein mvAvgLX[0] is a horizontal component of the averaged motion vector mvAvgLX, mvAvgLX[1] is a vertical component of the averaged motion vector mvAvgLX; wherein SubWidthC and SubHeightC represent the chroma scaling factors in horizontal and vertical directions respectively; xSbIdx and ySbIdx represent a subblock index in horizontal direction and a subblock index in the vertical direction, respectively, for a luma subblock in the set(S), “<<” is a left arithmetic shift and “>>” is a right arithmetic shift.

### Claim 19 (depends on 12)

The apparatus of claim 12, wherein the video coder is further configured to determine the chroma scaling factors in the horizontal and vertical directions based on a mapping between the chroma format information and a pair of chroma scaling factors in the horizontal and vertical directions respectively.

### Claim 20 (depends on 12)

The apparatus of claim 12, wherein the video coder is further configured to:
generate a prediction of the chroma subblock based on the determined chroma motion vector;
obtain a residual of the chroma subblock according to a prediction of the chroma subblock, wherein a residual of the image block comprises the residual of the chroma subblock of the chroma block; and
perform transformation, quantization, and entropy coding on the residual of the image block, to output the encoded bitstream.

### Claim 21 (depends on 12)

The apparatus of claim 12, wherein the image block is coded in an affine based inter prediction mode.

### Claim 22 (depends on 12)

The apparatus of claim 12, wherein when both SubWidthC and SubHeightC are equal to 1, the set of luma subblocks (S) is a luma subblock indexed by S0=(xSbIdx, ySbIdx);
when at least one of SubWidthC and SubHeightC is not equal to 1, the set of luma subblocks (S) is: a first luma subblock indexed by S0=
((xSbIdx>>(SubWidthC−1)<<(SubWidthC−1)),
(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))), and a second luma subblock indexed by
S1=((xSbIdx>>(SubWidthC−1)<<(SubWidthC−1))+(SubWidthC−1),
(ySbIdx>>(SubHeightC−1)<<(SubHeightC−1))+(SubHeightC−1))
wherein SubWidthC and SubHeightC represent the chroma scaling factors in horizontal and vertical directions, respectively;
xSbIdx and ySbIdx represent a subblock index in the horizontal direction and a subblock index in the vertical direction, respectively, for a luma subblock in the set(S);
“<<” represents a left arithmetic shift;
“>>” represents a right arithmetic shift;
xSbIdx is an integer number ranging from 0 to numSbX−1 and ySbIdx is an integer ranging from 0 to numSbY−1;
numSbX indicates the number of luma subblocks in the luma block along the horizontal direction; and
numSbY indicates the number of luma subblocks in the luma block along the vertical direction.

### Claim 23

A non-transitory computer-readable medium storing program instructions which, when executed by one or more processors, cause the one or more processors to perform operations of chroma motion vector derivation used in an affine based inter prediction of a current image block comprises a luma block and a co-located chroma block, the operations comprising:
performing an image encoding process for an image block coded in an inter prediction mode, to output an encoded bitstream, wherein the image block comprises a luma block and a co-located chroma block, and wherein the performing the image encoding process comprises a chroma motion vector derivation process, comprising:
obtaining an averaged luma motion vector, mvAvgLX by:
determining (1501, 1601) chroma scaling factors in horizontal and vertical directions based on chroma format information, wherein the chroma format information indicates a chroma format of a current picture which the image block belongs to, wherein the chroma format comprises one of a YUV 4:2:2 format, a YUV 4:2:0 format or a YUV 4:4:4 format;
determining (1503) a set (S) of luma subblocks of the luma block based on values of the chroma scaling factors; and
generating the averaged luma motion vector, mvAvgLX by averaging (1605) motion vectors of the luma subblocks in the set S, in the case that more than one luma subblocks in the set (S);
deriving (1607) a chroma motion vector for a chroma subblock, mvCLX[xSbIdx][ySbIdx] of the chroma block based on the averaged luma motion vector, mvAvgLX; wherein the derivation process for the chroma motion vector is invoked with the mvAvgLX as inputs, and the chroma motion vector, mvCLX[xSbIdx][ySbIdx] as output, the following applies:
mvCLX[0]=mvLX[0]*2/SubWidthC
mvCLX[1]=mvLX[1]*2/SubHeightC, wherein a reference picture corresponding to the refIdxLX for the image block is not a current picture; or
mvCLX[0]=((mvLX[0]>>(3+SubWidthC))*32
mvCLX[1]=((mvLX[1]>>(3+SubHeightC))*32, wherein the reference picture corresponding to the refIdxLX for the image block is the current picture.

### Claim 24

A non-transitory computer-readable medium for storing data associated with a video signal, comprising:
an encoded bitstream for the video signal being generated according to the operations comprising:
performing an image encoding process for an image block coded in an inter prediction mode, to output the encoded bitstream, wherein the image block comprises a luma block and a co-located chroma block, and wherein the performing the image encoding process comprises a chroma motion vector derivation process, comprising:
obtaining an averaged luma motion vector, mvAvgLX by:
determining (1501, 1601) chroma scaling factors in horizontal and vertical directions based on chroma format information, wherein the chroma format information indicates a chroma format of a current picture which the image block belongs to, wherein the chroma format comprises one of a YUV 4:2:2 format, a YUV 4:2:0 format or a YUV 4:4:4 format;
determining (1503) a set (S) of luma subblocks of the luma block based on values of the chroma scaling factors; and
generating the averaged luma motion vector, mvAvgLX by averaging (1605) motion vectors of the luma subblocks in the set S, in the case that more than one luma subblocks in the set (S);
deriving (1607) a chroma motion vector for a chroma subblock, mvCLX[xSbIdx][ySbIdx] of the chroma block based on the averaged luma motion vector, mvAvgLX; wherein the derivation process for the chroma motion vector is invoked with the mvAvgLX as inputs, and the chroma motion vector, mvCLX[xSbIdx][ySbIdx] as output, the following applies:
mvCLX[0]=mvLX[0]*2/SubWidthC
mvCLX[1]=mvLX[1]*2/SubHeightC, wherein a reference picture corresponding to the refIdxLX for the image block is not a current picture; or
mvCLX[0]=((mvLX[0]>>(3+SubWidthC))*32
mvCLX[1]=((mvLX[1]>>(3+SubHeightC))*32, wherein the reference picture corresponding to the refIdxLX for the image block is the current picture.
