Skip to content

Commit

Permalink
Rav1dFrameContext_frame_thread::cf: Unconditionally resize
Browse files Browse the repository at this point in the history
  • Loading branch information
randomPoison committed Feb 23, 2024
1 parent 0188504 commit 9eb28ad
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 16 deletions.
5 changes: 0 additions & 5 deletions src/align.rs
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,6 @@ impl<T: Copy> AlignedVec64<T> {

self.len = new_len;
}

pub fn clear(&mut self) {
self.inner.clear();
self.len = 0;
}
}

impl<T: Copy> Deref for AlignedVec64<T> {
Expand Down
7 changes: 2 additions & 5 deletions src/decode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4361,11 +4361,8 @@ pub(crate) unsafe fn rav1d_decode_frame_init(
}

let cf_sz = (num_sb128 * size_mul[0] as c_int) << hbd;
if cf_sz as usize != f.frame_thread.cf_sz() {
f.frame_thread.cf.clear();
// TODO: Fallible allocation
f.frame_thread.cf.resize(cf_sz as usize * 128 * 128 / 2, 0);
}
// TODO: Fallible allocation
f.frame_thread.cf.resize(cf_sz as usize * 128 * 128 / 2, 0);

if frame_hdr.allow_screen_content_tools != 0 {
// TODO: Fallible allocation
Expand Down
6 changes: 0 additions & 6 deletions src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,6 @@ pub struct Rav1dFrameContext_frame_thread {
pub tile_start_off: *mut u32,
}

impl Rav1dFrameContext_frame_thread {
pub fn cf_sz(&self) -> usize {
self.cf.len() / (128 * 128 / 2)
}
}

/// loopfilter
#[repr(C)]
pub struct Rav1dFrameContext_lf {
Expand Down

0 comments on commit 9eb28ad

Please sign in to comment.