static void smptebars_fill_picture(AVFilterContext *ctx, AVFrame *picref)

{

    TestSourceContext *test = ctx->priv;

    FFDrawColor color;

    int r_w, r_h, w_h, p_w, p_h, i, tmp, x = 0;

    const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);



    r_w = FFALIGN((test->w + 6) / 7, 1 << pixdesc->log2_chroma_w);

    r_h = FFALIGN(test->h * 2 / 3, 1 << pixdesc->log2_chroma_h);

    w_h = FFALIGN(test->h * 3 / 4 - r_h,  1 << pixdesc->log2_chroma_h);

    p_w = FFALIGN(r_w * 5 / 4, 1 << pixdesc->log2_chroma_w);

    p_h = test->h - w_h - r_h;



#define DRAW_COLOR(rgba, x, y, w, h)                                    \

    ff_draw_color(&test->draw, &color, rgba);                           \

    ff_fill_rectangle(&test->draw, &color,                              \

                      picref->data, picref->linesize, x, y, w, h)       \



    for (i = 0; i < 7; i++) {

        DRAW_COLOR(rainbow[i], x, 0,   FFMIN(r_w, test->w - x), r_h);

        DRAW_COLOR(wobnair[i], x, r_h, FFMIN(r_w, test->w - x), w_h);

        x += r_w;

    }

    x = 0;

    DRAW_COLOR(i_pixel, x, r_h + w_h, p_w, p_h);

    x += p_w;

    DRAW_COLOR(white, x, r_h + w_h, p_w, p_h);

    x += p_w;

    DRAW_COLOR(q_pixel, x, r_h + w_h, p_w, p_h);

    x += p_w;

    tmp = FFALIGN(5 * r_w - x,  1 << pixdesc->log2_chroma_w);

    DRAW_COLOR(black, x, r_h + w_h, tmp, p_h);

    x += tmp;

    tmp = FFALIGN(r_w / 3,  1 << pixdesc->log2_chroma_w);

    DRAW_COLOR(neg4ire, x, r_h + w_h, tmp, p_h);

    x += tmp;

    DRAW_COLOR(black, x, r_h + w_h, tmp, p_h);

    x += tmp;

    DRAW_COLOR(pos4ire, x, r_h + w_h, tmp, p_h);

    x += tmp;

    DRAW_COLOR(black, x, r_h + w_h, test->w - x, p_h);

}

static void smptebars_fill_picture(AVFilterContext *ctx, AVFrame *picref)

{

    TestSourceContext *test = ctx->priv;

    FFDrawColor color;

    int r_w, r_h, w_h, p_w, p_h, i, tmp, x = 0;

    const AVPixFmtDescriptor *pixdesc = av_pix_fmt_desc_get(picref->format);



    r_w = FFALIGN((test->w + 6) / 7, 1 << pixdesc->log2_chroma_w);

    r_h = FFALIGN(test->h * 2 / 3, 1 << pixdesc->log2_chroma_h);

    w_h = FFALIGN(test->h * 3 / 4 - r_h,  1 << pixdesc->log2_chroma_h);

    p_w = FFALIGN(r_w * 5 / 4, 1 << pixdesc->log2_chroma_w);

    p_h = test->h - w_h - r_h;



#define DRAW_COLOR(rgba, x, y, w, h)                                    \

    ff_draw_color(&test->draw, &color, rgba);                           \

    ff_fill_rectangle(&test->draw, &color,                              \

                      picref->data, picref->linesize, x, y, w, h)       \



    for (i = 0; i < 7; i++) {

        DRAW_COLOR(rainbow[i], x, 0,   FFMIN(r_w, test->w - x), r_h);

        DRAW_COLOR(wobnair[i], x, r_h, FFMIN(r_w, test->w - x), w_h);

        x += r_w;

    }

    x = 0;

    DRAW_COLOR(i_pixel, x, r_h + w_h, p_w, p_h);

    x += p_w;

    DRAW_COLOR(white, x, r_h + w_h, p_w, p_h);

    x += p_w;

    DRAW_COLOR(q_pixel, x, r_h + w_h, p_w, p_h);

    x += p_w;

    tmp = FFALIGN(5 * r_w - x,  1 << pixdesc->log2_chroma_w);

    DRAW_COLOR(black, x, r_h + w_h, tmp, p_h);

    x += tmp;

    tmp = FFALIGN(r_w / 3,  1 << pixdesc->log2_chroma_w);

    DRAW_COLOR(neg4ire, x, r_h + w_h, tmp, p_h);

    x += tmp;

    DRAW_COLOR(black, x, r_h + w_h, tmp, p_h);

    x += tmp;

    DRAW_COLOR(pos4ire, x, r_h + w_h, tmp, p_h);

    x += tmp;

    DRAW_COLOR(black, x, r_h + w_h, test->w - x, p_h);

}

    FFDrawColor color; #define DRAW_COLOR(rgba, x, y, w, h)                                    \     ff_draw_color(&test->draw, &color, rgba);                           \     ff_fill_rectangle(&test->draw, &color,                              \                       picref->data, picref->linesize, x, y, w, h)       \         DRAW_COLOR(rainbow[i], x, 0,   FFMIN(r_w, test->w - x), r_h);         DRAW_COLOR(wobnair[i], x, r_h, FFMIN(r_w, test->w - x), w_h);     DRAW_COLOR(i_pixel, x, r_h + w_h, p_w, p_h);     DRAW_COLOR(white, x, r_h + w_h, p_w, p_h);     DRAW_COLOR(q_pixel, x, r_h + w_h, p_w, p_h);     DRAW_COLOR(black, x, r_h + w_h, tmp, p_h);     DRAW_COLOR(neg4ire, x, r_h + w_h, tmp, p_h);     DRAW_COLOR(black, x, r_h + w_h, tmp, p_h);     DRAW_COLOR(pos4ire, x, r_h + w_h, tmp, p_h);     DRAW_COLOR(black, x, r_h + w_h, test->w - x, p_h);
static void FUNC_0(AVFilterContext *VAR_0, AVFrame *VAR_1)

{

    TestSourceContext *test = VAR_0->priv;

    FFDrawColor color;

    int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9 = 0;

    const AVPixFmtDescriptor *VAR_10 = av_pix_fmt_desc_get(VAR_1->format);



    VAR_2 = FFALIGN((test->w + 6) / 7, 1 << VAR_10->log2_chroma_w);

    VAR_3 = FFALIGN(test->h * 2 / 3, 1 << VAR_10->log2_chroma_h);

    VAR_4 = FFALIGN(test->h * 3 / 4 - VAR_3,  1 << VAR_10->log2_chroma_h);

    VAR_5 = FFALIGN(VAR_2 * 5 / 4, 1 << VAR_10->log2_chroma_w);

    VAR_6 = test->h - VAR_4 - VAR_3;



#define DRAW_COLOR(rgba, VAR_9, y, w, h)                                    \

    ff_draw_color(&test->draw, &color, rgba);                           \

    ff_fill_rectangle(&test->draw, &color,                              \

                      VAR_1->data, VAR_1->linesize, VAR_9, y, w, h)       \



    for (VAR_7 = 0; VAR_7 < 7; VAR_7++) {

        DRAW_COLOR(rainbow[VAR_7], VAR_9, 0,   FFMIN(VAR_2, test->w - VAR_9), VAR_3);

        DRAW_COLOR(wobnair[VAR_7], VAR_9, VAR_3, FFMIN(VAR_2, test->w - VAR_9), VAR_4);

        VAR_9 += VAR_2;

    }

    VAR_9 = 0;

    DRAW_COLOR(i_pixel, VAR_9, VAR_3 + VAR_4, VAR_5, VAR_6);

    VAR_9 += VAR_5;

    DRAW_COLOR(white, VAR_9, VAR_3 + VAR_4, VAR_5, VAR_6);

    VAR_9 += VAR_5;

    DRAW_COLOR(q_pixel, VAR_9, VAR_3 + VAR_4, VAR_5, VAR_6);

    VAR_9 += VAR_5;

    VAR_8 = FFALIGN(5 * VAR_2 - VAR_9,  1 << VAR_10->log2_chroma_w);

    DRAW_COLOR(black, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6);

    VAR_9 += VAR_8;

    VAR_8 = FFALIGN(VAR_2 / 3,  1 << VAR_10->log2_chroma_w);

    DRAW_COLOR(neg4ire, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6);

    VAR_9 += VAR_8;

    DRAW_COLOR(black, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6);

    VAR_9 += VAR_8;

    DRAW_COLOR(pos4ire, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6);

    VAR_9 += VAR_8;

    DRAW_COLOR(black, VAR_9, VAR_3 + VAR_4, test->w - VAR_9, VAR_6);

}

static void FUNC_0(AVFilterContext *VAR_0, AVFrame *VAR_1)
{ TestSourceContext *test = VAR_0->priv; FFDrawColor color; int VAR_2, VAR_3, VAR_4, VAR_5, VAR_6, VAR_7, VAR_8, VAR_9 = 0; const AVPixFmtDescriptor *VAR_10 = av_pix_fmt_desc_get(VAR_1->format); VAR_2 = FFALIGN((test->w + 6) / 7, 1 << VAR_10->log2_chroma_w); VAR_3 = FFALIGN(test->h * 2 / 3, 1 << VAR_10->log2_chroma_h); VAR_4 = FFALIGN(test->h * 3 / 4 - VAR_3,  1 << VAR_10->log2_chroma_h); VAR_5 = FFALIGN(VAR_2 * 5 / 4, 1 << VAR_10->log2_chroma_w); VAR_6 = test->h - VAR_4 - VAR_3; #define DRAW_COLOR(rgba, VAR_9, y, w, h)                                    \
ff_draw_color(&test->draw, &color, rgba);                           \ ff_fill_rectangle(&test->draw, &color,                              \
VAR_1->data, VAR_1->linesize, VAR_9, y, w, h)       \
for (VAR_7 = 0; VAR_7 < 7; VAR_7++) { DRAW_COLOR(rainbow[VAR_7], VAR_9, 0,   FFMIN(VAR_2, test->w - VAR_9), VAR_3); DRAW_COLOR(wobnair[VAR_7], VAR_9, VAR_3, FFMIN(VAR_2, test->w - VAR_9), VAR_4); VAR_9 += VAR_2; } VAR_9 = 0; DRAW_COLOR(i_pixel, VAR_9, VAR_3 + VAR_4, VAR_5, VAR_6); VAR_9 += VAR_5; DRAW_COLOR(white, VAR_9, VAR_3 + VAR_4, VAR_5, VAR_6); VAR_9 += VAR_5; DRAW_COLOR(q_pixel, VAR_9, VAR_3 + VAR_4, VAR_5, VAR_6); VAR_9 += VAR_5; VAR_8 = FFALIGN(5 * VAR_2 - VAR_9,  1 << VAR_10->log2_chroma_w); DRAW_COLOR(black, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6); VAR_9 += VAR_8; VAR_8 = FFALIGN(VAR_2 / 3,  1 << VAR_10->log2_chroma_w); DRAW_COLOR(neg4ire, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6); VAR_9 += VAR_8; DRAW_COLOR(black, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6); VAR_9 += VAR_8; DRAW_COLOR(pos4ire, VAR_9, VAR_3 + VAR_4, VAR_8, VAR_6); VAR_9 += VAR_8; DRAW_COLOR(black, VAR_9, VAR_3 + VAR_4, test->w - VAR_9, VAR_6); }