FFmpeg
Loading...
Searching...
No Matches
vf_v360_vulkan.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 "libavutil/opt.h"
20#include "vulkan_filter.h"
21
22#include "v360.h"
23#include "filters.h"
24#include "video.h"
25
26extern const unsigned char ff_v360_comp_spv_data[];
27extern const unsigned int ff_v360_comp_spv_len;
28
29typedef struct V360ulkanContext {
31
36 VkSampler sampler;
37
38 /* Options */
41 int in, out;
43 float h_fov, v_fov;
44 float ih_fov, iv_fov;
45 float yaw, pitch, roll;
46 char *rorder;
49
50/* Push constants */
51struct PushData {
52 float rot_mat[4][4];
53 int in_img_size[4][2];
54 float iflat_range[2];
55 float flat_range[2];
56};
57
58static int get_rorder(char c)
59{
60 switch (c) {
61 case 'Y':
62 case 'y':
63 return YAW;
64 case 'P':
65 case 'p':
66 return PITCH;
67 case 'R':
68 case 'r':
69 return ROLL;
70 default:
71 return -1;
72 }
73}
74
76{
77 int err;
78 V360VulkanContext *s = ctx->priv;
79 FFVulkanContext *vkctx = &s->vkctx;
80 const int planes = av_pix_fmt_count_planes(s->vkctx.output_format);
81
82 for (int order = 0; order < NB_RORDERS; order++) {
83 const char c = s->rorder[order];
84 int rorder;
85
86 if (c == '\0') {
88 "Incomplete rorder option. "
89 "Direction for all 3 rotation orders should be specified. "
90 "Switching to default rorder.\n");
91 s->rotation_order[0] = YAW;
92 s->rotation_order[1] = PITCH;
93 s->rotation_order[2] = ROLL;
94 break;
95 }
96
97 rorder = get_rorder(c);
98 if (rorder == -1) {
100 "Incorrect rotation order symbol '%c' in rorder option. "
101 "Switching to default rorder.\n", c);
102 s->rotation_order[0] = YAW;
103 s->rotation_order[1] = PITCH;
104 s->rotation_order[2] = ROLL;
105 break; }
106
107 s->rotation_order[order] = rorder;
108 }
109
110 RET(ff_vk_init_sampler(vkctx, &s->sampler, 0, VK_FILTER_LINEAR));
111
112 s->qf = ff_vk_qf_find(vkctx, VK_QUEUE_COMPUTE_BIT, 0);
113 if (!s->qf) {
114 av_log(ctx, AV_LOG_ERROR, "Device has no compute queues\n");
115 err = AVERROR(ENOTSUP);
116 goto fail;
117 }
118
119 RET(ff_vk_exec_pool_init(vkctx, s->qf, &s->e, 2, 0, 0, 0, NULL));
120
121 SPEC_LIST_CREATE(sl, 4, 2*sizeof(int) + 2*sizeof(float))
122 SPEC_LIST_ADD(sl, 0, 32, s->out);
123 SPEC_LIST_ADD(sl, 1, 32, s->in);
124
125 const float m_pi = M_PI, m_pi2 = M_PI_2;
126 SPEC_LIST_ADD(sl, 2, 32, av_float2int(m_pi));
127 SPEC_LIST_ADD(sl, 3, 32, av_float2int(m_pi2));
128
129 ff_vk_shader_load(&s->shd, VK_SHADER_STAGE_COMPUTE_BIT,
130 sl, (uint32_t []) { 16, 16, 1 }, 0);
131
132 ff_vk_shader_add_push_const(&s->shd, 0, sizeof(struct PushData),
133 VK_SHADER_STAGE_COMPUTE_BIT);
134
135 const FFVulkanDescriptorSetBinding desc_set[] = {
136 { /* input_img */
137 .type = VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER,
138 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
139 .elems = planes,
140 .samplers = DUP_SAMPLER(s->sampler),
141 },
142 { /* output_img */
143 .type = VK_DESCRIPTOR_TYPE_STORAGE_IMAGE,
144 .stages = VK_SHADER_STAGE_COMPUTE_BIT,
145 .elems = planes,
146 },
147 };
148 ff_vk_shader_add_descriptor_set(vkctx, &s->shd, desc_set, 2, 0);
149
150 RET(ff_vk_shader_link(vkctx, &s->shd,
152 ff_v360_comp_spv_len, "main"));
153
154 RET(ff_vk_shader_register_exec(vkctx, &s->e, &s->shd));
155
156 s->initialized = 1;
157
158fail:
159 return err;
160}
161
162static void multiply_matrix(float c[4][4], const float a[4][4], const float b[4][4])
163{
164 for (int i = 0; i < 3; i++) {
165 for (int j = 0; j < 3; j++) {
166 float sum = 0.0f;
167 for (int k = 0; k < 3; k++)
168 sum += a[i][k] * b[k][j];
169 c[i][j] = sum;
170 }
171 }
172}
173
174static inline void calculate_iflat_range(int in, float ih_fov, float iv_fov,
175 float *iflat_range)
176{
177 switch (in) {
178 case FLAT:
179 iflat_range[0] = tanf(0.5f * ih_fov * M_PI / 180.f);
180 iflat_range[1] = tanf(0.5f * iv_fov * M_PI / 180.f);
181 break;
182 case STEREOGRAPHIC:
183 iflat_range[0] = tanf(FFMIN(ih_fov, 359.f) * M_PI / 720.f);
184 iflat_range[1] = tanf(FFMIN(iv_fov, 359.f) * M_PI / 720.f);
185 break;
186 case DUAL_FISHEYE:
187 case FISHEYE:
188 iflat_range[0] = ih_fov / 180.f;
189 iflat_range[1] = iv_fov / 180.f;
190 break;
191 default:
192 break;
193 }
194}
195
196static inline void calculate_flat_range(int out, float h_fov, float v_fov,
197 float *flat_range)
198{
199 switch (out) {
200 case FLAT:
201 flat_range[0] = tanf(0.5f * h_fov * M_PI / 180.f);
202 flat_range[1] = tanf(0.5f * v_fov * M_PI / 180.f);
203 break;
204 case STEREOGRAPHIC:
205 flat_range[0] = tanf(FFMIN(h_fov, 359.f) * M_PI / 720.f);
206 flat_range[1] = tanf(FFMIN(v_fov, 359.f) * M_PI / 720.f);
207 break;
208 case DUAL_FISHEYE:
209 case FISHEYE:
210 flat_range[0] = h_fov / 180.f;
211 flat_range[1] = v_fov / 180.f;
212 break;
213 default:
214 break;
215 }
216}
217
218static inline void calculate_rotation_matrix(float yaw, float pitch, float roll,
219 float rot_mat[4][4],
220 const int rotation_order[3])
221{
222 const float yaw_rad = yaw * M_PI / 180.f;
223 const float pitch_rad = pitch * M_PI / 180.f;
224 const float roll_rad = roll * M_PI / 180.f;
225
226 const float sin_yaw = sinf(yaw_rad);
227 const float cos_yaw = cosf(yaw_rad);
228 const float sin_pitch = sinf(pitch_rad);
229 const float cos_pitch = cosf(pitch_rad);
230 const float sin_roll = sinf(roll_rad);
231 const float cos_roll = cosf(roll_rad);
232
233 float m[3][4][4];
234 float temp[4][4];
235
236 m[0][0][0] = cos_yaw; m[0][0][1] = 0; m[0][0][2] = sin_yaw;
237 m[0][1][0] = 0; m[0][1][1] = 1; m[0][1][2] = 0;
238 m[0][2][0] = -sin_yaw; m[0][2][1] = 0; m[0][2][2] = cos_yaw;
239
240 m[1][0][0] = 1; m[1][0][1] = 0; m[1][0][2] = 0;
241 m[1][1][0] = 0; m[1][1][1] = cos_pitch; m[1][1][2] = -sin_pitch;
242 m[1][2][0] = 0; m[1][2][1] = sin_pitch; m[1][2][2] = cos_pitch;
243
244 m[2][0][0] = cos_roll; m[2][0][1] = -sin_roll; m[2][0][2] = 0;
245 m[2][1][0] = sin_roll; m[2][1][1] = cos_roll; m[2][1][2] = 0;
246 m[2][2][0] = 0; m[2][2][1] = 0; m[2][2][2] = 1;
247
248 multiply_matrix(temp, m[rotation_order[0]], m[rotation_order[1]]);
249 multiply_matrix(rot_mat, temp, m[rotation_order[2]]);
250}
251
253{
254 int err;
255 AVFrame *out = NULL;
256 AVFilterContext *ctx = link->dst;
257 V360VulkanContext *s = ctx->priv;
258 AVFilterLink *outlink = ctx->outputs[0];
259
260 out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
261 if (!out) {
262 err = AVERROR(ENOMEM);
263 goto fail;
264 }
265
266 if (!s->initialized)
267 RET(init_filter(ctx, in));
268
269 /* Push constants */
270 struct PushData pd = { 0 };
271
272 const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(s->vkctx.input_format);
273 pd.in_img_size[0][0] = pd.in_img_size[3][0] = in->width;
274 pd.in_img_size[0][1] = pd.in_img_size[3][1] = in->height;
275 pd.in_img_size[1][0] = pd.in_img_size[2][0] =
276 FF_CEIL_RSHIFT(in->width, desc->log2_chroma_w);
277 pd.in_img_size[1][1] = pd.in_img_size[2][1] =
278 FF_CEIL_RSHIFT(in->height, desc->log2_chroma_h);
279
280 calculate_iflat_range(s->in, s->ih_fov, s->iv_fov, pd.iflat_range);
281 calculate_flat_range(s->out, s->h_fov, s->v_fov, pd.flat_range);
282 calculate_rotation_matrix(s->yaw, s->pitch, s->roll,
283 pd.rot_mat, s->rotation_order);
284
285 RET(ff_vk_filter_process_simple(&s->vkctx, &s->e, &s->shd,
286 out, in, s->sampler, 1,
287 &pd, sizeof(pd)));
288
289 err = av_frame_copy_props(out, in);
290 if (err < 0)
291 goto fail;
292
293 av_frame_free(&in);
294
295 return ff_filter_frame(outlink, out);
296
297fail:
298 av_frame_free(&in);
300 return err;
301}
302
304{
305 V360VulkanContext *s = avctx->priv;
306 FFVulkanContext *vkctx = &s->vkctx;
307 FFVulkanFunctions *vk = &vkctx->vkfn;
308
309 ff_vk_exec_pool_free(vkctx, &s->e);
310 ff_vk_shader_free(vkctx, &s->shd);
311
312 if (s->sampler)
313 vk->DestroySampler(vkctx->hwctx->act_dev, s->sampler,
314 vkctx->hwctx->alloc);
315
316 ff_vk_uninit(&s->vkctx);
317
318 s->initialized = 0;
319}
320
321#define OFFSET(x) offsetof(V360VulkanContext, x)
322#define FLAGS (AV_OPT_FLAG_FILTERING_PARAM | AV_OPT_FLAG_VIDEO_PARAM)
323#define DYNAMIC (FLAGS | AV_OPT_FLAG_RUNTIME_PARAM)
325 { "input", "set input projection", OFFSET(in), AV_OPT_TYPE_INT, {.i64=EQUIRECTANGULAR}, 0, NB_PROJECTIONS-1, FLAGS, "in" },
326 { "e", "equirectangular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIRECTANGULAR}, 0, 0, FLAGS, "in" },
327 { "equirect", "equirectangular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIRECTANGULAR}, 0, 0, FLAGS, "in" },
328 { "flat", "regular video", 0, AV_OPT_TYPE_CONST, {.i64=FLAT}, 0, 0, FLAGS, "in" },
329 { "dfisheye", "dual fisheye", 0, AV_OPT_TYPE_CONST, {.i64=DUAL_FISHEYE}, 0, 0, FLAGS, "in" },
330 { "sg", "stereographic", 0, AV_OPT_TYPE_CONST, {.i64=STEREOGRAPHIC}, 0, 0, FLAGS, "in" },
331 { "fisheye", "fisheye", 0, AV_OPT_TYPE_CONST, {.i64=FISHEYE}, 0, 0, FLAGS, "in" },
332
333 { "output", "set output projection", OFFSET(out), AV_OPT_TYPE_INT, {.i64=FLAT}, 0, NB_PROJECTIONS-1, FLAGS, "out" },
334 { "e", "equirectangular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIRECTANGULAR}, 0, 0, FLAGS, "out" },
335 { "equirect", "equirectangular", 0, AV_OPT_TYPE_CONST, {.i64=EQUIRECTANGULAR}, 0, 0, FLAGS, "out" },
336 { "flat", "regular video", 0, AV_OPT_TYPE_CONST, {.i64=FLAT}, 0, 0, FLAGS, "out" },
337 { "dfisheye", "dual fisheye", 0, AV_OPT_TYPE_CONST, {.i64=DUAL_FISHEYE}, 0, 0, FLAGS, "out" },
338 { "sg", "stereographic", 0, AV_OPT_TYPE_CONST, {.i64=STEREOGRAPHIC}, 0, 0, FLAGS, "out" },
339 { "fisheye", "fisheye", 0, AV_OPT_TYPE_CONST, {.i64=FISHEYE}, 0, 0, FLAGS, "out" },
340
341 { "w", "output width", OFFSET(width), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT16_MAX, FLAGS, "w" },
342 { "h", "output height", OFFSET(height), AV_OPT_TYPE_INT, {.i64 = 0}, 0, INT16_MAX, FLAGS, "h" },
343 { "yaw", "yaw rotation", OFFSET(yaw), AV_OPT_TYPE_FLOAT, {.dbl = 0.0f}, -180.f, 180.f, DYNAMIC, "yaw" },
344 { "pitch", "pitch rotation", OFFSET(pitch), AV_OPT_TYPE_FLOAT, {.dbl = 0.0f}, -180.f, 180.f, DYNAMIC, "pitch" },
345 { "roll", "roll rotation", OFFSET(roll), AV_OPT_TYPE_FLOAT, {.dbl = 0.0f}, -180.f, 180.f, DYNAMIC, "roll" },
346 { "rorder", "rotation order", OFFSET(rorder), AV_OPT_TYPE_STRING, {.str = "ypr"}, 0, 0, FLAGS, "rorder" },
347 { "h_fov", "set output horizontal FOV angle", OFFSET(h_fov), AV_OPT_TYPE_FLOAT, {.dbl = 90.0f}, 0.00001f, 360.0f, DYNAMIC, "h_fov" },
348 { "v_fov", "set output vertical FOV angle", OFFSET(v_fov), AV_OPT_TYPE_FLOAT, {.dbl = 45.0f}, 0.00001f, 360.0f, DYNAMIC, "v_fov" },
349 { "ih_fov", "set input horizontal FOV angle", OFFSET(ih_fov), AV_OPT_TYPE_FLOAT, {.dbl = 90.0f}, 0.00001f, 360.0f, DYNAMIC, "ih_fov" },
350 { "iv_fov", "set input vertical FOV angle", OFFSET(iv_fov), AV_OPT_TYPE_FLOAT, {.dbl = 45.0f}, 0.00001f, 360.0f, DYNAMIC, "iv_fov" },
351
352 { NULL },
353};
354
356
358 {
359 .name = "default",
360 .type = AVMEDIA_TYPE_VIDEO,
361 .filter_frame = &v360_vulkan_filter_frame,
362 .config_props = &ff_vk_filter_config_input,
363 },
364};
365
367 {
368 .name = "default",
369 .type = AVMEDIA_TYPE_VIDEO,
370 .config_props = &ff_vk_filter_config_output,
371 },
372};
373
375 .p.name = "v360_vulkan",
376 .p.description = NULL_IF_CONFIG_SMALL("Convert 360 projection of video."),
377 .p.priv_class = &v360_vulkan_class,
378 .p.flags = AVFILTER_FLAG_HWDEVICE,
379 .priv_size = sizeof(V360VulkanContext),
385 .flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
386};
const FFFilter ff_vf_v360_vulkan
int ff_filter_frame(AVFilterLink *link, AVFrame *frame)
Send a frame of data to the next filter.
Definition avfilter.c:1068
#define i(width, name, range_min, range_max)
Definition cbs_h264.c:63
#define s(width, name)
Definition cbs_vp9.c:198
#define FLAGS
Definition cmdutils.c:598
#define FF_CEIL_RSHIFT
Definition common.h:63
#define NULL
Definition coverity.c:32
int(* init)(AVBSFContext *ctx)
Definition dts2pts.c:608
#define fail
Definition test.h:479
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
Definition opt.h:298
@ AV_OPT_TYPE_INT
Underlying C type is int.
Definition opt.h:258
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
Definition opt.h:270
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
Definition opt.h:275
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
Definition avfilter.h:187
#define AVERROR(e)
Definition error.h:45
void av_frame_free(AVFrame **frame)
Free the frame and any dynamically allocated objects in it, e.g.
Definition frame.c:64
int av_frame_copy_props(AVFrame *dst, const AVFrame *src)
Copy only "metadata" fields from src to dst.
Definition frame.c:599
#define AV_LOG_WARNING
Something somehow does not look correct.
Definition log.h:216
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
Definition log.h:210
@ AVMEDIA_TYPE_VIDEO
Definition avutil.h:200
int a
#define b
Definition input.c:43
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 FILTER_INPUTS(array)
Definition filters.h:264
#define FILTER_OUTPUTS(array)
Definition filters.h:265
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition filters.h:208
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
Definition filters.h:254
#define AVFILTER_DEFINE_CLASS(fname)
Definition filters.h:478
#define av_cold
Definition attributes.h:117
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition internal.h:88
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:2070
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:2373
void ff_vk_exec_pool_free(FFVulkanContext *s, FFVkExecPool *pool)
Definition vulkan.c:310
int ff_vk_exec_pool_init(FFVulkanContext *s, AVVulkanDeviceQueueFamily *qf, FFVkExecPool *pool, int nb_contexts, int nb_queries, VkQueryType query_type, int query_64bit, const void *query_create_pnext)
Allocates/frees an execution pool.
Definition vulkan.c:357
int ff_vk_shader_add_push_const(FFVulkanShader *shd, int offset, int size, VkShaderStageFlagBits stage)
Add/update push constants for execution.
Definition vulkan.c:1443
void ff_vk_uninit(FFVulkanContext *s)
Frees main context.
Definition vulkan.c:2638
void ff_vk_shader_free(FFVulkanContext *s, FFVulkanShader *shd)
Free a shader.
Definition vulkan.c:2614
int ff_vk_shader_register_exec(FFVulkanContext *s, FFVkExecPool *pool, FFVulkanShader *shd)
Register a shader with an exec pool.
Definition vulkan.c:2407
int ff_vk_init_sampler(FFVulkanContext *s, VkSampler *sampler, int unnorm_coords, VkFilter filt)
Create a sampler.
Definition vulkan.c:1454
AVVulkanDeviceQueueFamily * ff_vk_qf_find(FFVulkanContext *s, VkQueueFlagBits dev_family, VkVideoCodecOperationFlagBitsKHR vid_ops)
Chooses an appropriate QF.
Definition vulkan.c:297
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:2267
#define sinf(x)
Definition libm.h:421
#define cosf(x)
Definition libm.h:80
const char * desc
Definition libsvtav1.c:83
static const struct @257111027162314367033347246032313251342043035002 planes[]
#define FFMIN(a, b)
Definition macros.h:49
#define M_PI_2
Definition mathematics.h:73
#define M_PI
Definition mathematics.h:67
AVOptions.
int av_pix_fmt_count_planes(enum AVPixelFormat pix_fmt)
Definition pixdesc.c:3500
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
An instance of a filter.
Definition avfilter.h:273
void * priv
private data for use by the filter
Definition avfilter.h:288
A filter pad used for either input or output.
Definition filters.h:40
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
AVOption.
Definition opt.h:428
Descriptor that unambiguously describes how the bits of a pixel are stored in the up to 4 data planes...
Definition pixdesc.h:69
const VkAllocationCallbacks * alloc
Custom memory allocator, else NULL.
VkDevice act_dev
Active device.
AVVulkanDeviceContext * hwctx
Definition vulkan.h:329
FFVulkanFunctions vkfn
Definition vulkan.h:294
int in_img_size[4][2]
float rot_mat[4][4]
float flat_range[2]
float iflat_range[2]
AVVulkanDeviceQueueFamily * qf
FFVulkanContext vkctx
FFVulkanShader shd
#define av_log(a,...)
static FILE * out
Definition movenc.c:55
static AVFormatContext * ctx
Definition movenc.c:49
#define height
Definition dsp.h:89
#define width
Definition dsp.h:89
@ FLAT
Definition v360.h:37
@ FISHEYE
Definition v360.h:46
@ DUAL_FISHEYE
Definition v360.h:38
@ EQUIRECTANGULAR
Definition v360.h:33
@ STEREOGRAPHIC
Definition v360.h:41
@ NB_PROJECTIONS
Definition v360.h:58
@ ROLL
Definition v360.h:104
@ NB_RORDERS
Definition v360.h:105
@ YAW
Definition v360.h:102
@ PITCH
Definition v360.h:103
#define DYNAMIC
else temp
Definition vf_mcdeint.c:275
static const AVOption v360_vulkan_options[]
static const AVFilterPad v360_vulkan_outputs[]
static void v360_vulkan_uninit(AVFilterContext *avctx)
const unsigned char ff_v360_comp_spv_data[]
static void calculate_iflat_range(int in, float ih_fov, float iv_fov, float *iflat_range)
static void calculate_rotation_matrix(float yaw, float pitch, float roll, float rot_mat[4][4], const int rotation_order[3])
const unsigned int ff_v360_comp_spv_len
static av_cold int init_filter(AVFilterContext *ctx, AVFrame *in)
static void calculate_flat_range(int out, float h_fov, float v_fov, float *flat_range)
static void multiply_matrix(float c[4][4], const float a[4][4], const float b[4][4])
static const AVFilterPad v360_vulkan_inputs[]
#define OFFSET(x)
static int get_rorder(char c)
static int v360_vulkan_filter_frame(AVFilterLink *link, AVFrame *in)
AVFrame * ff_get_video_buffer(AVFilterLink *link, int w, int h)
Request a picture buffer with a specific set of permissions.
Definition video.c:89
static double c[64]
#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
#define DUP_SAMPLER(x)
Definition vulkan.h:73
int ff_vk_filter_config_input(AVFilterLink *inlink)
int ff_vk_filter_config_output(AVFilterLink *outlink)
int ff_vk_filter_process_simple(FFVulkanContext *vkctx, FFVkExecPool *e, FFVulkanShader *shd, AVFrame *out_f, AVFrame *in_f, VkSampler sampler, uint32_t wgc_z, void *push_src, size_t push_size)
Submit a compute shader with a zero/one input and single out for execution.
int ff_vk_filter_init(AVFilterContext *avctx)
General lavfi IO functions.