diff options
author | Marton Balint <cus@passwd.hu> | 2022-03-19 01:22:23 +0100 |
---|---|---|
committer | Marton Balint <cus@passwd.hu> | 2022-04-10 20:12:23 +0200 |
commit | 013d774e225c685cf2a9674f4c5dc9bb13941cb4 (patch) | |
tree | 25f14d51dbbcc4b30a9a71db020c0fcb882cb6a0 /libavformat | |
parent | a4570d7a66da772d2f530980a60ef5057750f8e6 (diff) |
avcodec/vbndec: add VBN decoder
Add support for decoding Vizrt Binary Image (VBN) files.
LZW-compressed data is not supported yet.
Signed-off-by: Marton Balint <cus@passwd.hu>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/allformats.c | 1 | ||||
-rw-r--r-- | libavformat/img2.c | 1 | ||||
-rw-r--r-- | libavformat/img2dec.c | 12 |
3 files changed, 14 insertions, 0 deletions
diff --git a/libavformat/allformats.c b/libavformat/allformats.c index 587ad59b3c..7c1d0ac38f 100644 --- a/libavformat/allformats.c +++ b/libavformat/allformats.c @@ -526,6 +526,7 @@ extern const AVInputFormat ff_image_sgi_pipe_demuxer; extern const AVInputFormat ff_image_svg_pipe_demuxer; extern const AVInputFormat ff_image_sunrast_pipe_demuxer; extern const AVInputFormat ff_image_tiff_pipe_demuxer; +extern const AVInputFormat ff_image_vbn_pipe_demuxer; extern const AVInputFormat ff_image_webp_pipe_demuxer; extern const AVInputFormat ff_image_xbm_pipe_demuxer; extern const AVInputFormat ff_image_xpm_pipe_demuxer; diff --git a/libavformat/img2.c b/libavformat/img2.c index 4153102c92..fe2ca7bfff 100644 --- a/libavformat/img2.c +++ b/libavformat/img2.c @@ -87,6 +87,7 @@ const IdStrMap ff_img_tags[] = { { AV_CODEC_ID_GEM, "img" }, { AV_CODEC_ID_GEM, "ximg" }, { AV_CODEC_ID_GEM, "timg" }, + { AV_CODEC_ID_VBN, "vbn" }, { AV_CODEC_ID_NONE, NULL } }; diff --git a/libavformat/img2dec.c b/libavformat/img2dec.c index b9c06c5b54..551b9d508e 100644 --- a/libavformat/img2dec.c +++ b/libavformat/img2dec.c @@ -37,6 +37,7 @@ #include "internal.h" #include "img2.h" #include "libavcodec/mjpeg.h" +#include "libavcodec/vbn.h" #include "libavcodec/xwd.h" #include "subtitles.h" @@ -1131,6 +1132,16 @@ static int gem_probe(const AVProbeData *p) return 0; } +static int vbn_probe(const AVProbeData *p) +{ + const uint8_t *b = p->buf; + if (AV_RL32(b ) == VBN_MAGIC && + AV_RL32(b + 4) == VBN_MAJOR && + AV_RL32(b + 8) == VBN_MINOR) + return AVPROBE_SCORE_MAX - 1; + return 0; +} + #define IMAGEAUTO_DEMUXER_0(imgname, codecid) #define IMAGEAUTO_DEMUXER_1(imgname, codecid)\ const AVInputFormat ff_image_ ## imgname ## _pipe_demuxer = {\ @@ -1181,6 +1192,7 @@ IMAGEAUTO_DEMUXER(sgi, SGI) IMAGEAUTO_DEMUXER(sunrast, SUNRAST) IMAGEAUTO_DEMUXER(svg, SVG) IMAGEAUTO_DEMUXER(tiff, TIFF) +IMAGEAUTO_DEMUXER(vbn, VBN) IMAGEAUTO_DEMUXER(webp, WEBP) IMAGEAUTO_DEMUXER(xbm, XBM) IMAGEAUTO_DEMUXER(xpm, XPM) |