diff options
author | Thomas Mundt <loudmax@yahoo.de> | 2015-09-27 22:11:47 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-09-27 22:39:24 +0200 |
commit | 2b6567722a48656c526ca2d6c1dcab88be3c18f7 (patch) | |
tree | 93090b90f761fb10b686fa6e6d271be12517c00c /libavcodec | |
parent | b8b8e82ea14016b2cb04b49ecea57f836e6ee7f8 (diff) | |
download | ffmpeg-2b6567722a48656c526ca2d6c1dcab88be3c18f7.tar.gz |
h264: Fix ticket #3147 H264 - Wrong field order
Default field order to top field first when interlaced frame is detected and pic_struct_present_flag is not set.
Since bottom field first comes from the old NTSC standard and is not used with HD anymore I think it´s straight forward to favor the majority.
Signed-off-by: Thomas Mundt <loudmax@yahoo.de>
Reviewed-by: Kieran Kunhya <kierank@obe.tv>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec')
-rw-r--r-- | libavcodec/h264.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index b7978936b8..8b95003f75 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -803,7 +803,7 @@ static void decode_postinit(H264Context *h, int setup_finished) /* Derive top_field_first from field pocs. */ cur->f->top_field_first = cur->field_poc[0] < cur->field_poc[1]; } else { - if (cur->f->interlaced_frame || h->sps.pic_struct_present_flag) { + if (h->sps.pic_struct_present_flag) { /* Use picture timing SEI information. Even if it is a * information of a past frame, better than nothing. */ if (h->sei_pic_struct == SEI_PIC_STRUCT_TOP_BOTTOM || @@ -811,6 +811,10 @@ static void decode_postinit(H264Context *h, int setup_finished) cur->f->top_field_first = 1; else cur->f->top_field_first = 0; + } else if (cur->f->interlaced_frame) { + /* Default to top field first when pic_struct_present_flag + * is not set but interlaced frame detected */ + cur->f->top_field_first = 1; } else { /* Most likely progressive */ cur->f->top_field_first = 0; |