[FFmpeg-devel] [PATCH]Assume STRICT for h264.c

Carl Eugen Hoyos cehoyos
Sun Nov 8 13:36:46 CET 2009


Michael Niedermayer <michaelni <at> gmx.at> writes:

> We should have code that increases has_b_frames in h264.c, ive not looked at
> this issue at all, but if you want to work on this, try to find out why this
> code doesnt increase has_b_frames or if it does why it isnt enough

Following inlined trial-and-error variant also fixes the issue:

Index: libavcodec/h264.c
===================================================================
--- libavcodec/h264.c   (revision 20475)
+++ libavcodec/h264.c   (working copy)
@@ -7906,6 +7906,7 @@
             if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >=
h->sps.num_reorder_frames)
                 { }
             else if((out_of_order && pics-1 == s->avctx->has_b_frames &&
s->avctx->has_b_frames < MAX_DELAYED_PIC_COUNT)
+               || h->sps.ref_frame_count > s->avctx->has_b_frames + 1
                || (s->low_delay &&
                 ((!cross_idr && out->poc > h->outputed_poc + 2)
                  || cur->pict_type == FF_B_TYPE)))

But I guess that even streams without B-frames can have up to 16 reference
frames, am I correct?

Carl Eugen




More information about the ffmpeg-devel mailing list