Skip to content

Commit 1c4fcd8

Browse files
committed
Fix clippy lints
1 parent c7c72b5 commit 1c4fcd8

File tree

9 files changed

+31
-31
lines changed

9 files changed

+31
-31
lines changed

src/api/color.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -171,19 +171,19 @@ pub enum MatrixCoefficients {
171171
BT601,
172172
/// SMPTE 240 M
173173
SMPTE240,
174-
/// YCgCo
174+
/// `YCgCo`
175175
YCgCo,
176-
/// BT.2020 non-constant luminance, BT.2100 YCbCr
176+
/// BT.2020 non-constant luminance, BT.2100 `YCbCr`
177177
BT2020NCL,
178178
/// BT.2020 constant luminance
179179
BT2020CL,
180-
/// SMPTE ST 2085 YDzDx
180+
/// SMPTE ST 2085 `YDzDx`
181181
SMPTE2085,
182182
/// Chromaticity-derived non-constant luminance
183183
ChromatNCL,
184184
/// Chromaticity-derived constant luminance
185185
ChromatCL,
186-
/// BT.2020 ICtCp
186+
/// BT.2020 `ICtCp`
187187
ICtCp,
188188
}
189189

src/api/internal.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ pub struct InterConfig {
5454
group_output_len: u64,
5555
/// Interval between consecutive S-frames.
5656
/// Keyframes reset this interval.
57-
/// This MUST be a multiple of group_input_len.
57+
/// This MUST be a multiple of `group_input_len`.
5858
pub(crate) switch_frame_interval: u64,
5959
}
6060

@@ -229,12 +229,12 @@ pub(crate) struct ContextInner<T: Pixel> {
229229
pub(crate) output_frameno: u64,
230230
pub(super) inter_cfg: InterConfig,
231231
pub(super) frames_processed: u64,
232-
/// Maps *input_frameno* to frames
232+
/// Maps *`input_frameno`* to frames
233233
pub(super) frame_q: FrameQueue<T>,
234-
/// Maps *output_frameno* to frame data
234+
/// Maps *`output_frameno`* to frame data
235235
pub(super) frame_data: FrameDataQueue<T>,
236-
/// A list of the input_frameno for keyframes in this encode.
237-
/// Needed so that we don't need to keep all of the frame_invariants in
236+
/// A list of the `input_frameno` for keyframes in this encode.
237+
/// Needed so that we don't need to keep all of the `frame_invariants` in
238238
/// memory for the whole life of the encode.
239239
// TODO: Is this needed at all?
240240
keyframes: BTreeSet<u64>,

src/api/util.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ impl fmt::Display for FrameType {
142142
pub struct T35 {
143143
/// Country code.
144144
pub country_code: u8,
145-
/// Country code extension bytes (if country_code == 0xFF)
145+
/// Country code extension bytes (if `country_code` == 0xFF)
146146
pub country_code_extension_byte: u8,
147147
/// T.35 payload.
148148
pub data: Box<[u8]>,

src/asm/aarch64/cdef.rs

+6-6
Original file line numberDiff line numberDiff line change
@@ -132,10 +132,10 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
132132
// rows (that is, src.x, src.y-2). It does _not_ point to
133133
// src.x-2, src.y-2.
134134
(pad)(
135-
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8) as *mut u16,
135+
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8),
136136
src as *const u8,
137137
T::to_asm_stride(src_stride as usize),
138-
left.data.as_ptr() as *const [u8; 2],
138+
left.data.as_ptr(),
139139
top as *const u8,
140140
bottom as *const u8,
141141
8 >> ydec,
@@ -145,7 +145,7 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
145145
(func)(
146146
dst.data_ptr_mut() as *mut u8,
147147
T::to_asm_stride(dst.plane_cfg.stride),
148-
tmp.data.as_ptr().offset(2 * tmpstride + 8) as *const u16,
148+
tmp.data.as_ptr().offset(2 * tmpstride + 8),
149149
pri_strength,
150150
sec_strength,
151151
dir as i32,
@@ -187,10 +187,10 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
187187
}
188188

189189
(pad)(
190-
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8) as *mut u16,
190+
tmp.data.as_mut_ptr().offset(2 * tmpstride + 8),
191191
src as *const u16,
192192
T::to_asm_stride(src_stride as usize),
193-
left.data.as_ptr() as *const [u16; 2],
193+
left.data.as_ptr(),
194194
top as *const u16,
195195
bottom as *const u16,
196196
8 >> ydec,
@@ -200,7 +200,7 @@ pub(crate) unsafe fn cdef_filter_block<T: Pixel>(
200200
(func)(
201201
dst.data_ptr_mut() as *mut u16,
202202
T::to_asm_stride(dst.plane_cfg.stride),
203-
tmp.data.as_ptr().offset(2 * tmpstride + 8) as *const u16,
203+
tmp.data.as_ptr().offset(2 * tmpstride + 8),
204204
pri_strength,
205205
sec_strength,
206206
dir as i32,

src/bin/stats.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -721,7 +721,7 @@ pub struct QualityMetrics {
721721
pub ssim: Option<PlanarMetrics>,
722722
/// Multi-Scale Structural Similarity
723723
pub ms_ssim: Option<PlanarMetrics>,
724-
/// CIEDE 2000 color difference algorithm: https://en.wikipedia.org/wiki/Color_difference#CIEDE2000
724+
/// CIEDE 2000 [color difference algorithm](https://en.wikipedia.org/wiki/Color_difference#CIEDE2000)
725725
pub ciede: Option<f64>,
726726
/// Aligned Peak Signal-to-Noise Ratio for Y, U, and V planes
727727
pub apsnr: Option<PlanarMetrics>,

src/ec.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ pub struct WriterBase<S> {
121121
#[cfg(feature = "desync_finder")]
122122
/// Debug enable flag
123123
debug: bool,
124-
/// Extra offset added to tell() and tell_frac() to approximate costs
124+
/// Extra offset added to `tell()` and `tell_frac()` to approximate costs
125125
/// of actually coding a symbol
126126
fake_bits_frac: u32,
127127
/// Use-specific storage

src/encoder.rs

+10-10
Original file line numberDiff line numberDiff line change
@@ -146,21 +146,21 @@ pub struct Sequence {
146146
pub still_picture: bool,
147147
/// Use reduced header for still picture
148148
pub reduced_still_picture_hdr: bool,
149-
/// enables/disables filter_intra
149+
/// enables/disables `filter_intra`
150150
pub enable_filter_intra: bool,
151151
/// enables/disables corner/edge filtering and upsampling
152152
pub enable_intra_edge_filter: bool,
153-
/// enables/disables interintra_compound
153+
/// enables/disables `interintra_compound`
154154
pub enable_interintra_compound: bool,
155155
/// enables/disables masked compound
156156
pub enable_masked_compound: bool,
157157
/// 0 - disable dual interpolation filter
158158
/// 1 - enable vert/horiz filter selection
159159
pub enable_dual_filter: bool,
160160
/// 0 - disable order hint, and related tools
161-
/// jnt_comp, ref_frame_mvs, frame_sign_bias
162-
/// if 0, enable_jnt_comp and
163-
/// enable_ref_frame_mvs must be set zs 0.
161+
/// `jnt_comp`, `ref_frame_mvs`, `frame_sign_bias`
162+
/// if 0, `enable_jnt_comp` and
163+
/// `enable_ref_frame_mvs` must be set zs 0.
164164
pub enable_order_hint: bool,
165165
/// 0 - disable joint compound modes
166166
/// 1 - enable it
@@ -190,7 +190,7 @@ pub struct Sequence {
190190
pub display_model_info_present_flag: bool,
191191
pub decoder_model_info_present_flag: bool,
192192
pub level_idx: [u8; MAX_NUM_OPERATING_POINTS],
193-
/// seq_tier in the spec. One bit: 0 or 1.
193+
/// `seq_tier` in the spec. One bit: 0 or 1.
194194
pub tier: [usize; MAX_NUM_OPERATING_POINTS],
195195
pub film_grain_params_present: bool,
196196
pub timing_info_present: bool,
@@ -700,9 +700,9 @@ pub struct CodedFrameData<T: Pixel> {
700700
/// indicating how much future frames depend on the block (for example, via
701701
/// inter-prediction).
702702
pub block_importances: Box<[f32]>,
703-
/// Pre-computed distortion_scale.
703+
/// Pre-computed `distortion_scale`.
704704
pub distortion_scales: Box<[DistortionScale]>,
705-
/// Pre-computed activity_scale.
705+
/// Pre-computed `activity_scale`.
706706
pub activity_scales: Box<[DistortionScale]>,
707707
pub activity_mask: ActivityMask,
708708
/// Combined metric of activity and distortion
@@ -772,7 +772,7 @@ impl<T: Pixel> CodedFrameData<T> {
772772
for scale in self.distortion_scales.iter_mut() {
773773
*scale *= inv_mean;
774774
}
775-
self.spatiotemporal_scores = self.distortion_scales.clone();
775+
self.spatiotemporal_scores.clone_from(&self.distortion_scales);
776776
inv_mean.blog64() >> 1
777777
}
778778

@@ -986,7 +986,7 @@ impl<T: Pixel> FrameInvariants<T> {
986986
let show_existing_frame =
987987
inter_cfg.get_show_existing_frame(fi.idx_in_group_output);
988988
if !show_existing_frame {
989-
fi.coded_frame_data = previous_coded_fi.coded_frame_data.clone();
989+
fi.coded_frame_data.clone_from(&previous_coded_fi.coded_frame_data);
990990
}
991991

992992
fi.order_hint =

src/rdo.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2003,7 +2003,7 @@ pub fn rdo_partition_decision<T: Pixel, W: Writer>(
20032003
if rd < best_rd {
20042004
best_rd = rd;
20052005
best_partition = partition;
2006-
best_pred_modes = child_modes.clone();
2006+
best_pred_modes.clone_from(&child_modes);
20072007
}
20082008
}
20092009
cw.rollback(&cw_checkpoint);

src/scenechange/mod.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ pub struct SceneChangeDetector<T: Pixel> {
6565
scale_func: Option<ScaleFunction<T>>,
6666
/// Frame buffer for scaled frames
6767
downscaled_frame_buffer: Option<[Plane<T>; 2]>,
68-
/// Buffer for FrameMEStats for cost scenecut
68+
/// Buffer for `FrameMEStats` for cost scenecut
6969
frame_me_stats_buffer: Option<RefMEStats>,
7070
/// Deque offset for current
7171
lookahead_offset: usize,
@@ -84,7 +84,7 @@ pub struct SceneChangeDetector<T: Pixel> {
8484
/// Calculated intra costs for each input frame.
8585
/// These are cached for reuse later in rav1e.
8686
pub(crate) intra_costs: BTreeMap<u64, Box<[u32]>>,
87-
/// Temporary buffer used by estimate_intra_costs.
87+
/// Temporary buffer used by `estimate_intra_costs`.
8888
pub(crate) temp_plane: Option<Plane<T>>,
8989
}
9090

0 commit comments

Comments
 (0)