]> git.sesse.net Git - ffmpeg/blobdiff - libavcodec/cdxl.c
h264: move intra4x4_pred_mode[_cache] into the per-slice context
[ffmpeg] / libavcodec / cdxl.c
index 465867c098b8547c00b606572e53787bc7a58789..e45e722be59f7640bd1f0ebc7ab7907b7ad28a97 100644 (file)
@@ -31,9 +31,8 @@
 #define BIT_LINE     0x80
 #define BYTE_LINE    0xC0
 
-typedef struct {
+typedef struct CDXLVideoContext {
     AVCodecContext *avctx;
-    AVFrame        frame;
     int            bpp;
     int            format;
     int            padded_bits;
@@ -233,14 +232,12 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
     if (c->bpp < 1)
         return AVERROR_INVALIDDATA;
     if (c->format != BIT_PLANAR && c->format != BIT_LINE) {
-        av_log_ask_for_sample(avctx, "unsupported pixel format: 0x%0x\n", c->format);
+        avpriv_request_sample(avctx, "Pixel format 0x%0x", c->format);
         return AVERROR_PATCHWELCOME;
     }
 
-    if ((ret = av_image_check_size(w, h, 0, avctx)) < 0)
+    if ((ret = ff_set_dimensions(avctx, w, h)) < 0)
         return ret;
-    if (w != avctx->width || h != avctx->height)
-        avcodec_set_dimensions(avctx, w, h);
 
     aligned_width = FFALIGN(c->avctx->width, 16);
     c->padded_bits  = aligned_width - c->avctx->width;
@@ -253,7 +250,7 @@ static int cdxl_decode_frame(AVCodecContext *avctx, void *data,
             return AVERROR_INVALIDDATA;
         avctx->pix_fmt = AV_PIX_FMT_BGR24;
     } else {
-        av_log_ask_for_sample(avctx, "unsupported encoding %d and bpp %d\n",
+        avpriv_request_sample(avctx, "Encoding %d and bpp %d",
                               encoding, c->bpp);
         return AVERROR_PATCHWELCOME;
     }
@@ -292,6 +289,7 @@ static av_cold int cdxl_decode_end(AVCodecContext *avctx)
 
 AVCodec ff_cdxl_decoder = {
     .name           = "cdxl",
+    .long_name      = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
     .type           = AVMEDIA_TYPE_VIDEO,
     .id             = AV_CODEC_ID_CDXL,
     .priv_data_size = sizeof(CDXLVideoContext),
@@ -299,5 +297,4 @@ AVCodec ff_cdxl_decoder = {
     .close          = cdxl_decode_end,
     .decode         = cdxl_decode_frame,
     .capabilities   = CODEC_CAP_DR1,
-    .long_name      = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
 };