diff options
author | Wu Jianhua <jianhua.wu@intel.com> | 2021-11-19 21:52:44 +0800 |
---|---|---|
committer | Lynne <dev@lynne.ee> | 2021-11-19 16:47:47 +0100 |
commit | 6e4efe439f99fa512944bcacd8f2eaea28639196 (patch) | |
tree | 386ad29715d1a824469127de55d78fe41631d6ac /libavfilter/vf_chromaber_vulkan.c | |
parent | 9f2b204461015fed54ff114666679dcbee8a2b5e (diff) | |
download | ffmpeg-6e4efe439f99fa512944bcacd8f2eaea28639196.tar.gz |
avfilter/chromaber_vulkan: call av_vkfmt_from_pixfmt only one time
Signed-off-by: Wu Jianhua <jianhua.wu@intel.com>
Diffstat (limited to 'libavfilter/vf_chromaber_vulkan.c')
-rw-r--r-- | libavfilter/vf_chromaber_vulkan.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/libavfilter/vf_chromaber_vulkan.c b/libavfilter/vf_chromaber_vulkan.c index 912ee8c609..b9423e417e 100644 --- a/libavfilter/vf_chromaber_vulkan.c +++ b/libavfilter/vf_chromaber_vulkan.c @@ -180,6 +180,8 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) AVVkFrame *in = (AVVkFrame *)in_f->data[0]; AVVkFrame *out = (AVVkFrame *)out_f->data[0]; int planes = av_pix_fmt_count_planes(s->vkctx.output_format); + const VkFormat *input_formats = av_vkfmt_from_pixfmt(s->vkctx.input_format); + const VkFormat *ouput_formats = av_vkfmt_from_pixfmt(s->vkctx.output_format); /* Update descriptors and init the exec context */ ff_vk_start_exec_recording(vkctx, s->exec); @@ -188,12 +190,12 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) for (int i = 0; i < planes; i++) { RET(ff_vk_create_imageview(vkctx, s->exec, &s->input_images[i].imageView, in->img[i], - av_vkfmt_from_pixfmt(s->vkctx.input_format)[i], + input_formats[i], ff_comp_identity_map)); RET(ff_vk_create_imageview(vkctx, s->exec, &s->output_images[i].imageView, out->img[i], - av_vkfmt_from_pixfmt(s->vkctx.output_format)[i], + ouput_formats[i], ff_comp_identity_map)); s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL; |