[FFmpeg-cvslog] lavfi/misc_vaapi: use default value setting if without arguments.

Jun Zhao git at videolan.org
Fri Jan 26 01:16:41 EET 2018


ffmpeg | branch: master | Jun Zhao <jun.zhao at intel.com> | Wed Jan 24 09:32:50 2018 +0800| [4e6e1e5350b73bee3122ad4044195bb14d69c229] | committer: Mark Thompson

lavfi/misc_vaapi: use default value setting if without arguments.

Signed-off-by: Jun Zhao <jun.zhao at intel.com>
Signed-off-by: Mark Thompson <sw at jkqxz.net>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4e6e1e5350b73bee3122ad4044195bb14d69c229
---

 libavfilter/vf_misc_vaapi.c | 64 +++++++++++++++++++++------------------------
 1 file changed, 30 insertions(+), 34 deletions(-)

diff --git a/libavfilter/vf_misc_vaapi.c b/libavfilter/vf_misc_vaapi.c
index c60b7b0c48..8b179fe215 100644
--- a/libavfilter/vf_misc_vaapi.c
+++ b/libavfilter/vf_misc_vaapi.c
@@ -71,24 +71,22 @@ static int denoise_vaapi_build_filter_params(AVFilterContext *avctx)
 
     VAProcFilterParameterBuffer denoise;
 
-    if (ctx->denoise != DENOISE_DEFAULT) {
-        vas = vaQueryVideoProcFilterCaps(vpp_ctx->hwctx->display, vpp_ctx->va_context,
-                                         VAProcFilterNoiseReduction,
-                                         &caps, &num_caps);
-        if (vas != VA_STATUS_SUCCESS) {
-            av_log(avctx, AV_LOG_ERROR, "Failed to query denoise caps "
-                   "context: %d (%s).\n", vas, vaErrorStr(vas));
-            return AVERROR(EIO);
-        }
-
-        denoise.type  = VAProcFilterNoiseReduction;
-        denoise.value =  map(ctx->denoise, DENOISE_MIN, DENOISE_MAX,
-                             caps.range.min_value,
-                             caps.range.max_value);
-        ff_vaapi_vpp_make_param_buffers(avctx, VAProcFilterParameterBufferType,
-                                        &denoise, sizeof(denoise), 1);
+    vas = vaQueryVideoProcFilterCaps(vpp_ctx->hwctx->display, vpp_ctx->va_context,
+                                     VAProcFilterNoiseReduction,
+                                     &caps, &num_caps);
+    if (vas != VA_STATUS_SUCCESS) {
+        av_log(avctx, AV_LOG_ERROR, "Failed to query denoise caps "
+               "context: %d (%s).\n", vas, vaErrorStr(vas));
+        return AVERROR(EIO);
     }
 
+    denoise.type  = VAProcFilterNoiseReduction;
+    denoise.value =  map(ctx->denoise, DENOISE_MIN, DENOISE_MAX,
+                         caps.range.min_value,
+                         caps.range.max_value);
+    ff_vaapi_vpp_make_param_buffers(avctx, VAProcFilterParameterBufferType,
+                                    &denoise, sizeof(denoise), 1);
+
     return 0;
 }
 
@@ -104,26 +102,24 @@ static int sharpness_vaapi_build_filter_params(AVFilterContext *avctx)
 
     VAProcFilterParameterBuffer sharpness;
 
-    if (ctx->sharpness != SHARPNESS_DEFAULT) {
-        vas = vaQueryVideoProcFilterCaps(vpp_ctx->hwctx->display, vpp_ctx->va_context,
-                                         VAProcFilterSharpening,
-                                         &caps, &num_caps);
-        if (vas != VA_STATUS_SUCCESS) {
-            av_log(avctx, AV_LOG_ERROR, "Failed to query sharpness caps "
-                   "context: %d (%s).\n", vas, vaErrorStr(vas));
-            return AVERROR(EIO);
-        }
-
-        sharpness.type  = VAProcFilterSharpening;
-        sharpness.value = map(ctx->sharpness,
-                              SHARPNESS_MIN, SHARPNESS_MAX,
-                              caps.range.min_value,
-                              caps.range.max_value);
-        ff_vaapi_vpp_make_param_buffers(avctx,
-                                        VAProcFilterParameterBufferType,
-                                        &sharpness, sizeof(sharpness), 1);
+    vas = vaQueryVideoProcFilterCaps(vpp_ctx->hwctx->display, vpp_ctx->va_context,
+                                     VAProcFilterSharpening,
+                                     &caps, &num_caps);
+    if (vas != VA_STATUS_SUCCESS) {
+        av_log(avctx, AV_LOG_ERROR, "Failed to query sharpness caps "
+               "context: %d (%s).\n", vas, vaErrorStr(vas));
+        return AVERROR(EIO);
     }
 
+    sharpness.type  = VAProcFilterSharpening;
+    sharpness.value = map(ctx->sharpness,
+                          SHARPNESS_MIN, SHARPNESS_MAX,
+                          caps.range.min_value,
+                          caps.range.max_value);
+    ff_vaapi_vpp_make_param_buffers(avctx,
+                                    VAProcFilterParameterBufferType,
+                                    &sharpness, sizeof(sharpness), 1);
+
     return 0;
 }
 



More information about the ffmpeg-cvslog mailing list