Go to the documentation of this file.
56 VkVideoReferenceSlotInfoKHR *ref_slot,
57 VkVideoPictureResourceInfoKHR *
ref,
59 const AV1Frame *pic,
int is_current,
int has_grain,
76 for (
unsigned i = 0;
i < 7;
i++) {
83 *
ref = (VkVideoPictureResourceInfoKHR) {
84 .sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR,
85 .codedOffset = (VkOffset2D){ 0, 0 },
92 *ref_slot = (VkVideoReferenceSlotInfoKHR) {
93 .sType = VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR,
95 .slotIndex = dpb_slot_index,
96 .pPictureResource =
ref,
116 VkVideoSessionParametersCreateInfoKHR session_params_create;
173 .sequence_header = &av1_sequence_header,
177 .pParametersAddInfo = &av1_params_info,
179 session_params_create = (VkVideoSessionParametersCreateInfoKHR) {
180 .
sType = VK_STRUCTURE_TYPE_VIDEO_SESSION_PARAMETERS_CREATE_INFO_KHR,
181 .pNext = &av1_params,
182 .videoSession =
ctx->common.session,
183 .videoSessionParametersTemplate =
NULL,
219 unsigned slot_idx = 0;
220 for (
unsigned i = 0;
i < 32;
i++) {
248 pic, 1, apply_grain, 8);
262 .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR,
265 .pSetupReferenceSlot = &vp->
ref_slot,
266 .referenceSlotCount = ref_count,
268 .dstPictureResource = (VkVideoPictureResourceInfoKHR) {
269 .sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR,
270 .codedOffset = (VkOffset2D){ 0, 0 },
271 .codedExtent = (VkExtent2D){ pic->
f->
width, pic->
f->
height },
283 .render_and_frame_size_different =
frame_header->render_and_frame_size_different,
284 .allow_screen_content_tools =
frame_header->allow_screen_content_tools,
285 .is_filter_switchable =
frame_header->is_filter_switchable,
287 .frame_size_override_flag =
frame_header->frame_size_override_flag,
288 .buffer_removal_time_present_flag =
frame_header->buffer_removal_time_present_flag,
290 .frame_refs_short_signaling =
frame_header->frame_refs_short_signaling,
291 .allow_high_precision_mv =
frame_header->allow_high_precision_mv,
292 .is_motion_mode_switchable =
frame_header->is_motion_mode_switchable,
294 .disable_frame_end_update_cdf =
frame_header->disable_frame_end_update_cdf,
295 .allow_warped_motion =
frame_header->allow_warped_motion,
301 .frame_to_show_map_idx =
frame_header->frame_to_show_map_idx,
302 .frame_presentation_time =
frame_header->frame_presentation_time,
308 .frame_width_minus_1 =
frame_header->frame_width_minus_1,
309 .frame_height_minus_1 =
frame_header->frame_height_minus_1,
311 .render_width_minus_1 =
frame_header->render_width_minus_1,
312 .render_height_minus_1 =
frame_header->render_height_minus_1,
313 .refresh_frame_flags =
frame_header->refresh_frame_flags,
314 .interpolation_filter =
frame_header->interpolation_filter,
318 .uniform_tile_spacing_flag =
frame_header->uniform_tile_spacing_flag,
322 .context_update_tile_id =
frame_header->context_update_tile_id,
323 .tile_size_bytes_minus1 =
frame_header->tile_size_bytes_minus1,
348 .delta_enabled =
frame_header->loop_filter_delta_enabled,
373 .temporal_update =
frame_header->segmentation_temporal_update,
379 .apply_grain = apply_grain,
392 .cb_mult = film_grain->
cb_mult,
395 .cr_mult = film_grain->
cr_mult,
401 for (
int i = 0;
i < 64;
i++) {
408 for (
int i = 0;
i < 8;
i++) {
410 for (
int j = 0; j < 8; j++) {
427 .gm_type =
s->cur_frame.gm_type[
i],
429 s->cur_frame.gm_params[
i][0],
s->cur_frame.gm_params[
i][1],
430 s->cur_frame.gm_params[
i][2],
s->cur_frame.gm_params[
i][3],
431 s->cur_frame.gm_params[
i][4],
s->cur_frame.gm_params[
i][5],
436 for (
int i = 0;
i < 7;
i++) {
445 for (
int i = 0;
i < 14;
i++) {
450 for (
int i = 0;
i < 10;
i++) {
457 for (
int i = 0;
i < 24;
i++) {
482 for (
int i =
s->tg_start; i <= s->tg_end;
i++) {
484 .
size =
s->tile_group_info[
i].tile_size,
485 .offset =
s->tile_group_info[
i].tile_offset,
486 .row =
s->tile_group_info[
i].tile_row,
487 .column =
s->tile_group_info[
i].tile_column,
488 .tg_start =
s->tg_start,
493 data +
s->tile_group_info[
i].tile_offset,
494 s->tile_group_info[
i].tile_size, 0,
553 .
p.
name =
"av1_vulkan",
uint8_t ref_order_hint[7]
const FFHWAccel ff_av1_vulkan_hwaccel
uint32_t num_units_in_display_tick
uint8_t tile_start_col_sb[64]
uint8_t height_in_sbs_minus_1[64]
uint8_t clip_to_restricted_range
StdVideoAV1MESATileList tile_list
#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_ADD_INFO_MESA
#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_DPB_SLOT_INFO_MESA
FFVulkanDecodeShared * shared_ctx
VkVideoDecodeAV1PictureInfoMESA av1_pic_info
uint8_t point_cb_value[10]
AVHWAccel p
The public AVHWAccel.
This structure describes decoded (raw) audio or video data.
uint8_t point_y_value[14]
AV1RawFrameHeader * raw_frame_header
uint32_t frame_id_alloc_mask
static int vk_av1_start_frame(AVCodecContext *avctx, av_unused const uint8_t *buffer, av_unused uint32_t size)
#define AV_LOG_VERBOSE
Detailed information.
RefStruct is an API for creating reference-counted objects with minimal overhead.
static int vk_av1_create_params(AVCodecContext *avctx, AVBufferRef **buf)
int16_t feature_data[8][8]
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
int ff_vk_decode_prepare_frame(FFVulkanDecodeContext *dec, AVFrame *pic, FFVulkanDecodePicture *vkpic, int is_current, int alloc_dpb)
Prepare a frame, creates the image view, and sets up the dpb fields.
VkVideoPictureResourceInfoKHR ref
uint8_t separate_uv_delta_q
VkVideoDecodeAV1DpbSlotInfoMESA vkav1_refs[AV1_NUM_REF_FRAMES]
AVBufferRef * session_params
uint8_t chroma_scaling_from_luma
uint8_t ar_coeffs_cr_plus_128[25]
uint8_t point_cr_scaling[10]
static int vk_av1_end_frame(AVCodecContext *avctx)
uint8_t ar_coeff_shift_minus_6
int ff_vk_decode_frame(AVCodecContext *avctx, AVFrame *pic, FFVulkanDecodePicture *vp, AVFrame *rpic[], FFVulkanDecodePicture *rvkp[])
Decode a frame.
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
uint8_t grain_scaling_minus_8
VkVideoPictureResourceInfoKHR refs[36]
static const AVFrame * ref_frame(const struct pl_frame_mix *mix)
int ff_vk_decode_create_params(AVBufferRef **par_ref, void *logctx, FFVulkanDecodeShared *ctx, const VkVideoSessionParametersCreateInfoKHR *session_params_create)
Create VkVideoSessionParametersKHR wrapped in an AVBufferRef.
uint8_t disable_frame_end_update_cdf
int(* init)(AVBSFContext *ctx)
StdVideoAV1MESATile * tile_list
#define AV_LOG_DEBUG
Stuff which is only useful for libav* developers.
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture *vp)
Free a frame and its state.
#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_PICTURE_INFO_MESA
struct AVCodecInternal * internal
Private context used for internal data.
uint8_t point_y_value[14]
int ff_vk_decode_uninit(AVCodecContext *avctx)
Free decoder.
int ff_vk_frame_params(AVCodecContext *avctx, AVBufferRef *hw_frames_ctx)
Initialize hw_frames_ctx with the parameters needed to decode the stream using the parameters from av...
uint8_t point_cb_scaling[10]
int8_t ar_coeffs_cb_plus_128[25]
uint8_t point_cr_value[10]
uint32_t num_ticks_per_picture_minus_1
void * hwaccel_priv_data
hwaccel-specific private data
uint8_t point_cr_scaling[10]
uint8_t feature_enabled_bits[8]
@ AV_PICTURE_TYPE_NONE
Undefined.
uint8_t grain_scale_shift
const char * name
Name of the hardware accelerated codec.
#define i(width, name, range_min, range_max)
void * hwaccel_picture_private
RefStruct reference.
int8_t ar_coeffs_y_plus_128[24]
uint8_t point_y_scaling[14]
uint8_t equal_picture_interval
VkVideoReferenceSlotInfoKHR ref_slot
the pkt_dts and pkt_pts fields in AVFrame will work as usual Restrictions on codec whose streams don t reset across will not work because their bitstreams cannot be decoded in parallel *The contents of buffers must not be read before as well as code calling up to before the decode process starts Call have update_thread_context() run it in the next thread. Add AV_CODEC_CAP_FRAME_THREADS to the codec capabilities. There will be very little speed gain at this point but it should work. If there are inter-frame dependencies
VkVideoReferenceSlotInfoKHR ref_slots[36]
uint8_t y_sec_strength[8]
void ff_vk_decode_flush(AVCodecContext *avctx)
Flush decoder.
VkVideoDecodeAV1DpbSlotInfoMESA vkav1_ref
int8_t ar_coeffs_cr_plus_128[25]
uint8_t point_cb_value[10]
int ff_vk_decode_add_slice(AVCodecContext *avctx, FFVulkanDecodePicture *vp, const uint8_t *data, size_t size, int add_startcode, uint32_t *nb_slices, const uint32_t **offsets)
Add slice data to frame.
const AV1Frame * ref_src[AV1_NUM_REF_FRAMES]
main external API structure.
uint8_t point_cr_value[10]
uint8_t uv_pri_strength[8]
the frame and frame reference mechanism is intended to as much as expensive copies of that data while still allowing the filters to produce correct results The data is stored in buffers represented by AVFrame structures Several references can point to the same frame buffer
uint8_t skip_mode_frame_idx[2]
uint8_t tile_start_row_sb[64]
static int ref[MAX_W *MAX_W]
const uint32_t * tile_offsets
int export_side_data
Bit set of AV_CODEC_EXPORT_DATA_* flags, which affects the kind of metadata exported in frame,...
int ff_vk_params_invalidate(AVCodecContext *avctx, int t, const uint8_t *b, uint32_t s)
Removes current session parameters to recreate them.
uint8_t ar_coeffs_cb_plus_128[25]
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_SPEC_VERSION
uint8_t ar_coeffs_y_plus_128[24]
int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Synchronize the contexts between 2 threads.
uint8_t uv_sec_strength[8]
uint8_t point_y_scaling[14]
uint8_t width_in_sbs_minus_1[64]
void(* flush)(AVBSFContext *ctx)
A reference to a data buffer.
uint8_t point_cb_scaling[10]
const VkExtensionProperties ff_vk_dec_av1_ext
uint8_t y_pri_strength[8]
#define VK_STRUCTURE_TYPE_VIDEO_DECODE_AV1_SESSION_PARAMETERS_CREATE_INFO_MESA
int ff_vk_decode_init(AVCodecContext *avctx)
Initialize decoder.
static av_cold int uninit(AVCodecContext *avctx)
VkVideoDecodeInfoKHR decode_info
FFVulkanDecodeContext * dec
#define VK_STD_VULKAN_VIDEO_CODEC_AV1_DECODE_EXTENSION_NAME
static int vk_av1_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)
#define AV_CODEC_EXPORT_DATA_FILM_GRAIN
Decoding only.
static void vk_av1_free_frame_priv(FFRefStructOpaque _hwctx, void *data)
StdVideoAV1MESAGlobalMotionFlags flags
static int vk_av1_fill_pict(AVCodecContext *avctx, const AV1Frame **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, VkVideoPictureResourceInfoKHR *ref, VkVideoDecodeAV1DpbSlotInfoMESA *vkav1_ref, const AV1Frame *pic, int is_current, int has_grain, int dpb_slot_index)
StdVideoAV1MESATile tiles[MAX_TILES]
StdVideoAV1MESAFrameHeader av1_frame_header