[FFmpeg-devel,09/13] avformat/mxfenc: Add Padding Bits

Submitted by Michael Niedermayer on May 7, 2018, 10:38 a.m.

Details

Message ID 20180507103817.8320-9-michael@niedermayer.cc
State New
Headers show

Commit Message

Michael Niedermayer May 7, 2018, 10:38 a.m.
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
---
 libavformat/mxfenc.c            | 7 ++++++-
 tests/ref/fate/copy-trac4914    | 2 +-
 tests/ref/fate/mxf-reel_name    | 2 +-
 tests/ref/fate/time_base        | 2 +-
 tests/ref/lavf/mxf              | 6 +++---
 tests/ref/lavf/mxf_d10          | 2 +-
 tests/ref/lavf/mxf_dv25         | 2 +-
 tests/ref/lavf/mxf_dvcpro50     | 2 +-
 tests/ref/lavf/mxf_opatom       | 2 +-
 tests/ref/lavf/mxf_opatom_audio | 2 +-
 10 files changed, 17 insertions(+), 12 deletions(-)

Comments

Tomas Härdin May 8, 2018, 10:50 a.m.
mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> @@ -1228,6 +1229,10 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
>      mxf_write_local_tag(pb, 1, 0x3303);
>      avio_w8(pb, sc->color_siting);
>  
> +    // Padding Bits
> +    mxf_write_local_tag(pb, 2, 0x3307);
> +    avio_wb16(pb, 0);

I'm pretty sure there's ways of muxing v210 in mxf, so it might be
better to say nothing here unless we're entirely sure. Probably OK
since mxfenc can't mux raw video tho

/Tomas
Michael Niedermayer May 8, 2018, 5:20 p.m.
On Tue, May 08, 2018 at 12:50:16PM +0200, Tomas Härdin wrote:
> mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > > Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
> > @@ -1228,6 +1229,10 @@ static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
> >      mxf_write_local_tag(pb, 1, 0x3303);
> >      avio_w8(pb, sc->color_siting);
> >  
> > +    // Padding Bits
> > +    mxf_write_local_tag(pb, 2, 0x3307);
> > +    avio_wb16(pb, 0);
> 
> I'm pretty sure there's ways of muxing v210 in mxf, so it might be
> better to say nothing here unless we're entirely sure. Probably OK
> since mxfenc can't mux raw video tho

IIUC we need this for SMPTE 386M (D-10). It lists "Padding Bits"

this needs to be updated in case rawvideo support is added with different
padding bits.

will apply

thanks


[...]

Patch hide | download patch | download mbox

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index 722830615e..f2be76cc86 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -500,6 +500,7 @@  static const MXFLocalTagPair mxf_local_tag_batch[] = {
     { 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 */
+    { 0x3307, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x18,0x01,0x04,0x00,0x00,0x00,0x00}}, /* Padding Bits */
     { 0x3304, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x03,0x03,0x00,0x00,0x00}}, /* Black Ref level */
     { 0x3305, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x01,0x04,0x01,0x05,0x03,0x04,0x00,0x00,0x00}}, /* White Ref level */
     { 0x3306, {0x06,0x0E,0x2B,0x34,0x01,0x01,0x01,0x02,0x04,0x01,0x05,0x03,0x05,0x00,0x00,0x00}}, /* Color Range */
@@ -1147,7 +1148,7 @@  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 + 5*8;
+    unsigned desc_size = size+8+8+8+8+8+8+8+5+16+4+12+20+5 + 5*8 + 6;
     if (sc->interlaced && sc->field_dominance)
         desc_size += 5;
     if (sc->signal_standard)
@@ -1228,6 +1229,10 @@  static void mxf_write_cdci_common(AVFormatContext *s, AVStream *st, const UID ke
     mxf_write_local_tag(pb, 1, 0x3303);
     avio_w8(pb, sc->color_siting);
 
+    // Padding Bits
+    mxf_write_local_tag(pb, 2, 0x3307);
+    avio_wb16(pb, 0);
+
     if (st->codecpar->color_range != AVCOL_RANGE_UNSPECIFIED) {
         int black = 0,
             white = (1<<sc->component_depth) - 1,
diff --git a/tests/ref/fate/copy-trac4914 b/tests/ref/fate/copy-trac4914
index f868753d45..e3266abeb9 100644
--- a/tests/ref/fate/copy-trac4914
+++ b/tests/ref/fate/copy-trac4914
@@ -1,4 +1,4 @@ 
-2296e01ba6794ab91c78d8bc1215a801 *tests/data/fate/copy-trac4914.mxf
+298afac2f4ddfed331294981160023f0 *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 50023ce52a..b9beffef66 100644
--- a/tests/ref/fate/mxf-reel_name
+++ b/tests/ref/fate/mxf-reel_name
@@ -1 +1 @@ 
-c5752bf1b72694455e1b348cad8660c5
+471e8a7d012fb2b00835aadd5fe648c7
diff --git a/tests/ref/fate/time_base b/tests/ref/fate/time_base
index 979aa08972..acda7c5fcf 100644
--- a/tests/ref/fate/time_base
+++ b/tests/ref/fate/time_base
@@ -1 +1 @@ 
-6aac6c1a2e367e43d665bdb974bb7679
+68608a7f54b8fe3a85cd387e64bab764
diff --git a/tests/ref/lavf/mxf b/tests/ref/lavf/mxf
index df1c2607c7..9f5818e0af 100644
--- a/tests/ref/lavf/mxf
+++ b/tests/ref/lavf/mxf
@@ -1,9 +1,9 @@ 
-b2c881236ca2791a6f378545d82a891b *./tests/data/lavf/lavf.mxf
+408b3758c11af3210c722a52d2754d8c *./tests/data/lavf/lavf.mxf
 526393 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0x8dddfaab
-b14305ee249cc9a7f1708737dbd6daa7 *./tests/data/lavf/lavf.mxf
+76d3bec8f170e389da50a82075c8bf83 *./tests/data/lavf/lavf.mxf
 561721 ./tests/data/lavf/lavf.mxf
 ./tests/data/lavf/lavf.mxf CRC=0xf21b1b48
-0c8ddc85308c8e00d588c33f2458d4be *./tests/data/lavf/lavf.mxf
+caa15603349cb79d11b75a7c6ad633ab *./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 3f91f9c30e..e73cd5d24f 100644
--- a/tests/ref/lavf/mxf_d10
+++ b/tests/ref/lavf/mxf_d10
@@ -1,3 +1,3 @@ 
-e167b53d927a43d6b14c5d0631640adb *./tests/data/lavf/lavf.mxf_d10
+eb9412edd406c02e4d2ac2380748186b *./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 992f0a927d..8635484f17 100644
--- a/tests/ref/lavf/mxf_dv25
+++ b/tests/ref/lavf/mxf_dv25
@@ -1,3 +1,3 @@ 
-7ff3cc1ee0a68cc08221c28a1b801490 *./tests/data/lavf/lavf.mxf_dv25
+eddb23aba03c1c0499928bca27d43795 *./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 74b0bd17de..5df967054c 100644
--- a/tests/ref/lavf/mxf_dvcpro50
+++ b/tests/ref/lavf/mxf_dvcpro50
@@ -1,3 +1,3 @@ 
-b6b24c4c562e2d4c866a3f53907c8745 *./tests/data/lavf/lavf.mxf_dvcpro50
+cfbd162ecd9fa35f9f81d0b721f965e3 *./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 c72481b193..57829f0ebd 100644
--- a/tests/ref/lavf/mxf_opatom
+++ b/tests/ref/lavf/mxf_opatom
@@ -1,3 +1,3 @@ 
-6cf21f1d5e2406c50edf9c34ecdf2b45 *./tests/data/lavf/lavf.mxf_opatom
+062eb7acb97409a91791ca11374a4b5d *./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 f020530cc7..db90cf2718 100644
--- a/tests/ref/lavf/mxf_opatom_audio
+++ b/tests/ref/lavf/mxf_opatom_audio
@@ -1,3 +1,3 @@ 
-0778fda8cea977d37674868ad8ddc2fd *./tests/data/lavf/lavf.mxf_opatom_audio
+b05d38be5e3e40bfe9a9de775370a7ed *./tests/data/lavf/lavf.mxf_opatom_audio
 102969 ./tests/data/lavf/lavf.mxf_opatom_audio
 ./tests/data/lavf/lavf.mxf_opatom_audio CRC=0xd155c6ff