Skip to main content

EncodeError

Enum EncodeError 

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

InvalidDimensions

Visible width or height is zero or exceeds the 14-bit VP8 field (width > 0x3FFF or height > 0x3FFF).

Fields

§width: u32
§height: u32
§

LoopFilterLevelOutOfRange

loop_filter_level outside the 6-bit field (> 63).

Fields

§value: u8
§

SharpnessLevelOutOfRange

sharpness_level outside the 3-bit field (> 7).

Fields

§value: u8
§

InvalidDctPartitionCount

nbr_of_dct_partitions is not one of the four legal values (1 / 2 / 4 / 8) per §9.5.

Fields

§value: u8
§

QuantIndexOutOfRange

y_ac_qi outside the 7-bit field (> 127) per §9.6.

Fields

§value: u8
§

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.

Fields

§bytes: usize
§

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

§source: (u32, u32)

(width, height) of the source frame’s macroblock-aligned grid.

§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).

Fields

§mode: InterMode

The resolved mode the picker handed the emit layer.

§

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: CopyBufferSelector

The §9.7 selector field whose value was out of range.

§value: u8

The offending value (must be 0, 1, or 2).

§

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: LoopFilterDeltaSlot

The §9.4 delta slot whose value was out of range.

§value: i16

The offending signed value (must be -63..=63).

Trait Implementations§

Source§

impl Clone for EncodeError

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for EncodeError

Source§

impl Debug for EncodeError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Display for EncodeError

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Eq for EncodeError

Source§

impl Error for EncodeError

1.30.0 · Source§

fn source(&self) -> Option<&(dyn Error + 'static)>

Returns the lower-level source of this error, if any. Read more
1.0.0 · Source§

fn description(&self) -> &str

👎Deprecated since 1.42.0:

use the Display impl or to_string()

1.0.0 · Source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0:

replaced by Error::source, which can support downcasting

Replaced by Error::source.
Source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type-based access to context intended for error reports. Read more
Source§

impl From<EncodeError> for StreamEncodeError

Source§

fn from(e: EncodeError) -> Self

Converts to this type from the input type.
Source§

impl PartialEq for EncodeError

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for EncodeError

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> CloneToUninit for T
where T: Clone,

Source§

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

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

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.