static int cinepak_decode_init(AVCodecContext *avctx)

{

    CinepakContext *s = avctx->priv_data;



    s->avctx = avctx;

    s->width = (avctx->width + 3) & ~3;

    s->height = (avctx->height + 3) & ~3;

    s->sega_film_skip_bytes = -1;  /* uninitialized state */



    // check for paletted data

    if ((avctx->palctrl == NULL) || (avctx->bits_per_sample == 40)) {

        s->palette_video = 0;

        avctx->pix_fmt = PIX_FMT_YUV420P;

    } else {

        s->palette_video = 1;

        avctx->pix_fmt = PIX_FMT_PAL8;

    }



    dsputil_init(&s->dsp, avctx);



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



    return 0;

}

static int cinepak_decode_init(AVCodecContext *avctx)

{

    CinepakContext *s = avctx->priv_data;



    s->avctx = avctx;

    s->width = (avctx->width + 3) & ~3;

    s->height = (avctx->height + 3) & ~3;

    s->sega_film_skip_bytes = -1;  



    

    if ((avctx->palctrl == NULL) || (avctx->bits_per_sample == 40)) {

        s->palette_video = 0;

        avctx->pix_fmt = PIX_FMT_YUV420P;

    } else {

        s->palette_video = 1;

        avctx->pix_fmt = PIX_FMT_PAL8;

    }



    dsputil_init(&s->dsp, avctx);



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



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0)

{

    CinepakContext *s = VAR_0->priv_data;



    s->VAR_0 = VAR_0;

    s->width = (VAR_0->width + 3) & ~3;

    s->height = (VAR_0->height + 3) & ~3;

    s->sega_film_skip_bytes = -1;  



    

    if ((VAR_0->palctrl == NULL) || (VAR_0->bits_per_sample == 40)) {

        s->palette_video = 0;

        VAR_0->pix_fmt = PIX_FMT_YUV420P;

    } else {

        s->palette_video = 1;

        VAR_0->pix_fmt = PIX_FMT_PAL8;

    }



    dsputil_init(&s->dsp, VAR_0);



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



    return 0;

}

static int FUNC_0(AVCodecContext *VAR_0)
{ CinepakContext *s = VAR_0->priv_data; s->VAR_0 = VAR_0; s->width = (VAR_0->width + 3) & ~3; s->height = (VAR_0->height + 3) & ~3; s->sega_film_skip_bytes = -1; if ((VAR_0->palctrl == NULL) || (VAR_0->bits_per_sample == 40)) { s->palette_video = 0; VAR_0->pix_fmt = PIX_FMT_YUV420P; } else { s->palette_video = 1; VAR_0->pix_fmt = PIX_FMT_PAL8; } dsputil_init(&s->dsp, VAR_0); s->frame.data[0] = NULL; return 0; }