Skip to content

Commit

Permalink
codec/av1: fix clippy warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
Gnurou committed Jun 10, 2024
1 parent 2e29f42 commit eb2d8bd
Showing 1 changed file with 20 additions and 21 deletions.
41 changes: 20 additions & 21 deletions src/codec/av1/synthesizer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -438,12 +438,11 @@ where
{
self.invalid_element_value("BitDepth")?;
}
} else if self.obu.seq_profile <= Profile::Profile2 {
if (cc.high_bitdepth && self.obu.bit_depth != BitDepth::Depth10)
|| (!cc.high_bitdepth && self.obu.bit_depth != BitDepth::Depth8)
{
self.invalid_element_value("BitDepth")?;
}
} else if self.obu.seq_profile <= Profile::Profile2
&& ((cc.high_bitdepth && self.obu.bit_depth != BitDepth::Depth10)
|| (!cc.high_bitdepth && self.obu.bit_depth != BitDepth::Depth8))
{
self.invalid_element_value("BitDepth")?;
}

if matches!(self.obu.seq_profile, Profile::Profile1) {
Expand Down Expand Up @@ -812,14 +811,15 @@ where
self.f(8, self.obu.refresh_frame_flags)?;
}

if !self.obu.frame_is_intra || self.obu.refresh_frame_flags != ALL_FRAMES {
if self.obu.error_resilient_mode && sequence.enable_order_hint {
for i in 0..NUM_REF_FRAMES {
self.f(
sequence.order_hint_bits as usize,
self.obu.ref_order_hint[i],
)?;
}
if (!self.obu.frame_is_intra || self.obu.refresh_frame_flags != ALL_FRAMES)
&& self.obu.error_resilient_mode
&& sequence.enable_order_hint
{
for i in 0..NUM_REF_FRAMES {
self.f(
sequence.order_hint_bits as usize,
self.obu.ref_order_hint[i],
)?;
}
}

Expand Down Expand Up @@ -1054,13 +1054,12 @@ where

self.f(6, self.obu.loop_filter_params.loop_filter_level[0])?;
self.f(6, self.obu.loop_filter_params.loop_filter_level[1])?;
if sequence.num_planes > 1 {
if self.obu.loop_filter_params.loop_filter_level[0] != 0
&& self.obu.loop_filter_params.loop_filter_level[1] != 0
{
self.f(6, self.obu.loop_filter_params.loop_filter_level[2])?;
self.f(6, self.obu.loop_filter_params.loop_filter_level[3])?;
}
if sequence.num_planes > 1
&& self.obu.loop_filter_params.loop_filter_level[0] != 0
&& self.obu.loop_filter_params.loop_filter_level[1] != 0
{
self.f(6, self.obu.loop_filter_params.loop_filter_level[2])?;
self.f(6, self.obu.loop_filter_params.loop_filter_level[3])?;
}

self.f(3, self.obu.loop_filter_params.loop_filter_sharpness)?;
Expand Down

0 comments on commit eb2d8bd

Please sign in to comment.