Commit d7b385a2 authored by michael's avatar michael

Fix MB skiping with dropable frames.

Fixes issue323.


git-svn-id: file:///var/local/repositories/ffmpeg/trunk@13378 9553f0bf-9b14-0410-a0b8-cfaf0461ba5b
parent 8ed6d825
...@@ -236,7 +236,7 @@ int alloc_picture(MpegEncContext *s, Picture *pic, int shared){ ...@@ -236,7 +236,7 @@ int alloc_picture(MpegEncContext *s, Picture *pic, int shared){
/* It might be nicer if the application would keep track of these /* It might be nicer if the application would keep track of these
* but it would require an API change. */ * but it would require an API change. */
memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1); memmove(s->prev_pict_types+1, s->prev_pict_types, PREV_PICT_TYPES_BUFFER_SIZE-1);
s->prev_pict_types[0]= s->pict_type; s->prev_pict_types[0]= s->dropable ? FF_B_TYPE : s->pict_type;
if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == FF_B_TYPE) if(pic->age < PREV_PICT_TYPES_BUFFER_SIZE && s->prev_pict_types[pic->age] == FF_B_TYPE)
pic->age= INT_MAX; // Skipped MBs in B-frames are quite rare in MPEG-1/2 and it is a bit tricky to skip them anyway. pic->age= INT_MAX; // Skipped MBs in B-frames are quite rare in MPEG-1/2 and it is a bit tricky to skip them anyway.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment