Re: [FFmpeg-devel] [PATCH 05/13] avformat/mxfenc: Fix stored width

2018-05-08 Thread Michael Niedermayer
On Tue, May 08, 2018 at 12:37:08PM +0200, Tomas Härdin wrote:
> mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> > This fixes the width to have computations matching the height
> > 
> > > Signed-off-by: Michael Niedermayer 
> > ---
> >  libavformat/mxfenc.c  |   3 +-
> >  .../ref/fate/concat-demuxer-extended-lavf-mxf |   2 +-
> >  .../fate/concat-demuxer-extended-lavf-mxf_d10 |   2 +-
> >  .../ref/fate/concat-demuxer-simple1-lavf-mxf  | 242 +-
> >  .../fate/concat-demuxer-simple1-lavf-mxf_d10  | 140 +-
> >  tests/ref/seek/lavf-mxf   |  44 ++--
> >  tests/ref/seek/lavf-mxf_d10   |  54 ++--
> >  tests/ref/seek/lavf-mxf_dv25  |  54 ++--
> >  tests/ref/seek/lavf-mxf_dvcpro50  |  54 ++--
> >  tests/ref/seek/lavf-mxf_opatom_audio  |  54 ++--
> >  10 files changed, 325 insertions(+), 324 deletions(-)
> > 
> > diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> > index f0fd406493..9140302b81 100644
> > --- a/libavformat/mxfenc.c
> > +++ b/libavformat/mxfenc.c
> > @@ -1131,6 +1131,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, 
> > AVStream *st, const UID ke
> >  {
> >  MXFStreamContext *sc = st->priv_data;
> >  AVIOContext *pb = s->pb;
> > +int stored_width  = (st->codecpar->width +15)/16*16;
> >  int stored_height = (st->codecpar->height+15)/16*16;
> 
> Should a muxer really do this kinds of computations? 

The specification lists these fields as "best effort" so litterally
yes, the muxer should do its best to do the computations and fill the
fields.


> What happens if a
> codec comes along that has larger or smaller macroblocks?

In this case we likely will have to check for this in the muxer

will apply

thx

[...]

-- 
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Elect your leaders based on what they did after the last election, not
based on what they say before an election.



signature.asc
Description: PGP signature
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


Re: [FFmpeg-devel] [PATCH 05/13] avformat/mxfenc: Fix stored width

2018-05-08 Thread Tomas Härdin
mån 2018-05-07 klockan 12:38 +0200 skrev Michael Niedermayer:
> This fixes the width to have computations matching the height
> 
> > Signed-off-by: Michael Niedermayer 
> ---
>  libavformat/mxfenc.c  |   3 +-
>  .../ref/fate/concat-demuxer-extended-lavf-mxf |   2 +-
>  .../fate/concat-demuxer-extended-lavf-mxf_d10 |   2 +-
>  .../ref/fate/concat-demuxer-simple1-lavf-mxf  | 242 +-
>  .../fate/concat-demuxer-simple1-lavf-mxf_d10  | 140 +-
>  tests/ref/seek/lavf-mxf   |  44 ++--
>  tests/ref/seek/lavf-mxf_d10   |  54 ++--
>  tests/ref/seek/lavf-mxf_dv25  |  54 ++--
>  tests/ref/seek/lavf-mxf_dvcpro50  |  54 ++--
>  tests/ref/seek/lavf-mxf_opatom_audio  |  54 ++--
>  10 files changed, 325 insertions(+), 324 deletions(-)
> 
> diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
> index f0fd406493..9140302b81 100644
> --- a/libavformat/mxfenc.c
> +++ b/libavformat/mxfenc.c
> @@ -1131,6 +1131,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, 
> AVStream *st, const UID ke
>  {
>  MXFStreamContext *sc = st->priv_data;
>  AVIOContext *pb = s->pb;
> +int stored_width  = (st->codecpar->width +15)/16*16;
>  int stored_height = (st->codecpar->height+15)/16*16;

Should a muxer really do this kinds of computations? What happens if a
codec comes along that has larger or smaller macroblocks?

>  int display_height;
>  int f1, f2;
> @@ -1143,7 +1144,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, 
> AVStream *st, const UID ke
>  mxf_write_generic_desc(s, st, key, desc_size);
>  
>  mxf_write_local_tag(pb, 4, 0x3203);
> -avio_wb32(pb, st->codecpar->width);
> +avio_wb32(pb, stored_width);

/Tomas
___
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel


[FFmpeg-devel] [PATCH 05/13] avformat/mxfenc: Fix stored width

2018-05-07 Thread Michael Niedermayer
This fixes the width to have computations matching the height

Signed-off-by: Michael Niedermayer 
---
 libavformat/mxfenc.c  |   3 +-
 .../ref/fate/concat-demuxer-extended-lavf-mxf |   2 +-
 .../fate/concat-demuxer-extended-lavf-mxf_d10 |   2 +-
 .../ref/fate/concat-demuxer-simple1-lavf-mxf  | 242 +-
 .../fate/concat-demuxer-simple1-lavf-mxf_d10  | 140 +-
 tests/ref/seek/lavf-mxf   |  44 ++--
 tests/ref/seek/lavf-mxf_d10   |  54 ++--
 tests/ref/seek/lavf-mxf_dv25  |  54 ++--
 tests/ref/seek/lavf-mxf_dvcpro50  |  54 ++--
 tests/ref/seek/lavf-mxf_opatom_audio  |  54 ++--
 10 files changed, 325 insertions(+), 324 deletions(-)

diff --git a/libavformat/mxfenc.c b/libavformat/mxfenc.c
index f0fd406493..9140302b81 100644
--- a/libavformat/mxfenc.c
+++ b/libavformat/mxfenc.c
@@ -1131,6 +1131,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, 
AVStream *st, const UID ke
 {
 MXFStreamContext *sc = st->priv_data;
 AVIOContext *pb = s->pb;
+int stored_width  = (st->codecpar->width +15)/16*16;
 int stored_height = (st->codecpar->height+15)/16*16;
 int display_height;
 int f1, f2;
@@ -1143,7 +1144,7 @@ static void mxf_write_cdci_common(AVFormatContext *s, 
AVStream *st, const UID ke
 mxf_write_generic_desc(s, st, key, desc_size);
 
 mxf_write_local_tag(pb, 4, 0x3203);
-avio_wb32(pb, st->codecpar->width);
+avio_wb32(pb, stored_width);
 
 mxf_write_local_tag(pb, 4, 0x3202);
 avio_wb32(pb, stored_height>>sc->interlaced);
diff --git a/tests/ref/fate/concat-demuxer-extended-lavf-mxf 
b/tests/ref/fate/concat-demuxer-extended-lavf-mxf
index c47f14faa1..13170c6eaf 100644
--- a/tests/ref/fate/concat-demuxer-extended-lavf-mxf
+++ b/tests/ref/fate/concat-demuxer-extended-lavf-mxf
@@ -1 +1 @@
-7e53f4c5cb0c9afda2771c9f0c697d9c 
*tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe
+7c8c500ea386b41e9025487fb4380f5c 
*tests/data/fate/concat-demuxer-extended-lavf-mxf.ffprobe
diff --git a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10 
b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
index 75d386e3c1..c3c8591c93 100644
--- a/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
+++ b/tests/ref/fate/concat-demuxer-extended-lavf-mxf_d10
@@ -1 +1 @@
-44810fc20072d9d7011b0d2afe59 
*tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe
+d87c3a2394c60046636e43848fa8b4f6 
*tests/data/fate/concat-demuxer-extended-lavf-mxf_d10.ffprobe
diff --git a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf 
b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf
index 1174a1e183..4f1d12fe26 100644
--- a/tests/ref/fate/concat-demuxer-simple1-lavf-mxf
+++ b/tests/ref/fate/concat-demuxer-simple1-lavf-mxf
@@ -1,124 +1,124 @@
-video|0|0|0.00|-1|-0.04|1|0.04|N/A|N/A|24801|6144|K_
-audio|1|0|0.00|0|0.00|1920|0.04|N/A|N/A|3840|31232|K_
-video|0|3|0.12|0|0.00|1|0.04|N/A|N/A|16743|35840|__
-audio|1|1920|0.04|1920|0.04|1920|0.04|N/A|N/A|3840|52736|K_
-video|0|1|0.04|1|0.04|1|0.04|N/A|N/A|13812|57344|__
-audio|1|3840|0.08|3840|0.08|1920|0.04|N/A|N/A|3840|71680|K_
-video|0|2|0.08|2|0.08|1|0.04|N/A|N/A|13607|76288|__
-audio|1|5760|0.12|5760|0.12|1920|0.04|N/A|N/A|3840|90112|K_
-video|0|6|0.24|3|0.12|1|0.04|N/A|N/A|16158|94720|__
-audio|1|7680|0.16|7680|0.16|1920|0.04|N/A|N/A|3840|04|K_
-video|0|4|0.16|4|0.16|1|0.04|N/A|N/A|13943|115712|__
-audio|1|9600|0.20|9600|0.20|1920|0.04|N/A|N/A|3840|130048|K_
-video|0|5|0.20|5|0.20|1|0.04|N/A|N/A|11223|134656|__
-audio|1|11520|0.24|11520|0.24|1920|0.04|N/A|N/A|3840|145920|K_
-video|0|9|0.36|6|0.24|1|0.04|N/A|N/A|20298|150528|__
-audio|1|13440|0.28|13440|0.28|1920|0.04|N/A|N/A|3840|171008|K_
-video|0|7|0.28|7|0.28|1|0.04|N/A|N/A|13341|175616|__
-audio|1|15360|0.32|15360|0.32|1920|0.04|N/A|N/A|3840|189440|K_
-video|0|8|0.32|8|0.32|1|0.04|N/A|N/A|12362|194048|__
-audio|1|17280|0.36|17280|0.36|1920|0.04|N/A|N/A|3840|206848|K_
-video|0|12|0.48|9|0.36|1|0.04|N/A|N/A|24786|211456|K_
-audio|1|19200|0.40|19200|0.40|1920|0.04|N/A|N/A|3840|236544|K_
-video|0|10|0.40|10|0.40|1|0.04|N/A|N/A|13377|241152|__
-audio|1|21120|0.44|21120|0.44|1920|0.04|N/A|N/A|3840|254976|K_
-video|0|11|0.44|11|0.44|1|0.04|N/A|N/A|15624|259584|__
-audio|1|23040|0.48|23040|0.48|1920|0.04|N/A|N/A|3840|275456|K_
-video|0|15|0.60|12|0.48|1|0.04|N/A|N/A|22597|280064|__
-audio|1|24960|0.52|24960|0.52|1920|0.04|N/A|N/A|3840|303104|K_
-video|0|13|0.52|13|0.52|1|0.04|N/A|N/A|15028|307712|__
-audio|1|26880|0.56|26880|0.56|1920|0.04|N/A|N/A|3840|323072|K_