S12: dnxhd 2-byte samples via as_chunks; crate clippy allow list dropped (clippy -D warnings clean)
Browse files at this commit9eb8b571078937732d5061b017dbebbab0ab2d3fParent: 23638713 changed files +3 -4
- crates/ec-dnxhd/src/decoder.rs +2 -2
- crates/ec-dnxhd/src/idct.rs +1 -1
- crates/ec-dnxhd/src/lib.rs +0 -1
crates/ec-dnxhd/src/decoder.rsmodified+2 -2
| @@ -575,7 +575,7 @@ pub(crate) fn to_picture(c: Canvas) -> Picture { | ||
| 575 | 575 | if c.bps == 1 { |
| 576 | 576 | out.extend(row.iter().map(|&v| u16::from(v))); |
| 577 | 577 | } else { |
| 578 | - out.extend(row.chunks_exact(2).map(|b| u16::from_le_bytes([b[0], b[1]]))); | |
| 578 | + out.extend(row.as_chunks::<2>().0.iter().map(|b| u16::from_le_bytes(*b))); | |
| 579 | 579 | } |
| 580 | 580 | } |
| 581 | 581 | out |
| @@ -596,7 +596,7 @@ pub(crate) fn to_video_frame(mut c: Canvas) -> Result<VideoFrame> { | ||
| 596 | 596 | }; |
| 597 | 597 | if info.bit_depth == 12 { |
| 598 | 598 | for p in &mut c.planes { |
| 599 | - for b in p.chunks_exact_mut(2) { | |
| 599 | + for b in p.as_chunks_mut::<2>().0 { | |
| 600 | 600 | let v = (u32::from(u16::from_le_bytes([b[0], b[1]])) + 2) >> 2; |
| 601 | 601 | b.copy_from_slice(&(v.min(1023) as u16).to_le_bytes()); |
| 602 | 602 | } |
crates/ec-dnxhd/src/idct.rsmodified+1 -1
| @@ -155,7 +155,7 @@ pub(crate) fn idct_put<const BD: u32>(blk: &mut Block, dst: &mut [u8], stride: u | ||
| 155 | 155 | } |
| 156 | 156 | } else { |
| 157 | 157 | for (row, o) in dst.chunks_mut(stride).zip(out.iter()) { |
| 158 | - for (d, &v) in row[..16].chunks_exact_mut(2).zip(o) { | |
| 158 | + for (d, &v) in row[..16].as_chunks_mut::<2>().0.iter_mut().zip(o) { | |
| 159 | 159 | d.copy_from_slice(&v.to_le_bytes()); |
| 160 | 160 | } |
| 161 | 161 | } |
crates/ec-dnxhd/src/lib.rsmodified+0 -1
| @@ -12,7 +12,6 @@ | ||
| 12 | 12 | //! ec-core has no 12-bit pixel formats, so [`DnxhdDecoder::decode`] narrows |
| 13 | 13 | //! 12-bit pictures to 10 bits (`(v + 2) >> 2`, clamped); [`DnxhdDecoder::decode_native`] |
| 14 | 14 | //! returns the samples at their coded depth. |
| 15 | -#![allow(clippy::chunks_exact_to_as_chunks, clippy::needless_range_loop)] | |
| 16 | 15 | #![forbid(unsafe_code)] |
| 17 | 16 | mod bits; |
| 18 | 17 | mod codec; |