lavf: Add pcx auto-detection.

This commit is contained in:
Carl Eugen Hoyos 2016-02-29 15:49:52 +01:00
parent 4e05a12a41
commit 8c5092912b
4 changed files with 25 additions and 1 deletions

View File

@ -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

View File

@ -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);

View File

@ -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)

View File

@ -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, \