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

Tim Nicholson nichot20 at yahoo.com
Tue Mar 19 17:30:39 CET 2013


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.

However, that said, it would be good to use TB/BT/TT/BB consistently.

> 
> /Tomas
> [..]


-- 
Tim


More information about the ffmpeg-devel mailing list