Mercurial > libavcodec.hg
diff h264.c @ 9128:793cf8c68c4f libavcodec
Add support for ct_type to correctly detect interlaced flag
author | schreter |
---|---|
date | Wed, 04 Mar 2009 19:37:19 +0000 |
parents | 65141aec8b05 |
children | 53123c63f82a |
line wrap: on
line diff
--- a/h264.c Wed Mar 04 18:18:49 2009 +0000 +++ b/h264.c Wed Mar 04 19:37:19 2009 +0000 @@ -6795,6 +6795,7 @@ if(h->sps.pic_struct_present_flag){ unsigned int i, num_clock_ts; h->sei_pic_struct = get_bits(&s->gb, 4); + h->sei_ct_type = 0; if (h->sei_pic_struct > SEI_PIC_STRUCT_FRAME_TRIPLING) return -1; @@ -6804,7 +6805,7 @@ for (i = 0 ; i < num_clock_ts ; i++){ if(get_bits(&s->gb, 1)){ /* clock_timestamp_flag */ unsigned int full_timestamp_flag; - skip_bits(&s->gb, 2); /* ct_type */ + h->sei_ct_type |= 1<<get_bits(&s->gb, 2); skip_bits(&s->gb, 1); /* nuit_field_based_flag */ skip_bits(&s->gb, 5); /* counting_type */ full_timestamp_flag = get_bits(&s->gb, 1); @@ -7762,24 +7763,19 @@ /* Signal interlacing information externally. */ /* Prioritize picture timing SEI information over used decoding process if it exists. */ + if (h->sei_ct_type) + cur->interlaced_frame = (h->sei_ct_type & (1<<1)) != 0; + else + cur->interlaced_frame = FIELD_OR_MBAFF_PICTURE; + if(h->sps.pic_struct_present_flag){ switch (h->sei_pic_struct) { - case SEI_PIC_STRUCT_FRAME: - cur->interlaced_frame = 0; - break; - case SEI_PIC_STRUCT_TOP_FIELD: - case SEI_PIC_STRUCT_BOTTOM_FIELD: - case SEI_PIC_STRUCT_TOP_BOTTOM: - case SEI_PIC_STRUCT_BOTTOM_TOP: - cur->interlaced_frame = 1; - break; case SEI_PIC_STRUCT_TOP_BOTTOM_TOP: case SEI_PIC_STRUCT_BOTTOM_TOP_BOTTOM: // Signal the possibility of telecined film externally (pic_struct 5,6) // From these hints, let the applications decide if they apply deinterlacing. cur->repeat_pict = 1; - cur->interlaced_frame = FIELD_OR_MBAFF_PICTURE; break; case SEI_PIC_STRUCT_FRAME_DOUBLING: // Force progressive here, as doubling interlaced frame is a bad idea.