Struct Config

struct Config { ... }

Contains the encoder configuration.

Implementations

impl Config

fn new() -> Self

Create a default configuration

same as Default::default()

fn with_encoder_config(self: Self, enc: EncoderConfig) -> Self

Set the encoder configuration

EncoderConfig contains the settings impacting the codec features used in the produced bitstream.

const fn with_threads(self: Self, threads: usize) -> Self

Set the number of workers in the threadpool

The threadpool is shared across all the different parallel components in the encoder.

If it is left unset, the encoder will use the default global threadpool provided by Rayon instead.

const fn with_rate_control(self: Self, rate_control: RateControlConfig) -> Self

Set the rate control configuration

The default configuration is single pass

impl Config

fn new_context<T: Pixel>(self: &Self) -> Result<Context<T>, InvalidConfig>

Creates a Context with this configuration.

Errors

Returns InvalidConfig if the config is invalid.

Examples

use rav1e::prelude::*;

# fn main() -> Result<(), InvalidConfig> {
let cfg = Config::default();
let ctx: Context<u8> = cfg.new_context()?;
# Ok(())
# }
fn validate(self: &Self) -> Result<(), InvalidConfig>

Validates the configuration.

Errors

  • Returns InvalidConfig if the tiling config is invalid.
fn tiling_info(self: &Self) -> Result<TilingInfo, InvalidConfig>

Provide the tiling information for the current Config

Useful for reporting and debugging.

Errors

  • Returns InvalidConfig if the tiling config is invalid.

impl Clone for Config

fn clone(self: &Self) -> Config

impl Debug for Config

fn fmt(self: &Self, f: &mut $crate::fmt::Formatter<'_>) -> $crate::fmt::Result

impl Default for Config

fn default() -> Config

impl Freeze for Config

impl RefUnwindSafe for Config

impl Send for Config

impl Sync for Config

impl Unpin for Config

impl UnwindSafe for Config

impl<T> Any for Config

fn type_id(self: &Self) -> TypeId

impl<T> Borrow for Config

fn borrow(self: &Self) -> &T

impl<T> BorrowMut for Config

fn borrow_mut(self: &mut Self) -> &mut T

impl<T> CloneToUninit for Config

unsafe fn clone_to_uninit(self: &Self, dest: *mut u8)

impl<T> From for Config

fn from(t: T) -> T

Returns the argument unchanged.

impl<T> ToOwned for Config

fn to_owned(self: &Self) -> T
fn clone_into(self: &Self, target: &mut T)

impl<T, U> Into for Config

fn into(self: Self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

impl<T, U> TryFrom for Config

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

impl<T, U> TryInto for Config

fn try_into(self: Self) -> Result<U, <U as TryFrom<T>>::Error>