memorysafety/rav1d

`Rav1dFrameContext`: Make fields safe

Closed this issue · 0 comments

Make all raw pointer fields into appropriate safe smart pointer or collection types. Note that the Rav1dContext pointer is handled separately in #695.

  • mvs_ref, mvs - Replace Rav1dRef with an Arc.
  • ref_mvs, ref_mvs_ref - Replace Rav1dRef with an Arc.
  • cur_segmap, cur_segmap_ref - Replace Rav1dRef with an Arc.
  • prev_segmap, prev_segmap_ref - Replace Rav1dRef with an Arc.
  • ts, n_ts - Replace with AlignedVec32.
  • dsp - References c.dsp indexed by seq_hdr.hbd. Might replace with an offset, but might also make sense to remove entirely and directly do c.dsp[seq_hdr.hbd] where it's used.
  • ipred_edge - First element is the base pointer of the allocation, next two elements point into the allocation. Split up into an AlignedVec64 and then an array of offsets.
  • qm - Points into dav1d_qm_tbl. Can probably be made into &'static [u8]s, but may need to be offsets depending on usage.
  • a, a_sz - Owned allocation, can be a Vec.