mirror of
https://github.com/webmproject/libwebp.git
synced 2024-12-27 06:08:21 +01:00
special-case WHT transform when there's only DC
happens surprisingly often at low quality, so we might as well hard-code a simplified TransformWHT() directly. Change-Id: Ib7a858ef74e8f334bd59d6512bf5bd3e455c5459
This commit is contained in:
parent
80911aef38
commit
63f9aba4b3
@ -519,9 +519,15 @@ static int ParseResiduals(VP8Decoder* const dec,
|
||||
if (!block->is_i4x4_) { // parse DC
|
||||
int16_t dc[16] = { 0 };
|
||||
const int ctx = mb->nz_dc_ + left_mb->nz_dc_;
|
||||
mb->nz_dc_ = left_mb->nz_dc_ =
|
||||
(GetCoeffs(token_br, bands[1], ctx, q->y2_mat_, 0, dc) > 0);
|
||||
VP8TransformWHT(dc, dst);
|
||||
const int nz = GetCoeffs(token_br, bands[1], ctx, q->y2_mat_, 0, dc);
|
||||
mb->nz_dc_ = left_mb->nz_dc_ = (nz > 0);
|
||||
if (nz > 1) { // more than just the DC -> perform the full transform
|
||||
VP8TransformWHT(dc, dst);
|
||||
} else { // only DC is non-zero -> inlined simplified transform
|
||||
int i;
|
||||
const int dc0 = (dc[0] + 3) >> 3;
|
||||
for (i = 0; i < 16 * 16; i += 16) dst[i] = dc0;
|
||||
}
|
||||
first = 1;
|
||||
ac_proba = bands[0];
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user