History

avfilter/scale_vulkan: call av_vkfmt_from_pixfmt only one time

Wu Jianhua committed 4 years ago

Commit 067da5c1 parent 404a58d1 file · +4 −2Browse files

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

Unified · Split

libavfilter/vf_scale_vulkan.c+4−2
@@ -304,6 +304,8 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) · 303 unmodified lines
304304 VkImageMemoryBarrier barriers[AV_NUM_DATA_POINTERS*2];
305305 int barrier_count = 0;
306306 const int planes = av_pix_fmt_count_planes(s->vkctx.input_format);
307+ const VkFormat *input_formats = av_vkfmt_from_pixfmt(s->vkctx.input_format);
308+ const VkFormat *output_formats = av_vkfmt_from_pixfmt(s->vkctx.output_format);
307309
308310 /* Update descriptors and init the exec context */
309311 ff_vk_start_exec_recording(vkctx, s->exec);
@@ -312,12 +314,12 @@ static int process_frames(AVFilterContext *avctx, AVFrame *out_f, AVFrame *in_f) · 2 unmodified lines
312314 for (int i = 0; i < planes; i++) {
313315 RET(ff_vk_create_imageview(vkctx, s->exec,
314316 &s->input_images[i].imageView, in->img[i],
315− av_vkfmt_from_pixfmt(s->vkctx.input_format)[i],
317+ input_formats[i],
316318 ff_comp_identity_map));
317319
318320 RET(ff_vk_create_imageview(vkctx, s->exec,
319321 &s->output_images[i].imageView, out->img[i],
320− av_vkfmt_from_pixfmt(s->vkctx.output_format)[i],
322+ output_formats[i],
321323 ff_comp_identity_map));
322324
323325 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