From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 4F0834543C for ; Mon, 30 Jan 2023 01:37:50 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 25EA768BD65; Mon, 30 Jan 2023 03:37:48 +0200 (EET) Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 2586B680BA3 for ; Mon, 30 Jan 2023 03:37:40 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675042666; x=1706578666; h=from:to:cc:subject:date:message-id; bh=pjtbHuHjDShp3nHMjFhuaKiJWVmAP+SyPEKQ4MynvDc=; b=XUuOrpjOTYbhl/V+2JhbpdRSoJW6oWndP0czZ/D2/JnjOLFyORuvzMKn 0NHGnyYFwo7ZI5QEi9JIXX9AsBhmZrV/YmUsDTZeiAv9GRMeJyFewOxOp SJmxRF2ABNRkii1nh3du7EwJzm49p7k79UHXVlH7bUrpwn9atNR03EX69 0cIBx8zJPVoJOuLe/Rw+F3Gamq0P7fra9t7Dtcuf4imfvbcJlPDA5CFQ8 ZoU0os70pXqP9vcckBzcwv+mEvPR0IttGa+70sA3LssfgPd5osaiAqjTN K1AWi26aHo/jHs3YEDvfFj4+seAHtyi3hHqXGm4eC4pY80odPjSQshwP7 A==; X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="307798847" X-IronPort-AV: E=Sophos;i="5.97,256,1669104000"; d="scan'208";a="307798847" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2023 17:37:38 -0800 X-IronPort-AV: E=McAfee;i="6500,9779,10605"; a="772305350" X-IronPort-AV: E=Sophos;i="5.97,256,1669104000"; d="scan'208";a="772305350" Received: from xhh-dg164.sh.intel.com ([10.238.5.169]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 29 Jan 2023 17:37:36 -0800 From: "Xiang, Haihao" To: ffmpeg-devel@ffmpeg.org Date: Mon, 30 Jan 2023 09:37:17 +0800 Message-Id: <20230130013719.7167-1-haihao.xiang@intel.com> X-Mailer: git-send-email 2.17.1 Subject: [FFmpeg-devel] [PATCH 1/3] lavfi/vpp_qsv: add rate option X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Cc: Haihao Xiang MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: From: Haihao Xiang This is used to control the output at frame rate or field rate when deinterlace is expected and framerate is not specified. Signed-off-by: Haihao Xiang --- libavfilter/vf_vpp_qsv.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_vpp_qsv.c b/libavfilter/vf_vpp_qsv.c index 34e530e244..aac0a234c3 100644 --- a/libavfilter/vf_vpp_qsv.c +++ b/libavfilter/vf_vpp_qsv.c @@ -101,6 +101,7 @@ typedef struct VPPContext{ char *output_format_str; int has_passthrough; /* apply pass through mode if possible */ + int field_rate; /* Generate output at frame rate or field rate for deinterlace mode, 0: frame, 1: field */ } VPPContext; static const char *const var_names[] = { @@ -255,9 +256,14 @@ static int config_input(AVFilterLink *inlink) int ret; int64_t ow, oh; - if (vpp->framerate.den == 0 || vpp->framerate.num == 0) + if (vpp->framerate.den == 0 || vpp->framerate.num == 0) { vpp->framerate = inlink->frame_rate; + if (vpp->deinterlace && vpp->field_rate) + vpp->framerate = av_mul_q(inlink->frame_rate, + (AVRational){ 2, 1 }); + } + if (av_cmp_q(vpp->framerate, inlink->frame_rate)) vpp->use_frc = 1; @@ -352,7 +358,7 @@ static int config_output(AVFilterLink *outlink) outlink->w = vpp->out_width; outlink->h = vpp->out_height; outlink->frame_rate = vpp->framerate; - outlink->time_base = inlink->time_base; + outlink->time_base = av_inv_q(vpp->framerate); param.filter_frame = NULL; param.num_ext_buf = 0; @@ -678,6 +684,13 @@ static const AVOption vpp_options[] = { { "low_power", "low power mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_LOWPOWER}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, { "hq", "high quality mode", 0, AV_OPT_TYPE_CONST, { .i64 = MFX_SCALING_MODE_QUALITY}, INT_MIN, INT_MAX, FLAGS, "scale mode"}, + { "rate", "Generate output at frame rate or field rate, available only for deinterlace mode", + OFFSET(field_rate), AV_OPT_TYPE_INT, { .i64 = 0 }, 0, 1, FLAGS, "rate" }, + { "frame", "Output at frame rate (one frame of output for each field-pair)", + 0, AV_OPT_TYPE_CONST, { .i64 = 0 }, 0, 0, FLAGS, "rate" }, + { "field", "Output at field rate (one frame of output for each field)", + 0, AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0, FLAGS, "rate" }, + { NULL } }; -- 2.17.1 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".