#[non_exhaustive]pub enum EncodeEffort {
Fastest,
Fast,
Balanced,
Thorough,
}Expand description
How much mode search the key-frame encoder spends per macroblock.
The levels trade output size for encode time; all of them emit a
conformant RFC 6386 key frame that this crate’s decoder (and any
other) reconstructs to exactly the picture the encoder predicted
from. Balanced is the default;
Thorough is the search of the option-less entry
points. See the crate README for the measured time / size / quality
of each level.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Fastest
Level 0. Modes are shortlisted by squared prediction error (the
best two of the ten §12.3 sub-block modes, the single best §12.2
luma and chroma mode); the survivors are compared with the cost
model; coefficients are plain-rounded — the §13 trellis is off
regardless of TrellisStrength. B_PRED is not searched for a
macroblock whose best whole-block mode leaves no luma AC residual.
Fast
Level 1. As Fastest but the cost model sees the
best four sub-block modes and all §12.2 luma / chroma modes, and
the winners are trellis-quantised.
Balanced
Level 2 (default). Every candidate mode is compared with the cost
model; only the winners go through the trellis and
reconstruction. About half the time of
Thorough for the same picture quality within
a percent of its size.
Thorough
Level 3. Exhaustive rate-distortion search: every candidate is transformed, trellis-quantised, reconstructed and priced exactly — the search of the option-less entry points.
Implementations§
Source§impl EncodeEffort
impl EncodeEffort
Sourcepub const ALL: [EncodeEffort; 4]
pub const ALL: [EncodeEffort; 4]
All levels, fastest first.
Sourcepub const fn from_level(level: u8) -> Self
pub const fn from_level(level: u8) -> Self
The level for a number: 0, 1, 2, and Thorough
for 3 and anything above.