Patent ID: 8750379

Claim:
A method for video coding, comprising: receiving a sequence of N video frames, each video frame containing macroblocks, where N is an integer greater than two; obtaining a budget for the N video frames, the budget specifying a maximum number of computations, C Total , that may be used in performing motion estimation for the N video frames; determining in a single pass through the N video frames a video frame allocation for each video frame such that the sum of the video frame allocations approaches C Total as the video frame allocations for more video frames are determined during the single pass through the N video frames, wherein the video frame allocation further comprises: allocating a number of computations allocated to a class of the macroblocks among individual macroblocks in the class of macroblocks; and allocating a number of computations allocated to an individual macroblock among individual steps of a motion estimation process; performing motion estimation for each video frame during the single pass through the N video frames using an actual number of video frame computations that is determined based at least upon on the video frame allocation and one or more classes of the macroblocks contained in the video frame, wherein the class of each macroblock is based upon at least one motion vector related to the macroblock; and coding each video frame in accordance with the motion estimation during the single pass through the N video frames and outputting each coded video frame.