Skip to content

Commit

Permalink
make frame_size_override a bool
Browse files Browse the repository at this point in the history
  • Loading branch information
folkertdev committed Mar 6, 2024
1 parent abd3d29 commit 8bb2017
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions include/dav1d/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2281,7 +2281,7 @@ pub struct Rav1dFrameHeader {
pub disable_cdf_update: c_int,
pub allow_screen_content_tools: bool,
pub force_integer_mv: bool,
pub frame_size_override: c_int,
pub frame_size_override: bool,
pub primary_ref_frame: c_int,
pub buffer_removal_time_present: c_int,
pub operating_points: [Rav1dFrameHeaderOperatingPoint; RAV1D_MAX_OPERATING_POINTS],
Expand Down Expand Up @@ -2388,7 +2388,7 @@ impl From<Dav1dFrameHeader> for Rav1dFrameHeader {
disable_cdf_update,
allow_screen_content_tools: allow_screen_content_tools != 0,
force_integer_mv: force_integer_mv != 0,
frame_size_override,
frame_size_override: frame_size_override != 0,
primary_ref_frame,
buffer_removal_time_present,
operating_points: operating_points.map(|c| c.into()),
Expand Down Expand Up @@ -2501,7 +2501,7 @@ impl From<Rav1dFrameHeader> for Dav1dFrameHeader {
disable_cdf_update,
allow_screen_content_tools: allow_screen_content_tools.into(),
force_integer_mv: force_integer_mv.into(),
frame_size_override,
frame_size_override: frame_size_override.into(),
primary_ref_frame,
buffer_removal_time_present,
operating_points: operating_points.map(|rust| rust.into()),
Expand Down
10 changes: 5 additions & 5 deletions src/obu.rs
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,7 @@ unsafe fn parse_frame_size(
c: &Rav1dContext,
seqhdr: &Rav1dSequenceHeader,
refidx: Option<&[c_int; RAV1D_REFS_PER_FRAME]>,
frame_size_override: c_int,
frame_size_override: bool,
gb: &mut GetBits,
) -> Rav1dResult<Rav1dFrameSize> {
if let Some(refidx) = refidx {
Expand Down Expand Up @@ -597,7 +597,7 @@ unsafe fn parse_frame_size(

let width1;
let height;
if frame_size_override != 0 {
if frame_size_override {
width1 = gb.get_bits(seqhdr.width_n_bits) as c_int + 1;
height = gb.get_bits(seqhdr.height_n_bits) as c_int + 1;
} else {
Expand Down Expand Up @@ -1808,13 +1808,13 @@ unsafe fn parse_frame_hdr(
frame_id = Default::default();
}

let frame_size_override = (if seqhdr.reduced_still_picture_header != 0 {
let frame_size_override = if seqhdr.reduced_still_picture_header != 0 {
false
} else if frame_type == Rav1dFrameType::Switch {
true
} else {
gb.get_bit()
}) as c_int;
};
debug.post(gb, "frame_size_override_flag");
let frame_offset = if seqhdr.order_hint != 0 {
gb.get_bits(seqhdr.order_hint_n_bits) as c_int
Expand Down Expand Up @@ -1908,7 +1908,7 @@ unsafe fn parse_frame_hdr(
frame_id,
gb,
)?;
let use_ref = error_resilient_mode == 0 && frame_size_override != 0;
let use_ref = error_resilient_mode == 0 && frame_size_override;
size = parse_frame_size(
c,
seqhdr,
Expand Down

0 comments on commit 8bb2017

Please sign in to comment.