[FFmpeg-cvslog] avcodec/dpx: add support for 10bit gray
Paul B Mahol
git at videolan.org
Tue Dec 4 22:08:26 EET 2018
ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Tue Dec 4 21:04:05 2018 +0100| [ed5680f37ed30a01933c0158b21e3bb3c8acfe4a] | committer: Paul B Mahol
avcodec/dpx: add support for 10bit gray
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=ed5680f37ed30a01933c0158b21e3bb3c8acfe4a
---
libavcodec/dpx.c | 13 +++++++++----
1 file changed, 9 insertions(+), 4 deletions(-)
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c
index cf23bb6ba1..538a1b9943 100644
--- a/libavcodec/dpx.c
+++ b/libavcodec/dpx.c
@@ -310,6 +310,9 @@ static int decode_frame(AVCodecContext *avctx,
case 51121:
avctx->pix_fmt = AV_PIX_FMT_GBRAP12;
break;
+ case 6101:
+ avctx->pix_fmt = AV_PIX_FMT_GRAY10;
+ break;
case 6161:
avctx->pix_fmt = AV_PIX_FMT_GRAY16BE;
break;
@@ -362,12 +365,14 @@ static int decode_frame(AVCodecContext *avctx,
(uint16_t*)ptr[3]};
int shift = packing == 1 ? 22 : 20;
for (y = 0; y < avctx->width; y++) {
- *dst[2]++ = read10in32(&buf, &rgbBuffer,
- &n_datum, endian, shift);
+ if (elements >= 3)
+ *dst[2]++ = read10in32(&buf, &rgbBuffer,
+ &n_datum, endian, shift);
*dst[0]++ = read10in32(&buf, &rgbBuffer,
&n_datum, endian, shift);
- *dst[1]++ = read10in32(&buf, &rgbBuffer,
- &n_datum, endian, shift);
+ if (elements >= 2)
+ *dst[1]++ = read10in32(&buf, &rgbBuffer,
+ &n_datum, endian, shift);
if (elements == 4)
*dst[3]++ =
read10in32(&buf, &rgbBuffer,
More information about the ffmpeg-cvslog
mailing list