diff options
author | Ivan Schreter <schreter@gmx.net> | 2009-02-18 00:38:10 +0000 |
---|---|---|
committer | Carl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at> | 2009-02-18 00:38:10 +0000 |
commit | cf6065ca6bdba3929d952da36bbd1410a2e112c0 (patch) | |
tree | 8c71740a719f883c44226d4bfa1b2da8ca2cce79 | |
parent | ff594f81dfae66e28aec9ed7fd1606450d38d0c7 (diff) | |
download | ffmpeg-cf6065ca6bdba3929d952da36bbd1410a2e112c0.tar.gz |
Parse cbp_removal_delay in SEI picture structure.
Patch by Ivan Schreter, schreter gmx net
Originally committed as revision 17413 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/h264.c | 5 | ||||
-rw-r--r-- | libavcodec/h264.h | 5 |
2 files changed, 9 insertions, 1 deletions
diff --git a/libavcodec/h264.c b/libavcodec/h264.c index 7b1d0d8686..29493a3472 100644 --- a/libavcodec/h264.c +++ b/libavcodec/h264.c @@ -2210,6 +2210,7 @@ static av_cold int decode_init(AVCodecContext *avctx){ h->prev_poc_msb= 1<<16; h->sei_recovery_frame_cnt = -1; h->sei_dpb_output_delay = 0; + h->sei_cpb_removal_delay = -1; return 0; } @@ -3146,6 +3147,7 @@ static void flush_dpb(AVCodecContext *avctx){ h->s.first_field= 0; h->sei_recovery_frame_cnt = -1; h->sei_dpb_output_delay = 0; + h->sei_cpb_removal_delay = -1; ff_mpeg_flush(avctx); } @@ -6783,7 +6785,7 @@ static int decode_slice(struct AVCodecContext *avctx, void *arg){ static int decode_picture_timing(H264Context *h){ MpegEncContext * const s = &h->s; if(h->sps.nal_hrd_parameters_present_flag || h->sps.vcl_hrd_parameters_present_flag){ - skip_bits(&s->gb, h->sps.cpb_removal_delay_length); /* cpb_removal_delay */ + h->sei_cpb_removal_delay = get_bits(&s->gb, h->sps.cpb_removal_delay_length); h->sei_dpb_output_delay = get_bits(&s->gb, h->sps.dpb_output_delay_length); } if(h->sps.pic_struct_present_flag){ @@ -7694,6 +7696,7 @@ static int decode_frame(AVCodecContext *avctx, MPV_frame_end(s); h->sei_recovery_frame_cnt = -1; h->sei_dpb_output_delay = 0; + h->sei_cpb_removal_delay = -1; if (cur->field_poc[0]==INT_MAX || cur->field_poc[1]==INT_MAX) { /* Wait for second field. */ diff --git a/libavcodec/h264.h b/libavcodec/h264.h index bfeae32247..43201d32ec 100644 --- a/libavcodec/h264.h +++ b/libavcodec/h264.h @@ -507,6 +507,11 @@ typedef struct H264Context{ int sei_dpb_output_delay; /** + * cpb_removal_delay in picture timing SEI message, see H.264 C.1.2 + */ + int sei_cpb_removal_delay; + + /** * recovery_frame_cnt from SEI message * * Set to -1 if no recovery point SEI message found or to number of frames |