pub struct FixedLpc { /* private fields */ }
Expand description
SUBFRAME_FIXED
component.
Implementations§
Source§impl FixedLpc
impl FixedLpc
Sourcepub fn new(
warm_up: &[i32],
residual: Residual,
bits_per_sample: usize,
) -> Result<Self, VerifyError>
pub fn new( warm_up: &[i32], residual: Residual, bits_per_sample: usize, ) -> Result<Self, VerifyError>
Constructs new FixedLpc
.
§Errors
Returns VerifyError
if an argument is invalid.
§Examples
let residual = Residual::new(0, 64, 1, &[8], &[0; 64], &[0; 64])?; // zero
let subframe = FixedLpc::new(&[0xCDi32], residual, 16)?;
let mut sink = ByteSink::new();
subframe.write(&mut sink)?;
assert_eq!(sink.as_slice()[0], 0x12); /* tag */
assert_eq!(sink.as_slice()[1..3], [0x00, 0xCD]); /* warmup */
Sourcepub fn bits_per_sample(&self) -> usize
pub fn bits_per_sample(&self) -> usize
Returns bits-per-sample.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for FixedLpc
impl<'de> Deserialize<'de> for FixedLpc
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Verify for FixedLpc
impl Verify for FixedLpc
Source§fn verify(&self) -> Result<(), VerifyError>
fn verify(&self) -> Result<(), VerifyError>
Verifies there’s no internal data inconsistency. Read more
Source§fn into_verified(self) -> Result<Verified<Self>, (Self, VerifyError)>
fn into_verified(self) -> Result<Verified<Self>, (Self, VerifyError)>
Wraps into
Verified
to indicate that the data is already verified. Read moreSource§unsafe fn assume_verified(self) -> Verified<Self>
unsafe fn assume_verified(self) -> Verified<Self>
Wraps into
Verified
without actual verification. Read moreAuto Trait Implementations§
impl Freeze for FixedLpc
impl RefUnwindSafe for FixedLpc
impl Send for FixedLpc
impl Sync for FixedLpc
impl Unpin for FixedLpc
impl UnwindSafe for FixedLpc
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