Skip to content

Commit

Permalink
struct Rav1dContext::itut_t35: Remove DRav1d, as only `Rav1dPictu…
Browse files Browse the repository at this point in the history
…re::itut_t35` needs it.
  • Loading branch information
kkysen committed Apr 23, 2024
1 parent 72cde01 commit 1c24cee
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 16 deletions.
17 changes: 4 additions & 13 deletions include/dav1d/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -57,16 +57,6 @@ where
}
}

impl<R, D> DRav1d<Vec<R>, Vec<D>>
where
R: Clone + Into<D>,
{
pub fn push(&mut self, value: R) {
self.rav1d.push(value.clone());
self.dav1d.push(value.into());
}
}

// Constants from Section 3. "Symbols and abbreviated terms"
pub const DAV1D_MAX_CDEF_STRENGTHS: usize = 8;
pub const DAV1D_MAX_OPERATING_POINTS: usize = 32;
Expand Down Expand Up @@ -844,10 +834,11 @@ impl From<Rav1dITUTT35> for Dav1dITUTT35 {

impl Rav1dITUTT35 {
pub fn to_immut(
mutable: Arc<Mutex<DRav1d<Vec<Rav1dITUTT35>, Vec<Dav1dITUTT35>>>>,
mutable: Arc<Mutex<Vec<Rav1dITUTT35>>>,
) -> Arc<DRav1d<Box<[Rav1dITUTT35]>, Box<[Dav1dITUTT35]>>> {
let DRav1d { rav1d, dav1d: _ } = Arc::into_inner(mutable).unwrap().into_inner().unwrap();
let rav1d = rav1d.into_boxed_slice();
let mutable = Arc::into_inner(mutable).unwrap().into_inner().unwrap();
let immutable = mutable.into_boxed_slice();
let rav1d = immutable;
let dav1d = rav1d.iter().cloned().map(Dav1dITUTT35::from).collect();
Arc::new(DRav1d { rav1d, dav1d })
}
Expand Down
3 changes: 1 addition & 2 deletions src/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ use crate::include::dav1d::dav1d::Rav1dEventFlags;
use crate::include::dav1d::dav1d::Rav1dInloopFilterType;
use crate::include::dav1d::headers::DRav1d;
use crate::include::dav1d::headers::Dav1dFrameHeader;
use crate::include::dav1d::headers::Dav1dITUTT35;
use crate::include::dav1d::headers::Dav1dSequenceHeader;
use crate::include::dav1d::headers::Rav1dContentLightLevel;
use crate::include::dav1d::headers::Rav1dFrameHeader;
Expand Down Expand Up @@ -325,7 +324,7 @@ pub struct Rav1dContext {
pub(crate) frame_hdr: Option<Arc<DRav1d<Rav1dFrameHeader, Dav1dFrameHeader>>>, // TODO(kkysen) Previously pooled.
pub(crate) content_light: Option<Arc<Rav1dContentLightLevel>>,
pub(crate) mastering_display: Option<Arc<Rav1dMasteringDisplay>>,
pub(crate) itut_t35: Arc<Mutex<DRav1d<Vec<Rav1dITUTT35>, Vec<Dav1dITUTT35>>>>,
pub(crate) itut_t35: Arc<Mutex<Vec<Rav1dITUTT35>>>,

// decoded output picture queue
pub(crate) in_0: Rav1dData,
Expand Down
2 changes: 1 addition & 1 deletion src/picture.rs
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ pub(crate) unsafe fn rav1d_thread_picture_alloc(
c: &Rav1dContext,
f: &mut Rav1dFrameData,
bpc: c_int,
itut_t35: Arc<Mutex<DRav1d<Vec<Rav1dITUTT35>, Vec<Dav1dITUTT35>>>>,
itut_t35: Arc<Mutex<Vec<Rav1dITUTT35>>>,
) -> Rav1dResult {
let p = &mut f.sr_cur;
let have_frame_mt = c.n_fc > 1;
Expand Down

0 comments on commit 1c24cee

Please sign in to comment.