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->in_color_range = AMF_COLOR_RANGE_UNDEFINED;
121 ctx->in_primaries = AMF_COLOR_PRIMARIES_UNDEFINED;
122 ctx->in_trc = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED;
123 ctx->color_profile = AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN;
124 ctx->out_color_range = AMF_COLOR_RANGE_UNDEFINED;
125 ctx->out_primaries = AMF_COLOR_PRIMARIES_UNDEFINED;
126 ctx->out_trc = AMF_COLOR_TRANSFER_CHARACTERISTIC_UNDEFINED;
134 #define OFFSET(x) offsetof(AMFFilterContext, x)
135 #define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
145 {
"algorithm",
"Scaling algorithm",
OFFSET(algorithm),
AV_OPT_TYPE_INT, { .i64 = -1 }, -1, AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1,
FLAGS,
"algorithm" },
146 {
"bilinear",
"Bilinear", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_BILINEAR }, 0, 0,
FLAGS,
"algorithm" },
147 {
"bicubic",
"Bicubic", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_BICUBIC }, 0, 0,
FLAGS,
"algorithm" },
148 {
"sr1-0",
"Video SR1.0", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_0 }, 0, 0,
FLAGS,
"algorithm" },
149 {
"point",
"Point", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_POINT }, 0, 0,
FLAGS,
"algorithm" },
150 {
"sr1-1",
"Video SR1.1", 0,
AV_OPT_TYPE_CONST, { .i64 = AMF_HQ_SCALER_ALGORITHM_VIDEOSR1_1 }, 0, 0,
FLAGS,
"algorithm" },
177 .p.priv_class = &sr_amf_class,