dds: Add support for monochrome images
authorVittorio Giovara <vittorio.giovara@gmail.com>
Fri, 22 Apr 2016 21:28:04 +0000 (17:28 -0400)
committerVittorio Giovara <vittorio.giovara@gmail.com>
Tue, 26 Apr 2016 20:30:18 +0000 (16:30 -0400)
libavcodec/dds.c
tests/fate/image.mak
tests/ref/fate/dds-monob [new file with mode: 0644]

index f549cad..91e0c24 100644 (file)
@@ -240,6 +240,10 @@ static int parse_pixel_format(AVCodecContext *avctx)
             ctx->paletted   = 1;
             avctx->pix_fmt  = AV_PIX_FMT_PAL8;
             break;
+        case MKTAG('G', '1', ' ', ' '):
+            ctx->compressed = 0;
+            avctx->pix_fmt  = AV_PIX_FMT_MONOBLACK;
+            break;
         case MKTAG('D', 'X', '1', '0'):
             /* DirectX 10 extra header */
             dxgi = bytestream2_get_le32(gbc);
index 22e0a33..e58291b 100644 (file)
@@ -65,6 +65,7 @@ DDS_FMT          = alpha8                                               \
                    dxt5-xrbg                                            \
                    dxt5-ycocg                                           \
                    dxt5-ycocg-scaled                                    \
+                   monob                                                \
                    pal                                                  \
                    pal-ati                                              \
                    rgb1555                                              \
diff --git a/tests/ref/fate/dds-monob b/tests/ref/fate/dds-monob
new file mode 100644 (file)
index 0000000..370a431
--- /dev/null
@@ -0,0 +1,2 @@
+#tb 0: 1/25
+0,          0,          0,        1,     1952, 0x716498a1