VIDEO CODING USING ADAPTIVE MOTION VECTOR RESOLUTION
In one example, a device for coding video data includes a video coder configured to configured to code information representative of whether an absolute value of an x-component of a motion vector difference value for a current block of video data is greater than zero, code information representative of whether an absolute value of a y-component of the motion vector difference value is greater than zero, when the absolute value of the x-component is greater than zero, code information representative of the absolute value of the x-component, when the absolute value of the y-component is greater than zero, code information representative of the absolute value of the y-component, when the absolute value of the x-component is greater than zero, code a sign of the x-component, and when the absolute value of the y-component is greater than zero, code a sign of the y-component.
1 . A method of encoding video data, the method comprising:
calculating a motion vector for the current block of video data;
calculating the motion vector difference value as a difference between the motion vector for the current block of video data and a motion vector predictor determined for the current block of video data;
entropy encoding information representative of a motion vector difference value, wherein entropy encoding the information representative of the motion vector difference value comprises:
interleaving information indicating at the absolute value of the x-component of a motion vector difference value for the current block of video data is greater than zero and information indicating that the absolute value of the y-component of the motion vector difference value is greater than zero and entropy encoding the interleaved information; and
interleaving information representative of the absolute value of the x-component of the motion vector difference value, information representative of the absolute value of the y-component of the motion vector difference value, information representative of the a sign of the x-component of the motion vector difference value, and information representative of the a sign of the y-component of the motion vector difference value.
2 . The method of claim 1 , wherein entropy encoding comprises context-adaptive binary arithmetic coding (CABAC) coding.
3 . The method of claim 1 , further comprising:
encoding a value representative of whether a motion vector of the current block of video data has a first sub-pixel precision or a second sub-pixel precision, wherein the second sub-pixel precision is greater than the first sub-pixel precision; and
when the motion vector has the second sub-pixel precision, when the x-component of the motion vector difference value is not equal to zero, and when the y-component of the motion vector difference value is not equal to zero, wherein encoding information representative of the absolute value of the x-component of the motion vector difference value and encoding information representative of the absolute value of the y-component of the motion vector difference value comprises encoding a jointly coded value representative of both the x-component of the motion vector difference value and the y-component of the motion vector difference value.
4 . The method of claim 1 , wherein encoding information representative of the absolute value of the x-component of the motion vector difference values comprises encoding the absolute value of the x-component of the motion vector difference values mvd_x/2−1, wherein mvd_x comprises the x-component of the motion vector difference value; and
wherein encoding information representative of the absolute value of the y-component of the motion vector difference values comprises encoding the absolute value of the y-component of the motion vector difference values as mvd_y/2−1, wherein mvd_y comprises the y-component of the motion vector difference value.
5 . A method of decoding video data, the method comprising:
entropy decoding information representative of a motion vector difference value;
determining a motion vector predictor for the current block of video data; and calculating a motion vector for the current block of video data as a sum of the motion vector difference value and the motion vector predictor,
wherein entropy decoding the information representative of the motion vector difference value comprises:
entropy decoding interleaved information indicating that the absolute value of the x-component of a motion vector difference value for the current block of video data is greater than zero and information indicating that the absolute value of the y-component of the motion vector difference value is greater than zero; and
entropy decoding interleaved information representative of the absolute value of the x-component of the motion vector difference value, information representative of the absolute value of the y-component of the motion vector difference value, information representative of the a sign of the x-component of the motion vector difference value, and information representative of the a sign of the y-component of the motion vector difference value.
6 . The method of claim 5 , wherein entropy decoding comprises context-adaptive binary arithmetic coding (CABAC) decoding
7 . The method of claim 1 , further comprising:
decoding a value representative of whether a motion vector of the current block of video data has a first sub-pixel precision or a second sub-pixel precision, wherein the second sub-pixel precision is greater than the first sub-pixel precision; and
when the motion vector has the second sub-pixel precision, when the x-component of the motion vector difference value is not equal to zero, and when the y-component of the motion vector difference value is not equal to zero, wherein encoding information representative of the absolute value of the x-component of the motion vector difference value and encoding information representative of the absolute value of the y-component of the motion vector difference value comprises encoding a jointly coded value representative of both the x-component of the motion vector difference value and the y-component of the motion vector difference value.
8 . The method of claim 1 , wherein decoding information representative of the absolute value of the x-component of the motion vector difference values comprises decoding the absolute value of the x-component of the motion vector difference values as mvd_x/2−1, wherein mvd_x comprises the x-component of the motion vector difference value; and
wherein decoding information representative of the absolute value of the y-component of the motion vector difference values comprises decoding the absolute value of the y-component of the motion vector difference values as mvd_y/2−1, wherein mvd_y comprises the y-component of the motion vector difference value.
9 . An apparatus for decoding video data, the apparatus comprising:
a memory configured to store video data; and
a processor in communication with the memory and configured to:
entropy decode information representative of a motion vector difference value;
decode information representative of a motion vector difference value;
determining a motion vector predictor for the current block of video data; and
calculate a motion vector for the current block of video data as a sum of the motion vector difference value and the motion vector predictor,
wherein to entropy decode the information representative of the motion vector difference value, the processor is further configured to:
entropy decode interleaved information indicating that the absolute value of the x-component of a motion vector difference value for the current block of video data is greater than zero and information indicating that the absolute value of the y-component of the motion vector difference value is greater than zero; and
entropy decode interleaved information representative of the absolute value of the x-component of the motion vector difference value, information representative of the absolute value of the y-component of the motion vector difference value, information representative of the a sign of the x-component of the motion vector difference value, and information representative of the a sign of the y-component of the motion vector difference value.
10 . The apparatus of claim 9 , wherein the apparatus comprises at least one of:
an integrated circuit;
a microprocessor; or
a wireless communication device, which includes the processor.