diff mbox series

[FFmpeg-devel,v2,4/4] lavfi/vf_vpp_qsv: scale_mode can be applied to color conversion

Message ID 20221128044321.613550-4-haihao.xiang@intel.com
State Accepted
Commit 0ae459176b2bec76c548247c684f0c93b1d2fd69
Headers show
Series [FFmpeg-devel,v2,1/4] lavfi/qsvvpp: change the output frame's width and height | expand

Checks

Context Check Description
yinshiyou/make_loongarch64 success Make finished
yinshiyou/make_fate_loongarch64 success Make fate finished
andriy/make_x86 success Make finished
andriy/make_fate_x86 success Make fate finished

Commit Message

Xiang, Haihao Nov. 28, 2022, 4:43 a.m. UTC
From: Haihao Xiang <haihao.xiang@intel.com>

Signed-off-by: Haihao Xiang <haihao.xiang@intel.com>
---
 libavfilter/vf_vpp_qsv.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)
diff mbox series

Patch

diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c
index 4a053f9145..a14b3de7b5 100644
--- a/libavfilter/vf_vpp_qsv.c
+++ b/libavfilter/vf_vpp_qsv.c
@@ -133,7 +133,7 @@  static const AVOption options[] = {
     { "height", "Output video height", OFFSET(oh), AV_OPT_TYPE_STRING, { .str="w*ch/cw" }, 0, 255, .flags = FLAGS },
     { "format", "Output pixel format", OFFSET(output_format_str), AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS },
     { "async_depth", "Internal parallelization depth, the higher the value the higher the latency.", OFFSET(async_depth), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, INT_MAX, .flags = FLAGS },
-    { "scale_mode", "scale mode: 0=auto, 1=low power, 2=high quality", OFFSET(scale_mode), AV_OPT_TYPE_INT, { .i64 = MFX_SCALING_MODE_DEFAULT }, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, .flags = FLAGS, "scale mode" },
+    { "scale_mode", "scale & format conversion mode: 0=auto, 1=low power, 2=high quality", OFFSET(scale_mode), AV_OPT_TYPE_INT, { .i64 = MFX_SCALING_MODE_DEFAULT }, MFX_SCALING_MODE_DEFAULT, MFX_SCALING_MODE_QUALITY, .flags = FLAGS, "scale mode" },
     { NULL }
 };
 
@@ -492,7 +492,7 @@  static int config_output(AVFilterLink *outlink)
         }
     }
 
-    if (inlink->w != outlink->w || inlink->h != outlink->h) {
+    if (inlink->w != outlink->w || inlink->h != outlink->h || in_format != vpp->out_format) {
         if (QSV_RUNTIME_VERSION_ATLEAST(mfx_version, 1, 19)) {
             memset(&vpp->scale_conf, 0, sizeof(mfxExtVPPScaling));
             vpp->scale_conf.Header.BufferId    = MFX_EXTBUFF_VPP_SCALING;
@@ -501,8 +501,8 @@  static int config_output(AVFilterLink *outlink)
 
             param.ext_buf[param.num_ext_buf++] = (mfxExtBuffer*)&vpp->scale_conf;
         } else
-            av_log(ctx, AV_LOG_WARNING, "The QSV VPP Scale option is "
-                "not supported with this MSDK version.\n");
+            av_log(ctx, AV_LOG_WARNING, "The QSV VPP Scale & format conversion "
+                   "option is not supported with this MSDK version.\n");
     }
 
     if (vpp->use_frc || vpp->use_crop || vpp->deinterlace || vpp->denoise ||