X-Git-Url: https://git.nihav.org/?p=nihav.git;a=blobdiff_plain;f=nihav-rad%2Fsrc%2Fcodecs%2Fbink2.rs;h=2b6ca26a6bd12e1ec9886b79b2a489892aca783b;hp=1305878bed5b36a5c2590bc2e586d4667f7fcf26;hb=bf109afe32ce8eb2722ebd830667f9438ba21b54;hpb=4efceb69a4604c623de2ca48c841d06615558365 diff --git a/nihav-rad/src/codecs/bink2.rs b/nihav-rad/src/codecs/bink2.rs index 1305878..2b6ca26 100644 --- a/nihav-rad/src/codecs/bink2.rs +++ b/nihav-rad/src/codecs/bink2.rs @@ -279,7 +279,7 @@ impl Bink2DSP { 0 => { let src = &ppix[poff..]; for (out, row) in dst.chunks_mut(stride).take(16).zip(src.chunks(pstride)) { - for i in 0..16 { out[i] = row[i]; } + out[..16].copy_from_slice(&row[..16]); } }, 1 => { @@ -338,7 +338,7 @@ impl Bink2DSP { if (mx == 0) && (my == 0) { let inpix = &ppix[poff..]; for (out, src) in dst.chunks_mut(stride).take(8).zip(inpix.chunks(pstride)) { - for i in 0..8 { out[i] = src[i]; } + out[..8].copy_from_slice(&src[..8]); } } else if my == 0 { chroma_interp!(dst, stride, 8, u8, &ppix[poff..], pstride, 1, mx, 2); @@ -1027,6 +1027,7 @@ impl Bink2Decoder { Self::default() } + #[allow(clippy::cyclomatic_complexity)] fn decode_frame_new(&mut self, br: &mut BitReader, buf: &mut NAVideoBuffer, is_intra: bool) -> DecoderResult<()> { let (stride_y, stride_u, stride_v, stride_a) = (buf.get_stride(0), buf.get_stride(1), buf.get_stride(2), buf.get_stride(3)); let (mut off_y, mut off_u, mut off_v, mut off_a) = (buf.get_offset(0), buf.get_offset(1), buf.get_offset(2), buf.get_offset(3));