static int cinepak_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)

{

    CinepakEncContext *s = avctx->priv_data;

    AVFrame *frame = data;

    int ret;



    s->lambda = frame->quality ? frame->quality - 1 : 2 * FF_LAMBDA_SCALE;



    frame->key_frame = s->curframe == 0;

    frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;



    ret = rd_frame(s, frame, buf, buf_size);



    FFSWAP(AVFrame, s->last_frame, s->best_frame);



    if (++s->curframe >= s->keyint)

        s->curframe = 0;



    return ret;

}

static int cinepak_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)

{

    CinepakEncContext *s = avctx->priv_data;

    AVFrame *frame = data;

    int ret;



    s->lambda = frame->quality ? frame->quality - 1 : 2 * FF_LAMBDA_SCALE;



    frame->key_frame = s->curframe == 0;

    frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;



    ret = rd_frame(s, frame, buf, buf_size);



    FFSWAP(AVFrame, s->last_frame, s->best_frame);



    if (++s->curframe >= s->keyint)

        s->curframe = 0;



    return ret;

}

static int cinepak_encode_frame(AVCodecContext *avctx, unsigned char *buf, int buf_size, void *data)     AVFrame *frame = data;     frame->key_frame = s->curframe == 0;     frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;     ret = rd_frame(s, frame, buf, buf_size);     FFSWAP(AVFrame, s->last_frame, s->best_frame);     return ret;
static int FUNC_0(AVCodecContext *VAR_0, unsigned char *VAR_1, int VAR_2, void *VAR_3)

{

    CinepakEncContext *s = VAR_0->priv_data;

    AVFrame *frame = VAR_3;

    int VAR_4;



    s->lambda = frame->quality ? frame->quality - 1 : 2 * FF_LAMBDA_SCALE;



    frame->key_frame = s->curframe == 0;

    frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;



    VAR_4 = rd_frame(s, frame, VAR_1, VAR_2);



    FFSWAP(AVFrame, s->last_frame, s->best_frame);



    if (++s->curframe >= s->keyint)

        s->curframe = 0;



    return VAR_4;

}

static int FUNC_0(AVCodecContext *VAR_0, unsigned char *VAR_1, int VAR_2, void *VAR_3)
{ CinepakEncContext *s = VAR_0->priv_data; AVFrame *frame = VAR_3; int VAR_4; s->lambda = frame->quality ? frame->quality - 1 : 2 * FF_LAMBDA_SCALE; frame->key_frame = s->curframe == 0; frame->pict_type = frame->key_frame ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P; VAR_4 = rd_frame(s, frame, VAR_1, VAR_2); FFSWAP(AVFrame, s->last_frame, s->best_frame); if (++s->curframe >= s->keyint)
s->curframe = 0; return VAR_4; }