[FFmpeg-cvslog] iff: recognise more DEEP colorspaces

Peter Ross git at videolan.org
Sun Nov 18 13:55:56 CET 2012


ffmpeg | branch: master | Peter Ross <pross at xvid.org> | Sun Nov 18 19:01:41 2012 +1100| [d26eeb0dc1dd8f8aab0a5ed5830c3e34ce795aee] | committer: Michael Niedermayer

iff: recognise more DEEP colorspaces

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=d26eeb0dc1dd8f8aab0a5ed5830c3e34ce795aee
---

 libavformat/iff.c |    9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/libavformat/iff.c b/libavformat/iff.c
index c7213bc..d4bdf50 100644
--- a/libavformat/iff.c
+++ b/libavformat/iff.c
@@ -137,6 +137,9 @@ static int iff_probe(AVProbeData *p)
 
 static const uint8_t deep_rgb24[] = {0, 0, 0, 3, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
 static const uint8_t deep_rgba[]  = {0, 0, 0, 4, 0, 1, 0, 8, 0, 2, 0, 8, 0, 3, 0, 8};
+static const uint8_t deep_bgra[]  = {0, 0, 0, 4, 0, 3, 0, 8, 0, 2, 0, 8, 0, 1, 0, 8};
+static const uint8_t deep_argb[]  = {0, 0, 0, 4, 0,17, 0, 8, 0, 1, 0, 8, 0, 2, 0, 8};
+static const uint8_t deep_abgr[]  = {0, 0, 0, 4, 0,17, 0, 8, 0, 3, 0, 8, 0, 2, 0, 8};
 
 static int iff_read_header(AVFormatContext *s)
 {
@@ -249,6 +252,12 @@ static int iff_read_header(AVFormatContext *s)
                 st->codec->pix_fmt = AV_PIX_FMT_RGB24;
             else if (fmt_size == sizeof(deep_rgba) && !memcmp(fmt, deep_rgba, sizeof(deep_rgba)))
                 st->codec->pix_fmt = AV_PIX_FMT_RGBA;
+            else if (fmt_size == sizeof(deep_bgra) && !memcmp(fmt, deep_bgra, sizeof(deep_bgra)))
+                st->codec->pix_fmt = AV_PIX_FMT_BGRA;
+            else if (fmt_size == sizeof(deep_argb) && !memcmp(fmt, deep_argb, sizeof(deep_argb)))
+                st->codec->pix_fmt = AV_PIX_FMT_ARGB;
+            else if (fmt_size == sizeof(deep_abgr) && !memcmp(fmt, deep_abgr, sizeof(deep_abgr)))
+                st->codec->pix_fmt = AV_PIX_FMT_ABGR;
             else {
                 av_log_ask_for_sample(s, "unsupported color format\n");
                 return AVERROR_PATCHWELCOME;



More information about the ffmpeg-cvslog mailing list