static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)

{

    int i;

    int a= 2<<s->sprite_warping_accuracy;

    int rho= 3-s->sprite_warping_accuracy;

    int r=16/a;

    const int vop_ref[4][2]= {{0,0}, {s->width,0}, {0, s->height}, {s->width, s->height}}; // only true for rectangle shapes

    int d[4][2]={{0,0}, {0,0}, {0,0}, {0,0}};

    int sprite_ref[4][2];

    int virtual_ref[2][2];

    int w2, h2, w3, h3;

    int alpha=0, beta=0;

    int w= s->width;

    int h= s->height;

    int min_ab;



    for(i=0; i<s->num_sprite_warping_points; i++){

        int length;

        int x=0, y=0;



        length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);

        if(length){

            x= get_xbits(gb, length);

        }

        if(!(s->divx_version==500 && s->divx_build==413)) skip_bits1(gb); /* marker bit */



        length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);

        if(length){

            y=get_xbits(gb, length);

        }

        skip_bits1(gb); /* marker bit */

        s->sprite_traj[i][0]= d[i][0]= x;

        s->sprite_traj[i][1]= d[i][1]= y;

    }

    for(; i<4; i++)

        s->sprite_traj[i][0]= s->sprite_traj[i][1]= 0;



    while((1<<alpha)<w) alpha++;

    while((1<<beta )<h) beta++; // there seems to be a typo in the mpeg4 std for the definition of w' and h'

    w2= 1<<alpha;

    h2= 1<<beta;



// Note, the 4th point isn't used for GMC

    if(s->divx_version==500 && s->divx_build==413){

        sprite_ref[0][0]= a*vop_ref[0][0] + d[0][0];

        sprite_ref[0][1]= a*vop_ref[0][1] + d[0][1];

        sprite_ref[1][0]= a*vop_ref[1][0] + d[0][0] + d[1][0];

        sprite_ref[1][1]= a*vop_ref[1][1] + d[0][1] + d[1][1];

        sprite_ref[2][0]= a*vop_ref[2][0] + d[0][0] + d[2][0];

        sprite_ref[2][1]= a*vop_ref[2][1] + d[0][1] + d[2][1];

    } else {

        sprite_ref[0][0]= (a>>1)*(2*vop_ref[0][0] + d[0][0]);

        sprite_ref[0][1]= (a>>1)*(2*vop_ref[0][1] + d[0][1]);

        sprite_ref[1][0]= (a>>1)*(2*vop_ref[1][0] + d[0][0] + d[1][0]);

        sprite_ref[1][1]= (a>>1)*(2*vop_ref[1][1] + d[0][1] + d[1][1]);

        sprite_ref[2][0]= (a>>1)*(2*vop_ref[2][0] + d[0][0] + d[2][0]);

        sprite_ref[2][1]= (a>>1)*(2*vop_ref[2][1] + d[0][1] + d[2][1]);

    }

/*    sprite_ref[3][0]= (a>>1)*(2*vop_ref[3][0] + d[0][0] + d[1][0] + d[2][0] + d[3][0]);

    sprite_ref[3][1]= (a>>1)*(2*vop_ref[3][1] + d[0][1] + d[1][1] + d[2][1] + d[3][1]); */



// this is mostly identical to the mpeg4 std (and is totally unreadable because of that ...)

// perhaps it should be reordered to be more readable ...

// the idea behind this virtual_ref mess is to be able to use shifts later per pixel instead of divides

// so the distance between points is converted from w&h based to w2&h2 based which are of the 2^x form

    virtual_ref[0][0]= 16*(vop_ref[0][0] + w2)

        + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + w2*(r*sprite_ref[1][0] - 16*vop_ref[1][0])),w);

    virtual_ref[0][1]= 16*vop_ref[0][1]

        + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + w2*(r*sprite_ref[1][1] - 16*vop_ref[1][1])),w);

    virtual_ref[1][0]= 16*vop_ref[0][0]

        + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + h2*(r*sprite_ref[2][0] - 16*vop_ref[2][0])),h);

    virtual_ref[1][1]= 16*(vop_ref[0][1] + h2)

        + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + h2*(r*sprite_ref[2][1] - 16*vop_ref[2][1])),h);



    switch(s->num_sprite_warping_points)

    {

        case 0:

            s->sprite_offset[0][0]= 0;

            s->sprite_offset[0][1]= 0;

            s->sprite_offset[1][0]= 0;

            s->sprite_offset[1][1]= 0;

            s->sprite_delta[0][0]= a;

            s->sprite_delta[0][1]= 0;

            s->sprite_delta[1][0]= 0;

            s->sprite_delta[1][1]= a;

            s->sprite_shift[0]= 0;

            s->sprite_shift[1]= 0;

            break;

        case 1: //GMC only

            s->sprite_offset[0][0]= sprite_ref[0][0] - a*vop_ref[0][0];

            s->sprite_offset[0][1]= sprite_ref[0][1] - a*vop_ref[0][1];

            s->sprite_offset[1][0]= ((sprite_ref[0][0]>>1)|(sprite_ref[0][0]&1)) - a*(vop_ref[0][0]/2);

            s->sprite_offset[1][1]= ((sprite_ref[0][1]>>1)|(sprite_ref[0][1]&1)) - a*(vop_ref[0][1]/2);

            s->sprite_delta[0][0]= a;

            s->sprite_delta[0][1]= 0;

            s->sprite_delta[1][0]= 0;

            s->sprite_delta[1][1]= a;

            s->sprite_shift[0]= 0;

            s->sprite_shift[1]= 0;

            break;

        case 2:

            s->sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+rho))

                                                  + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][0])

                                                  + ( r*sprite_ref[0][1] - virtual_ref[0][1])*(-vop_ref[0][1])

                                                  + (1<<(alpha+rho-1));

            s->sprite_offset[0][1]= (sprite_ref[0][1]<<(alpha+rho))

                                                  + (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-vop_ref[0][0])

                                                  + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][1])

                                                  + (1<<(alpha+rho-1));

            s->sprite_offset[1][0]= ( (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][0] + 1)

                                     +( r*sprite_ref[0][1] - virtual_ref[0][1])*(-2*vop_ref[0][1] + 1)

                                     +2*w2*r*sprite_ref[0][0]

                                     - 16*w2

                                     + (1<<(alpha+rho+1)));

            s->sprite_offset[1][1]= ( (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-2*vop_ref[0][0] + 1)

                                     +(-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][1] + 1)

                                     +2*w2*r*sprite_ref[0][1]

                                     - 16*w2

                                     + (1<<(alpha+rho+1)));

            s->sprite_delta[0][0]=   (-r*sprite_ref[0][0] + virtual_ref[0][0]);

            s->sprite_delta[0][1]=   (+r*sprite_ref[0][1] - virtual_ref[0][1]);

            s->sprite_delta[1][0]=   (-r*sprite_ref[0][1] + virtual_ref[0][1]);

            s->sprite_delta[1][1]=   (-r*sprite_ref[0][0] + virtual_ref[0][0]);



            s->sprite_shift[0]= alpha+rho;

            s->sprite_shift[1]= alpha+rho+2;

            break;

        case 3:

            min_ab= FFMIN(alpha, beta);

            w3= w2>>min_ab;

            h3= h2>>min_ab;

            s->sprite_offset[0][0]=  (sprite_ref[0][0]<<(alpha+beta+rho-min_ab))

                                   + (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-vop_ref[0][0])

                                   + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-vop_ref[0][1])

                                   + (1<<(alpha+beta+rho-min_ab-1));

            s->sprite_offset[0][1]=  (sprite_ref[0][1]<<(alpha+beta+rho-min_ab))

                                   + (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-vop_ref[0][0])

                                   + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-vop_ref[0][1])

                                   + (1<<(alpha+beta+rho-min_ab-1));

            s->sprite_offset[1][0]=  (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-2*vop_ref[0][0] + 1)

                                   + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-2*vop_ref[0][1] + 1)

                                   + 2*w2*h3*r*sprite_ref[0][0]

                                   - 16*w2*h3

                                   + (1<<(alpha+beta+rho-min_ab+1));

            s->sprite_offset[1][1]=  (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-2*vop_ref[0][0] + 1)

                                   + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-2*vop_ref[0][1] + 1)

                                   + 2*w2*h3*r*sprite_ref[0][1]

                                   - 16*w2*h3

                                   + (1<<(alpha+beta+rho-min_ab+1));

            s->sprite_delta[0][0]=   (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3;

            s->sprite_delta[0][1]=   (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3;

            s->sprite_delta[1][0]=   (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3;

            s->sprite_delta[1][1]=   (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3;



            s->sprite_shift[0]= alpha + beta + rho - min_ab;

            s->sprite_shift[1]= alpha + beta + rho - min_ab + 2;

            break;

    }

    /* try to simplify the situation */

    if(   s->sprite_delta[0][0] == a<<s->sprite_shift[0]

       && s->sprite_delta[0][1] == 0

       && s->sprite_delta[1][0] == 0

       && s->sprite_delta[1][1] == a<<s->sprite_shift[0])

    {

        s->sprite_offset[0][0]>>=s->sprite_shift[0];

        s->sprite_offset[0][1]>>=s->sprite_shift[0];

        s->sprite_offset[1][0]>>=s->sprite_shift[1];

        s->sprite_offset[1][1]>>=s->sprite_shift[1];

        s->sprite_delta[0][0]= a;

        s->sprite_delta[0][1]= 0;

        s->sprite_delta[1][0]= 0;

        s->sprite_delta[1][1]= a;

        s->sprite_shift[0]= 0;

        s->sprite_shift[1]= 0;

        s->real_sprite_warping_points=1;

    }

    else{

        int shift_y= 16 - s->sprite_shift[0];

        int shift_c= 16 - s->sprite_shift[1];

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

            s->sprite_offset[0][i]<<= shift_y;

            s->sprite_offset[1][i]<<= shift_c;

            s->sprite_delta[0][i]<<= shift_y;

            s->sprite_delta[1][i]<<= shift_y;

            s->sprite_shift[i]= 16;

        }

        s->real_sprite_warping_points= s->num_sprite_warping_points;

    }

}

static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)

{

    int i;

    int a= 2<<s->sprite_warping_accuracy;

    int rho= 3-s->sprite_warping_accuracy;

    int r=16/a;

    const int vop_ref[4][2]= {{0,0}, {s->width,0}, {0, s->height}, {s->width, s->height}}; 

    int d[4][2]={{0,0}, {0,0}, {0,0}, {0,0}};

    int sprite_ref[4][2];

    int virtual_ref[2][2];

    int w2, h2, w3, h3;

    int alpha=0, beta=0;

    int w= s->width;

    int h= s->height;

    int min_ab;



    for(i=0; i<s->num_sprite_warping_points; i++){

        int length;

        int x=0, y=0;



        length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);

        if(length){

            x= get_xbits(gb, length);

        }

        if(!(s->divx_version==500 && s->divx_build==413)) skip_bits1(gb); 



        length= get_vlc2(gb, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);

        if(length){

            y=get_xbits(gb, length);

        }

        skip_bits1(gb); 

        s->sprite_traj[i][0]= d[i][0]= x;

        s->sprite_traj[i][1]= d[i][1]= y;

    }

    for(; i<4; i++)

        s->sprite_traj[i][0]= s->sprite_traj[i][1]= 0;



    while((1<<alpha)<w) alpha++;

    while((1<<beta )<h) beta++; 

    w2= 1<<alpha;

    h2= 1<<beta;





    if(s->divx_version==500 && s->divx_build==413){

        sprite_ref[0][0]= a*vop_ref[0][0] + d[0][0];

        sprite_ref[0][1]= a*vop_ref[0][1] + d[0][1];

        sprite_ref[1][0]= a*vop_ref[1][0] + d[0][0] + d[1][0];

        sprite_ref[1][1]= a*vop_ref[1][1] + d[0][1] + d[1][1];

        sprite_ref[2][0]= a*vop_ref[2][0] + d[0][0] + d[2][0];

        sprite_ref[2][1]= a*vop_ref[2][1] + d[0][1] + d[2][1];

    } else {

        sprite_ref[0][0]= (a>>1)*(2*vop_ref[0][0] + d[0][0]);

        sprite_ref[0][1]= (a>>1)*(2*vop_ref[0][1] + d[0][1]);

        sprite_ref[1][0]= (a>>1)*(2*vop_ref[1][0] + d[0][0] + d[1][0]);

        sprite_ref[1][1]= (a>>1)*(2*vop_ref[1][1] + d[0][1] + d[1][1]);

        sprite_ref[2][0]= (a>>1)*(2*vop_ref[2][0] + d[0][0] + d[2][0]);

        sprite_ref[2][1]= (a>>1)*(2*vop_ref[2][1] + d[0][1] + d[2][1]);

    }















    virtual_ref[0][0]= 16*(vop_ref[0][0] + w2)

        + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + w2*(r*sprite_ref[1][0] - 16*vop_ref[1][0])),w);

    virtual_ref[0][1]= 16*vop_ref[0][1]

        + ROUNDED_DIV(((w - w2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + w2*(r*sprite_ref[1][1] - 16*vop_ref[1][1])),w);

    virtual_ref[1][0]= 16*vop_ref[0][0]

        + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][0] - 16*vop_ref[0][0]) + h2*(r*sprite_ref[2][0] - 16*vop_ref[2][0])),h);

    virtual_ref[1][1]= 16*(vop_ref[0][1] + h2)

        + ROUNDED_DIV(((h - h2)*(r*sprite_ref[0][1] - 16*vop_ref[0][1]) + h2*(r*sprite_ref[2][1] - 16*vop_ref[2][1])),h);



    switch(s->num_sprite_warping_points)

    {

        case 0:

            s->sprite_offset[0][0]= 0;

            s->sprite_offset[0][1]= 0;

            s->sprite_offset[1][0]= 0;

            s->sprite_offset[1][1]= 0;

            s->sprite_delta[0][0]= a;

            s->sprite_delta[0][1]= 0;

            s->sprite_delta[1][0]= 0;

            s->sprite_delta[1][1]= a;

            s->sprite_shift[0]= 0;

            s->sprite_shift[1]= 0;

            break;

        case 1: 

            s->sprite_offset[0][0]= sprite_ref[0][0] - a*vop_ref[0][0];

            s->sprite_offset[0][1]= sprite_ref[0][1] - a*vop_ref[0][1];

            s->sprite_offset[1][0]= ((sprite_ref[0][0]>>1)|(sprite_ref[0][0]&1)) - a*(vop_ref[0][0]/2);

            s->sprite_offset[1][1]= ((sprite_ref[0][1]>>1)|(sprite_ref[0][1]&1)) - a*(vop_ref[0][1]/2);

            s->sprite_delta[0][0]= a;

            s->sprite_delta[0][1]= 0;

            s->sprite_delta[1][0]= 0;

            s->sprite_delta[1][1]= a;

            s->sprite_shift[0]= 0;

            s->sprite_shift[1]= 0;

            break;

        case 2:

            s->sprite_offset[0][0]= (sprite_ref[0][0]<<(alpha+rho))

                                                  + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][0])

                                                  + ( r*sprite_ref[0][1] - virtual_ref[0][1])*(-vop_ref[0][1])

                                                  + (1<<(alpha+rho-1));

            s->sprite_offset[0][1]= (sprite_ref[0][1]<<(alpha+rho))

                                                  + (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-vop_ref[0][0])

                                                  + (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-vop_ref[0][1])

                                                  + (1<<(alpha+rho-1));

            s->sprite_offset[1][0]= ( (-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][0] + 1)

                                     +( r*sprite_ref[0][1] - virtual_ref[0][1])*(-2*vop_ref[0][1] + 1)

                                     +2*w2*r*sprite_ref[0][0]

                                     - 16*w2

                                     + (1<<(alpha+rho+1)));

            s->sprite_offset[1][1]= ( (-r*sprite_ref[0][1] + virtual_ref[0][1])*(-2*vop_ref[0][0] + 1)

                                     +(-r*sprite_ref[0][0] + virtual_ref[0][0])*(-2*vop_ref[0][1] + 1)

                                     +2*w2*r*sprite_ref[0][1]

                                     - 16*w2

                                     + (1<<(alpha+rho+1)));

            s->sprite_delta[0][0]=   (-r*sprite_ref[0][0] + virtual_ref[0][0]);

            s->sprite_delta[0][1]=   (+r*sprite_ref[0][1] - virtual_ref[0][1]);

            s->sprite_delta[1][0]=   (-r*sprite_ref[0][1] + virtual_ref[0][1]);

            s->sprite_delta[1][1]=   (-r*sprite_ref[0][0] + virtual_ref[0][0]);



            s->sprite_shift[0]= alpha+rho;

            s->sprite_shift[1]= alpha+rho+2;

            break;

        case 3:

            min_ab= FFMIN(alpha, beta);

            w3= w2>>min_ab;

            h3= h2>>min_ab;

            s->sprite_offset[0][0]=  (sprite_ref[0][0]<<(alpha+beta+rho-min_ab))

                                   + (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-vop_ref[0][0])

                                   + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-vop_ref[0][1])

                                   + (1<<(alpha+beta+rho-min_ab-1));

            s->sprite_offset[0][1]=  (sprite_ref[0][1]<<(alpha+beta+rho-min_ab))

                                   + (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-vop_ref[0][0])

                                   + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-vop_ref[0][1])

                                   + (1<<(alpha+beta+rho-min_ab-1));

            s->sprite_offset[1][0]=  (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3*(-2*vop_ref[0][0] + 1)

                                   + (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3*(-2*vop_ref[0][1] + 1)

                                   + 2*w2*h3*r*sprite_ref[0][0]

                                   - 16*w2*h3

                                   + (1<<(alpha+beta+rho-min_ab+1));

            s->sprite_offset[1][1]=  (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3*(-2*vop_ref[0][0] + 1)

                                   + (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3*(-2*vop_ref[0][1] + 1)

                                   + 2*w2*h3*r*sprite_ref[0][1]

                                   - 16*w2*h3

                                   + (1<<(alpha+beta+rho-min_ab+1));

            s->sprite_delta[0][0]=   (-r*sprite_ref[0][0] + virtual_ref[0][0])*h3;

            s->sprite_delta[0][1]=   (-r*sprite_ref[0][0] + virtual_ref[1][0])*w3;

            s->sprite_delta[1][0]=   (-r*sprite_ref[0][1] + virtual_ref[0][1])*h3;

            s->sprite_delta[1][1]=   (-r*sprite_ref[0][1] + virtual_ref[1][1])*w3;



            s->sprite_shift[0]= alpha + beta + rho - min_ab;

            s->sprite_shift[1]= alpha + beta + rho - min_ab + 2;

            break;

    }

    

    if(   s->sprite_delta[0][0] == a<<s->sprite_shift[0]

       && s->sprite_delta[0][1] == 0

       && s->sprite_delta[1][0] == 0

       && s->sprite_delta[1][1] == a<<s->sprite_shift[0])

    {

        s->sprite_offset[0][0]>>=s->sprite_shift[0];

        s->sprite_offset[0][1]>>=s->sprite_shift[0];

        s->sprite_offset[1][0]>>=s->sprite_shift[1];

        s->sprite_offset[1][1]>>=s->sprite_shift[1];

        s->sprite_delta[0][0]= a;

        s->sprite_delta[0][1]= 0;

        s->sprite_delta[1][0]= 0;

        s->sprite_delta[1][1]= a;

        s->sprite_shift[0]= 0;

        s->sprite_shift[1]= 0;

        s->real_sprite_warping_points=1;

    }

    else{

        int shift_y= 16 - s->sprite_shift[0];

        int shift_c= 16 - s->sprite_shift[1];

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

            s->sprite_offset[0][i]<<= shift_y;

            s->sprite_offset[1][i]<<= shift_c;

            s->sprite_delta[0][i]<<= shift_y;

            s->sprite_delta[1][i]<<= shift_y;

            s->sprite_shift[i]= 16;

        }

        s->real_sprite_warping_points= s->num_sprite_warping_points;

    }

}

static void mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
static void FUNC_0(MpegEncContext * VAR_0, GetBitContext *VAR_1)

{

    int VAR_2;

    int VAR_3= 2<<VAR_0->sprite_warping_accuracy;

    int VAR_4= 3-VAR_0->sprite_warping_accuracy;

    int VAR_5=16/VAR_3;

    const int VAR_6[4][2]= {{0,0}, {VAR_0->width,0}, {0, VAR_0->height}, {VAR_0->width, VAR_0->height}}; 

    int VAR_7[4][2]={{0,0}, {0,0}, {0,0}, {0,0}};

    int VAR_8[4][2];

    int VAR_9[2][2];

    int VAR_10, VAR_11, VAR_12, VAR_13;

    int VAR_14=0, VAR_15=0;

    int VAR_16= VAR_0->width;

    int VAR_17= VAR_0->height;

    int VAR_18;



    for(VAR_2=0; VAR_2<VAR_0->num_sprite_warping_points; VAR_2++){

        int length;

        int x=0, y=0;



        length= get_vlc2(VAR_1, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);

        if(length){

            x= get_xbits(VAR_1, length);

        }

        if(!(VAR_0->divx_version==500 && VAR_0->divx_build==413)) skip_bits1(VAR_1); 



        length= get_vlc2(VAR_1, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3);

        if(length){

            y=get_xbits(VAR_1, length);

        }

        skip_bits1(VAR_1); 

        VAR_0->sprite_traj[VAR_2][0]= VAR_7[VAR_2][0]= x;

        VAR_0->sprite_traj[VAR_2][1]= VAR_7[VAR_2][1]= y;

    }

    for(; VAR_2<4; VAR_2++)

        VAR_0->sprite_traj[VAR_2][0]= VAR_0->sprite_traj[VAR_2][1]= 0;



    while((1<<VAR_14)<VAR_16) VAR_14++;

    while((1<<VAR_15 )<VAR_17) VAR_15++; 

    VAR_10= 1<<VAR_14;

    VAR_11= 1<<VAR_15;





    if(VAR_0->divx_version==500 && VAR_0->divx_build==413){

        VAR_8[0][0]= VAR_3*VAR_6[0][0] + VAR_7[0][0];

        VAR_8[0][1]= VAR_3*VAR_6[0][1] + VAR_7[0][1];

        VAR_8[1][0]= VAR_3*VAR_6[1][0] + VAR_7[0][0] + VAR_7[1][0];

        VAR_8[1][1]= VAR_3*VAR_6[1][1] + VAR_7[0][1] + VAR_7[1][1];

        VAR_8[2][0]= VAR_3*VAR_6[2][0] + VAR_7[0][0] + VAR_7[2][0];

        VAR_8[2][1]= VAR_3*VAR_6[2][1] + VAR_7[0][1] + VAR_7[2][1];

    } else {

        VAR_8[0][0]= (VAR_3>>1)*(2*VAR_6[0][0] + VAR_7[0][0]);

        VAR_8[0][1]= (VAR_3>>1)*(2*VAR_6[0][1] + VAR_7[0][1]);

        VAR_8[1][0]= (VAR_3>>1)*(2*VAR_6[1][0] + VAR_7[0][0] + VAR_7[1][0]);

        VAR_8[1][1]= (VAR_3>>1)*(2*VAR_6[1][1] + VAR_7[0][1] + VAR_7[1][1]);

        VAR_8[2][0]= (VAR_3>>1)*(2*VAR_6[2][0] + VAR_7[0][0] + VAR_7[2][0]);

        VAR_8[2][1]= (VAR_3>>1)*(2*VAR_6[2][1] + VAR_7[0][1] + VAR_7[2][1]);

    }















    VAR_9[0][0]= 16*(VAR_6[0][0] + VAR_10)

        + ROUNDED_DIV(((VAR_16 - VAR_10)*(VAR_5*VAR_8[0][0] - 16*VAR_6[0][0]) + VAR_10*(VAR_5*VAR_8[1][0] - 16*VAR_6[1][0])),VAR_16);

    VAR_9[0][1]= 16*VAR_6[0][1]

        + ROUNDED_DIV(((VAR_16 - VAR_10)*(VAR_5*VAR_8[0][1] - 16*VAR_6[0][1]) + VAR_10*(VAR_5*VAR_8[1][1] - 16*VAR_6[1][1])),VAR_16);

    VAR_9[1][0]= 16*VAR_6[0][0]

        + ROUNDED_DIV(((VAR_17 - VAR_11)*(VAR_5*VAR_8[0][0] - 16*VAR_6[0][0]) + VAR_11*(VAR_5*VAR_8[2][0] - 16*VAR_6[2][0])),VAR_17);

    VAR_9[1][1]= 16*(VAR_6[0][1] + VAR_11)

        + ROUNDED_DIV(((VAR_17 - VAR_11)*(VAR_5*VAR_8[0][1] - 16*VAR_6[0][1]) + VAR_11*(VAR_5*VAR_8[2][1] - 16*VAR_6[2][1])),VAR_17);



    switch(VAR_0->num_sprite_warping_points)

    {

        case 0:

            VAR_0->sprite_offset[0][0]= 0;

            VAR_0->sprite_offset[0][1]= 0;

            VAR_0->sprite_offset[1][0]= 0;

            VAR_0->sprite_offset[1][1]= 0;

            VAR_0->sprite_delta[0][0]= VAR_3;

            VAR_0->sprite_delta[0][1]= 0;

            VAR_0->sprite_delta[1][0]= 0;

            VAR_0->sprite_delta[1][1]= VAR_3;

            VAR_0->sprite_shift[0]= 0;

            VAR_0->sprite_shift[1]= 0;

            break;

        case 1: 

            VAR_0->sprite_offset[0][0]= VAR_8[0][0] - VAR_3*VAR_6[0][0];

            VAR_0->sprite_offset[0][1]= VAR_8[0][1] - VAR_3*VAR_6[0][1];

            VAR_0->sprite_offset[1][0]= ((VAR_8[0][0]>>1)|(VAR_8[0][0]&1)) - VAR_3*(VAR_6[0][0]/2);

            VAR_0->sprite_offset[1][1]= ((VAR_8[0][1]>>1)|(VAR_8[0][1]&1)) - VAR_3*(VAR_6[0][1]/2);

            VAR_0->sprite_delta[0][0]= VAR_3;

            VAR_0->sprite_delta[0][1]= 0;

            VAR_0->sprite_delta[1][0]= 0;

            VAR_0->sprite_delta[1][1]= VAR_3;

            VAR_0->sprite_shift[0]= 0;

            VAR_0->sprite_shift[1]= 0;

            break;

        case 2:

            VAR_0->sprite_offset[0][0]= (VAR_8[0][0]<<(VAR_14+VAR_4))

                                                  + (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-VAR_6[0][0])

                                                  + ( VAR_5*VAR_8[0][1] - VAR_9[0][1])*(-VAR_6[0][1])

                                                  + (1<<(VAR_14+VAR_4-1));

            VAR_0->sprite_offset[0][1]= (VAR_8[0][1]<<(VAR_14+VAR_4))

                                                  + (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*(-VAR_6[0][0])

                                                  + (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-VAR_6[0][1])

                                                  + (1<<(VAR_14+VAR_4-1));

            VAR_0->sprite_offset[1][0]= ( (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-2*VAR_6[0][0] + 1)

                                     +( VAR_5*VAR_8[0][1] - VAR_9[0][1])*(-2*VAR_6[0][1] + 1)

                                     +2*VAR_10*VAR_5*VAR_8[0][0]

                                     - 16*VAR_10

                                     + (1<<(VAR_14+VAR_4+1)));

            VAR_0->sprite_offset[1][1]= ( (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*(-2*VAR_6[0][0] + 1)

                                     +(-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-2*VAR_6[0][1] + 1)

                                     +2*VAR_10*VAR_5*VAR_8[0][1]

                                     - 16*VAR_10

                                     + (1<<(VAR_14+VAR_4+1)));

            VAR_0->sprite_delta[0][0]=   (-VAR_5*VAR_8[0][0] + VAR_9[0][0]);

            VAR_0->sprite_delta[0][1]=   (+VAR_5*VAR_8[0][1] - VAR_9[0][1]);

            VAR_0->sprite_delta[1][0]=   (-VAR_5*VAR_8[0][1] + VAR_9[0][1]);

            VAR_0->sprite_delta[1][1]=   (-VAR_5*VAR_8[0][0] + VAR_9[0][0]);



            VAR_0->sprite_shift[0]= VAR_14+VAR_4;

            VAR_0->sprite_shift[1]= VAR_14+VAR_4+2;

            break;

        case 3:

            VAR_18= FFMIN(VAR_14, VAR_15);

            VAR_12= VAR_10>>VAR_18;

            VAR_13= VAR_11>>VAR_18;

            VAR_0->sprite_offset[0][0]=  (VAR_8[0][0]<<(VAR_14+VAR_15+VAR_4-VAR_18))

                                   + (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*VAR_13*(-VAR_6[0][0])

                                   + (-VAR_5*VAR_8[0][0] + VAR_9[1][0])*VAR_12*(-VAR_6[0][1])

                                   + (1<<(VAR_14+VAR_15+VAR_4-VAR_18-1));

            VAR_0->sprite_offset[0][1]=  (VAR_8[0][1]<<(VAR_14+VAR_15+VAR_4-VAR_18))

                                   + (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*VAR_13*(-VAR_6[0][0])

                                   + (-VAR_5*VAR_8[0][1] + VAR_9[1][1])*VAR_12*(-VAR_6[0][1])

                                   + (1<<(VAR_14+VAR_15+VAR_4-VAR_18-1));

            VAR_0->sprite_offset[1][0]=  (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*VAR_13*(-2*VAR_6[0][0] + 1)

                                   + (-VAR_5*VAR_8[0][0] + VAR_9[1][0])*VAR_12*(-2*VAR_6[0][1] + 1)

                                   + 2*VAR_10*VAR_13*VAR_5*VAR_8[0][0]

                                   - 16*VAR_10*VAR_13

                                   + (1<<(VAR_14+VAR_15+VAR_4-VAR_18+1));

            VAR_0->sprite_offset[1][1]=  (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*VAR_13*(-2*VAR_6[0][0] + 1)

                                   + (-VAR_5*VAR_8[0][1] + VAR_9[1][1])*VAR_12*(-2*VAR_6[0][1] + 1)

                                   + 2*VAR_10*VAR_13*VAR_5*VAR_8[0][1]

                                   - 16*VAR_10*VAR_13

                                   + (1<<(VAR_14+VAR_15+VAR_4-VAR_18+1));

            VAR_0->sprite_delta[0][0]=   (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*VAR_13;

            VAR_0->sprite_delta[0][1]=   (-VAR_5*VAR_8[0][0] + VAR_9[1][0])*VAR_12;

            VAR_0->sprite_delta[1][0]=   (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*VAR_13;

            VAR_0->sprite_delta[1][1]=   (-VAR_5*VAR_8[0][1] + VAR_9[1][1])*VAR_12;



            VAR_0->sprite_shift[0]= VAR_14 + VAR_15 + VAR_4 - VAR_18;

            VAR_0->sprite_shift[1]= VAR_14 + VAR_15 + VAR_4 - VAR_18 + 2;

            break;

    }

    

    if(   VAR_0->sprite_delta[0][0] == VAR_3<<VAR_0->sprite_shift[0]

       && VAR_0->sprite_delta[0][1] == 0

       && VAR_0->sprite_delta[1][0] == 0

       && VAR_0->sprite_delta[1][1] == VAR_3<<VAR_0->sprite_shift[0])

    {

        VAR_0->sprite_offset[0][0]>>=VAR_0->sprite_shift[0];

        VAR_0->sprite_offset[0][1]>>=VAR_0->sprite_shift[0];

        VAR_0->sprite_offset[1][0]>>=VAR_0->sprite_shift[1];

        VAR_0->sprite_offset[1][1]>>=VAR_0->sprite_shift[1];

        VAR_0->sprite_delta[0][0]= VAR_3;

        VAR_0->sprite_delta[0][1]= 0;

        VAR_0->sprite_delta[1][0]= 0;

        VAR_0->sprite_delta[1][1]= VAR_3;

        VAR_0->sprite_shift[0]= 0;

        VAR_0->sprite_shift[1]= 0;

        VAR_0->real_sprite_warping_points=1;

    }

    else{

        int VAR_19= 16 - VAR_0->sprite_shift[0];

        int VAR_20= 16 - VAR_0->sprite_shift[1];

        for(VAR_2=0; VAR_2<2; VAR_2++){

            VAR_0->sprite_offset[0][VAR_2]<<= VAR_19;

            VAR_0->sprite_offset[1][VAR_2]<<= VAR_20;

            VAR_0->sprite_delta[0][VAR_2]<<= VAR_19;

            VAR_0->sprite_delta[1][VAR_2]<<= VAR_19;

            VAR_0->sprite_shift[VAR_2]= 16;

        }

        VAR_0->real_sprite_warping_points= VAR_0->num_sprite_warping_points;

    }

}

static void FUNC_0(MpegEncContext * VAR_0, GetBitContext *VAR_1)
{ int VAR_2; int VAR_3= 2<<VAR_0->sprite_warping_accuracy; int VAR_4= 3-VAR_0->sprite_warping_accuracy; int VAR_5=16/VAR_3; const int VAR_6[4][2]= {{0,0}, {VAR_0->width,0}, {0, VAR_0->height}, {VAR_0->width, VAR_0->height}}; int VAR_7[4][2]={{0,0}, {0,0}, {0,0}, {0,0}}; int VAR_8[4][2]; int VAR_9[2][2]; int VAR_10, VAR_11, VAR_12, VAR_13; int VAR_14=0, VAR_15=0; int VAR_16= VAR_0->width; int VAR_17= VAR_0->height; int VAR_18; for(VAR_2=0; VAR_2<VAR_0->num_sprite_warping_points; VAR_2++){ int length; int x=0, y=0; length= get_vlc2(VAR_1, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3); if(length){ x= get_xbits(VAR_1, length); } if(!(VAR_0->divx_version==500 && VAR_0->divx_build==413)) skip_bits1(VAR_1); length= get_vlc2(VAR_1, sprite_trajectory.table, SPRITE_TRAJ_VLC_BITS, 3); if(length){ y=get_xbits(VAR_1, length); } skip_bits1(VAR_1); VAR_0->sprite_traj[VAR_2][0]= VAR_7[VAR_2][0]= x; VAR_0->sprite_traj[VAR_2][1]= VAR_7[VAR_2][1]= y; } for(; VAR_2<4; VAR_2++) VAR_0->sprite_traj[VAR_2][0]= VAR_0->sprite_traj[VAR_2][1]= 0; while((1<<VAR_14)<VAR_16) VAR_14++; while((1<<VAR_15 )<VAR_17) VAR_15++; VAR_10= 1<<VAR_14; VAR_11= 1<<VAR_15; if(VAR_0->divx_version==500 && VAR_0->divx_build==413){ VAR_8[0][0]= VAR_3*VAR_6[0][0] + VAR_7[0][0]; VAR_8[0][1]= VAR_3*VAR_6[0][1] + VAR_7[0][1]; VAR_8[1][0]= VAR_3*VAR_6[1][0] + VAR_7[0][0] + VAR_7[1][0]; VAR_8[1][1]= VAR_3*VAR_6[1][1] + VAR_7[0][1] + VAR_7[1][1]; VAR_8[2][0]= VAR_3*VAR_6[2][0] + VAR_7[0][0] + VAR_7[2][0]; VAR_8[2][1]= VAR_3*VAR_6[2][1] + VAR_7[0][1] + VAR_7[2][1]; } else { VAR_8[0][0]= (VAR_3>>1)*(2*VAR_6[0][0] + VAR_7[0][0]); VAR_8[0][1]= (VAR_3>>1)*(2*VAR_6[0][1] + VAR_7[0][1]); VAR_8[1][0]= (VAR_3>>1)*(2*VAR_6[1][0] + VAR_7[0][0] + VAR_7[1][0]); VAR_8[1][1]= (VAR_3>>1)*(2*VAR_6[1][1] + VAR_7[0][1] + VAR_7[1][1]); VAR_8[2][0]= (VAR_3>>1)*(2*VAR_6[2][0] + VAR_7[0][0] + VAR_7[2][0]); VAR_8[2][1]= (VAR_3>>1)*(2*VAR_6[2][1] + VAR_7[0][1] + VAR_7[2][1]); } VAR_9[0][0]= 16*(VAR_6[0][0] + VAR_10)
+ ROUNDED_DIV(((VAR_16 - VAR_10)*(VAR_5*VAR_8[0][0] - 16*VAR_6[0][0]) + VAR_10*(VAR_5*VAR_8[1][0] - 16*VAR_6[1][0])),VAR_16); VAR_9[0][1]= 16*VAR_6[0][1]
+ ROUNDED_DIV(((VAR_16 - VAR_10)*(VAR_5*VAR_8[0][1] - 16*VAR_6[0][1]) + VAR_10*(VAR_5*VAR_8[1][1] - 16*VAR_6[1][1])),VAR_16); VAR_9[1][0]= 16*VAR_6[0][0]
+ ROUNDED_DIV(((VAR_17 - VAR_11)*(VAR_5*VAR_8[0][0] - 16*VAR_6[0][0]) + VAR_11*(VAR_5*VAR_8[2][0] - 16*VAR_6[2][0])),VAR_17); VAR_9[1][1]= 16*(VAR_6[0][1] + VAR_11)
+ ROUNDED_DIV(((VAR_17 - VAR_11)*(VAR_5*VAR_8[0][1] - 16*VAR_6[0][1]) + VAR_11*(VAR_5*VAR_8[2][1] - 16*VAR_6[2][1])),VAR_17); switch(VAR_0->num_sprite_warping_points)
{ case 0:
VAR_0->sprite_offset[0][0]= 0; VAR_0->sprite_offset[0][1]= 0; VAR_0->sprite_offset[1][0]= 0; VAR_0->sprite_offset[1][1]= 0; VAR_0->sprite_delta[0][0]= VAR_3; VAR_0->sprite_delta[0][1]= 0; VAR_0->sprite_delta[1][0]= 0; VAR_0->sprite_delta[1][1]= VAR_3; VAR_0->sprite_shift[0]= 0; VAR_0->sprite_shift[1]= 0; break; case 1:
VAR_0->sprite_offset[0][0]= VAR_8[0][0] - VAR_3*VAR_6[0][0]; VAR_0->sprite_offset[0][1]= VAR_8[0][1] - VAR_3*VAR_6[0][1]; VAR_0->sprite_offset[1][0]= ((VAR_8[0][0]>>1)|(VAR_8[0][0]&1)) - VAR_3*(VAR_6[0][0]/2); VAR_0->sprite_offset[1][1]= ((VAR_8[0][1]>>1)|(VAR_8[0][1]&1)) - VAR_3*(VAR_6[0][1]/2); VAR_0->sprite_delta[0][0]= VAR_3; VAR_0->sprite_delta[0][1]= 0; VAR_0->sprite_delta[1][0]= 0; VAR_0->sprite_delta[1][1]= VAR_3; VAR_0->sprite_shift[0]= 0; VAR_0->sprite_shift[1]= 0; break; case 2:
VAR_0->sprite_offset[0][0]= (VAR_8[0][0]<<(VAR_14+VAR_4))
+ (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-VAR_6[0][0])
+ ( VAR_5*VAR_8[0][1] - VAR_9[0][1])*(-VAR_6[0][1])
+ (1<<(VAR_14+VAR_4-1)); VAR_0->sprite_offset[0][1]= (VAR_8[0][1]<<(VAR_14+VAR_4))
+ (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*(-VAR_6[0][0])
+ (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-VAR_6[0][1])
+ (1<<(VAR_14+VAR_4-1)); VAR_0->sprite_offset[1][0]= ( (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-2*VAR_6[0][0] + 1)
+( VAR_5*VAR_8[0][1] - VAR_9[0][1])*(-2*VAR_6[0][1] + 1)
+2*VAR_10*VAR_5*VAR_8[0][0]
- 16*VAR_10
+ (1<<(VAR_14+VAR_4+1))); VAR_0->sprite_offset[1][1]= ( (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*(-2*VAR_6[0][0] + 1)
+(-VAR_5*VAR_8[0][0] + VAR_9[0][0])*(-2*VAR_6[0][1] + 1)
+2*VAR_10*VAR_5*VAR_8[0][1]
- 16*VAR_10
+ (1<<(VAR_14+VAR_4+1))); VAR_0->sprite_delta[0][0]=   (-VAR_5*VAR_8[0][0] + VAR_9[0][0]); VAR_0->sprite_delta[0][1]=   (+VAR_5*VAR_8[0][1] - VAR_9[0][1]); VAR_0->sprite_delta[1][0]=   (-VAR_5*VAR_8[0][1] + VAR_9[0][1]); VAR_0->sprite_delta[1][1]=   (-VAR_5*VAR_8[0][0] + VAR_9[0][0]); VAR_0->sprite_shift[0]= VAR_14+VAR_4; VAR_0->sprite_shift[1]= VAR_14+VAR_4+2; break; case 3:
VAR_18= FFMIN(VAR_14, VAR_15); VAR_12= VAR_10>>VAR_18; VAR_13= VAR_11>>VAR_18; VAR_0->sprite_offset[0][0]=  (VAR_8[0][0]<<(VAR_14+VAR_15+VAR_4-VAR_18))
+ (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*VAR_13*(-VAR_6[0][0])
+ (-VAR_5*VAR_8[0][0] + VAR_9[1][0])*VAR_12*(-VAR_6[0][1])
+ (1<<(VAR_14+VAR_15+VAR_4-VAR_18-1)); VAR_0->sprite_offset[0][1]=  (VAR_8[0][1]<<(VAR_14+VAR_15+VAR_4-VAR_18))
+ (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*VAR_13*(-VAR_6[0][0])
+ (-VAR_5*VAR_8[0][1] + VAR_9[1][1])*VAR_12*(-VAR_6[0][1])
+ (1<<(VAR_14+VAR_15+VAR_4-VAR_18-1)); VAR_0->sprite_offset[1][0]=  (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*VAR_13*(-2*VAR_6[0][0] + 1)
+ (-VAR_5*VAR_8[0][0] + VAR_9[1][0])*VAR_12*(-2*VAR_6[0][1] + 1)
+ 2*VAR_10*VAR_13*VAR_5*VAR_8[0][0]
- 16*VAR_10*VAR_13
+ (1<<(VAR_14+VAR_15+VAR_4-VAR_18+1)); VAR_0->sprite_offset[1][1]=  (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*VAR_13*(-2*VAR_6[0][0] + 1)
+ (-VAR_5*VAR_8[0][1] + VAR_9[1][1])*VAR_12*(-2*VAR_6[0][1] + 1)
+ 2*VAR_10*VAR_13*VAR_5*VAR_8[0][1]
- 16*VAR_10*VAR_13
+ (1<<(VAR_14+VAR_15+VAR_4-VAR_18+1)); VAR_0->sprite_delta[0][0]=   (-VAR_5*VAR_8[0][0] + VAR_9[0][0])*VAR_13; VAR_0->sprite_delta[0][1]=   (-VAR_5*VAR_8[0][0] + VAR_9[1][0])*VAR_12; VAR_0->sprite_delta[1][0]=   (-VAR_5*VAR_8[0][1] + VAR_9[0][1])*VAR_13; VAR_0->sprite_delta[1][1]=   (-VAR_5*VAR_8[0][1] + VAR_9[1][1])*VAR_12; VAR_0->sprite_shift[0]= VAR_14 + VAR_15 + VAR_4 - VAR_18; VAR_0->sprite_shift[1]= VAR_14 + VAR_15 + VAR_4 - VAR_18 + 2; break; } if(   VAR_0->sprite_delta[0][0] == VAR_3<<VAR_0->sprite_shift[0]
&& VAR_0->sprite_delta[0][1] == 0
&& VAR_0->sprite_delta[1][0] == 0
&& VAR_0->sprite_delta[1][1] == VAR_3<<VAR_0->sprite_shift[0])
{ VAR_0->sprite_offset[0][0]>>=VAR_0->sprite_shift[0]; VAR_0->sprite_offset[0][1]>>=VAR_0->sprite_shift[0]; VAR_0->sprite_offset[1][0]>>=VAR_0->sprite_shift[1]; VAR_0->sprite_offset[1][1]>>=VAR_0->sprite_shift[1]; VAR_0->sprite_delta[0][0]= VAR_3; VAR_0->sprite_delta[0][1]= 0; VAR_0->sprite_delta[1][0]= 0; VAR_0->sprite_delta[1][1]= VAR_3; VAR_0->sprite_shift[0]= 0; VAR_0->sprite_shift[1]= 0; VAR_0->real_sprite_warping_points=1; } else{ int VAR_19= 16 - VAR_0->sprite_shift[0]; int VAR_20= 16 - VAR_0->sprite_shift[1]; for(VAR_2=0; VAR_2<2; VAR_2++){ VAR_0->sprite_offset[0][VAR_2]<<= VAR_19; VAR_0->sprite_offset[1][VAR_2]<<= VAR_20; VAR_0->sprite_delta[0][VAR_2]<<= VAR_19; VAR_0->sprite_delta[1][VAR_2]<<= VAR_19; VAR_0->sprite_shift[VAR_2]= 16; } VAR_0->real_sprite_warping_points= VAR_0->num_sprite_warping_points; } }