Systems and methods for handling out of boundary motion compensation predictors in video coding
A device may be configured to perform motion compensation for coded video according to one or more of the techniques described herein. In one example, a device for decoding coded data comprises a processor, and a memory associated with the processor; wherein the processor is configured to: for a predicted sample located a position (x,y), determine reference locations based on motion vectors; compute weights based on the determined reference locations; and generate a prediction sample based on the weights.
1 . A method of coding video data, the method comprising:
for a predicted sample located at a position (x,y), determining reference locations based on motion vectors, wherein the reference locations are determined based on the following:
xr0=16*x+mvL0[0],
yr0=16*y+mvL0[1],
xr1=16*x+mvL1[0], and
yr1=16*y+mvL1[1],
wherein mvL0 is a first motion vector applicable to a first prediction and mvL1 is a second motion vector applicable to a second prediction;
computing out-of-bounds variables: oobdx0[x][y], oobdy0[x][y], oobdx1[x][y], and oobdy1[x][y], based on respective determined reference locations: xr0, yr0, xr1, and yr1, wherein an out-of-bounds variable, among the out-of-bounds variables, equal to 16 indicates that a respective determined reference location, among the respective determined reference locations, is within a picture boundary, and decreases to 0, as the respective determined reference location points further away from the picture boundary;
computing weights based on the computed out-of-bounds variables; and
generating a prediction sample based on the weights.
2 . The method of claim 1 , wherein the out-of-bounds variables, based on the respective determined reference locations, are computed based on the following:
oobdx0[x][y]=min(16,max(0,16+xr0)+max(0,16*(pps_pic_width_in_luma_samples−2)−xr0))
oobdy0[x][y]=min(16,max(0,16+yr0)+max(0,16*(pps_pic_height_in_luma_samples−2)−yr0))
oobdx1[x][y]=min(16,max(0,16+xr1)+max(0,16*(pps_pic_width_in_luma_samples−2)−xr1))
oobdy1[x][y]=min(16,max(0,16+yr1)+max(0,16*(pps_pic_height_in_luma_samples−2)−yr1)).
3 . A device comprising one or more processors configured to:
for a predicted sample located at a position (x,y), determine reference locations based on motion vectors, wherein the reference locations are determined based on the following:
xr0=16*x+mvL0[0],
yr0=16*y+mvL0[1],
xr1=16*x+mvL1[0], and
yr1=16*y+mvL1[1],
wherein mvL0 is a first motion vector applicable to a first prediction and mvL1 is a second motion vector applicable to a second prediction;
compute out-of-bounds variables: oobdx0[x][y], oobdy0[x][y], oobdx1[x][y], and oobdy1[x][y], based on respective determined reference locations: xr0, yr0, xr1, and yr1, wherein an out-of-bounds variable, among the out-of-bounds variables, equal to 16 indicates that a respective determined reference location, among the respective determined reference locations, is within a picture boundary, and decreases to 0, as the respective determined reference location points further away from the picture boundary;
compute weights based on the computed out-of-bounds variables; and
generate a prediction sample based on the weights.
4 . The device of claim 3 , wherein the out-of-bounds variables, based on the respective determined reference locations, are computed based on the following:
oobdx0[x][y]=min(16,max(0,16+xr0)+max(0,16*(pps_pic_width_in_luma_samples−2)−xr0))
oobdy0[x][y]=min(16,max(0,16+yr0)+max(0,16*(pps_pic_height_in_luma_samples−2)−yr0))
oobdx1[x][y]=min(16,max(0,16+xr1)+max(0,16*(pps_pic_width_in_luma_samples−2)−xr1))
oobdy1[x][y]=min(16,max(0,16+yr1)+max(0,16*(pps_pic_height_in_luma_samples−2)−yr1)).
5 . The device of claim 3 , wherein the device includes a video encoder.
6 . The device of claim 3 , wherein the device includes a video decoder.