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
180 AVVkFrame *in = (AVVkFrame *)in_f->data[0];180 AVVkFrame *in = (AVVkFrame *)in_f->data[0];
181 AVVkFrame *out = (AVVkFrame *)out_f->data[0];181 AVVkFrame *out = (AVVkFrame *)out_f->data[0];
182 int planes = av_pix_fmt_count_planes(s->vkctx.output_format);182 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);
183 185
184 /* Update descriptors and init the exec context */186 /* Update descriptors and init the exec context */
185 ff_vk_start_exec_recording(vkctx, s->exec);187 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
188 for (int i = 0; i < planes; i++) {190 for (int i = 0; i < planes; i++) {
189 RET(ff_vk_create_imageview(vkctx, s->exec,191 RET(ff_vk_create_imageview(vkctx, s->exec,
190 &s->input_images[i].imageView, in->img[i],192 &s->input_images[i].imageView, in->img[i],
191 av_vkfmt_from_pixfmt(s->vkctx.input_format)[i],193 input_formats[i],
192 ff_comp_identity_map));194 ff_comp_identity_map));
193 195
194 RET(ff_vk_create_imageview(vkctx, s->exec,196 RET(ff_vk_create_imageview(vkctx, s->exec,
195 &s->output_images[i].imageView, out->img[i],197 &s->output_images[i].imageView, out->img[i],
196 av_vkfmt_from_pixfmt(s->vkctx.output_format)[i],198 ouput_formats[i],
197 ff_comp_identity_map));199 ff_comp_identity_map));
198 200
199 s->input_images[i].imageLayout = VK_IMAGE_LAYOUT_SHADER_READ_ONLY_OPTIMAL;201 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