Go to the documentation of this file.
37 #include "AMF/components/HQScaler.h"
38 #include "AMF/components/ColorSpace.h"
78 output_pix_fmts = output_pix_fmts_default;
103 res =
ctx->amf_device_ctx->factory->pVtbl->CreateComponent(
ctx->amf_device_ctx->factory,
ctx->amf_device_ctx->context, AMFHQScaler, &
ctx->component);
108 AMF_ASSIGN_PROPERTY_SIZE(res,
ctx->component, AMF_HQ_SCALER_OUTPUT_SIZE,
out_size);
111 if (
ctx->algorithm != -1) {
112 AMF_ASSIGN_PROPERTY_INT64(res,
ctx->component, AMF_HQ_SCALER_ALGORITHM,
ctx->algorithm);
114 if (
ctx->sharpness != -1) {
115 AMF_ASSIGN_PROPERTY_DOUBLE(res,
ctx->component, AMF_HQ_SCALER_SHARPNESS,
ctx->sharpness);
117 AMF_ASSIGN_PROPERTY_BOOL(res,
ctx->component, AMF_HQ_SCALER_FILL,
ctx->fill);
118 AMF_ASSIGN_PROPERTY_BOOL(res,
ctx->component, AMF_HQ_SCALER_KEEP_ASPECT_RATIO,
ctx->keep_ratio);
120 ctx->color_profile = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN;
121 ctx->color_range = AMF_COLOR_RANGE_UNDEFINED;
122 ctx->primaries = AMF_COLOR_PRIMARIES_UNDEFINED;
123 ctx->trc = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED;
131 #define OFFSET(x) offsetof(AMFFilterContext, x)
132 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
142 {
"algorithm",
"Scaling algorithm",
OFFSET(algorithm),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1,
FLAGS,
"algorithm" },
143 {
"bilinear",
"Bilinear", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_BILINEAR }, 0, 0,
FLAGS,
"algorithm" },
144 {
"bicubic",
"Bicubic", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_BICUBIC }, 0, 0,
FLAGS,
"algorithm" },
145 {
"sr1-0",
"Video SR1.0", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_0 }, 0, 0,
FLAGS,
"algorithm" },
146 {
"point",
"Point", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_POINT }, 0, 0,
FLAGS,
"algorithm" },
147 {
"sr1-1",
"Video SR1.1", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1 }, 0, 0,
FLAGS,
"algorithm" },
174 .p.priv_class = &sr_amf_class,
AVPixelFormat
Pixel format.
static int amf_filter_config_output(AVFilterLink *outlink)
The exact code depends on how similar the blocks are and how related they are to the and needs to apply these operations to the correct inlink or outlink if there are several Macros are available to factor that when no extra processing is inlink
#define FILTER_INPUTS(array)
@ AV_PIX_FMT_BGRA
packed BGRA 8:8:8:8, 32bpp, BGRABGRA...
int amf_setup_input_output_formats(AVFilterContext *avctx, const enum AVPixelFormat *input_pix_fmts, const enum AVPixelFormat *output_pix_fmts)
#define AMF_RETURN_IF_FALSE(avctx, exp, ret_value,...)
Error handling helper.
const char * name
Filter name.
#define AVERROR_UNKNOWN
Unknown error, typically from an external library.
A link between two filters.
@ AV_PIX_FMT_AMF_SURFACE
HW acceleration through AMF.
void * priv
private data for use by the filter
static const AVFilterPad amf_filter_inputs[]
static int amf_filter_query_formats(AVFilterContext *avctx)
enum AMF_SURFACE_FORMAT av_av_to_amf_format(enum AVPixelFormat fmt)
A filter pad used for either input or output.
#define AV_LOG_ERROR
Something went wrong and cannot losslessly be recovered.
@ AV_PIX_FMT_DXVA2_VLD
HW decoding through DXVA2, Picture.data[3] contains a LPDIRECT3DSURFACE9 pointer.
#define FILTER_OUTPUTS(array)
@ AV_PIX_FMT_RGBA
packed RGBA 8:8:8:8, 32bpp, RGBARGBA...
static const AVOption sr_amf_options[]
AVFilterLink ** inputs
array of pointers to input links
#define FF_FILTER_FLAG_HWFRAME_AWARE
The filter is aware of hardware frames, and any hardware frame context should not be automatically pr...
int(* init)(AVBSFContext *ctx)
#define NULL_IF_CONFIG_SMALL(x)
Return NULL if CONFIG_SMALL is true, otherwise the argument without modification.
#define AVFILTER_FLAG_HWDEVICE
The filter can create hardware frames using AVFilterContext.hw_device_ctx.
AVFilterContext * src
source filter
@ AV_PIX_FMT_D3D11
Hardware surfaces for Direct3D11.
int amf_filter_filter_frame(AVFilterLink *inlink, AVFrame *in)
void amf_filter_uninit(AVFilterContext *avctx)
@ AV_OPT_TYPE_FLOAT
Underlying C type is float.
static void uninit(AVBSFContext *ctx)
int w
agreed upon image width
const char * name
Pad name.
int amf_filter_init(AVFilterContext *avctx)
static const AVFilterPad amf_filter_outputs[]
@ 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...
int h
agreed upon image height
@ AV_OPT_TYPE_INT
Underlying C type is int.
int amf_init_filter_config(AVFilterLink *outlink, enum AVPixelFormat *in_format)
#define AVERROR_FILTER_NOT_FOUND
Filter not found.
AVFilter p
The public AVFilter.
#define AV_PIX_FMT_RGBAF16
@ AV_OPT_TYPE_BOOL
Underlying C type is int.
@ AV_OPT_TYPE_STRING
Underlying C type is a uint8_t* that is either NULL or points to a C string allocated with the av_mal...
AVFILTER_DEFINE_CLASS(sr_amf)
@ AV_OPT_TYPE_CONST
Special option type for declaring named constants.
#define FILTER_SINGLE_PIXFMT(pix_fmt_)
#define FILTER_QUERY_FUNC(func)