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
impl RCState
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
pub(crate) fn select_first_pass_qi( &self, bit_depth: usize, fti: usize, chroma_sampling: ChromaSampling, ) -> QuantizerParameters
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
fn calc_flat_quantizer(base_qi: u8, bit_depth: usize, fti: usize) -> (i64, i64)
pub fn update_state( &mut self, bits: i64, fti: usize, show_frame: bool, log_target_q: i64, trial: bool, droppable: bool, ) -> bool
pub const fn needs_trial_encode(&self, fti: usize) -> bool
pub(crate) const fn ready(&self) -> bool
fn buffer_val(&mut self, val: i64, bytes: usize, cur_pos: usize) -> usize
pub(crate) fn select_pass1_log_base_q<T: Pixel>( &self, ctx: &ContextInner<T>, output_frameno: u64, ) -> i64
pub(crate) fn init_first_pass(&mut self, maybe_pass1_log_base_q: Option<i64>)
fn emit_placeholder_summary(&mut self) -> &[u8] ⓘ
pub(crate) fn emit_frame_data(&mut self) -> Option<&[u8]>
pub(crate) fn emit_summary(&mut self) -> &[u8] ⓘ
pub(crate) fn twopass_out(&mut self, done_processing: bool) -> Option<&[u8]>
pub(crate) fn init_second_pass(&mut self)
pub(crate) fn setup_second_pass(&mut self, s: &RCSummary)
fn twopass_parse_summary(&mut self, buf: &[u8]) -> Result<usize, String>
pub(crate) fn twopass_first_packet_size(&self) -> usize
pub(crate) fn twopass_in_frames_needed(&self) -> i32
pub(crate) fn parse_frame_data_packet( &mut self, buf: &[u8], ) -> Result<(), String>
fn twopass_parse_frame_data( &mut self, maybe_buf: Option<&[u8]>, consumed: usize, ) -> Result<usize, String>
pub(crate) fn twopass_in( &mut self, maybe_buf: Option<&[u8]>, ) -> Result<usize, String>
Auto Trait Implementations§
impl Freeze for RCState
impl RefUnwindSafe for RCState
impl Send for RCState
impl Sync for RCState
impl Unpin for RCState
impl UnsafeUnpin for RCState
impl UnwindSafe for RCState
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