#![allow(unused_imports)]
use crate::{vk::Result as VkResult, vk::*, *};
use core::ffi::{CStr, c_char, c_int, c_void};
use core::mem::transmute;
use core::ptr;
pub const EXTENSION_NAME: &CStr = c"vulkan_video_codec_av1std_decode";
pub(super) mod defs {
#![allow(non_camel_case_types, unused_imports)]
use crate::{vk::*, *};
use core::ffi::{CStr, c_char, c_int, c_void};
use core::fmt;
use core::marker::PhantomData;
use core::ptr;
#[repr(C)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(Copy, Clone, Default)]
#[must_use]
pub struct StdVideoDecodeAV1PictureInfoFlags {
pub _bitfield_0: u32,
}
impl StdVideoDecodeAV1PictureInfoFlags {
#[inline]
pub fn error_resilient_mode(mut self, error_resilient_mode: bool) -> Self {
set_bitfield_bool::<0>(&mut self._bitfield_0, error_resilient_mode);
self
}
#[inline]
pub fn disable_cdf_update(mut self, disable_cdf_update: bool) -> Self {
set_bitfield_bool::<1>(&mut self._bitfield_0, disable_cdf_update);
self
}
#[inline]
pub fn use_superres(mut self, use_superres: bool) -> Self {
set_bitfield_bool::<2>(&mut self._bitfield_0, use_superres);
self
}
#[inline]
pub fn render_and_frame_size_different(
mut self,
render_and_frame_size_different: bool,
) -> Self {
set_bitfield_bool::<3>(&mut self._bitfield_0, render_and_frame_size_different);
self
}
#[inline]
pub fn allow_screen_content_tools(mut self, allow_screen_content_tools: bool) -> Self {
set_bitfield_bool::<4>(&mut self._bitfield_0, allow_screen_content_tools);
self
}
#[inline]
pub fn is_filter_switchable(mut self, is_filter_switchable: bool) -> Self {
set_bitfield_bool::<5>(&mut self._bitfield_0, is_filter_switchable);
self
}
#[inline]
pub fn force_integer_mv(mut self, force_integer_mv: bool) -> Self {
set_bitfield_bool::<6>(&mut self._bitfield_0, force_integer_mv);
self
}
#[inline]
pub fn frame_size_override_flag(mut self, frame_size_override_flag: bool) -> Self {
set_bitfield_bool::<7>(&mut self._bitfield_0, frame_size_override_flag);
self
}
#[inline]
pub fn buffer_removal_time_present_flag(
mut self,
buffer_removal_time_present_flag: bool,
) -> Self {
set_bitfield_bool::<8>(&mut self._bitfield_0, buffer_removal_time_present_flag);
self
}
#[inline]
pub fn allow_intrabc(mut self, allow_intrabc: bool) -> Self {
set_bitfield_bool::<9>(&mut self._bitfield_0, allow_intrabc);
self
}
#[inline]
pub fn frame_refs_short_signaling(mut self, frame_refs_short_signaling: bool) -> Self {
set_bitfield_bool::<10>(&mut self._bitfield_0, frame_refs_short_signaling);
self
}
#[inline]
pub fn allow_high_precision_mv(mut self, allow_high_precision_mv: bool) -> Self {
set_bitfield_bool::<11>(&mut self._bitfield_0, allow_high_precision_mv);
self
}
#[inline]
pub fn is_motion_mode_switchable(mut self, is_motion_mode_switchable: bool) -> Self {
set_bitfield_bool::<12>(&mut self._bitfield_0, is_motion_mode_switchable);
self
}
#[inline]
pub fn use_ref_frame_mvs(mut self, use_ref_frame_mvs: bool) -> Self {
set_bitfield_bool::<13>(&mut self._bitfield_0, use_ref_frame_mvs);
self
}
#[inline]
pub fn disable_frame_end_update_cdf(mut self, disable_frame_end_update_cdf: bool) -> Self {
set_bitfield_bool::<14>(&mut self._bitfield_0, disable_frame_end_update_cdf);
self
}
#[inline]
pub fn allow_warped_motion(mut self, allow_warped_motion: bool) -> Self {
set_bitfield_bool::<15>(&mut self._bitfield_0, allow_warped_motion);
self
}
#[inline]
pub fn reduced_tx_set(mut self, reduced_tx_set: bool) -> Self {
set_bitfield_bool::<16>(&mut self._bitfield_0, reduced_tx_set);
self
}
#[inline]
pub fn reference_select(mut self, reference_select: bool) -> Self {
set_bitfield_bool::<17>(&mut self._bitfield_0, reference_select);
self
}
#[inline]
pub fn skip_mode_present(mut self, skip_mode_present: bool) -> Self {
set_bitfield_bool::<18>(&mut self._bitfield_0, skip_mode_present);
self
}
#[inline]
pub fn delta_q_present(mut self, delta_q_present: bool) -> Self {
set_bitfield_bool::<19>(&mut self._bitfield_0, delta_q_present);
self
}
#[inline]
pub fn delta_lf_present(mut self, delta_lf_present: bool) -> Self {
set_bitfield_bool::<20>(&mut self._bitfield_0, delta_lf_present);
self
}
#[inline]
pub fn delta_lf_multi(mut self, delta_lf_multi: bool) -> Self {
set_bitfield_bool::<21>(&mut self._bitfield_0, delta_lf_multi);
self
}
#[inline]
pub fn segmentation_enabled(mut self, segmentation_enabled: bool) -> Self {
set_bitfield_bool::<22>(&mut self._bitfield_0, segmentation_enabled);
self
}
#[inline]
pub fn segmentation_update_map(mut self, segmentation_update_map: bool) -> Self {
set_bitfield_bool::<23>(&mut self._bitfield_0, segmentation_update_map);
self
}
#[inline]
pub fn segmentation_temporal_update(mut self, segmentation_temporal_update: bool) -> Self {
set_bitfield_bool::<24>(&mut self._bitfield_0, segmentation_temporal_update);
self
}
#[inline]
pub fn segmentation_update_data(mut self, segmentation_update_data: bool) -> Self {
set_bitfield_bool::<25>(&mut self._bitfield_0, segmentation_update_data);
self
}
#[inline]
pub fn uses_lr(mut self, uses_lr: bool) -> Self {
set_bitfield_bool::<26>(&mut self._bitfield_0, uses_lr);
self
}
#[inline]
pub fn uses_chroma_lr(mut self, uses_chroma_lr: bool) -> Self {
set_bitfield_bool::<27>(&mut self._bitfield_0, uses_chroma_lr);
self
}
#[inline]
pub fn apply_grain(mut self, apply_grain: bool) -> Self {
set_bitfield_bool::<28>(&mut self._bitfield_0, apply_grain);
self
}
}
#[repr(C)]
#[derive(Copy, Clone)]
#[must_use]
pub struct StdVideoDecodeAV1PictureInfo<'a> {
pub flags: StdVideoDecodeAV1PictureInfoFlags,
pub frame_type: StdVideoAV1FrameType,
pub current_frame_id: u32,
pub order_hint: u8,
pub primary_ref_frame: u8,
pub refresh_frame_flags: u8,
pub reserved1: u8,
pub interpolation_filter: StdVideoAV1InterpolationFilter,
pub tx_mode: StdVideoAV1TxMode,
pub delta_q_res: u8,
pub delta_lf_res: u8,
pub skip_mode_frame: [u8; STD_VIDEO_AV1_SKIP_MODE_FRAMES as usize],
pub coded_denom: u8,
pub reserved2: [u8; 3],
pub order_hints: [u8; STD_VIDEO_AV1_NUM_REF_FRAMES as usize],
pub expected_frame_id: [u32; STD_VIDEO_AV1_NUM_REF_FRAMES as usize],
pub p_tile_info: *const StdVideoAV1TileInfo<'a>,
pub p_quantization: *const StdVideoAV1Quantization,
pub p_segmentation: *const StdVideoAV1Segmentation,
pub p_loop_filter: *const StdVideoAV1LoopFilter,
pub p_cdef: *const StdVideoAV1CDEF,
pub p_loop_restoration: *const StdVideoAV1LoopRestoration,
pub p_global_motion: *const StdVideoAV1GlobalMotion,
pub p_film_grain: *const StdVideoAV1FilmGrain,
pub _marker: PhantomData<&'a ()>,
}
#[cfg(feature = "debug")]
impl fmt::Debug for StdVideoDecodeAV1PictureInfo<'_> {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
f.debug_struct("StdVideoDecodeAV1PictureInfo")
.field("flags", &self.flags)
.field("frame_type", &self.frame_type)
.field("current_frame_id", &self.current_frame_id)
.field("order_hint", &self.order_hint)
.field("primary_ref_frame", &self.primary_ref_frame)
.field("refresh_frame_flags", &self.refresh_frame_flags)
.field("reserved1", &self.reserved1)
.field("interpolation_filter", &self.interpolation_filter)
.field("tx_mode", &self.tx_mode)
.field("delta_q_res", &self.delta_q_res)
.field("delta_lf_res", &self.delta_lf_res)
.field("skip_mode_frame", &self.skip_mode_frame)
.field("coded_denom", &self.coded_denom)
.field("reserved2", &self.reserved2)
.field("order_hints", &self.order_hints)
.field("expected_frame_id", &self.expected_frame_id)
.field("p_tile_info", &self.p_tile_info)
.field("p_quantization", &self.p_quantization)
.field("p_segmentation", &self.p_segmentation)
.field("p_loop_filter", &self.p_loop_filter)
.field("p_cdef", &self.p_cdef)
.field("p_loop_restoration", &self.p_loop_restoration)
.field("p_global_motion", &self.p_global_motion)
.field("p_film_grain", &self.p_film_grain)
.finish()
}
}
impl Default for StdVideoDecodeAV1PictureInfo<'_> {
fn default() -> Self {
Self {
flags: Default::default(),
frame_type: Default::default(),
current_frame_id: Default::default(),
order_hint: Default::default(),
primary_ref_frame: Default::default(),
refresh_frame_flags: Default::default(),
reserved1: Default::default(),
interpolation_filter: Default::default(),
tx_mode: Default::default(),
delta_q_res: Default::default(),
delta_lf_res: Default::default(),
skip_mode_frame: [Default::default(); _],
coded_denom: Default::default(),
reserved2: [Default::default(); _],
order_hints: [Default::default(); _],
expected_frame_id: [Default::default(); _],
p_tile_info: ptr::null(),
p_quantization: ptr::null(),
p_segmentation: ptr::null(),
p_loop_filter: ptr::null(),
p_cdef: ptr::null(),
p_loop_restoration: ptr::null(),
p_global_motion: ptr::null(),
p_film_grain: ptr::null(),
_marker: PhantomData,
}
}
}
impl<'a> StdVideoDecodeAV1PictureInfo<'a> {
#[inline]
pub fn flags(mut self, flags: StdVideoDecodeAV1PictureInfoFlags) -> Self {
self.flags = flags;
self
}
#[inline]
pub fn frame_type(mut self, frame_type: StdVideoAV1FrameType) -> Self {
self.frame_type = frame_type;
self
}
#[inline]
pub fn current_frame_id(mut self, current_frame_id: u32) -> Self {
self.current_frame_id = current_frame_id;
self
}
#[inline]
pub fn order_hint(mut self, order_hint: u8) -> Self {
self.order_hint = order_hint;
self
}
#[inline]
pub fn primary_ref_frame(mut self, primary_ref_frame: u8) -> Self {
self.primary_ref_frame = primary_ref_frame;
self
}
#[inline]
pub fn refresh_frame_flags(mut self, refresh_frame_flags: u8) -> Self {
self.refresh_frame_flags = refresh_frame_flags;
self
}
#[inline]
pub fn reserved1(mut self, reserved1: u8) -> Self {
self.reserved1 = reserved1;
self
}
#[inline]
pub fn interpolation_filter(
mut self,
interpolation_filter: StdVideoAV1InterpolationFilter,
) -> Self {
self.interpolation_filter = interpolation_filter;
self
}
#[inline]
pub fn tx_mode(mut self, tx_mode: StdVideoAV1TxMode) -> Self {
self.tx_mode = tx_mode;
self
}
#[inline]
pub fn delta_q_res(mut self, delta_q_res: u8) -> Self {
self.delta_q_res = delta_q_res;
self
}
#[inline]
pub fn delta_lf_res(mut self, delta_lf_res: u8) -> Self {
self.delta_lf_res = delta_lf_res;
self
}
#[inline]
pub fn skip_mode_frame(
mut self,
skip_mode_frame: [u8; STD_VIDEO_AV1_SKIP_MODE_FRAMES as usize],
) -> Self {
self.skip_mode_frame = skip_mode_frame;
self
}
#[inline]
pub fn coded_denom(mut self, coded_denom: u8) -> Self {
self.coded_denom = coded_denom;
self
}
#[inline]
pub fn reserved2(mut self, reserved2: [u8; 3]) -> Self {
self.reserved2 = reserved2;
self
}
#[inline]
pub fn order_hints(
mut self,
order_hints: [u8; STD_VIDEO_AV1_NUM_REF_FRAMES as usize],
) -> Self {
self.order_hints = order_hints;
self
}
#[inline]
pub fn expected_frame_id(
mut self,
expected_frame_id: [u32; STD_VIDEO_AV1_NUM_REF_FRAMES as usize],
) -> Self {
self.expected_frame_id = expected_frame_id;
self
}
#[inline]
pub fn tile_info(mut self, tile_info: &'a StdVideoAV1TileInfo<'a>) -> Self {
self.p_tile_info = tile_info;
self
}
#[inline]
pub fn quantization(mut self, quantization: &'a StdVideoAV1Quantization) -> Self {
self.p_quantization = quantization;
self
}
#[inline]
pub fn segmentation(mut self, segmentation: &'a StdVideoAV1Segmentation) -> Self {
self.p_segmentation = segmentation;
self
}
#[inline]
pub fn loop_filter(mut self, loop_filter: &'a StdVideoAV1LoopFilter) -> Self {
self.p_loop_filter = loop_filter;
self
}
#[inline]
pub fn cdef(mut self, cdef: &'a StdVideoAV1CDEF) -> Self {
self.p_cdef = cdef;
self
}
#[inline]
pub fn loop_restoration(
mut self,
loop_restoration: &'a StdVideoAV1LoopRestoration,
) -> Self {
self.p_loop_restoration = loop_restoration;
self
}
#[inline]
pub fn global_motion(mut self, global_motion: &'a StdVideoAV1GlobalMotion) -> Self {
self.p_global_motion = global_motion;
self
}
#[inline]
pub fn film_grain(mut self, film_grain: &'a StdVideoAV1FilmGrain) -> Self {
self.p_film_grain = film_grain;
self
}
}
#[repr(C)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(Copy, Clone, Default)]
#[must_use]
pub struct StdVideoDecodeAV1ReferenceInfoFlags {
pub _bitfield_0: u32,
}
impl StdVideoDecodeAV1ReferenceInfoFlags {
#[inline]
pub fn disable_frame_end_update_cdf(mut self, disable_frame_end_update_cdf: bool) -> Self {
set_bitfield_bool::<0>(&mut self._bitfield_0, disable_frame_end_update_cdf);
self
}
#[inline]
pub fn segmentation_enabled(mut self, segmentation_enabled: bool) -> Self {
set_bitfield_bool::<1>(&mut self._bitfield_0, segmentation_enabled);
self
}
}
#[repr(C)]
#[cfg_attr(feature = "debug", derive(Debug))]
#[derive(Copy, Clone)]
#[must_use]
pub struct StdVideoDecodeAV1ReferenceInfo {
pub flags: StdVideoDecodeAV1ReferenceInfoFlags,
pub frame_type: u8,
pub ref_frame_sign_bias: u8,
pub order_hint: u8,
pub saved_order_hints: [u8; STD_VIDEO_AV1_NUM_REF_FRAMES as usize],
}
impl Default for StdVideoDecodeAV1ReferenceInfo {
fn default() -> Self {
Self {
flags: Default::default(),
frame_type: Default::default(),
ref_frame_sign_bias: Default::default(),
order_hint: Default::default(),
saved_order_hints: [Default::default(); _],
}
}
}
impl StdVideoDecodeAV1ReferenceInfo {
#[inline]
pub fn flags(mut self, flags: StdVideoDecodeAV1ReferenceInfoFlags) -> Self {
self.flags = flags;
self
}
#[inline]
pub fn frame_type(mut self, frame_type: u8) -> Self {
self.frame_type = frame_type;
self
}
#[inline]
pub fn ref_frame_sign_bias(mut self, ref_frame_sign_bias: u8) -> Self {
self.ref_frame_sign_bias = ref_frame_sign_bias;
self
}
#[inline]
pub fn order_hint(mut self, order_hint: u8) -> Self {
self.order_hint = order_hint;
self
}
#[inline]
pub fn saved_order_hints(
mut self,
saved_order_hints: [u8; STD_VIDEO_AV1_NUM_REF_FRAMES as usize],
) -> Self {
self.saved_order_hints = saved_order_hints;
self
}
}
}
#[cfg(feature = "ffi")]
pub(super) mod ffi {
#![allow(non_camel_case_types)]
use super::defs::*;
pub type StdVideoDecodeAV1PictureInfoFlags = super::defs::StdVideoDecodeAV1PictureInfoFlags;
pub type StdVideoDecodeAV1PictureInfo = super::defs::StdVideoDecodeAV1PictureInfo<'static>;
pub type StdVideoDecodeAV1ReferenceInfoFlags = super::defs::StdVideoDecodeAV1ReferenceInfoFlags;
pub type StdVideoDecodeAV1ReferenceInfo = super::defs::StdVideoDecodeAV1ReferenceInfo;
impl super::defs::StdVideoDecodeAV1PictureInfo<'_> {
#[inline]
pub unsafe fn drop_lifetime_for_ffi(&self) -> &StdVideoDecodeAV1PictureInfo {
unsafe { core::mem::transmute(self) }
}
}
}