Commit 2c3eaffd authored by boyuanxiao-argondesign's avatar boyuanxiao-argondesign Committed by Ronald S. Bultje
Browse files

Correct the condition for freeing references in dav1d_parse_obus

A new coded video sequence (see page 193; section 7.5 of the spec)
begins when we see a sequence header that isn't bit identical to
previous ones. This is the point at which we can throw away previous
frames etc.
parent a1e945ca
Pipeline #2634 passed with stages
in 2 minutes and 52 seconds
......@@ -1090,7 +1090,10 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
return res;
if (check_for_overrun(&gb, init_bit_pos, len))
return -EINVAL;
if (!c->have_frame_hdr || memcmp(&hdr, &c->seq_hdr, sizeof(hdr))) {
// If we have read a sequence header which is different from
// the old one, this is a new video sequence and can't use any
// previous state. Free that state.
if (c->have_seq_hdr && memcmp(&hdr, &c->seq_hdr, sizeof(hdr))) {
for (int i = 0; i < 8; i++) {
if (c->refs[i][0])
......@@ -1099,7 +1102,6 @@ int dav1d_parse_obus(Dav1dContext *const c, Dav1dData *const in) {
if (c->cdf[i].cdf)
if (c->have_seq_hdr)
c->seq_hdr = hdr;
c->have_seq_hdr = 1;
Supports Markdown
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