static void draw_axis_yuv(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off)

{

    int fmt = out->format, x, y, yh, w = axis->width, h = axis->height;

    int offh = (fmt == AV_PIX_FMT_YUV420P) ? off / 2 : off;

    float a, rcp_255 = 1.0f / 255.0f;

    uint8_t *vy = out->data[0], *vu = out->data[1], *vv = out->data[2];

    uint8_t *vay = axis->data[0], *vau = axis->data[1], *vav = axis->data[2], *vaa = axis->data[3];

    int lsy = out->linesize[0], lsu = out->linesize[1], lsv = out->linesize[2];

    int lsay = axis->linesize[0], lsau = axis->linesize[1], lsav = axis->linesize[2], lsaa = axis->linesize[3];

    uint8_t *lpy, *lpu, *lpv, *lpay, *lpau, *lpav, *lpaa;



    for (y = 0; y < h; y += 2) {

        yh = (fmt == AV_PIX_FMT_YUV420P) ? y / 2 : y;

        lpy = vy + (off + y) * lsy;

        lpu = vu + (offh + yh) * lsu;

        lpv = vv + (offh + yh) * lsv;

        lpay = vay + y * lsay;

        lpau = vau + yh * lsau;

        lpav = vav + yh * lsav;

        lpaa = vaa + y * lsaa;

        for (x = 0; x < w; x += 2) {

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x].yuv.y + 0.5f;

            *lpu++ = a * (*lpau++) + (1.0f - a) * c[x].yuv.u + 0.5f;

            *lpv++ = a * (*lpav++) + (1.0f - a) * c[x].yuv.v + 0.5f;

            /* u and v are skipped on yuv422p and yuv420p */

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x+1].yuv.y + 0.5f;

            if (fmt == AV_PIX_FMT_YUV444P) {

                *lpu++ = a * (*lpau++) + (1.0f - a) * c[x+1].yuv.u + 0.5f;

                *lpv++ = a * (*lpav++) + (1.0f - a) * c[x+1].yuv.v + 0.5f;

            }

        }



        lpy = vy + (off + y + 1) * lsy;

        lpu = vu + (off + y + 1) * lsu;

        lpv = vv + (off + y + 1) * lsv;

        lpay = vay + (y + 1) * lsay;

        lpau = vau + (y + 1) * lsau;

        lpav = vav + (y + 1) * lsav;

        lpaa = vaa + (y + 1) * lsaa;

        for (x = 0; x < out->width; x += 2) {

            /* u and v are skipped on yuv420p */

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x].yuv.y + 0.5f;

            if (fmt != AV_PIX_FMT_YUV420P) {

                *lpu++ = a * (*lpau++) + (1.0f - a) * c[x].yuv.u + 0.5f;

                *lpv++ = a * (*lpav++) + (1.0f - a) * c[x].yuv.v + 0.5f;

            }

            /* u and v are skipped on yuv422p and yuv420p */

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x+1].yuv.y + 0.5f;

            if (fmt == AV_PIX_FMT_YUV444P) {

                *lpu++ = a * (*lpau++) + (1.0f - a) * c[x+1].yuv.u + 0.5f;

                *lpv++ = a * (*lpav++) + (1.0f - a) * c[x+1].yuv.v + 0.5f;

            }

        }

    }

}

static void draw_axis_yuv(AVFrame *out, AVFrame *axis, const ColorFloat *c, int off)

{

    int fmt = out->format, x, y, yh, w = axis->width, h = axis->height;

    int offh = (fmt == AV_PIX_FMT_YUV420P) ? off / 2 : off;

    float a, rcp_255 = 1.0f / 255.0f;

    uint8_t *vy = out->data[0], *vu = out->data[1], *vv = out->data[2];

    uint8_t *vay = axis->data[0], *vau = axis->data[1], *vav = axis->data[2], *vaa = axis->data[3];

    int lsy = out->linesize[0], lsu = out->linesize[1], lsv = out->linesize[2];

    int lsay = axis->linesize[0], lsau = axis->linesize[1], lsav = axis->linesize[2], lsaa = axis->linesize[3];

    uint8_t *lpy, *lpu, *lpv, *lpay, *lpau, *lpav, *lpaa;



    for (y = 0; y < h; y += 2) {

        yh = (fmt == AV_PIX_FMT_YUV420P) ? y / 2 : y;

        lpy = vy + (off + y) * lsy;

        lpu = vu + (offh + yh) * lsu;

        lpv = vv + (offh + yh) * lsv;

        lpay = vay + y * lsay;

        lpau = vau + yh * lsau;

        lpav = vav + yh * lsav;

        lpaa = vaa + y * lsaa;

        for (x = 0; x < w; x += 2) {

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x].yuv.y + 0.5f;

            *lpu++ = a * (*lpau++) + (1.0f - a) * c[x].yuv.u + 0.5f;

            *lpv++ = a * (*lpav++) + (1.0f - a) * c[x].yuv.v + 0.5f;

            

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x+1].yuv.y + 0.5f;

            if (fmt == AV_PIX_FMT_YUV444P) {

                *lpu++ = a * (*lpau++) + (1.0f - a) * c[x+1].yuv.u + 0.5f;

                *lpv++ = a * (*lpav++) + (1.0f - a) * c[x+1].yuv.v + 0.5f;

            }

        }



        lpy = vy + (off + y + 1) * lsy;

        lpu = vu + (off + y + 1) * lsu;

        lpv = vv + (off + y + 1) * lsv;

        lpay = vay + (y + 1) * lsay;

        lpau = vau + (y + 1) * lsau;

        lpav = vav + (y + 1) * lsav;

        lpaa = vaa + (y + 1) * lsaa;

        for (x = 0; x < out->width; x += 2) {

            

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x].yuv.y + 0.5f;

            if (fmt != AV_PIX_FMT_YUV420P) {

                *lpu++ = a * (*lpau++) + (1.0f - a) * c[x].yuv.u + 0.5f;

                *lpv++ = a * (*lpav++) + (1.0f - a) * c[x].yuv.v + 0.5f;

            }

            

            a = rcp_255 * (*lpaa++);

            *lpy++ = a * (*lpay++) + (1.0f - a) * c[x+1].yuv.y + 0.5f;

            if (fmt == AV_PIX_FMT_YUV444P) {

                *lpu++ = a * (*lpau++) + (1.0f - a) * c[x+1].yuv.u + 0.5f;

                *lpv++ = a * (*lpav++) + (1.0f - a) * c[x+1].yuv.v + 0.5f;

            }

        }

    }

}

static void FUNC_0(AVFrame *VAR_0, AVFrame *VAR_1, const ColorFloat *VAR_2, int VAR_3)

{

    int VAR_4 = VAR_0->format, VAR_5, VAR_6, VAR_7, VAR_8 = VAR_1->width, VAR_9 = VAR_1->height;

    int VAR_10 = (VAR_4 == AV_PIX_FMT_YUV420P) ? VAR_3 / 2 : VAR_3;

    float VAR_11, VAR_12 = 1.0f / 255.0f;

    uint8_t *vy = VAR_0->data[0], *vu = VAR_0->data[1], *vv = VAR_0->data[2];

    uint8_t *vay = VAR_1->data[0], *vau = VAR_1->data[1], *vav = VAR_1->data[2], *vaa = VAR_1->data[3];

    int VAR_13 = VAR_0->linesize[0], VAR_14 = VAR_0->linesize[1], VAR_15 = VAR_0->linesize[2];

    int VAR_16 = VAR_1->linesize[0], VAR_17 = VAR_1->linesize[1], VAR_18 = VAR_1->linesize[2], VAR_19 = VAR_1->linesize[3];

    uint8_t *lpy, *lpu, *lpv, *lpay, *lpau, *lpav, *lpaa;



    for (VAR_6 = 0; VAR_6 < VAR_9; VAR_6 += 2) {

        VAR_7 = (VAR_4 == AV_PIX_FMT_YUV420P) ? VAR_6 / 2 : VAR_6;

        lpy = vy + (VAR_3 + VAR_6) * VAR_13;

        lpu = vu + (VAR_10 + VAR_7) * VAR_14;

        lpv = vv + (VAR_10 + VAR_7) * VAR_15;

        lpay = vay + VAR_6 * VAR_16;

        lpau = vau + VAR_7 * VAR_17;

        lpav = vav + VAR_7 * VAR_18;

        lpaa = vaa + VAR_6 * VAR_19;

        for (VAR_5 = 0; VAR_5 < VAR_8; VAR_5 += 2) {

            VAR_11 = VAR_12 * (*lpaa++);

            *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.VAR_6 + 0.5f;

            *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.u + 0.5f;

            *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.v + 0.5f;

            

            VAR_11 = VAR_12 * (*lpaa++);

            *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.VAR_6 + 0.5f;

            if (VAR_4 == AV_PIX_FMT_YUV444P) {

                *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.u + 0.5f;

                *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.v + 0.5f;

            }

        }



        lpy = vy + (VAR_3 + VAR_6 + 1) * VAR_13;

        lpu = vu + (VAR_3 + VAR_6 + 1) * VAR_14;

        lpv = vv + (VAR_3 + VAR_6 + 1) * VAR_15;

        lpay = vay + (VAR_6 + 1) * VAR_16;

        lpau = vau + (VAR_6 + 1) * VAR_17;

        lpav = vav + (VAR_6 + 1) * VAR_18;

        lpaa = vaa + (VAR_6 + 1) * VAR_19;

        for (VAR_5 = 0; VAR_5 < VAR_0->width; VAR_5 += 2) {

            

            VAR_11 = VAR_12 * (*lpaa++);

            *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.VAR_6 + 0.5f;

            if (VAR_4 != AV_PIX_FMT_YUV420P) {

                *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.u + 0.5f;

                *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.v + 0.5f;

            }

            

            VAR_11 = VAR_12 * (*lpaa++);

            *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.VAR_6 + 0.5f;

            if (VAR_4 == AV_PIX_FMT_YUV444P) {

                *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.u + 0.5f;

                *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.v + 0.5f;

            }

        }

    }

}

static void FUNC_0(AVFrame *VAR_0, AVFrame *VAR_1, const ColorFloat *VAR_2, int VAR_3)
{ int VAR_4 = VAR_0->format, VAR_5, VAR_6, VAR_7, VAR_8 = VAR_1->width, VAR_9 = VAR_1->height; int VAR_10 = (VAR_4 == AV_PIX_FMT_YUV420P) ? VAR_3 / 2 : VAR_3; float VAR_11, VAR_12 = 1.0f / 255.0f; uint8_t *vy = VAR_0->data[0], *vu = VAR_0->data[1], *vv = VAR_0->data[2]; uint8_t *vay = VAR_1->data[0], *vau = VAR_1->data[1], *vav = VAR_1->data[2], *vaa = VAR_1->data[3]; int VAR_13 = VAR_0->linesize[0], VAR_14 = VAR_0->linesize[1], VAR_15 = VAR_0->linesize[2]; int VAR_16 = VAR_1->linesize[0], VAR_17 = VAR_1->linesize[1], VAR_18 = VAR_1->linesize[2], VAR_19 = VAR_1->linesize[3]; uint8_t *lpy, *lpu, *lpv, *lpay, *lpau, *lpav, *lpaa; for (VAR_6 = 0; VAR_6 < VAR_9; VAR_6 += 2) { VAR_7 = (VAR_4 == AV_PIX_FMT_YUV420P) ? VAR_6 / 2 : VAR_6; lpy = vy + (VAR_3 + VAR_6) * VAR_13; lpu = vu + (VAR_10 + VAR_7) * VAR_14; lpv = vv + (VAR_10 + VAR_7) * VAR_15; lpay = vay + VAR_6 * VAR_16; lpau = vau + VAR_7 * VAR_17; lpav = vav + VAR_7 * VAR_18; lpaa = vaa + VAR_6 * VAR_19; for (VAR_5 = 0; VAR_5 < VAR_8; VAR_5 += 2) { VAR_11 = VAR_12 * (*lpaa++); *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.VAR_6 + 0.5f; *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.u + 0.5f; *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.v + 0.5f; VAR_11 = VAR_12 * (*lpaa++); *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.VAR_6 + 0.5f; if (VAR_4 == AV_PIX_FMT_YUV444P) { *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.u + 0.5f; *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.v + 0.5f; } } lpy = vy + (VAR_3 + VAR_6 + 1) * VAR_13; lpu = vu + (VAR_3 + VAR_6 + 1) * VAR_14; lpv = vv + (VAR_3 + VAR_6 + 1) * VAR_15; lpay = vay + (VAR_6 + 1) * VAR_16; lpau = vau + (VAR_6 + 1) * VAR_17; lpav = vav + (VAR_6 + 1) * VAR_18; lpaa = vaa + (VAR_6 + 1) * VAR_19; for (VAR_5 = 0; VAR_5 < VAR_0->width; VAR_5 += 2) { VAR_11 = VAR_12 * (*lpaa++); *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.VAR_6 + 0.5f; if (VAR_4 != AV_PIX_FMT_YUV420P) { *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.u + 0.5f; *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5].yuv.v + 0.5f; } VAR_11 = VAR_12 * (*lpaa++); *lpy++ = VAR_11 * (*lpay++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.VAR_6 + 0.5f; if (VAR_4 == AV_PIX_FMT_YUV444P) { *lpu++ = VAR_11 * (*lpau++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.u + 0.5f; *lpv++ = VAR_11 * (*lpav++) + (1.0f - VAR_11) * VAR_2[VAR_5+1].yuv.v + 0.5f; } } } }