#[non_exhaustive]pub struct KeyframeEncodeOptions {
pub effort: EncodeEffort,
pub threads: usize,
pub auto_loop_filter: bool,
pub fitted_token_prob_updates: bool,
pub token_prob_fit: bool,
pub search_token_probs: Option<TokenProbUpdates>,
pub sampled_loop_filter: bool,
}Expand description
Controls for one key-frame encode — the options the
encode_keyframe_with_options family takes next to
KeyframeParams.
Default is the recommended still-picture encode: the default
EncodeEffort, serial, the loop filter of the KeyframeParams,
and the §13.4 token probabilities fitted to the picture within the
one search (token_prob_fit).
KeyframeEncodeOptions::exhaustive is the option-less
encode_keyframe, byte for byte.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.effort: EncodeEffortMode-search effort.
threads: usizeThread budget for the encode. 0 and 1 both mean serial (the
default); with n > 1 the macroblock analysis runs as a
macroblock-row wavefront on up to n threads (scoped
std::threads that end with the call). The output bytes are the
same for every budget.
auto_loop_filter: boolMeasure every §9.4 loop-filter level / sharpness candidate on the
reconstruction and keep the best (ignoring
KeyframeParams::loop_filter_level), as
encode_keyframe_auto_loop_filter does.
fitted_token_prob_updates: boolRun the mode search a second time against the token probabilities
fitted to the first search, and keep the smaller stream (roughly
doubles the encode time for a further few tenths of a percent;
encode_keyframe_with_fitted_token_prob_updates
is this with the exhaustive search).
token_prob_fit: boolFit the §13.4 token-probability updates to the token statistics of the search itself and code the tokens against the fitted table (on by default). The search records its token decisions instead of bits, so this costs one walk over the recorded decisions — no second search — and never enlarges the stream: an update ships only where it saves more bits than it costs.
search_token_probs: Option<TokenProbUpdates>§13.4 updates the mode search prices tokens against instead of
the §13.5 defaults — typically the
KeyframeEncoded::token_prob_updates a similar picture (the
previous frame, a neighbouring tile, a first quick encode) came
out with. With token_prob_fit they only
steer the search and the stream carries this picture’s own fit;
without it they are shipped as given.
sampled_loop_filter: boolChoose the §9.4 loop-filter level and sharpness on a sample of
the picture (three to six bands of macroblock rows spread over
its height, searched coarse to fine), ignoring
KeyframeParams::loop_filter_level — most of the gain of
auto_loop_filter for a small fraction
of its time. auto_loop_filter takes precedence when both are
set.
Implementations§
Source§impl KeyframeEncodeOptions
impl KeyframeEncodeOptions
Sourcepub fn new() -> Self
pub fn new() -> Self
The defaults: the default EncodeEffort, serial, token
probabilities fitted in the one search.
Sourcepub fn exhaustive() -> Self
pub fn exhaustive() -> Self
The exhaustive encode of the option-less entry points:
EncodeEffort::Thorough, serial, the §13.5 default token
probabilities — the bytes of
encode_keyframe.
Sourcepub fn with_effort(self, v: EncodeEffort) -> Self
pub fn with_effort(self, v: EncodeEffort) -> Self
Set effort.
Sourcepub fn with_threads(self, v: usize) -> Self
pub fn with_threads(self, v: usize) -> Self
Set threads.
Sourcepub fn with_auto_loop_filter(self, v: bool) -> Self
pub fn with_auto_loop_filter(self, v: bool) -> Self
Set auto_loop_filter.
Sourcepub fn with_fitted_token_prob_updates(self, v: bool) -> Self
pub fn with_fitted_token_prob_updates(self, v: bool) -> Self
Set fitted_token_prob_updates.
Sourcepub fn with_token_prob_fit(self, v: bool) -> Self
pub fn with_token_prob_fit(self, v: bool) -> Self
Set token_prob_fit.
Sourcepub fn with_search_token_probs(self, v: Option<TokenProbUpdates>) -> Self
pub fn with_search_token_probs(self, v: Option<TokenProbUpdates>) -> Self
Set search_token_probs.
Sourcepub fn with_sampled_loop_filter(self, v: bool) -> Self
pub fn with_sampled_loop_filter(self, v: bool) -> Self
Set sampled_loop_filter.