[FFmpeg-cvslog] Merge commit '550cb6a85d0f7211289f7a789527d48cb29460ff'
James Almer
git at videolan.org
Wed Nov 8 18:48:59 EET 2017
ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Wed Nov 8 13:47:42 2017 -0300| [975db5dcc2edd6e374eee7050f67ad529c69ddde] | committer: James Almer
Merge commit '550cb6a85d0f7211289f7a789527d48cb29460ff'
* commit '550cb6a85d0f7211289f7a789527d48cb29460ff':
lavf/vf_deinterlace_qsv: Enable the qsv deinterlace vpp
Merged-by: James Almer <jamrial at gmail.com>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=975db5dcc2edd6e374eee7050f67ad529c69ddde
---
libavfilter/vf_deinterlace_qsv.c | 24 +++++++++++++++++++-----
1 file changed, 19 insertions(+), 5 deletions(-)
diff --git a/libavfilter/vf_deinterlace_qsv.c b/libavfilter/vf_deinterlace_qsv.c
index 2810bffe46..897e6bd622 100644
--- a/libavfilter/vf_deinterlace_qsv.c
+++ b/libavfilter/vf_deinterlace_qsv.c
@@ -68,13 +68,18 @@ typedef struct QSVDeintContext {
int nb_surface_ptrs;
mfxExtOpaqueSurfaceAlloc opaque_alloc;
- mfxExtBuffer *ext_buffers[1];
+ mfxExtVPPDeinterlacing deint_conf;
+ mfxExtBuffer *ext_buffers[2];
+ int num_ext_buffers;
QSVFrame *work_frames;
int64_t last_pts;
int eof;
+
+ /* option for Deinterlacing algorithm to be used */
+ int mode;
} QSVDeintContext;
static void qsvdeint_uninit(AVFilterContext *ctx)
@@ -212,6 +217,12 @@ static int init_out_session(AVFilterContext *ctx)
memset(&par, 0, sizeof(par));
+ s->deint_conf.Header.BufferId = MFX_EXTBUFF_VPP_DEINTERLACING;
+ s->deint_conf.Header.BufferSz = sizeof(s->deint_conf);
+ s->deint_conf.Mode = s->mode;
+
+ s->ext_buffers[s->num_ext_buffers++] = (mfxExtBuffer *)&s->deint_conf;
+
if (opaque) {
s->surface_ptrs = av_mallocz_array(hw_frames_hwctx->nb_surfaces,
sizeof(*s->surface_ptrs));
@@ -230,10 +241,7 @@ static int init_out_session(AVFilterContext *ctx)
s->opaque_alloc.Header.BufferId = MFX_EXTBUFF_OPAQUE_SURFACE_ALLOCATION;
s->opaque_alloc.Header.BufferSz = sizeof(s->opaque_alloc);
- s->ext_buffers[0] = (mfxExtBuffer*)&s->opaque_alloc;
-
- par.ExtParam = s->ext_buffers;
- par.NumExtParam = FF_ARRAY_ELEMS(s->ext_buffers);
+ s->ext_buffers[s->num_ext_buffers++] = (mfxExtBuffer *)&s->opaque_alloc;
par.IOPattern = MFX_IOPATTERN_IN_OPAQUE_MEMORY | MFX_IOPATTERN_OUT_OPAQUE_MEMORY;
} else {
@@ -261,6 +269,9 @@ static int init_out_session(AVFilterContext *ctx)
par.IOPattern = MFX_IOPATTERN_IN_VIDEO_MEMORY | MFX_IOPATTERN_OUT_VIDEO_MEMORY;
}
+ par.ExtParam = s->ext_buffers;
+ par.NumExtParam = s->num_ext_buffers;
+
par.AsyncDepth = 1; // TODO async
par.vpp.In = hw_frames_hwctx->surfaces[0].Info;
@@ -529,6 +540,9 @@ static int qsvdeint_request_frame(AVFilterLink *outlink)
#define OFFSET(x) offsetof(QSVDeintContext, x)
#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static const AVOption options[] = {
+ { "mode", "set deinterlace mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"},
+ { "bob", "bob algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_BOB}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"},
+ { "advanced", "Motion adaptive algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"},
{ NULL },
};
======================================================================
diff --cc libavfilter/vf_deinterlace_qsv.c
index 2810bffe46,2360491d3f..897e6bd622
--- a/libavfilter/vf_deinterlace_qsv.c
+++ b/libavfilter/vf_deinterlace_qsv.c
@@@ -74,7 -76,11 +76,10 @@@ typedef struct QSVDeintContext
int64_t last_pts;
- int got_output_frame;
int eof;
+
+ /* option for Deinterlacing algorithm to be used */
+ int mode;
} QSVDeintContext;
static void qsvdeint_uninit(AVFilterContext *ctx)
@@@ -527,8 -543,11 +538,11 @@@ static int qsvdeint_request_frame(AVFil
}
#define OFFSET(x) offsetof(QSVDeintContext, x)
-#define FLAGS AV_OPT_FLAG_VIDEO_PARAM
+#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
static const AVOption options[] = {
+ { "mode", "set deinterlace mode", OFFSET(mode), AV_OPT_TYPE_INT, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"},
+ { "bob", "bob algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_BOB}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"},
+ { "advanced", "Motion adaptive algorithm", 0, AV_OPT_TYPE_CONST, {.i64 = MFX_DEINTERLACING_ADVANCED}, MFX_DEINTERLACING_BOB, MFX_DEINTERLACING_ADVANCED, FLAGS, "mode"},
{ NULL },
};
More information about the ffmpeg-cvslog
mailing list