diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-02-29 15:49:52 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-02-29 15:49:52 +0100 |
commit | 8c5092912b19e793412b07e070da2f8636c2c2f3 (patch) | |
tree | df01cfeb8f5485d872023a874bd745fd1fea07b9 /libavformat | |
parent | 4e05a12a41f4934cffeef39fd1d490f1e6947dfc (diff) | |
download | ffmpeg-8c5092912b19e793412b07e070da2f8636c2c2f3.tar.gz |
lavf: Add pcx auto-detection.
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/Makefile | 1 | ||||
-rw-r--r-- | libavformat/allformats.c | 1 | ||||
-rw-r--r-- | libavformat/img2dec.c | 22 | ||||
-rw-r--r-- | libavformat/version.h | 2 |
4 files changed, 25 insertions, 1 deletions
diff --git a/libavformat/Makefile b/libavformat/Makefile index 782908eebd..edfa695437 100644 --- a/libavformat/Makefile +++ b/libavformat/Makefile @@ -218,6 +218,7 @@ OBJS-$(CONFIG_IMAGE_EXR_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_J2K_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_JPEG_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_JPEGLS_PIPE_DEMUXER) += img2dec.o img2.o +OBJS-$(CONFIG_IMAGE_PCX_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_PICTOR_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_PNG_PIPE_DEMUXER) += img2dec.o img2.o OBJS-$(CONFIG_IMAGE_QDRAW_PIPE_DEMUXER) += img2dec.o img2.o diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 9662941139..fc87900d96 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -358,6 +358,7 @@ void av_register_all(void) REGISTER_DEMUXER (IMAGE_J2K_PIPE, image_j2k_pipe); REGISTER_DEMUXER (IMAGE_JPEG_PIPE, image_jpeg_pipe); REGISTER_DEMUXER (IMAGE_JPEGLS_PIPE, image_jpegls_pipe); + REGISTER_DEMUXER (IMAGE_PCX_PIPE, image_pcx_pipe); REGISTER_DEMUXER (IMAGE_PICTOR_PIPE, image_pictor_pipe); REGISTER_DEMUXER (IMAGE_PNG_PIPE, image_png_pipe); REGISTER_DEMUXER (IMAGE_QDRAW_PIPE, image_qdraw_pipe); diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index 94cce93e11..019793f29c 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -764,6 +764,27 @@ static int jpegls_probe(AVProbeData *p) return 0; } +static int pcx_probe(AVProbeData *p) +{ + const uint8_t *b = p->buf; + + if ( p->buf_size < 128 + || b[0] != 10 + || b[1] > 5 + || b[2] != 1 + || av_popcount(b[3]) != 1 || b[3] > 8 + || AV_RL16(&b[4]) > AV_RL16(&b[8]) + || AV_RL16(&b[6]) > AV_RL16(&b[10]) + || b[64]) + return 0; + b += 73; + while (++b < p->buf + 128) + if (*b) + return AVPROBE_SCORE_EXTENSION / 4; + + return AVPROBE_SCORE_EXTENSION + 1; +} + static int qdraw_probe(AVProbeData *p) { const uint8_t *b = p->buf; @@ -865,6 +886,7 @@ IMAGEAUTO_DEMUXER(exr, AV_CODEC_ID_EXR) IMAGEAUTO_DEMUXER(j2k, AV_CODEC_ID_JPEG2000) IMAGEAUTO_DEMUXER(jpeg, AV_CODEC_ID_MJPEG) IMAGEAUTO_DEMUXER(jpegls, AV_CODEC_ID_JPEGLS) +IMAGEAUTO_DEMUXER(pcx, AV_CODEC_ID_PCX) IMAGEAUTO_DEMUXER(pictor, AV_CODEC_ID_PICTOR) IMAGEAUTO_DEMUXER(png, AV_CODEC_ID_PNG) IMAGEAUTO_DEMUXER(qdraw, AV_CODEC_ID_QDRAW) diff --git a/libavformat/version.h b/libavformat/version.h index 82a8892280..29aca6640c 100644 --- a/libavformat/version.h +++ b/libavformat/version.h @@ -30,7 +30,7 @@ #include "libavutil/version.h" #define LIBAVFORMAT_VERSION_MAJOR 57 -#define LIBAVFORMAT_VERSION_MINOR 26 +#define LIBAVFORMAT_VERSION_MINOR 27 #define LIBAVFORMAT_VERSION_MICRO 100 #define LIBAVFORMAT_VERSION_INT AV_VERSION_INT(LIBAVFORMAT_VERSION_MAJOR, \ |