shithub: dav1d

Download patch

ref: cdf4a3bc94be2425a7d0b140091bbfaf08c48eac
parent: dfcd6ea9f96025ee6779335a209514760fd85ace
author: Michael Bradshaw <mjbshaw@google.com>
date: Sat Dec 28 17:26:34 EST 2019

Allow skip mode

--- a/src/obu.c
+++ b/src/obu.c
@@ -933,19 +933,20 @@
                     off_after = refpoc;
                     off_after_idx = i;
                 }
-            } else if (diff < 0) {
-                if (off_before[0] == 0xFFFFFFFFU ||
-                    get_poc_diff(seqhdr->order_hint_n_bits,
-                                 refpoc, off_before[0]) > 0)
-                {
-                    off_before[1] = off_before[0];
-                    off_before[0] = refpoc;
-                    off_before_idx[1] = off_before_idx[0];
-                    off_before_idx[0] = i;
-                } else if (refpoc != off_before[0] &&
-                           (off_before[1] == 0xFFFFFFFFU ||
-                            get_poc_diff(seqhdr->order_hint_n_bits,
-                                         refpoc, off_before[1]) > 0))
+            } else if (diff < 0 && (off_before[0] == 0xFFFFFFFFU ||
+                                    get_poc_diff(seqhdr->order_hint_n_bits,
+                                                 refpoc, off_before[0]) > 0))
+            {
+                off_before[1] = off_before[0];
+                off_before[0] = refpoc;
+                off_before_idx[1] = off_before_idx[0];
+                off_before_idx[0] = i;
+            } else if (off_before[0] != 0xFFFFFFFFU) {
+                const int diff = get_poc_diff(seqhdr->order_hint_n_bits,
+                                              refpoc, off_before[0]);
+                if (diff < 0 && (off_before[1] == 0xFFFFFFFFU ||
+                                 get_poc_diff(seqhdr->order_hint_n_bits,
+                                              refpoc, off_before[1]) > 0))
                 {
                     off_before[1] = refpoc;
                     off_before_idx[1] = i;