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

Tomas Härdin tomas.hardin at codemill.se
Tue Mar 19 11:56:57 CET 2013


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.

/Tomas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20130319/80269850/attachment.asc>


More information about the ffmpeg-devel mailing list