Methods for deriving a motion vector prediction in video coding
A method of performing motion vector prediction for coding video data is disclosed. A full precision motion vector mv is determined for generating a prediction for video block in a first picture. A rounded motion vector rmv having a less precision than the full precision motion vector mv is stored. A motion vector predictor candidate is generated for a video block in a second picture from the stored motion vector.
1 . A method of decoding video data, the method comprising:
deriving a value from a bitstream;
deriving a shifted value by right shifting the value;
deriving a first value based on an integerized value, wherein the integerized value is obtained by integerizing a second value, and the second value is obtained based on an “exclusive or” of the value and the shifted value;
deriving a mask information based on left shifting by the first value and right shifting by a third value;
deriving a round information based on the first value and right shifting by (third value+1);
deriving a rounded value by masking a fourth value, obtained by adding the round information to the value, based on the mask information; and
generating a reconstructed image based on the rounded value.
2 . A method of encoding video data, the method comprising:
deriving a value from a bitstream;
deriving a shifted value by right shifting the value;
deriving a first value based on an integerized value, wherein the integerized value is obtained by integerizing a second value, and the second value is obtained based on an “exclusive or” of the value and the shifted value;
deriving a mask information based on left shifting by the first value and right shifting by a third value;
deriving a round information based on the first value and right shifting by (third value+1);
deriving a rounded value by masking a fourth value, obtained by adding the round information to the value, based on the mask information; and
generating a reconstructed image based on the rounded value.
3 . A non-transitory computer-readable storage medium storing a program for making a computer decode video data, wherein the program makes the computer:
derive a value from a bitstream;
derive a shifted value by right shifting the value;
derive a first value based on an integerized value, wherein the integerized value is obtained by integerizing a second value, and the second value is obtained based on an “exclusive or” of the value and the shifted value;
derive a mask information based on left shifting by the first value and right shifting by a third value;
derive a round information based on the first value and right shifting by (third value+1);
derive a rounded value by masking a fourth value, obtained by adding the round information to the value, based on the mask information; and
generate a reconstructed image based on the rounded value.