Refactoring in nonrd_ methods in vp9_encodeframe

Refactored some of the more repetitive code in the nonrd methods in
vp9_encodeframe.c.

Change-Id: Ib71dcd14f74fb6e5fd123b3ffea8f253aaa04b1a