Skip to main content

BlockSize

Enum BlockSize 

Source
pub enum BlockSize {
Show 22 variants Block4x4 = 0, Block4x8 = 1, Block8x4 = 2, Block8x8 = 3, Block8x16 = 4, Block16x8 = 5, Block16x16 = 6, Block16x32 = 7, Block32x16 = 8, Block32x32 = 9, Block32x64 = 10, Block64x32 = 11, Block64x64 = 12, Block64x128 = 13, Block128x64 = 14, Block128x128 = 15, Block4x16 = 16, Block16x4 = 17, Block8x32 = 18, Block32x8 = 19, Block16x64 = 20, Block64x16 = 21,
}
Expand description

Block size enumeration.

Variants§

§

Block4x4 = 0

4x4 block.

§

Block4x8 = 1

4x8 block.

§

Block8x4 = 2

8x4 block.

§

Block8x8 = 3

8x8 block.

§

Block8x16 = 4

8x16 block.

§

Block16x8 = 5

16x8 block.

§

Block16x16 = 6

16x16 block.

§

Block16x32 = 7

16x32 block.

§

Block32x16 = 8

32x16 block.

§

Block32x32 = 9

32x32 block.

§

Block32x64 = 10

32x64 block.

§

Block64x32 = 11

64x32 block.

§

Block64x64 = 12

64x64 block.

§

Block64x128 = 13

64x128 block.

§

Block128x64 = 14

128x64 block.

§

Block128x128 = 15

128x128 block.

§

Block4x16 = 16

4x16 block.

§

Block16x4 = 17

16x4 block.

§

Block8x32 = 18

8x32 block.

§

Block32x8 = 19

32x8 block.

§

Block16x64 = 20

16x64 block.

§

Block64x16 = 21

64x16 block.

Implementations§

Source§

impl BlockSize

Source

pub const fn width(self) -> u32

Get width in samples.

Source

pub const fn height(self) -> u32

Get height in samples.

Source

pub const fn width_log2(self) -> u8

Get width log2.

Source

pub const fn height_log2(self) -> u8

Get height log2.

Source

pub const fn width_mi(self) -> u32

Get width in 4x4 units.

Source

pub const fn height_mi(self) -> u32

Get height in 4x4 units.

Source

pub const fn is_square(self) -> bool

Check if this is a square block.

Source

pub const fn is_superblock(self) -> bool

Check if this block size is valid for a superblock.

Source

pub const fn area(self) -> u32

Get the area in samples.

Source

pub const fn from_u8(val: u8) -> Option<Self>

Convert from integer value.

Source

pub const fn from_dimensions(width: u32, height: u32) -> Option<Self>

Get block size from dimensions.

Source

pub const fn max_tx_size(self) -> TxSize

Get maximum transform size for this block.

Source

pub const fn subsampled(self, subx: bool, suby: bool) -> Option<Self>

Get subsampled block size for chroma planes.

Trait Implementations§

Source§

impl Clone for BlockSize

Source§

fn clone(&self) -> BlockSize

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for BlockSize

Source§

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

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

impl Default for BlockSize

Source§

fn default() -> BlockSize

Returns the “default value” for a type. Read more
Source§

impl PartialEq for BlockSize

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for BlockSize

Source§

impl Eq for BlockSize

Source§

impl StructuralPartialEq for BlockSize

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> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts self into a Left variant of Either<Self, Self> if into_left is true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts self into a Left variant of Either<Self, Self> if into_left(&self) returns true. Converts self into a Right variant of Either<Self, Self> otherwise. Read more
Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

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

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.