Struct RCState

Source
pub struct RCState {
Show 44 fields target_bitrate: i32, reservoir_frame_delay: i32, reservoir_frame_delay_is_set: bool, maybe_ac_qi_max: Option<u8>, ac_qi_min: u8, drop_frames: bool, cap_overflow: bool, cap_underflow: bool, pass1_log_base_q: i64, twopass_state: i32, log_npixels: i64, bits_per_tu: i64, reservoir_fullness: i64, reservoir_target: i64, reservoir_max: i64, log_scale: [i64; 4], exp: [u8; 4], scalefilter: [IIRBessel2; 4], nframes: [i32; 5], inter_delay: [i32; 3], inter_delay_target: i32, rate_bias: i64, nencoded_frames: i64, nsef_frames: i64, pass1_buffer: [u8; 68], pub pass1_data_retrieved: bool, pass1_summary_retrieved: bool, pass2_data_ready: bool, prev_metrics: RCFrameMetrics, cur_metrics: RCFrameMetrics, frame_metrics: Vec<RCFrameMetrics>, nframe_metrics: usize, frame_metrics_head: usize, des: RCDeserialize, ntus: i32, ntus_total: i32, ntus_left: i32, nframes_total: [i32; 5], nframes_total_total: i32, nframes_left: [i32; 5], scale_sum: [i64; 4], scale_window_ntus: i32, scale_window_nframes: [i32; 5], scale_window_sum: [i64; 4],
}

Fields§

§target_bitrate: i32§reservoir_frame_delay: i32§reservoir_frame_delay_is_set: bool§maybe_ac_qi_max: Option<u8>§ac_qi_min: u8§drop_frames: bool§cap_overflow: bool§cap_underflow: bool§pass1_log_base_q: i64§twopass_state: i32§log_npixels: i64§bits_per_tu: i64§reservoir_fullness: i64§reservoir_target: i64§reservoir_max: i64§log_scale: [i64; 4]§exp: [u8; 4]§scalefilter: [IIRBessel2; 4]§nframes: [i32; 5]§inter_delay: [i32; 3]§inter_delay_target: i32§rate_bias: i64§nencoded_frames: i64§nsef_frames: i64§pass1_buffer: [u8; 68]§pass1_data_retrieved: bool§pass1_summary_retrieved: bool§pass2_data_ready: bool§prev_metrics: RCFrameMetrics§cur_metrics: RCFrameMetrics§frame_metrics: Vec<RCFrameMetrics>§nframe_metrics: usize§frame_metrics_head: usize§des: RCDeserialize§ntus: i32§ntus_total: i32§ntus_left: i32§nframes_total: [i32; 5]§nframes_total_total: i32§nframes_left: [i32; 5]§scale_sum: [i64; 4]§scale_window_ntus: i32§scale_window_nframes: [i32; 5]§scale_window_sum: [i64; 4]

Implementations§

Source§

impl RCState

Source

pub fn new( frame_width: i32, frame_height: i32, framerate_num: i64, framerate_den: i64, target_bitrate: i32, maybe_ac_qi_max: Option<u8>, ac_qi_min: u8, max_key_frame_interval: i32, maybe_reservoir_frame_delay: Option<i32>, ) -> RCState

Source

pub(crate) fn select_first_pass_qi( &self, bit_depth: usize, fti: usize, chroma_sampling: ChromaSampling, ) -> QuantizerParameters

Source

pub(crate) fn select_qi<T: Pixel>( &self, ctx: &ContextInner<T>, output_frameno: u64, fti: usize, maybe_prev_log_base_q: Option<i64>, log_isqrt_mean_scale: i64, ) -> QuantizerParameters

Source

fn calc_flat_quantizer(base_qi: u8, bit_depth: usize, fti: usize) -> (i64, i64)

Source

pub fn update_state( &mut self, bits: i64, fti: usize, show_frame: bool, log_target_q: i64, trial: bool, droppable: bool, ) -> bool

Source

pub const fn needs_trial_encode(&self, fti: usize) -> bool

Source

pub(crate) const fn ready(&self) -> bool

Source

fn buffer_val(&mut self, val: i64, bytes: usize, cur_pos: usize) -> usize

Source

pub(crate) fn select_pass1_log_base_q<T: Pixel>( &self, ctx: &ContextInner<T>, output_frameno: u64, ) -> i64

Source

pub(crate) fn init_first_pass(&mut self, maybe_pass1_log_base_q: Option<i64>)

Source

fn emit_placeholder_summary(&mut self) -> &[u8]

Source

pub(crate) fn emit_frame_data(&mut self) -> Option<&[u8]>

Source

pub(crate) fn emit_summary(&mut self) -> &[u8]

Source

pub(crate) fn twopass_out(&mut self, done_processing: bool) -> Option<&[u8]>

Source

pub(crate) fn init_second_pass(&mut self)

Source

pub(crate) fn setup_second_pass(&mut self, s: &RCSummary)

Source

fn twopass_parse_summary(&mut self, buf: &[u8]) -> Result<usize, String>

Source

pub(crate) fn twopass_first_packet_size(&self) -> usize

Source

pub(crate) fn twopass_in_frames_needed(&self) -> i32

Source

pub(crate) fn parse_frame_data_packet( &mut self, buf: &[u8], ) -> Result<(), String>

Source

fn twopass_parse_frame_data( &mut self, maybe_buf: Option<&[u8]>, consumed: usize, ) -> Result<usize, String>

Source

pub(crate) fn twopass_in( &mut self, maybe_buf: Option<&[u8]>, ) -> Result<usize, String>

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

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

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

Initializes a with the given initializer. Read more
Source§

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

Dereferences the given pointer. Read more
Source§

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

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.