typedef struct ELBGContext {
const AVClass *class;
AVLFG lfg;
- unsigned int lfg_seed;
+ int64_t lfg_seed;
int max_steps_nb;
int *codeword;
int codeword_length;
{ "l", "set codebook length", OFFSET(codebook_length), AV_OPT_TYPE_INT, { .i64 = 256 }, 1, INT_MAX, FLAGS },
{ "nb_steps", "set max number of steps used to compute the mapping", OFFSET(max_steps_nb), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
{ "n", "set max number of steps used to compute the mapping", OFFSET(max_steps_nb), AV_OPT_TYPE_INT, { .i64 = 1 }, 1, INT_MAX, FLAGS },
- { "seed", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
- { "s", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT, { .i64 = -1 }, -1, UINT32_MAX, FLAGS },
+ { "seed", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT64, {.i64 = -1}, -1, UINT32_MAX, FLAGS },
+ { "s", "set the random seed", OFFSET(lfg_seed), AV_OPT_TYPE_INT64, { .i64 = -1 }, -1, UINT32_MAX, FLAGS },
{ "pal8", "set the pal8 output", OFFSET(pal8), AV_OPT_TYPE_BOOL, { .i64 = 0 }, 0, 1, FLAGS },
{ NULL }
};
AV_PIX_FMT_PAL8,
AV_PIX_FMT_NONE
};
- if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[0]->out_formats)) < 0 ||
- (ret = ff_formats_ref(ff_make_format_list(pal8_fmt), &ctx->outputs[0]->in_formats)) < 0)
+ if ((ret = ff_formats_ref(ff_make_format_list(pix_fmts), &ctx->inputs[0]->outcfg.formats)) < 0 ||
+ (ret = ff_formats_ref(ff_make_format_list(pal8_fmt), &ctx->outputs[0]->incfg.formats)) < 0)
return ret;
}
return 0;
AVFrame *out = ff_get_video_buffer(outlink, outlink->w, outlink->h);
uint32_t *pal;
- if (!out)
+ if (!out) {
+ av_frame_free(&frame);
return AVERROR(ENOMEM);
+ }
out->pts = frame->pts;
av_frame_free(&frame);
pal = (uint32_t *)out->data[1];
{ NULL }
};
-AVFilter ff_vf_elbg = {
+const AVFilter ff_vf_elbg = {
.name = "elbg",
.description = NULL_IF_CONFIG_SMALL("Apply posterize effect, using the ELBG algorithm."),
.priv_size = sizeof(ELBGContext),