diff options
author | Kostya Shishkov <kostya.shishkov@gmail.com> | 2012-02-28 19:44:07 +0100 |
---|---|---|
committer | Kostya Shishkov <kostya.shishkov@gmail.com> | 2012-02-29 09:29:02 +0100 |
commit | 12b812d2e5dcc7c80b19b7c01713be31389120d5 (patch) | |
tree | eab0f1be68dfa50cec62f4abd46cc8da72101ea4 /libavcodec | |
parent | c7084182e85eaa437899df58fd1ae57426d3c7f7 (diff) | |
download | ffmpeg-12b812d2e5dcc7c80b19b7c01713be31389120d5.tar.gz |
prores: store and retrieve extended colourspace information
Based on the patch by Phil Barrett.
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/proresdec.c | 4 | ||||
-rw-r--r-- | libavcodec/proresenc.c | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/libavcodec/proresdec.c b/libavcodec/proresdec.c index da90912031..a399576179 100644 --- a/libavcodec/proresdec.c +++ b/libavcodec/proresdec.c @@ -165,6 +165,10 @@ static int decode_frame_header(ProresContext *ctx, const uint8_t *buf, ctx->picture.top_field_first = ctx->frame_type & 1; } + avctx->color_primaries = buf[14]; + avctx->color_trc = buf[15]; + avctx->colorspace = buf[16]; + ctx->alpha_info = buf[17] & 0xf; if (ctx->alpha_info) av_log_missing_feature(avctx, "alpha channel", 0); diff --git a/libavcodec/proresenc.c b/libavcodec/proresenc.c index c10f599f27..8e6f93fe2b 100644 --- a/libavcodec/proresenc.c +++ b/libavcodec/proresenc.c @@ -689,9 +689,9 @@ static int encode_frame(AVCodecContext *avctx, AVPacket *pkt, bytestream_put_be16 (&buf, avctx->height); bytestream_put_byte (&buf, ctx->chroma_factor << 6); // frame flags bytestream_put_byte (&buf, 0); // reserved - bytestream_put_byte (&buf, 0); // primaries - bytestream_put_byte (&buf, 0); // transfer function - bytestream_put_byte (&buf, 6); // colour matrix - ITU-R BT.601-4 + bytestream_put_byte (&buf, avctx->color_primaries); + bytestream_put_byte (&buf, avctx->color_trc); + bytestream_put_byte (&buf, avctx->colorspace); bytestream_put_byte (&buf, 0x40); // source format and alpha information bytestream_put_byte (&buf, 0); // reserved bytestream_put_byte (&buf, 0x03); // matrix flags - both matrices are present |