Skip to content

Commit

Permalink
Fix clippy lints
Browse files Browse the repository at this point in the history
  • Loading branch information
lu-zero committed May 21, 2024
1 parent c7c72b5 commit 1c4fcd8
Show file tree
Hide file tree
Showing 9 changed files with 31 additions and 31 deletions.
8 changes: 4 additions & 4 deletions src/api/color.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,19 +171,19 @@ pub enum MatrixCoefficients {
BT601,
/// SMPTE 240 M
SMPTE240,
/// YCgCo
/// `YCgCo`
YCgCo,
/// BT.2020 non-constant luminance, BT.2100 YCbCr
/// BT.2020 non-constant luminance, BT.2100 `YCbCr`
BT2020NCL,
/// BT.2020 constant luminance
BT2020CL,
/// SMPTE ST 2085 YDzDx
/// SMPTE ST 2085 `YDzDx`
SMPTE2085,
/// Chromaticity-derived non-constant luminance
ChromatNCL,
/// Chromaticity-derived constant luminance
ChromatCL,
/// BT.2020 ICtCp
/// BT.2020 `ICtCp`
ICtCp,
}

Expand Down
10 changes: 5 additions & 5 deletions src/api/internal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ pub struct InterConfig {
group_output_len: u64,
/// Interval between consecutive S-frames.
/// Keyframes reset this interval.
/// This MUST be a multiple of group_input_len.
/// This MUST be a multiple of `group_input_len`.
pub(crate) switch_frame_interval: u64,
}

Expand Down Expand Up @@ -229,12 +229,12 @@ pub(crate) struct ContextInner<T: Pixel> {
pub(crate) output_frameno: u64,
pub(super) inter_cfg: InterConfig,
pub(super) frames_processed: u64,
/// Maps *input_frameno* to frames
/// Maps *`input_frameno`* to frames
pub(super) frame_q: FrameQueue<T>,
/// Maps *output_frameno* to frame data
/// Maps *`output_frameno`* to frame data
pub(super) frame_data: FrameDataQueue<T>,
/// A list of the input_frameno for keyframes in this encode.
/// Needed so that we don't need to keep all of the frame_invariants in
/// A list of the `input_frameno` for keyframes in this encode.
/// Needed so that we don't need to keep all of the `frame_invariants` in
/// memory for the whole life of the encode.
// TODO: Is this needed at all?
keyframes: BTreeSet<u64>,
Expand Down
2 changes: 1 addition & 1 deletion src/api/util.rs
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ impl fmt::Display for FrameType {
pub struct T35 {
/// Country code.
pub country_code: u8,
/// Country code extension bytes (if country_code == 0xFF)
/// Country code extension bytes (if `country_code` == 0xFF)
pub country_code_extension_byte: u8,
/// T.35 payload.
pub data: Box<[u8]>,
Expand Down
12 changes: 6 additions & 6 deletions src/asm/aarch64/cdef.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,10 +132,10 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
// rows (that is, src.x, src.y-2). It does _not_ point to
// src.x-2, src.y-2.
(pad)(
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8) as *mut u16,
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8),
src as *const u8,
T::to_asm_stride(src_stride as usize),
left.data.as_ptr() as *const [u8; 2],
left.data.as_ptr(),
top as *const u8,
bottom as *const u8,
8 >> ydec,
Expand All @@ -145,7 +145,7 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
(func)(
dst.data_ptr_mut() as *mut u8,
T::to_asm_stride(dst.plane_cfg.stride),
tmp.data.as_ptr().offset(2 * tmpstride + 8) as *const u16,
tmp.data.as_ptr().offset(2 * tmpstride + 8),
pri_strength,
sec_strength,
dir as i32,
Expand Down Expand Up @@ -187,10 +187,10 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
}

(pad)(
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8) as *mut u16,
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8),
src as *const u16,
T::to_asm_stride(src_stride as usize),
left.data.as_ptr() as *const [u16; 2],
left.data.as_ptr(),
top as *const u16,
bottom as *const u16,
8 >> ydec,
Expand All @@ -200,7 +200,7 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
(func)(
dst.data_ptr_mut() as *mut u16,
T::to_asm_stride(dst.plane_cfg.stride),
tmp.data.as_ptr().offset(2 * tmpstride + 8) as *const u16,
tmp.data.as_ptr().offset(2 * tmpstride + 8),
pri_strength,
sec_strength,
dir as i32,
Expand Down
2 changes: 1 addition & 1 deletion src/bin/stats.rs
Original file line number Diff line number Diff line change
Expand Up @@ -721,7 +721,7 @@ pub struct QualityMetrics {
pub ssim: Option<PlanarMetrics>,
/// Multi-Scale Structural Similarity
pub ms_ssim: Option<PlanarMetrics>,
/// CIEDE 2000 color difference algorithm: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
/// CIEDE 2000 [color difference algorithm](https://en.wikipedia.org/wiki/Color_difference#CIEDE2000)
pub ciede: Option<f64>,
/// Aligned Peak Signal-to-Noise Ratio for Y, U, and V planes
pub apsnr: Option<PlanarMetrics>,
Expand Down
2 changes: 1 addition & 1 deletion src/ec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ pub struct WriterBase<S> {
#[cfg(feature = "desync_finder")]
/// Debug enable flag
debug: bool,
/// Extra offset added to tell() and tell_frac() to approximate costs
/// Extra offset added to `tell()` and `tell_frac()` to approximate costs
/// of actually coding a symbol
fake_bits_frac: u32,
/// Use-specific storage
Expand Down
20 changes: 10 additions & 10 deletions src/encoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -146,21 +146,21 @@ pub struct Sequence {
pub still_picture: bool,
/// Use reduced header for still picture
pub reduced_still_picture_hdr: bool,
/// enables/disables filter_intra
/// enables/disables `filter_intra`
pub enable_filter_intra: bool,
/// enables/disables corner/edge filtering and upsampling
pub enable_intra_edge_filter: bool,
/// enables/disables interintra_compound
/// enables/disables `interintra_compound`
pub enable_interintra_compound: bool,
/// enables/disables masked compound
pub enable_masked_compound: bool,
/// 0 - disable dual interpolation filter
/// 1 - enable vert/horiz filter selection
pub enable_dual_filter: bool,
/// 0 - disable order hint, and related tools
/// jnt_comp, ref_frame_mvs, frame_sign_bias
/// if 0, enable_jnt_comp and
/// enable_ref_frame_mvs must be set zs 0.
/// `jnt_comp`, `ref_frame_mvs`, `frame_sign_bias`
/// if 0, `enable_jnt_comp` and
/// `enable_ref_frame_mvs` must be set zs 0.
pub enable_order_hint: bool,
/// 0 - disable joint compound modes
/// 1 - enable it
Expand Down Expand Up @@ -190,7 +190,7 @@ pub struct Sequence {
pub display_model_info_present_flag: bool,
pub decoder_model_info_present_flag: bool,
pub level_idx: [u8; MAX_NUM_OPERATING_POINTS],
/// seq_tier in the spec. One bit: 0 or 1.
/// `seq_tier` in the spec. One bit: 0 or 1.
pub tier: [usize; MAX_NUM_OPERATING_POINTS],
pub film_grain_params_present: bool,
pub timing_info_present: bool,
Expand Down Expand Up @@ -700,9 +700,9 @@ pub struct CodedFrameData<T: Pixel> {
/// indicating how much future frames depend on the block (for example, via
/// inter-prediction).
pub block_importances: Box<[f32]>,
/// Pre-computed distortion_scale.
/// Pre-computed `distortion_scale`.
pub distortion_scales: Box<[DistortionScale]>,
/// Pre-computed activity_scale.
/// Pre-computed `activity_scale`.
pub activity_scales: Box<[DistortionScale]>,
pub activity_mask: ActivityMask,
/// Combined metric of activity and distortion
Expand Down Expand Up @@ -772,7 +772,7 @@ impl<T: Pixel> CodedFrameData<T> {
for scale in self.distortion_scales.iter_mut() {
*scale *= inv_mean;
}
self.spatiotemporal_scores = self.distortion_scales.clone();
self.spatiotemporal_scores.clone_from(&self.distortion_scales);
inv_mean.blog64() >> 1
}

Expand Down Expand Up @@ -986,7 +986,7 @@ impl<T: Pixel> FrameInvariants<T> {
let show_existing_frame =
inter_cfg.get_show_existing_frame(fi.idx_in_group_output);
if !show_existing_frame {
fi.coded_frame_data = previous_coded_fi.coded_frame_data.clone();
fi.coded_frame_data.clone_from(&previous_coded_fi.coded_frame_data);
}

fi.order_hint =
Expand Down
2 changes: 1 addition & 1 deletion src/rdo.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2003,7 +2003,7 @@ pub fn rdo_partition_decision<T: Pixel, W: Writer>(
if rd < best_rd {
best_rd = rd;
best_partition = partition;
best_pred_modes = child_modes.clone();
best_pred_modes.clone_from(&child_modes);
}
}
cw.rollback(&cw_checkpoint);
Expand Down
4 changes: 2 additions & 2 deletions src/scenechange/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ pub struct SceneChangeDetector<T: Pixel> {
scale_func: Option<ScaleFunction<T>>,
/// Frame buffer for scaled frames
downscaled_frame_buffer: Option<[Plane<T>; 2]>,
/// Buffer for FrameMEStats for cost scenecut
/// Buffer for `FrameMEStats` for cost scenecut
frame_me_stats_buffer: Option<RefMEStats>,
/// Deque offset for current
lookahead_offset: usize,
Expand All @@ -84,7 +84,7 @@ pub struct SceneChangeDetector<T: Pixel> {
/// Calculated intra costs for each input frame.
/// These are cached for reuse later in rav1e.
pub(crate) intra_costs: BTreeMap<u64, Box<[u32]>>,
/// Temporary buffer used by estimate_intra_costs.
/// Temporary buffer used by `estimate_intra_costs`.
pub(crate) temp_plane: Option<Plane<T>>,
}

Expand Down

0 comments on commit 1c4fcd8

Please sign in to comment.