30#include "AMF/components/FRC.h"
42#define AMF_FRC_ASSIGN_PROPERTY_INT64_CHECK(avctx, this, name, val) {\
43 AMF_ASSIGN_PROPERTY_INT64(res, this, name, val);\
45 av_log(avctx, AV_LOG_WARNING, "AMFFRC->SetProperty(%ls, %d) failed with error %d\n", name, val, res);\
64 ctx->common.color_profile = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN;
90 AMFComponent *amf_filter =
NULL;
141 AMF_ASSIGN_PROPERTY_INT64(res, amf_filter, AMF_FRC_MODE, frc_ctx->
enable ? FRC_x2_PRESENT : FRC_OFF);
147#define OFFSET(x) offsetof(AMFFRCFilterContext, x)
148#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
150 {
"engine_type",
"Engine type",
OFFSET(engine_type),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, FRC_ENGINE_DX11, .flags =
FLAGS,
"engine_type" },
156 {
"fallback_mode",
"Fallback behavior in case of low interpolation confidence",
OFFSET(fallback),
AV_OPT_TYPE_INT, { .i64 = 1 }, 0, 1, .flags =
FLAGS,
"fallback_mode" },
158 {
"blend",
"Blend two frames together", 0,
AV_OPT_TYPE_CONST, { .i64 = 1 }, 0, 0,
FLAGS,
"fallback_mode" },
160 {
"indicator",
"Show FRC indicator square in the top left corner of the video.",
OFFSET(indicator),
AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, .flags =
FLAGS },
162 {
"profile",
"Level of hierarchical motion search",
OFFSET(
profile),
AV_OPT_TYPE_INT, { .i64 = FRC_PROFILE_HIGH }, FRC_PROFILE_LOW, FRC_PROFILE_SUPER,
FLAGS,
"profile" },
163 {
"low",
"Less levels of hierarchical motion search. "
164 "Only recommended for extremely low resolutions.", 0,
AV_OPT_TYPE_CONST, { .i64 = FRC_PROFILE_LOW }, 0, 0,
FLAGS,
"profile" },
165 {
"high",
"Recommended for any resolution up to 1440p.", 0,
AV_OPT_TYPE_CONST, { .i64 = FRC_PROFILE_HIGH }, 0, 0,
FLAGS,
"profile" },
166 {
"super",
"More levels of hierarchical motion search. "
167 "Recommended for resolutions 1440p or higher.", 0,
AV_OPT_TYPE_CONST, { .i64 = FRC_PROFILE_SUPER }, 0, 0,
FLAGS,
"profile" },
169 {
"mv_search_mode",
"Performance mode of the motion search",
OFFSET(mv_search_mode),
AV_OPT_TYPE_INT, { .i64 = FRC_MV_SEARCH_NATIVE }, FRC_MV_SEARCH_NATIVE, FRC_MV_SEARCH_PERFORMANCE,
FLAGS,
"mv_search_mode" },
170 {
"native",
"Conduct motion search on the full resolution of source images.", 0,
AV_OPT_TYPE_CONST, { .i64 = FRC_MV_SEARCH_NATIVE }, 0, 0,
FLAGS,
"mv_search_mode" },
171 {
"performance",
"Conduct motion search on the down scaled source images. "
172 "Recommended for APU or low end GPU for better performance.", 0,
AV_OPT_TYPE_CONST, { .i64 = FRC_MV_SEARCH_PERFORMANCE }, 0, 0,
FLAGS,
"mv_search_mode" },
174 {
"use_future_frame",
"Enable dependency on future frame, improves quality for the cost of latency",
OFFSET(use_future_frame),
AV_OPT_TYPE_BOOL, { .i64 = 1 }, 0, 1, .flags =
FLAGS },
200 .p.priv_class = &frc_amf_class,
const FFFilter ff_vf_frc_amf
#define AMF_RETURN_IF_FALSE(avctx, exp, ret_value,...)
Error handling helper.
static AVFormatContext * ctx
int(* init)(AVBSFContext *ctx)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
@ AV_OPT_TYPE_INT
Underlying C type is int.
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
#define AVERROR_FILTER_NOT_FOUND
Filter not found.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
enum AMF_SURFACE_FORMAT av_av_to_amf_format(enum AVPixelFormat fmt)
#define AMF_IFACE_CALL(this, function,...)
static av_cold void uninit(AVBitStreamFilterContext *ctx)
static int activate(AVBitStreamFilterContext *ctx)
#define FILTER_INPUTS(array)
#define FILTER_OUTPUTS(array)
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
#define FILTER_QUERY_FUNC(func)
static FilterLink * ff_filter_link(AVFilterLink *link)
#define AVFILTER_DEFINE_CLASS(fname)
common internal API header
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AV_PIX_FMT_RGBAF16
AVPixelFormat
Pixel format.
@ AV_PIX_FMT_NV12
planar YUV 4:2:0, 12bpp, 1 plane for Y and 1 plane for the UV components, which are interleaved (firs...
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
@ AV_PIX_FMT_AMF_SURFACE
HW acceleration through AMF.
#define AV_PIX_FMT_X2BGR10
enum AVPixelFormat format
AVAMFDeviceContext * amf_device_ctx
This struct is allocated as AVHWDeviceContext.hwctx.
AVFilterLink ** inputs
array of pointers to input links
void * priv
private data for use by the filter
A link between two filters.
int w
agreed upon image width
int h
agreed upon image height
AVFilterContext * src
source filter
AVRational time_base
Define the time base used by the PTS of the frames/samples which will pass through this link.
A filter pad used for either input or output.
Link properties exposed to filter code, but not external callers.
AVRational frame_rate
Frame rate of the stream on the link, or 1/0 if unknown or variable.
int amf_setup_input_output_formats(AVFilterContext *avctx, const enum AVPixelFormat *input_pix_fmts)
int amf_filter_activate(AVFilterContext *avctx)
int amf_init_filter_config(AVFilterLink *outlink, enum AVPixelFormat *in_format)
enum AVPixelFormat amf_inlink_sw_format(AVFilterLink *inlink)
void amf_filter_uninit(AVFilterContext *avctx)
static const AVOption frc_amf_options[]
static const AVFilterPad amf_filter_inputs[]
static int amf_frc_filter_config_output(AVFilterLink *outlink)
static int amf_frc_init(AVFilterContext *avctx)
static int amf_filter_query_formats(AVFilterContext *avctx)
#define AMF_FRC_ASSIGN_PROPERTY_INT64_CHECK(avctx, this, name, val)
static const AVFilterPad amf_filter_outputs[]