Perform sliding window operation during frame gap handling.

This avoids some warnings about too many reference frames.

Originally committed as revision 24057 to svn://svn.ffmpeg.org/ffmpeg/trunk
oldabi
Michael Niedermayer 15 years ago
parent 733f5990d0
commit 3d5421201b
  1. 3
      libavcodec/h264.c
  2. 1
      libavcodec/h264_refs.c

@ -1908,7 +1908,8 @@ static int decode_slice_header(H264Context *h, H264Context *h0){
h->prev_frame_num++; h->prev_frame_num++;
h->prev_frame_num %= 1<<h->sps.log2_max_frame_num; h->prev_frame_num %= 1<<h->sps.log2_max_frame_num;
s->current_picture_ptr->frame_num= h->prev_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... */ /* See if we have a decoded first field looking for a pair... */

@ -478,6 +478,7 @@ void ff_generate_sliding_window_mmcos(H264Context *h) {
MpegEncContext * const s = &h->s; MpegEncContext * const s = &h->s;
assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count); 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 && 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)) { !(FIELD_PICTURE && !s->first_field && s->current_picture_ptr->reference)) {
h->mmco[0].opcode= MMCO_SHORT2UNUSED; h->mmco[0].opcode= MMCO_SHORT2UNUSED;

Loading…
Cancel
Save