Method and apparatus for encoding or decoding video
The present disclosure provides a computer-implemented method for decoding video. The method includes receiving a bitstream including a coding unit of a video frame, the coding unit being coded in a skip mode or a direct mode; determining whether the coding units has a width greater than a threshold width or a height greater than a threshold height; in response to the coding unit having the width greater than the threshold width or the height greater than the threshold height, enabling a motion vector angular prediction process to store one or more motion vector angular prediction candidates in a candidate list storing a plurality of motion candidates associated with the coding unit; and performing an inter prediction to the coding unit according to the candidate list and an index parsed from the bitstream.
1. A method for decoding video, comprising:
receiving a bitstream including a coding unit of a video frame, the coding unit being coded in a skip mode or a direct mode;
determining whether the coding unit has a width greater than a threshold width or a height greater than a threshold height;
in response to the coding unit having the width greater than the threshold width or the height greater than the threshold height, enabling a motion vector angular prediction process to store one or more motion vector angular prediction candidates in a candidate list storing a plurality of motion candidates associated with the coding unit, wherein the candidate list for the inter prediction is derived by:
storing a temporal motion vector predictor as one of the motion candidates;
storing a spatial motion vector predictor as one of the motion candidates; and
storing the one or more motion vector angular prediction candidates as one or more of the motion candidates in response to the enabled motion vector angular prediction process; and
performing an inter prediction to the coding unit according to the candidate list and an index parsed from the bitstream.
2. The method of claim 1 , further comprising:
in response to another coding unit having a width equal to the threshold width and a height equal to the threshold height, disabling the motion vector angular prediction process to derive the candidate list storing the plurality of motion candidates associated with the another coding unit without storing any motion vector angular prediction candidate in the candidate list.
3. The method of claim 1 , wherein deriving the candidate list further comprises:
checking whether a history-based motion vector predictor stored in a HMVP table is identical to any motion candidate in the candidate list; and
in response to the history-based motion vector predictor being different from the motion candidates in the candidate list, storing the history-based motion vector predictor as one of the motion candidates in the candidate list.
4. An apparatus, comprising:
a memory configured to store instructions; and
a processor coupled to the memory and configured to execute the instructions to cause the apparatus to:
receive a bitstream including a coding unit of a video frame, the coding unit being coded in a skip mode or a direct mode;
determine whether the coding unit has a width greater than a threshold width or a height greater than a threshold height;
in response to the coding unit having the width greater than the threshold width or the height greater than the threshold height, enable a motion vector angular prediction process to store one or more motion vector angular prediction candidates in a candidate list storing a plurality of motion candidates associated with the coding unit, wherein the candidate list is derived by:
storing a temporal motion vector predictor as one of the motion candidates;
storing a spatial motion vector predictor as one of the motion candidates; and
storing the one or more motion vector angular prediction candidates as one or more of the motion candidates, in response to the enabled motion vector angular prediction process; and
perform an inter prediction to the coding unit according to the candidate list and an index parsed from the bitstream.
5. The apparatus of claim 4 , wherein the processor is configured to execute the instructions to cause the apparatus to:
in response to another coding unit having a width equal to the threshold width and a height equal to the threshold height, disable the motion vector angular prediction process to derive the candidate list storing the plurality of motion candidates associated with the another coding unit without storing any motion vector angular prediction candidate in the candidate list.
6. The apparatus of claim 4 , wherein the processor is configured to execute the instructions to cause the apparatus to derive the candidate list by:
checking whether a history-based motion vector predictor stored in a HMVP table is identical to any motion candidate in the candidate list; and
in response to the history-based motion vector predictor being different from the motion candidates in the candidate list, storing the history-based motion vector predictor as one of the motion candidates in the candidate list.
7. A non-transitory computer-readable storage medium storing a set of instructions that are executable by one or more processors of a device to cause the device to perform a method for motion vector prediction, comprising:
dividing a coding unit into a plurality of subblocks;
filling a reference list associated with the coding unit by:
filling a reference unit in the reference list with motion information of a neighboring block of the coding unit, if the motion information of the neighboring block associated with the reference unit is available;
filling a first reference unit being a first entry in the reference list with a predefined motion information if the motion information of a first neighboring block associated with the first reference unit is unavailable; and
filling a remaining reference unit with the motion information filled in a previous neighboring reference unit in the reference list if the motion information of the neighboring block associated with the remaining reference unit is unavailable; and
performing a motion vector angular prediction process to obtain one or more motion vector angular prediction candidates for each subblock by using the reference list according to one or more prediction directions.
8. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to fill the first reference unit with the predefined motion information by:
filling the first reference unit with a zero-motion vector and a reference index set to zero.
9. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to fill the first reference unit with the predefined motion information by:
filling the first reference unit with the motion information stored in a last entry of a history-based motion vector predictor table.
10. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to fill the first reference unit with the predefined motion information by:
filling the first reference unit with the motion information of a temporal motion vector predictor (TMVP) candidate or a spatial motion vector predictor (SMVP) candidate.
11. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to further perform:
in response to the number of the reference unit filled with the available motion information of the neighboring block being less than a threshold value:
disabling the motion vector angular prediction process for the coding unit; and
deriving a candidate list storing a plurality of motion candidates without storing any vector angular prediction candidate to the candidate list.
12. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to further perform:
in response to the number of the reference unit filled with the available motion information of the neighboring block reaching a threshold value:
enabling the motion vector angular prediction process for the coding unit; and
deriving a candidate list storing a plurality of motion candidates including a plurality of motion vector angular prediction candidates for each subblock according to a plurality of prediction directions.
13. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to further perform:
enabling the motion vector angular prediction process for the coding unit without checking for an availability of the one or more prediction directions; and
deriving a candidate list storing a plurality of motion candidates including a plurality of motion vector angular prediction candidates for each subblock according to a plurality of prediction directions.
14. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to further perform:
selecting one or more available directions from a plurality of prediction directions by checking for an availability of each prediction direction; and
performing the motion vector angular prediction process according to the one or more available directions to obtain the one or more motion vector angular prediction candidates.
15. The non-transitory computer-readable storage medium of claim 14 , wherein the number of the one or more vector angular prediction candidates is between 0 to 5 according to the number of the one or more available directions.
16. The non-transitory computer-readable storage medium of claim 7 , wherein the number of the reference units in the reference motion information list is (2M/4+2N/4+1) for a M×N coding unit, M and N being integer.
17. The non-transitory computer-readable storage medium of claim 7 , wherein the size of the reference unit in the reference motion information list is 4×4.
18. The non-transitory computer-readable storage medium of claim 7 , wherein the set of instructions that are executable by the one or more processors of the device causes the device to further perform:
deriving a candidate list storing a plurality of motion candidates by:
storing a temporal motion vector predictor and a spatial motion vector predictor;
in response to the motion vector angular prediction process being enable, storing the one or more motion vector angular prediction candidate; and
storing a history-based motion vector predictor.