summaryrefslogtreecommitdiff
path: root/libavformat/mxfenc.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-21 19:32:32 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-05-08 23:02:58 +0200
commit2bee43b67dc5c35a853823c7c90d97f5cfec9559 (patch)
treec6e0851db3c2c3790a13c0e09676b60c29008855 /libavformat/mxfenc.c
parent77cbe698cd9124dc23c5c235ad52e5ce3973633a (diff)
avformat/mxfenc: Add vertical subsampling support
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/mxfenc.c')
-rw-r--r--libavformat/mxfenc.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 56ba8eebf3..ce2f0ede1e 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -88,6 +88,7 @@ typedef struct MXFStreamContext {
int color_siting;
int signal_standard;
int h_chroma_sub_sample;
+ int v_chroma_sub_sample;
int temporal_reordering;
AVRational aspect_ratio; ///< display aspect ratio
int closed_gop; ///< gop is closed, used in mpeg-2 frame parsing
@@ -490,6 +491,7 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
// CDCI Picture Essence Descriptor
{ 0x3301, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x05,0x03,0x0A,0x00,0x00,0x00}}, /* Component Depth */
{ 0x3302, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x05,0x00,0x00,0x00}}, /* Horizontal Subsampling */
+ { 0x3308, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x05,0x01,0x10,0x00,0x00,0x00}}, /* Vertical Subsampling */
{ 0x3303, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x06,0x00,0x00,0x00}}, /* Color Siting */
// Generic Sound Essence Descriptor
{ 0x3D02, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x04,0x04,0x02,0x03,0x01,0x04,0x00,0x00,0x00}}, /* Locked/Unlocked */
@@ -1140,6 +1142,8 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
desc_size += 5;
if (sc->signal_standard)
desc_size += 5;
+ if (sc->v_chroma_sub_sample)
+ desc_size += 8;
mxf_write_generic_desc(s, st, key, desc_size);
@@ -1174,6 +1178,12 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
mxf_write_local_tag(pb, 4, 0x3302);
avio_wb32(pb, sc->h_chroma_sub_sample);
+ // vertical subsampling
+ if (sc->v_chroma_sub_sample) {
+ mxf_write_local_tag(pb, 4, 0x3308);
+ avio_wb32(pb, sc->v_chroma_sub_sample);
+ }
+
// color siting
mxf_write_local_tag(pb, 1, 0x3303);
avio_w8(pb, sc->color_siting);
@@ -2238,6 +2248,7 @@ static int mxf_write_header(AVFormatContext *s)
if (pix_desc) {
sc->component_depth = pix_desc->comp[0].depth;
sc->h_chroma_sub_sample = 1 << pix_desc->log2_chroma_w;
+ sc->v_chroma_sub_sample = 1 << pix_desc->log2_chroma_h;
}
switch (ff_choose_chroma_location(s, st)) {
case AVCHROMA_LOC_TOPLEFT: sc->color_siting = 0; break;