}
#[allow(clippy::erasing_op)]
+#[allow(clippy::identity_op)]
fn idct_col(blk: &mut [i16; 64], off: usize) {
let in0 = ((i32::from(blk[off + 0*8])) << 8) + (1 << (COL_SHIFT - 1));
let in1 = (i32::from(blk[off + 4*8])) << 8;
self.depth = 0;
}
+ #[allow(clippy::many_single_char_names)]
fn parse_sof(&mut self, br: &mut ByteReader) -> DecoderResult<NABufferType> {
validate!(self.width == 0);
}
validate!(off == src.len());
- NABufferType::Video(NAVideoBuffer::from_raw_parts(vinfo.clone(), src.clone(), offs, strides).into_ref())
+ NABufferType::Video(NAVideoBuffer::from_raw_parts(*vinfo, src, offs, strides).into_ref())
} else {
let esize = vinfo.format.elem_size as usize;
let ychr = vinfo.format.get_chromaton(0).unwrap();
let stride = (width * esize + ystep - 1) / ystep;
let offs = vec![0];
let strides = vec![stride];
- NABufferType::VideoPacked(NAVideoBuffer::from_raw_parts(vinfo.clone(), src.clone(), offs, strides).into_ref())
+ NABufferType::VideoPacked(NAVideoBuffer::from_raw_parts(*vinfo, src, offs, strides).into_ref())
};
let mut frm = NAFrame::new_from_pkt(pkt, self.info.clone(), buf);
let sstride = (vinfo.width + 3) & !3;
- let buf = alloc_video_buffer(vinfo.clone(), 0)?;
+ let buf = alloc_video_buffer(*vinfo, 0)?;
let mut frm = buf.get_vbuf().unwrap();
let dstride = frm.get_stride(0);
15 | 16 => {
let sstride = (vinfo.width * 2 + 3) & !3;
- let buf = alloc_video_buffer(vinfo.clone(), 0)?;
+ let buf = alloc_video_buffer(*vinfo, 0)?;
let mut frm = buf.get_vbuf16().unwrap();
let dstride = frm.get_stride(0);
let offs = vec![0; ncomp];
let mut strides = vec![0; ncomp];
strides[0] = sstride;
- NABufferType::VideoPacked(NAVideoBuffer::from_raw_parts(vinfo.clone(), src.clone(), offs, strides).into_ref())
+ NABufferType::VideoPacked(NAVideoBuffer::from_raw_parts(*vinfo, src, offs, strides).into_ref())
},
_ => return Err(DecoderError::NotImplemented),
};
let vhdr = NAVideoInfo::new(self.width, self.height, false, format);
let vci = NACodecTypeInfo::Video(vhdr);
let vinfo = NACodecInfo::new("rawvideo", vci, None);
- if let None = strmgr.add_stream(NAStream::new(StreamType::Video, 0, vinfo, self.fps_num, self.fps_den, 0)) {
+ if strmgr.add_stream(NAStream::new(StreamType::Video, 0, vinfo, self.fps_num, self.fps_den, 0)).is_none() {
return Err(DemuxerError::MemoryError);
}
1 => 192,
2..=5 => 576 << (bsz_id - 2),
6 => {
- validate!(idx + 1 <= buf.len());
+ validate!(idx < buf.len());
u64::from(buf[idx]) + 1
},
7 => {