remove the special casing for res->first in VP8SetResidualCoeffs

if res->first = 1, coeffs[0]=0 because of quant.c:749 and line
added at quant.c:744
So, no need for the extra case.
Going forward, TrellisQuantizeBlock() should also be calling
a variant of VP8SetResidualCoeffs() to set the 'last' field.

also: fixes a warning for win64
    + slight speed-up

Change-Id: Ib24b611f7396d24aeb5b56dc74d5c39160f048f0
This commit is contained in:
skal
2014-06-08 06:40:22 +02:00
parent bdfeebaa01
commit 69fce2ea78
3 changed files with 11 additions and 6 deletions

View File

@ -562,7 +562,8 @@ static void SetResidualCoeffs(const int16_t* const coeffs,
VP8Residual* const res) {
int n;
res->last = -1;
for (n = 15; n >= res->first; --n) {
assert(res->first == 0 || coeffs[0] == 0);
for (n = 15; n >= 0; --n) {
if (coeffs[n]) {
res->last = n;
break;