Skip to main content

AacDecoder

Struct AacDecoder 

Source
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: u32

Implementations§

Source§

impl AacDecoder

Source

pub fn new(cfg: AacConfig) -> Result<Self, &'static str>

Source

pub fn config(&self) -> AacConfig

Source

pub fn decode_frame_f32( &mut self, data: &[u8], ) -> Result<Vec<f32>, &'static str>

raw_data_block を 1 つ復号し、-1.0..1.0 の float をチャンネル交互(1024 × チャンネル数)で返す。

Source

pub fn decode_frame(&mut self, data: &[u8]) -> Result<Vec<i16>, &'static str>

decode_frame_f32 の 16 ビット PCM 版。

Source

fn next_rand(&mut self) -> f32

Source

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。

Source

fn spectral_values( &self, r: &mut Bits<'_>, cb: u8, ) -> Result<[i32; 4], &'static str>

1 つの符号語のスペクトル値(コードブック 1〜11、4.6.3)。

Source

fn synthesize(&mut self, ch: usize, c: &ChannelData) -> [f32; 1024]

逆 MDCT・窓掛け・重ね合わせ(4.6.11)。戻り値は 1024 サンプル(±32768 程度のスケール)。

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.