annotate libmpcodecs/vf_softskip.c @ 22345:a50a835635c7

grammar/spelling
author diego
date Tue, 27 Feb 2007 17:06:36 +0000
parents 009635b12924
children f8d4f8eff72b
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
1 #include <stdio.h>
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
2 #include <stdlib.h>
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
3 #include <string.h>
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
4
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 12337
diff changeset
5 #include "config.h"
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 12337
diff changeset
6 #include "mp_msg.h"
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
7
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
8 #include "img_format.h"
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
9 #include "mp_image.h"
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
10 #include "vf.h"
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
11
17012
6ff3379a0862 Unify include path handling, -I.. is in CFLAGS.
diego
parents: 12337
diff changeset
12 #include "libvo/fastmemcpy.h"
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
13
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
14 struct vf_priv_s {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
15 int skipflag;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
16 };
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
17
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17012
diff changeset
18 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts)
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
19 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
20 mp_image_t *dmpi;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
21
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
22 if (vf->priv->skipflag)
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
23 return vf->priv->skipflag = 0;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
24
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
25 dmpi = vf_get_image(vf->next, mpi->imgfmt,
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
26 MP_IMGTYPE_EXPORT, 0, mpi->width, mpi->height);
21698
009635b12924 Pass quant tables to next filters
gpoirier
parents: 17906
diff changeset
27 vf_clone_mpi_attributes(dmpi, mpi);
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
28
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
29 dmpi->planes[0] = mpi->planes[0];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
30 dmpi->stride[0] = mpi->stride[0];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
31 if (dmpi->flags&MP_IMGFLAG_PLANAR) {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
32 dmpi->planes[1] = mpi->planes[1];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
33 dmpi->stride[1] = mpi->stride[1];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
34 dmpi->planes[2] = mpi->planes[2];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
35 dmpi->stride[2] = mpi->stride[2];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
36 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
37
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17012
diff changeset
38 return vf_next_put_image(vf, dmpi, pts);
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
39 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
40
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
41 static int control(struct vf_instance_s* vf, int request, void* data)
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
42 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
43 switch (request) {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
44 case VFCTRL_SKIP_NEXT_FRAME:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
45 vf->priv->skipflag = 1;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
46 return CONTROL_TRUE;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
47 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
48 return vf_next_control(vf, request, data);
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
49 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
50
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
51 static int query_format(struct vf_instance_s* vf, unsigned int fmt)
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
52 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
53 /* FIXME - figure out which other formats work */
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
54 switch (fmt) {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
55 case IMGFMT_YV12:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
56 case IMGFMT_IYUV:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
57 case IMGFMT_I420:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
58 return vf_next_query_format(vf, fmt);
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
59 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
60 return 0;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
61 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
62
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
63 static void uninit(struct vf_instance_s* vf)
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
64 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
65 free(vf->priv);
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
66 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
67
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
68 static int open(vf_instance_t *vf, char* args)
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
69 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
70 vf->put_image = put_image;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
71 vf->control = control;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
72 vf->uninit = uninit;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
73 vf->priv = calloc(1, sizeof(struct vf_priv_s));
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
74 return 1;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
75 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
76
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
77 vf_info_t vf_info_softskip = {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
78 "soft (post-filter) frame skipping for encoding",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
79 "softskip",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
80 "Rich Felker",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
81 "",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
82 open,
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
83 NULL
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
84 };
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
85
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
86