aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2018-03-17 23:06:13 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2018-05-12 01:08:01 +0200
commitd628caf54f57726e027433ccc83be3ed0b08efaf (patch)
treefa953934c300380bb045b387d5f05c74ce313ba4
parent66ba303c53698829e0b2c2d8f1c063fa35763fca (diff)
downloadffmpeg-d628caf54f57726e027433ccc83be3ed0b08efaf.tar.gz
avformat/mxfenc: Add Sample width/height/x offset/y offset, Display x offset and F2 offset
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavformat/mxfenc.c39
-rw-r--r--tests/ref/fate/copy-trac49142
-rw-r--r--tests/ref/fate/mxf-reel_name2
-rw-r--r--tests/ref/fate/time_base2
-rw-r--r--tests/ref/lavf/mxf6
-rw-r--r--tests/ref/lavf/mxf_d102
-rw-r--r--tests/ref/lavf/mxf_dv252
-rw-r--r--tests/ref/lavf/mxf_dvcpro502
-rw-r--r--tests/ref/lavf/mxf_opatom2
-rw-r--r--tests/ref/lavf/mxf_opatom_audio2
10 files changed, 48 insertions, 13 deletions
diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 83b7fff42e..f955b50a66 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -481,9 +481,16 @@ static const MXFLocalTagPair mxf_local_tag_batch[] = {
{ 0x320D, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x03,0x02,0x05,0x00,0x00,0x00}}, /* Video Line Map */
{ 0x3203, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x02,0x00,0x00,0x00}}, /* Stored Width */
{ 0x3202, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x02,0x01,0x00,0x00,0x00}}, /* Stored Height */
+ { 0x3216, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x01,0x03,0x02,0x08,0x00,0x00,0x00}}, /* Stored F2 Offset */
+ { 0x3205, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x08,0x00,0x00,0x00}}, /* Sampled Width */
+ { 0x3204, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x07,0x00,0x00,0x00}}, /* Sampled Height */
+ { 0x3206, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x09,0x00,0x00,0x00}}, /* Sampled X Offset */
+ { 0x3207, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0A,0x00,0x00,0x00}}, /* Sampled Y Offset */
{ 0x3209, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0C,0x00,0x00,0x00}}, /* Display Width */
{ 0x3208, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0B,0x00,0x00,0x00}}, /* Display Height */
+ { 0x320A, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0D,0x00,0x00,0x00}}, /* Display X offset */
{ 0x320B, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x01,0x0E,0x00,0x00,0x00}}, /* Presentation Y offset */
+ { 0x3217, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x05,0x04,0x01,0x03,0x02,0x07,0x00,0x00,0x00}}, /* Display F2 offset */
{ 0x320E, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x01,0x01,0x01,0x00,0x00,0x00}}, /* Aspect Ratio */
{ 0x3210, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x02,0x01,0x01,0x01,0x02,0x00}}, /* Transfer characteristic */
{ 0x3213, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x18,0x01,0x02,0x00,0x00,0x00,0x00}}, /* Image Start Offset */
@@ -1173,13 +1180,15 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
int stored_height = (st->codecpar->height+15)/16*16;
int display_height;
int f1, f2;
- unsigned desc_size = size+8+8+8+8+8+8+8+5+16+4+12+20+5 + 6;
+ unsigned desc_size = size+8+8+8+8+8+8+8+5+16+4+12+20+5 + 5*8 + 6;
UID transfer_ul = {0};
if (sc->interlaced && sc->field_dominance)
desc_size += 5;
if (sc->signal_standard)
desc_size += 5;
+ if (sc->interlaced)
+ desc_size += 8;
if (sc->v_chroma_sub_sample)
desc_size += 8;
if (st->codecpar->color_range != AVCOL_RANGE_UNSPECIFIED)
@@ -1211,6 +1220,22 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
avio_wb32(pb, 0);
}
+ //Sampled width
+ mxf_write_local_tag(pb, 4, 0x3205);
+ avio_wb32(pb, st->codecpar->width);
+
+ //Samples height
+ mxf_write_local_tag(pb, 4, 0x3204);
+ avio_wb32(pb, st->codecpar->height>>sc->interlaced);
+
+ //Sampled X Offset
+ mxf_write_local_tag(pb, 4, 0x3206);
+ avio_wb32(pb, 0);
+
+ //Sampled Y Offset
+ mxf_write_local_tag(pb, 4, 0x3207);
+ avio_wb32(pb, 0);
+
mxf_write_local_tag(pb, 4, 0x3209);
avio_wb32(pb, st->codecpar->width);
@@ -1224,10 +1249,20 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
mxf_write_local_tag(pb, 4, 0x3208);
avio_wb32(pb, display_height>>sc->interlaced);
- // presentation Y offset
+ // display X offset
+ mxf_write_local_tag(pb, 4, 0x320A);
+ avio_wb32(pb, 0);
+
+ // display Y offset
mxf_write_local_tag(pb, 4, 0x320B);
avio_wb32(pb, (st->codecpar->height - display_height)>>sc->interlaced);
+ if (sc->interlaced) {
+ //Display F2 Offset
+ mxf_write_local_tag(pb, 4, 0x3217);
+ avio_wb32(pb, -((st->codecpar->height - display_height)&1));
+ }
+
// component depth
mxf_write_local_tag(pb, 4, 0x3301);
avio_wb32(pb, sc->component_depth);
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index 231cdafa17..a805699374 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -1,4 +1,4 @@
-efa819aae97478b7e8e486a52e7ca7ab *tests/data/fate/copy-trac4914.mxf
+ed7921a1218fce5ca0fd27217ddd7863 *tests/data/fate/copy-trac4914.mxf
561721 tests/data/fate/copy-trac4914.mxf
#tb 0: 1001/30000
#media_type 0: video
diff --git a/tests/ref/fate/mxf-reel_name b/tests/ref/fate/mxf-reel_name
index 8985965222..273e51d6e5 100644
--- a/tests/ref/fate/mxf-reel_name
+++ b/tests/ref/fate/mxf-reel_name
@@ -1 +1 @@
-159c175b80f35b924ef55293ef433d0a
+02b2c67154665a72c6adebe9c234b778
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index 460eae195e..d5fd8e0523 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@
-aa60f92877322f9e22c90d4fc508d73a
+b27e3b5e01771daa4425db36366aafb5
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index b3be23f7c8..30a7846143 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@
-24b059ddbf6022df8059b7e13a11d2a9 *./tests/data/lavf/lavf.mxf
+93367bc02b8997b84224e7eb359cae8a *./tests/data/lavf/lavf.mxf
526393 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-937b67f0d27d44da8f10f862445a376b *./tests/data/lavf/lavf.mxf
+0087ea968d20cc9192456fcd4c00019e *./tests/data/lavf/lavf.mxf
561721 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0xf21b1b48
-ffb3f5fb2473ce2895ffc0b6ca38ba1f *./tests/data/lavf/lavf.mxf
+7754550ff6fe5895555610f586a15fc5 *./tests/data/lavf/lavf.mxf
526393 ./tests/data/lavf/lavf.mxf
./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
diff --git a/tests/ref/lavf/mxf_d10 b/tests/ref/lavf/mxf_d10
index e3d764c2b4..4c272048a1 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@
-f429e5c52dadb28236bd72c75544f757 *./tests/data/lavf/lavf.mxf_d10
+693c6e28c56607aba86e73da3d14cecf *./tests/data/lavf/lavf.mxf_d10
5332013 ./tests/data/lavf/lavf.mxf_d10
./tests/data/lavf/lavf.mxf_d10 CRC=0x6c74d488
diff --git a/tests/ref/lavf/mxf_dv25 b/tests/ref/lavf/mxf_dv25
index d22bb3126e..ac9147d284 100644
--- a/tests/ref/lavf/mxf_dv25
+++ b/tests/ref/lavf/mxf_dv25
@@ -1,3 +1,3 @@
-f570a233ee440058987a5b9f3642fea5 *./tests/data/lavf/lavf.mxf_dv25
+37ad73c526ecc698dbae5a8995c7dd4d *./tests/data/lavf/lavf.mxf_dv25
3834413 ./tests/data/lavf/lavf.mxf_dv25
./tests/data/lavf/lavf.mxf_dv25 CRC=0xbdaf7f52
diff --git a/tests/ref/lavf/mxf_dvcpro50 b/tests/ref/lavf/mxf_dvcpro50
index 9d0db2b654..19740a9a30 100644
--- a/tests/ref/lavf/mxf_dvcpro50
+++ b/tests/ref/lavf/mxf_dvcpro50
@@ -1,3 +1,3 @@
-914aed46af112523de45ae3487aa6d79 *./tests/data/lavf/lavf.mxf_dvcpro50
+8e989e5eb6f64741c1f3f2a9bfdb6f9a *./tests/data/lavf/lavf.mxf_dvcpro50
7431213 ./tests/data/lavf/lavf.mxf_dvcpro50
./tests/data/lavf/lavf.mxf_dvcpro50 CRC=0xe3bbe4b4
diff --git a/tests/ref/lavf/mxf_opatom b/tests/ref/lavf/mxf_opatom
index 13a4ff36a2..29b1b58843 100644
--- a/tests/ref/lavf/mxf_opatom
+++ b/tests/ref/lavf/mxf_opatom
@@ -1,3 +1,3 @@
-75ccb51d422e319f4b284a94815bb0c7 *./tests/data/lavf/lavf.mxf_opatom
+b6e1fde300f68808ead5c316fd9a4543 *./tests/data/lavf/lavf.mxf_opatom
4717625 ./tests/data/lavf/lavf.mxf_opatom
./tests/data/lavf/lavf.mxf_opatom CRC=0xf55aa22a
diff --git a/tests/ref/lavf/mxf_opatom_audio b/tests/ref/lavf/mxf_opatom_audio
index f8bfb606e4..a86aa991e9 100644
--- a/tests/ref/lavf/mxf_opatom_audio
+++ b/tests/ref/lavf/mxf_opatom_audio
@@ -1,3 +1,3 @@
-55868441de7088b20438417ecdf77d93 *./tests/data/lavf/lavf.mxf_opatom_audio
+cc0dc4aacd82f5495456000c4ce38b08 *./tests/data/lavf/lavf.mxf_opatom_audio
102969 ./tests/data/lavf/lavf.mxf_opatom_audio
./tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff