From 1a151e53b591a45fb7f009e480d7abb5e03f0cfe Mon Sep 17 00:00:00 2001 From: Kostya Shishkov Date: Fri, 19 Oct 2018 17:28:32 +0200 Subject: [PATCH] trailing whitespace fixes --- src/codecs/atrac3.rs | 2 +- src/codecs/blockdsp.rs | 1 - src/codecs/gremlinvideo.rs | 6 +++--- src/codecs/h263/decoder.rs | 2 +- src/codecs/h263/rv10.rs | 2 +- src/codecs/h263/rv20.rs | 4 ++-- src/codecs/indeo/imc.rs | 4 ++-- src/codecs/indeo/indeo4.rs | 1 - src/codecs/indeo/indeo5.rs | 2 +- src/codecs/indeo/ivibr.rs | 2 +- src/codecs/indeo/ividsp.rs | 2 +- src/codecs/real/ra144.rs | 2 +- src/codecs/real/ralf.rs | 2 +- src/codecs/real/rv3040.rs | 2 +- src/codecs/real/rv40dsp.rs | 2 +- src/codecs/sipro.rs | 4 ++-- src/codecs/ts102366.rs | 2 +- src/demuxers/avi.rs | 2 +- src/demuxers/mod.rs | 2 +- src/demuxers/realmedia.rs | 4 ++-- src/dsp/fft.rs | 2 +- src/formats.rs | 2 +- src/frame.rs | 2 +- src/io/codebook.rs | 2 +- 24 files changed, 28 insertions(+), 30 deletions(-) diff --git a/src/codecs/atrac3.rs b/src/codecs/atrac3.rs index ac3964d..2a6b44c 100644 --- a/src/codecs/atrac3.rs +++ b/src/codecs/atrac3.rs @@ -286,7 +286,7 @@ impl DSP { window[i] = w; window[512 - 1 - i] = w; } - + Self { imdct: IMDCT::new(FFTMode::SplitRadix, 512), tmp: [0.0; ATRAC3_FRAME_SIZE + 64], diff --git a/src/codecs/blockdsp.rs b/src/codecs/blockdsp.rs index af2ea13..ab0773e 100644 --- a/src/codecs/blockdsp.rs +++ b/src/codecs/blockdsp.rs @@ -163,7 +163,6 @@ pub fn copy_blocks(dst: &mut NAVideoBuffer, src: &NAVideoBuffer, let bh_ = if comp > 0 { bh/2 } else { bh }; (interp[mode])(&mut dbuf[doff + x + y * dstride..], dstride, ebuf.as_slice(), ebuf_stride, bw_, bh_); } - } else { for comp in 0..3 { let sstride = src.get_stride(comp); diff --git a/src/codecs/gremlinvideo.rs b/src/codecs/gremlinvideo.rs index 24d7a53..f7e19c6 100644 --- a/src/codecs/gremlinvideo.rs +++ b/src/codecs/gremlinvideo.rs @@ -239,7 +239,7 @@ impl GremlinVideoDecoder { let off = -((b >> 2) as isize) - 1; validate!(len <= size); size -= len; - self.lz_copy(idx, off, len)?; + self.lz_copy(idx, off, len)?; idx += len; } } @@ -326,7 +326,7 @@ impl GremlinVideoDecoder { let len = if (b & 0x80) == 0 { 2 } else { 3 }; validate!(len <= size); size -= len; - self.lz_copy(idx, -(off as isize), len)?; + self.lz_copy(idx, -(off as isize), len)?; idx += len; } } else { @@ -361,7 +361,7 @@ impl GremlinVideoDecoder { } validate!(len <= size); size -= len; - self.lz_copy(idx, off, len)?; + self.lz_copy(idx, off, len)?; idx += len; } } diff --git a/src/codecs/h263/decoder.rs b/src/codecs/h263/decoder.rs index d5a6b5b..f871bbd 100644 --- a/src/codecs/h263/decoder.rs +++ b/src/codecs/h263/decoder.rs @@ -81,7 +81,7 @@ impl MVInfo { _ => {}, }; } - + new_mv } fn set_zero_mv(&mut self, mb_x: usize) { diff --git a/src/codecs/h263/rv10.rs b/src/codecs/h263/rv10.rs index ac5b24c..f72c342 100644 --- a/src/codecs/h263/rv10.rs +++ b/src/codecs/h263/rv10.rs @@ -376,7 +376,7 @@ impl RealVideo10Decoder { let luma_dc_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); let mut coderead = CodeReader::new(RV10_CHROMA_DC_CODES, RV10_CHROMA_DC_BITS); let chroma_dc_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); - + let tables = Tables { intra_mcbpc_cb: intra_mcbpc_cb, inter_mcbpc_cb: inter_mcbpc_cb, diff --git a/src/codecs/h263/rv20.rs b/src/codecs/h263/rv20.rs index f512305..9e62875 100644 --- a/src/codecs/h263/rv20.rs +++ b/src/codecs/h263/rv20.rs @@ -310,7 +310,7 @@ impl<'a> BlockDecoder for RealVideo20BR<'a> { if !is_intra { cbpy ^= 0xF; } (cbpy << 2) | (cbpc & 3) } else { 0 }; - + if dquant { let idx = br.read(2)? as usize; q = ((q as i16) + (H263_DQUANT_TAB[idx] as i16)) as u8; @@ -424,7 +424,7 @@ impl RealVideo20Decoder { let aic_rl_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); let mut coderead = H263ShortCodeReader::new(H263_MV); let mv_cb = Codebook::new(&mut coderead, CodebookMode::MSB).unwrap(); - + let tables = Tables { intra_mcbpc_cb: intra_mcbpc_cb, inter_mcbpc_cb: inter_mcbpc_cb, diff --git a/src/codecs/indeo/imc.rs b/src/codecs/indeo/imc.rs index 5ba1575..9a2ba21 100644 --- a/src/codecs/indeo/imc.rs +++ b/src/codecs/indeo/imc.rs @@ -570,7 +570,7 @@ impl IMCDecoder { self.ba.band_width[i] = 0; } } - + for i in 0..BANDS-1 { if self.ba.band_width[i] > 0 { self.ba.band_present[i] = br.read_bool()?; @@ -721,7 +721,7 @@ impl IMCDecoder { ch_data.cw[i] = quant[val - 1] * ch_data.adj_floor[band]; } else { ch_data.cw[i] = -quant[max - val - 1] * ch_data.adj_floor[band]; - } + } } } } diff --git a/src/codecs/indeo/indeo4.rs b/src/codecs/indeo/indeo4.rs index 52caadd..36ec86b 100644 --- a/src/codecs/indeo/indeo4.rs +++ b/src/codecs/indeo/indeo4.rs @@ -201,7 +201,6 @@ impl IndeoXParser for Indeo4Parser { let blk_cb; if br.read_bool()? { - blk_cb = br.read_ivi_codebook_desc(false, true)?; } else { blk_cb = self.blk_cb; diff --git a/src/codecs/indeo/indeo5.rs b/src/codecs/indeo/indeo5.rs index ae9113a..bf3b974 100644 --- a/src/codecs/indeo/indeo5.rs +++ b/src/codecs/indeo/indeo5.rs @@ -260,7 +260,7 @@ impl IndeoXParser for Indeo5Parser { }, _ => { unreachable!(); } }; - + Ok(BandHeader::new(plane_no, band_no, self.mb_size[band_id], self.blk_size[band_id], self.is_hpel[band_id], inherit_mv, has_qdelta, inherit_qd, band_q, rvmap_idx, num_corr, corr_map, blk_cb, tr, txtype)) } diff --git a/src/codecs/indeo/ivibr.rs b/src/codecs/indeo/ivibr.rs index 00c27e7..2e1dd9a 100644 --- a/src/codecs/indeo/ivibr.rs +++ b/src/codecs/indeo/ivibr.rs @@ -163,7 +163,7 @@ fn read_trans_band_header(br: &mut BitReader, w: usize, h: usize, dst: &mut [i16 let g = br.read(8)?; let b = br.read(8)?; } - + br.skip(1)?; let mut cb = IVI_CB_ZERO; diff --git a/src/codecs/indeo/ividsp.rs b/src/codecs/indeo/ividsp.rs index 9145f3e..5bec1eb 100644 --- a/src/codecs/indeo/ividsp.rs +++ b/src/codecs/indeo/ividsp.rs @@ -90,7 +90,7 @@ fn haar8x8_2d(blk: &mut[i32; 64]) { let mut c1 = blk[i + 1*8] << 1; let mut c2 = blk[i + 2*8] << 1; let mut c3 = blk[i + 3*8] << 1; - haar_transform!(c0, c1, c2, c3, + haar_transform!(c0, c1, c2, c3, blk[i + 4*8], blk[i + 5*8], blk[i + 6*8], blk[i + 7*8]); blk[i + 0*8] = c0; blk[i + 1*8] = c1; diff --git a/src/codecs/real/ra144.rs b/src/codecs/real/ra144.rs index e680758..97577d6 100644 --- a/src/codecs/real/ra144.rs +++ b/src/codecs/real/ra144.rs @@ -238,7 +238,7 @@ fn eval_reflection(coeffs: &[i16; LPC_ORDER]) -> Option { } fn clip_out(sample: i16) -> i16 { - sample.max(-16384 >> 2).min(16383 >> 2) + sample.max(-16384 >> 2).min(16383 >> 2) } impl NADecoder for RA144Decoder { diff --git a/src/codecs/real/ralf.rs b/src/codecs/real/ralf.rs index d1286d5..74eefe3 100644 --- a/src/codecs/real/ralf.rs +++ b/src/codecs/real/ralf.rs @@ -342,7 +342,7 @@ impl RALFDecoder { _ => unreachable!(), } self.sample_offset += length; - + Ok(()) } } diff --git a/src/codecs/real/rv3040.rs b/src/codecs/real/rv3040.rs index b2290e7..078de45 100644 --- a/src/codecs/real/rv3040.rs +++ b/src/codecs/real/rv3040.rs @@ -974,7 +974,7 @@ impl RV34Decoder { MBType::MBSkip | MBType::MBDirect => { if let (Some(ref fwdbuf), Some(ref bwdbuf)) = (self.ipbs.get_b_fwdref(), self.ipbs.get_b_bwdref()) { for y in 0..2 { - for x in 0..2 { + for x in 0..2 { let (mv_f, mv_b) = self.ref_mvi.get_mv(mb_x, mb_y, x, y, true).scale(sstate.trd, sstate.trb); do_mc_8x8(&self.dsp, buf, fwdbuf, mb_x, x, mb_y, y, mv_f, false); do_mc_8x8(&self.dsp, &mut self.avg_buf, bwdbuf, mb_x, x, mb_y, y, mv_b, true); diff --git a/src/codecs/real/rv40dsp.rs b/src/codecs/real/rv40dsp.rs index f118d99..4230715 100644 --- a/src/codecs/real/rv40dsp.rs +++ b/src/codecs/real/rv40dsp.rs @@ -219,7 +219,7 @@ impl RV40DSP { pub fn new() -> Self { RV40DSP { luma_mc: [ - [ copy_16, luma_mc_10_16, luma_mc_20_16, luma_mc_30_16, + [ copy_16, luma_mc_10_16, luma_mc_20_16, luma_mc_30_16, luma_mc_01_16, luma_mc_11_16, luma_mc_21_16, luma_mc_31_16, luma_mc_02_16, luma_mc_12_16, luma_mc_22_16, luma_mc_32_16, luma_mc_03_16, luma_mc_13_16, luma_mc_23_16, luma_mc_33_16 ], diff --git a/src/codecs/sipro.rs b/src/codecs/sipro.rs index efee94e..d3511aa 100644 --- a/src/codecs/sipro.rs +++ b/src/codecs/sipro.rs @@ -297,7 +297,7 @@ impl SiproDecoder { sum += self.excitation[estart + j] * SIPRO_SINC_LBR[idx0 as usize]; sum += self.excitation[estart - j - 1] * SIPRO_SINC_LBR[idx1 as usize]; } - self.excitation[EXCITATION_OFFSET + sf * 48 + i] = sum; + self.excitation[EXCITATION_OFFSET + sf * 48 + i] = sum; } } fn unpack_pulses_16k(&mut self, sf: usize) { @@ -409,7 +409,7 @@ impl SiproDecoder { let gain0 = SIPRO_GAIN_CB_LBR[self.gc_index[sf]][0]; let gain1 = SIPRO_GAIN_CB_LBR[self.gc_index[sf]][1]; self.prev_pitch_gain = gain0; - + self.avg_energy = 0.01; for el in self.fix_vec.iter().take(48) { self.avg_energy += *el * *el; diff --git a/src/codecs/ts102366.rs b/src/codecs/ts102366.rs index c6fb42f..3ee68ee 100644 --- a/src/codecs/ts102366.rs +++ b/src/codecs/ts102366.rs @@ -836,7 +836,7 @@ impl AudioBlock { fn read(&mut self, br: &mut BitReader, bsi: &BSI, fscod: usize, blk_no: usize) -> DecoderResult { let channels = bsi.acmod.get_num_channels(); let is_stereo = bsi.acmod == ACMode::Stereo; - + for ch in 0..channels { self.chdata[ch].blksw = br.read_bool()?; } diff --git a/src/demuxers/avi.rs b/src/demuxers/avi.rs index 37bfa3b..fa83557 100644 --- a/src/demuxers/avi.rs +++ b/src/demuxers/avi.rs @@ -105,7 +105,7 @@ impl<'a> DemuxCore<'a> for AVIDemuxer<'a> { let (tb_num, tb_den) = stream.get_timebase(); let ts = NATimeInfo::new(Some(self.cur_frame[stream_no as usize]), None, None, tb_num, tb_den); let pkt = self.src.read_packet(stream, ts, false, size)?; - self.cur_frame[stream_no as usize] += 1; + self.cur_frame[stream_no as usize] += 1; self.movi_size -= size + 8; return Ok(pkt); diff --git a/src/demuxers/mod.rs b/src/demuxers/mod.rs index 3ecc983..9d24e04 100644 --- a/src/demuxers/mod.rs +++ b/src/demuxers/mod.rs @@ -237,6 +237,6 @@ pub fn find_demuxer(name: &str) -> Option<&DemuxerCreator> { pub fn create_demuxer<'a>(dmxcr: &DemuxerCreator, br: &'a mut ByteReader<'a>) -> DemuxerResult> { let mut dmx = dmxcr.new_demuxer(br); let mut str = StreamManager::new(); - dmx.open(&mut str)?; + dmx.open(&mut str)?; Ok(Demuxer::new(dmx, str)) } diff --git a/src/demuxers/realmedia.rs b/src/demuxers/realmedia.rs index 223dbb7..270eddc 100644 --- a/src/demuxers/realmedia.rs +++ b/src/demuxers/realmedia.rs @@ -384,7 +384,7 @@ impl<'a> DemuxCore<'a> for RealMediaDemuxer<'a> { if packet_num == 1 { vstr.start_slice(num_pkts, frame_size as usize, self.slice_buf.as_slice()); } else { - vstr.add_slice(packet_num as usize, self.slice_buf.as_slice()); + vstr.add_slice(packet_num as usize, self.slice_buf.as_slice()); } if (packet_num as usize) < num_pkts { continue; @@ -414,7 +414,7 @@ impl<'a> DemuxCore<'a> for RealMediaDemuxer<'a> { if packet_num == 1 && frame_size == tail_size { vstr.start_slice(num_pkts, frame_size as usize, self.slice_buf.as_slice()); } else { - vstr.add_slice(packet_num as usize, self.slice_buf.as_slice()); + vstr.add_slice(packet_num as usize, self.slice_buf.as_slice()); } while self.src.tell() < pos + (payload_size as u64) { diff --git a/src/dsp/fft.rs b/src/dsp/fft.rs index 7f9b4aa..98f8904 100644 --- a/src/dsp/fft.rs +++ b/src/dsp/fft.rs @@ -130,7 +130,7 @@ impl FFT { } return; } - + let hsize = (1 << (bits - 1)) as usize; self.do_fft_inplace_ct(&mut data[0..hsize], bits - 1, forward); self.do_fft_inplace_ct(&mut data[hsize..], bits - 1, forward); diff --git a/src/formats.rs b/src/formats.rs index 74c9dcd..53b28dc 100644 --- a/src/formats.rs +++ b/src/formats.rs @@ -131,7 +131,7 @@ impl FromStr for NAChannelType { "Lo" => Ok(NAChannelType::Lo), "Ro" => Ok(NAChannelType::Ro), _ => Err(ChannelParseError{}), - } + } } } diff --git a/src/frame.rs b/src/frame.rs index 628efb6..4aaf272 100644 --- a/src/frame.rs +++ b/src/frame.rs @@ -374,7 +374,7 @@ pub fn alloc_audio_buffer(ainfo: NAAudioInfo, nsamples: usize, chmap: NAChannelM let mut data: Vec = Vec::with_capacity(length); data.resize(length, 0); let buf: NAAudioBuffer = NAAudioBuffer { data: Rc::new(RefCell::new(data)), info: ainfo, offs: offs, chmap: chmap, len: nsamples }; - Ok(NABufferType::AudioPacked(buf)) + Ok(NABufferType::AudioPacked(buf)) } } diff --git a/src/io/codebook.rs b/src/io/codebook.rs index c867c27..d67e790 100644 --- a/src/io/codebook.rs +++ b/src/io/codebook.rs @@ -181,7 +181,7 @@ fn build_esc_lut(table: &mut Vec, for (_, sec_bucket) in &escape_list { build_esc_lut(table, mode, sec_bucket)?; } - + Ok(()) } -- 2.39.5