Skip to content

Commit

Permalink
fn rav1d_parse_obus: Replace an array memcmp of `struct Rav1dSequ…
Browse files Browse the repository at this point in the history
…enceHeader::operating_parameter_info` with `!=`.
  • Loading branch information
kkysen committed Dec 6, 2023
1 parent 1504a93 commit 49b5bef
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 8 deletions.
2 changes: 1 addition & 1 deletion include/dav1d/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -588,7 +588,7 @@ pub struct Dav1dSequenceHeaderOperatingParameterInfo {
pub low_delay_mode: c_int,
}

#[derive(Clone, Copy)]
#[derive(Clone, Copy, PartialEq, Eq)]
#[repr(C)]
pub(crate) struct Rav1dSequenceHeaderOperatingParameterInfo {
pub decoder_buffer_delay: c_int,
Expand Down
8 changes: 1 addition & 7 deletions src/obu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ 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::Dav1dSequenceHeaderOperatingParameterInfo;
use crate::include::dav1d::headers::Rav1dAdaptiveBoolean;
use crate::include::dav1d::headers::Rav1dChromaSamplePosition;
use crate::include::dav1d::headers::Rav1dColorPrimaries;
Expand Down Expand Up @@ -1901,12 +1900,7 @@ pub(crate) unsafe fn rav1d_parse_obus(
rav1d_cdf_thread_unref(&mut c.cdf[i as usize]);
}
c.frame_flags |= PICTURE_FLAG_NEW_SEQUENCE;
} else if memcmp(
((*seq_hdr).operating_parameter_info).as_mut_ptr() as *const c_void,
((*c.seq_hdr).operating_parameter_info).as_mut_ptr() as *const c_void,
::core::mem::size_of::<[Dav1dSequenceHeaderOperatingParameterInfo; 32]>(),
) != 0
{
} else if (*seq_hdr).operating_parameter_info != (*c.seq_hdr).operating_parameter_info {
// If operating_parameter_info changed, signal it
c.frame_flags |= PICTURE_FLAG_NEW_OP_PARAMS_INFO;
}
Expand Down

0 comments on commit 49b5bef

Please sign in to comment.