static void inline xan_wc3_copy_pixel_run(XanContext *s, 

    int x, int y, int pixel_count, int motion_x, int motion_y)

{

    int stride;

    int line_inc;

    int curframe_index, prevframe_index;

    int curframe_x, prevframe_x;

    int width = s->avctx->width;

    unsigned char *palette_plane, *prev_palette_plane;

    unsigned char *y_plane, *u_plane, *v_plane;

    unsigned char *prev_y_plane, *prev_u_plane, *prev_v_plane;

    unsigned char *rgb_plane, *prev_rgb_plane;

    unsigned short *rgb16_plane, *prev_rgb16_plane;

    unsigned int *rgb32_plane, *prev_rgb32_plane;



    switch (s->avctx->pix_fmt) {



    case PIX_FMT_PAL8:

        palette_plane = s->current_frame.data[0];

        prev_palette_plane = s->last_frame.data[0];

        stride = s->current_frame.linesize[0];

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            palette_plane[curframe_index++] = 

                prev_palette_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGB555:

    case PIX_FMT_RGB565:

        rgb16_plane = (unsigned short *)s->current_frame.data[0];

        prev_rgb16_plane = (unsigned short *)s->last_frame.data[0];

        stride = s->current_frame.linesize[0] / 2;

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            rgb16_plane[curframe_index++] = 

                prev_rgb16_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGB24:

    case PIX_FMT_BGR24:

        rgb_plane = s->current_frame.data[0];

        prev_rgb_plane = s->last_frame.data[0];

        stride = s->current_frame.linesize[0];

        line_inc = stride - width * 3;

        curframe_index = y * stride + x * 3;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + 

            (3 * (x + motion_x));

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++];

            rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++];

            rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGBA32:

        rgb32_plane = (unsigned int *)s->current_frame.data[0];

        prev_rgb32_plane = (unsigned int *)s->last_frame.data[0];

        stride = s->current_frame.linesize[0] / 4;

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            rgb32_plane[curframe_index++] = 

                prev_rgb32_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_YUV444P:

        y_plane = s->current_frame.data[0];

        u_plane = s->current_frame.data[1];

        v_plane = s->current_frame.data[2];

        prev_y_plane = s->last_frame.data[0];

        prev_u_plane = s->last_frame.data[1];

        prev_v_plane = s->last_frame.data[2];

        stride = s->current_frame.linesize[0];

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            y_plane[curframe_index] = prev_y_plane[prevframe_index];

            u_plane[curframe_index] = prev_u_plane[prevframe_index];

            v_plane[curframe_index] = prev_v_plane[prevframe_index];



            curframe_index++;

            ADVANCE_CURFRAME_X();

            prevframe_index++;

            ADVANCE_PREVFRAME_X();

        }

        break;



    default:

        av_log(s->avctx, AV_LOG_ERROR, " Xan WC3: Unhandled colorspace\n");

        break;

    }

}

static void inline xan_wc3_copy_pixel_run(XanContext *s, 

    int x, int y, int pixel_count, int motion_x, int motion_y)

{

    int stride;

    int line_inc;

    int curframe_index, prevframe_index;

    int curframe_x, prevframe_x;

    int width = s->avctx->width;

    unsigned char *palette_plane, *prev_palette_plane;

    unsigned char *y_plane, *u_plane, *v_plane;

    unsigned char *prev_y_plane, *prev_u_plane, *prev_v_plane;

    unsigned char *rgb_plane, *prev_rgb_plane;

    unsigned short *rgb16_plane, *prev_rgb16_plane;

    unsigned int *rgb32_plane, *prev_rgb32_plane;



    switch (s->avctx->pix_fmt) {



    case PIX_FMT_PAL8:

        palette_plane = s->current_frame.data[0];

        prev_palette_plane = s->last_frame.data[0];

        stride = s->current_frame.linesize[0];

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            palette_plane[curframe_index++] = 

                prev_palette_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGB555:

    case PIX_FMT_RGB565:

        rgb16_plane = (unsigned short *)s->current_frame.data[0];

        prev_rgb16_plane = (unsigned short *)s->last_frame.data[0];

        stride = s->current_frame.linesize[0] / 2;

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            rgb16_plane[curframe_index++] = 

                prev_rgb16_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGB24:

    case PIX_FMT_BGR24:

        rgb_plane = s->current_frame.data[0];

        prev_rgb_plane = s->last_frame.data[0];

        stride = s->current_frame.linesize[0];

        line_inc = stride - width * 3;

        curframe_index = y * stride + x * 3;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + 

            (3 * (x + motion_x));

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++];

            rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++];

            rgb_plane[curframe_index++] = prev_rgb_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGBA32:

        rgb32_plane = (unsigned int *)s->current_frame.data[0];

        prev_rgb32_plane = (unsigned int *)s->last_frame.data[0];

        stride = s->current_frame.linesize[0] / 4;

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            rgb32_plane[curframe_index++] = 

                prev_rgb32_plane[prevframe_index++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_YUV444P:

        y_plane = s->current_frame.data[0];

        u_plane = s->current_frame.data[1];

        v_plane = s->current_frame.data[2];

        prev_y_plane = s->last_frame.data[0];

        prev_u_plane = s->last_frame.data[1];

        prev_v_plane = s->last_frame.data[2];

        stride = s->current_frame.linesize[0];

        line_inc = stride - width;

        curframe_index = y * stride + x;

        curframe_x = x;

        prevframe_index = (y + motion_y) * stride + x + motion_x;

        prevframe_x = x + motion_x;

        while(pixel_count--) {



            y_plane[curframe_index] = prev_y_plane[prevframe_index];

            u_plane[curframe_index] = prev_u_plane[prevframe_index];

            v_plane[curframe_index] = prev_v_plane[prevframe_index];



            curframe_index++;

            ADVANCE_CURFRAME_X();

            prevframe_index++;

            ADVANCE_PREVFRAME_X();

        }

        break;



    default:

        av_log(s->avctx, AV_LOG_ERROR, " Xan WC3: Unhandled colorspace\n");

        break;

    }

}

static void inline FUNC_0(XanContext *VAR_0, 

    int VAR_1, int VAR_2, int VAR_3, int VAR_4, int VAR_5)

{

    int VAR_6;

    int VAR_7;

    int VAR_8, VAR_9;

    int VAR_10, VAR_11;

    int VAR_12 = VAR_0->avctx->VAR_12;

    unsigned char *VAR_13, *VAR_14;

    unsigned char *VAR_15, *VAR_16, *VAR_17;

    unsigned char *VAR_18, *VAR_19, *VAR_20;

    unsigned char *VAR_21, *VAR_22;

    unsigned short *VAR_23, *VAR_24;

    unsigned int *VAR_25, *VAR_26;



    switch (VAR_0->avctx->pix_fmt) {



    case PIX_FMT_PAL8:

        VAR_13 = VAR_0->current_frame.data[0];

        VAR_14 = VAR_0->last_frame.data[0];

        VAR_6 = VAR_0->current_frame.linesize[0];

        VAR_7 = VAR_6 - VAR_12;

        VAR_8 = VAR_2 * VAR_6 + VAR_1;

        VAR_10 = VAR_1;

        VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4;

        VAR_11 = VAR_1 + VAR_4;

        while(VAR_3--) {



            VAR_13[VAR_8++] = 

                VAR_14[VAR_9++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGB555:

    case PIX_FMT_RGB565:

        VAR_23 = (unsigned short *)VAR_0->current_frame.data[0];

        VAR_24 = (unsigned short *)VAR_0->last_frame.data[0];

        VAR_6 = VAR_0->current_frame.linesize[0] / 2;

        VAR_7 = VAR_6 - VAR_12;

        VAR_8 = VAR_2 * VAR_6 + VAR_1;

        VAR_10 = VAR_1;

        VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4;

        VAR_11 = VAR_1 + VAR_4;

        while(VAR_3--) {



            VAR_23[VAR_8++] = 

                VAR_24[VAR_9++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGB24:

    case PIX_FMT_BGR24:

        VAR_21 = VAR_0->current_frame.data[0];

        VAR_22 = VAR_0->last_frame.data[0];

        VAR_6 = VAR_0->current_frame.linesize[0];

        VAR_7 = VAR_6 - VAR_12 * 3;

        VAR_8 = VAR_2 * VAR_6 + VAR_1 * 3;

        VAR_10 = VAR_1;

        VAR_9 = (VAR_2 + VAR_5) * VAR_6 + 

            (3 * (VAR_1 + VAR_4));

        VAR_11 = VAR_1 + VAR_4;

        while(VAR_3--) {



            VAR_21[VAR_8++] = VAR_22[VAR_9++];

            VAR_21[VAR_8++] = VAR_22[VAR_9++];

            VAR_21[VAR_8++] = VAR_22[VAR_9++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_RGBA32:

        VAR_25 = (unsigned int *)VAR_0->current_frame.data[0];

        VAR_26 = (unsigned int *)VAR_0->last_frame.data[0];

        VAR_6 = VAR_0->current_frame.linesize[0] / 4;

        VAR_7 = VAR_6 - VAR_12;

        VAR_8 = VAR_2 * VAR_6 + VAR_1;

        VAR_10 = VAR_1;

        VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4;

        VAR_11 = VAR_1 + VAR_4;

        while(VAR_3--) {



            VAR_25[VAR_8++] = 

                VAR_26[VAR_9++];



            ADVANCE_CURFRAME_X();

            ADVANCE_PREVFRAME_X();

        }

        break;



    case PIX_FMT_YUV444P:

        VAR_15 = VAR_0->current_frame.data[0];

        VAR_16 = VAR_0->current_frame.data[1];

        VAR_17 = VAR_0->current_frame.data[2];

        VAR_18 = VAR_0->last_frame.data[0];

        VAR_19 = VAR_0->last_frame.data[1];

        VAR_20 = VAR_0->last_frame.data[2];

        VAR_6 = VAR_0->current_frame.linesize[0];

        VAR_7 = VAR_6 - VAR_12;

        VAR_8 = VAR_2 * VAR_6 + VAR_1;

        VAR_10 = VAR_1;

        VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4;

        VAR_11 = VAR_1 + VAR_4;

        while(VAR_3--) {



            VAR_15[VAR_8] = VAR_18[VAR_9];

            VAR_16[VAR_8] = VAR_19[VAR_9];

            VAR_17[VAR_8] = VAR_20[VAR_9];



            VAR_8++;

            ADVANCE_CURFRAME_X();

            VAR_9++;

            ADVANCE_PREVFRAME_X();

        }

        break;



    default:

        av_log(VAR_0->avctx, AV_LOG_ERROR, " Xan WC3: Unhandled colorspace\n");

        break;

    }

}

static void inline FUNC_0(XanContext *VAR_0,
int VAR_1, int VAR_2, int VAR_3, int VAR_4, int VAR_5)
{ int VAR_6; int VAR_7; int VAR_8, VAR_9; int VAR_10, VAR_11; int VAR_12 = VAR_0->avctx->VAR_12; unsigned char *VAR_13, *VAR_14; unsigned char *VAR_15, *VAR_16, *VAR_17; unsigned char *VAR_18, *VAR_19, *VAR_20; unsigned char *VAR_21, *VAR_22; unsigned short *VAR_23, *VAR_24; unsigned int *VAR_25, *VAR_26; switch (VAR_0->avctx->pix_fmt) { case PIX_FMT_PAL8:
VAR_13 = VAR_0->current_frame.data[0]; VAR_14 = VAR_0->last_frame.data[0]; VAR_6 = VAR_0->current_frame.linesize[0]; VAR_7 = VAR_6 - VAR_12; VAR_8 = VAR_2 * VAR_6 + VAR_1; VAR_10 = VAR_1; VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4; VAR_11 = VAR_1 + VAR_4; while(VAR_3--) { VAR_13[VAR_8++] =
VAR_14[VAR_9++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_RGB555:
case PIX_FMT_RGB565:
VAR_23 = (unsigned short *)VAR_0->current_frame.data[0]; VAR_24 = (unsigned short *)VAR_0->last_frame.data[0]; VAR_6 = VAR_0->current_frame.linesize[0] / 2; VAR_7 = VAR_6 - VAR_12; VAR_8 = VAR_2 * VAR_6 + VAR_1; VAR_10 = VAR_1; VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4; VAR_11 = VAR_1 + VAR_4; while(VAR_3--) { VAR_23[VAR_8++] =
VAR_24[VAR_9++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_RGB24:
case PIX_FMT_BGR24:
VAR_21 = VAR_0->current_frame.data[0]; VAR_22 = VAR_0->last_frame.data[0]; VAR_6 = VAR_0->current_frame.linesize[0]; VAR_7 = VAR_6 - VAR_12 * 3; VAR_8 = VAR_2 * VAR_6 + VAR_1 * 3; VAR_10 = VAR_1; VAR_9 = (VAR_2 + VAR_5) * VAR_6 +
(3 * (VAR_1 + VAR_4)); VAR_11 = VAR_1 + VAR_4; while(VAR_3--) { VAR_21[VAR_8++] = VAR_22[VAR_9++]; VAR_21[VAR_8++] = VAR_22[VAR_9++]; VAR_21[VAR_8++] = VAR_22[VAR_9++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_RGBA32:
VAR_25 = (unsigned int *)VAR_0->current_frame.data[0]; VAR_26 = (unsigned int *)VAR_0->last_frame.data[0]; VAR_6 = VAR_0->current_frame.linesize[0] / 4; VAR_7 = VAR_6 - VAR_12; VAR_8 = VAR_2 * VAR_6 + VAR_1; VAR_10 = VAR_1; VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4; VAR_11 = VAR_1 + VAR_4; while(VAR_3--) { VAR_25[VAR_8++] =
VAR_26[VAR_9++]; ADVANCE_CURFRAME_X(); ADVANCE_PREVFRAME_X(); } break; case PIX_FMT_YUV444P:
VAR_15 = VAR_0->current_frame.data[0]; VAR_16 = VAR_0->current_frame.data[1]; VAR_17 = VAR_0->current_frame.data[2]; VAR_18 = VAR_0->last_frame.data[0]; VAR_19 = VAR_0->last_frame.data[1]; VAR_20 = VAR_0->last_frame.data[2]; VAR_6 = VAR_0->current_frame.linesize[0]; VAR_7 = VAR_6 - VAR_12; VAR_8 = VAR_2 * VAR_6 + VAR_1; VAR_10 = VAR_1; VAR_9 = (VAR_2 + VAR_5) * VAR_6 + VAR_1 + VAR_4; VAR_11 = VAR_1 + VAR_4; while(VAR_3--) { VAR_15[VAR_8] = VAR_18[VAR_9]; VAR_16[VAR_8] = VAR_19[VAR_9]; VAR_17[VAR_8] = VAR_20[VAR_9]; VAR_8++; ADVANCE_CURFRAME_X(); VAR_9++; ADVANCE_PREVFRAME_X(); } break; default:
av_log(VAR_0->avctx, AV_LOG_ERROR, " Xan WC3: Unhandled colorspace\n"); break; } }