static int lut2_config_output(AVFilterLink *outlink)

{

    AVFilterContext *ctx = outlink->src;

    LUT2Context *s = ctx->priv;

    AVFilterLink *srcx = ctx->inputs[0];

    AVFilterLink *srcy = ctx->inputs[1];

    FFFrameSyncIn *in;

    int ret;



    if (srcx->format != srcy->format) {

        av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n");

        return AVERROR(EINVAL);

    }

    if (srcx->w                       != srcy->w ||

        srcx->h                       != srcy->h ||

        srcx->sample_aspect_ratio.num != srcy->sample_aspect_ratio.num ||

        srcx->sample_aspect_ratio.den != srcy->sample_aspect_ratio.den) {

        av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "

               "(size %dx%d, SAR %d:%d) do not match the corresponding "

               "second input link %s parameters (%dx%d, SAR %d:%d)\n",

               ctx->input_pads[0].name, srcx->w, srcx->h,

               srcx->sample_aspect_ratio.num,

               srcx->sample_aspect_ratio.den,

               ctx->input_pads[1].name,

               srcy->w, srcy->h,

               srcy->sample_aspect_ratio.num,

               srcy->sample_aspect_ratio.den);

        return AVERROR(EINVAL);

    }



    outlink->w = srcx->w;

    outlink->h = srcx->h;

    outlink->time_base = srcx->time_base;

    outlink->sample_aspect_ratio = srcx->sample_aspect_ratio;

    outlink->frame_rate = srcx->frame_rate;



    if ((ret = ff_framesync2_init(&s->fs, ctx, 2)) < 0)

        return ret;



    in = s->fs.in;

    in[0].time_base = srcx->time_base;

    in[1].time_base = srcy->time_base;

    in[0].sync   = 1;

    in[0].before = EXT_STOP;

    in[0].after  = EXT_INFINITY;

    in[1].sync   = 1;

    in[1].before = EXT_STOP;

    in[1].after  = EXT_INFINITY;

    s->fs.opaque   = s;

    s->fs.on_event = process_frame;



    if ((ret = config_output(outlink)) < 0)

        return ret;



    return ff_framesync2_configure(&s->fs);

}

static int lut2_config_output(AVFilterLink *outlink)

{

    AVFilterContext *ctx = outlink->src;

    LUT2Context *s = ctx->priv;

    AVFilterLink *srcx = ctx->inputs[0];

    AVFilterLink *srcy = ctx->inputs[1];

    FFFrameSyncIn *in;

    int ret;



    if (srcx->format != srcy->format) {

        av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n");

        return AVERROR(EINVAL);

    }

    if (srcx->w                       != srcy->w ||

        srcx->h                       != srcy->h ||

        srcx->sample_aspect_ratio.num != srcy->sample_aspect_ratio.num ||

        srcx->sample_aspect_ratio.den != srcy->sample_aspect_ratio.den) {

        av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "

               "(size %dx%d, SAR %d:%d) do not match the corresponding "

               "second input link %s parameters (%dx%d, SAR %d:%d)\n",

               ctx->input_pads[0].name, srcx->w, srcx->h,

               srcx->sample_aspect_ratio.num,

               srcx->sample_aspect_ratio.den,

               ctx->input_pads[1].name,

               srcy->w, srcy->h,

               srcy->sample_aspect_ratio.num,

               srcy->sample_aspect_ratio.den);

        return AVERROR(EINVAL);

    }



    outlink->w = srcx->w;

    outlink->h = srcx->h;

    outlink->time_base = srcx->time_base;

    outlink->sample_aspect_ratio = srcx->sample_aspect_ratio;

    outlink->frame_rate = srcx->frame_rate;



    if ((ret = ff_framesync2_init(&s->fs, ctx, 2)) < 0)

        return ret;



    in = s->fs.in;

    in[0].time_base = srcx->time_base;

    in[1].time_base = srcy->time_base;

    in[0].sync   = 1;

    in[0].before = EXT_STOP;

    in[0].after  = EXT_INFINITY;

    in[1].sync   = 1;

    in[1].before = EXT_STOP;

    in[1].after  = EXT_INFINITY;

    s->fs.opaque   = s;

    s->fs.on_event = process_frame;



    if ((ret = config_output(outlink)) < 0)

        return ret;



    return ff_framesync2_configure(&s->fs);

}

    in[0].sync   = 1;
static int FUNC_0(AVFilterLink *VAR_0)

{

    AVFilterContext *ctx = VAR_0->src;

    LUT2Context *s = ctx->priv;

    AVFilterLink *srcx = ctx->inputs[0];

    AVFilterLink *srcy = ctx->inputs[1];

    FFFrameSyncIn *in;

    int VAR_1;



    if (srcx->format != srcy->format) {

        av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n");

        return AVERROR(EINVAL);

    }

    if (srcx->w                       != srcy->w ||

        srcx->h                       != srcy->h ||

        srcx->sample_aspect_ratio.num != srcy->sample_aspect_ratio.num ||

        srcx->sample_aspect_ratio.den != srcy->sample_aspect_ratio.den) {

        av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "

               "(size %dx%d, SAR %d:%d) do not match the corresponding "

               "second input link %s parameters (%dx%d, SAR %d:%d)\n",

               ctx->input_pads[0].name, srcx->w, srcx->h,

               srcx->sample_aspect_ratio.num,

               srcx->sample_aspect_ratio.den,

               ctx->input_pads[1].name,

               srcy->w, srcy->h,

               srcy->sample_aspect_ratio.num,

               srcy->sample_aspect_ratio.den);

        return AVERROR(EINVAL);

    }



    VAR_0->w = srcx->w;

    VAR_0->h = srcx->h;

    VAR_0->time_base = srcx->time_base;

    VAR_0->sample_aspect_ratio = srcx->sample_aspect_ratio;

    VAR_0->frame_rate = srcx->frame_rate;



    if ((VAR_1 = ff_framesync2_init(&s->fs, ctx, 2)) < 0)

        return VAR_1;



    in = s->fs.in;

    in[0].time_base = srcx->time_base;

    in[1].time_base = srcy->time_base;

    in[0].sync   = 1;

    in[0].before = EXT_STOP;

    in[0].after  = EXT_INFINITY;

    in[1].sync   = 1;

    in[1].before = EXT_STOP;

    in[1].after  = EXT_INFINITY;

    s->fs.opaque   = s;

    s->fs.on_event = process_frame;



    if ((VAR_1 = config_output(VAR_0)) < 0)

        return VAR_1;



    return ff_framesync2_configure(&s->fs);

}

static int FUNC_0(AVFilterLink *VAR_0)
{ AVFilterContext *ctx = VAR_0->src; LUT2Context *s = ctx->priv; AVFilterLink *srcx = ctx->inputs[0]; AVFilterLink *srcy = ctx->inputs[1]; FFFrameSyncIn *in; int VAR_1; if (srcx->format != srcy->format) { av_log(ctx, AV_LOG_ERROR, "inputs must be of same pixel format\n"); return AVERROR(EINVAL); } if (srcx->w                       != srcy->w ||
srcx->h                       != srcy->h ||
srcx->sample_aspect_ratio.num != srcy->sample_aspect_ratio.num ||
srcx->sample_aspect_ratio.den != srcy->sample_aspect_ratio.den) { av_log(ctx, AV_LOG_ERROR, "First input link %s parameters "
"(size %dx%d, SAR %d:%d) do not match the corresponding "
"second input link %s parameters (%dx%d, SAR %d:%d)\n",
ctx->input_pads[0].name, srcx->w, srcx->h,
srcx->sample_aspect_ratio.num,
srcx->sample_aspect_ratio.den,
ctx->input_pads[1].name,
srcy->w, srcy->h,
srcy->sample_aspect_ratio.num,
srcy->sample_aspect_ratio.den); return AVERROR(EINVAL); } VAR_0->w = srcx->w; VAR_0->h = srcx->h; VAR_0->time_base = srcx->time_base; VAR_0->sample_aspect_ratio = srcx->sample_aspect_ratio; VAR_0->frame_rate = srcx->frame_rate; if ((VAR_1 = ff_framesync2_init(&s->fs, ctx, 2)) < 0)
return VAR_1; in = s->fs.in; in[0].time_base = srcx->time_base; in[1].time_base = srcy->time_base; in[0].sync   = 1; in[0].before = EXT_STOP; in[0].after  = EXT_INFINITY; in[1].sync   = 1; in[1].before = EXT_STOP; in[1].after  = EXT_INFINITY; s->fs.opaque   = s; s->fs.on_event = process_frame; if ((VAR_1 = config_output(VAR_0)) < 0)
return VAR_1; return ff_framesync2_configure(&s->fs); }