static int config_input(AVFilterLink *inlink)
{
    IlContext *il = inlink->dst->priv;
    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(inlink->format);
    int i, ret;

    for (i = 0; i < desc->nb_components; i++)
        il->nb_planes = FFMAX(il->nb_planes, desc->comp[i].plane);
    il->nb_planes++;

    il->has_alpha = !!(desc->flags & PIX_FMT_ALPHA);
    if ((ret = av_image_fill_linesizes(il->linesize, inlink->format, inlink->w)) < 0)
        return ret;

    il->chroma_height = inlink->h >> desc->log2_chroma_h;

    return 0;
}