1. A method comprising: receiving a current frame to encode; analyzing the current frame to determine a feature for a current macroblock in the frame, the feature based on an object found in the current frame; determining a subset of reference frames from a storage of reference frames in memory, the reference frames classified based on a plurality of features; performing a motion search using the subset of reference frames to determine a reference block in a reference frame for the current macroblock; and encoding the current macroblock using the reference block.