ref: 95cf7cf8f3c8b884483777e33adcc63ad7075327
parent: d6770f93447fa6fa5a95e15cb567657684410d79
author: Ronald S. Bultje <[email protected]>
date: Wed Dec 5 12:34:02 EST 2018
Use adapted CDF for invisible keyframes if refresh_context=1 Fixes #213.
--- a/src/obu.c
+++ b/src/obu.c
@@ -1388,7 +1388,7 @@
if (c->refs[c->frame_hdr->existing_frame_idx].p.p.frame_hdr->frame_type == DAV1D_FRAME_TYPE_KEY) {
const int r = c->frame_hdr->existing_frame_idx;
for (int i = 0; i < 8; i++) {
- if (i == c->frame_hdr->existing_frame_idx) continue;
+ if (i == r) continue;
if (c->refs[i].p.p.data[0])
dav1d_thread_picture_unref(&c->refs[i].p);
@@ -1395,7 +1395,7 @@
dav1d_thread_picture_ref(&c->refs[i].p, &c->refs[r].p);
if (c->cdf[i].cdf) dav1d_cdf_thread_unref(&c->cdf[i]);
- dav1d_init_states(&c->cdf[i], c->refs[r].p.p.frame_hdr->quant.yac);
+ dav1d_cdf_thread_ref(&c->cdf[i], &c->cdf[r]);
dav1d_ref_dec(&c->refs[i].segmap);
c->refs[i].segmap = c->refs[r].segmap;