Mercurial > mplayer.hg
view libmpcodecs/vf_softskip.c @ 15915:b3924612667a
Update of the x264 encoding guide:
- Reorganized things, options are now divided into "speed vs quality"
and "other" (more or less). subq is now where it belongs.
- subq=6 is documented
- explanation of what 2-pass really does, and why you'd better use it
- mention 3-pass (and the fact that it usually doesn't help)
- documented qcomp
- documented keyint (not like it needed any more explanation, though)
- deblocking parameter tweaking no longer categorized as options that
"affect speed and quality ;)
- updated example cpu requirements for decoding, in codecs.xml
(720x480 @ 1500kbps 50%->35%, for my CPU)
author | gpoirier |
---|---|
date | Mon, 04 Jul 2005 05:37:27 +0000 |
parents | 6f1b4c989914 |
children | 6ff3379a0862 |
line wrap: on
line source
#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 };