diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-11-10 23:04:46 +0100 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2016-11-14 00:33:12 +0100 |
commit | b1367f7e5e6717cbd0ac658f74479b927c1945e3 (patch) | |
tree | f6a2cf7d22e2ba3eb26d3d480c53f219baffc950 /libavcodec/dpx.c | |
parent | f75035b06f4b287443fa9275f76183ace39c2d45 (diff) | |
download | ffmpeg-b1367f7e5e6717cbd0ac658f74479b927c1945e3.tar.gz |
lavc/dpx: Support GRAY12 colourspace.
Diffstat (limited to 'libavcodec/dpx.c')
-rw-r--r-- | libavcodec/dpx.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libavcodec/dpx.c b/libavcodec/dpx.c index e4dd1b05b5..1aa2cbd1c8 100644 --- a/libavcodec/dpx.c +++ b/libavcodec/dpx.c @@ -243,6 +243,10 @@ static int decode_frame(AVCodecContext *avctx, case 6080: avctx->pix_fmt = AV_PIX_FMT_GRAY8; break; + case 6121: + case 6120: + avctx->pix_fmt = AV_PIX_FMT_GRAY12; + break; case 50081: case 50080: avctx->pix_fmt = AV_PIX_FMT_RGB24; @@ -345,12 +349,12 @@ static int decode_frame(AVCodecContext *avctx, (uint16_t*)ptr[2], (uint16_t*)ptr[3]}; for (y = 0; y < avctx->width; y++) { - *dst[2] = read16(&buf, endian) >> 4; - dst[2]++; + if (elements >= 3) + *dst[2]++ = read16(&buf, endian) >> 4; *dst[0] = read16(&buf, endian) >> 4; dst[0]++; - *dst[1] = read16(&buf, endian) >> 4; - dst[1]++; + if (elements >= 2) + *dst[1]++ = read16(&buf, endian) >> 4; if (elements == 4) *dst[3]++ = read16(&buf, endian) >> 4; } |