static void inline xan_wc3_output_pixel_run(XanContext *s, 

    unsigned char *pixel_buffer, int x, int y, int pixel_count)

{

    int stride;

    int line_inc;

    int index;

    int current_x;

    int width = s->avctx->width;

    unsigned char pix;

    unsigned char *palette_plane;

    unsigned char *y_plane;

    unsigned char *u_plane;

    unsigned char *v_plane;

    unsigned char *rgb_plane;

    unsigned short *rgb16_plane;

    unsigned short *palette16;

    unsigned int *rgb32_plane;

    unsigned int *palette32;



    switch (s->avctx->pix_fmt) {



    case PIX_FMT_PAL8:

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

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {



            /* don't do a memcpy() here; keyframes generally copy an entire

             * frame of data and the stride needs to be accounted for */

            palette_plane[index++] = *pixel_buffer++;



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGB555:

    case PIX_FMT_RGB565:

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

        palette16 = (unsigned short *)s->palette;

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {



            rgb16_plane[index++] = palette16[*pixel_buffer++];



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGB24:

    case PIX_FMT_BGR24:

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

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

        line_inc = stride - width * 3;

        index = y * stride + x * 3;

        current_x = x;

        while(pixel_count--) {

            pix = *pixel_buffer++;



            rgb_plane[index++] = s->palette[pix * 4 + 0];

            rgb_plane[index++] = s->palette[pix * 4 + 1];

            rgb_plane[index++] = s->palette[pix * 4 + 2];



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGBA32:

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

        palette32 = (unsigned int *)s->palette;

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {



            rgb32_plane[index++] = palette32[*pixel_buffer++];



            ADVANCE_CURRENT_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];

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {

            pix = *pixel_buffer++;



            y_plane[index] = s->palette[pix * 4 + 0];

            u_plane[index] = s->palette[pix * 4 + 1];

            v_plane[index] = s->palette[pix * 4 + 2];



            index++;

            ADVANCE_CURRENT_X();

        }

        break;



    default:

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

        break;

    }

}

static void inline xan_wc3_output_pixel_run(XanContext *s, 

    unsigned char *pixel_buffer, int x, int y, int pixel_count)

{

    int stride;

    int line_inc;

    int index;

    int current_x;

    int width = s->avctx->width;

    unsigned char pix;

    unsigned char *palette_plane;

    unsigned char *y_plane;

    unsigned char *u_plane;

    unsigned char *v_plane;

    unsigned char *rgb_plane;

    unsigned short *rgb16_plane;

    unsigned short *palette16;

    unsigned int *rgb32_plane;

    unsigned int *palette32;



    switch (s->avctx->pix_fmt) {



    case PIX_FMT_PAL8:

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

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {



            



            palette_plane[index++] = *pixel_buffer++;



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGB555:

    case PIX_FMT_RGB565:

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

        palette16 = (unsigned short *)s->palette;

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {



            rgb16_plane[index++] = palette16[*pixel_buffer++];



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGB24:

    case PIX_FMT_BGR24:

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

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

        line_inc = stride - width * 3;

        index = y * stride + x * 3;

        current_x = x;

        while(pixel_count--) {

            pix = *pixel_buffer++;



            rgb_plane[index++] = s->palette[pix * 4 + 0];

            rgb_plane[index++] = s->palette[pix * 4 + 1];

            rgb_plane[index++] = s->palette[pix * 4 + 2];



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGBA32:

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

        palette32 = (unsigned int *)s->palette;

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {



            rgb32_plane[index++] = palette32[*pixel_buffer++];



            ADVANCE_CURRENT_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];

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

        line_inc = stride - width;

        index = y * stride + x;

        current_x = x;

        while(pixel_count--) {

            pix = *pixel_buffer++;



            y_plane[index] = s->palette[pix * 4 + 0];

            u_plane[index] = s->palette[pix * 4 + 1];

            v_plane[index] = s->palette[pix * 4 + 2];



            index++;

            ADVANCE_CURRENT_X();

        }

        break;



    default:

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

        break;

    }

}

static void inline FUNC_0(XanContext *VAR_0, 

    unsigned char *VAR_1, int VAR_2, int VAR_3, int VAR_4)

{

    int VAR_5;

    int VAR_6;

    int VAR_7;

    int VAR_8;

    int VAR_9 = VAR_0->avctx->VAR_9;

    unsigned char VAR_10;

    unsigned char *VAR_11;

    unsigned char *VAR_12;

    unsigned char *VAR_13;

    unsigned char *VAR_14;

    unsigned char *VAR_15;

    unsigned short *VAR_16;

    unsigned short *VAR_17;

    unsigned int *VAR_18;

    unsigned int *VAR_19;



    switch (VAR_0->avctx->pix_fmt) {



    case PIX_FMT_PAL8:

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

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

        VAR_6 = VAR_5 - VAR_9;

        VAR_7 = VAR_3 * VAR_5 + VAR_2;

        VAR_8 = VAR_2;

        while(VAR_4--) {



            



            VAR_11[VAR_7++] = *VAR_1++;



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGB555:

    case PIX_FMT_RGB565:

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

        VAR_17 = (unsigned short *)VAR_0->palette;

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

        VAR_6 = VAR_5 - VAR_9;

        VAR_7 = VAR_3 * VAR_5 + VAR_2;

        VAR_8 = VAR_2;

        while(VAR_4--) {



            VAR_16[VAR_7++] = VAR_17[*VAR_1++];



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGB24:

    case PIX_FMT_BGR24:

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

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

        VAR_6 = VAR_5 - VAR_9 * 3;

        VAR_7 = VAR_3 * VAR_5 + VAR_2 * 3;

        VAR_8 = VAR_2;

        while(VAR_4--) {

            VAR_10 = *VAR_1++;



            VAR_15[VAR_7++] = VAR_0->palette[VAR_10 * 4 + 0];

            VAR_15[VAR_7++] = VAR_0->palette[VAR_10 * 4 + 1];

            VAR_15[VAR_7++] = VAR_0->palette[VAR_10 * 4 + 2];



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_RGBA32:

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

        VAR_19 = (unsigned int *)VAR_0->palette;

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

        VAR_6 = VAR_5 - VAR_9;

        VAR_7 = VAR_3 * VAR_5 + VAR_2;

        VAR_8 = VAR_2;

        while(VAR_4--) {



            VAR_18[VAR_7++] = VAR_19[*VAR_1++];



            ADVANCE_CURRENT_X();

        }

        break;



    case PIX_FMT_YUV444P:

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

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

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

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

        VAR_6 = VAR_5 - VAR_9;

        VAR_7 = VAR_3 * VAR_5 + VAR_2;

        VAR_8 = VAR_2;

        while(VAR_4--) {

            VAR_10 = *VAR_1++;



            VAR_12[VAR_7] = VAR_0->palette[VAR_10 * 4 + 0];

            VAR_13[VAR_7] = VAR_0->palette[VAR_10 * 4 + 1];

            VAR_14[VAR_7] = VAR_0->palette[VAR_10 * 4 + 2];



            VAR_7++;

            ADVANCE_CURRENT_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,
unsigned char *VAR_1, int VAR_2, int VAR_3, int VAR_4)
{ int VAR_5; int VAR_6; int VAR_7; int VAR_8; int VAR_9 = VAR_0->avctx->VAR_9; unsigned char VAR_10; unsigned char *VAR_11; unsigned char *VAR_12; unsigned char *VAR_13; unsigned char *VAR_14; unsigned char *VAR_15; unsigned short *VAR_16; unsigned short *VAR_17; unsigned int *VAR_18; unsigned int *VAR_19; switch (VAR_0->avctx->pix_fmt) { case PIX_FMT_PAL8:
VAR_11 = VAR_0->current_frame.data[0]; VAR_5 = VAR_0->current_frame.linesize[0]; VAR_6 = VAR_5 - VAR_9; VAR_7 = VAR_3 * VAR_5 + VAR_2; VAR_8 = VAR_2; while(VAR_4--) { VAR_11[VAR_7++] = *VAR_1++; ADVANCE_CURRENT_X(); } break; case PIX_FMT_RGB555:
case PIX_FMT_RGB565:
VAR_16 = (unsigned short *)VAR_0->current_frame.data[0]; VAR_17 = (unsigned short *)VAR_0->palette; VAR_5 = VAR_0->current_frame.linesize[0] / 2; VAR_6 = VAR_5 - VAR_9; VAR_7 = VAR_3 * VAR_5 + VAR_2; VAR_8 = VAR_2; while(VAR_4--) { VAR_16[VAR_7++] = VAR_17[*VAR_1++]; ADVANCE_CURRENT_X(); } break; case PIX_FMT_RGB24:
case PIX_FMT_BGR24:
VAR_15 = VAR_0->current_frame.data[0]; VAR_5 = VAR_0->current_frame.linesize[0]; VAR_6 = VAR_5 - VAR_9 * 3; VAR_7 = VAR_3 * VAR_5 + VAR_2 * 3; VAR_8 = VAR_2; while(VAR_4--) { VAR_10 = *VAR_1++; VAR_15[VAR_7++] = VAR_0->palette[VAR_10 * 4 + 0]; VAR_15[VAR_7++] = VAR_0->palette[VAR_10 * 4 + 1]; VAR_15[VAR_7++] = VAR_0->palette[VAR_10 * 4 + 2]; ADVANCE_CURRENT_X(); } break; case PIX_FMT_RGBA32:
VAR_18 = (unsigned int *)VAR_0->current_frame.data[0]; VAR_19 = (unsigned int *)VAR_0->palette; VAR_5 = VAR_0->current_frame.linesize[0] / 4; VAR_6 = VAR_5 - VAR_9; VAR_7 = VAR_3 * VAR_5 + VAR_2; VAR_8 = VAR_2; while(VAR_4--) { VAR_18[VAR_7++] = VAR_19[*VAR_1++]; ADVANCE_CURRENT_X(); } break; case PIX_FMT_YUV444P:
VAR_12 = VAR_0->current_frame.data[0]; VAR_13 = VAR_0->current_frame.data[1]; VAR_14 = VAR_0->current_frame.data[2]; VAR_5 = VAR_0->current_frame.linesize[0]; VAR_6 = VAR_5 - VAR_9; VAR_7 = VAR_3 * VAR_5 + VAR_2; VAR_8 = VAR_2; while(VAR_4--) { VAR_10 = *VAR_1++; VAR_12[VAR_7] = VAR_0->palette[VAR_10 * 4 + 0]; VAR_13[VAR_7] = VAR_0->palette[VAR_10 * 4 + 1]; VAR_14[VAR_7] = VAR_0->palette[VAR_10 * 4 + 2]; VAR_7++; ADVANCE_CURRENT_X(); } break; default:
av_log(VAR_0->avctx, AV_LOG_ERROR, " Xan WC3: Unhandled colorspace\n"); break; } }