#define BIT_LINE 0x80
#define BYTE_LINE 0xC0
-typedef struct {
+typedef struct CDXLVideoContext {
AVCodecContext *avctx;
- AVFrame frame;
int bpp;
int format;
int padded_bits;
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;
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;
}
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),
.close = cdxl_decode_end,
.decode = cdxl_decode_frame,
.capabilities = CODEC_CAP_DR1,
- .long_name = NULL_IF_CONFIG_SMALL("Commodore CDXL video"),
};