X-Git-Url: https://git.nihav.org/?a=blobdiff_plain;f=nihav-commonfmt%2Fsrc%2Fcodecs%2Faac.rs;h=beb0fffe76ded4ee33d0d939c248beb69c123e67;hb=9e78289cc98dddb8f6d6ea4fc4c3655636e31a72;hp=02223c8a969fa0a5aeebb976b346a44ab87a1663;hpb=4f6124ac474e05ab343505444cdbb69b67829e2c;p=nihav.git diff --git a/nihav-commonfmt/src/codecs/aac.rs b/nihav-commonfmt/src/codecs/aac.rs index 02223c8..beb0fff 100644 --- a/nihav-commonfmt/src/codecs/aac.rs +++ b/nihav-commonfmt/src/codecs/aac.rs @@ -1,9 +1,6 @@ -use std::rc::Rc; -use std::cell::RefCell; use nihav_core::formats::*; use nihav_core::frame::*; use nihav_core::codecs::*; -use nihav_core::dsp::fft::FFTMode; use nihav_core::dsp::mdct::IMDCT; use nihav_core::dsp::window::*; use nihav_core::io::bitreader::*; @@ -966,7 +963,7 @@ impl ChannelPair { } fn synth_audio(&mut self, dsp: &mut DSP, abuf: &mut NABufferType, srate_idx: usize) { let mut adata = abuf.get_abuf_f32().unwrap(); - let mut output = adata.get_data_mut(); + let output = adata.get_data_mut().unwrap(); let off0 = abuf.get_offset(self.channel); let off1 = abuf.get_offset(self.channel + 1); self.ics[0].synth_channel(dsp, &mut output[off0..], srate_idx); @@ -1003,8 +1000,8 @@ impl DSP { Self { kbd_long_win, kbd_short_win, sine_long_win, sine_short_win, - imdct_long: IMDCT::new(FFTMode::SplitRadix, 1024 * 2, true), - imdct_short: IMDCT::new(FFTMode::SplitRadix, 128 * 2, true), + imdct_long: IMDCT::new(1024 * 2, true), + imdct_short: IMDCT::new(128 * 2, true), tmp: [0.0; 2048], ew_buf: [0.0; 1152], } } @@ -1107,7 +1104,7 @@ impl DSP { } struct AACDecoder { - info: Rc, + info: NACodecInfoRef, chmap: NAChannelMap, m4ainfo: M4AInfo, pairs: Vec, @@ -1205,7 +1202,7 @@ impl AACDecoder { } impl NADecoder for AACDecoder { - fn init(&mut self, info: Rc) -> DecoderResult<()> { + fn init(&mut self, _supp: &mut NADecoderSupport, info: NACodecInfoRef) -> DecoderResult<()> { if let NACodecTypeInfo::Audio(_) = info.get_properties() { let edata = info.get_extradata().unwrap(); validate!(edata.len() >= 2); @@ -1235,7 +1232,7 @@ impl NADecoder for AACDecoder { Err(DecoderError::InvalidData) } } - fn decode(&mut self, pkt: &NAPacket) -> DecoderResult { + fn decode(&mut self, _supp: &mut NADecoderSupport, pkt: &NAPacket) -> DecoderResult { let info = pkt.get_stream().get_info(); validate!(info.get_properties().is_audio()); let pktbuf = pkt.get_buffer(); @@ -1253,7 +1250,7 @@ impl NADecoder for AACDecoder { let mut frm = NAFrame::new_from_pkt(pkt, self.info.replace_info(NACodecTypeInfo::Audio(ainfo)), abuf); frm.set_keyframe(true); - Ok(Rc::new(RefCell::new(frm))) + Ok(frm.into_ref()) } }