Skip to main content

Backend

Struct Backend 

Source
pub struct Backend {
    api: *const x265_api,
    params: *mut x265_param,
    encoder: *mut x265_encoder,
    layout: InputLayout,
    pictures: [[Vec<u64>; 3]; 2],
    aligned: [[usize; 3]; 2],
    current: usize,
}

Fields§

§api: *const x265_api§params: *mut x265_param§encoder: *mut x265_encoder§layout: InputLayout

How the session lays out a source picture, which pictures follow.

§pictures: [[Vec<u64>; 3]; 2]

Two pictures, three planes each, converted into in turn: x265 reads a picture through the encode it is passed to, and the other holds the frame before while it is read. Each plane is 64-byte aligned within its buffer at aligned.

§aligned: [[usize; 3]; 2]§current: usize

Implementations§

Source§

impl Backend

Source

pub const LIBRARY: &'static str = "x265"

Source

pub const FULLCOLOR: bool = true

Source

pub const KEY_ON_REQUEST: bool = true

Source

pub const HOLDS_QUANTIZER: bool = true

Source

pub const REFINES: bool = true

Source

pub const CONSTANT_BLOCKS: bool = true

Source

pub const REFINE_FINER: u32 = 6

Quality index steps finer than the paint-over one x265 codes a refined block at (FrameEncoder::refines). Its ultrafast analysis settles many a still block on its merge candidate before the offset’s quantizer counts, so refining takes 1080p text beside a video less far than its cleanup of the still screen does, and every step finer gains: at 8 Mbit/s from 31.1 dB to 34.2, 35.5, and 36.3 at 0, 3, and 6 steps finer, against 46.4 still; at a constant quality from 37.7 to 40.7, 41.6, and 42.7, against 49.6; the video losing 0.3 dB.

Source

pub fn ten_bit() -> bool

Whether the linked x265 carries a 10-bit encoder beside its 8-bit one, which is a property of how the library was built.

Source

fn set(&self, name: &str, value: &str) -> Result<(), String>

Source

fn rate_options(rate: RateSettings, q: u32) -> Vec<(&'static str, String)>

The rate-control options of rate at quantizer q: a constant rate held to its VBV with the quantizer capped at 51, since the library’s default ceiling admits out-of-spec quantizers that only force skips on a VBV underflow; else a constant rate factor.

Source

pub fn open( width: usize, height: usize, threads: i32, i444: bool, bit_depth: u32, rate: RateSettings, q: u32, ) -> Result<Self, String>

Source

fn plane(&mut self, picture: usize, p: usize) -> (*mut u8, usize)

The first pixel of plane p of picture picture, and the bytes from it to the buffer’s end.

Source

pub fn encode( &mut self, planes: &mut Planes, pixels: &[u8], stride: usize, rgba: bool, full_range: bool, threads: usize, pts: u64, key: bool, held: Option<u32>, offsets: Option<&mut [f32]>, constant: Option<&mut [u8]>, ) -> Result<Option<Coded>, String>

Convert the host frame into the next in-place picture and encode it there. constant marks the 16x16 blocks x265 codes as skips without analysis.

Trait Implementations§

Source§

impl Drop for Backend

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

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
§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

§

impl<T> Downcast for T
where T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
where F: FnOnce(&Self) -> bool,

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
§

impl<T> Pointable for T

§

const ALIGN: usize

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

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.
§

impl<T> WithSubscriber for T

§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more