From 46ca153401ef3852b8870f491c0358b74c6c108b Mon Sep 17 00:00:00 2001 From: rfelker Date: Wed, 28 Apr 2004 04:29:17 +0000 Subject: soft skipping for mencoder. rather than skipping decoding/filtering frames that will be skipped, mencoded tells vf_softskip (if present) that it should drop the next frame. this allows filters that need to see every input frame (inverse telecine, denoise3d, ...) to see skipped frames before they get dropped. in principle, a smarter softskip filter could be written that would buffer frames and choose to drop the one with least change, rather than strictly dropping the next one. git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12338 b3059339-0415-0410-9bf9-f77b7e298cf2 --- mencoder.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'mencoder.c') diff --git a/mencoder.c b/mencoder.c index 0a347f3ba8..069235652c 100644 --- a/mencoder.c +++ b/mencoder.c @@ -1289,14 +1289,16 @@ case VCODEC_FRAMENO: break; default: // decode_video will callback down to ve_*.c encoders, through the video filters - blit_frame=decode_video(sh_video,start,in_size,(skip_flag>0)?1:0); + blit_frame=decode_video(sh_video,start,in_size, + skip_flag>0 && vf_next_control(sh_video->vfilter, VFCTRL_SKIP_NEXT_FRAME, 0) != CONTROL_TRUE); if(!blit_frame){ badframes++; if(skip_flag<=0){ // unwanted skipping of a frame, what to do? if(skip_limit==0){ // skipping not allowed -> write empty frame: - muxer_write_chunk(mux_v,0,0); + if (!encode_duplicates || vf_next_control(sh_video->vfilter, VFCTRL_DUPLICATE_FRAME, 0) != CONTROL_TRUE) + muxer_write_chunk(mux_v,0,0); } else { // skipping allowed -> skip it and distriubute timer error: v_timer_corr-=(float)mux_v->h.dwScale/mux_v->h.dwRate; -- cgit v1.2.3