瀏覽代碼

nv-filters: For Blur FX, do not set mask image

It is not necessary to set the mask parameter for Blur FX.
Setting it to NULL, will apply the blur to the whole image.
This is not documented in the SDK but is returned when info about the
FX is requested by the plugin to the SDK library.

Signed-off-by: pkv <[email protected]>
pkv 2 月之前
父節點
當前提交
3baf0456ba
共有 1 個文件被更改,包括 5 次插入1 次删除
  1. 5 1
      plugins/nv-filters/nvidia-videofx-filter.c

+ 5 - 1
plugins/nv-filters/nvidia-videofx-filter.c

@@ -521,6 +521,7 @@ static bool init_blur_images(struct nvvfx_data *filter)
 {
 	uint32_t width = filter->width;
 	uint32_t height = filter->height;
+	enum nvvfx_fx_id id = filter->filter_id;
 
 	/* 1. Create and allocate Blur BGR NvCVimage (blur FX dst) */
 	NvCVImage_Create(width, height, NVCV_BGR, NVCV_U8, NVCV_CHUNKY, NVCV_GPU, 1, &filter->blur_BGR_dst_img);
@@ -536,7 +537,10 @@ static bool init_blur_images(struct nvvfx_data *filter)
 
 	/* 3. Set input & output images for nv blur FX */
 	NvVFX_SetImage(filter->handle_blur, NVVFX_INPUT_IMAGE, filter->BGR_src_img);
-	NvVFX_SetImage(filter->handle_blur, NVVFX_INPUT_IMAGE_1, filter->A_dst_img);
+	if (id != S_FX_BLUR)
+		NvVFX_SetImage(filter->handle_blur, NVVFX_INPUT_IMAGE_1, filter->A_dst_img);
+	else
+		NvVFX_SetImage(filter->handle_blur, NVVFX_INPUT_IMAGE_1, NULL);
 	NvVFX_SetImage(filter->handle_blur, NVVFX_OUTPUT_IMAGE, filter->blur_BGR_dst_img);
 
 	if (NvVFX_Load(filter->handle_blur) != NVCV_SUCCESS) {