changeset 12094:f7bedc1ce1bc libavcodec

Perform sliding window operation during frame gap handling. This avoids some warnings about too many reference frames.
author michael
date Mon, 05 Jul 2010 14:36:03 +0000
parents 05f91a88f986
children 108e7da64995
files h264.c h264_refs.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/h264.c	Mon Jul 05 12:42:19 2010 +0000
+++ b/h264.c	Mon Jul 05 14:36:03 2010 +0000
@@ -1908,7 +1908,8 @@
             h->prev_frame_num++;
             h->prev_frame_num %= 1<<h->sps.log2_max_frame_num;
             s->current_picture_ptr->frame_num= h->prev_frame_num;
-            ff_h264_execute_ref_pic_marking(h, NULL, 0);
+            ff_generate_sliding_window_mmcos(h);
+            ff_h264_execute_ref_pic_marking(h, h->mmco, h->mmco_index);
         }
 
         /* See if we have a decoded first field looking for a pair... */
--- a/h264_refs.c	Mon Jul 05 12:42:19 2010 +0000
+++ b/h264_refs.c	Mon Jul 05 14:36:03 2010 +0000
@@ -478,6 +478,7 @@
     MpegEncContext * const s = &h->s;
     assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count);
 
+    h->mmco_index= 0;
     if(h->short_ref_count && h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count &&
             !(FIELD_PICTURE && !s->first_field && s->current_picture_ptr->reference)) {
         h->mmco[0].opcode= MMCO_SHORT2UNUSED;