From 9eb28ad30557eb3f93d4679ac90e39db21310c97 Mon Sep 17 00:00:00 2001 From: Nicole LeGare Date: Fri, 23 Feb 2024 09:40:08 -0800 Subject: [PATCH] `Rav1dFrameContext_frame_thread::cf`: Unconditionally resize --- src/align.rs | 5 ----- src/decode.rs | 7 ++----- src/internal.rs | 6 ------ 3 files changed, 2 insertions(+), 16 deletions(-) diff --git a/src/align.rs b/src/align.rs index b3e260959..0cc79a08d 100644 --- a/src/align.rs +++ b/src/align.rs @@ -168,11 +168,6 @@ impl AlignedVec64 { self.len = new_len; } - - pub fn clear(&mut self) { - self.inner.clear(); - self.len = 0; - } } impl Deref for AlignedVec64 { diff --git a/src/decode.rs b/src/decode.rs index 8083182c8..e7bac8cb8 100644 --- a/src/decode.rs +++ b/src/decode.rs @@ -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 diff --git a/src/internal.rs b/src/internal.rs index 8ab6c75fd..3d5a8190e 100644 --- a/src/internal.rs +++ b/src/internal.rs @@ -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 {