Commit 552c02f2 authored by Clément Bœsch's avatar Clément Bœsch

lavfi/histeq: use standard options parsing.

parent b27a8ba1
...@@ -85,14 +85,6 @@ AVFILTER_DEFINE_CLASS(histeq); ...@@ -85,14 +85,6 @@ AVFILTER_DEFINE_CLASS(histeq);
static av_cold int init(AVFilterContext *ctx, const char *args) static av_cold int init(AVFilterContext *ctx, const char *args)
{ {
HisteqContext *histeq = ctx->priv; HisteqContext *histeq = ctx->priv;
const char *shorthand[] = { "strength", "intensity", "antibanding", NULL };
int ret;
histeq->class = &histeq_class;
av_opt_set_defaults(histeq);
if ((ret = av_opt_set_from_string(histeq, args, shorthand, "=", ":")) < 0)
return ret;
av_log(ctx, AV_LOG_VERBOSE, av_log(ctx, AV_LOG_VERBOSE,
"strength:%0.3f intensity:%0.3f antibanding:%d\n", "strength:%0.3f intensity:%0.3f antibanding:%d\n",
...@@ -101,12 +93,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args) ...@@ -101,12 +93,6 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
return 0; return 0;
} }
static av_cold void uninit(AVFilterContext *ctx)
{
HisteqContext *histeq = ctx->priv;
av_opt_free(histeq);
}
static int query_formats(AVFilterContext *ctx) static int query_formats(AVFilterContext *ctx)
{ {
static const enum PixelFormat pix_fmts[] = { static const enum PixelFormat pix_fmts[] = {
...@@ -283,15 +269,17 @@ static const AVFilterPad histeq_outputs[] = { ...@@ -283,15 +269,17 @@ static const AVFilterPad histeq_outputs[] = {
{ NULL } { NULL }
}; };
static const char *const shorthand[] = { "strength", "intensity", "antibanding", NULL };
AVFilter avfilter_vf_histeq = { AVFilter avfilter_vf_histeq = {
.name = "histeq", .name = "histeq",
.description = NULL_IF_CONFIG_SMALL("Apply global color histogram equalization."), .description = NULL_IF_CONFIG_SMALL("Apply global color histogram equalization."),
.priv_size = sizeof(HisteqContext), .priv_size = sizeof(HisteqContext),
.init = init, .init = init,
.uninit = uninit,
.query_formats = query_formats, .query_formats = query_formats,
.inputs = histeq_inputs, .inputs = histeq_inputs,
.outputs = histeq_outputs, .outputs = histeq_outputs,
.priv_class = &histeq_class, .priv_class = &histeq_class,
.shorthand = shorthand,
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment