pub struct AacDecoder {
cfg: AacConfig,
huff_sf: Huff,
huff_spec: Vec<Huff>,
pow43: Vec<f32>,
win_long: [Vec<f32>; 2],
win_short: [Vec<f32>; 2],
imdct_long: Imdct,
imdct_short: Imdct,
ch: Vec<ChannelState>,
rand: u32,
}Expand description
AAC-LC デコーダ。1 フレーム(raw_data_block)ごとに 1024 サンプル × チャンネル数を返す。
Fields§
§cfg: AacConfig§huff_sf: Huff§huff_spec: Vec<Huff>§pow43: Vec<f32>§win_long: [Vec<f32>; 2]窓の前半(立ち上がり): [サイン, KBD]。長窓 1024・短窓 128。
win_short: [Vec<f32>; 2]§imdct_long: Imdct§imdct_short: Imdct§ch: Vec<ChannelState>§rand: u32Implementations§
Source§impl AacDecoder
impl AacDecoder
pub fn new(cfg: AacConfig) -> Result<Self, &'static str>
pub fn config(&self) -> AacConfig
Sourcepub fn decode_frame_f32(
&mut self,
data: &[u8],
) -> Result<Vec<f32>, &'static str>
pub fn decode_frame_f32( &mut self, data: &[u8], ) -> Result<Vec<f32>, &'static str>
raw_data_block を 1 つ復号し、-1.0..1.0 の float をチャンネル交互(1024 × チャンネル数)で返す。
Sourcepub fn decode_frame(&mut self, data: &[u8]) -> Result<Vec<i16>, &'static str>
pub fn decode_frame(&mut self, data: &[u8]) -> Result<Vec<i16>, &'static str>
decode_frame_f32 の 16 ビット PCM 版。
fn next_rand(&mut self) -> f32
Sourcefn decode_ics(
&mut self,
r: &mut Bits<'_>,
common: Option<IcsInfo>,
) -> Result<ChannelData, &'static str>
fn decode_ics( &mut self, r: &mut Bits<'_>, common: Option<IcsInfo>, ) -> Result<ChannelData, &'static str>
individual_channel_stream(4.4.2.7)。common は CPE の共通 ics_info。
Sourcefn spectral_values(
&self,
r: &mut Bits<'_>,
cb: u8,
) -> Result<[i32; 4], &'static str>
fn spectral_values( &self, r: &mut Bits<'_>, cb: u8, ) -> Result<[i32; 4], &'static str>
1 つの符号語のスペクトル値(コードブック 1〜11、4.6.3)。
Sourcefn synthesize(&mut self, ch: usize, c: &ChannelData) -> [f32; 1024]
fn synthesize(&mut self, ch: usize, c: &ChannelData) -> [f32; 1024]
逆 MDCT・窓掛け・重ね合わせ(4.6.11)。戻り値は 1024 サンプル(±32768 程度のスケール)。
Auto Trait Implementations§
impl Freeze for AacDecoder
impl RefUnwindSafe for AacDecoder
impl Send for AacDecoder
impl Sync for AacDecoder
impl Unpin for AacDecoder
impl UnsafeUnpin for AacDecoder
impl UnwindSafe for AacDecoder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more