Skip to content

Calculate reference frames correctly when using segmentation

This corresponds to the code in read_ref_frames in the spec (section 5.11.25). The first problem is that the segmentation logic was missing from the "is_comp" branch of the giant if() statement.

The second change is that we should be checking seg->ref >= 0 rather than seg->ref > 0. This is because the SEG_LVL_REF_FRAME feature is active whenever seg->ref is non-negative (and we don't want to fall through to reading stuff from the bitstream when seg->ref is zero).

This fixes issue #177 (closed)

Merge request reports