FFmpeg
Loading...
Searching...
No Matches
vulkan_prores_raw.c
Go to the documentation of this file.
1/*
2 * Copyright (c) 2025 Lynne <dev@lynne.ee>
3 *
4 * This file is part of FFmpeg.
5 *
6 * FFmpeg is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
10 *
11 * FFmpeg is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
15 *
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with FFmpeg; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19 */
20
21#include "vulkan_decode.h"
22#include "hwaccel_internal.h"
23
24#include "prores_raw.h"
25#include "libavutil/mem.h"
26
27extern const unsigned char ff_prores_raw_decode_comp_spv_data[];
28extern const unsigned int ff_prores_raw_decode_comp_spv_len;
29
30extern const unsigned char ff_prores_raw_idct_comp_spv_data[];
31extern const unsigned int ff_prores_raw_idct_comp_spv_len;
32
34 .codec_id = AV_CODEC_ID_PRORES_RAW,
35 .queue_flags = VK_QUEUE_COMPUTE_BIT,
36};
37
44
51
52typedef struct DecodePushData {
53 VkDeviceAddress pkt_data;
54 uint8_t qmat[64];
55 uint16_t lin_curve[8];
57
58typedef struct TileData {
60 uint32_t offset;
61 uint32_t size;
63} TileData;
64
66 const AVBufferRef *buffer_ref,
67 av_unused const uint8_t *buffer,
68 av_unused uint32_t size)
69{
70 int err;
73 ProResRAWVulkanDecodeContext *prv = ctx->sd_ctx;
74 ProResRAWContext *prr = avctx->priv_data;
75
77 FFVulkanDecodePicture *vp = &pp->vp;
78
79 /* Host map the input tile data if supported */
80 if (ctx->s.extensions & FF_VK_EXT_EXTERNAL_HOST_MEMORY)
81 ff_vk_host_map_buffer(&ctx->s, &vp->slices_buf, buffer_ref->data,
82 VK_WHOLE_SIZE, buffer_ref,
83 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT |
84 VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT);
85
86 /* Allocate tile data */
88 &pp->frame_data_buf,
89 VK_BUFFER_USAGE_STORAGE_BUFFER_BIT,
90 NULL, prr->nb_tiles*sizeof(TileData),
91 VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT |
92 VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT);
93 if (err < 0)
94 return err;
95
96 return 0;
97}
98
100 const uint8_t *data,
101 uint32_t size)
102{
103 ProResRAWContext *prr = avctx->priv_data;
104
106 FFVulkanDecodePicture *vp = &pp->vp;
107
108 FFVkBuffer *frame_data_buf = pp->frame_data_buf;
109 TileData *td = (TileData *)frame_data_buf->mapped_mem;
110 FFVkBuffer *slices_buf = vp->slices_buf;
111
112 td[pp->nb_tiles].pos[0] = prr->tiles[pp->nb_tiles].x;
113 td[pp->nb_tiles].pos[1] = prr->tiles[pp->nb_tiles].y;
114 td[pp->nb_tiles].size = size;
116
117 if (vp->slices_buf && slices_buf->host_ref) {
118 td[pp->nb_tiles].offset = data - slices_buf->mapped_mem;
119 pp->nb_tiles++;
120 } else {
121 int err;
122 td[pp->nb_tiles].offset = vp->slices_size;
123 err = ff_vk_decode_add_slice(avctx, vp, data, size, 0,
124 &pp->nb_tiles, NULL);
125 if (err < 0)
126 return err;
127 }
128
129 return 0;
130}
131
133{
134 int err;
137 FFVulkanFunctions *vk = &ctx->s.vkfn;
138
139 ProResRAWContext *prr = avctx->priv_data;
140 ProResRAWVulkanDecodeContext *prv = ctx->sd_ctx;
141
143 FFVulkanDecodePicture *vp = &pp->vp;
144
145 FFVkBuffer *slices_buf = vp->slices_buf;
146 FFVkBuffer *frame_data_buf = pp->frame_data_buf;
147
148 VkImageMemoryBarrier2 img_bar[8];
149 int nb_img_bar = 0;
150
151 FFVkExecContext *exec = ff_vk_exec_get(&ctx->s, &ctx->exec_pool);
152 err = ff_vk_exec_start(&ctx->s, exec);
153 if (err < 0)
154 return err;
155
156 /* Prepare deps */
157 RET(ff_vk_exec_add_dep_frame(&ctx->s, exec, prr->frame,
158 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
159 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT));
160
161 /* Exec-owned output views: freed on exec recycle, so releasing a picture
162 * needs no blocking wait. No mirror_sem: nothing consumes vp->sem here. */
163 VkImageView views[AV_NUM_DATA_POINTERS];
164 RET(ff_vk_create_imageviews(&ctx->s, exec, views, prr->frame,
166
169
170 AVVkFrame *vkf = (AVVkFrame *)prr->frame->data[0];
171 vkf->layout[0] = VK_IMAGE_LAYOUT_UNDEFINED;
172 vkf->access[0] = VK_ACCESS_2_NONE;
173
174 ff_vk_frame_barrier(&ctx->s, exec, prr->frame, img_bar, &nb_img_bar,
175 VK_PIPELINE_STAGE_2_ALL_COMMANDS_BIT,
176 VK_PIPELINE_STAGE_2_CLEAR_BIT,
177 VK_ACCESS_2_TRANSFER_WRITE_BIT,
178 VK_IMAGE_LAYOUT_GENERAL,
179 VK_QUEUE_FAMILY_IGNORED);
180
181 vk->CmdPipelineBarrier2(exec->buf, &(VkDependencyInfo) {
182 .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO,
183 .pImageMemoryBarriers = img_bar,
184 .imageMemoryBarrierCount = nb_img_bar,
185 });
186 nb_img_bar = 0;
187
188 vk->CmdClearColorImage(exec->buf, vkf->img[0],
189 VK_IMAGE_LAYOUT_GENERAL,
190 &((VkClearColorValue) { 0 }),
191 1, &((VkImageSubresourceRange) {
192 .aspectMask = VK_IMAGE_ASPECT_COLOR_BIT,
193 .levelCount = 1,
194 .layerCount = 1,
195 }));
196
197 ff_vk_frame_barrier(&ctx->s, exec, prr->frame, img_bar, &nb_img_bar,
198 VK_PIPELINE_STAGE_2_CLEAR_BIT,
199 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT,
200 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT,
201 VK_IMAGE_LAYOUT_GENERAL,
202 VK_QUEUE_FAMILY_IGNORED);
203
204 vk->CmdPipelineBarrier2(exec->buf, &(VkDependencyInfo) {
205 .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO,
206 .pImageMemoryBarriers = img_bar,
207 .imageMemoryBarrierCount = nb_img_bar,
208 });
209 nb_img_bar = 0;
210
211 FFVulkanShader *decode_shader = &prv->decode;
212 ff_vk_shader_update_img_array(&ctx->s, exec, decode_shader,
213 prr->frame, views,
214 0, 0,
215 VK_IMAGE_LAYOUT_GENERAL,
216 VK_NULL_HANDLE);
217 ff_vk_shader_update_desc_buffer(&ctx->s, exec, decode_shader,
218 0, 1, 0,
219 frame_data_buf,
220 0, prr->nb_tiles*sizeof(TileData),
221 VK_FORMAT_UNDEFINED);
222
223 ff_vk_exec_bind_shader(&ctx->s, exec, decode_shader);
224
225 /* Update push data */
226 DecodePushData pd_decode = (DecodePushData) {
227 .pkt_data = slices_buf->address,
228 };
229 /* The decoder permutes the quantization matrix to match the layout
230 * expected by its IDCT, undo it here. */
231 for (int i = 0; i < 64; i++)
232 pd_decode.qmat[prr->prodsp.idct_permutation[i]] = prr->qmat[i];
233 memcpy(pd_decode.lin_curve, prr->lin_curve, sizeof(pd_decode.lin_curve));
234 ff_vk_shader_update_push_const(&ctx->s, exec, decode_shader,
235 VK_SHADER_STAGE_COMPUTE_BIT,
236 0, offsetof(DecodePushData, qmat), &pd_decode);
237
238 vk->CmdDispatch(exec->buf, prr->nb_tw, prr->nb_th, 1);
239
240 ff_vk_frame_barrier(&ctx->s, exec, prr->frame, img_bar, &nb_img_bar,
241 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT,
242 VK_PIPELINE_STAGE_2_COMPUTE_SHADER_BIT,
243 VK_ACCESS_2_SHADER_STORAGE_READ_BIT |
244 VK_ACCESS_2_SHADER_STORAGE_WRITE_BIT,
245 VK_IMAGE_LAYOUT_GENERAL,
246 VK_QUEUE_FAMILY_IGNORED);
247
248 FFVulkanShader *idct_shader = &prv->idct;
249 ff_vk_shader_update_img_array(&ctx->s, exec, idct_shader,
250 prr->frame, views,
251 0, 0,
252 VK_IMAGE_LAYOUT_GENERAL,
253 VK_NULL_HANDLE);
254 ff_vk_shader_update_desc_buffer(&ctx->s, exec, idct_shader,
255 0, 1, 0,
256 frame_data_buf,
257 0, prr->nb_tiles*sizeof(TileData),
258 VK_FORMAT_UNDEFINED);
259 ff_vk_exec_bind_shader(&ctx->s, exec, idct_shader);
260 ff_vk_shader_update_push_const(&ctx->s, exec, idct_shader,
261 VK_SHADER_STAGE_COMPUTE_BIT,
262 0, sizeof(pd_decode), &pd_decode);
263
264 vk->CmdPipelineBarrier2(exec->buf, &(VkDependencyInfo) {
265 .sType = VK_STRUCTURE_TYPE_DEPENDENCY_INFO,
266 .pImageMemoryBarriers = img_bar,
267 .imageMemoryBarrierCount = nb_img_bar,
268 });
269 nb_img_bar = 0;
270
271 vk->CmdDispatch(exec->buf, prr->nb_tw, prr->nb_th, 1);
272
273 err = ff_vk_exec_submit(&ctx->s, exec);
274 if (err < 0)
275 return err;
276
277 return 0;
278
279fail:
280 ff_vk_exec_discard(&ctx->s, exec);
281 return 0;
282}
283
285 FFVulkanShader *shd)
286{
287 const FFVulkanDescriptorSetBinding desc_set[] = {
288 { /* dst */
289 .type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
290 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
291 },
292 { /* frame_data_buf */
293 .type = VK_DESCRIPTOR_TYPE_STORAGE_BUFFER,
294 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
295 },
296 };
297
298 ff_vk_shader_add_descriptor_set(s, shd, desc_set, 2, 0);
299
300 return 0;
301}
302
304 FFVkExecPool *pool, FFVulkanShader *shd,
305 int version)
306{
307 int err;
308
309 /* Discrete GPUs read host-mapped packets over the bus; prefetch more
310 * to hide the latency. Integrated GPUs would only lose shared memory. */
311 int deep_prefetch = s->props.properties.deviceType ==
312 VK_PHYSICAL_DEVICE_TYPE_DISCRETE_GPU &&
313 (s->extensions & FF_VK_EXT_EXTERNAL_HOST_MEMORY);
314 SPEC_LIST_CREATE(sl, 1, sizeof(uint32_t))
315 SPEC_LIST_ADD(sl, 0, 32, deep_prefetch ? 64 : 4);
316
317 ff_vk_shader_add_push_const(shd, 0, offsetof(DecodePushData, qmat),
318 VK_SHADER_STAGE_COMPUTE_BIT);
319 ff_vk_shader_load(shd, VK_SHADER_STAGE_COMPUTE_BIT, sl,
320 (uint32_t []) { 1, 4, 1 }, 0);
321
322 add_desc(avctx, s, shd);
323
327
328 RET(ff_vk_shader_register_exec(s, pool, shd));
329
330fail:
331 return err;
332}
333
335 FFVkExecPool *pool, FFVulkanShader *shd,
336 int version)
337{
338 int err;
339 SPEC_LIST_CREATE(sl, 2 + 8, (2 + 8)*sizeof(uint32_t))
340
341 int nb_blocks = version == 0 ? 8 : 16;
342 SPEC_LIST_ADD(sl, 16, 32, nb_blocks);
343 SPEC_LIST_ADD(sl, 17, 32, 4); /* nb_components */
344
345 const double idct_8_scales[8] = {
346 cos(4.0*M_PI/16.0) / 2.0, cos(1.0*M_PI/16.0) / 2.0,
347 cos(2.0*M_PI/16.0) / 2.0, cos(3.0*M_PI/16.0) / 2.0,
348 cos(4.0*M_PI/16.0) / 2.0, cos(5.0*M_PI/16.0) / 2.0,
349 cos(6.0*M_PI/16.0) / 2.0, cos(7.0*M_PI/16.0) / 2.0,
350 };
351 for (int i = 0; i < 8; i++)
352 SPEC_LIST_ADD(sl, 18 + i, 32, av_float2int(idct_8_scales[i]));
353
354 ff_vk_shader_load(shd, VK_SHADER_STAGE_COMPUTE_BIT, sl,
355 (uint32_t []) { 8, nb_blocks, 4 }, 0);
356
358 VK_SHADER_STAGE_COMPUTE_BIT);
359 add_desc(avctx, s, shd);
360
364
365 RET(ff_vk_shader_register_exec(s, pool, shd));
366
367fail:
368 return err;
369}
370
372{
373 ProResRAWVulkanDecodeContext *fv = ctx->sd_ctx;
374
375 ff_vk_shader_free(&ctx->s, &fv->decode);
376 ff_vk_shader_free(&ctx->s, &fv->idct);
377
379
380 av_freep(&fv);
381}
382
384{
385 int err;
387 ProResRAWContext *prr = avctx->priv_data;
388
389 err = ff_vk_decode_init(avctx);
390 if (err < 0)
391 return err;
392
394 ProResRAWVulkanDecodeContext *prv = ctx->sd_ctx = av_mallocz(sizeof(*prv));
395 if (!prv) {
396 err = AVERROR(ENOMEM);
397 goto fail;
398 }
399
400 ctx->sd_ctx_free = &vk_decode_prores_raw_uninit;
401
402 /* Setup decode shader */
403 RET(init_decode_shader(avctx, &ctx->s, &ctx->exec_pool, &prv->decode,
404 prr->version));
405 RET(init_idct_shader(avctx, &ctx->s, &ctx->exec_pool, &prv->idct,
406 prr->version));
407
408fail:
409 return err;
410}
411
413{
414 AVHWDeviceContext *dev_ctx = _hwctx.nc;
415
417 FFVulkanDecodePicture *vp = &pp->vp;
418
419 ff_vk_decode_free_frame(dev_ctx, vp);
420
422}
423
425 .p.name = "prores_raw_vulkan",
426 .p.type = AVMEDIA_TYPE_VIDEO,
428 .p.pix_fmt = AV_PIX_FMT_VULKAN,
429 .start_frame = &vk_prores_raw_start_frame,
430 .decode_slice = &vk_prores_raw_decode_slice,
431 .end_frame = &vk_prores_raw_end_frame,
432 .free_frame_priv = &vk_prores_raw_free_frame_priv,
433 .frame_priv_data_size = sizeof(ProResRAWVulkanDecodePicture),
435 .update_thread_context = &ff_vk_update_thread_context,
437 .frame_params = &ff_vk_frame_params,
438 .priv_data_size = sizeof(FFVulkanDecodeContext),
440};
static AVFormatContext * ctx
int32_t
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define NULL
Definition coverity.c:32
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define AV_NUM_DATA_POINTERS
Definition frame.h:473
#define fail
Definition test.h:479
@ AV_CODEC_ID_PRORES_RAW
Definition codec_id.h:324
#define AVERROR(e)
Definition error.h:45
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
#define HWACCEL_CAP_ASYNC_SAFE
Header providing the internals of AVHWAccel.
#define HWACCEL_CAP_THREAD_SAFE
const struct FFHWAccel ff_prores_raw_vulkan_hwaccel
static av_always_inline uint32_t av_float2int(float f)
Reinterpret a float as a 32-bit integer.
Definition intfloat.h:50
static av_cold void uninit(AVBitStreamFilterContext *ctx)
#define av_unused
Definition attributes.h:164
void ff_vk_shader_update_img_array(FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, AVFrame *f, VkImageView *views, int set, int binding, VkImageLayout layout, VkSampler sampler)
Update a descriptor in a buffer with an image array.
Definition vulkan.c:2690
int ff_vk_shader_load(FFVulkanShader *shd, VkPipelineStageFlags stage, VkSpecializationInfo *spec, uint32_t wg_size[3], uint32_t required_subgroup_size)
Initialize a shader object.
Definition vulkan.c:2262
void ff_vk_shader_add_descriptor_set(FFVulkanContext *s, FFVulkanShader *shd, const FFVulkanDescriptorSetBinding *desc, int nb, int singular)
Add descriptor to a shader.
Definition vulkan.c:2521
int ff_vk_shader_add_push_const(FFVulkanShader *shd, int offset, int size, VkShaderStageFlagBits stage)
Add/update push constants for execution.
Definition vulkan.c:1631
void ff_vk_frame_barrier(FFVulkanContext *s, FFVkExecContext *e, AVFrame *pic, VkImageMemoryBarrier2 *bar, int *nb_bar, VkPipelineStageFlags2 src_stage, VkPipelineStageFlags2 dst_stage, VkAccessFlagBits2 new_access, VkImageLayout new_layout, uint32_t new_qf)
Definition vulkan.c:2216
int ff_vk_exec_start(FFVulkanContext *s, FFVkExecContext *e)
Start/submit/wait an execution.
Definition vulkan.c:664
int ff_vk_create_imageviews(FFVulkanContext *s, FFVkExecContext *e, VkImageView views[AV_NUM_DATA_POINTERS], AVFrame *f, enum FFVkShaderRepFormat rep_fmt)
Create an imageview and add it as a dependency to an execution.
Definition vulkan.c:2147
void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd)
Free a shader.
Definition vulkan.c:2757
int ff_vk_shader_register_exec(FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd)
Register a shader with an exec pool.
Definition vulkan.c:2555
FFVkExecContext * ff_vk_exec_get(FFVulkanContext *s, FFVkExecPool *pool)
Retrieve an execution pool.
Definition vulkan.c:626
int ff_vk_exec_submit(FFVulkanContext *s, FFVkExecContext *e)
Definition vulkan.c:987
void ff_vk_exec_bind_shader(FFVulkanContext *s, FFVkExecContext *e, const FFVulkanShader *shd)
Bind a shader.
Definition vulkan.c:2739
void ff_vk_exec_move_dep_refstruct(FFVulkanContext *s, FFVkExecContext *e, void *obj)
Definition vulkan.c:790
int ff_vk_shader_update_desc_buffer(FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, int set, int bind, int elem, FFVkBuffer *buf, VkDeviceSize offset, VkDeviceSize len, VkFormat fmt)
Update a descriptor in a buffer with a buffer.
Definition vulkan.c:2703
int ff_vk_host_map_buffer(FFVulkanContext *s, FFVkBuffer **dst, uint8_t *src_data, VkDeviceSize size, const AVBufferRef *src_buf, VkBufferUsageFlags usage)
Maps a system RAM buffer into a Vulkan buffer.
Definition vulkan.c:1540
int ff_vk_get_pooled_buffer(FFVulkanContext *ctx, AVRefStructPool **buf_pool, FFVkBuffer **buf, VkBufferUsageFlags usage, void *create_pNext, size_t size, VkMemoryPropertyFlagBits mem_props)
Initialize a pool and create AVBufferRefs containing FFVkBuffer.
Definition vulkan.c:1444
void ff_vk_exec_discard(FFVulkanContext *s, FFVkExecContext *e)
Definition vulkan.c:767
int ff_vk_shader_link(FFVulkanContext *s, FFVulkanShader *shd, const char *spirv, size_t spirv_len, const char *entrypoint)
Link a shader into an executable.
Definition vulkan.c:2425
int ff_vk_exec_add_dep_frame(FFVulkanContext *s, FFVkExecContext *e, AVFrame *f, VkPipelineStageFlagBits2 wait_stage, VkPipelineStageFlagBits2 signal_stage)
Definition vulkan.c:885
void ff_vk_shader_update_push_const(FFVulkanContext *s, FFVkExecContext *e, FFVulkanShader *shd, VkShaderStageFlagBits stage, int offset, size_t size, void *src)
Update push constant in a shader.
Definition vulkan.c:2729
version
Definition libkvazaar.c:313
#define M_PI
Definition mathematics.h:67
Memory handling functions.
const char data[16]
Definition mxf.c:149
@ AV_PIX_FMT_VULKAN
Vulkan hardware images.
Definition pixfmt.h:379
void av_refstruct_unref(void *objp)
Decrement the reference count of the underlying object and automatically free the object if there are...
Definition refstruct.c:121
static void av_refstruct_pool_uninit(AVRefStructPool **poolp)
Mark the pool as being available for freeing.
Definition refstruct.h:292
A reference to a data buffer.
Definition buffer.h:82
uint8_t * data
The data buffer.
Definition buffer.h:90
main external API structure.
Definition avcodec.h:443
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
uint8_t * data[AV_NUM_DATA_POINTERS]
pointer to the picture/channel planes.
Definition frame.h:493
This struct aggregates all the (hardware/vendor-specific) "high-level" state, i.e.
Definition hwcontext.h:63
AVRefStructPool is an API for a thread-safe pool of objects managed via the RefStruct API.
Definition refstruct.c:184
VkImageLayout layout[AV_NUM_DATA_POINTERS]
VkAccessFlagBits2 access[AV_NUM_DATA_POINTERS]
Updated after every barrier.
VkImage img[AV_NUM_DATA_POINTERS]
Vulkan images to which the memory is bound to.
uint16_t lin_curve[8]
VkDeviceAddress pkt_data
VkDeviceAddress address
Definition vulkan.h:99
AVBufferRef * host_ref
Definition vulkan.h:111
uint8_t * mapped_mem
Definition vulkan.h:103
VkCommandBuffer buf
Definition vulkan.h:142
FFVulkanDecodeShared * shared_ctx
uint16_t lin_curve[8]
Definition prores_raw.h:61
TileContext * tiles
Definition prores_raw.h:43
ProresDSPContext prodsp
Definition prores_raw.h:40
uint8_t qmat[64]
Definition prores_raw.h:56
AVFrame * frame
Definition prores_raw.h:50
void * hwaccel_picture_private
Definition prores_raw.h:51
uint8_t idct_permutation[64]
Definition proresdsp.h:31
int log2_nb_blocks
Definition prores_raw.h:36
unsigned y
Definition prores_raw.h:35
unsigned x
Definition prores_raw.h:35
uint32_t offset
int32_t pos[2]
uint32_t log2_nb_blocks
uint32_t size
#define av_mallocz(s)
#define av_freep(p)
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
@ FF_VK_REP_NATIVE
Definition vulkan.h:440
#define RET(x)
Definition vulkan.h:37
#define SPEC_LIST_ADD(name, idx, val_bits, val)
Definition vulkan.h:55
#define SPEC_LIST_CREATE(name, max_length, max_size)
Definition vulkan.h:45
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.
#define FF_VK_EXT_EXTERNAL_HOST_MEMORY
const unsigned char ff_prores_raw_decode_comp_spv_data[]
const unsigned char ff_prores_raw_idct_comp_spv_data[]
static int vk_prores_raw_decode_slice(AVCodecContext *avctx, const uint8_t *data, uint32_t size)
static void vk_decode_prores_raw_uninit(FFVulkanDecodeShared *ctx)
static int vk_prores_raw_start_frame(AVCodecContext *avctx, const AVBufferRef *buffer_ref, av_unused const uint8_t *buffer, av_unused uint32_t size)
static int vk_decode_prores_raw_init(AVCodecContext *avctx)
static int add_desc(AVCodecContext *avctx, FFVulkanContext *s, FFVulkanShader *shd)
static void vk_prores_raw_free_frame_priv(AVRefStructOpaque _hwctx, void *data)
const FFVulkanDecodeDescriptor ff_vk_dec_prores_raw_desc
const unsigned int ff_prores_raw_decode_comp_spv_len
const unsigned int ff_prores_raw_idct_comp_spv_len
static int init_decode_shader(AVCodecContext *avctx, FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd, int version)
static int vk_prores_raw_end_frame(AVCodecContext *avctx)
static int init_idct_shader(AVCodecContext *avctx, FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd, int version)