Mercurial > mplayer.hg
annotate libmpcodecs/vf_noise.c @ 25861:5442946cade2
Fix illegal identifiers, names starting with __ are reserved for the system.
author | diego |
---|---|
date | Sun, 27 Jan 2008 18:01:19 +0000 |
parents | 00fff9a3b735 |
children | 82601a38e2a7 |
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 | |
17367
401b440a6d76
Update licensing information: The FSF changed postal address.
diego
parents:
17012
diff
changeset
|
16 Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA |
6424 | 17 */ |
18 | |
19 #include <stdio.h> | |
20 #include <stdlib.h> | |
21 #include <string.h> | |
22 #include <inttypes.h> | |
23 #include <math.h> | |
24 | |
17012 | 25 #include "config.h" |
26 #include "mp_msg.h" | |
27 #include "cpudetect.h" | |
6424 | 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" | |
17012 | 36 #include "libvo/fastmemcpy.h" |
6424 | 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); | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
45 static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift); |
6424 | 46 |
47 static void (*lineNoise)(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift)= lineNoise_C; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
48 static void (*lineNoiseAvg)(uint8_t *dst, uint8_t *src, int len, int8_t **shift)= lineNoiseAvg_C; |
6424 | 49 |
50 typedef struct FilterParam{ | |
51 int strength; | |
52 int uniform; | |
53 int temporal; | |
6448 | 54 int quality; |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
55 int averaged; |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
56 int pattern; |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
57 int shiftptr; |
6424 | 58 int8_t *noise; |
6964 | 59 int8_t *prev_shift[MAX_RES][3]; |
6424 | 60 }FilterParam; |
61 | |
62 struct vf_priv_s { | |
63 FilterParam lumaParam; | |
64 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
|
65 unsigned int outfmt; |
6424 | 66 }; |
67 | |
18030
ec68026bc1d0
move 12k from data to bss (reduce binary size by 12k)
rfelker
parents:
17906
diff
changeset
|
68 static int nonTempRandShift_init; |
ec68026bc1d0
move 12k from data to bss (reduce binary size by 12k)
rfelker
parents:
17906
diff
changeset
|
69 static int nonTempRandShift[MAX_RES]; |
6424 | 70 |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
71 static int patt[4] = { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
72 -1,0,1,0 |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
73 }; |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
74 |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
75 #define RAND_N(range) ((int) ((double)range*rand()/(RAND_MAX+1.0))) |
6424 | 76 static int8_t *initNoise(FilterParam *fp){ |
77 int strength= fp->strength; | |
78 int uniform= fp->uniform; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
79 int averaged= fp->averaged; |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
80 int pattern= fp->pattern; |
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
|
81 int8_t *noise= memalign(16, MAX_NOISE*sizeof(int8_t)); |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
82 int i, j; |
6424 | 83 |
84 srand(123457); | |
85 | |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
86 for(i=0,j=0; i<MAX_NOISE; i++,j++) |
6424 | 87 { |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
88 if(uniform) { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
89 if (averaged) { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
90 if (pattern) { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
91 noise[i]= (RAND_N(strength) - strength/2)/6 |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
92 +patt[j%4]*strength*0.25/3; |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
93 } else { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
94 noise[i]= (RAND_N(strength) - strength/2)/3; |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
95 } |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
96 } else { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
97 if (pattern) { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
98 noise[i]= (RAND_N(strength) - strength/2)/2 |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
99 + patt[j%4]*strength*0.25; |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
100 } else { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
101 noise[i]= RAND_N(strength) - strength/2; |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
102 } |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
103 } |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
104 } else { |
6424 | 105 double x1, x2, w, y1; |
106 do { | |
107 x1 = 2.0 * rand()/(float)RAND_MAX - 1.0; | |
108 x2 = 2.0 * rand()/(float)RAND_MAX - 1.0; | |
109 w = x1 * x1 + x2 * x2; | |
110 } while ( w >= 1.0 ); | |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
111 |
6424 | 112 w = sqrt( (-2.0 * log( w ) ) / w ); |
113 y1= x1 * w; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
114 y1*= strength / sqrt(3.0); |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
115 if (pattern) { |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
116 y1 /= 2; |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
117 y1 += patt[j%4]*strength*0.35; |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
118 } |
6424 | 119 if (y1<-128) y1=-128; |
120 else if(y1> 127) y1= 127; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
121 if (averaged) y1 /= 3.0; |
6424 | 122 noise[i]= (int)y1; |
123 } | |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
124 if (RAND_N(6) == 0) j--; |
6424 | 125 } |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
126 |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
127 |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
128 for (i = 0; i < MAX_RES; i++) |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
129 for (j = 0; j < 3; j++) |
6964 | 130 fp->prev_shift[i][j] = noise + (rand()&(MAX_SHIFT-1)); |
6424 | 131 |
18030
ec68026bc1d0
move 12k from data to bss (reduce binary size by 12k)
rfelker
parents:
17906
diff
changeset
|
132 if(!nonTempRandShift_init){ |
6424 | 133 for(i=0; i<MAX_RES; i++){ |
134 nonTempRandShift[i]= rand()&(MAX_SHIFT-1); | |
135 } | |
18030
ec68026bc1d0
move 12k from data to bss (reduce binary size by 12k)
rfelker
parents:
17906
diff
changeset
|
136 nonTempRandShift_init = 1; |
6424 | 137 } |
138 | |
139 fp->noise= noise; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
140 fp->shiftptr= 0; |
6424 | 141 return noise; |
142 } | |
143 | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
144 /***************************************************************************/ |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
145 |
6424 | 146 #ifdef HAVE_MMX |
147 static inline void lineNoise_MMX(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){ | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
148 long mmx_len= len&(~7); |
6424 | 149 noise+=shift; |
150 | |
151 asm volatile( | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
152 "mov %3, %%"REG_a" \n\t" |
6424 | 153 "pcmpeqb %%mm7, %%mm7 \n\t" |
154 "psllw $15, %%mm7 \n\t" | |
155 "packsswb %%mm7, %%mm7 \n\t" | |
19372
6334c14b38eb
Replace asmalign.h hack by ASMALIGN cpp macros from config.h.
diego
parents:
18684
diff
changeset
|
156 ASMALIGN(4) |
6424 | 157 "1: \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
158 "movq (%0, %%"REG_a"), %%mm0 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
159 "movq (%1, %%"REG_a"), %%mm1 \n\t" |
6424 | 160 "pxor %%mm7, %%mm0 \n\t" |
161 "paddsb %%mm1, %%mm0 \n\t" | |
162 "pxor %%mm7, %%mm0 \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
163 "movq %%mm0, (%2, %%"REG_a") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
164 "add $8, %%"REG_a" \n\t" |
6424 | 165 " js 1b \n\t" |
166 :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len) | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
167 : "%"REG_a |
6424 | 168 ); |
169 if(mmx_len!=len) | |
170 lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0); | |
171 } | |
172 #endif | |
173 | |
174 //duplicate of previous except movntq | |
175 #ifdef HAVE_MMX2 | |
176 static inline void lineNoise_MMX2(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){ | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
177 long mmx_len= len&(~7); |
6424 | 178 noise+=shift; |
179 | |
180 asm volatile( | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
181 "mov %3, %%"REG_a" \n\t" |
6424 | 182 "pcmpeqb %%mm7, %%mm7 \n\t" |
183 "psllw $15, %%mm7 \n\t" | |
184 "packsswb %%mm7, %%mm7 \n\t" | |
19372
6334c14b38eb
Replace asmalign.h hack by ASMALIGN cpp macros from config.h.
diego
parents:
18684
diff
changeset
|
185 ASMALIGN(4) |
6424 | 186 "1: \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
187 "movq (%0, %%"REG_a"), %%mm0 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
188 "movq (%1, %%"REG_a"), %%mm1 \n\t" |
6424 | 189 "pxor %%mm7, %%mm0 \n\t" |
190 "paddsb %%mm1, %%mm0 \n\t" | |
191 "pxor %%mm7, %%mm0 \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
192 "movntq %%mm0, (%2, %%"REG_a") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
193 "add $8, %%"REG_a" \n\t" |
6424 | 194 " js 1b \n\t" |
195 :: "r" (src+mmx_len), "r" (noise+mmx_len), "r" (dst+mmx_len), "g" (-mmx_len) | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
196 : "%"REG_a |
6424 | 197 ); |
198 if(mmx_len!=len) | |
199 lineNoise_C(dst+mmx_len, src+mmx_len, noise+mmx_len, len-mmx_len, 0); | |
200 } | |
201 #endif | |
202 | |
203 static inline void lineNoise_C(uint8_t *dst, uint8_t *src, int8_t *noise, int len, int shift){ | |
204 int i; | |
205 noise+= shift; | |
206 for(i=0; i<len; i++) | |
207 { | |
208 int v= src[i]+ noise[i]; | |
209 if(v>255) dst[i]=255; //FIXME optimize | |
210 else if(v<0) dst[i]=0; | |
211 else dst[i]=v; | |
212 } | |
213 } | |
214 | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
215 /***************************************************************************/ |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
216 |
6966 | 217 #ifdef HAVE_MMX |
218 static inline void lineNoiseAvg_MMX(uint8_t *dst, uint8_t *src, int len, int8_t **shift){ | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
219 long mmx_len= len&(~7); |
6966 | 220 |
221 asm volatile( | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
222 "mov %5, %%"REG_a" \n\t" |
19372
6334c14b38eb
Replace asmalign.h hack by ASMALIGN cpp macros from config.h.
diego
parents:
18684
diff
changeset
|
223 ASMALIGN(4) |
6966 | 224 "1: \n\t" |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
225 "movq (%1, %%"REG_a"), %%mm1 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
226 "movq (%0, %%"REG_a"), %%mm0 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
227 "paddb (%2, %%"REG_a"), %%mm1 \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
228 "paddb (%3, %%"REG_a"), %%mm1 \n\t" |
6966 | 229 "movq %%mm0, %%mm2 \n\t" |
230 "movq %%mm1, %%mm3 \n\t" | |
231 "punpcklbw %%mm0, %%mm0 \n\t" | |
232 "punpckhbw %%mm2, %%mm2 \n\t" | |
233 "punpcklbw %%mm1, %%mm1 \n\t" | |
234 "punpckhbw %%mm3, %%mm3 \n\t" | |
235 "pmulhw %%mm0, %%mm1 \n\t" | |
236 "pmulhw %%mm2, %%mm3 \n\t" | |
237 "paddw %%mm1, %%mm1 \n\t" | |
238 "paddw %%mm3, %%mm3 \n\t" | |
239 "paddw %%mm0, %%mm1 \n\t" | |
240 "paddw %%mm2, %%mm3 \n\t" | |
241 "psrlw $8, %%mm1 \n\t" | |
242 "psrlw $8, %%mm3 \n\t" | |
243 "packuswb %%mm3, %%mm1 \n\t" | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
244 "movq %%mm1, (%4, %%"REG_a") \n\t" |
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
245 "add $8, %%"REG_a" \n\t" |
6966 | 246 " js 1b \n\t" |
247 :: "r" (src+mmx_len), "r" (shift[0]+mmx_len), "r" (shift[1]+mmx_len), "r" (shift[2]+mmx_len), | |
248 "r" (dst+mmx_len), "g" (-mmx_len) | |
13720
821f464b4d90
adapting existing mmx/mmx2/sse/3dnow optimizations so they work on x86_64
aurel
parents:
10141
diff
changeset
|
249 : "%"REG_a |
6966 | 250 ); |
251 | |
252 if(mmx_len!=len){ | |
253 int8_t *shift2[3]={shift[0]+mmx_len, shift[1]+mmx_len, shift[2]+mmx_len}; | |
254 lineNoiseAvg_C(dst+mmx_len, src+mmx_len, len-mmx_len, shift2); | |
255 } | |
256 } | |
257 #endif | |
258 | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
259 static inline void lineNoiseAvg_C(uint8_t *dst, uint8_t *src, int len, int8_t **shift){ |
6965 | 260 int i; |
261 int8_t *src2= (int8_t*)src; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
262 |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
263 for(i=0; i<len; i++) |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
264 { |
6965 | 265 const int n= shift[0][i] + shift[1][i] + shift[2][i]; |
266 dst[i]= src2[i]+((n*src2[i])>>7); | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
267 } |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
268 } |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
269 |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
270 /***************************************************************************/ |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
271 |
6424 | 272 static void noise(uint8_t *dst, uint8_t *src, int dstStride, int srcStride, int width, int height, FilterParam *fp){ |
273 int8_t *noise= fp->noise; | |
274 int y; | |
275 int shift=0; | |
276 | |
277 if(!noise) | |
278 { | |
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
|
279 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
|
280 |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
19372
diff
changeset
|
281 if(dstStride==srcStride) fast_memcpy(dst, src, srcStride*height); |
6424 | 282 else |
283 { | |
284 for(y=0; y<height; y++) | |
285 { | |
23457
a124f3abc1ec
Replace implicit use of fast_memcpy via macro by explicit use to allow
reimar
parents:
19372
diff
changeset
|
286 fast_memcpy(dst, src, width); |
6424 | 287 dst+= dstStride; |
6448 | 288 src+= srcStride; |
6424 | 289 } |
290 } | |
291 return; | |
292 } | |
293 | |
294 for(y=0; y<height; y++) | |
295 { | |
296 if(fp->temporal) shift= rand()&(MAX_SHIFT -1); | |
297 else shift= nonTempRandShift[y]; | |
298 | |
6448 | 299 if(fp->quality==0) shift&= ~7; |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
300 if (fp->averaged) { |
6964 | 301 lineNoiseAvg(dst, src, width, fp->prev_shift[y]); |
302 fp->prev_shift[y][fp->shiftptr] = noise + shift; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
303 } else { |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
304 lineNoise(dst, src, noise, width, shift); |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
305 } |
6424 | 306 dst+= dstStride; |
307 src+= srcStride; | |
308 } | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
309 fp->shiftptr++; |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
310 if (fp->shiftptr == 3) fp->shiftptr = 0; |
6424 | 311 } |
312 | |
313 static int config(struct vf_instance_s* vf, | |
314 int width, int height, int d_width, int d_height, | |
315 unsigned int flags, unsigned int outfmt){ | |
6448 | 316 |
6424 | 317 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt); |
318 } | |
319 | |
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 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
|
321 if(mpi->flags&MP_IMGFLAG_PRESERVE) return; // don't change |
6962 | 322 if(mpi->imgfmt!=vf->priv->outfmt) return; // colorspace differ |
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
|
323 // ok, we can do pp in-place (or pp disabled): |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
324 vf->dmpi=vf_get_image(vf->next,mpi->imgfmt, |
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
|
325 mpi->type, mpi->flags, mpi->w, mpi->h); |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
326 mpi->planes[0]=vf->dmpi->planes[0]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
327 mpi->stride[0]=vf->dmpi->stride[0]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
328 mpi->width=vf->dmpi->width; |
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 if(mpi->flags&MP_IMGFLAG_PLANAR){ |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
330 mpi->planes[1]=vf->dmpi->planes[1]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
331 mpi->planes[2]=vf->dmpi->planes[2]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
332 mpi->stride[1]=vf->dmpi->stride[1]; |
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
333 mpi->stride[2]=vf->dmpi->stride[2]; |
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
|
334 } |
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 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
|
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 |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17367
diff
changeset
|
338 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi, double pts){ |
6424 | 339 mp_image_t *dmpi; |
340 | |
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
|
341 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
|
342 // no DR, so get a new image! hope we'll get DR buffer: |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
343 vf->dmpi=vf_get_image(vf->next,vf->priv->outfmt, |
6424 | 344 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
|
345 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
|
346 //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
|
347 } |
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
|
348 //else printf("dr\n"); |
10141
7d6a854a5fe5
cleanup, use vf->dmpi rather than vf->priv->dmpi for consistency
rfelker
parents:
9934
diff
changeset
|
349 dmpi= vf->dmpi; |
6424 | 350 |
351 noise(dmpi->planes[0], mpi->planes[0], dmpi->stride[0], mpi->stride[0], mpi->w, mpi->h, &vf->priv->lumaParam); | |
352 noise(dmpi->planes[1], mpi->planes[1], dmpi->stride[1], mpi->stride[1], mpi->w/2, mpi->h/2, &vf->priv->chromaParam); | |
353 noise(dmpi->planes[2], mpi->planes[2], dmpi->stride[2], mpi->stride[2], mpi->w/2, mpi->h/2, &vf->priv->chromaParam); | |
354 | |
9934 | 355 vf_clone_mpi_attributes(dmpi, mpi); |
6424 | 356 |
357 #ifdef HAVE_MMX | |
358 if(gCpuCaps.hasMMX) asm volatile ("emms\n\t"); | |
359 #endif | |
360 #ifdef HAVE_MMX2 | |
361 if(gCpuCaps.hasMMX2) asm volatile ("sfence\n\t"); | |
362 #endif | |
363 | |
17906
20aca9baf5d8
passing pts through the filter layer (lets see if pts or cola comes out at the end)
michael
parents:
17367
diff
changeset
|
364 return vf_next_put_image(vf,dmpi, pts); |
6424 | 365 } |
366 | |
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
|
367 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
|
368 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
|
369 |
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
|
370 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
|
371 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
|
372 |
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
|
373 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
|
374 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
|
375 |
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
|
376 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
|
377 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
|
378 } |
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
|
379 |
6424 | 380 //===========================================================================// |
381 | |
382 static int query_format(struct vf_instance_s* vf, unsigned int fmt){ | |
383 switch(fmt) | |
384 { | |
385 case IMGFMT_YV12: | |
386 case IMGFMT_I420: | |
387 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
|
388 return vf_next_query_format(vf,vf->priv->outfmt); |
6424 | 389 } |
390 return 0; | |
391 } | |
392 | |
393 static void parse(FilterParam *fp, char* args){ | |
394 char *pos; | |
395 char *max= strchr(args, ':'); | |
396 | |
397 if(!max) max= args + strlen(args); | |
398 | |
399 fp->strength= atoi(args); | |
400 pos= strchr(args, 'u'); | |
401 if(pos && pos<max) fp->uniform=1; | |
402 pos= strchr(args, 't'); | |
403 if(pos && pos<max) fp->temporal=1; | |
6448 | 404 pos= strchr(args, 'h'); |
405 if(pos && pos<max) fp->quality=1; | |
6990
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
406 pos= strchr(args, 'p'); |
857bae3001e8
semi regular noise pattern patch by (Jindrich Makovicka <makovick at kmlinux dot fjfi dot cvut dot cz>)
michael
parents:
6966
diff
changeset
|
407 if(pos && pos<max) fp->pattern=1; |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
408 pos= strchr(args, 'a'); |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
409 if(pos && pos<max) { |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
410 fp->temporal=1; |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
411 fp->averaged=1; |
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
412 } |
6424 | 413 |
414 if(fp->strength) initNoise(fp); | |
415 } | |
416 | |
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
|
417 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
|
418 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
|
419 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
|
420 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
|
421 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
|
422 }; |
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
|
423 |
6424 | 424 static int open(vf_instance_t *vf, char* args){ |
425 vf->config=config; | |
426 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
|
427 vf->get_image=get_image; |
6424 | 428 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
|
429 vf->uninit=uninit; |
6424 | 430 vf->priv=malloc(sizeof(struct vf_priv_s)); |
431 memset(vf->priv, 0, sizeof(struct vf_priv_s)); | |
432 if(args) | |
433 { | |
434 char *arg2= strchr(args,':'); | |
435 if(arg2) parse(&vf->priv->chromaParam, arg2+1); | |
436 parse(&vf->priv->lumaParam, args); | |
437 } | |
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
|
438 |
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
|
439 // 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
|
440 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
|
441 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
|
442 { |
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
|
443 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
|
444 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
|
445 } |
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
|
446 |
6424 | 447 |
448 #ifdef HAVE_MMX | |
6966 | 449 if(gCpuCaps.hasMMX){ |
450 lineNoise= lineNoise_MMX; | |
451 lineNoiseAvg= lineNoiseAvg_MMX; | |
452 } | |
6424 | 453 #endif |
454 #ifdef HAVE_MMX2 | |
455 if(gCpuCaps.hasMMX2) lineNoise= lineNoise_MMX2; | |
6963
76fee64d884a
film/average noise patch by (Jindrich Makovicka <makovick at KMLinux dot fjfi dot cvut dot cz>)
michael
parents:
6962
diff
changeset
|
456 // if(gCpuCaps.hasMMX) lineNoiseAvg= lineNoiseAvg_MMX2; |
6424 | 457 #endif |
458 | |
459 return 1; | |
460 } | |
461 | |
25221 | 462 const vf_info_t vf_info_noise = { |
18684
c9de3673e299
typo noticed by Alexander Monakov monoid$$at$$fds-net$$dot$$ru
diego
parents:
18104
diff
changeset
|
463 "noise generator", |
6424 | 464 "noise", |
465 "Michael Niedermayer", | |
466 "", | |
9593
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
7368
diff
changeset
|
467 open, |
e9a2af584986
Add the new -vf option wich is the same as vop in reverse order.
albeu
parents:
7368
diff
changeset
|
468 NULL |
6424 | 469 }; |
470 | |
471 //===========================================================================// |