From: "Xiang, Haihao" <haihao.xiang-at-intel.com@ffmpeg.org> To: "ffmpeg-devel@ffmpeg.org" <ffmpeg-devel@ffmpeg.org> Subject: Re: [FFmpeg-devel] [PATCH 1/3] lavfi/vpp_qsv: add rate option Date: Thu, 2 Feb 2023 03:00:49 +0000 Message-ID: <87bd3328c7c018a6a410fbf804da4e0e9b239c65.camel@intel.com> (raw) In-Reply-To: <20230130013719.7167-1-haihao.xiang@intel.com> On Ma, 2023-01-30 at 09:37 +0800, Xiang, Haihao wrote: > From: Haihao Xiang <haihao.xiang@intel.com> > > 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 <haihao.xiang@intel.com> > --- > 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 } > }; Will apply this patchset. - Haihao > _______________________________________________ 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".
prev parent reply other threads:[~2023-02-02 3:01 UTC|newest] Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top 2023-01-30 1:37 Xiang, Haihao 2023-01-30 1:37 ` [FFmpeg-devel] [PATCH 2/3] lavfi/deinterlace_qsv: simplify deinterlace_qsv filter Xiang, Haihao 2023-01-30 1:37 ` [FFmpeg-devel] [PATCH 3/3] lavfi/deinterlace_qsv: re-use VPPContext for " Xiang, Haihao 2023-02-02 3:00 ` Xiang, Haihao [this message]
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=87bd3328c7c018a6a410fbf804da4e0e9b239c65.camel@intel.com \ --to=haihao.xiang-at-intel.com@ffmpeg.org \ --cc=ffmpeg-devel@ffmpeg.org \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: link
Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel This inbox may be cloned and mirrored by anyone: git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git # If you have public-inbox 1.1+ installed, you may # initialize and index your mirror using the following commands: public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \ ffmpegdev@gitmailbox.com public-inbox-index ffmpegdev Example config snippet for mirrors. AGPL code for this site: git clone https://public-inbox.org/public-inbox.git