Commit 5dab7b91 authored by Paras Chadha's avatar Paras Chadha Committed by Paul B Mahol

avcodec: add XPM decoder and demuxer

Signed-off-by: 's avatarParas Chadha <paraschadha18@gmail.com>
parent b9acc7fb
......@@ -27,6 +27,7 @@ version <next>:
- ScreenPressor decoder
- incomplete ClearVideo decoder
- Intel QSV video scaling and deinterlacing filters
- XPM decoder
version 3.2:
- libopenmpt demuxer
......
......@@ -609,6 +609,8 @@ following image formats are supported:
@tab X BitMap image format
@item XFace @tab X @tab X
@tab X-Face image format
@item XPM @tab @tab X
@tab X PixMap image format
@item XWD @tab X @tab X
@tab X Window Dump image format
@end multitable
......
......@@ -650,6 +650,7 @@ OBJS-$(CONFIG_XFACE_ENCODER) += xfaceenc.o xface.o
OBJS-$(CONFIG_XL_DECODER) += xl.o
OBJS-$(CONFIG_XMA1_DECODER) += wmaprodec.o wma.o wma_common.o
OBJS-$(CONFIG_XMA2_DECODER) += wmaprodec.o wma.o wma_common.o
OBJS-$(CONFIG_XPM_DECODER) += xpmdec.o
OBJS-$(CONFIG_XSUB_DECODER) += xsubdec.o
OBJS-$(CONFIG_XSUB_ENCODER) += xsubenc.o
OBJS-$(CONFIG_XWD_DECODER) += xwddec.o
......
......@@ -378,6 +378,7 @@ static void register_all(void)
REGISTER_ENCDEC (XBM, xbm);
REGISTER_ENCDEC (XFACE, xface);
REGISTER_DECODER(XL, xl);
REGISTER_DECODER(XPM, xpm);
REGISTER_ENCDEC (XWD, xwd);
REGISTER_ENCDEC (Y41P, y41p);
REGISTER_DECODER(YLC, ylc);
......
......@@ -439,6 +439,7 @@ enum AVCodecID {
AV_CODEC_ID_FMVC,
AV_CODEC_ID_SCPR,
AV_CODEC_ID_CLEARVIDEO,
AV_CODEC_ID_XPM,
/* various PCM "codecs" */
AV_CODEC_ID_FIRST_AUDIO = 0x10000, ///< A dummy id pointing at the start of audio codecs
......
......@@ -1590,6 +1590,13 @@ static const AVCodecDescriptor codec_descriptors[] = {
.long_name = NULL_IF_CONFIG_SMALL("XBM (X BitMap) image"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
.id = AV_CODEC_ID_XPM,
.type = AVMEDIA_TYPE_VIDEO,
.name = "xpm",
.long_name = NULL_IF_CONFIG_SMALL("XPM (X PixMap) image"),
.props = AV_CODEC_PROP_INTRA_ONLY | AV_CODEC_PROP_LOSSLESS,
},
{
.id = AV_CODEC_ID_XWD,
.type = AVMEDIA_TYPE_VIDEO,
......
......@@ -28,8 +28,8 @@
#include "libavutil/version.h"
#define LIBAVCODEC_VERSION_MAJOR 57
#define LIBAVCODEC_VERSION_MINOR 82
#define LIBAVCODEC_VERSION_MICRO 102
#define LIBAVCODEC_VERSION_MINOR 83
#define LIBAVCODEC_VERSION_MICRO 100
#define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
LIBAVCODEC_VERSION_MINOR, \
......
This diff is collapsed.
......@@ -241,6 +241,7 @@ OBJS-$(CONFIG_IMAGE_SGI_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_SUNRAST_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_TIFF_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_WEBP_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_IMAGE_XPM_PIPE_DEMUXER) += img2dec.o img2.o
OBJS-$(CONFIG_INGENIENT_DEMUXER) += ingenientdec.o rawdec.o
OBJS-$(CONFIG_IPMOVIE_DEMUXER) += ipmovie.o
OBJS-$(CONFIG_IRCAM_DEMUXER) += ircamdec.o ircam.o pcm.o
......
......@@ -372,6 +372,7 @@ static void register_all(void)
REGISTER_DEMUXER (IMAGE_SUNRAST_PIPE, image_sunrast_pipe);
REGISTER_DEMUXER (IMAGE_TIFF_PIPE, image_tiff_pipe);
REGISTER_DEMUXER (IMAGE_WEBP_PIPE, image_webp_pipe);
REGISTER_DEMUXER (IMAGE_XPM_PIPE, image_xpm_pipe);
/* external libraries */
REGISTER_MUXER (CHROMAPRINT, chromaprint);
......
......@@ -75,6 +75,7 @@ const IdStrMap ff_img_tags[] = {
{ AV_CODEC_ID_V210X, "yuv10" },
{ AV_CODEC_ID_WEBP, "webp" },
{ AV_CODEC_ID_XBM, "xbm" },
{ AV_CODEC_ID_XPM, "xpm" },
{ AV_CODEC_ID_XFACE, "xface" },
{ AV_CODEC_ID_XWD, "xwd" },
{ AV_CODEC_ID_NONE, NULL }
......
......@@ -943,6 +943,15 @@ static int pam_probe(AVProbeData *p)
return pnm_magic_check(p, 7) ? pnm_probe(p) : 0;
}
static int xpm_probe(AVProbeData *p)
{
const uint8_t *b = p->buf;
if (AV_RB64(b) == 0x2f2a2058504d202a && *(b+8) == '/')
return AVPROBE_SCORE_MAX - 1;
return 0;
}
#define IMAGEAUTO_DEMUXER(imgname, codecid)\
static const AVClass imgname ## _class = {\
.class_name = AV_STRINGIFY(imgname) " demuxer",\
......@@ -983,3 +992,4 @@ IMAGEAUTO_DEMUXER(sgi, AV_CODEC_ID_SGI)
IMAGEAUTO_DEMUXER(sunrast, AV_CODEC_ID_SUNRAST)
IMAGEAUTO_DEMUXER(tiff, AV_CODEC_ID_TIFF)
IMAGEAUTO_DEMUXER(webp, AV_CODEC_ID_WEBP)
IMAGEAUTO_DEMUXER(xpm, AV_CODEC_ID_XPM)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment