1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-11-26 19:01:44 +02:00

set last_picture for h.264 too, this significantly improves error concealment quality, i hope it doesnt break anything as last_picture_ptr was always NULL for h.264

Originally committed as revision 7686 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Michael Niedermayer 2007-01-24 14:20:00 +00:00
parent 560588b717
commit 6ad7cd0469

View File

@ -1538,6 +1538,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
/* mark&release old frames */ /* mark&release old frames */
if (s->pict_type != B_TYPE && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->data[0]) { if (s->pict_type != B_TYPE && s->last_picture_ptr && s->last_picture_ptr != s->next_picture_ptr && s->last_picture_ptr->data[0]) {
if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
avctx->release_buffer(avctx, (AVFrame*)s->last_picture_ptr); avctx->release_buffer(avctx, (AVFrame*)s->last_picture_ptr);
/* release forgotten pictures */ /* release forgotten pictures */
@ -1551,6 +1552,7 @@ int MPV_frame_start(MpegEncContext *s, AVCodecContext *avctx)
} }
} }
} }
}
alloc: alloc:
if(!s->encoding){ if(!s->encoding){
/* release non reference frames */ /* release non reference frames */
@ -1587,7 +1589,6 @@ alloc:
copy_picture(&s->current_picture, s->current_picture_ptr); copy_picture(&s->current_picture, s->current_picture_ptr);
if(s->out_format != FMT_H264 || s->codec_id == CODEC_ID_SVQ3){
if (s->pict_type != B_TYPE) { if (s->pict_type != B_TYPE) {
s->last_picture_ptr= s->next_picture_ptr; s->last_picture_ptr= s->next_picture_ptr;
if(!s->dropable) if(!s->dropable)
@ -1621,7 +1622,6 @@ alloc:
s->next_picture.linesize[i] *=2; s->next_picture.linesize[i] *=2;
} }
} }
}
s->hurry_up= s->avctx->hurry_up; s->hurry_up= s->avctx->hurry_up;
s->error_resilience= avctx->error_resilience; s->error_resilience= avctx->error_resilience;