mirror of
https://github.com/webmproject/libwebp.git
synced 2025-07-13 06:24:27 +02:00
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:
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user