]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/xbmenc.c
tiffdec: remove an unneeded variable
[ffmpeg] / libavcodec / xbmenc.c
index 358a25ab67795b6801b0c3525743a16497ad771c..517e569a60ab8fefe7e47649e3297de0c2f5d7a7 100644 (file)
 
 #include "avcodec.h"
 #include "internal.h"
+#include "mathops.h"
 
 static av_cold int xbm_encode_init(AVCodecContext *avctx)
 {
-    avctx->coded_frame = avcodec_alloc_frame();
+    avctx->coded_frame = av_frame_alloc();
     if (!avctx->coded_frame)
         return AVERROR(ENOMEM);
     avctx->coded_frame->pict_type = AV_PICTURE_TYPE_I;
@@ -54,7 +55,7 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
     buf += snprintf(buf, 40, "static unsigned char image_bits[] = {\n");
     for (i = 0; i < avctx->height; i++) {
         for (j = 0; j < linesize; j++)
-            buf += snprintf(buf, 7, " 0x%02X,", av_reverse[*ptr++]);
+            buf += snprintf(buf, 7, " 0x%02X,", ff_reverse[*ptr++]);
         ptr += p->linesize[0] - linesize;
         buf += snprintf(buf, 2, "\n");
     }
@@ -68,19 +69,19 @@ static int xbm_encode_frame(AVCodecContext *avctx, AVPacket *pkt,
 
 static av_cold int xbm_encode_close(AVCodecContext *avctx)
 {
-    av_freep(&avctx->coded_frame);
+    av_frame_free(&avctx->coded_frame);
 
     return 0;
 }
 
 AVCodec ff_xbm_encoder = {
     .name         = "xbm",
+    .long_name    = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
     .type         = AVMEDIA_TYPE_VIDEO,
     .id           = AV_CODEC_ID_XBM,
     .init         = xbm_encode_init,
     .encode2      = xbm_encode_frame,
     .close        = xbm_encode_close,
-    .pix_fmts     = (const enum PixelFormat[]) { PIX_FMT_MONOWHITE,
-                                                 PIX_FMT_NONE },
-    .long_name    = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
+    .pix_fmts     = (const enum AVPixelFormat[]) { AV_PIX_FMT_MONOWHITE,
+                                                 AV_PIX_FMT_NONE },
 };