Manually cherry-picked from libvpx/nextgenv2: fa99c376 Change-Id: Ia614aaa784c405a3d0f815846a584dd358008b18