Mercurial > mplayer.hg
annotate libmpcodecs/vf_delogo.c @ 32714:5248e989612a
Remove libswscale subdirectory.
libswscale has been moved to FFmpeg since some time and only kept in the
MPlayer repository for historical reasons and difficulty in moving code
complete with history between Subversion repositories.
FFmpeg now contains libswscale directly without indirection through an
svn:externals property, so no reason to keep libswscale in MPlayer remains.
author | diego |
---|---|
date | Thu, 20 Jan 2011 09:41:43 +0000 |
parents | 7af3e6f901fd |
children | f18abad8054c |
rev | line source |
---|---|
10809 | 1 /* |
26727 | 2 * Copyright (C) 2002 Jindrich Makovicka <makovick@gmail.com> |
3 * | |
4 * This file is part of MPlayer. | |
5 * | |
6 * MPlayer is free software; you can redistribute it and/or modify | |
7 * it under the terms of the GNU General Public License as published by | |
8 * the Free Software Foundation; either version 2 of the License, or | |
9 * (at your option) any later version. | |
10 * | |
11 * MPlayer is distributed in the hope that it will be useful, | |
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
14 * GNU General Public License for more details. | |
15 * | |
16 * You should have received a copy of the GNU General Public License along | |
17 * with MPlayer; if not, write to the Free Software Foundation, Inc., | |
18 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | |
19 */ | |
10809 | 20 |
21 /* A very simple tv station logo remover */ | |
22 | |
23 #include <stdio.h> | |
24 #include <stdlib.h> | |
25 #include <string.h> | |
26 #include <inttypes.h> | |
27 #include <math.h> | |
28 | |
17012 | 29 #include "mp_msg.h" |
30 #include "cpudetect.h" | |
10809 | 31 #include "img_format.h" |
32 #include "mp_image.h" | |
33 #include "vf.h" | |
17012 | 34 #include "libvo/fastmemcpy.h" |
10809 | 35 |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
36 #include "m_option.h" |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
37 #include "m_struct.h" |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
38 |
10809 | 39 //===========================================================================// |
40 | |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
41 static struct vf_priv_s { |
10809 | 42 unsigned int outfmt; |
43 int xoff, yoff, lw, lh, band, show; | |
22027 | 44 } const vf_priv_dflt = { |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
45 0, |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
46 0, 0, 0, 0, 0, 0 |
10809 | 47 }; |
48 | |
49 #define MIN(a,b) (((a) < (b)) ? (a) : (b)) | |
50 #define MAX(a,b) (((a) > (b)) ? (a) : (b)) | |
51 | |
52 static void delogo(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
53 int logo_x, int logo_y, int logo_w, int logo_h, int band, int show, int direct) { |
10809 | 54 int y, x; |
55 int interp, dist; | |
56 uint8_t *xdst, *xsrc; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29087
diff
changeset
|
57 |
10809 | 58 uint8_t *topleft, *botleft, *topright; |
59 int xclipl, xclipr, yclipt, yclipb; | |
10811 | 60 int logo_x1, logo_x2, logo_y1, logo_y2; |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29087
diff
changeset
|
61 |
10809 | 62 xclipl = MAX(-logo_x, 0); |
63 xclipr = MAX(logo_x+logo_w-width, 0); | |
64 yclipt = MAX(-logo_y, 0); | |
65 yclipb = MAX(logo_y+logo_h-height, 0); | |
66 | |
10811 | 67 logo_x1 = logo_x + xclipl; |
68 logo_x2 = logo_x + logo_w - xclipr; | |
69 logo_y1 = logo_y + yclipt; | |
70 logo_y2 = logo_y + logo_h - yclipb; | |
10809 | 71 |
10811 | 72 topleft = src+logo_y1*srcStride+logo_x1; |
11029 | 73 topright = src+logo_y1*srcStride+logo_x2-1; |
10811 | 74 botleft = src+(logo_y2-1)*srcStride+logo_x1; |
75 | |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
76 if (!direct) memcpy_pic(dst, src, width, height, dstStride, srcStride); |
10811 | 77 |
78 dst += (logo_y1+1)*dstStride; | |
79 src += (logo_y1+1)*srcStride; | |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29087
diff
changeset
|
80 |
10811 | 81 for(y = logo_y1+1; y < logo_y2-1; y++) |
10809 | 82 { |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
83 for (x = logo_x1+1, xdst = dst+logo_x1+1, xsrc = src+logo_x1+1; x < logo_x2-1; x++, xdst++, xsrc++) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
84 interp = ((topleft[srcStride*(y-logo_y-yclipt)] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
85 + topleft[srcStride*(y-logo_y-1-yclipt)] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
86 + topleft[srcStride*(y-logo_y+1-yclipt)])*(logo_w-(x-logo_x))/logo_w |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
87 + (topright[srcStride*(y-logo_y-yclipt)] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
88 + topright[srcStride*(y-logo_y-1-yclipt)] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
89 + topright[srcStride*(y-logo_y+1-yclipt)])*(x-logo_x)/logo_w |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
90 + (topleft[x-logo_x-xclipl] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
91 + topleft[x-logo_x-1-xclipl] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
92 + topleft[x-logo_x+1-xclipl])*(logo_h-(y-logo_y))/logo_h |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
93 + (botleft[x-logo_x-xclipl] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
94 + botleft[x-logo_x-1-xclipl] |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
95 + botleft[x-logo_x+1-xclipl])*(y-logo_y)/logo_h |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
96 )/6; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
97 /* interp = (topleft[srcStride*(y-logo_y)]*(logo_w-(x-logo_x))/logo_w |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
98 + topright[srcStride*(y-logo_y)]*(x-logo_x)/logo_w |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
99 + topleft[x-logo_x]*(logo_h-(y-logo_y))/logo_h |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
100 + botleft[x-logo_x]*(y-logo_y)/logo_h |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
101 )/2;*/ |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
102 if (y >= logo_y+band && y < logo_y+logo_h-band && x >= logo_x+band && x < logo_x+logo_w-band) { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
103 *xdst = interp; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
104 } else { |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
105 dist = 0; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
106 if (x < logo_x+band) dist = MAX(dist, logo_x-x+band); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
107 else if (x >= logo_x+logo_w-band) dist = MAX(dist, x-(logo_x+logo_w-1-band)); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
108 if (y < logo_y+band) dist = MAX(dist, logo_y-y+band); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
109 else if (y >= logo_y+logo_h-band) dist = MAX(dist, y-(logo_y+logo_h-1-band)); |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
110 *xdst = (*xsrc*dist + interp*(band-dist))/band; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
111 if (show && (dist == band-1)) *xdst = 0; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
112 } |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
113 } |
10809 | 114 |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
115 dst+= dstStride; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
116 src+= srcStride; |
10809 | 117 } |
118 } | |
119 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
120 static int config(struct vf_instance *vf, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
121 int width, int height, int d_width, int d_height, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
122 unsigned int flags, unsigned int outfmt){ |
10809 | 123 |
124 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); | |
125 } | |
126 | |
127 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
128 static void get_image(struct vf_instance *vf, mp_image_t *mpi){ |
10809 | 129 if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change |
130 if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ | |
131 // ok, we can do pp in-place (or pp disabled): | |
132 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
133 mpi->type, mpi->flags, mpi->w, mpi->h); |
10809 | 134 mpi->planes[0]=vf->dmpi->planes[0]; |
135 mpi->stride[0]=vf->dmpi->stride[0]; | |
136 mpi->width=vf->dmpi->width; | |
137 if(mpi->flags&MP_IMGFLAG_PLANAR){ | |
138 mpi->planes[1]=vf->dmpi->planes[1]; | |
139 mpi->planes[2]=vf->dmpi->planes[2]; | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
140 mpi->stride[1]=vf->dmpi->stride[1]; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
141 mpi->stride[2]=vf->dmpi->stride[2]; |
10809 | 142 } |
143 mpi->flags|=MP_IMGFLAG_DIRECT; | |
144 } | |
145 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
146 static int put_image(struct vf_instance *vf, mp_image_t *mpi, double pts){ |
10809 | 147 mp_image_t *dmpi; |
148 | |
149 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
150 // no DR, so get a new image! hope we'll get DR buffer: |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
151 vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
152 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
153 mpi->w,mpi->h); |
10809 | 154 } |
155 dmpi= vf->dmpi; | |
156 | |
157 delogo(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
158 vf->priv->xoff, vf->priv->yoff, vf->priv->lw, vf->priv->lh, vf->priv->band, vf->priv->show, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
159 mpi->flags&MP_IMGFLAG_DIRECT); |
10809 | 160 delogo(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
161 vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
162 mpi->flags&MP_IMGFLAG_DIRECT); |
10809 | 163 delogo(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
164 vf->priv->xoff/2, vf->priv->yoff/2, vf->priv->lw/2, vf->priv->lh/2, vf->priv->band/2, vf->priv->show, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
165 mpi->flags&MP_IMGFLAG_DIRECT); |
10809 | 166 |
167 vf_clone_mpi_attributes(dmpi, mpi); | |
168 | |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17367
diff
changeset
|
169 return vf_next_put_image(vf,dmpi, pts); |
10809 | 170 } |
171 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
172 static void uninit(struct vf_instance *vf){ |
10809 | 173 if(!vf->priv) return; |
174 | |
175 free(vf->priv); | |
176 vf->priv=NULL; | |
177 } | |
178 | |
179 //===========================================================================// | |
180 | |
30642
a972c1a4a012
cosmetics: Rename struct vf_instance_s --> vf_instance.
diego
parents:
30638
diff
changeset
|
181 static int query_format(struct vf_instance *vf, unsigned int fmt){ |
10809 | 182 switch(fmt) |
183 { | |
184 case IMGFMT_YV12: | |
185 case IMGFMT_I420: | |
186 case IMGFMT_IYUV: | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
187 return vf_next_query_format(vf,vf->priv->outfmt); |
10809 | 188 } |
189 return 0; | |
190 } | |
191 | |
30708 | 192 static const unsigned int fmt_list[]={ |
10809 | 193 IMGFMT_YV12, |
194 IMGFMT_I420, | |
195 IMGFMT_IYUV, | |
196 0 | |
197 }; | |
198 | |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
29915
diff
changeset
|
199 static int vf_open(vf_instance_t *vf, char *args){ |
10809 | 200 vf->config=config; |
201 vf->put_image=put_image; | |
202 vf->get_image=get_image; | |
203 vf->query_format=query_format; | |
204 vf->uninit=uninit; | |
205 | |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
206 mp_msg(MSGT_VFILTER, MSGL_V, "delogo: %d x %d, %d x %d, band = %d\n", |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
207 vf->priv->xoff, vf->priv->yoff, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
208 vf->priv->lw, vf->priv->lh, |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
209 vf->priv->band); |
10809 | 210 |
211 vf->priv->show = 0; | |
212 | |
213 if (vf->priv->band < 0) { | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
214 vf->priv->band = 4; |
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
215 vf->priv->show = 1; |
10809 | 216 } |
29263
0f1b5b68af32
whitespace cosmetics: Remove all trailing whitespace.
diego
parents:
29087
diff
changeset
|
217 |
10809 | 218 |
219 vf->priv->lw += vf->priv->band*2; | |
220 vf->priv->lh += vf->priv->band*2; | |
221 vf->priv->xoff -= vf->priv->band; | |
222 vf->priv->yoff -= vf->priv->band; | |
223 | |
224 // check csp: | |
225 vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12); | |
226 if(!vf->priv->outfmt) | |
227 { | |
32702
7af3e6f901fd
Convert some tabs to whitespace to allow using MPlayer filter sourcecode in FFmpeg.
cehoyos
parents:
30708
diff
changeset
|
228 uninit(vf); |
10809 | 229 return 0; // no csp match :( |
230 } | |
231 | |
232 return 1; | |
233 } | |
234 | |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
235 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f) |
30707 | 236 static const m_option_t vf_opts_fields[] = { |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
237 { "x", ST_OFF(xoff), CONF_TYPE_INT, 0, 0, 0, NULL }, |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
238 { "y", ST_OFF(yoff), CONF_TYPE_INT, 0, 0, 0, NULL }, |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
239 { "w", ST_OFF(lw), CONF_TYPE_INT, 0, 0, 0, NULL }, |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
240 { "h", ST_OFF(lh), CONF_TYPE_INT, 0, 0, 0, NULL }, |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
241 { "t", ST_OFF(band), CONF_TYPE_INT, 0, 0, 0, NULL }, |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
242 { "band", ST_OFF(band), CONF_TYPE_INT, 0, 0, 0, NULL }, // alias |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
243 { NULL, NULL, 0, 0, 0, 0, NULL } |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
244 }; |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
245 |
30707 | 246 static const m_struct_t vf_opts = { |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
247 "delogo", |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
248 sizeof(struct vf_priv_s), |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
249 &vf_priv_dflt, |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
250 vf_opts_fields |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
251 }; |
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
252 |
25221 | 253 const vf_info_t vf_info_delogo = { |
10809 | 254 "simple logo remover", |
255 "delogo", | |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
256 "Jindrich Makovicka, Alex Beregszaszi", |
10809 | 257 "", |
30638
a7b908875c14
Rename open() vf initialization function to vf_open().
diego
parents:
29915
diff
changeset
|
258 vf_open, |
10816
e9dc9b0b16fa
added new config system support and fixed some bugs (altought sanity checks are needed in delogo as it segfaults easily with w/h out of range)
alex
parents:
10811
diff
changeset
|
259 &vf_opts |
10809 | 260 }; |
261 | |
262 //===========================================================================// |