for _ in 0..self.components {
let mut flags: [bool; 4] = [false; 4];
- for band in 0..self.bands {
- flags[band] = br.read_bool()?;
+ for flag in flags[..self.bands].iter_mut() {
+ *flag = br.read_bool()?;
}
let nvals = br.read(3)? as usize;
let quant = br.read(3)? as usize;
let mut scf: [usize; 32] = [0; 32];
self.subbands = (br.read(5)? as usize) + 1;
let mode0 = br.read_bool()?;
- for i in 0..self.subbands {
- quants[i] = br.read(3)? as usize;
+ for quant in quants[..self.subbands].iter_mut() {
+ *quant = br.read(3)? as usize;
}
for i in 0..self.subbands {
if quants[i] == 0 { continue; }
tmp: [f32; ATRAC3_FRAME_SIZE + 64],
}
-#[allow(clippy::manual_memcpy)]
impl DSP {
fn new() -> Self {
let mut gain_tab: [f32; 16] = [0.0; 16];
let mut gain_tab2: [f32; 32] = [0.0; 32];
- for i in 0..16 {
- gain_tab[i] = 2.0f32.powf(4.0 - (i as f32));
+ for (i, el) in gain_tab.iter_mut().enumerate() {
+ *el = 2.0f32.powf(4.0 - (i as f32));
}
- for i in 0..32 {
- gain_tab2[i] = 2.0f32.powf(((i as f32) - 15.0) * -0.125);
+ for (i, el) in gain_tab2.iter_mut().enumerate() {
+ *el = 2.0f32.powf(((i as f32) - 15.0) * -0.125);
}
let mut tmpw: [f32; 256] = [0.0; 256];
- for i in 0..tmpw.len() {
- tmpw[i] = (((((i as f32) + 0.5) / 256.0 - 0.5) * consts::PI).sin() + 1.0) * 0.5;
+ for (i, el) in tmpw.iter_mut().enumerate() {
+ *el = (((((i as f32) + 0.5) / 256.0 - 0.5) * consts::PI).sin() + 1.0) * 0.5;
}
let mut window: [f32; 512] = [0.0; 512];
fn synth_band(&mut self, src: &[f32]) {
let dst = &mut self.tmp;
self.imdct.imdct(src, dst);
- for i in 0..512 {
- dst[i] *= self.window[i];
+ for (sample, &win) in dst.iter_mut().zip(self.window.iter()) {
+ *sample *= win;
}
}
fn apply_gains(&mut self, dst: &mut [f32], delay: &[f32], gain_data: &mut [GainData; 2], block_no: usize, band: usize) {
}
}
fn qmf_prepare(&mut self, src: &[f32], delay: &[f32], size: usize, swap: bool) {
- for i in 0..46 {
- self.tmp[i] = delay[i];
- }
+ self.tmp[..46].copy_from_slice(&delay[..46]);
let (s0, s1) = if !swap {
(&src[0..], &src[size/2..])
} else {
fn do_qmf(&mut self, dst: &mut [f32], delay: &mut [f32], swap: bool) {
self.qmf_prepare(dst, delay, 512, swap);
self.qmf_synth(dst, 512);
- for i in 0..46 {
- delay[i] = self.tmp[512 + i];
- }
+ delay[..46].copy_from_slice(&self.tmp[512..][..46]);
}
fn do_qmf_out(&mut self, dst: &mut [f32], src: &[f32], delay: &mut [f32]) {
self.qmf_prepare(src, delay, 1024, false);
self.qmf_synth(dst, 1024);
- for i in 0..46 {
- delay[i] = self.tmp[1024 + i];
- }
+ delay[..46].copy_from_slice(&self.tmp[1024..][..46]);
}
}
impl Atrac3Decoder {
fn new() -> Self {
let mut scalefactors: [f32; 64] = [0.0; 64];
- for i in 0..scalefactors.len() {
- scalefactors[i] = 2.0f32.powf(((i as f32) - 15.0) / 3.0);
+ for (i, scf) in scalefactors.iter_mut().enumerate() {
+ *scf = 2.0f32.powf(((i as f32) - 15.0) / 3.0);
}
let mut cb0 = Atrac3CodebookReader { codes: ATRAC3_HUFF_CODES[0], bits: ATRAC3_HUFF_BITS[0] };
let cb_size = (size - 4) / cb_elem;
validate!(size - 4 == cb_size * cb_elem);
validate!(cb_size <= 256);
- for i in 0..cb_size {
- br.read_buf(&mut cb[i][..cb_elem])?;
+ for cb_entry in cb[..cb_size].iter_mut() {
+ br.read_buf(&mut cb_entry[..cb_elem])?;
if !is_yuv {
- cb[i][4] = 0x80;
- cb[i][5] = 0x80;
+ cb_entry[4] = 0x80;
+ cb_entry[5] = 0x80;
} else {
- cb[i][4] ^= 0x80;
- cb[i][5] ^= 0x80;
+ cb_entry[4] ^= 0x80;
+ cb_entry[5] ^= 0x80;
}
}
Ok(())
validate!(br.tell() == end);
Ok(())
}
+ #[allow(clippy::too_many_arguments)]
fn decode_strip(&mut self, src: &[u8], sno: usize, is_intra: bool, is_intra_strip: bool, xoff: usize, yoff: usize, xend: usize, yend: usize, frm: &mut NASimpleVideoFrame<u8>) -> DecoderResult<()> {
let mut mr = MemoryReader::new_read(src);
let mut br = ByteReader::new(&mut mr);
offset
}
+#[allow(clippy::collapsible_else_if)]
impl CinepakEncoder {
fn new() -> Self {
Self {
fn len(&mut self) -> usize { self.bits.len() }
}
-#[allow(dead_code)]
struct LevelCodes {
flags_cb: Option<Codebook<u8>>,
mv_cb: Option<Codebook<u16>>,
}
}
-#[allow(dead_code)]
struct ClearVideoDecoder {
info: NACodecInfoRef,
dc_cb: Codebook<i8>,
}
impl NADecoder for ClearVideoDecoder {
- #[allow(clippy::or_fun_call)]
fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
let mut w = vinfo.get_width();
const ROW_SHIFT: u8 = 8;
const COL_SHIFT: u8 = 14;
-#[allow(clippy::erasing_op)]
fn idct_row(row: &mut [i16]) {
let in0 = ((i32::from(row[0])) << 11) + (1 << (ROW_SHIFT - 1));
let in1 = (i32::from(row[4])) << 11;
}
#[derive(Debug,PartialEq)]
-#[allow(dead_code)]
enum JPEGType {
None,
Baseline,
Differential,
DiffProgressive,
DiffLossless,
- JPEGLS,
+ //JPEGLS,
}
struct JPEGDecoder {
self.depth = 0;
}
- #[allow(clippy::many_single_char_names)]
fn parse_sof(&mut self, br: &mut ByteReader) -> DecoderResult<NABufferType> {
validate!(self.width == 0);
put_block(&blocks[1], &mut frm.data[offs[i] + x * 8 + frm.stride[i] * 8..], frm.stride[i]);
},
0x22 => {
+ #[allow(clippy::needless_range_loop)]
for j in 0..4 {
put_block(&blocks[j], &mut frm.data[offs[i] + x * 16 + (j & 1) * 8 + (j >> 1) * 8 * frm.stride[i]..], frm.stride[i]);
}
#[cfg(feature="decoder_cinepak")]
mod cinepak;
#[cfg(feature="decoder_clearvideo")]
+#[allow(clippy::too_many_arguments)]
mod clearvideo;
#[cfg(feature="decoder_gif")]
mod gif;
#[cfg(feature="decoder_jpeg")]
+#[allow(clippy::manual_range_contains)]
mod jpeg;
#[cfg(feature="decoder_rawvideo")]
mod rawvideo;
mod zmbv;
#[cfg(feature="decoder_atrac3")]
+#[allow(clippy::excessive_precision)]
#[allow(clippy::identity_op)]
-#[allow(clippy::useless_let_if_seq)]
mod atrac3;
#[cfg(any(feature="decoder_pcm",feature="encoder_pcm"))]
mod pcm;
#[cfg(feature="decoder_sipro")]
-#[allow(clippy::collapsible_if)]
-#[allow(clippy::collapsible_else_if)]
+#[allow(clippy::excessive_precision)]
#[allow(clippy::identity_op)]
-#[allow(clippy::manual_memcpy)]
mod sipro;
#[cfg(feature="decoder_ts102366")]
+#[allow(clippy::needless_range_loop)]
mod ts102366;
#[cfg(feature="decoders")]
}
}
-#[allow(unused_macros)]
+#[cfg(feature="encoder_pcm")]
macro_rules! write_buffer {
($abuf: expr, $dvec: expr, $write_be: ident, $write_le: ident, $dtype: tt) => {
let info = $abuf.get_info();
}
}
let mut off = 0;
- for i in 0..ncomp {
+ for (comp_id, &comp_size) in sizes[..ncomp].iter().enumerate() {
for (cno, chr) in vinfo.format.comp_info[..ncomp].iter().enumerate() {
if let Some(chromaton) = chr {
let comp_off = chromaton.comp_offs as usize;
validate!(comp_off < ncomp);
- if comp_off != i {
+ if comp_off != comp_id {
continue;
}
offs[cno] = off;
- off += sizes[i];
+ off += comp_size;
}
}
}
match *sd {
NASideData::Palette(_, ref pal) => {
for (dst, src) in self.pal.chunks_mut(3).zip(pal.chunks(4)) {
- dst[0] = src[0];
- dst[1] = src[1];
- dst[2] = src[2];
+ dst.copy_from_slice(&src[..3]);
}
break;
},
newfilt[i] = 0.88 * filter[i] + 0.12 * self.lsf_hist[i] + SIPRO_MEAN_LSF_16K[i];
}
}
- for i in 0..filter.len() {
- self.lsf_hist[i] = filter[i];
- }
+ self.lsf_hist[..filter.len()].copy_from_slice(&filter);
let mut prev: f32 = 0.0;
- for i in 0..newfilt.len() {
- newfilt[i] = newfilt[i].max(prev + SIPRO_LSF_MIN_DIST/2.0);
- prev = newfilt[i];
- filter[i] = newfilt[i].cos();
+ for (filt, nf) in filter.iter_mut().zip(newfilt.iter_mut()) {
+ *nf = nf.max(prev + SIPRO_LSF_MIN_DIST/2.0);
+ prev = *nf;
+ *filt = nf.cos();
}
- for i in 0..lsp.len() {
- lsp[i] = (filter[i] + self.lsp_hist[i]) * 0.5;
+ for (lsp, (&filter, &lsp_hist)) in lsp.iter_mut()
+ .zip(filter.iter().zip(self.lsp_hist.iter())) {
+ *lsp = (filter + lsp_hist) * 0.5;
}
lsp2lpc_16k(&mut self.sf_filter[0], &lsp);
lsp2lpc_16k(&mut self.sf_filter[1], &filter);
- for i in 0..filter.len() {
- self.lsp_hist[i] = filter[i];
- }
+ self.lsp_hist[..filter.len()].copy_from_slice(&filter);
- for i in 0..16 {
- self.synth[i] = self.synth_hist[i];
- }
+ self.synth[..16].copy_from_slice(&self.synth_hist);
}
fn decode_lsf_lbr(&mut self) {
let mut filter: [f32; 10] = [0.0; 10];
}
let mut prev: f32 = 0.0;
- for i in 0..9 {
- newfilt[i] = newfilt[i].max(prev + SIPRO_LSF_MIN_DIST);
- prev = newfilt[i];
+ for nf in newfilt[..9].iter_mut() {
+ *nf = nf.max(prev + SIPRO_LSF_MIN_DIST);
+ prev = *nf;
}
newfilt[9] = newfilt[9].min(prev + SIPRO_LSF_MIN_DIST_LAST);
- for i in 0..filter.len() {
- self.lsf_hist[i] = filter[i];
- }
+ self.lsf_hist[..filter.len()].copy_from_slice(&filter);
- for i in 0..9 {
- newfilt[i] = newfilt[i].cos();
+ for nf in newfilt[..9].iter_mut() {
+ *nf = nf.cos();
}
newfilt[9] *= 6.153848 / PI;
lsp2lpc_lbr(&mut self.sf_filter[sf], &filter);
interp += 1.0 / (self.mode.subframes as f32);
}
- for i in 0..newfilt.len() {
- self.lsp_hist[i] = newfilt[i];
- }
+ self.lsp_hist[..newfilt.len()].copy_from_slice(&newfilt);
for i in 0..10 {
self.synth[i] = self.synth_hist[i];
}
}
+ #[allow(clippy::collapsible_else_if)]
fn calc_pitch_16k(&mut self, sf: usize) {
let idx = self.pitch_delay[sf];
let pitch_idx = if sf == 0 {
}
self.unpack_pulses_common();
}
- #[allow(clippy::cast_lossless)]
fn unpack_pulses_common(&mut self) {
for i in 0..48 {
self.fix_vec[i] = 0.0;
self.energy_hist[0] = SIPRO_GAIN_DB_CB_16K[self.gc_index[sf]];
let exc = &mut self.excitation[EXCITATION_OFFSET + sf * 80..][..80];
- for i in 0..80 {
- exc[i] = exc[i] * SIPRO_GAIN_PITCH_CB_16K[self.gp_index[sf]] + self.fix_vec[i] * gain;
+ for (exc_val, &fix_vec) in exc.iter_mut().zip(self.fix_vec.iter()) {
+ *exc_val = *exc_val * SIPRO_GAIN_PITCH_CB_16K[self.gp_index[sf]] + fix_vec * gain;
}
}
fn update_gain_lbr(&mut self, sf: usize) {
}
self.avg_energy /= 48.0;
- let mut sum: f32 = -56.30899869919435856603;
- for i in 0..4 {
- sum += self.energy_hist[i] * SIPRO_GAIN_PRED[i];
- }
+ let sum = self.energy_hist.iter().zip(SIPRO_GAIN_PRED.iter())
+ .fold(-56.30899869919435856603f32, |acc, (&a, &b)| acc + a * b);
for i in 0..3 {
self.energy_hist[i] = self.energy_hist[i + 1];
}
let gain = (f64::from(gain1) * (f64::from(sum) * (10.0f64).ln() * 0.05).exp() / f64::from(self.avg_energy).sqrt()) as f32;
let exc = &mut self.excitation[EXCITATION_OFFSET + sf * 48..][..48];
- for i in 0..48 {
- exc[i] = exc[i] * gain0 + self.fix_vec[i] * gain;
+ for (exc_val, &fix_vec) in exc.iter_mut().zip(self.fix_vec.iter()) {
+ *exc_val = *exc_val * gain0 + fix_vec * gain;
}
let pitch_gain = (0.5 * gain0 * gain0).min(0.4);
let gain = gain * self.gain_mem;
- for i in 0..48 {
- self.fix_vec[i] = exc[i] - gain * self.fix_vec[i];
+ for (fix_vec, &exc_val) in self.fix_vec.iter_mut().zip(exc.iter()) {
+ *fix_vec = exc_val - gain * *fix_vec;
}
}
fn synth_subframe_16k(&mut self, sf: usize) {
fn postfilter_16k(&mut self) {
let mut filt: [f32; 16] = [0.0; 16];
- for i in 0..filt.len() {
- filt[i] = self.postfilt_16k_filt_prev[i] * SIPRO_POW_0_5[i];
+ for (filt, (&prev, &pow)) in filt.iter_mut()
+ .zip(self.postfilt_16k_filt_prev.iter().zip(SIPRO_POW_0_5.iter())) {
+ *filt = prev * pow;
}
let mut tmp: [f32; 64] = [0.0; 64];
- for i in 0..16 {
- tmp[i] = self.postfilt_16k_preemph[i];
- }
+ tmp[..16].copy_from_slice(&self.postfilt_16k_preemph[..16]);
synth_filter(&mut tmp, 16, &self.postfilt_16k_filt, &self.synth[16..], 30, 16);
for i in 0..16 {
self.synth[i] = self.postfilt_16k_preemph[i];
}
let mut tmp: [f32; 48 + 10] = [0.0; 48 + 10];
- for i in 0..10 {
- tmp[i] = self.postfilt_5k_mem1[i];
- }
+ tmp[..10].copy_from_slice(&self.postfilt_5k_mem1[..10]);
synth_filter(&mut tmp, 10, &d, &self.fix_vec, 48, 10);
- for i in 0..10 {
- self.postfilt_5k_mem1[i] = tmp[i + 48];
- }
+ self.postfilt_5k_mem1[..10].copy_from_slice(&tmp[48..]);
let tilt = tmp[48 + 10 - 1];
for i in (10+1..48+10).rev() {
tmp[10] -= 0.4 * self.postfilt_5k_tilt;
self.postfilt_5k_tilt = tilt;
- for i in 0..10 {
- tmp[i] = self.postfilt_5k_mem2[i];
- }
- for i in 0..10 {
- self.postfilt_5k_mem2[i] = tmp[i + 48];
- }
+ tmp[..10].copy_from_slice(&self.postfilt_5k_mem2[..10]);
+ self.postfilt_5k_mem2[..10].copy_from_slice(&tmp[48..]);
for i in 0..48 { // almost but not exactly like synth_filter(fix_vec, 0, -n, tmp, 48, 10)
self.fix_vec[i] = tmp[i + 10];
self.excitation[i] = self.excitation[80 * 2 + i];
}
self.postfilter_16k();
- for i in 0..80 * 2 {
- dst[i] = self.postfilt_16k_buf[i];
- }
+ dst[..80 * 2].copy_from_slice(&self.postfilt_16k_buf[..80 * 2]);
}
fn output_lbr(&mut self, dst: &mut [f32]) {
let out_size = self.mode.subframe_len * self.mode.subframes;
for i in 0..EXCITATION_OFFSET {
self.excitation[i] = self.excitation[i + out_size];
}
- for i in 0..out_size {
- let x = 0.939805806 * self.synth[i + 10] + 1.93307352 * self.iir_state[0] - 0.935891986 * self.iir_state[1];
+ for (sample, &synth) in dst[..out_size].iter_mut().zip(self.synth[10..].iter()) {
+ let x = 0.939805806 * synth + 1.93307352 * self.iir_state[0] - 0.935891986 * self.iir_state[1];
let y = x - 1.99997 * self.iir_state[0] + self.iir_state[1];
self.iir_state[1] = self.iir_state[0];
self.iir_state[0] = x;
- dst[i] = y;
+ *sample = y;
}
}
}
if lastbin >= end { break; }
}
}
+ #[allow(clippy::too_many_arguments)]
fn compute_mask(&mut self, mask: &mut [i32; MAX_BANDS], fscod: usize, sgain: u16, fdecay: u8, sdecay: u8,
dbknee: u16, cplfleak: u16, cplsleak: u16, shift: u8) {
let fgain = i32::from(TS102366_FAST_GAIN[self.fgaincod]);
elem_size: 4, be: false, alpha: false, palette: false };
impl NADecoder for ZMBVDecoder {
- #[allow(clippy::or_fun_call)]
fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> {
if let NACodecTypeInfo::Video(vinfo) = info.get_properties() {
self.pparms.width = vinfo.get_width();
}
}
-#[allow(dead_code)]
struct AVIDemuxer<'a> {
src: &'a mut ByteReader<'a>,
cur_frame: Vec<u64>,
false
}
-#[allow(unused_variables)]
-fn parse_hdrl(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
+fn parse_hdrl(_dmx: &mut AVIDemuxer, _strmgr: &mut StreamManager, _size: usize) -> DemuxerResult<usize> {
Ok(0)
}
-#[allow(unused_variables)]
-fn parse_strl(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
+fn parse_strl(_dmx: &mut AVIDemuxer, _strmgr: &mut StreamManager, _size: usize) -> DemuxerResult<usize> {
Ok(0)
}
Ok(0)
}
-#[allow(unused_variables)]
-fn parse_strh(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
+fn parse_strh(dmx: &mut AVIDemuxer, _strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
if size < 0x38 { return Err(InvalidData); }
let tag = dmx.src.read_u32be()?; //stream type
- let fcc = dmx.src.read_u32be()?; //handler(fourcc)
+ let _fcc = dmx.src.read_u32be()?; //handler(fourcc)
dmx.src.read_u32le()?; //flags
dmx.src.read_skip(2)?; //priority
dmx.src.read_skip(2)?; //language
dmx.src.read_skip(4)?; //buf size
dmx.src.read_skip(4)?; //quality
dmx.src.read_skip(4)?; //sample size
- let a = dmx.src.read_u16le()?;
- let b = dmx.src.read_u16le()?;
- let c = dmx.src.read_u16le()?;
- let d = dmx.src.read_u16le()?;
+ let _a = dmx.src.read_u16le()?;
+ let _b = dmx.src.read_u16le()?;
+ let _c = dmx.src.read_u16le()?;
+ let _d = dmx.src.read_u16le()?;
dmx.src.read_skip(size - 0x38)?;
}
}
-#[allow(unused_variables)]
fn parse_strf_vids(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
if size < 40 { return Err(InvalidData); }
let bi_size = dmx.src.read_u32le()?;
let bitcount = dmx.src.read_u16le()?;
let mut compression: [u8; 4] = [0; 4];
dmx.src.read_buf(&mut compression)?;
- let img_size = dmx.src.read_u32le()?;
- let xdpi = dmx.src.read_u32le()?;
- let ydpi = dmx.src.read_u32le()?;
+ let _img_size = dmx.src.read_u32le()?;
+ let _xdpi = dmx.src.read_u32le()?;
+ let _ydpi = dmx.src.read_u32le()?;
let colors = dmx.src.read_u32le()?;
validate!(colors <= 256);
- let imp_colors = dmx.src.read_u32le()?;
+ let _imp_colors = dmx.src.read_u32le()?;
let flip = height < 0;
let format = if bitcount > 8 { RGB24_FORMAT } else { PAL8_FORMAT };
}
}
-#[allow(unused_variables)]
fn parse_strf_auds(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
if size < 16 { return Err(InvalidData); }
let w_format_tag = dmx.src.read_u16le()?;
let channels = dmx.src.read_u16le()?;
let samplespersec = dmx.src.read_u32le()?;
- let avgbytespersec = dmx.src.read_u32le()?;
+ let _avgbytespersec = dmx.src.read_u32le()?;
let block_align = dmx.src.read_u16le()?;
let bits_per_sample = dmx.src.read_u16le()?;
Ok(size)
}
-#[allow(unused_variables)]
-fn parse_avih(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
+fn parse_avih(dmx: &mut AVIDemuxer, _strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
if size < 0x38 { return Err(InvalidData); }
- let timebase = dmx.src.read_u32le()?; //microsec per frame
+ let _timebase = dmx.src.read_u32le()?; //microsec per frame
dmx.src.read_skip(4)?; //max frame size
dmx.src.read_skip(4)?; //padding
dmx.src.read_u32le()?; //flags
- let frames = dmx.src.read_u32le()?; //frames
+ let _frames = dmx.src.read_u32le()?; //frames
dmx.src.read_skip(4)?; //initial frames
let streams = dmx.src.read_u32le()?; //streams
if streams > 100 { return Err(InvalidData); }
dmx.num_streams = streams as u8;
dmx.src.read_skip(4)?; //buf size
- let width = dmx.src.read_u32le()?; //width
- let height = dmx.src.read_u32le()? as i32; //height
+ let _width = dmx.src.read_u32le()?; //width
+ let _height = dmx.src.read_u32le()? as i32; //height
dmx.src.read_skip(16)?; //reserved
dmx.cur_frame.resize(streams as usize, 0);
Ok(size)
}
-#[allow(unused_variables)]
-fn parse_junk(dmx: &mut AVIDemuxer, strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
+fn parse_junk(dmx: &mut AVIDemuxer, _strmgr: &mut StreamManager, size: usize) -> DemuxerResult<usize> {
dmx.src.read_skip(size)?;
Ok(size)
}
-#[allow(clippy::verbose_bit_mask)]
fn parse_idx1(src: &mut ByteReader, strmgr: &mut StreamManager, seek_idx: &mut SeekIndex, size: usize, movi_pos: u64, key_offs: &mut Vec<u64>) -> DemuxerResult<usize> {
validate!((size & 15) == 0);
let mut tag = [0u8; 4];
}
#[cfg(feature="demuxer_avi")]
-#[allow(clippy::cast_lossless)]
mod avi;
#[cfg(feature="demuxer_gif")]
mod gif;
#[cfg(feature="demuxer_mov")]
-#[allow(clippy::cast_lossless)]
mod mov;
#[cfg(feature="demuxer_wav")]
mod wav;
self.bsize
}
}
- #[allow(clippy::collapsible_if)]
- #[allow(clippy::collapsible_else_if)]
fn seek(&mut self, pts: u64, tpoint: NATimePoint) -> DemuxerResult<u64> {
self.cur_sample = pts as usize;
self.samples_left = 0;
}
self.raw_apos = apos;
apos += (cur_samps / self.frame_samples) as u64;
- if apos > exp_pts {
- if cur_samps == self.frame_samples || apos > exp_pts + 1 {
- if self.cur_chunk >= self.chunk_offsets.len() {
- return Err(DemuxerError::SeekError);
- }
- self.last_offset = self.chunk_offsets[self.cur_chunk];
- break;
+ if apos > exp_pts && (cur_samps == self.frame_samples || apos > exp_pts + 1) {
+ if self.cur_chunk >= self.chunk_offsets.len() {
+ return Err(DemuxerError::SeekError);
}
+ self.last_offset = self.chunk_offsets[self.cur_chunk];
+ break;
}
self.cur_chunk += 1;
}
extern crate nihav_registry;
#[cfg(any(feature="decoders", feature="encoders"))]
-#[allow(clippy::needless_range_loop)]
#[allow(clippy::single_match)]
-#[allow(clippy::unreadable_literal)]
-#[allow(clippy::too_many_arguments)]
-#[allow(clippy::excessive_precision)]
#[allow(clippy::upper_case_acronyms)]
-#[allow(clippy::manual_range_contains)]
-#[allow(clippy::collapsible_else_if)]
mod codecs;
#[cfg(feature="decoders")]
}
impl<'a> MuxCore<'a> for AVIMuxer<'a> {
- #[allow(clippy::unreadable_literal)]
- #[allow(clippy::cast_lossless)]
fn create(&mut self, strmgr: &StreamManager) -> MuxerResult<()> {
if strmgr.get_num_streams() == 0 {
return Err(MuxerError::InvalidArgument);