static int draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)

{

    AlphaExtractContext *extract = inlink->dst->priv;

    AVFilterBufferRef *cur_buf = inlink->cur_buf;

    AVFilterBufferRef *out_buf = inlink->dst->outputs[0]->out_buf;



    if (extract->is_packed_rgb) {

        int x, y;

        uint8_t *pin, *pout;

        for (y = y0; y < (y0 + h); y++) {

            pin = cur_buf->data[0] + y * cur_buf->linesize[0] + extract->rgba_map[A];

            pout = out_buf->data[0] + y * out_buf->linesize[0];

            for (x = 0; x < out_buf->video->w; x++) {

                *pout = *pin;

                pout += 1;

                pin += 4;

            }

        }

    } else if (cur_buf->linesize[A] == out_buf->linesize[Y]) {

        const int linesize = cur_buf->linesize[A];

        memcpy(out_buf->data[Y] + y0 * linesize,

               cur_buf->data[A] + y0 * linesize,

               linesize * h);

    } else {

        const int linesize = FFMIN(out_buf->linesize[Y], cur_buf->linesize[A]);

        int y;

        for (y = y0; y < (y0 + h); y++) {

            memcpy(out_buf->data[Y] + y * out_buf->linesize[Y],

                   cur_buf->data[A] + y * cur_buf->linesize[A],

                   linesize);

        }

    }

    return ff_draw_slice(inlink->dst->outputs[0], y0, h, slice_dir);

}

static int draw_slice(AVFilterLink *inlink, int y0, int h, int slice_dir)

{

    AlphaExtractContext *extract = inlink->dst->priv;

    AVFilterBufferRef *cur_buf = inlink->cur_buf;

    AVFilterBufferRef *out_buf = inlink->dst->outputs[0]->out_buf;



    if (extract->is_packed_rgb) {

        int x, y;

        uint8_t *pin, *pout;

        for (y = y0; y < (y0 + h); y++) {

            pin = cur_buf->data[0] + y * cur_buf->linesize[0] + extract->rgba_map[A];

            pout = out_buf->data[0] + y * out_buf->linesize[0];

            for (x = 0; x < out_buf->video->w; x++) {

                *pout = *pin;

                pout += 1;

                pin += 4;

            }

        }

    } else if (cur_buf->linesize[A] == out_buf->linesize[Y]) {

        const int linesize = cur_buf->linesize[A];

        memcpy(out_buf->data[Y] + y0 * linesize,

               cur_buf->data[A] + y0 * linesize,

               linesize * h);

    } else {

        const int linesize = FFMIN(out_buf->linesize[Y], cur_buf->linesize[A]);

        int y;

        for (y = y0; y < (y0 + h); y++) {

            memcpy(out_buf->data[Y] + y * out_buf->linesize[Y],

                   cur_buf->data[A] + y * cur_buf->linesize[A],

                   linesize);

        }

    }

    return ff_draw_slice(inlink->dst->outputs[0], y0, h, slice_dir);

}

    } else if (cur_buf->linesize[A] == out_buf->linesize[Y]) {         const int linesize = cur_buf->linesize[A];         memcpy(out_buf->data[Y] + y0 * linesize,                cur_buf->data[A] + y0 * linesize,                linesize * h);
static int FUNC_0(AVFilterLink *VAR_0, int VAR_1, int VAR_2, int VAR_3)

{

    AlphaExtractContext *extract = VAR_0->dst->priv;

    AVFilterBufferRef *cur_buf = VAR_0->cur_buf;

    AVFilterBufferRef *out_buf = VAR_0->dst->outputs[0]->out_buf;



    if (extract->is_packed_rgb) {

        int VAR_4, VAR_7;

        uint8_t *pin, *pout;

        for (VAR_7 = VAR_1; VAR_7 < (VAR_1 + VAR_2); VAR_7++) {

            pin = cur_buf->data[0] + VAR_7 * cur_buf->VAR_7[0] + extract->rgba_map[A];

            pout = out_buf->data[0] + VAR_7 * out_buf->VAR_7[0];

            for (VAR_4 = 0; VAR_4 < out_buf->video->w; VAR_4++) {

                *pout = *pin;

                pout += 1;

                pin += 4;

            }

        }

    } else if (cur_buf->VAR_7[A] == out_buf->VAR_7[Y]) {

        const int VAR_7 = cur_buf->VAR_7[A];

        memcpy(out_buf->data[Y] + VAR_1 * VAR_7,

               cur_buf->data[A] + VAR_1 * VAR_7,

               VAR_7 * VAR_2);

    } else {

        const int VAR_7 = FFMIN(out_buf->VAR_7[Y], cur_buf->VAR_7[A]);

        int VAR_7;

        for (VAR_7 = VAR_1; VAR_7 < (VAR_1 + VAR_2); VAR_7++) {

            memcpy(out_buf->data[Y] + VAR_7 * out_buf->VAR_7[Y],

                   cur_buf->data[A] + VAR_7 * cur_buf->VAR_7[A],

                   VAR_7);

        }

    }

    return ff_draw_slice(VAR_0->dst->outputs[0], VAR_1, VAR_2, VAR_3);

}

static int FUNC_0(AVFilterLink *VAR_0, int VAR_1, int VAR_2, int VAR_3)
{ AlphaExtractContext *extract = VAR_0->dst->priv; AVFilterBufferRef *cur_buf = VAR_0->cur_buf; AVFilterBufferRef *out_buf = VAR_0->dst->outputs[0]->out_buf; if (extract->is_packed_rgb) { int VAR_4, VAR_7; uint8_t *pin, *pout; for (VAR_7 = VAR_1; VAR_7 < (VAR_1 + VAR_2); VAR_7++) { pin = cur_buf->data[0] + VAR_7 * cur_buf->VAR_7[0] + extract->rgba_map[A]; pout = out_buf->data[0] + VAR_7 * out_buf->VAR_7[0]; for (VAR_4 = 0; VAR_4 < out_buf->video->w; VAR_4++) { *pout = *pin; pout += 1; pin += 4; } } } else if (cur_buf->VAR_7[A] == out_buf->VAR_7[Y]) { const int VAR_7 = cur_buf->VAR_7[A]; memcpy(out_buf->data[Y] + VAR_1 * VAR_7,
cur_buf->data[A] + VAR_1 * VAR_7,
VAR_7 * VAR_2); } else { const int VAR_7 = FFMIN(out_buf->VAR_7[Y], cur_buf->VAR_7[A]); int VAR_7; for (VAR_7 = VAR_1; VAR_7 < (VAR_1 + VAR_2); VAR_7++) { memcpy(out_buf->data[Y] + VAR_7 * out_buf->VAR_7[Y],
cur_buf->data[A] + VAR_7 * cur_buf->VAR_7[A],
VAR_7); } } return ff_draw_slice(VAR_0->dst->outputs[0], VAR_1, VAR_2, VAR_3); }