Browse Source

Support decoding gray8a with libopenjpeg.

tags/n0.11
Michael Bradshaw Carl Eugen Hoyos 13 years ago
parent
commit
ec0d02e441
1 changed files with 7 additions and 1 deletions
  1. +7
    -1
      libavcodec/libopenjpegdec.c

+ 7
- 1
libavcodec/libopenjpegdec.c View File

@@ -260,6 +260,8 @@ static int libopenjpeg_decode_frame(AVCodecContext *avctx,
switch (image->numcomps) { switch (image->numcomps) {
case 1: avctx->pix_fmt = (image->comps[0].bpp == 8) ? PIX_FMT_GRAY8 : PIX_FMT_GRAY16; case 1: avctx->pix_fmt = (image->comps[0].bpp == 8) ? PIX_FMT_GRAY8 : PIX_FMT_GRAY16;
break; break;
case 2: avctx->pix_fmt = PIX_FMT_GRAY8A;
break;
case 3: avctx->pix_fmt = check_image_attributes(avctx, image); case 3: avctx->pix_fmt = check_image_attributes(avctx, image);
break; break;
case 4: avctx->pix_fmt = is_yuva420(image) ? PIX_FMT_YUVA420P : PIX_FMT_RGBA; 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; break;
case 2: case 2:
libopenjpeg_copyto16(picture, image);
if (ispacked) {
libopenjpeg_copy_to_packed8(picture, image);
} else {
libopenjpeg_copyto16(picture, image);
}
break; break;
case 3: case 3:
case 4: case 4:


Loading…
Cancel
Save