pub struct HevcEncoder { /* private fields */ }Expand description
A from-scratch HEVC encoder (milestone 3: IDR-only, I_PCM).
Implementations§
Source§impl HevcEncoder
impl HevcEncoder
Sourcepub fn new(width: u32, height: u32) -> Self
pub fn new(width: u32, height: u32) -> Self
New color (4:2:0) encoder for a width × height display picture.
Sourcepub fn new_monochrome(width: u32, height: u32) -> Self
pub fn new_monochrome(width: u32, height: u32) -> Self
New monochrome (4:0:0) encoder — the format of a transparent video’s
alpha auxiliary layer. Feed single-plane frames via
encode_gray_frame.
Sourcepub fn config(&self) -> &HevcConfig
pub fn config(&self) -> &HevcConfig
The active configuration (coded size, CTB grid, …).
Sourcepub fn encode_frame(&mut self, frame: &Yuv420Frame) -> Vec<u8> ⓘ
pub fn encode_frame(&mut self, frame: &Yuv420Frame) -> Vec<u8> ⓘ
Encode one 4:2:0 frame, returning its Annex-B access unit. The first call prepends VPS/SPS/PPS; subsequent calls emit the IDR slice only.
Sourcepub fn encode_gray_frame(&mut self, gray: &[u8]) -> Vec<u8> ⓘ
pub fn encode_gray_frame(&mut self, gray: &[u8]) -> Vec<u8> ⓘ
Encode one monochrome frame — a tightly-packed width × height 8-bit
plane (e.g. an alpha channel). Returns the Annex-B access unit.
Auto Trait Implementations§
impl Forget for HevcEncoder
impl Freeze for HevcEncoder
impl Move for HevcEncoder
impl RefUnwindSafe for HevcEncoder
impl Send for HevcEncoder
impl Sync for HevcEncoder
impl Unpin for HevcEncoder
impl UnsafeUnpin for HevcEncoder
impl UnwindSafe for HevcEncoder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more