Mercurial > libavcodec.hg
comparison h264_refs.c @ 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 |
comparison
equal
deleted
inserted
replaced
12093:05f91a88f986 | 12094:f7bedc1ce1bc |
---|---|
476 | 476 |
477 void ff_generate_sliding_window_mmcos(H264Context *h) { | 477 void ff_generate_sliding_window_mmcos(H264Context *h) { |
478 MpegEncContext * const s = &h->s; | 478 MpegEncContext * const s = &h->s; |
479 assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count); | 479 assert(h->long_ref_count + h->short_ref_count <= h->sps.ref_frame_count); |
480 | 480 |
481 h->mmco_index= 0; | |
481 if(h->short_ref_count && h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count && | 482 if(h->short_ref_count && h->long_ref_count + h->short_ref_count == h->sps.ref_frame_count && |
482 !(FIELD_PICTURE && !s->first_field && s->current_picture_ptr->reference)) { | 483 !(FIELD_PICTURE && !s->first_field && s->current_picture_ptr->reference)) { |
483 h->mmco[0].opcode= MMCO_SHORT2UNUSED; | 484 h->mmco[0].opcode= MMCO_SHORT2UNUSED; |
484 h->mmco[0].short_pic_num= h->short_ref[ h->short_ref_count - 1 ]->frame_num; | 485 h->mmco[0].short_pic_num= h->short_ref[ h->short_ref_count - 1 ]->frame_num; |
485 h->mmco_index= 1; | 486 h->mmco_index= 1; |