FFmpeg
Data Structures | Macros | Enumerations | Functions | Variables
vf_deinterlace_qsv.c File Reference
#include <mfx/mfxvideo.h>
#include <stdio.h>
#include <string.h>
#include "libavutil/avstring.h"
#include "libavutil/common.h"
#include "libavutil/hwcontext.h"
#include "libavutil/hwcontext_qsv.h"
#include "libavutil/internal.h"
#include "libavutil/mathematics.h"
#include "libavutil/opt.h"
#include "libavutil/pixdesc.h"
#include "libavutil/time.h"
#include "libavfilter/qsvvpp.h"
#include "avfilter.h"
#include "formats.h"
#include "internal.h"
#include "video.h"

Go to the source code of this file.

Data Structures

struct  QSVDeintContext
 

Macros

#define MFX_IMPL_VIA_MASK(impl)   (0x0f00 & (impl))
 
#define OFFSET(x)   offsetof(QSVDeintContext, x)
 
#define FLAGS   AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 

Enumerations

enum  { QSVDEINT_MORE_OUTPUT = 1, QSVDEINT_MORE_INPUT }
 

Functions

static av_cold void qsvdeint_uninit (AVFilterContext *ctx)
 
static int qsvdeint_query_formats (AVFilterContext *ctx)
 
static mfxStatus frame_alloc (mfxHDL pthis, mfxFrameAllocRequest *req, mfxFrameAllocResponse *resp)
 
static mfxStatus frame_free (mfxHDL pthis, mfxFrameAllocResponse *resp)
 
static mfxStatus frame_lock (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
 
static mfxStatus frame_unlock (mfxHDL pthis, mfxMemId mid, mfxFrameData *ptr)
 
static mfxStatus frame_get_hdl (mfxHDL pthis, mfxMemId mid, mfxHDL *hdl)
 
static int init_out_session (AVFilterContext *ctx)
 
static int qsvdeint_config_props (AVFilterLink *outlink)
 
static void clear_unused_frames (QSVDeintContext *s)
 
static int get_free_frame (QSVDeintContext *s, QSVFrame **f)
 
static int submit_frame (AVFilterContext *ctx, AVFrame *frame, mfxFrameSurface1 **surface)
 
static int process_frame (AVFilterContext *ctx, const AVFrame *in, mfxFrameSurface1 *surf_in)
 
static int qsvdeint_filter_frame (AVFilterLink *link, AVFrame *in)
 
static int qsvdeint_request_frame (AVFilterLink *outlink)
 

Variables

static const AVOption options []
 
static const AVClass qsvdeint_class
 
static const AVFilterPad qsvdeint_inputs []
 
static const AVFilterPad qsvdeint_outputs []
 
const AVFilter ff_vf_deinterlace_qsv
 

Detailed Description

deinterlace video filter - QSV

Definition in file vf_deinterlace_qsv.c.

Macro Definition Documentation

◆ MFX_IMPL_VIA_MASK

#define MFX_IMPL_VIA_MASK (   impl)    (0x0f00 & (impl))

Definition at line 45 of file vf_deinterlace_qsv.c.

◆ OFFSET

#define OFFSET (   x)    offsetof(QSVDeintContext, x)

Definition at line 563 of file vf_deinterlace_qsv.c.

◆ FLAGS

Definition at line 564 of file vf_deinterlace_qsv.c.

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
QSVDEINT_MORE_OUTPUT 
QSVDEINT_MORE_INPUT 

Definition at line 47 of file vf_deinterlace_qsv.c.

Function Documentation

◆ qsvdeint_uninit()

static av_cold void qsvdeint_uninit ( AVFilterContext ctx)
static

Definition at line 80 of file vf_deinterlace_qsv.c.

Referenced by qsvdeint_config_props().

◆ qsvdeint_query_formats()

static int qsvdeint_query_formats ( AVFilterContext ctx)
static

Definition at line 106 of file vf_deinterlace_qsv.c.

◆ frame_alloc()

static mfxStatus frame_alloc ( mfxHDL  pthis,
mfxFrameAllocRequest *  req,
mfxFrameAllocResponse *  resp 
)
static

Definition at line 115 of file vf_deinterlace_qsv.c.

Referenced by init_out_session().

◆ frame_free()

static mfxStatus frame_free ( mfxHDL  pthis,
mfxFrameAllocResponse *  resp 
)
static

Definition at line 132 of file vf_deinterlace_qsv.c.

Referenced by init_out_session().

◆ frame_lock()

static mfxStatus frame_lock ( mfxHDL  pthis,
mfxMemId  mid,
mfxFrameData *  ptr 
)
static

Definition at line 137 of file vf_deinterlace_qsv.c.

Referenced by init_out_session().

◆ frame_unlock()

static mfxStatus frame_unlock ( mfxHDL  pthis,
mfxMemId  mid,
mfxFrameData *  ptr 
)
static

Definition at line 142 of file vf_deinterlace_qsv.c.

Referenced by init_out_session().

◆ frame_get_hdl()

static mfxStatus frame_get_hdl ( mfxHDL  pthis,
mfxMemId  mid,
mfxHDL *  hdl 
)
static

Definition at line 147 of file vf_deinterlace_qsv.c.

Referenced by init_out_session().

◆ init_out_session()

static int init_out_session ( AVFilterContext ctx)
static

Definition at line 159 of file vf_deinterlace_qsv.c.

Referenced by qsvdeint_config_props().

◆ qsvdeint_config_props()

static int qsvdeint_config_props ( AVFilterLink outlink)
static

Definition at line 326 of file vf_deinterlace_qsv.c.

◆ clear_unused_frames()

static void clear_unused_frames ( QSVDeintContext s)
static

Definition at line 366 of file vf_deinterlace_qsv.c.

Referenced by get_free_frame().

◆ get_free_frame()

static int get_free_frame ( QSVDeintContext s,
QSVFrame **  f 
)
static

Definition at line 378 of file vf_deinterlace_qsv.c.

Referenced by submit_frame().

◆ submit_frame()

static int submit_frame ( AVFilterContext ctx,
AVFrame frame,
mfxFrameSurface1 **  surface 
)
static

Definition at line 405 of file vf_deinterlace_qsv.c.

Referenced by qsvdeint_filter_frame().

◆ process_frame()

static int process_frame ( AVFilterContext ctx,
const AVFrame in,
mfxFrameSurface1 *  surf_in 
)
static

Definition at line 454 of file vf_deinterlace_qsv.c.

Referenced by qsvdeint_filter_frame().

◆ qsvdeint_filter_frame()

static int qsvdeint_filter_frame ( AVFilterLink link,
AVFrame in 
)
static

Definition at line 534 of file vf_deinterlace_qsv.c.

◆ qsvdeint_request_frame()

static int qsvdeint_request_frame ( AVFilterLink outlink)
static

Definition at line 556 of file vf_deinterlace_qsv.c.

Variable Documentation

◆ options

const AVOption options[]
static
Initial value:
= {
{ "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 },
}

Definition at line 565 of file vf_deinterlace_qsv.c.

◆ qsvdeint_class

const AVClass qsvdeint_class
static
Initial value:
= {
.class_name = "deinterlace_qsv",
.item_name = av_default_item_name,
.option = options,
}

Definition at line 572 of file vf_deinterlace_qsv.c.

◆ qsvdeint_inputs

const AVFilterPad qsvdeint_inputs[]
static
Initial value:
= {
{
.name = "default",
.filter_frame = qsvdeint_filter_frame,
},
}

Definition at line 579 of file vf_deinterlace_qsv.c.

◆ qsvdeint_outputs

const AVFilterPad qsvdeint_outputs[]
static
Initial value:
= {
{
.name = "default",
.config_props = qsvdeint_config_props,
.request_frame = qsvdeint_request_frame,
},
}

Definition at line 587 of file vf_deinterlace_qsv.c.

◆ ff_vf_deinterlace_qsv

const AVFilter ff_vf_deinterlace_qsv
Initial value:
= {
.name = "deinterlace_qsv",
.description = NULL_IF_CONFIG_SMALL("QuickSync video deinterlacing"),
.uninit = qsvdeint_uninit,
.query_formats = qsvdeint_query_formats,
.priv_size = sizeof(QSVDeintContext),
.priv_class = &qsvdeint_class,
.flags_internal = FF_FILTER_FLAG_HWFRAME_AWARE,
}

Definition at line 596 of file vf_deinterlace_qsv.c.

qsvdeint_request_frame
static int qsvdeint_request_frame(AVFilterLink *outlink)
Definition: vf_deinterlace_qsv.c:556
FF_FILTER_FLAG_HWFRAME_AWARE
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
Definition: internal.h:334
qsvdeint_filter_frame
static int qsvdeint_filter_frame(AVFilterLink *link, AVFrame *in)
Definition: vf_deinterlace_qsv.c:534
QSVDeintContext
Definition: vf_deinterlace_qsv.c:52
qsvdeint_uninit
static av_cold void qsvdeint_uninit(AVFilterContext *ctx)
Definition: vf_deinterlace_qsv.c:80
FILTER_INPUTS
#define FILTER_INPUTS(array)
Definition: internal.h:152
LIBAVUTIL_VERSION_INT
#define LIBAVUTIL_VERSION_INT
Definition: version.h:85
NULL
#define NULL
Definition: coverity.c:32
av_default_item_name
const char * av_default_item_name(void *ptr)
Return the context name.
Definition: log.c:235
OFFSET
#define OFFSET(x)
Definition: vf_deinterlace_qsv.c:563
qsvdeint_class
static const AVClass qsvdeint_class
Definition: vf_deinterlace_qsv.c:572
NULL_IF_CONFIG_SMALL
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
Definition: internal.h:117
qsvdeint_query_formats
static int qsvdeint_query_formats(AVFilterContext *ctx)
Definition: vf_deinterlace_qsv.c:106
options
static const AVOption options[]
Definition: vf_deinterlace_qsv.c:565
qsvdeint_config_props
static int qsvdeint_config_props(AVFilterLink *outlink)
Definition: vf_deinterlace_qsv.c:326
mode
mode
Definition: ebur128.h:83
qsvdeint_outputs
static const AVFilterPad qsvdeint_outputs[]
Definition: vf_deinterlace_qsv.c:587
AV_OPT_TYPE_INT
@ AV_OPT_TYPE_INT
Definition: opt.h:224
qsvdeint_inputs
static const AVFilterPad qsvdeint_inputs[]
Definition: vf_deinterlace_qsv.c:579
AVMEDIA_TYPE_VIDEO
@ AVMEDIA_TYPE_VIDEO
Definition: avutil.h:201
FILTER_OUTPUTS
#define FILTER_OUTPUTS(array)
Definition: internal.h:153
AV_OPT_TYPE_CONST
@ AV_OPT_TYPE_CONST
Definition: opt.h:233
FLAGS
#define FLAGS
Definition: vf_deinterlace_qsv.c:564