static int msrle_decode_init(AVCodecContext *avctx)

{

    MsrleContext *s = (MsrleContext *)avctx->priv_data;

    int i, j;

    unsigned char *palette;



    s->avctx = avctx;



    avctx->pix_fmt = PIX_FMT_PAL8;

    avctx->has_b_frames = 0;

    s->frame.data[0] = s->prev_frame.data[0] = NULL;



    /* convert palette */

    palette = (unsigned char *)s->avctx->extradata;

    memset (s->palette, 0, 256 * 4);

    for (i = 0, j = 0; i < s->avctx->extradata_size / 4; i++, j += 4)

        s->palette[i] = 

            (palette[j + 2] << 16) |

            (palette[j + 1] <<  8) |

            (palette[j + 0] <<  0);



    return 0;

}

static int msrle_decode_init(AVCodecContext *avctx)

{

    MsrleContext *s = (MsrleContext *)avctx->priv_data;

    int i, j;

    unsigned char *palette;



    s->avctx = avctx;



    avctx->pix_fmt = PIX_FMT_PAL8;

    avctx->has_b_frames = 0;

    s->frame.data[0] = s->prev_frame.data[0] = NULL;



    

    palette = (unsigned char *)s->avctx->extradata;

    memset (s->palette, 0, 256 * 4);

    for (i = 0, j = 0; i < s->avctx->extradata_size / 4; i++, j += 4)

        s->palette[i] = 

            (palette[j + 2] << 16) |

            (palette[j + 1] <<  8) |

            (palette[j + 0] <<  0);



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0)

{

    MsrleContext *s = (MsrleContext *)VAR_0->priv_data;

    int VAR_1, VAR_2;

    unsigned char *VAR_3;



    s->VAR_0 = VAR_0;



    VAR_0->pix_fmt = PIX_FMT_PAL8;

    VAR_0->has_b_frames = 0;

    s->frame.data[0] = s->prev_frame.data[0] = NULL;



    

    VAR_3 = (unsigned char *)s->VAR_0->extradata;

    memset (s->VAR_3, 0, 256 * 4);

    for (VAR_1 = 0, VAR_2 = 0; VAR_1 < s->VAR_0->extradata_size / 4; VAR_1++, VAR_2 += 4)

        s->VAR_3[VAR_1] = 

            (VAR_3[VAR_2 + 2] << 16) |

            (VAR_3[VAR_2 + 1] <<  8) |

            (VAR_3[VAR_2 + 0] <<  0);



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0)
{ MsrleContext *s = (MsrleContext *)VAR_0->priv_data; int VAR_1, VAR_2; unsigned char *VAR_3; s->VAR_0 = VAR_0; VAR_0->pix_fmt = PIX_FMT_PAL8; VAR_0->has_b_frames = 0; s->frame.data[0] = s->prev_frame.data[0] = NULL; VAR_3 = (unsigned char *)s->VAR_0->extradata; memset (s->VAR_3, 0, 256 * 4); for (VAR_1 = 0, VAR_2 = 0; VAR_1 < s->VAR_0->extradata_size / 4; VAR_1++, VAR_2 += 4) s->VAR_3[VAR_1] =
(VAR_3[VAR_2 + 2] << 16) |
(VAR_3[VAR_2 + 1] <<  8) |
(VAR_3[VAR_2 + 0] <<  0); return 0; }