Commit ed5680f3 authored by Paul B Mahol's avatar Paul B Mahol

avcodec/dpx: add support for 10bit gray

parent ea68e02c
...@@ -310,6 +310,9 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -310,6 +310,9 @@ static int decode_frame(AVCodecContext *avctx,
case 51121: case 51121:
avctx->pix_fmt = AV_PIX_FMT_GBRAP12; avctx->pix_fmt = AV_PIX_FMT_GBRAP12;
break; break;
case 6101:
avctx->pix_fmt = AV_PIX_FMT_GRAY10;
break;
case 6161: case 6161:
avctx->pix_fmt = AV_PIX_FMT_GRAY16BE; avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
break; break;
...@@ -362,10 +365,12 @@ static int decode_frame(AVCodecContext *avctx, ...@@ -362,10 +365,12 @@ static int decode_frame(AVCodecContext *avctx,
(uint16_t*)ptr[3]}; (uint16_t*)ptr[3]};
int shift = packing == 1 ? 22 : 20; int shift = packing == 1 ? 22 : 20;
for (y = 0; y < avctx->width; y++) { for (y = 0; y < avctx->width; y++) {
if (elements >= 3)
*dst[2]++ = read10in32(&buf, &rgbBuffer, *dst[2]++ = read10in32(&buf, &rgbBuffer,
&n_datum, endian, shift); &n_datum, endian, shift);
*dst[0]++ = read10in32(&buf, &rgbBuffer, *dst[0]++ = read10in32(&buf, &rgbBuffer,
&n_datum, endian, shift); &n_datum, endian, shift);
if (elements >= 2)
*dst[1]++ = read10in32(&buf, &rgbBuffer, *dst[1]++ = read10in32(&buf, &rgbBuffer,
&n_datum, endian, shift); &n_datum, endian, shift);
if (elements == 4) if (elements == 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