Merge "Some refactoring to support warped motion mode" into nextgenv2