]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/zmbvenc.c
avcodec: Constify AVCodecs
[ffmpeg] / libavcodec / zmbvenc.c
index 0e22ce687f4f6a6d34edd148b7debea32efb9eac..27d2954352612d738a75a206584dfe112d347f85 100644 (file)
@@ -180,12 +180,6 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     c->curfrm++;
     if(c->curfrm == c->keyint)
         c->curfrm = 0;
-#if FF_API_CODED_FRAME
-FF_DISABLE_DEPRECATION_WARNINGS
-    avctx->coded_frame->pict_type = keyframe ? AV_PICTURE_TYPE_I : AV_PICTURE_TYPE_P;
-    avctx->coded_frame->key_frame = keyframe;
-FF_ENABLE_DEPRECATION_WARNINGS
-#endif
 
     palptr = (avctx->pix_fmt == AV_PIX_FMT_PAL8) ? (uint32_t *)p->data[1] : NULL;
     chpal = !keyframe && palptr && memcmp(palptr, c->pal2, 1024);
@@ -409,7 +403,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
      */
     c->pstride = FFALIGN((avctx->width + c->lrange) * c->bypp, 16);
     prev_size = FFALIGN(c->lrange * c->bypp, 16) + c->pstride * (c->lrange + avctx->height + c->urange);
-    prev_offset = FFALIGN(c->lrange, 16) + c->pstride * c->lrange;
+    prev_offset = FFALIGN(c->lrange * c->bypp, 16) + c->pstride * c->lrange;
     if (!(c->prev_buf = av_mallocz(prev_size))) {
         av_log(avctx, AV_LOG_ERROR, "Can't allocate picture.\n");
         return AVERROR(ENOMEM);
@@ -428,7 +422,7 @@ static av_cold int encode_init(AVCodecContext *avctx)
     return 0;
 }
 
-AVCodec ff_zmbv_encoder = {
+const AVCodec ff_zmbv_encoder = {
     .name           = "zmbv",
     .long_name      = NULL_IF_CONFIG_SMALL("Zip Motion Blocks Video"),
     .type           = AVMEDIA_TYPE_VIDEO,