((uint8_t*)avctx->extradata)[7]= 0;
((uint8_t*)avctx->extradata)[7]= CODEC_ZLIB;
static int encode_init(AVCodecContext *avctx){    LclContext *c = avctx->priv_data;    int zret; // Zlib return code#ifndef CONFIG_ZLIB    av_log(avctx, AV_LOG_ERROR, "Zlib support not compiled.\n");    return 1;#else    c->avctx= avctx;            assert(avctx->width && avctx->height);        avctx->extradata= av_mallocz(8);    avctx->coded_frame= &c->pic;    // Will be user settable someday    c->compression = 6;    c->flags = 0;    switch(avctx->pix_fmt){        case PIX_FMT_BGR24:            c->imgtype = IMGTYPE_RGB24;            c->decomp_size = avctx->width * avctx->height * 3;            avctx->bits_per_sample= 24;            break;        default:            av_log(avctx, AV_LOG_ERROR, "Format %d not supported\n", avctx->pix_fmt);            return -1;    }    ((uint8_t*)avctx->extradata)[0]= 4;    ((uint8_t*)avctx->extradata)[1]= 0;    ((uint8_t*)avctx->extradata)[2]= 0;    ((uint8_t*)avctx->extradata)[3]= 0;    ((uint8_t*)avctx->extradata)[4]= c->imgtype;    ((uint8_t*)avctx->extradata)[5]= c->compression;    ((uint8_t*)avctx->extradata)[6]= c->flags;    ((uint8_t*)avctx->extradata)[7]= 0;    c->avctx->extradata_size= 8;        c->zstream.zalloc = Z_NULL;    c->zstream.zfree = Z_NULL;    c->zstream.opaque = Z_NULL;    zret = deflateInit(&(c->zstream), c->compression);    if (zret != Z_OK) {        av_log(avctx, AV_LOG_ERROR, "Deflate init error: %d\n", zret);        return 1;    }        /* Conservative upper bound taken from zlib v1.2.1 source */        c->max_comp_size = c->decomp_size + ((c->decomp_size + 7) >> 3) +                           ((c->decomp_size + 63) >> 6) + 11;    if ((c->comp_buf = av_malloc(c->max_comp_size)) == NULL) {        av_log(avctx, AV_LOG_ERROR, "Can't allocate compression buffer.\n");        return 1;    }    return 0;#endif}