diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2005-11-05 00:16:03 +0000 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2005-11-05 00:16:03 +0000 |
commit | a75a3ca429e0c0f34a60c3fbd4653f6cd3ab94d7 (patch) | |
tree | ed02d4b6268ce92e568bc8f6617fd674482f79ac | |
parent | 840fb7a76db9238554f0dbe1a84e660a6f16cdb1 (diff) | |
download | ffmpeg-a75a3ca429e0c0f34a60c3fbd4653f6cd3ab94d7.tar.gz |
frame skip fixes
fix 16pixel error in comparission
fix vbv messup
fix unlimited skip intervals, limited by GOP now
Originally committed as revision 4678 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r-- | libavcodec/mpegvideo.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c index a381cfe11f..96f2fc8a7e 100644 --- a/libavcodec/mpegvideo.c +++ b/libavcodec/mpegvideo.c @@ -2117,7 +2117,8 @@ static int skip_check(MpegEncContext *s, Picture *p, Picture *ref){ const int bw= plane ? 1 : 2; for(y=0; y<s->mb_height*bw; y++){ for(x=0; x<s->mb_width*bw; x++){ - int v= s->dsp.frame_skip_cmp[1](s, p->data[plane] + 8*(x + y*stride), ref->data[plane] + 8*(x + y*stride), stride, 8); + int off= p->type == FF_BUFFER_TYPE_SHARED ? 0: 16; + int v= s->dsp.frame_skip_cmp[1](s, p->data[plane] + 8*(x + y*stride)+off, ref->data[plane] + 8*(x + y*stride), stride, 8); switch(s->avctx->frame_skip_exp){ case 0: score= FFMAX(score, v); break; @@ -2156,7 +2157,8 @@ static void select_input_picture(MpegEncContext *s){ int b_frames; if(s->avctx->frame_skip_threshold || s->avctx->frame_skip_factor){ - if(skip_check(s, s->input_picture[0], s->next_picture_ptr)){ + if(s->picture_in_gop_number < s->gop_size && skip_check(s, s->input_picture[0], s->next_picture_ptr)){ + //FIXME check that te gop check above is +-1 correct //av_log(NULL, AV_LOG_DEBUG, "skip %p %Ld\n", s->input_picture[0]->data[0], s->input_picture[0]->pts); if(s->input_picture[0]->type == FF_BUFFER_TYPE_SHARED){ @@ -2169,6 +2171,9 @@ static void select_input_picture(MpegEncContext *s){ s->avctx->release_buffer(s->avctx, (AVFrame*)s->input_picture[0]); } + + emms_c(); + ff_vbv_update(s, 0); goto no_output_pic; } |