static void draw_bar(TestSourceContext *test, const uint8_t color[4],

                     unsigned x, unsigned y, unsigned w, unsigned h,

                     AVFrame *frame)

{

    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);

    uint8_t *p, *p0;

    int plane;



    x = FFMIN(x, test->w - 1);

    y = FFMIN(y, test->h - 1);

    w = FFMIN(w, test->w - x);

    h = FFMIN(h, test->h - y);



    av_assert0(x + w <= test->w);

    av_assert0(y + h <= test->h);



    for (plane = 0; frame->data[plane]; plane++) {

        const int c = color[plane];

        const int linesize = frame->linesize[plane];

        int i, px, py, pw, ph;



        if (plane == 1 || plane == 2) {

            px = x >> desc->log2_chroma_w;

            pw = w >> desc->log2_chroma_w;

            py = y >> desc->log2_chroma_h;

            ph = h >> desc->log2_chroma_h;

        } else {

            px = x;

            pw = w;

            py = y;

            ph = h;

        }



        p0 = p = frame->data[plane] + py * linesize + px;

        memset(p, c, pw);

        p += linesize;

        for (i = 1; i < ph; i++, p += linesize)

            memcpy(p, p0, pw);

    }

}

static void draw_bar(TestSourceContext *test, const uint8_t color[4],

                     unsigned x, unsigned y, unsigned w, unsigned h,

                     AVFrame *frame)

{

    const AVPixFmtDescriptor *desc = av_pix_fmt_desc_get(frame->format);

    uint8_t *p, *p0;

    int plane;



    x = FFMIN(x, test->w - 1);

    y = FFMIN(y, test->h - 1);

    w = FFMIN(w, test->w - x);

    h = FFMIN(h, test->h - y);



    av_assert0(x + w <= test->w);

    av_assert0(y + h <= test->h);



    for (plane = 0; frame->data[plane]; plane++) {

        const int c = color[plane];

        const int linesize = frame->linesize[plane];

        int i, px, py, pw, ph;



        if (plane == 1 || plane == 2) {

            px = x >> desc->log2_chroma_w;

            pw = w >> desc->log2_chroma_w;

            py = y >> desc->log2_chroma_h;

            ph = h >> desc->log2_chroma_h;

        } else {

            px = x;

            pw = w;

            py = y;

            ph = h;

        }



        p0 = p = frame->data[plane] + py * linesize + px;

        memset(p, c, pw);

        p += linesize;

        for (i = 1; i < ph; i++, p += linesize)

            memcpy(p, p0, pw);

    }

}

                     unsigned x, unsigned y, unsigned w, unsigned h,             pw = w >> desc->log2_chroma_w;             ph = h >> desc->log2_chroma_h;
static void FUNC_0(TestSourceContext *VAR_0, const uint8_t VAR_1[4],

                     unsigned VAR_2, unsigned VAR_3, unsigned VAR_4, unsigned VAR_5,

                     AVFrame *VAR_6)

{

    const AVPixFmtDescriptor *VAR_7 = av_pix_fmt_desc_get(VAR_6->format);

    uint8_t *p, *p0;

    int VAR_8;



    VAR_2 = FFMIN(VAR_2, VAR_0->VAR_4 - 1);

    VAR_3 = FFMIN(VAR_3, VAR_0->VAR_5 - 1);

    VAR_4 = FFMIN(VAR_4, VAR_0->VAR_4 - VAR_2);

    VAR_5 = FFMIN(VAR_5, VAR_0->VAR_5 - VAR_3);



    av_assert0(VAR_2 + VAR_4 <= VAR_0->VAR_4);

    av_assert0(VAR_3 + VAR_5 <= VAR_0->VAR_5);



    for (VAR_8 = 0; VAR_6->data[VAR_8]; VAR_8++) {

        const int c = VAR_1[VAR_8];

        const int linesize = VAR_6->linesize[VAR_8];

        int i, px, py, pw, ph;



        if (VAR_8 == 1 || VAR_8 == 2) {

            px = VAR_2 >> VAR_7->log2_chroma_w;

            pw = VAR_4 >> VAR_7->log2_chroma_w;

            py = VAR_3 >> VAR_7->log2_chroma_h;

            ph = VAR_5 >> VAR_7->log2_chroma_h;

        } else {

            px = VAR_2;

            pw = VAR_4;

            py = VAR_3;

            ph = VAR_5;

        }



        p0 = p = VAR_6->data[VAR_8] + py * linesize + px;

        memset(p, c, pw);

        p += linesize;

        for (i = 1; i < ph; i++, p += linesize)

            memcpy(p, p0, pw);

    }

}

static void FUNC_0(TestSourceContext *VAR_0, const uint8_t VAR_1[4],
unsigned VAR_2, unsigned VAR_3, unsigned VAR_4, unsigned VAR_5,
AVFrame *VAR_6)
{ const AVPixFmtDescriptor *VAR_7 = av_pix_fmt_desc_get(VAR_6->format); uint8_t *p, *p0; int VAR_8; VAR_2 = FFMIN(VAR_2, VAR_0->VAR_4 - 1); VAR_3 = FFMIN(VAR_3, VAR_0->VAR_5 - 1); VAR_4 = FFMIN(VAR_4, VAR_0->VAR_4 - VAR_2); VAR_5 = FFMIN(VAR_5, VAR_0->VAR_5 - VAR_3); av_assert0(VAR_2 + VAR_4 <= VAR_0->VAR_4); av_assert0(VAR_3 + VAR_5 <= VAR_0->VAR_5); for (VAR_8 = 0; VAR_6->data[VAR_8]; VAR_8++) { const int c = VAR_1[VAR_8]; const int linesize = VAR_6->linesize[VAR_8]; int i, px, py, pw, ph; if (VAR_8 == 1 || VAR_8 == 2) { px = VAR_2 >> VAR_7->log2_chroma_w; pw = VAR_4 >> VAR_7->log2_chroma_w; py = VAR_3 >> VAR_7->log2_chroma_h; ph = VAR_5 >> VAR_7->log2_chroma_h; } else { px = VAR_2; pw = VAR_4; py = VAR_3; ph = VAR_5; } p0 = p = VAR_6->data[VAR_8] + py * linesize + px; memset(p, c, pw); p += linesize; for (i = 1; i < ph; i++, p += linesize) memcpy(p, p0, pw); } }