Merge set_prev_mi function into encoder function.

Change-Id: Ifcf2efbb232ea4cabcdebbe77e0820d121e4a6da
Merge "Merge set_prev_mi function into encoder function."