annotate libmpcodecs/vf_softskip.c @ 24212:87c196d3755f

Remove unnecessary fastmemcpybench prerequisite.
author diego
date Mon, 27 Aug 2007 10:51:48 +0000
parents f8d4f8eff72b
children 8a6f80593529
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
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
12 struct vf_priv_s {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
13 int skipflag;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
14 };
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
15
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17012
diff changeset
16 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
17 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
18 mp_image_t *dmpi;
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 if (vf->priv->skipflag)
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
21 return vf->priv->skipflag = 0;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
22
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
23 dmpi = vf_get_image(vf->next, mpi->imgfmt,
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
24 MP_IMGTYPE_EXPORT, 0, mpi->width, mpi->height);
21698
009635b12924 Pass quant tables to next filters
gpoirier
parents: 17906
diff changeset
25 vf_clone_mpi_attributes(dmpi, mpi);
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
26
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
27 dmpi->planes[0] = mpi->planes[0];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
28 dmpi->stride[0] = mpi->stride[0];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
29 if (dmpi->flags&MP_IMGFLAG_PLANAR) {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
30 dmpi->planes[1] = mpi->planes[1];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
31 dmpi->stride[1] = mpi->stride[1];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
32 dmpi->planes[2] = mpi->planes[2];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
33 dmpi->stride[2] = mpi->stride[2];
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
34 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
35
17906
20aca9baf5d8 passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents: 17012
diff changeset
36 return vf_next_put_image(vf, dmpi, pts);
12337
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
37 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
38
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
39 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
40 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
41 switch (request) {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
42 case VFCTRL_SKIP_NEXT_FRAME:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
43 vf->priv->skipflag = 1;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
44 return CONTROL_TRUE;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
45 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
46 return vf_next_control(vf, request, data);
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
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
49 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
50 {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
51 /* FIXME - figure out which other formats work */
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
52 switch (fmt) {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
53 case IMGFMT_YV12:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
54 case IMGFMT_IYUV:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
55 case IMGFMT_I420:
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
56 return vf_next_query_format(vf, fmt);
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
57 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
58 return 0;
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
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
61 static void uninit(struct vf_instance_s* vf)
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 free(vf->priv);
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
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
66 static int open(vf_instance_t *vf, char* args)
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 vf->put_image = put_image;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
69 vf->control = control;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
70 vf->uninit = uninit;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
71 vf->priv = calloc(1, sizeof(struct vf_priv_s));
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
72 return 1;
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
73 }
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
74
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
75 vf_info_t vf_info_softskip = {
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
76 "soft (post-filter) frame skipping for encoding",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
77 "softskip",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
78 "Rich Felker",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
79 "",
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
80 open,
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
81 NULL
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
82 };
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
83
6f1b4c989914 soft skipping for mencoder. rather than skipping decoding/filtering
rfelker
parents:
diff changeset
84