1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-21 10:55:51 +02:00

sgi: decode images with 4 channels at 8 and 16 bits

This commit is contained in:
Carl Eugen Hoyos 2012-01-14 01:14:51 +01:00 committed by Vittorio Giovara
parent ab7c64624a
commit f8dea10d3f
2 changed files with 3 additions and 2 deletions

View File

@ -11,6 +11,7 @@ version <next>:
- XBM decoder
- bmp standalone parser
- OpenEXR image decoder
- support decoding 4-channel SGI images
version 10:

View File

@ -198,8 +198,8 @@ static int decode_frame(AVCodecContext *avctx,
avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_GRAY16BE : AV_PIX_FMT_GRAY8;
} else if (s->depth == SGI_RGB) {
avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGB48BE : AV_PIX_FMT_RGB24;
} else if (s->depth == SGI_RGBA && s->bytes_per_channel == 1) {
avctx->pix_fmt = AV_PIX_FMT_RGBA;
} else if (s->depth == SGI_RGBA) {
avctx->pix_fmt = s->bytes_per_channel == 2 ? AV_PIX_FMT_RGBA64BE : AV_PIX_FMT_RGBA;
} else {
av_log(avctx, AV_LOG_ERROR, "wrong picture format\n");
return -1;