#[non_exhaustive]pub enum EncodeError {
InvalidDimensions {
width: u32,
height: u32,
},
LoopFilterLevelOutOfRange {
value: u8,
},
SharpnessLevelOutOfRange {
value: u8,
},
InvalidDctPartitionCount {
value: u8,
},
QuantIndexOutOfRange {
value: u8,
},
FirstPartitionTooLarge {
bytes: usize,
},
Token(TokenEncodeError),
Reconstruct(ReconstructError),
ReferenceDimensionsMismatch {
source: (u32, u32),
reference: (u32, u32),
},
UnsupportedInterMode {
mode: InterMode,
},
InvalidCopyBufferSelector {
which: CopyBufferSelector,
value: u8,
},
LoopFilterDeltaOutOfRange {
which: LoopFilterDeltaSlot,
value: i16,
},
}Expand description
Errors surfaced by the encoder.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
InvalidDimensions
Visible width or height is zero or exceeds the 14-bit VP8 field
(width > 0x3FFF or height > 0x3FFF).
LoopFilterLevelOutOfRange
loop_filter_level outside the 6-bit field (> 63).
SharpnessLevelOutOfRange
sharpness_level outside the 3-bit field (> 7).
InvalidDctPartitionCount
nbr_of_dct_partitions is not one of the four legal values
(1 / 2 / 4 / 8) per §9.5.
QuantIndexOutOfRange
y_ac_qi outside the 7-bit field (> 127) per §9.6.
FirstPartitionTooLarge
First-partition payload exceeded the 19-bit field VP8 reserves
for it in §9.1 (> 0x7_FFFF). At the partition sizes Phase 1
emits this is unreachable, but the check sits at the boundary
for future encoder rounds that may push it.
Token(TokenEncodeError)
The §13 token-block encoder rejected a macroblock’s residual
(a coefficient out of the §13.2 alphabet range). Surfaces the
underlying TokenEncodeError.
Reconstruct(ReconstructError)
The §14.2 / §12.3 reconstruction orchestrator (the decoder’s own,
reused to evolve neighbours) rejected the encoder’s per-MB inputs.
Surfaces the underlying crate::reconstruct::ReconstructError.
ReferenceDimensionsMismatch
The reference frame supplied to a P-frame encode does not match
the source frame’s macroblock-aligned dimensions
(mb_cols * 16 × mb_rows * 16). Surfaced by
encode_p_frame_zero_mv.
Fields
reference: (u32, u32)(width, height) of the reference crate::frame::KeyframePlanes.
UnsupportedInterMode
Reserved for inter-mode picker fall-throughs. The Phase-11
encode_p_frame_zero_mv picker now emits all five §16.2
mv_ref_tree leaves (ZEROMV / NEARESTMV / NEARMV / NEWMV /
SPLITMV); this variant is retained for forward-compatibility with
a future picker that may surface an InterMode not handled by the
emit layer (e.g. an Intra fallback in a mixed-mode inter pass).
InvalidCopyBufferSelector
copy_buffer_to_golden or copy_buffer_to_alternate was outside
the 2-bit field (0..=2) per §9.7. Surfaced by
encode_p_frame_multi_ref_with_refresh when its
RefreshControls argument fails validation.
Fields
which: CopyBufferSelectorThe §9.7 selector field whose value was out of range.
LoopFilterDeltaOutOfRange
A §9.4 reference or mode loop_filter_delta value exceeded the
6-bit-magnitude + 1-bit-sign field (abs(value) > 63). Surfaced
by LoopFilterDeltas::validate and
encode_p_frame_multi_ref_with_refresh_and_lf_deltas.
Fields
which: LoopFilterDeltaSlotThe §9.4 delta slot whose value was out of range.
Trait Implementations§
Source§impl Clone for EncodeError
impl Clone for EncodeError
impl Copy for EncodeError
Source§impl Debug for EncodeError
impl Debug for EncodeError
Source§impl Display for EncodeError
impl Display for EncodeError
impl Eq for EncodeError
Source§impl Error for EncodeError
impl Error for EncodeError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()