]> git.sesse.net Git - ffmpeg/commitdiff
lavc/dds: Fix GRAY8A decoding.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 15 Apr 2016 19:06:34 +0000 (21:06 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Fri, 15 Apr 2016 19:06:34 +0000 (21:06 +0200)
Fixes ticket #4667.

libavcodec/dds.c
libavcodec/version.h
tests/ref/fate/dds-ya

index 9577b67f0fdd04c906b1288e979c6df5d884142e..feaaba5a2416f450f37fb6ba2b71e79eb09f2621 100644 (file)
@@ -356,6 +356,10 @@ static int parse_pixel_format(AVCodecContext *avctx)
         /* 16 bpp */
         else if (bpp == 16 && r == 0xff && g == 0 && b == 0 && a == 0xff00)
             avctx->pix_fmt = AV_PIX_FMT_YA8;
+        else if (bpp == 16 && r == 0xff00 && g == 0 && b == 0 && a == 0xff) {
+            avctx->pix_fmt = AV_PIX_FMT_YA8;
+            ctx->postproc = DDS_SWAP_ALPHA;
+        }
         else if (bpp == 16 && r == 0xffff && g == 0 && b == 0 && a == 0)
             avctx->pix_fmt = AV_PIX_FMT_GRAY16LE;
         else if (bpp == 16 && r == 0xf800 && g == 0x7e0 && b == 0x1f && a == 0)
@@ -387,8 +391,6 @@ static int parse_pixel_format(AVCodecContext *avctx)
         ctx->postproc = DDS_NORMAL_MAP;
     else if (ycocg_classic && !ctx->compressed)
         ctx->postproc = DDS_RAW_YCOCG;
-    else if (avctx->pix_fmt == AV_PIX_FMT_YA8)
-        ctx->postproc = DDS_SWAP_ALPHA;
 
     /* ATI/NVidia variants sometimes add swizzling in bpp. */
     switch (bpp) {
index 8f0522b5d52917069c7cb93e547d2276c12b41c8..c24f0fc42c4260efdfc37c39a70f48f9deff6089 100644 (file)
@@ -29,7 +29,7 @@
 
 #define LIBAVCODEC_VERSION_MAJOR  57
 #define LIBAVCODEC_VERSION_MINOR  34
-#define LIBAVCODEC_VERSION_MICRO 101
+#define LIBAVCODEC_VERSION_MICRO 102
 
 #define LIBAVCODEC_VERSION_INT  AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \
                                                LIBAVCODEC_VERSION_MINOR, \
index 1de0436b83b772e533aa83eb1759ad5186f725a5..a0f12b56343892767035c9541ab2912787951aa7 100644 (file)
@@ -3,4 +3,4 @@
 #codec_id 0: rawvideo
 #dimensions 0: 220x64
 #sar 0: 0/1
-0,          0,          0,        1,    28160, 0xd3981fcb
+0,          0,          0,        1,    28160, 0x5aa41fcb