[FFmpeg-devel] [PATCH 2/3] lavf/mxfdec: set field dominance for j2k codec with separate fields layout

Michael Niedermayer michaelni at gmx.at
Tue Mar 19 21:33:10 CET 2013


On Tue, Mar 19, 2013 at 04:30:39PM +0000, Tim Nicholson wrote:
> On 19/03/13 10:56, Tomas Härdin wrote:
> > On Sat, 2013-02-16 at 13:52 +0100, Matthieu Bouron wrote:
> >> ---
> >>  libavformat/mxfdec.c | 11 +++++++++++
> >>  1 file changed, 11 insertions(+)
> >>
> >> diff --git a/libavformat/mxfdec.c b/libavformat/mxfdec.c
> >> index d4cdbac..4736179 100644
> >> --- a/libavformat/mxfdec.c
> >> +++ b/libavformat/mxfdec.c
> >> @@ -1541,6 +1541,17 @@ static int mxf_parse_structural_metadata(MXFContext *mxf)
> >>                      break;
> >>                  case SeparateFields:
> >>                      st->codec->height *= 2; /* Turn field height into frame height. */
> >> +                    if (st->codec->codec_id == CODEC_ID_JPEG2000) {
> >> +                        if (descriptor->field_dominance == 1)
> >> +                            st->codec->field_order = AV_FIELD_TT;
> >> +                        else if (descriptor->field_dominance == 2)
> >> +                            st->codec->field_order = AV_FIELD_BB;
> >> +                        else {
> >> +                            av_log(mxf->fc, AV_LOG_INFO,
> >> +                                   "Invalid field dominance value: %d, defaulting to TFF\n", descriptor->field_dominance);
> >> +                            st->codec->field_order = AV_FIELD_TT;
> >> +                        }
> >> +                    }
> >>                      break;
> >>                  default:
> >>                      av_log(mxf->fc, AV_LOG_INFO, "Unknown frame layout type: %d\n", descriptor->frame_layout);
> > 
> > Looks OK, but we might want to double-check this against what JPEG2000
> > in MOV looks like. It might want BT/TB. But that can perhaps be
> > addressed in movenc.c.
> 
> All my sample J2K mov's made in FCP etc do not set the 'fiel' atom as
> the information is already in the stream, so its difficult to know what
> the value should be.

> Perhaps this is another codec where movenc.c should
> not just blindly write that atom just because there is a value set.

yes, sounds like thats the correct thing to do
If theres something i should apply or a branch i should merge, please
say so ...


> 
> However, that said, it would be good to use TB/BT/TT/BB consistently.
> 
> > 
> > /Tomas
> > [..]
> 
> 
> -- 
> Tim
> _______________________________________________
> ffmpeg-devel mailing list
> ffmpeg-devel at ffmpeg.org
> http://ffmpeg.org/mailman/listinfo/ffmpeg-devel
> 

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130319/94bb7fee/attachment.asc>


More information about the ffmpeg-devel mailing list