Re: [FFmpeg-devel] [PATCH 2/2] lavf/vf_scale_amf: AMF scaler/colorspace converter filter implementation

2018-06-18 Thread diamond
Ok, Thanks, I will (after code review, probably some issues should be also 
fixed)



18.06.2018, 14:10 пользователь "ffmpeg-devel от имени Moritz Barsnick" 
 написал:

On Mon, Jun 18, 2018 at 13:53:24 +0300, Alexander Kravchenko wrote:
> ---
>  configure  |   1 +
>  libavfilter/Makefile   |   1 +
>  libavfilter/allfilters.c   |   1 +
>  libavfilter/vf_scale_amf.c | 620 
+
>  4 files changed, 623 insertions(+)
>  create mode 100644 libavfilter/vf_scale_amf.c
[...]

Kindly add some documentation to doc/filters.texi, at least describing
these:

> +#define OFFSET(x) offsetof(AMFScaleContext, x)
> +#define FLAGS AV_OPT_FLAG_VIDEO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
> +static const AVOption options[] = {
> +{ "w",  "Output video width",   OFFSET(w_expr), 
AV_OPT_TYPE_STRING, { .str = "iw"   }, .flags = FLAGS },
> +{ "h",  "Output video height",  OFFSET(h_expr), 
AV_OPT_TYPE_STRING, { .str = "ih"   }, .flags = FLAGS },
> +{ "format", "Output pixel format",  OFFSET(format_str), 
AV_OPT_TYPE_STRING, { .str = "same" }, .flags = FLAGS },
> +
> +{ "scale_type","Scale Type",OFFSET(scale_type),  
AV_OPT_TYPE_INT,   { .i64 = AMF_VIDEO_CONVERTER_SCALE_BILINEAR },
> +AMF_VIDEO_CONVERTER_SCALE_BILINEAR, 
AMF_VIDEO_CONVERTER_SCALE_BICUBIC, FLAGS, "scale_type" },
> +{ "bilinear",  "Bilinear",  0,   
AV_OPT_TYPE_CONST, { .i64 = AMF_VIDEO_CONVERTER_SCALE_BILINEAR },   0, 0, 
FLAGS, "scale_type" },
> +{ "bicubic",   "Bicubic",   0,   
AV_OPT_TYPE_CONST, { .i64 = AMF_VIDEO_CONVERTER_SCALE_BICUBIC },0, 0, 
FLAGS, "scale_type" },
> +
> +{ "color_profile", "Color Profile", 
OFFSET(color_profile),   AV_OPT_TYPE_INT,{ .i64 = 
AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN },
> +AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN, 
AMF_VIDEO_CONVERTER_COLOR_PROFILE_JPEG, FLAGS, "color_profile" },
> +{ "auto",  "Auto",   0, AV_OPT_TYPE_CONST,  { .i64 = 
AMF_VIDEO_CONVERTER_COLOR_PROFILE_UNKNOWN },0, 0, FLAGS, "color_profile" },
> +{ "601",   "601",0, AV_OPT_TYPE_CONST,  { .i64 = 
AMF_VIDEO_CONVERTER_COLOR_PROFILE_601  },   0, 0, FLAGS, "color_profile" },
> +{ "709",   "709",0, AV_OPT_TYPE_CONST,  { .i64 = 
AMF_VIDEO_CONVERTER_COLOR_PROFILE_709  },   0, 0, FLAGS, "color_profile" },
> +{ "2020",  "2020",   0, AV_OPT_TYPE_CONST,  { .i64 = 
AMF_VIDEO_CONVERTER_COLOR_PROFILE_2020  },  0, 0, FLAGS, "color_profile" },
> +{ "full",  "Full Range", 0, AV_OPT_TYPE_CONST,  { .i64 = 
AMF_VIDEO_CONVERTER_COLOR_PROFILE_JPEG  },  0, 0, FLAGS, "color_profile" },
> +
> +{ "keep_aspect_ratio", "Keep Aspect Ratio", 
OFFSET(keep_aspect_ratio), AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, FLAGS },
> +
> +{ "fill",   "Enable fill area out of ROI",  OFFSET(fill),
   AV_OPT_TYPE_BOOL,  { .i64 = 0 }, 0, 1, FLAGS },
> +{ "fill_color", "Fill color out of ROI",OFFSET(fill_color),  
   AV_OPT_TYPE_COLOR,  {.str = "black"}, CHAR_MIN, CHAR_MAX, FLAGS },
> +
> +{ "rect_left",  "Output video rect.left",   OFFSET(rect_left),   
 AV_OPT_TYPE_INT, { .i64 = 0   }, 0, INT_MAX, .flags = FLAGS },
> +{ "rect_right", "Output video rect.right",  OFFSET(rect_right),  
 AV_OPT_TYPE_INT, { .i64 = 0   }, 0, INT_MAX, .flags = FLAGS },
> +{ "rect_top",   "Output video rect.top",OFFSET(rect_top),
 AV_OPT_TYPE_INT, { .i64 = 0   }, 0, INT_MAX, .flags = FLAGS },
> +{ "rect_bottom","Output video rect.bottom", OFFSET(rect_bottom), 
 AV_OPT_TYPE_INT, { .i64 = 0   }, 0, INT_MAX, .flags = FLAGS },
> +
> +{ NULL },
> +};

Thanks,
Moritz
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel



___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 2/2] lavf/vf_scale_amf: AMF scaler/format converter filter implementation

2018-07-16 Thread diamond
> +static const enum AVPixelFormat input_pix_fmts[] = {
> +AV_PIX_FMT_NV12,
> +AV_PIX_FMT_0RGB,
> +AV_PIX_FMT_BGR0,
> +AV_PIX_FMT_RGB0,
> +AV_PIX_FMT_GRAY8,
> +AV_PIX_FMT_YUV420P,
> +AV_PIX_FMT_YUYV422,
> +AV_PIX_FMT_NONE,
> +};

Do I miss it or did you forget to add RGBA?

Can you confirm that the alpha plane is really scaled?
(Unless I misunderstand, you haven't tested it.)
   


Hi Carl. Thanks for your feedback.

Yes, sure, alpha is also scaled in AMF
It look like I did mistake preparing patch and missed RGBA formats here. 
I will update it

Thanks,
Alexander


___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel