Commit b3be34bf authored by Ronald S. Bultje's avatar Ronald S. Bultje
Browse files

Don't read filmgrain parameters for never-visible frames.

Also a tiny fix to ensure that frame-difference is always evaluated
in the correct wraparound order.
parent 19ba5a94
Pipeline #437 failed with stage
in 15 seconds
......@@ -307,7 +307,7 @@ static inline int get_jnt_comp_ctx(const int order_hint_n_bits,
const int yb4, const int xb4)
{
const unsigned d0 = abs(get_poc_diff(order_hint_n_bits, ref0poc, poc));
const unsigned d1 = abs(get_poc_diff(order_hint_n_bits, ref1poc, poc));
const unsigned d1 = abs(get_poc_diff(order_hint_n_bits, poc, ref1poc));
const int offset = d0 == d1;
const int a_ctx = a->comp_type[xb4] >= COMP_INTER_AVG ||
a->ref[0][xb4] == 6;
......
......@@ -862,7 +862,9 @@ static int parse_frame_hdr(Dav1dContext *const c, GetBits *const gb,
(gb->ptr - init_ptr) * 8 - gb->bits_left);
#endif
hdr->film_grain.present = seqhdr->film_grain_present && get_bits(gb, 1);
hdr->film_grain.present = seqhdr->film_grain_present &&
(hdr->show_frame || hdr->showable_frame) &&
get_bits(gb, 1);
if (hdr->film_grain.present) {
hdr->film_grain.seed = get_bits(gb, 16);
hdr->film_grain.update = hdr->frame_type != INTER_FRAME || get_bits(gb, 1);
......
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