dds: Add support for alpha-only files

Due to how pixel format conversion is done, they behave the same way
as gray files.

Signed-off-by: Vittorio Giovara <vittorio.giovara@gmail.com>
This commit is contained in:
Vittorio Giovara 2016-04-01 15:11:50 +02:00
parent 9a9fb710bc
commit 0253863626

View File

@ -352,6 +352,8 @@ static int parse_pixel_format(AVCodecContext *avctx)
/* 8 bpp */
if (bpp == 8 && r == 0xff && g == 0 && b == 0 && a == 0)
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
else if (bpp == 8 && r == 0 && g == 0 && b == 0 && a == 0xff)
avctx->pix_fmt = AV_PIX_FMT_GRAY8;
/* 16 bpp */
else if (bpp == 16 && r == 0xff && g == 0 && b == 0 && a == 0xff00)
avctx->pix_fmt = AV_PIX_FMT_YA8;