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 => {
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);
Self::default()
}
+ #[allow(clippy::cyclomatic_complexity)]
fn decode_frame_new(&mut self, br: &mut BitReader, buf: &mut NAVideoBuffer<u8>, 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));
}
Ok(())
}
+ #[allow(clippy::transmute_ptr_to_ptr)]
fn output(&mut self, dst: &mut [f32], off0: usize, off1: usize, chno: usize) {
match self.transform {
Transform::DCT(ref mut dct) => {
let mut didx = 0;
let mut sidx = 0;
for _ in 0..self.h {
- for x in 0..self.w { dst[didx + x] = self.frame[sidx + x]; }
+ dst[didx..][..self.w].copy_from_slice(&self.frame[sidx..][..self.w]);
sidx += self.stride;
didx += stride;
if is_scaled {
Err(DecoderError::InvalidData)
}
}
+ #[allow(clippy::manual_memcpy)]
fn decode(&mut self, _supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult<NAFrameRef> {
let info = pkt.get_stream().get_info();
if let NACodecTypeInfo::Audio(_) = info.get_properties() {
const BINK_AUD_FLAG_STEREO: u8 = 0x20;
impl AudioTrack {
- fn new(strmgr: &mut StreamManager, srate: u32, flags: u8, str_id: usize, magic: &[u8; 4]) -> DemuxerResult<Self> {
+ fn new(strmgr: &mut StreamManager, srate: u32, flags: u8, str_id: usize, magic: [u8; 4]) -> DemuxerResult<Self> {
let channels = if (flags & BINK_AUD_FLAG_STEREO) != 0 { 2 } else { 1 };
let codecname = if (flags & BINK_AUD_FLAG_DCT) != 0 {
"bink-audio-dct"
};
let ahdr = NAAudioInfo::new(srate, channels, SND_F32P_FORMAT, 1);
let mut edata: Vec<u8> = Vec::with_capacity(4);
- edata.extend_from_slice(magic);
+ edata.extend_from_slice(&magic);
let ainfo = NACodecInfo::new(codecname, NACodecTypeInfo::Audio(ahdr), Some(edata));
let res = strmgr.add_stream(NAStream::new(StreamType::Audio, (str_id + 1) as u32, ainfo, 1, srate));
validate!(res.is_some());
let srate = src.read_u24le()?;
let flags = src.read_byte()?;
validate!(srate > 0);
- self.ainfo.push(AudioTrack::new(strmgr, srate, flags, i, &magic)?);
+ self.ainfo.push(AudioTrack::new(strmgr, srate, flags, i, magic)?);
}
for _ in 0..num_audio {
let _trk_id = src.read_u32le()?;
}
impl<'a> DemuxCore<'a> for SmackerVideoDemuxer<'a> {
+ #[allow(clippy::unreadable_literal)]
fn open(&mut self, strmgr: &mut StreamManager, _seek_idx: &mut SeekIndex) -> DemuxerResult<()> {
let src = &mut self.src;
let mut magic: [u8; 4] = [0; 4];
Ok(())
}
+ #[allow(clippy::identity_op)]
+ #[allow(clippy::unreadable_literal)]
fn get_frame(&mut self, strmgr: &mut StreamManager) -> DemuxerResult<NAPacket> {
if !self.queued_packets.is_empty() {
let pkt = self.queued_packets.pop().unwrap();