Patent ID: 8774280

Claim:
A computing device comprising a processor and memory, wherein the computing device implements a video encoder adapted to perform a method comprising: encoding, as part of rate-distortion optimization, at least part of a current picture of a sequence of pictures using temporal motion vector (“MV”) prediction for direct mode portions; encoding, as part of the rate-distortion optimization, the at least part of the current picture using spatial MV prediction for direct mode portions, including, for a current direct mode portion of the current picture: determining a first reference picture for the current direct mode portion as having a first minimum reference picture index among reference picture indices of plural spatially neighboring portions of the current picture for a first reference picture list; determining a first predicted MV for the current direct mode portion using spatial MV prediction, the first predicted MV referencing data associated with the first reference picture, wherein the first predicted MV is based on median values of first MV data for the plural spatially neighboring portions; determining a second reference picture for the current direct mode portion as having a second minimum reference picture index among reference picture indices of the plural spatially neighboring portions for a second reference picture list; determining a second predicted MV for the current direct mode portion using spatial MV prediction, the second predicted MV referencing data associated with the second reference picture, wherein the second predicted MV is based on median values of second MV data for the plural spatially neighboring portions; and performing motion compensation for the current direct mode portion; based at least in part on results of the encoding using temporal MV prediction and results of the encoding using spatial MV prediction, selecting, as part of the rate-distortion optimization, between using temporal MV prediction and using spatial MV prediction for direct mode portions of the at least part of the current picture; and outputting encoded data in a bitstream for the at least part of the current picture.