[FFmpeg-cvslog] h264: migrate poc gap based has_b_frames calculation into new has_b_frame calculation code .

Michael Niedermayer git at videolan.org
Thu Nov 17 01:52:58 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Thu Nov 17 01:08:17 2011 +0100| [4f7ad4c3e460a7dfe4e3186c73ad73db29336488] | committer: Michael Niedermayer

h264: migrate poc gap based has_b_frames calculation into new has_b_frame calculation code.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=4f7ad4c3e460a7dfe4e3186c73ad73db29336488
---

 libavcodec/h264.c |   12 ++----------
 1 files changed, 2 insertions(+), 10 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 256c830..e3d9449 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -1484,7 +1484,8 @@ static void decode_postinit(H264Context *h, int setup_finished){
         }
     }
     out_of_order = MAX_DELAYED_PIC_COUNT - i;
-    if(cur->f.pict_type == AV_PICTURE_TYPE_B)
+    if(   cur->f.pict_type == AV_PICTURE_TYPE_B
+       || (h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > INT_MIN && h->last_pocs[MAX_DELAYED_PIC_COUNT-1] - h->last_pocs[MAX_DELAYED_PIC_COUNT-2] > 2))
         out_of_order = FFMAX(out_of_order, 1);
     if(s->avctx->has_b_frames < out_of_order && !h->sps.bitstream_restriction_flag){
         av_log(s->avctx, AV_LOG_WARNING, "Increasing reorder buffer to %d\n", out_of_order);
@@ -1512,15 +1513,6 @@ static void decode_postinit(H264Context *h, int setup_finished){
         h->next_outputed_poc= INT_MIN;
     out_of_order = out->poc < h->next_outputed_poc;
 
-    if(h->sps.bitstream_restriction_flag && s->avctx->has_b_frames >= h->sps.num_reorder_frames)
-        { }
-    else if (s->low_delay &&
-               ((h->next_outputed_poc != INT_MIN && out->poc > h->next_outputed_poc + 2) ||
-                cur->f.pict_type == AV_PICTURE_TYPE_B)) {
-        s->low_delay = 0;
-        s->avctx->has_b_frames++;
-    }
-
     if(out_of_order || pics > s->avctx->has_b_frames){
         out->f.reference &= ~DELAYED_PIC_REF;
         out->owner2 = s; // for frame threading, the owner must be the second field's thread



More information about the ffmpeg-cvslog mailing list