S12: dv factor tables loop over QSTEP and QUANT_SHIFTS directly; crate clippy allow list dropped (clippy -D warnings clean)
Browse files at this commit2363871a3fd5c1c12cedb57b1a4140af1e469a0dParent: c7ea28b2 changed files +5 -6
- crates/ec-dv/src/lib.rs +0 -1
- crates/ec-dv/src/video.rs +5 -5
crates/ec-dv/src/lib.rsmodified+0 -1
| @@ -14,7 +14,6 @@ | |||
| 14 | //! this crate as PCM, and [`DvDemuxer`] publishes it as `PcmS16Le` streams. | 14 | //! this crate as PCM, and [`DvDemuxer`] publishes it as `PcmS16Le` streams. |
| 15 | //! * [`DvDemuxer`], [`is_dv`] -- raw `.dv` / `.dif` files. | 15 | //! * [`DvDemuxer`], [`is_dv`] -- raw `.dv` / `.dif` files. |
| 16 | #![forbid(unsafe_code)] | 16 | #![forbid(unsafe_code)] |
| 17 | -#![allow(clippy::needless_range_loop, clippy::too_many_arguments)] | ||
| 18 | 17 | ||
| 19 | mod audio; | 18 | mod audio; |
| 20 | mod decoder; | 19 | mod decoder; |
crates/ec-dv/src/video.rsmodified+5 -5
| @@ -263,10 +263,10 @@ impl DvVideoDecoder { | |||
| 263 | let mut f1 = Vec::with_capacity(4096); | 263 | let mut f1 = Vec::with_capacity(4096); |
| 264 | let mut f2 = Vec::with_capacity(4096); | 264 | let mut f2 = Vec::with_capacity(4096); |
| 265 | for c in 0..4 { | 265 | for c in 0..4 { |
| 266 | - for s in 0..16 { | 266 | + for q in QSTEP { |
| 267 | for i in 0..64 { | 267 | for i in 0..64 { |
| 268 | - f1.push((QSTEP[s] << (c + 9)).wrapping_mul(u32::from(w1[i]))); | 268 | + f1.push((q << (c + 9)).wrapping_mul(u32::from(w1[i]))); |
| 269 | - f2.push((QSTEP[s] << (c + 9)).wrapping_mul(u32::from(w2[i]))); | 269 | + f2.push((q << (c + 9)).wrapping_mul(u32::from(w2[i]))); |
| 270 | } | 270 | } |
| 271 | } | 271 | } |
| 272 | } | 272 | } |
| @@ -277,11 +277,11 @@ impl DvVideoDecoder { | |||
| 277 | let mut f1 = Vec::with_capacity(2816); | 277 | let mut f1 = Vec::with_capacity(2816); |
| 278 | let mut f2 = Vec::with_capacity(2816); | 278 | let mut f2 = Vec::with_capacity(2816); |
| 279 | for iw in [&IWEIGHT_88, &IWEIGHT_248] { | 279 | for iw in [&IWEIGHT_88, &IWEIGHT_248] { |
| 280 | - for s in 0..22 { | 280 | + for shifts in QUANT_SHIFTS { |
| 281 | let mut i = 0; | 281 | let mut i = 0; |
| 282 | for c in 0..4 { | 282 | for c in 0..4 { |
| 283 | while i < AREAS[c] { | 283 | while i < AREAS[c] { |
| 284 | - let v = u32::from(iw[i]) << (QUANT_SHIFTS[s][c] + 1); | 284 | + let v = u32::from(iw[i]) << (shifts[c] + 1); |
| 285 | f1.push(v); | 285 | f1.push(v); |
| 286 | f2.push(v << 1); | 286 | f2.push(v << 1); |
| 287 | i += 1; | 287 | i += 1; |