Mercurial > mplayer.hg
annotate libmpcodecs/vf_noise.c @ 6621:dfb11bf64ea6
delay=0 removed, totally unneeded
author | arpi |
---|---|
date | Tue, 02 Jul 2002 20:29:27 +0000 |
parents | e10e3264c19c |
children | ba721168ed24 |
rev | line source |
---|---|
6424 | 1 /* |
2 Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at> | |
3 | |
4 This program is free software; you can redistribute it and/or modify | |
5 it under the terms of the GNU General Public License as published by | |
6 the Free Software Foundation; either version 2 of the License, or | |
7 (at your option) any later version. | |
8 | |
9 This program is distributed in the hope that it will be useful, | |
10 but WITHOUT ANY WARRANTY; without even the implied warranty of | |
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
12 GNU General Public License for more details. | |
13 | |
14 You should have received a copy of the GNU General Public License | |
15 along with this program; if not, write to the Free Software | |
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | |
17 */ | |
18 | |
19 #include <stdio.h> | |
20 #include <stdlib.h> | |
21 #include <string.h> | |
22 #include <inttypes.h> | |
23 #include <math.h> | |
24 | |
25 #include "../config.h" | |
26 #include "../mp_msg.h" | |
27 #include "../cpudetect.h" | |
28 | |
29 #ifdef HAVE_MALLOC_H | |
30 #include <malloc.h> | |
31 #endif | |
32 | |
33 #include "img_format.h" | |
34 #include "mp_image.h" | |
35 #include "vf.h" | |
36 #include "../libvo/fastmemcpy.h" | |
37 | |
38 #define MAX_NOISE 4096 | |
39 #define MAX_SHIFT 1024 | |
40 #define MAX_RES (MAX_NOISE-MAX_SHIFT) | |
41 | |
42 //===========================================================================// | |
43 | |
44 static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift); | |
45 | |
46 static void (*lineNoise)(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift)= lineNoise_C; | |
47 | |
48 typedef struct FilterParam{ | |
49 int strength; | |
50 int uniform; | |
51 int temporal; | |
6448 | 52 int quality; |
6424 | 53 int8_t *noise; |
54 }FilterParam; | |
55 | |
56 struct vf_priv_s { | |
57 FilterParam lumaParam; | |
58 FilterParam chromaParam; | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
59 mp_image_t *dmpi; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
60 unsigned int outfmt; |
6424 | 61 }; |
62 | |
63 static int nonTempRandShift[MAX_RES]= {-1}; | |
64 | |
65 static int8_t *initNoise(FilterParam *fp){ | |
66 int strength= fp->strength; | |
67 int uniform= fp->uniform; | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
68 int8_t *noise= memalign(16, MAX_NOISE*sizeof(int8_t)); |
6424 | 69 int i; |
70 | |
71 srand(123457); | |
72 | |
73 for(i=0; i<MAX_NOISE; i++) | |
74 { | |
75 if(uniform) | |
76 noise[i]= ((rand()/11)%strength) - strength/2; | |
77 else | |
78 { | |
79 double x1, x2, w, y1; | |
80 do { | |
81 x1 = 2.0 * rand()/(float)RAND_MAX - 1.0; | |
82 x2 = 2.0 * rand()/(float)RAND_MAX - 1.0; | |
83 w = x1 * x1 + x2 * x2; | |
84 } while ( w >= 1.0 ); | |
85 | |
86 w = sqrt( (-2.0 * log( w ) ) / w ); | |
87 y1= x1 * w; | |
88 | |
89 y1*= strength / sqrt(3.0); | |
90 if (y1<-128) y1=-128; | |
91 else if(y1> 127) y1= 127; | |
92 noise[i]= (int)y1; | |
93 } | |
94 } | |
95 | |
96 if(nonTempRandShift[0]==-1){ | |
97 for(i=0; i<MAX_RES; i++){ | |
98 nonTempRandShift[i]= rand()&(MAX_SHIFT-1); | |
99 } | |
100 } | |
101 | |
102 fp->noise= noise; | |
103 return noise; | |
104 } | |
105 | |
106 #ifdef HAVE_MMX | |
107 static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){ | |
108 int mmx_len= len&(~7); | |
109 noise+=shift; | |
110 | |
111 asm volatile( | |
112 "movl %3, %%eax \n\t" | |
113 "pcmpeqb %%mm7, %%mm7 \n\t" | |
114 "psllw $15, %%mm7 \n\t" | |
115 "packsswb %%mm7, %%mm7 \n\t" | |
116 ".balign 16 \n\t" | |
117 "1: \n\t" | |
118 "movq (%0, %%eax), %%mm0 \n\t" | |
119 "movq (%1, %%eax), %%mm1 \n\t" | |
120 "pxor %%mm7, %%mm0 \n\t" | |
121 "paddsb %%mm1, %%mm0 \n\t" | |
122 "pxor %%mm7, %%mm0 \n\t" | |
123 "movq %%mm0, (%2, %%eax) \n\t" | |
124 "addl $8, %%eax \n\t" | |
125 " js 1b \n\t" | |
126 :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len) | |
127 : "%eax" | |
128 ); | |
129 if(mmx_len!=len) | |
130 lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0); | |
131 } | |
132 #endif | |
133 | |
134 //duplicate of previous except movntq | |
135 #ifdef HAVE_MMX2 | |
136 static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){ | |
137 int mmx_len= len&(~7); | |
138 noise+=shift; | |
139 | |
140 asm volatile( | |
141 "movl %3, %%eax \n\t" | |
142 "pcmpeqb %%mm7, %%mm7 \n\t" | |
143 "psllw $15, %%mm7 \n\t" | |
144 "packsswb %%mm7, %%mm7 \n\t" | |
145 ".balign 16 \n\t" | |
146 "1: \n\t" | |
147 "movq (%0, %%eax), %%mm0 \n\t" | |
148 "movq (%1, %%eax), %%mm1 \n\t" | |
149 "pxor %%mm7, %%mm0 \n\t" | |
150 "paddsb %%mm1, %%mm0 \n\t" | |
151 "pxor %%mm7, %%mm0 \n\t" | |
152 "movntq %%mm0, (%2, %%eax) \n\t" | |
153 "addl $8, %%eax \n\t" | |
154 " js 1b \n\t" | |
155 :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len) | |
156 : "%eax" | |
157 ); | |
158 if(mmx_len!=len) | |
159 lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0); | |
160 } | |
161 #endif | |
162 | |
163 static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){ | |
164 int i; | |
165 noise+= shift; | |
166 for(i=0; i<len; i++) | |
167 { | |
168 int v= src[i]+ noise[i]; | |
169 if(v>255) dst[i]=255; //FIXME optimize | |
170 else if(v<0) dst[i]=0; | |
171 else dst[i]=v; | |
172 } | |
173 } | |
174 | |
175 static void noise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, FilterParam *fp){ | |
176 int8_t *noise= fp->noise; | |
177 int y; | |
178 int shift=0; | |
179 | |
180 if(!noise) | |
181 { | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
182 if(src==dst) return; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
183 |
6424 | 184 if(dstStride==srcStride) memcpy(dst, src, srcStride*height); |
185 else | |
186 { | |
187 for(y=0; y<height; y++) | |
188 { | |
189 memcpy(dst, src, width); | |
190 dst+= dstStride; | |
6448 | 191 src+= srcStride; |
6424 | 192 } |
193 } | |
194 return; | |
195 } | |
196 | |
197 for(y=0; y<height; y++) | |
198 { | |
199 if(fp->temporal) shift= rand()&(MAX_SHIFT -1); | |
200 else shift= nonTempRandShift[y]; | |
201 | |
6448 | 202 if(fp->quality==0) shift&= ~7; |
6424 | 203 lineNoise(dst, src, noise, width, shift); |
204 dst+= dstStride; | |
205 src+= srcStride; | |
206 } | |
207 } | |
208 | |
209 static int config(struct vf_instance_s* vf, | |
210 int width, int height, int d_width, int d_height, | |
211 unsigned int flags, unsigned int outfmt){ | |
6448 | 212 |
6424 | 213 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); |
214 } | |
215 | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
216 static void get_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
217 if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
218 if(!(mpi->flags&MP_IMGFLAG_ACCEPT_STRIDE) && mpi->imgfmt!=vf->priv->outfmt) |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
219 return; // colorspace differ |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
220 // ok, we can do pp in-place (or pp disabled): |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
221 vf->priv->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
222 mpi->type, mpi->flags, mpi->w, mpi->h); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
223 mpi->planes[0]=vf->priv->dmpi->planes[0]; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
224 mpi->stride[0]=vf->priv->dmpi->stride[0]; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
225 mpi->width=vf->priv->dmpi->width; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
226 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
227 mpi->planes[1]=vf->priv->dmpi->planes[1]; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
228 mpi->planes[2]=vf->priv->dmpi->planes[2]; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
229 mpi->stride[1]=vf->priv->dmpi->stride[1]; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
230 mpi->stride[2]=vf->priv->dmpi->stride[2]; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
231 } |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
232 mpi->flags|=MP_IMGFLAG_DIRECT; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
233 } |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
234 |
6424 | 235 static void put_image(struct vf_instance_s* vf, mp_image_t *mpi){ |
236 mp_image_t *dmpi; | |
237 | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
238 if(!(mpi->flags&MP_IMGFLAG_DIRECT)){ |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
239 // no DR, so get a new image! hope we'll get DR buffer: |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
240 vf->priv->dmpi=vf_get_image(vf->next,vf->priv->outfmt, |
6424 | 241 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE, |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
242 mpi->w,mpi->h); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
243 //printf("nodr\n"); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
244 } |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
245 //else printf("dr\n"); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
246 dmpi= vf->priv->dmpi; |
6424 | 247 |
248 noise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam); | |
249 noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam); | |
250 noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam); | |
251 | |
252 dmpi->qscale=mpi->qscale; | |
253 dmpi->qstride=mpi->qstride; | |
254 | |
255 #ifdef HAVE_MMX | |
256 if(gCpuCaps.hasMMX) asm volatile ("emms\n\t"); | |
257 #endif | |
258 #ifdef HAVE_MMX2 | |
259 if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t"); | |
260 #endif | |
261 | |
262 vf_next_put_image(vf,dmpi); | |
263 } | |
264 | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
265 static void uninit(struct vf_instance_s* vf){ |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
266 if(!vf->priv) return; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
267 |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
268 if(vf->priv->chromaParam.noise) free(vf->priv->chromaParam.noise); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
269 vf->priv->chromaParam.noise= NULL; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
270 |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
271 if(vf->priv->lumaParam.noise) free(vf->priv->lumaParam.noise); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
272 vf->priv->lumaParam.noise= NULL; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
273 |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
274 free(vf->priv); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
275 vf->priv=NULL; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
276 } |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
277 |
6424 | 278 //===========================================================================// |
279 | |
280 static int query_format(struct vf_instance_s* vf, unsigned int fmt){ | |
281 switch(fmt) | |
282 { | |
283 case IMGFMT_YV12: | |
284 case IMGFMT_I420: | |
285 case IMGFMT_IYUV: | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
286 return vf_next_query_format(vf,vf->priv->outfmt); |
6424 | 287 } |
288 return 0; | |
289 } | |
290 | |
291 static void parse(FilterParam *fp, char* args){ | |
292 char *pos; | |
293 char *max= strchr(args, ':'); | |
294 | |
295 if(!max) max= args + strlen(args); | |
296 | |
297 fp->strength= atoi(args); | |
298 pos= strchr(args, 'u'); | |
299 if(pos && pos<max) fp->uniform=1; | |
300 pos= strchr(args, 't'); | |
301 if(pos && pos<max) fp->temporal=1; | |
6448 | 302 pos= strchr(args, 'h'); |
303 if(pos && pos<max) fp->quality=1; | |
6424 | 304 |
305 if(fp->strength) initNoise(fp); | |
306 } | |
307 | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
308 static unsigned int fmt_list[]={ |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
309 IMGFMT_YV12, |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
310 IMGFMT_I420, |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
311 IMGFMT_IYUV, |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
312 0 |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
313 }; |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
314 |
6424 | 315 static int open(vf_instance_t *vf, char* args){ |
316 vf->config=config; | |
317 vf->put_image=put_image; | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
318 vf->get_image=get_image; |
6424 | 319 vf->query_format=query_format; |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
320 vf->uninit=uninit; |
6424 | 321 vf->priv=malloc(sizeof(struct vf_priv_s)); |
322 memset(vf->priv, 0, sizeof(struct vf_priv_s)); | |
323 if(args) | |
324 { | |
325 char *arg2= strchr(args,':'); | |
326 if(arg2) parse(&vf->priv->chromaParam, arg2+1); | |
327 parse(&vf->priv->lumaParam, args); | |
328 } | |
6447
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
329 |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
330 // check csp: |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
331 vf->priv->outfmt=vf_match_csp(&vf->next,fmt_list,IMGFMT_YV12); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
332 if(!vf->priv->outfmt) |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
333 { |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
334 uninit(vf); |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
335 return 0; // no csp match :( |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
336 } |
751a5775ac35
direct rendering (hopefully at least, TFM for the video filters is a bit nonexistent or iam just too stupid) ;)
michael
parents:
6424
diff
changeset
|
337 |
6424 | 338 |
339 #ifdef HAVE_MMX | |
340 if(gCpuCaps.hasMMX) lineNoise= lineNoise_MMX; | |
341 #endif | |
342 #ifdef HAVE_MMX2 | |
343 if(gCpuCaps.hasMMX2) lineNoise= lineNoise_MMX2; | |
344 #endif | |
345 | |
346 return 1; | |
347 } | |
348 | |
349 vf_info_t vf_info_noise = { | |
350 "noise genenerator", | |
351 "noise", | |
352 "Michael Niedermayer", | |
353 "", | |
354 open | |
355 }; | |
356 | |
357 //===========================================================================// |