shithub: dav1d

Download patch

ref: 276973ecebea1fa7657253af26f6af3ac1e85513
parent: ee8856ffeb4247375f6cce41c89090647ccad3ea
author: Ronald S. Bultje <[email protected]>
date: Thu Dec 20 07:04:12 EST 2018

Don't apply QM on lossless blocks

Similar to use of 'lossless' variable in setup_segmentation_dequant()
in libaom. Fixes #226 and #228.

--- a/src/recon_tmpl.c
+++ b/src/recon_tmpl.c
@@ -205,8 +205,9 @@
 
     // residual and sign
     int dc_sign = 1;
+    const int lossless = f->frame_hdr->segmentation.lossless[b->seg_id];
     const uint16_t *const dq_tbl = ts->dq[b->seg_id][plane];
-    const uint8_t *const qm_tbl = f->qm[is_1d || *txtp == IDTX][tx][plane];
+    const uint8_t *const qm_tbl = f->qm[lossless || is_1d || *txtp == IDTX][tx][plane];
     const int dq_shift = imax(0, t_dim->ctx - 2);
     const int bitdepth = BITDEPTH == 8 ? 8 : f->cur.p.bpc;
     const int cf_min = -(1 << (7 + bitdepth));