Commit 5a4fea2c authored by Ronald S. Bultje's avatar Ronald S. Bultje

Add frame_hdr/seq_hdr to Dav1dPicture

parent 7cc54b91
......@@ -67,6 +67,9 @@ typedef struct Dav1dPicture {
*/
void *data[3];
struct Dav1dRef *ref; ///< allocation origin
struct Dav1dRef *frame_hdr_ref, *seq_hdr_ref;
Dav1dSequenceHeader *seq_hdr;
Dav1dFrameHeader *frame_hdr;
/**
* Number of bytes between 2 lines in data[] for luma [0] or chroma [1].
......
......@@ -3123,6 +3123,12 @@ int dav1d_submit_frame(Dav1dContext *const c) {
f->sr_cur.p.p.fullrange = f->seq_hdr->color_range;
f->sr_cur.p.m = f->tile[0].data.m;
f->sr_cur.p.p.spatial_id = f->frame_hdr->spatial_id;
f->sr_cur.p.frame_hdr = f->frame_hdr;
f->sr_cur.p.frame_hdr_ref = f->frame_hdr_ref;
dav1d_ref_inc(f->frame_hdr_ref);
f->sr_cur.p.seq_hdr = f->seq_hdr;
f->sr_cur.p.seq_hdr_ref = f->seq_hdr_ref;
dav1d_ref_inc(f->seq_hdr_ref);
if (f->frame_hdr->super_res.enabled) {
res = dav1d_picture_alloc_copy(&f->cur, f->frame_hdr->width[0], &f->sr_cur.p);
......
......@@ -180,6 +180,12 @@ int dav1d_picture_alloc_copy(Dav1dPicture *const dst, const int w,
dst->p = src->p;
dst->m = src->m;
dst->p.w = w;
dst->frame_hdr = src->frame_hdr;
dst->frame_hdr_ref = src->frame_hdr_ref;
if (dst->frame_hdr_ref) dav1d_ref_inc(dst->frame_hdr_ref);
dst->seq_hdr = src->seq_hdr;
dst->seq_hdr_ref = src->seq_hdr_ref;
if (dst->seq_hdr_ref) dav1d_ref_inc(dst->seq_hdr_ref);
}
return res;
......@@ -193,6 +199,8 @@ void dav1d_picture_ref(Dav1dPicture *const dst, const Dav1dPicture *const src) {
if (src->ref) {
validate_input(src->data[0] != NULL);
dav1d_ref_inc(src->ref);
if (src->frame_hdr_ref) dav1d_ref_inc(src->frame_hdr_ref);
if (src->seq_hdr_ref) dav1d_ref_inc(src->seq_hdr_ref);
}
*dst = *src;
}
......@@ -224,6 +232,8 @@ void dav1d_picture_unref(Dav1dPicture *const p) {
if (p->ref) {
validate_input(p->data[0] != NULL);
dav1d_ref_dec(&p->ref);
dav1d_ref_dec(&p->seq_hdr_ref);
dav1d_ref_dec(&p->frame_hdr_ref);
}
memset(p, 0, sizeof(*p));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment