diff options
author | Ronald S. Bultje <rsbultje@gmail.com> | 2019-12-28 23:12:51 +0300 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2019-12-29 18:21:44 +0300 |
commit | a4178cc20d1495543295ea55eead3581b189ec86 (patch) | |
tree | 179dc8475aa6ca5e211aac75d83d8a02f6f8b1a8 /src/recon_tmpl.c | |
parent | 1d36922f2538436d05213f5f4cddaff976a7559e (diff) |
av1: use chroma txtp inference over default DCT_DCT if qidx=0
Fixes #320. The problem here is that qidx=0 is (in libaom) a shortcut
for lossless, which normally becomes WHT_WHT, but under some obscure
conditions, it can also be non-lossless, in which case qidx=0 implies
DCT_DCT for luma. For chroma, apparently we should use the default
inference pattern, which becomes DCT_DCT for inter also, but requires
the standard lookup table for intra.
Diffstat (limited to 'src/recon_tmpl.c')
-rw-r--r-- | src/recon_tmpl.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/recon_tmpl.c b/src/recon_tmpl.c index cd1722a..3eec874 100644 --- a/src/recon_tmpl.c +++ b/src/recon_tmpl.c @@ -352,13 +352,17 @@ static int decode_coefs(Dav1dTileContext *const t, if (lossless) { assert(t_dim->max == TX_4X4); *txtp = WHT_WHT; - } else if (!f->frame_hdr->segmentation.qidx[b->seg_id] || - t_dim->max + intra >= TX_64X64) - { + } else if (t_dim->max + intra >= TX_64X64) { *txtp = DCT_DCT; } else if (chroma) { + // inferred from either the luma txtp (inter) or a LUT (intra) *txtp = intra ? dav1d_txtp_from_uvmode[b->uv_mode] : get_uv_inter_txtp(t_dim, *txtp); + } else if (!f->frame_hdr->segmentation.qidx[b->seg_id]) { + // In libaom, lossless is checked by a literal qidx == 0, but not all + // such blocks are actually lossless. The remainder gets an implicit + // transform type (for luma) + *txtp = DCT_DCT; } else { unsigned idx; if (intra) { |