Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/videolan/dav1d.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2022-04-07 20:33:40 +0300
committerJames Almer <jamrial@gmail.com>2022-04-07 20:56:33 +0300
commit9bd8350ace32aef4f808770b97459747fd217b69 (patch)
tree048bd4d3b0247ac9520e103e0519e3f0bcf3eb74
parent6777dd0a61ab78cc9fab92af53558ea44c135056 (diff)
picture: ensure the new seq header and op param info flags are attached to the next visible picture in display order
If the first picture in coding order after a new sequence header is parsed is not visible, the first picture output by dav1d after the fact (which is coded after the aforementioned invisible picture) would not trigger the new seq header event flag as expected, despite being the first containing a reference to a new sequence header. Assuming the invisible picture is ever output, the result of this change will be two pictures signaling a new sequence header was seen despite there being only one new sequence header.
-rw-r--r--src/picture.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/picture.c b/src/picture.c
index bebc4dd..7046ed1 100644
--- a/src/picture.c
+++ b/src/picture.c
@@ -194,8 +194,12 @@ int dav1d_thread_picture_alloc(Dav1dContext *const c, Dav1dFrameContext *const f
dav1d_ref_dec(&c->itut_t35_ref);
c->itut_t35 = NULL;
+ // Don't clear these flags from c->frame_flags if the frame is not visible.
+ // This way they will be added to the next visible frame too.
+ const int flags_mask = (f->frame_hdr->show_frame || c->output_invisible_frames)
+ ? 0 : (PICTURE_FLAG_NEW_SEQUENCE | PICTURE_FLAG_NEW_OP_PARAMS_INFO);
p->flags = c->frame_flags;
- c->frame_flags = 0;
+ c->frame_flags &= flags_mask;
p->visible = f->frame_hdr->show_frame;
if (have_frame_mt) {