History

avfilter/chromaber_vulkan: call av_vkfmt_from_pixfmt only one time

Wu Jianhua committed 4 years ago

Commit 6e4efe41 parent 9f2b2041 file · +4 −2Browse files

Showing the changes to libavfilter (1 of 1 file). Show all

Unified · Split

libavfilter/vf_chromaber_vulkan.c+4−2
@@ -180,6 +180,8 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) · 179 unmodified lines
180180 AVVkFrame *in = (AVVkFrame *)in_f->data[0];
181181 AVVkFrame *out = (AVVkFrame *)out_f->data[0];
182182 int planes = av_pix_fmt_count_planes(s->vkctx.output_format);
183+ const VkFormat *input_formats = av_vkfmt_from_pixfmt(s->vkctx.input_format);
184+ const VkFormat *ouput_formats = av_vkfmt_from_pixfmt(s->vkctx.output_format);
183185
184186 /* Update descriptors and init the exec context */
185187 ff_vk_start_exec_recording(vkctx, s->exec);
@@ -188,12 +190,12 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) · 2 unmodified lines
188190 for (int i = 0; i < planes; i++) {
189191 RET(ff_vk_create_imageview(vkctx, s->exec,
190192 &s->input_images[i].imageView, in->img[i],
191− av_vkfmt_from_pixfmt(s->vkctx.input_format)[i],
193+ input_formats[i],
192194 ff_comp_identity_map));
193195
194196 RET(ff_vk_create_imageview(vkctx, s->exec,
195197 &s->output_images[i].imageView, out->img[i],
196− av_vkfmt_from_pixfmt(s->vkctx.output_format)[i],
198+ ouput_formats[i],
197199 ff_comp_identity_map));
198200
199201 s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t