introduce VP8EncQuantize2Blocks to quantize two blocks at a time

No speed diff for now. We might reorder better the instructions later,
to speed things up.

Change-Id: I1949525a0b329c7fd861b8dbea7db4b23d37709c
This commit is contained in:
skal
2014-08-25 13:16:14 -07:00
parent 0b21c30b1a
commit 73d361dd5f
6 changed files with 50 additions and 6 deletions

View File

@ -746,12 +746,13 @@ static int ReconstructIntra16(VP8EncIterator* const it,
}
}
} else {
for (n = 0; n < 16; ++n) {
for (n = 0; n < 16; n += 2) {
// Zero-out the first coeff, so that: a) nz is correct below, and
// b) finding 'last' non-zero coeffs in SetResidualCoeffs() is simplified.
tmp[n][0] = 0;
nz |= VP8EncQuantizeBlock(tmp[n], rd->y_ac_levels[n], &dqm->y1_) << n;
assert(rd->y_ac_levels[n][0] == 0);
tmp[n][0] = tmp[n + 1][0] = 0;
nz |= VP8EncQuantize2Blocks(tmp[n], rd->y_ac_levels[n], &dqm->y1_) << n;
assert(rd->y_ac_levels[n + 0][0] == 0);
assert(rd->y_ac_levels[n + 1][0] == 0);
}
}
@ -816,8 +817,8 @@ static int ReconstructUV(VP8EncIterator* const it, VP8ModeScore* const rd,
}
}
} else {
for (n = 0; n < 8; ++n) {
nz |= VP8EncQuantizeBlock(tmp[n], rd->uv_levels[n], &dqm->uv_) << n;
for (n = 0; n < 8; n += 2) {
nz |= VP8EncQuantize2Blocks(tmp[n], rd->uv_levels[n], &dqm->uv_) << n;
}
}