Skip to main content

Optimizer

Struct Optimizer 

Source
pub struct Optimizer { /* private fields */ }
Expand description

Main optimization engine.

Integrates RDO, psychovisual analysis, motion optimization, adaptive quantization, ROI encoding, and temporal AQ into a unified pipeline.

Implementations§

Source§

impl Optimizer

Source

pub fn new(config: OptimizerConfig) -> OxiResult<Self>

Creates a new optimizer with the given configuration.

Source

pub fn config(&self) -> &OptimizerConfig

Gets the optimizer configuration.

Source

pub fn rdo_engine(&self) -> &RdoEngine

Gets the RDO engine.

Source

pub fn psycho_analyzer(&self) -> &PsychoAnalyzer

Gets the psychovisual analyzer.

Source

pub fn motion_optimizer(&self) -> &MotionOptimizer

Gets the motion optimizer.

Source

pub fn aq_engine(&self) -> &AqEngine

Gets the adaptive quantization engine.

Source

pub fn aq_engine_mut(&mut self) -> &mut AqEngine

Gets a mutable reference to the adaptive quantization engine.

Source

pub fn roi_encoder(&self) -> Option<&RoiEncoder>

Gets the ROI encoder, if enabled.

Source

pub fn roi_encoder_mut(&mut self) -> Option<&mut RoiEncoder>

Gets a mutable reference to the ROI encoder, if enabled.

Source

pub fn temporal_aq_bridge(&self) -> Option<&TemporalAqBridge>

Gets the temporal AQ bridge, if enabled.

Source

pub fn temporal_aq_bridge_mut(&mut self) -> Option<&mut TemporalAqBridge>

Gets a mutable reference to the temporal AQ bridge, if enabled.

Source

pub fn process_temporal_aq( &mut self, activity: TemporalActivity, spatial_qp_offset: i8, ) -> Option<CombinedAqResult>

Processes a frame’s temporal activity through the temporal AQ bridge and returns the combined AQ result for a given spatial QP offset.

This is the main integration point between temporal and spatial AQ.

Source

pub fn generate_roi_map(&self) -> Option<RoiOptimizeResult>

Generates the ROI QP delta map for the current frame.

Returns None if ROI encoding is not enabled or no regions are set.

Source

pub fn add_roi_region(&mut self, region: RoiRegion) -> bool

Adds an ROI region to the encoder (if enabled).

Returns true if the region was added, false if ROI is not enabled.

Source

pub fn clear_roi_regions(&mut self)

Clears all ROI regions (if ROI is enabled).

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.