aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/mpeg12enc.c
diff options
context:
space:
mode:
authorMarc-Antoine Arnaud <arnaud.marcantoine@gmail.com>2014-06-04 09:26:55 +0200
committerDerek Buitenhuis <derek.buitenhuis@gmail.com>2014-06-06 15:38:10 +0100
commit8a06794112d02a5707f766b8b38a5d50dfd03898 (patch)
treef9b527fdf2c94499ccdcd99fae646eb163c6d7ec /libavcodec/mpeg12enc.c
parent2f7065190ad48744014a02288799d03adfa613e0 (diff)
downloadffmpeg-8a06794112d02a5707f766b8b38a5d50dfd03898.tar.gz
mpeg2: add sequence display extension information
Signed-off-by: Derek Buitenhuis <derek.buitenhuis@gmail.com>
Diffstat (limited to 'libavcodec/mpeg12enc.c')
-rw-r--r--libavcodec/mpeg12enc.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/libavcodec/mpeg12enc.c b/libavcodec/mpeg12enc.c
index c12491eaf2..f87286aa57 100644
--- a/libavcodec/mpeg12enc.c
+++ b/libavcodec/mpeg12enc.c
@@ -286,6 +286,18 @@ static void mpeg1_encode_sequence_header(MpegEncContext *s)
put_bits(&s->pb, 1, s->low_delay);
put_bits(&s->pb, 2, 0); // frame_rate_ext_n
put_bits(&s->pb, 5, 0); // frame_rate_ext_d
+
+ put_header(s, EXT_START_CODE);
+ put_bits(&s->pb, 4, 2); // sequence display extension
+ put_bits(&s->pb, 3, 0); // video_format: 0 is components
+ put_bits(&s->pb, 1, 1); // colour_description
+ put_bits(&s->pb, 8, s->avctx->color_primaries); // colour_primaries
+ put_bits(&s->pb, 8, s->avctx->color_trc); // transfer_characteristics
+ put_bits(&s->pb, 8, s->avctx->colorspace); // matrix_coefficients
+ put_bits(&s->pb, 14, s->width); // display_horizontal_size
+ put_bits(&s->pb, 1, 1); // marker_bit
+ put_bits(&s->pb, 14, s->height); // display_vertical_size
+ put_bits(&s->pb, 3, 0); // remaining 3 bits are zero padding
}
put_header(s, GOP_START_CODE);