static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)

{

    mp_image_t *dmpi;

    if (vf->priv->in.fmt == vf->priv->out.fmt) { //nothing to do

        dmpi = mpi;

    } else {

        int out_off_left, out_off_right;

        int in_off_left  = vf->priv->in.row_left   * mpi->stride[0]  +

                           vf->priv->in.off_left;

        int in_off_right = vf->priv->in.row_right  * mpi->stride[0]  +

                           vf->priv->in.off_right;



        dmpi = ff_vf_get_image(vf->next, IMGFMT_RGB24, MP_IMGTYPE_TEMP,

                            MP_IMGFLAG_ACCEPT_STRIDE,

                            vf->priv->out.width, vf->priv->out.height);

        out_off_left   = vf->priv->out.row_left  * dmpi->stride[0] +

                         vf->priv->out.off_left;

        out_off_right  = vf->priv->out.row_right * dmpi->stride[0] +

                         vf->priv->out.off_right;



        switch (vf->priv->out.fmt) {

        case SIDE_BY_SIDE_LR:

        case SIDE_BY_SIDE_RL:

        case SIDE_BY_SIDE_2_LR:

        case SIDE_BY_SIDE_2_RL:

        case ABOVE_BELOW_LR:

        case ABOVE_BELOW_RL:

        case ABOVE_BELOW_2_LR:

        case ABOVE_BELOW_2_RL:

        case INTERLEAVE_ROWS_LR:

        case INTERLEAVE_ROWS_RL:

            memcpy_pic2(dmpi->planes[0] + out_off_left,

                       mpi->planes[0] + in_off_left,

                       3 * vf->priv->width,

                       vf->priv->height,

                       dmpi->stride[0] * vf->priv->row_step,

                       mpi->stride[0] * vf->priv->row_step,

                       vf->priv->row_step != 1);

            memcpy_pic2(dmpi->planes[0] + out_off_right,

                       mpi->planes[0] + in_off_right,

                       3 * vf->priv->width,

                       vf->priv->height,

                       dmpi->stride[0] * vf->priv->row_step,

                       mpi->stride[0] * vf->priv->row_step,

                       vf->priv->row_step != 1);

            break;

        case MONO_L:

        case MONO_R:

            memcpy_pic(dmpi->planes[0],

                       mpi->planes[0] + in_off_left,

                       3 * vf->priv->width,

                       vf->priv->height,

                       dmpi->stride[0],

                       mpi->stride[0]);

            break;

        case ANAGLYPH_RC_GRAY:

        case ANAGLYPH_RC_HALF:

        case ANAGLYPH_RC_COLOR:

        case ANAGLYPH_RC_DUBOIS:

        case ANAGLYPH_GM_GRAY:

        case ANAGLYPH_GM_HALF:

        case ANAGLYPH_GM_COLOR:

        case ANAGLYPH_YB_GRAY:

        case ANAGLYPH_YB_HALF:

        case ANAGLYPH_YB_COLOR: {

            int i,x,y,il,ir,o;

            unsigned char *source     = mpi->planes[0];

            unsigned char *dest       = dmpi->planes[0];

            unsigned int   out_width  = vf->priv->out.width;

            int           *ana_matrix[3];



            for(i = 0; i < 3; i++)

                ana_matrix[i] = vf->priv->ana_matrix[i];



            for (y = 0; y < vf->priv->out.height; y++) {

                o   = dmpi->stride[0] * y;

                il  = in_off_left  + y * mpi->stride[0];

                ir  = in_off_right + y * mpi->stride[0];

                for (x = 0; x < out_width; x++) {

                    dest[o    ]  = ana_convert(

                                   ana_matrix[0], source + il, source + ir); //red out

                    dest[o + 1]  = ana_convert(

                                   ana_matrix[1], source + il, source + ir); //green out

                    dest[o + 2]  = ana_convert(

                                   ana_matrix[2], source + il, source + ir); //blue out

                    il += 3;

                    ir += 3;

                    o  += 3;

                }

            }

            break;

        }

        default:

            ff_mp_msg(MSGT_VFILTER, MSGL_WARN,

                   "[stereo3d] stereo format of output is not supported\n");

            return 0;

            break;

        }

    }

    return ff_vf_next_put_image(vf, dmpi, pts);

}

static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts)

{

    mp_image_t *dmpi;

    if (vf->priv->in.fmt == vf->priv->out.fmt) { 

        dmpi = mpi;

    } else {

        int out_off_left, out_off_right;

        int in_off_left  = vf->priv->in.row_left   * mpi->stride[0]  +

                           vf->priv->in.off_left;

        int in_off_right = vf->priv->in.row_right  * mpi->stride[0]  +

                           vf->priv->in.off_right;



        dmpi = ff_vf_get_image(vf->next, IMGFMT_RGB24, MP_IMGTYPE_TEMP,

                            MP_IMGFLAG_ACCEPT_STRIDE,

                            vf->priv->out.width, vf->priv->out.height);

        out_off_left   = vf->priv->out.row_left  * dmpi->stride[0] +

                         vf->priv->out.off_left;

        out_off_right  = vf->priv->out.row_right * dmpi->stride[0] +

                         vf->priv->out.off_right;



        switch (vf->priv->out.fmt) {

        case SIDE_BY_SIDE_LR:

        case SIDE_BY_SIDE_RL:

        case SIDE_BY_SIDE_2_LR:

        case SIDE_BY_SIDE_2_RL:

        case ABOVE_BELOW_LR:

        case ABOVE_BELOW_RL:

        case ABOVE_BELOW_2_LR:

        case ABOVE_BELOW_2_RL:

        case INTERLEAVE_ROWS_LR:

        case INTERLEAVE_ROWS_RL:

            memcpy_pic2(dmpi->planes[0] + out_off_left,

                       mpi->planes[0] + in_off_left,

                       3 * vf->priv->width,

                       vf->priv->height,

                       dmpi->stride[0] * vf->priv->row_step,

                       mpi->stride[0] * vf->priv->row_step,

                       vf->priv->row_step != 1);

            memcpy_pic2(dmpi->planes[0] + out_off_right,

                       mpi->planes[0] + in_off_right,

                       3 * vf->priv->width,

                       vf->priv->height,

                       dmpi->stride[0] * vf->priv->row_step,

                       mpi->stride[0] * vf->priv->row_step,

                       vf->priv->row_step != 1);

            break;

        case MONO_L:

        case MONO_R:

            memcpy_pic(dmpi->planes[0],

                       mpi->planes[0] + in_off_left,

                       3 * vf->priv->width,

                       vf->priv->height,

                       dmpi->stride[0],

                       mpi->stride[0]);

            break;

        case ANAGLYPH_RC_GRAY:

        case ANAGLYPH_RC_HALF:

        case ANAGLYPH_RC_COLOR:

        case ANAGLYPH_RC_DUBOIS:

        case ANAGLYPH_GM_GRAY:

        case ANAGLYPH_GM_HALF:

        case ANAGLYPH_GM_COLOR:

        case ANAGLYPH_YB_GRAY:

        case ANAGLYPH_YB_HALF:

        case ANAGLYPH_YB_COLOR: {

            int i,x,y,il,ir,o;

            unsigned char *source     = mpi->planes[0];

            unsigned char *dest       = dmpi->planes[0];

            unsigned int   out_width  = vf->priv->out.width;

            int           *ana_matrix[3];



            for(i = 0; i < 3; i++)

                ana_matrix[i] = vf->priv->ana_matrix[i];



            for (y = 0; y < vf->priv->out.height; y++) {

                o   = dmpi->stride[0] * y;

                il  = in_off_left  + y * mpi->stride[0];

                ir  = in_off_right + y * mpi->stride[0];

                for (x = 0; x < out_width; x++) {

                    dest[o    ]  = ana_convert(

                                   ana_matrix[0], source + il, source + ir); 

                    dest[o + 1]  = ana_convert(

                                   ana_matrix[1], source + il, source + ir); 

                    dest[o + 2]  = ana_convert(

                                   ana_matrix[2], source + il, source + ir); 

                    il += 3;

                    ir += 3;

                    o  += 3;

                }

            }

            break;

        }

        default:

            ff_mp_msg(MSGT_VFILTER, MSGL_WARN,

                   "[stereo3d] stereo format of output is not supported\n");

            return 0;

            break;

        }

    }

    return ff_vf_next_put_image(vf, dmpi, pts);

}

static int FUNC_0(struct vf_instance *VAR_0, mp_image_t *VAR_1, double VAR_2)

{

    mp_image_t *dmpi;

    if (VAR_0->priv->in.fmt == VAR_0->priv->out.fmt) { 

        dmpi = VAR_1;

    } else {

        int VAR_3, VAR_4;

        int VAR_5  = VAR_0->priv->in.row_left   * VAR_1->stride[0]  +

                           VAR_0->priv->in.off_left;

        int VAR_6 = VAR_0->priv->in.row_right  * VAR_1->stride[0]  +

                           VAR_0->priv->in.off_right;



        dmpi = ff_vf_get_image(VAR_0->next, IMGFMT_RGB24, MP_IMGTYPE_TEMP,

                            MP_IMGFLAG_ACCEPT_STRIDE,

                            VAR_0->priv->out.width, VAR_0->priv->out.height);

        VAR_3   = VAR_0->priv->out.row_left  * dmpi->stride[0] +

                         VAR_0->priv->out.off_left;

        VAR_4  = VAR_0->priv->out.row_right * dmpi->stride[0] +

                         VAR_0->priv->out.off_right;



        switch (VAR_0->priv->out.fmt) {

        case SIDE_BY_SIDE_LR:

        case SIDE_BY_SIDE_RL:

        case SIDE_BY_SIDE_2_LR:

        case SIDE_BY_SIDE_2_RL:

        case ABOVE_BELOW_LR:

        case ABOVE_BELOW_RL:

        case ABOVE_BELOW_2_LR:

        case ABOVE_BELOW_2_RL:

        case INTERLEAVE_ROWS_LR:

        case INTERLEAVE_ROWS_RL:

            memcpy_pic2(dmpi->planes[0] + VAR_3,

                       VAR_1->planes[0] + VAR_5,

                       3 * VAR_0->priv->width,

                       VAR_0->priv->height,

                       dmpi->stride[0] * VAR_0->priv->row_step,

                       VAR_1->stride[0] * VAR_0->priv->row_step,

                       VAR_0->priv->row_step != 1);

            memcpy_pic2(dmpi->planes[0] + VAR_4,

                       VAR_1->planes[0] + VAR_6,

                       3 * VAR_0->priv->width,

                       VAR_0->priv->height,

                       dmpi->stride[0] * VAR_0->priv->row_step,

                       VAR_1->stride[0] * VAR_0->priv->row_step,

                       VAR_0->priv->row_step != 1);

            break;

        case MONO_L:

        case MONO_R:

            memcpy_pic(dmpi->planes[0],

                       VAR_1->planes[0] + VAR_5,

                       3 * VAR_0->priv->width,

                       VAR_0->priv->height,

                       dmpi->stride[0],

                       VAR_1->stride[0]);

            break;

        case ANAGLYPH_RC_GRAY:

        case ANAGLYPH_RC_HALF:

        case ANAGLYPH_RC_COLOR:

        case ANAGLYPH_RC_DUBOIS:

        case ANAGLYPH_GM_GRAY:

        case ANAGLYPH_GM_HALF:

        case ANAGLYPH_GM_COLOR:

        case ANAGLYPH_YB_GRAY:

        case ANAGLYPH_YB_HALF:

        case ANAGLYPH_YB_COLOR: {

            int VAR_7,VAR_8,VAR_9,VAR_10,VAR_11,VAR_12;

            unsigned char *VAR_13     = VAR_1->planes[0];

            unsigned char *VAR_14       = dmpi->planes[0];

            unsigned int   VAR_15  = VAR_0->priv->out.width;

            int           *VAR_16[3];



            for(VAR_7 = 0; VAR_7 < 3; VAR_7++)

                VAR_16[VAR_7] = VAR_0->priv->VAR_16[VAR_7];



            for (VAR_9 = 0; VAR_9 < VAR_0->priv->out.height; VAR_9++) {

                VAR_12   = dmpi->stride[0] * VAR_9;

                VAR_10  = VAR_5  + VAR_9 * VAR_1->stride[0];

                VAR_11  = VAR_6 + VAR_9 * VAR_1->stride[0];

                for (VAR_8 = 0; VAR_8 < VAR_15; VAR_8++) {

                    VAR_14[VAR_12    ]  = ana_convert(

                                   VAR_16[0], VAR_13 + VAR_10, VAR_13 + VAR_11); 

                    VAR_14[VAR_12 + 1]  = ana_convert(

                                   VAR_16[1], VAR_13 + VAR_10, VAR_13 + VAR_11); 

                    VAR_14[VAR_12 + 2]  = ana_convert(

                                   VAR_16[2], VAR_13 + VAR_10, VAR_13 + VAR_11); 

                    VAR_10 += 3;

                    VAR_11 += 3;

                    VAR_12  += 3;

                }

            }

            break;

        }

        default:

            ff_mp_msg(MSGT_VFILTER, MSGL_WARN,

                   "[stereo3d] stereo format of output is not supported\n");

            return 0;

            break;

        }

    }

    return ff_vf_next_put_image(VAR_0, dmpi, VAR_2);

}

static int FUNC_0(struct vf_instance *VAR_0, mp_image_t *VAR_1, double VAR_2)
{ mp_image_t *dmpi; if (VAR_0->priv->in.fmt == VAR_0->priv->out.fmt) { dmpi = VAR_1; } else { int VAR_3, VAR_4; int VAR_5  = VAR_0->priv->in.row_left   * VAR_1->stride[0]  +
VAR_0->priv->in.off_left; int VAR_6 = VAR_0->priv->in.row_right  * VAR_1->stride[0]  +
VAR_0->priv->in.off_right; dmpi = ff_vf_get_image(VAR_0->next, IMGFMT_RGB24, MP_IMGTYPE_TEMP,
MP_IMGFLAG_ACCEPT_STRIDE,
VAR_0->priv->out.width, VAR_0->priv->out.height); VAR_3   = VAR_0->priv->out.row_left  * dmpi->stride[0] +
VAR_0->priv->out.off_left; VAR_4  = VAR_0->priv->out.row_right * dmpi->stride[0] +
VAR_0->priv->out.off_right; switch (VAR_0->priv->out.fmt) { case SIDE_BY_SIDE_LR:
case SIDE_BY_SIDE_RL:
case SIDE_BY_SIDE_2_LR:
case SIDE_BY_SIDE_2_RL:
case ABOVE_BELOW_LR:
case ABOVE_BELOW_RL:
case ABOVE_BELOW_2_LR:
case ABOVE_BELOW_2_RL:
case INTERLEAVE_ROWS_LR:
case INTERLEAVE_ROWS_RL:
memcpy_pic2(dmpi->planes[0] + VAR_3,
VAR_1->planes[0] + VAR_5,
3 * VAR_0->priv->width,
VAR_0->priv->height,
dmpi->stride[0] * VAR_0->priv->row_step,
VAR_1->stride[0] * VAR_0->priv->row_step,
VAR_0->priv->row_step != 1); memcpy_pic2(dmpi->planes[0] + VAR_4,
VAR_1->planes[0] + VAR_6,
3 * VAR_0->priv->width,
VAR_0->priv->height,
dmpi->stride[0] * VAR_0->priv->row_step,
VAR_1->stride[0] * VAR_0->priv->row_step,
VAR_0->priv->row_step != 1); break; case MONO_L:
case MONO_R:
memcpy_pic(dmpi->planes[0],
VAR_1->planes[0] + VAR_5,
3 * VAR_0->priv->width,
VAR_0->priv->height,
dmpi->stride[0],
VAR_1->stride[0]); break; case ANAGLYPH_RC_GRAY:
case ANAGLYPH_RC_HALF:
case ANAGLYPH_RC_COLOR:
case ANAGLYPH_RC_DUBOIS:
case ANAGLYPH_GM_GRAY:
case ANAGLYPH_GM_HALF:
case ANAGLYPH_GM_COLOR:
case ANAGLYPH_YB_GRAY:
case ANAGLYPH_YB_HALF:
case ANAGLYPH_YB_COLOR: { int VAR_7,VAR_8,VAR_9,VAR_10,VAR_11,VAR_12; unsigned char *VAR_13     = VAR_1->planes[0]; unsigned char *VAR_14       = dmpi->planes[0]; unsigned int   VAR_15  = VAR_0->priv->out.width; int           *VAR_16[3]; for(VAR_7 = 0; VAR_7 < 3; VAR_7++) VAR_16[VAR_7] = VAR_0->priv->VAR_16[VAR_7]; for (VAR_9 = 0; VAR_9 < VAR_0->priv->out.height; VAR_9++) { VAR_12   = dmpi->stride[0] * VAR_9; VAR_10  = VAR_5  + VAR_9 * VAR_1->stride[0]; VAR_11  = VAR_6 + VAR_9 * VAR_1->stride[0]; for (VAR_8 = 0; VAR_8 < VAR_15; VAR_8++) { VAR_14[VAR_12    ]  = ana_convert(
VAR_16[0], VAR_13 + VAR_10, VAR_13 + VAR_11); VAR_14[VAR_12 + 1]  = ana_convert(
VAR_16[1], VAR_13 + VAR_10, VAR_13 + VAR_11); VAR_14[VAR_12 + 2]  = ana_convert(
VAR_16[2], VAR_13 + VAR_10, VAR_13 + VAR_11); VAR_10 += 3; VAR_11 += 3; VAR_12  += 3; } } break; } default:
ff_mp_msg(MSGT_VFILTER, MSGL_WARN,
"[stereo3d] stereo format of output is not supported\n"); return 0; break; } } return ff_vf_next_put_image(VAR_0, dmpi, VAR_2); }