diff options
author | Michael Bradshaw <mbradshaw@sorensonmedia.com> | 2012-02-01 15:47:28 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2012-02-01 15:47:28 +0100 |
commit | ec0d02e441e0602418b51b98c1fe95b9ff4aac78 (patch) | |
tree | 4f3bd08242b4c7852ec33df3ffe96c7abb980760 | |
parent | 9fdae05607c9f406bb529ff8a1d05e00bcba3601 (diff) | |
download | ffmpeg-ec0d02e441e0602418b51b98c1fe95b9ff4aac78.tar.gz |
Support decoding gray8a with libopenjpeg.
-rw-r--r-- | libavcodec/libopenjpegdec.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/libavcodec/libopenjpegdec.c b/libavcodec/libopenjpegdec.c index 3139b85cf2..683b82c2f1 100644 --- a/libavcodec/libopenjpegdec.c +++ b/libavcodec/libopenjpegdec.c @@ -260,6 +260,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, switch (image->numcomps) { case 1: avctx->pix_fmt = (image->comps[0].bpp == 8) ? PIX_FMT_GRAY8 : PIX_FMT_GRAY16; break; + case 2: avctx->pix_fmt = PIX_FMT_GRAY8A; + break; case 3: avctx->pix_fmt = check_image_attributes(avctx, image); break; case 4: avctx->pix_fmt = is_yuva420(image) ? PIX_FMT_YUVA420P : PIX_FMT_RGBA; @@ -303,7 +305,11 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx, } break; case 2: - libopenjpeg_copyto16(picture, image); + if (ispacked) { + libopenjpeg_copy_to_packed8(picture, image); + } else { + libopenjpeg_copyto16(picture, image); + } break; case 3: case 4: |