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

Matthieu Bouron matthieu.bouron at gmail.com
Sat Feb 16 13:52:30 CET 2013


---
 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);
-- 
1.8.1.3



More information about the ffmpeg-devel mailing list