From: Kostya Shishkov Date: Tue, 11 Feb 2020 11:53:03 +0000 (+0100) Subject: remove trailing whitespaces X-Git-Url: https://git.nihav.org/?a=commitdiff_plain;h=d24468d9dbd54f5cbe414649ff061699337fa7fe;p=nihav.git remove trailing whitespaces --- diff --git a/nihav-core/src/dsp/dct.rs b/nihav-core/src/dsp/dct.rs index b3415e3..e58ccc7 100644 --- a/nihav-core/src/dsp/dct.rs +++ b/nihav-core/src/dsp/dct.rs @@ -81,7 +81,7 @@ impl DCT { },*/ _ => { tab = Vec::new(); }, }; - + Self { tmp, tab, mode, size, swaps, perms, is_pow2, perm_tab } } fn can_do_fast(&mut self) -> bool { diff --git a/nihav-core/src/dsp/fft.rs b/nihav-core/src/dsp/fft.rs index a626ad9..936a8aa 100644 --- a/nihav-core/src/dsp/fft.rs +++ b/nihav-core/src/dsp/fft.rs @@ -776,7 +776,7 @@ impl RDFT { let t2 = t1 * self.table[n]; buf[n + 1] = crossadd(t0, t2); - buf[self.size - n - 1] = FFTComplex { re: t0.re - t2.re, im: -(t0.im + t2.im) }; + buf[self.size - n - 1] = FFTComplex { re: t0.re - t2.re, im: -(t0.im + t2.im) }; } let a = buf[0].re; let b = buf[0].im; diff --git a/nihav-core/src/register.rs b/nihav-core/src/register.rs index b4441a4..7c1fc1d 100644 --- a/nihav-core/src/register.rs +++ b/nihav-core/src/register.rs @@ -145,9 +145,9 @@ static CODEC_REGISTER: &'static [CodecDescription] = &[ desc!(audio; "atrac3", "Sony Atrac3"), desc!(audio; "sipro", "Sipro Labs ADPCM"), - desc!(video; "truemotion1", "TrueMotion 1"), - desc!(video-im; "truemotionrt", "TrueMotion RT"), - desc!(video; "truemotion2", "TrueMotion 2"), + desc!(video; "truemotion1", "TrueMotion 1"), + desc!(video-im; "truemotionrt", "TrueMotion RT"), + desc!(video; "truemotion2", "TrueMotion 2"), desc!(video; "truemotion2x", "TrueMotion 2X"), desc!(video; "vp3", "VP3"), desc!(video; "vp4", "VP4"), diff --git a/nihav-core/src/scale/mod.rs b/nihav-core/src/scale/mod.rs index ad96da9..2b5f1b7 100644 --- a/nihav-core/src/scale/mod.rs +++ b/nihav-core/src/scale/mod.rs @@ -244,7 +244,7 @@ println!("[adding pack]"); if let Some(ref mut head) = stages { head.drop_last_tmp(); } - + Ok(stages) } diff --git a/nihav-core/src/soundcvt/mod.rs b/nihav-core/src/soundcvt/mod.rs index bc34b23..8d1ebb8 100644 --- a/nihav-core/src/soundcvt/mod.rs +++ b/nihav-core/src/soundcvt/mod.rs @@ -304,7 +304,7 @@ impl SampleWriter for PackedSampleWriter<'_> { } } -pub fn convert_audio_frame(src: &NABufferType, dst_info: &NAAudioInfo, dst_chmap: &NAChannelMap) -> +pub fn convert_audio_frame(src: &NABufferType, dst_info: &NAAudioInfo, dst_chmap: &NAChannelMap) -> Result { let mut nsamples = src.get_audio_length(); if nsamples == 0 { @@ -441,7 +441,7 @@ Result { } } drop(sw); - + Ok(dst_buf) } @@ -490,7 +490,7 @@ pub fn calculate_reorder_matrix(src: &NAChannelMap, dst: &NAChannelMap) -> Vec bool { (chmap.num_channels() == 2) && - (chmap.get_channel(0) == NAChannelType::L) && + (chmap.get_channel(0) == NAChannelType::L) && (chmap.get_channel(1) == NAChannelType::R) } diff --git a/nihav-core/src/test/dec_video.rs b/nihav-core/src/test/dec_video.rs index 9db9a02..9c219a0 100644 --- a/nihav-core/src/test/dec_video.rs +++ b/nihav-core/src/test/dec_video.rs @@ -284,7 +284,7 @@ pub fn test_decode_audio(demuxer: &str, name: &str, limit: Option, audio_pf } } - if let Some(audio_pfx) = audio_pfx { + if let Some(audio_pfx) = audio_pfx { let name = format!("{}/{}out.wav", OUTPUT_PREFIX, audio_pfx); let file = File::create(name).unwrap(); let mut fw = FileWriter::new_write(file); @@ -406,7 +406,7 @@ fn frame_checksum(md5: &mut MD5, frm: NAFrameRef) { }; } -pub fn test_decoding(demuxer: &str, dec_name: &str, filename: &str, limit: Option, +pub fn test_decoding(demuxer: &str, dec_name: &str, filename: &str, limit: Option, dmx_reg: &RegisteredDemuxers, dec_reg: &RegisteredDecoders, test: ExpectedTestResult) { let dmx_f = dmx_reg.find_demuxer(demuxer).unwrap(); diff --git a/nihav-duck/src/codecs/truemotion2.rs b/nihav-duck/src/codecs/truemotion2.rs index 0d937e0..32fb732 100644 --- a/nihav-duck/src/codecs/truemotion2.rs +++ b/nihav-duck/src/codecs/truemotion2.rs @@ -145,7 +145,7 @@ impl TM2Stream { validate!(pos <= endpos); let toskip = endpos - pos; br.read_skip(toskip as usize)?; - + Ok(()) } fn read_deltas(&mut self, src: &[u8]) -> DecoderResult { @@ -164,7 +164,7 @@ impl TM2Stream { self.deltas[i] = val as i32; } } - + Ok(((br.tell() + 31) >> 5) << 2) } fn read_huff_tree(&mut self, src: &[u8], htree: &mut HuffTree) -> DecoderResult { @@ -186,7 +186,7 @@ impl TM2Stream { let mut cr = FullCodebookDescReader::new(codes); htree.cb = Some(Codebook::new(&mut cr, CodebookMode::MSB)?); } - + Ok(((br.tell() + 31) >> 5) << 2) } fn read_tokens(&mut self, src: &[u8], htree: &HuffTree, ntoks: usize) -> DecoderResult { @@ -198,7 +198,7 @@ impl TM2Stream { self.tokens.push(tok); } } - + Ok(((br.tell() + 31) >> 5) << 2) } diff --git a/nihav-duck/src/codecs/truemotion2x.rs b/nihav-duck/src/codecs/truemotion2x.rs index 2232263..8efd66f 100644 --- a/nihav-duck/src/codecs/truemotion2x.rs +++ b/nihav-duck/src/codecs/truemotion2x.rs @@ -227,7 +227,7 @@ impl TM2XDecoder { br.read_skip(len)?; let _smth = br.read_u32be()?; } - + Ok(()) } fn parse_tabs(&mut self) -> DecoderResult<()> { diff --git a/nihav-duck/src/codecs/vp3.rs b/nihav-duck/src/codecs/vp3.rs index 9a67388..8c72f7f 100644 --- a/nihav-duck/src/codecs/vp3.rs +++ b/nihav-duck/src/codecs/vp3.rs @@ -243,7 +243,7 @@ impl BitRunDecoder { self.run = (self.read_run)(br)?; } self.run -= 1; - Ok(self.value) + Ok(self.value) } } @@ -1108,7 +1108,7 @@ impl VP34Decoder { cur_blk += 1; } } - } + } } Ok(()) } else { diff --git a/nihav-duck/src/codecs/vp5.rs b/nihav-duck/src/codecs/vp5.rs index c520b96..f6a649e 100644 --- a/nihav-duck/src/codecs/vp5.rs +++ b/nihav-duck/src/codecs/vp5.rs @@ -32,7 +32,7 @@ impl VP56Parser for VP5BR { validate!((hdr.disp_w <= hdr.mb_w) && (hdr.disp_h <= hdr.mb_h)); hdr.scale = bc.read_bits(2) as u8; } - + Ok(hdr) } fn decode_mv(&self, bc: &mut BoolCoder, model: &VP56MVModel) -> i16 { @@ -192,7 +192,7 @@ impl VP56Parser for VP5BR { if idx > 0 { coeffs[ZIGZAG[idx]] *= fstate.ac_quant; } - + idx += 1; if idx >= 64 { break; diff --git a/nihav-duck/src/codecs/vp7.rs b/nihav-duck/src/codecs/vp7.rs index 3250e1b..543d093 100644 --- a/nihav-duck/src/codecs/vp7.rs +++ b/nihav-duck/src/codecs/vp7.rs @@ -1441,7 +1441,7 @@ mod test { let mut dec_reg = RegisteredDecoders::new(); duck_register_all_codecs(&mut dec_reg); - test_decoding("avi", "vp7", "assets/Duck/interlaced_blit_pitch.avi", Some(12), &dmx_reg, + test_decoding("avi", "vp7", "assets/Duck/interlaced_blit_pitch.avi", Some(12), &dmx_reg, &dec_reg, ExpectedTestResult::MD5Frames(vec![ [0xb79fb6f8, 0xed51ac9e, 0x9e423456, 0xc0918e7f], [0xbf8d1274, 0x83515e15, 0x8c0887de, 0xfbfd05d3], diff --git a/nihav-duck/src/codecs/vp7dsp.rs b/nihav-duck/src/codecs/vp7dsp.rs index 0b141d2..afd035f 100644 --- a/nihav-duck/src/codecs/vp7dsp.rs +++ b/nihav-duck/src/codecs/vp7dsp.rs @@ -58,7 +58,7 @@ impl Default for IPredContext { const DCT_COEFFS: [i32; 16] = [ 23170, 23170, 23170, 23170, 30274, 12540, -12540, -30274, - 23170, -23170, -23170, 23170, + 23170, -23170, -23170, 23170, 12540, -30274, 30274, -12540 ]; diff --git a/nihav-game/src/codecs/bmv.rs b/nihav-game/src/codecs/bmv.rs index 1ff32bb..1f4a660 100644 --- a/nihav-game/src/codecs/bmv.rs +++ b/nihav-game/src/codecs/bmv.rs @@ -142,7 +142,7 @@ impl BMVVideoDecoder { } validate!(val >= 2); let len = (val >> 1) - 1; - + match mode { 1 => bw.copy(len), 2 => for _ in 0..len { bw.put_byte(br.get_byte()); }, diff --git a/nihav-game/src/codecs/midivid.rs b/nihav-game/src/codecs/midivid.rs index 2a04a9e..13c954a 100644 --- a/nihav-game/src/codecs/midivid.rs +++ b/nihav-game/src/codecs/midivid.rs @@ -92,7 +92,7 @@ fn decode_frame(frm: &mut NASimpleVideoFrame, src: &[u8], width: usize, heig idx_br.read_byte()? as usize } else { if bits == 0 { - hi9 = idx9_br.read_byte()?; + hi9 = idx9_br.read_byte()?; bits = 8; } bits -= 1; @@ -112,7 +112,7 @@ fn decode_frame(frm: &mut NASimpleVideoFrame, src: &[u8], width: usize, heig } } } - + Ok(is_intra) } diff --git a/nihav-game/src/demuxers/vmd.rs b/nihav-game/src/demuxers/vmd.rs index d095972..326dd06 100644 --- a/nihav-game/src/demuxers/vmd.rs +++ b/nihav-game/src/demuxers/vmd.rs @@ -45,7 +45,7 @@ impl<'a> DemuxCore<'a> for VMDDemuxer<'a> { let nframes = read_u16le(&header[6..])? as usize; let fpb = read_u16le(&header[18..])? as usize; validate!(nframes > 0 && fpb > 0); - + let mut edata: Vec = Vec::with_capacity(HEADER_SIZE); edata.extend_from_slice(&header); let vhdr = NAVideoInfo::new(width, height, false, PAL8_FORMAT); diff --git a/nihav-rad/src/codecs/bink2.rs b/nihav-rad/src/codecs/bink2.rs index 9375bfa..e1d5b59 100644 --- a/nihav-rad/src/codecs/bink2.rs +++ b/nihav-rad/src/codecs/bink2.rs @@ -973,7 +973,7 @@ struct Bink2Codes { } fn map_ac(idx: usize) -> u8 { idx as u8 } -fn map_mv(idx: usize) -> i8 { BINK2_MV_SYMS[idx] } +fn map_mv(idx: usize) -> i8 { BINK2_MV_SYMS[idx] } impl Default for Bink2Codes { fn default() -> Self { diff --git a/nihav-rad/src/codecs/binkvid.rs b/nihav-rad/src/codecs/binkvid.rs index 545c10e..ac434ad 100644 --- a/nihav-rad/src/codecs/binkvid.rs +++ b/nihav-rad/src/codecs/binkvid.rs @@ -1149,7 +1149,7 @@ fn read_residue(br: &mut BitReader, block: &mut [i32; 64], mut masks_count: usiz } mask >>= 1; } - + Ok(()) } diff --git a/nihav-rad/src/demuxers/bink.rs b/nihav-rad/src/demuxers/bink.rs index 5caa40c..e83f123 100644 --- a/nihav-rad/src/demuxers/bink.rs +++ b/nihav-rad/src/demuxers/bink.rs @@ -114,7 +114,7 @@ impl<'a> DemuxCore<'a> for BinkDemuxer<'a> { seek_idx.seek_info[0].filled = true; self.cur_frame = 0; - + Ok(()) } fn get_frame(&mut self, strmgr: &mut StreamManager) -> DemuxerResult { diff --git a/nihav-rad/src/demuxers/smacker.rs b/nihav-rad/src/demuxers/smacker.rs index 09f1cd7..741756c 100644 --- a/nihav-rad/src/demuxers/smacker.rs +++ b/nihav-rad/src/demuxers/smacker.rs @@ -161,7 +161,7 @@ impl<'a> DemuxCore<'a> for SmackerVideoDemuxer<'a> { self.start = src.tell(); self.cur_frame = 0; self.reset_state(); - + Ok(()) } fn get_frame(&mut self, strmgr: &mut StreamManager) -> DemuxerResult { diff --git a/nihav-realmedia/src/codecs/rv60.rs b/nihav-realmedia/src/codecs/rv60.rs index 827f7e0..14b487d 100644 --- a/nihav-realmedia/src/codecs/rv60.rs +++ b/nihav-realmedia/src/codecs/rv60.rs @@ -253,7 +253,7 @@ enum PUType { const RV60_PU_TYPES: [PUType; 8] = [ PUType::Full, PUType::N2Hor, PUType::N2Ver, PUType::Quarters, - PUType::N4Hor, PUType::N34Hor, PUType::N4Ver, PUType::N34Ver, + PUType::N4Hor, PUType::N34Hor, PUType::N4Ver, PUType::N34Ver, ]; impl PUType { @@ -1283,7 +1283,7 @@ println!(" left {} bits", br.left()); } else { b_mv = ZERO_MV; } - + MVInfo { f_mv: mvi.f_mv + f_mv, b_mv: mvi.b_mv + b_mv, mvref: mvi.mvref } } fn fill_skip_cand(&mut self, hdr: &FrameHeader, skip_cand: &mut UniqueList, size: usize) { diff --git a/nihav-realmedia/src/codecs/rv60dsp.rs b/nihav-realmedia/src/codecs/rv60dsp.rs index 3c88f39..a5ec0c8 100644 --- a/nihav-realmedia/src/codecs/rv60dsp.rs +++ b/nihav-realmedia/src/codecs/rv60dsp.rs @@ -167,7 +167,7 @@ fn filter_luma_edge(dst: &mut [u8], mut offset: usize, step: usize, stride: usiz let str_q = strength!(diff_p1p0[0] + diff_p1p0[1] + diff_p1p0[2] + diff_p1p0[3], lim2); if str_p + str_q > 2 { let msum = ((mode1 + mode2 + str_q + str_p) >> 1) as i16; - let (maxprod, weak) = if (str_q == 1) || (str_p == 1) { (512, true) } else { (384, false) }; + let (maxprod, weak) = if (str_q == 1) || (str_p == 1) { (512, true) } else { (384, false) }; for y in 0..4 { let diff_p0q0 = diff!(dst, offset, offset - step); if (diff_p0q0 != 0) && (lim1 * diff_p0q0.abs() < maxprod) { diff --git a/nihav-realmedia/src/demuxers/realmedia.rs b/nihav-realmedia/src/demuxers/realmedia.rs index feeb390..8f7b101 100644 --- a/nihav-realmedia/src/demuxers/realmedia.rs +++ b/nihav-realmedia/src/demuxers/realmedia.rs @@ -1130,7 +1130,7 @@ impl<'a> RealMediaDemuxer<'a> { let _next_idx = self.src.read_u32be()?; validate!(chunk_size == num_entries * 14 + 10); if num_entries == 0 { return Ok(()); } - + seek_idx.add_stream(str_id); let idx = seek_idx.get_stream_index(str_id).unwrap(); for _ in 0..num_entries {