FFmpeg
Loading...
Searching...
No Matches
vulkan_vp9.c
Go to the documentation of this file.
1/*
2 * This file is part of FFmpeg.
3 *
4 * FFmpeg is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
8 *
9 * FFmpeg is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with FFmpeg; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
17 */
18
19#include "vp9dec.h"
20
21#include "vulkan_decode.h"
22
24 .codec_id = AV_CODEC_ID_VP9,
25 .decode_extension = FF_VK_EXT_VIDEO_DECODE_VP9,
26 .queue_flags = VK_QUEUE_VIDEO_DECODE_BIT_KHR,
27 .decode_op = VK_VIDEO_CODEC_OPERATION_DECODE_VP9_BIT_KHR,
28 .ext_props = {
29 .extensionName = VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_EXTENSION_NAME,
30 .specVersion = VK_STD_VULKAN_VIDEO_CODEC_VP9_DECODE_SPEC_VERSION,
31 },
32};
33
34typedef struct VP9VulkanDecodePicture {
36
37 /* TODO: investigate if this can be removed to make decoding completely
38 * independent. */
40
41 /* Current picture */
42 StdVideoVP9ColorConfig color_config;
43 StdVideoVP9Segmentation segmentation;
44 StdVideoVP9LoopFilter loop_filter;
45 StdVideoDecodeVP9PictureInfo std_pic_info;
46 VkVideoDecodeVP9PictureInfoKHR vp9_pic_info;
47
48 const VP9Frame *ref_src[8];
49
50 uint8_t frame_id_set;
51 uint8_t frame_id;
54
55static int vk_vp9_fill_pict(AVCodecContext *avctx, const VP9Frame **ref_src,
56 VkVideoReferenceSlotInfoKHR *ref_slot, /* Main structure */
57 VkVideoPictureResourceInfoKHR *ref, /* Goes in ^ */
58 const VP9Frame *pic, int is_current)
59{
63 FFVulkanDecodePicture *vkpic = &hp->vp;
64
65 int err = ff_vk_decode_prepare_frame(dec, pic->tf.f, vkpic, is_current,
66 dec->dedicated_dpb);
67 if (err < 0)
68 return err;
69
70 *ref = (VkVideoPictureResourceInfoKHR) {
71 .sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR,
72 .codedOffset = (VkOffset2D){ 0, 0 },
73 .codedExtent = (VkExtent2D){ pic->tf.f->width, pic->tf.f->height },
74 .baseArrayLayer = (dec->dedicated_dpb && ctx->common.layered_dpb) ?
75 hp->frame_id : 0,
76 .imageViewBinding = vkpic->view.ref,
77 };
78
79 *ref_slot = (VkVideoReferenceSlotInfoKHR) {
80 .sType = VK_STRUCTURE_TYPE_VIDEO_REFERENCE_SLOT_INFO_KHR,
81 .slotIndex = hp->frame_id,
82 .pPictureResource = ref,
83 };
84
85 if (ref_src)
86 *ref_src = pic;
87
88 return 0;
89}
90
91static enum StdVideoVP9InterpolationFilter remap_interp(uint8_t is_filter_switchable,
92 uint8_t raw_interpolation_filter_type)
93{
94 static const enum StdVideoVP9InterpolationFilter remap[] = {
95 STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP_SMOOTH,
96 STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP,
97 STD_VIDEO_VP9_INTERPOLATION_FILTER_EIGHTTAP_SHARP,
98 STD_VIDEO_VP9_INTERPOLATION_FILTER_BILINEAR,
99 };
100 if (is_filter_switchable)
101 return STD_VIDEO_VP9_INTERPOLATION_FILTER_SWITCHABLE;
102 return remap[raw_interpolation_filter_type];
103}
104
106 av_unused const AVBufferRef *buffer_ref,
107 av_unused const uint8_t *buffer,
108 av_unused uint32_t size)
109{
110 int err;
111 int ref_count = 0;
112 const VP9Context *priv = avctx->priv_data;
113 const CodedBitstreamVP9Context *vp9 = priv->cbc->priv_data;
114 const VP9SharedContext *s = &priv->s;
115 uint32_t frame_id_alloc_mask = 0;
116
117 const VP9Frame *pic = &s->frames[CUR_FRAME];
118 const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(avctx->sw_pix_fmt);
121
123 FFVulkanDecodePicture *vp = &ap->vp;
124
125 /* Use the current frame_ids in ref_frames[] to decide occupied frame_ids */
126 for (int i = 0; i < STD_VIDEO_VP9_NUM_REF_FRAMES; i++) {
127 const VP9VulkanDecodePicture* rp = s->ref_frames[i].hwaccel_picture_private;
128 if (rp)
129 frame_id_alloc_mask |= 1 << rp->frame_id;
130 }
131
132 if (!ap->frame_id_set) {
133 unsigned slot_idx = 0;
134 for (unsigned i = 0; i < 32; i++) {
135 if (!(frame_id_alloc_mask & (1 << i))) {
136 slot_idx = i;
137 break;
138 }
139 }
140 ap->frame_id = slot_idx;
141 ap->frame_id_set = 1;
142 frame_id_alloc_mask |= (1 << slot_idx);
143 }
144
145 for (int i = 0; i < STD_VIDEO_VP9_REFS_PER_FRAME; i++) {
146 const int idx = pic->frame_header->ref_frame_idx[i];
147 const VP9Frame *ref_frame = &s->ref_frames[idx];
148 VP9VulkanDecodePicture *hp = ref_frame->hwaccel_picture_private;
149 int found = 0;
150
151 if (!ref_frame->tf.f)
152 continue;
153
154 for (int j = 0; j < ref_count; j++) {
155 if (vp->ref_slots[j].slotIndex == hp->frame_id) {
156 found = 1;
157 break;
158 }
159 }
160 if (found)
161 continue;
162
163 err = vk_vp9_fill_pict(avctx, &ap->ref_src[ref_count],
164 &vp->ref_slots[ref_count], &vp->refs[ref_count],
165 ref_frame, 0);
166 if (err < 0)
167 return err;
168
169 ref_count++;
170 }
171
172 err = vk_vp9_fill_pict(avctx, NULL, &vp->ref_slot, &vp->ref,
173 pic, 1);
174 if (err < 0)
175 return err;
176
177 ap->loop_filter = (StdVideoVP9LoopFilter) {
178 .flags = (StdVideoVP9LoopFilterFlags) {
179 .loop_filter_delta_enabled = pic->frame_header->loop_filter_delta_enabled,
180 .loop_filter_delta_update = pic->frame_header->loop_filter_delta_update,
181 },
182 .loop_filter_level = pic->frame_header->loop_filter_level,
183 .loop_filter_sharpness = pic->frame_header->loop_filter_sharpness,
184 .update_ref_delta = 0x0,
185 .update_mode_delta = 0x0,
186 };
187
188 for (int i = 0; i < STD_VIDEO_VP9_MAX_REF_FRAMES; i++) {
189 ap->loop_filter.loop_filter_ref_deltas[i] = vp9->loop_filter_ref_deltas[i];
190 ap->loop_filter.update_ref_delta |= pic->frame_header->update_ref_delta[i];
191 }
192 for (int i = 0; i < STD_VIDEO_VP9_LOOP_FILTER_ADJUSTMENTS; i++) {
193 ap->loop_filter.loop_filter_mode_deltas[i] = vp9->loop_filter_mode_deltas[i];
194 ap->loop_filter.update_mode_delta |= pic->frame_header->update_mode_delta[i];
195 }
196
197 ap->segmentation = (StdVideoVP9Segmentation) {
198 .flags = (StdVideoVP9SegmentationFlags) {
199 .segmentation_update_map = pic->frame_header->segmentation_update_map,
200 .segmentation_temporal_update = pic->frame_header->segmentation_temporal_update,
201 .segmentation_update_data = pic->frame_header->segmentation_update_data,
202 .segmentation_abs_or_delta_update = pic->frame_header->segmentation_abs_or_delta_update,
203 },
204 };
205
206 for (int i = 0; i < STD_VIDEO_VP9_MAX_SEGMENTATION_TREE_PROBS; i++)
207 ap->segmentation.segmentation_tree_probs[i] = vp9->segmentation_tree_probs[i];
208 for (int i = 0; i < STD_VIDEO_VP9_MAX_SEGMENTATION_PRED_PROB; i++)
209 ap->segmentation.segmentation_pred_prob[i] = vp9->segmentation_pred_prob[i];
210 for (int i = 0; i < STD_VIDEO_VP9_MAX_SEGMENTS; i++) {
211 ap->segmentation.FeatureEnabled[i] = 0x0;
212 for (int j = 0; j < STD_VIDEO_VP9_SEG_LVL_MAX; j++) {
213 ap->segmentation.FeatureEnabled[i] |= vp9->feature_enabled[i][j] << j;
214 ap->segmentation.FeatureData[i][j] = vp9->feature_sign[i][j] ?
215 -vp9->feature_value[i][j] :
216 +vp9->feature_value[i][j];
217 }
218 }
219
220 ap->color_config = (StdVideoVP9ColorConfig) {
221 .flags = (StdVideoVP9ColorConfigFlags) {
222 .color_range = pic->frame_header->color_range,
223 },
224 .BitDepth = profile < 2 ? 8 :
225 pic->frame_header->ten_or_twelve_bit ? 12 : 10,
226 .subsampling_x = pixdesc->log2_chroma_w,
227 .subsampling_y = pixdesc->log2_chroma_h,
228
229 .color_space = pic->frame_header->color_space,
230 };
231
232 ap->std_pic_info = (StdVideoDecodeVP9PictureInfo) {
233 .flags = (StdVideoDecodeVP9PictureInfoFlags) {
234 .error_resilient_mode = pic->frame_header->error_resilient_mode,
235 .intra_only = pic->frame_header->intra_only,
236 .allow_high_precision_mv = pic->frame_header->allow_high_precision_mv,
237 .refresh_frame_context = pic->frame_header->refresh_frame_context,
238 .frame_parallel_decoding_mode = pic->frame_header->frame_parallel_decoding_mode,
239 .segmentation_enabled = pic->frame_header->segmentation_enabled,
240 .show_frame = !s->h.invisible,
241 .UsePrevFrameMvs = s->h.use_last_frame_mvs,
242 },
243 .profile = profile,
244 .frame_type = pic->frame_header->frame_type,
245 .frame_context_idx = pic->frame_header->frame_context_idx,
246 .reset_frame_context = pic->frame_header->reset_frame_context,
247 .refresh_frame_flags = pic->frame_header->refresh_frame_flags,
248 .ref_frame_sign_bias_mask = 0x0,
249 .interpolation_filter = remap_interp(pic->frame_header->is_filter_switchable,
251 .base_q_idx = pic->frame_header->base_q_idx,
252 .delta_q_y_dc = pic->frame_header->delta_q_y_dc,
253 .delta_q_uv_dc = pic->frame_header->delta_q_uv_dc,
254 .delta_q_uv_ac = pic->frame_header->delta_q_uv_ac,
255 .tile_cols_log2 = pic->frame_header->tile_cols_log2,
256 .tile_rows_log2 = pic->frame_header->tile_rows_log2,
257 /* Reserved */
258 .pColorConfig = &ap->color_config,
259 .pLoopFilter = &ap->loop_filter,
260 .pSegmentation = &ap->segmentation,
261 };
262
263 for (int i = VP9_LAST_FRAME; i <= VP9_ALTREF_FRAME; i++)
264 ap->std_pic_info.ref_frame_sign_bias_mask |= pic->frame_header->ref_frame_sign_bias[i] << i;
265
266 ap->vp9_pic_info = (VkVideoDecodeVP9PictureInfoKHR) {
267 .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_VP9_PICTURE_INFO_KHR,
268 .pStdPictureInfo = &ap->std_pic_info,
269 .uncompressedHeaderOffset = 0,
270 .compressedHeaderOffset = s->h.uncompressed_header_size,
271 .tilesOffset = s->h.uncompressed_header_size +
272 s->h.compressed_header_size,
273 };
274
275 for (int i = 0; i < STD_VIDEO_VP9_REFS_PER_FRAME; i++) {
276 const int idx = pic->frame_header->ref_frame_idx[i];
277 const VP9Frame *ref_frame = &s->ref_frames[idx];
278 VP9VulkanDecodePicture *hp = ref_frame->hwaccel_picture_private;
279
280 if (!ref_frame->tf.f)
281 ap->vp9_pic_info.referenceNameSlotIndices[i] = -1;
282 else
283 ap->vp9_pic_info.referenceNameSlotIndices[i] = hp->frame_id;
284 }
285
286 vp->decode_info = (VkVideoDecodeInfoKHR) {
287 .sType = VK_STRUCTURE_TYPE_VIDEO_DECODE_INFO_KHR,
288 .pNext = &ap->vp9_pic_info,
289 .flags = 0x0,
290 .pSetupReferenceSlot = &vp->ref_slot,
291 .referenceSlotCount = ref_count,
292 .pReferenceSlots = vp->ref_slots,
293 .dstPictureResource = (VkVideoPictureResourceInfoKHR) {
294 .sType = VK_STRUCTURE_TYPE_VIDEO_PICTURE_RESOURCE_INFO_KHR,
295 .codedOffset = (VkOffset2D){ 0, 0 },
296 .codedExtent = (VkExtent2D){ pic->tf.f->width, pic->tf.f->height },
297 .baseArrayLayer = 0,
298 .imageViewBinding = vp->view.out,
299 },
300 };
301
302 ap->dec = dec;
303
304 return 0;
305}
306
308 const uint8_t *data,
309 uint32_t size)
310{
311 int err;
312 const VP9SharedContext *s = avctx->priv_data;
313 VP9VulkanDecodePicture *ap = s->frames[CUR_FRAME].hwaccel_picture_private;
314 FFVulkanDecodePicture *vp = &ap->vp;
315
316 err = ff_vk_decode_add_slice(avctx, vp, data, size, 0, NULL, NULL);
317 if (err < 0)
318 return err;
319
320 return 0;
321}
322
324{
325 const VP9SharedContext *s = avctx->priv_data;
326
327 const VP9Frame *pic = &s->frames[CUR_FRAME];
329 FFVulkanDecodePicture *vp = &ap->vp;
330 FFVulkanDecodePicture *rvp[STD_VIDEO_VP9_REFS_PER_FRAME] = { 0 };
331 AVFrame *rav[STD_VIDEO_VP9_REFS_PER_FRAME] = { 0 };
332
333 for (int i = 0; i < vp->decode_info.referenceSlotCount; i++) {
334 const VP9Frame *rp = ap->ref_src[i];
336
337 rvp[i] = &rhp->vp;
338 rav[i] = ap->ref_src[i]->tf.f;
339 }
340
341 av_log(avctx, AV_LOG_VERBOSE, "Decoding frame, %zu bytes\n",
342 vp->slices_size);
343
344 return ff_vk_decode_frame(avctx, pic->tf.f, vp, rav, rvp);
345}
346
348{
349 AVHWDeviceContext *hwctx = _hwctx.nc;
351
352 /* Free frame resources, this also destroys the session parameters. */
353 ff_vk_decode_free_frame(hwctx, &ap->vp);
354}
355
357 .p.name = "vp9_vulkan",
358 .p.type = AVMEDIA_TYPE_VIDEO,
359 .p.id = AV_CODEC_ID_VP9,
360 .p.pix_fmt = AV_PIX_FMT_VULKAN,
361 .start_frame = &vk_vp9_start_frame,
362 .decode_slice = &vk_vp9_decode_slice,
363 .end_frame = &vk_vp9_end_frame,
364 .free_frame_priv = &vk_vp9_free_frame_priv,
365 .frame_priv_data_size = sizeof(VP9VulkanDecodePicture),
367 .update_thread_context = &ff_vk_update_thread_context,
369 .frame_params = &ff_vk_frame_params,
370 .priv_data_size = sizeof(FFVulkanDecodeContext),
371 .caps_internal = HWACCEL_CAP_ASYNC_SAFE,
372};
static AVFormatContext * ctx
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
@ VP9_ALTREF_FRAME
Definition cbs_vp9.h:72
@ VP9_LAST_FRAME
Definition cbs_vp9.h:70
#define NULL
Definition coverity.c:32
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
@ AV_CODEC_ID_VP9
Definition codec_id.h:217
#define AV_LOG_VERBOSE
Detailed information.
Definition log.h:226
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
const struct FFHWAccel ff_vp9_vulkan_hwaccel
Definition vulkan_vp9.c:356
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define av_unused
Definition attributes.h:164
static const int remap[16]
Definition msvideo1enc.c:66
const char data[16]
Definition mxf.c:149
int profile
Definition mxfenc.c:2299
const AVPixFmtDescriptor * av_pix_fmt_desc_get(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3460
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition pixfmt.h:379
A reference to a data buffer.
Definition buffer.h:82
main external API structure.
Definition avcodec.h:443
enum AVPixelFormat sw_pix_fmt
Nominal unaccelerated pixel format, see AV_PIX_FMT_xxx.
Definition avcodec.h:650
struct AVCodecInternal * internal
Private context used for internal data.
Definition avcodec.h:478
void * priv_data
Definition avcodec.h:470
void * hwaccel_priv_data
hwaccel-specific private data
Definition internal.h:130
This structure describes decoded (raw) audio or video data.
Definition frame.h:472
int width
Definition frame.h:544
int height
Definition frame.h:544
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition hwcontext.h:63
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
uint8_t log2_chroma_w
Amount to shift the luma width right to find the chroma width.
Definition pixdesc.h:80
uint8_t log2_chroma_h
Amount to shift the luma height right to find the chroma height.
Definition pixdesc.h:89
void * priv_data
Internal codec-specific data.
Definition cbs.h:247
uint8_t feature_enabled[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
Definition cbs_vp9.h:213
uint8_t feature_value[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
Definition cbs_vp9.h:214
int8_t loop_filter_ref_deltas[VP9_MAX_REF_FRAMES]
Definition cbs_vp9.h:209
uint8_t segmentation_pred_prob[3]
Definition cbs_vp9.h:212
int8_t loop_filter_mode_deltas[2]
Definition cbs_vp9.h:210
uint8_t segmentation_tree_probs[7]
Definition cbs_vp9.h:211
uint8_t feature_sign[VP9_MAX_SEGMENTS][VP9_SEG_LVL_MAX]
Definition cbs_vp9.h:215
FFVulkanDecodeShared * shared_ctx
struct FFVulkanDecodePicture::@321376256110110067000314232201030232256240036361 view
VkVideoReferenceSlotInfoKHR ref_slot
VkVideoPictureResourceInfoKHR refs[36]
VkVideoReferenceSlotInfoKHR ref_slots[36]
VkVideoDecodeInfoKHR decode_info
struct AVFrame * f
CodedBitstreamContext * cbc
Definition vp9dec.h:101
VP9SharedContext s
Definition vp9dec.h:98
void * hwaccel_picture_private
RefStruct reference.
Definition vp9shared.h:76
ProgressFrame tf
Definition vp9shared.h:70
VP9RawFrameHeader * frame_header
Definition vp9shared.h:68
uint8_t segmentation_update_map
Definition cbs_vp9.h:147
uint8_t tile_rows_log2
Definition cbs_vp9.h:159
uint8_t ref_frame_idx[VP9_REFS_PER_FRAME]
Definition cbs_vp9.h:107
uint8_t base_q_idx
Definition cbs_vp9.h:140
uint8_t loop_filter_delta_update
Definition cbs_vp9.h:133
uint8_t update_mode_delta[2]
Definition cbs_vp9.h:136
uint8_t refresh_frame_flags
Definition cbs_vp9.h:102
uint8_t color_range
Definition cbs_vp9.h:98
uint8_t color_space
Definition cbs_vp9.h:97
int8_t delta_q_uv_ac
Definition cbs_vp9.h:143
uint8_t refresh_frame_context
Definition cbs_vp9.h:112
uint8_t segmentation_abs_or_delta_update
Definition cbs_vp9.h:152
uint8_t ref_frame_sign_bias[VP9_MAX_REF_FRAMES]
Definition cbs_vp9.h:108
uint8_t segmentation_update_data
Definition cbs_vp9.h:151
uint8_t tile_cols_log2
Definition cbs_vp9.h:158
uint8_t intra_only
Definition cbs_vp9.h:104
uint8_t raw_interpolation_filter_type
Definition cbs_vp9.h:127
uint8_t frame_context_idx
Definition cbs_vp9.h:115
uint8_t error_resilient_mode
Definition cbs_vp9.h:93
uint8_t loop_filter_sharpness
Definition cbs_vp9.h:131
uint8_t segmentation_temporal_update
Definition cbs_vp9.h:149
int8_t delta_q_y_dc
Definition cbs_vp9.h:141
uint8_t allow_high_precision_mv
Definition cbs_vp9.h:110
uint8_t reset_frame_context
Definition cbs_vp9.h:105
uint8_t frame_parallel_decoding_mode
Definition cbs_vp9.h:113
uint8_t frame_type
Definition cbs_vp9.h:91
int8_t delta_q_uv_dc
Definition cbs_vp9.h:142
uint8_t segmentation_enabled
Definition cbs_vp9.h:146
uint8_t profile_low_bit
Definition cbs_vp9.h:85
uint8_t loop_filter_level
Definition cbs_vp9.h:130
uint8_t loop_filter_delta_enabled
Definition cbs_vp9.h:132
uint8_t ten_or_twelve_bit
Definition cbs_vp9.h:96
uint8_t is_filter_switchable
Definition cbs_vp9.h:126
uint8_t update_ref_delta[VP9_MAX_REF_FRAMES]
Definition cbs_vp9.h:134
uint8_t profile_high_bit
Definition cbs_vp9.h:86
StdVideoVP9LoopFilter loop_filter
Definition vulkan_vp9.c:44
StdVideoDecodeVP9PictureInfo std_pic_info
Definition vulkan_vp9.c:45
StdVideoVP9ColorConfig color_config
Definition vulkan_vp9.c:42
VkVideoDecodeVP9PictureInfoKHR vp9_pic_info
Definition vulkan_vp9.c:46
StdVideoVP9Segmentation segmentation
Definition vulkan_vp9.c:43
const VP9Frame * ref_src[8]
Definition vulkan_vp9.c:48
FFVulkanDecodePicture vp
Definition vulkan_vp9.c:35
uint8_t ref_frame_sign_bias_mask
Definition vulkan_vp9.c:52
FFVulkanDecodeContext * dec
Definition vulkan_vp9.c:39
#define av_log(a,...)
static int ref[MAX_W *MAX_W]
static char buffer[20]
Definition seek.c:32
int size
RefStruct is an API for creating reference-counted objects with minimal overhead.
Definition refstruct.h:58
#define CUR_FRAME
Definition vp9shared.h:172
int ff_vk_decode_frame(AVCodecContext *avctx, AVFrame *pic, FFVulkanDecodePicture *vp, AVFrame *rpic[], FFVulkanDecodePicture *rvkp[])
Decode a frame.
int ff_vk_update_thread_context(AVCodecContext *dst, const AVCodecContext *src)
Synchronize the contexts between 2 threads.
int ff_vk_decode_init(AVCodecContext *avctx)
Initialize 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...
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.
void ff_vk_decode_free_frame(AVHWDeviceContext *dev_ctx, FFVulkanDecodePicture *vp)
Free a frame and its state.
int ff_vk_decode_uninit(AVCodecContext *avctx)
Free decoder.
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.
#define FF_VK_EXT_VIDEO_DECODE_VP9
static int vk_vp9_fill_pict(AVCodecContext *avctx, const VP9Frame **ref_src, VkVideoReferenceSlotInfoKHR *ref_slot, VkVideoPictureResourceInfoKHR *ref, const VP9Frame *pic, int is_current)
Definition vulkan_vp9.c:55
static void vk_vp9_free_frame_priv(AVRefStructOpaque _hwctx, void *data)
Definition vulkan_vp9.c:347
static enum StdVideoVP9InterpolationFilter remap_interp(uint8_t is_filter_switchable, uint8_t raw_interpolation_filter_type)
Definition vulkan_vp9.c:91
static int vk_vp9_start_frame(AVCodecContext *avctx, av_unused const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
Definition vulkan_vp9.c:105
static int vk_vp9_end_frame(AVCodecContext *avctx)
Definition vulkan_vp9.c:323
const FFVulkanDecodeDescriptor ff_vk_dec_vp9_desc
Definition vulkan_vp9.c:23
static int vk_vp9_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)
Definition vulkan_vp9.c:307
static int ref_frame(VVCFrame *dst, const VVCFrame *src)
Definition dec.c:616