This commit is a manual cherry-pick from aom/master: 42ff3881 Change-Id: I4a3cdb939b7b96a3aa27f6a00da7a0e73222f3f3