projects
/
nihav.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e243ceb
)
realmedia: fix clippy errors
author
Kostya Shishkov
<kostya.shishkov@gmail.com>
Tue, 14 May 2019 11:46:56 +0000
(13:46 +0200)
committer
Kostya Shishkov
<kostya.shishkov@gmail.com>
Tue, 14 May 2019 11:46:56 +0000
(13:46 +0200)
nihav-realmedia/src/codecs/cook.rs
patch
|
blob
|
blame
|
history
nihav-realmedia/src/codecs/mod.rs
patch
|
blob
|
blame
|
history
nihav-realmedia/src/codecs/ralf.rs
patch
|
blob
|
blame
|
history
nihav-realmedia/src/codecs/rv34dsp.rs
patch
|
blob
|
blame
|
history
nihav-realmedia/src/codecs/rv40dsp.rs
patch
|
blob
|
blame
|
history
nihav-realmedia/src/codecs/rv60.rs
patch
|
blob
|
blame
|
history
diff --git
a/nihav-realmedia/src/codecs/cook.rs
b/nihav-realmedia/src/codecs/cook.rs
index e5dba918d8019d37b927a0ad99ebc9ff1483952e..c7018c33be09e278dec37dab58b81106f01ba82c 100644
(file)
--- a/
nihav-realmedia/src/codecs/cook.rs
+++ b/
nihav-realmedia/src/codecs/cook.rs
@@
-1118,6
+1118,7
@@
const COOK_CPL_BAND: [u8; MAX_SUBBANDS - 1] = [
19, 19, 19
];
19, 19, 19
];
+#[allow(clippy::approx_constant)]
const COOK_DITHER_TAB: [f32; 9] = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107, 1.0 ];
const COOK_QUANT_CENTROID: [[f32; 14]; 7] = [
const COOK_DITHER_TAB: [f32; 9] = [ 0.0, 0.0, 0.0, 0.0, 0.0, 0.176777, 0.25, 0.707107, 1.0 ];
const COOK_QUANT_CENTROID: [[f32; 14]; 7] = [
diff --git
a/nihav-realmedia/src/codecs/mod.rs
b/nihav-realmedia/src/codecs/mod.rs
index 1fe37e03e8b353ea8ac41fa6c2d788dc259a050f..a5cc74cc2f12c42588f29939cf7e14d9139eee04 100644
(file)
--- a/
nihav-realmedia/src/codecs/mod.rs
+++ b/
nihav-realmedia/src/codecs/mod.rs
@@
-7,8
+7,10
@@
macro_rules! validate {
#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
mod rv3040;
#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
mod rv3040;
#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
+#[allow(clippy::erasing_op)]
mod rv34codes;
#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
mod rv34codes;
#[cfg(any(feature="decoder_realvideo3", feature="decoder_realvideo4"))]
+#[allow(clippy::erasing_op)]
mod rv34dsp;
#[cfg(feature="decoder_realvideo1")]
mod rv34dsp;
#[cfg(feature="decoder_realvideo1")]
@@
-18,16
+20,19
@@
pub mod rv20;
#[cfg(feature="decoder_realvideo3")]
pub mod rv30;
#[cfg(feature="decoder_realvideo3")]
#[cfg(feature="decoder_realvideo3")]
pub mod rv30;
#[cfg(feature="decoder_realvideo3")]
+#[allow(clippy::erasing_op)]
pub mod rv30dsp;
#[cfg(feature="decoder_realvideo4")]
pub mod rv40;
#[cfg(feature="decoder_realvideo4")]
pub mod rv30dsp;
#[cfg(feature="decoder_realvideo4")]
pub mod rv40;
#[cfg(feature="decoder_realvideo4")]
+#[allow(clippy::erasing_op)]
pub mod rv40dsp;
#[cfg(feature="decoder_realvideo6")]
pub mod rv60;
#[cfg(feature="decoder_realvideo6")]
pub mod rv60codes;
#[cfg(feature="decoder_realvideo6")]
pub mod rv40dsp;
#[cfg(feature="decoder_realvideo6")]
pub mod rv60;
#[cfg(feature="decoder_realvideo6")]
pub mod rv60codes;
#[cfg(feature="decoder_realvideo6")]
+#[allow(clippy::erasing_op)]
pub mod rv60dsp;
#[cfg(feature="decoder_realaudio144")]
pub mod rv60dsp;
#[cfg(feature="decoder_realaudio144")]
@@
-62,7
+67,7
@@
const RM_CODECS: &[DecoderInfo] = &[
];
pub fn realmedia_register_all_codecs(rd: &mut RegisteredDecoders) {
];
pub fn realmedia_register_all_codecs(rd: &mut RegisteredDecoders) {
- for decoder in RM_CODECS.i
nto_i
ter() {
+ for decoder in RM_CODECS.iter() {
rd.add_decoder(decoder.clone());
}
}
rd.add_decoder(decoder.clone());
}
}
diff --git
a/nihav-realmedia/src/codecs/ralf.rs
b/nihav-realmedia/src/codecs/ralf.rs
index 010c03aad228753f5d3239715e19d1087ba22b1d..6edfd85bcd0f15c92a1b88499bc951d2e77109ff 100644
(file)
--- a/
nihav-realmedia/src/codecs/ralf.rs
+++ b/
nihav-realmedia/src/codecs/ralf.rs
@@
-140,7
+140,7
@@
impl Filter {
}
fn predict(&self, src: &[i32], bits: u8) -> i32 {
let mut acc: i32 = 0;
}
fn predict(&self, src: &[i32], bits: u8) -> i32 {
let mut acc: i32 = 0;
- for (f, s) in src.iter().rev().take(self.length).zip(self.coeffs.i
nto_i
ter()) {
+ for (f, s) in src.iter().rev().take(self.length).zip(self.coeffs.iter()) {
acc += *f * *s;
}
let bias = 1 << (self.bits - 1);
acc += *f * *s;
}
let bias = 1 << (self.bits - 1);
diff --git
a/nihav-realmedia/src/codecs/rv34dsp.rs
b/nihav-realmedia/src/codecs/rv34dsp.rs
index c8c87fb61e06d9a3b85a6950f8a61c811d47be1d..21171c1bec4c4fa2aebb7f7c59f7e063281c29ed 100644
(file)
--- a/
nihav-realmedia/src/codecs/rv34dsp.rs
+++ b/
nihav-realmedia/src/codecs/rv34dsp.rs
@@
-36,6
+36,7
@@
pub struct RV34CommonDSP {
pub ipred16x16: [fn(buf: &mut [u8], idx: usize, stride: usize); 7],
}
pub ipred16x16: [fn(buf: &mut [u8], idx: usize, stride: usize); 7],
}
+#[allow(clippy::erasing_op)]
fn row_transform(src: &[i16], dst: &mut [i32]) {
for i in 0..4 {
let z0 = 13 * ((src[i + 4*0] as i32) + (src[i + 4*2] as i32));
fn row_transform(src: &[i16], dst: &mut [i32]) {
for i in 0..4 {
let z0 = 13 * ((src[i + 4*0] as i32) + (src[i + 4*2] as i32));
@@
-61,6
+62,7
@@
fn mclip8(a: i32) -> u8 {
else { a as u8 }
}
else { a as u8 }
}
+#[allow(clippy::erasing_op)]
impl RV34CommonDSP {
pub fn new() -> Self {
Self {
impl RV34CommonDSP {
pub fn new() -> Self {
Self {
diff --git
a/nihav-realmedia/src/codecs/rv40dsp.rs
b/nihav-realmedia/src/codecs/rv40dsp.rs
index c2841dfc1ec71d2f638e39e371aeec15a04ea27c..66c3e969edf4e9f48ace7178c9bcd9e47892764b 100644
(file)
--- a/
nihav-realmedia/src/codecs/rv40dsp.rs
+++ b/
nihav-realmedia/src/codecs/rv40dsp.rs
@@
-299,6
+299,7
@@
fn rv40_weak_loop_filter4_h(pix: &mut [u8], off: usize, stride: usize,
lim_p0q0: i16, lim_p1: i16, lim_q1: i16) {
rv40_weak_loop_filter4(pix, off, stride, 1, filter_p1, filter_q1, alpha, beta, lim_p0q0, lim_p1, lim_q1);
}
lim_p0q0: i16, lim_p1: i16, lim_q1: i16) {
rv40_weak_loop_filter4(pix, off, stride, 1, filter_p1, filter_q1, alpha, beta, lim_p0q0, lim_p1, lim_q1);
}
+#[allow(clippy::eq_op)]
fn rv40_weak_loop_filter4_v(pix: &mut [u8], off: usize, stride: usize,
filter_p1: bool, filter_q1: bool, alpha: i16, beta: i16,
lim_p0q0: i16, lim_p1: i16, lim_q1: i16) {
fn rv40_weak_loop_filter4_v(pix: &mut [u8], off: usize, stride: usize,
filter_p1: bool, filter_q1: bool, alpha: i16, beta: i16,
lim_p0q0: i16, lim_p1: i16, lim_q1: i16) {
@@
-457,6
+458,7
@@
fn rv40_loop_strength_h(pix: &[u8], off: usize, stride: usize,
rv40_loop_strength(pix, off, stride, 1, beta, beta2, edge)
}
rv40_loop_strength(pix, off, stride, 1, beta, beta2, edge)
}
+#[allow(clippy::eq_op)]
fn rv40_loop_strength_v(pix: &[u8], off: usize, stride: usize,
beta: i16, beta2: i16, edge: bool) -> (bool, bool, bool) {
let src = &pix[off - 3..][..stride * 3 + 3 + 3];
fn rv40_loop_strength_v(pix: &[u8], off: usize, stride: usize,
beta: i16, beta2: i16, edge: bool) -> (bool, bool, bool) {
let src = &pix[off - 3..][..stride * 3 + 3 + 3];
diff --git
a/nihav-realmedia/src/codecs/rv60.rs
b/nihav-realmedia/src/codecs/rv60.rs
index 4b7a2f2178f0dbaa62d6af63026fbfec6d510c39..1d13efdd9e073cce2976b335363da40b7bc87014 100644
(file)
--- a/
nihav-realmedia/src/codecs/rv60.rs
+++ b/
nihav-realmedia/src/codecs/rv60.rs
@@
-21,7
+21,7
@@
impl<A:Copy+Default+PartialEq> UniqueList<A> {
fn add(&mut self, cand: A) {
if self.fill == self.max_size { return; }
let mut unique = true;
fn add(&mut self, cand: A) {
if self.fill == self.max_size { return; }
let mut unique = true;
- for el in self.list.i
nto_i
ter().take(self.fill) {
+ for el in self.list.iter().take(self.fill) {
if *el == cand {
unique = false;
break;
if *el == cand {
unique = false;
break;
@@
-1117,7
+1117,7
@@
println!(" left {} bits", br.left());
}
}
}
}
}
}
- for el in RV60_CANDIDATE_INTRA_ANGLES.i
nto_i
ter() {
+ for el in RV60_CANDIDATE_INTRA_ANGLES.iter() {
ipm_cand.add(*el);
}
// actually decode prediction mode
ipm_cand.add(*el);
}
// actually decode prediction mode
@@
-1129,7
+1129,7
@@
println!(" left {} bits", br.left());
let mut imode = mode;
let mut ipm_cs: [u8; 3] = [ipm_cand.list[0], ipm_cand.list[1], ipm_cand.list[2]];
ipm_cs.sort();
let mut imode = mode;
let mut ipm_cs: [u8; 3] = [ipm_cand.list[0], ipm_cand.list[1], ipm_cand.list[2]];
ipm_cs.sort();
- for ic in ipm_cs.i
nto_i
ter() {
+ for ic in ipm_cs.iter() {
if imode >= *ic {
imode += 1;
}
if imode >= *ic {
imode += 1;
}