[Mplayer-cvslog] CVS: main/libmpcodecs vf_softskip.c, NONE, 1.1 vf.c, 1.106, 1.107 vf.h, 1.22, 1.23 Makefile, 1.128, 1.129

Richard Felker CVS syncmail at mplayerhq.hu
Wed Apr 28 06:29:19 CEST 2004


CVS change done by Richard Felker CVS

Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var2/tmp/cvs-serv28752/libmpcodecs

Modified Files:
	vf.c vf.h Makefile 
Added Files:
	vf_softskip.c 
Log Message:
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.



--- NEW FILE ---
#include <stdio.h>
#include <stdlib.h>
#include <string.h>

#include "../config.h"
#include "../mp_msg.h"

#include "img_format.h"
#include "mp_image.h"
#include "vf.h"

#include "../libvo/fastmemcpy.h"

struct vf_priv_s {
	int skipflag;
};

static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
{
	mp_image_t *dmpi;
	
	if (vf->priv->skipflag)
		return vf->priv->skipflag = 0;

	dmpi = vf_get_image(vf->next, mpi->imgfmt,
		MP_IMGTYPE_EXPORT, 0, mpi->width, mpi->height);

	dmpi->planes[0] = mpi->planes[0];
	dmpi->stride[0] = mpi->stride[0];
	if (dmpi->flags&MP_IMGFLAG_PLANAR) {
		dmpi->planes[1] = mpi->planes[1];
		dmpi->stride[1] = mpi->stride[1];
		dmpi->planes[2] = mpi->planes[2];
		dmpi->stride[2] = mpi->stride[2];
	}
	
	return vf_next_put_image(vf, dmpi);
}

static int control(struct vf_instance_s* vf, int request, void* data)
{
	switch (request) {
	case VFCTRL_SKIP_NEXT_FRAME:
		vf->priv->skipflag = 1;
		return CONTROL_TRUE;
	}
	return vf_next_control(vf, request, data);
}

static int query_format(struct vf_instance_s* vf, unsigned int fmt)
{
	/* FIXME - figure out which other formats work */
	switch (fmt) {
	case IMGFMT_YV12:
	case IMGFMT_IYUV:
	case IMGFMT_I420:
		return vf_next_query_format(vf, fmt);
	}
	return 0;
}

static void uninit(struct vf_instance_s* vf)
{
	free(vf->priv);
}

static int open(vf_instance_t *vf, char* args)
{
	vf->put_image = put_image;
	vf->control = control;
	vf->uninit = uninit;
	vf->priv = calloc(1, sizeof(struct vf_priv_s));
	return 1;
}

vf_info_t vf_info_softskip = {
    "soft (post-filter) frame skipping for encoding",
    "softskip",
    "Rich Felker",
    "",
    open,
    NULL
};



Index: vf.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.c,v
retrieving revision 1.106
retrieving revision 1.107
diff -u -r1.106 -r1.107
--- vf.c	28 Apr 2004 04:02:46 -0000	1.106
+++ vf.c	28 Apr 2004 04:29:17 -0000	1.107
@@ -90,6 +90,7 @@
 extern vf_info_t vf_info_phase;
 extern vf_info_t vf_info_divtc;
 extern vf_info_t vf_info_harddup;
+extern vf_info_t vf_info_softskip;
 
 // list of available filters:
 static vf_info_t* filter_list[]={
@@ -173,6 +174,7 @@
     &vf_info_phase,
     &vf_info_divtc,
     &vf_info_harddup,
+    &vf_info_softskip,
     NULL
 };
 

Index: vf.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf.h,v
retrieving revision 1.22
retrieving revision 1.23
diff -u -r1.22 -r1.23
--- vf.h	28 Apr 2004 04:07:07 -0000	1.22
+++ vf.h	28 Apr 2004 04:29:17 -0000	1.23
@@ -65,6 +65,7 @@
 #define VFCTRL_CHANGE_RECTANGLE 9 /* Change the rectangle boundaries */
 #define VFCTRL_FLIP_PAGE 10 /* Tell the vo to flip pages */
 #define VFCTRL_DUPLICATE_FRAME 11 /* For encoding - encode zero-change frame */
+#define VFCTRL_SKIP_NEXT_FRAME 12 /* For encoding - drop the next frame that passes thru */
 
 #include "vfcap.h"
 

Index: Makefile
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/Makefile,v
retrieving revision 1.128
retrieving revision 1.129
diff -u -r1.128 -r1.129
--- Makefile	28 Apr 2004 04:02:46 -0000	1.128
+++ Makefile	28 Apr 2004 04:29:17 -0000	1.129
@@ -14,7 +14,7 @@
 VIDEO_SRCS_OPT=vd_realvid.c vd_ffmpeg.c vd_dshow.c vd_dmo.c vd_vfw.c vd_vfwex.c vd_odivx.c vd_divx4.c vd_zrmjpeg.c vd_xanim.c vd_xvid.c vd_xvid4.c vd_libdv.c vd_qtvideo.c vd_theora.c
 VIDEO_SRCS=dec_video.c vd.c $(VIDEO_SRCS_NAT) $(VIDEO_SRCS_LIB) $(VIDEO_SRCS_OPT)
 
-VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_scale.c vf_format.c vf_noformat.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_field.c vf_denoise3d.c vf_hqdn3d.c vf_detc.c vf_telecine.c vf_tfields.c vf_ivtc.c vf_ilpack.c vf_dsize.c vf_decimate.c vf_softpulldown.c vf_tinterlace.c vf_pullup.c pullup.c vf_framestep.c vf_tile.c vf_delogo.c vf_fil.c vf_hue.c vf_spp.c vf_yuvcsp.c vf_filmdint.c vf_kerndeint.c vf_rgbtest.c vf_qp.c vf_phase.c vf_divtc.c vf_harddup.c
+VFILTER_SRCS=vf.c vf_vo.c vf_crop.c vf_expand.c vf_scale.c vf_format.c vf_noformat.c vf_yuy2.c vf_flip.c vf_rgb2bgr.c vf_rotate.c vf_mirror.c vf_palette.c vf_lavc.c vf_dvbscale.c vf_cropdetect.c vf_test.c vf_noise.c vf_yvu9.c vf_rectangle.c vf_lavcdeint.c vf_eq.c vf_eq2.c vf_halfpack.c vf_dint.c vf_1bpp.c vf_bmovl.c vf_2xsai.c vf_unsharp.c vf_swapuv.c vf_il.c vf_boxblur.c vf_sab.c vf_smartblur.c vf_perspective.c vf_down3dright.c vf_field.c vf_denoise3d.c vf_hqdn3d.c vf_detc.c vf_telecine.c vf_tfields.c vf_ivtc.c vf_ilpack.c vf_dsize.c vf_decimate.c vf_softpulldown.c vf_tinterlace.c vf_pullup.c pullup.c vf_framestep.c vf_tile.c vf_delogo.c vf_fil.c vf_hue.c vf_spp.c vf_yuvcsp.c vf_filmdint.c vf_kerndeint.c vf_rgbtest.c vf_qp.c vf_phase.c vf_divtc.c vf_harddup.c vf_softskip.c
 ifeq ($(HAVE_FFPOSTPROCESS),yes)
 VFILTER_SRCS += vf_pp.c
 endif




More information about the MPlayer-cvslog mailing list