shithub: dav1d

Download patch

ref: 242c35f3e26e4384a5f1e68c86b269ba60d70ef4
parent: 0fdee4daee5b70dcbfc8e3f3fd5d82095b57d6bf
author: Ronald S. Bultje <rsbultje@gmail.com>
date: Fri Nov 16 11:32:40 EST 2018

If Y/AC is 0 (but lossless=0), only allow coding DCT_DCT

This is consistent with what libaom does. Should fix #175.

--- a/src/env.h
+++ b/src/env.h
@@ -127,9 +127,13 @@
                                                 const Av1FrameHeader *const hdr,
                                                 const int seg_id)
 {
-    if (hdr->segmentation.lossless[seg_id]) {
-        assert(tx == (int) TX_4X4);
-        return TXTP_SET_LOSSLESS;
+    if (!hdr->segmentation.qidx[seg_id]) {
+        if (hdr->segmentation.lossless[seg_id]) {
+            assert(tx == (int) TX_4X4);
+            return TXTP_SET_LOSSLESS;
+        } else {
+            return TXTP_SET_DCT;
+        }
     }
 
     const TxfmInfo *const t_dim = &dav1d_txfm_dimensions[tx];