Commit b1367f7e authored by Carl Eugen Hoyos's avatar Carl Eugen Hoyos

lavc/dpx: Support GRAY12 colourspace.

parent f75035b0
...@@ -243,6 +243,10 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -243,6 +243,10 @@ static int decode_frame(AVCodecContext *avctx,
case 6080: case 6080:
avctx->pix_fmt = AV_PIX_FMT_GRAY8; avctx->pix_fmt = AV_PIX_FMT_GRAY8;
break; break;
case 6121:
case 6120:
avctx->pix_fmt = AV_PIX_FMT_GRAY12;
break;
case 50081: case 50081:
case 50080: case 50080:
avctx->pix_fmt = AV_PIX_FMT_RGB24; avctx->pix_fmt = AV_PIX_FMT_RGB24;
...@@ -345,12 +349,12 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -345,12 +349,12 @@ static int decode_frame(AVCodecContext *avctx,
(uint16_t*)ptr[2], (uint16_t*)ptr[2],
(uint16_t*)ptr[3]}; (uint16_t*)ptr[3]};
for (y = 0; y < avctx->width; y++) { for (y = 0; y < avctx->width; y++) {
*dst[2] = read16(&buf, endian) >> 4; if (elements >= 3)
dst[2]++; *dst[2]++ = read16(&buf, endian) >> 4;
*dst[0] = read16(&buf, endian) >> 4; *dst[0] = read16(&buf, endian) >> 4;
dst[0]++; dst[0]++;
*dst[1] = read16(&buf, endian) >> 4; if (elements >= 2)
dst[1]++; *dst[1]++ = read16(&buf, endian) >> 4;
if (elements == 4) if (elements == 4)
*dst[3]++ = read16(&buf, endian) >> 4; *dst[3]++ = read16(&buf, endian) >> 4;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment