annotate libmpcodecs/vf_smartblur.c @ 8118:434a4fce25c1

patch from Colin Leroy <colin@colino.net>
author pontscho
date Wed, 06 Nov 2002 21:08:33 +0000
parents 7aa3dba949f1
children 442ea8b6733c
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
8106
7aa3dba949f1 smartblur
michael
parents:
diff changeset
1 /*
7aa3dba949f1 smartblur
michael
parents:
diff changeset
2 Copyright (C) 2002 Michael Niedermayer <michaelni@gmx.at>
7aa3dba949f1 smartblur
michael
parents:
diff changeset
3
7aa3dba949f1 smartblur
michael
parents:
diff changeset
4 This program is free software; you can redistribute it and/or modify
7aa3dba949f1 smartblur
michael
parents:
diff changeset
5 it under the terms of the GNU General Public License as published by
7aa3dba949f1 smartblur
michael
parents:
diff changeset
6 the Free Software Foundation; either version 2 of the License, or
7aa3dba949f1 smartblur
michael
parents:
diff changeset
7 (at your option) any later version.
7aa3dba949f1 smartblur
michael
parents:
diff changeset
8
7aa3dba949f1 smartblur
michael
parents:
diff changeset
9 This program is distributed in the hope that it will be useful,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
7aa3dba949f1 smartblur
michael
parents:
diff changeset
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
7aa3dba949f1 smartblur
michael
parents:
diff changeset
12 GNU General Public License for more details.
7aa3dba949f1 smartblur
michael
parents:
diff changeset
13
7aa3dba949f1 smartblur
michael
parents:
diff changeset
14 You should have received a copy of the GNU General Public License
7aa3dba949f1 smartblur
michael
parents:
diff changeset
15 along with this program; if not, write to the Free Software
7aa3dba949f1 smartblur
michael
parents:
diff changeset
16 Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
7aa3dba949f1 smartblur
michael
parents:
diff changeset
17 */
7aa3dba949f1 smartblur
michael
parents:
diff changeset
18
7aa3dba949f1 smartblur
michael
parents:
diff changeset
19 #include <stdio.h>
7aa3dba949f1 smartblur
michael
parents:
diff changeset
20 #include <stdlib.h>
7aa3dba949f1 smartblur
michael
parents:
diff changeset
21 #include <string.h>
7aa3dba949f1 smartblur
michael
parents:
diff changeset
22 #include <inttypes.h>
7aa3dba949f1 smartblur
michael
parents:
diff changeset
23 #include <assert.h>
7aa3dba949f1 smartblur
michael
parents:
diff changeset
24
7aa3dba949f1 smartblur
michael
parents:
diff changeset
25 #include "../config.h"
7aa3dba949f1 smartblur
michael
parents:
diff changeset
26 #include "../mp_msg.h"
7aa3dba949f1 smartblur
michael
parents:
diff changeset
27
7aa3dba949f1 smartblur
michael
parents:
diff changeset
28 #ifdef HAVE_MALLOC_H
7aa3dba949f1 smartblur
michael
parents:
diff changeset
29 #include <malloc.h>
7aa3dba949f1 smartblur
michael
parents:
diff changeset
30 #endif
7aa3dba949f1 smartblur
michael
parents:
diff changeset
31
7aa3dba949f1 smartblur
michael
parents:
diff changeset
32 #include "img_format.h"
7aa3dba949f1 smartblur
michael
parents:
diff changeset
33 #include "mp_image.h"
7aa3dba949f1 smartblur
michael
parents:
diff changeset
34 #include "vf.h"
7aa3dba949f1 smartblur
michael
parents:
diff changeset
35 #include "../libvo/fastmemcpy.h"
7aa3dba949f1 smartblur
michael
parents:
diff changeset
36 #include "../postproc/swscale.h"
7aa3dba949f1 smartblur
michael
parents:
diff changeset
37
7aa3dba949f1 smartblur
michael
parents:
diff changeset
38 //===========================================================================//
7aa3dba949f1 smartblur
michael
parents:
diff changeset
39
7aa3dba949f1 smartblur
michael
parents:
diff changeset
40 typedef struct FilterParam{
7aa3dba949f1 smartblur
michael
parents:
diff changeset
41 float radius;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
42 float strength;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
43 int threshold;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
44 float quality;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
45 SwsContext *filterContext;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
46 }FilterParam;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
47
7aa3dba949f1 smartblur
michael
parents:
diff changeset
48 struct vf_priv_s {
7aa3dba949f1 smartblur
michael
parents:
diff changeset
49 FilterParam luma;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
50 FilterParam chroma;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
51 };
7aa3dba949f1 smartblur
michael
parents:
diff changeset
52
7aa3dba949f1 smartblur
michael
parents:
diff changeset
53
7aa3dba949f1 smartblur
michael
parents:
diff changeset
54 /***************************************************************************/
7aa3dba949f1 smartblur
michael
parents:
diff changeset
55
7aa3dba949f1 smartblur
michael
parents:
diff changeset
56 //FIXME stupid code duplication
7aa3dba949f1 smartblur
michael
parents:
diff changeset
57 static void getSubSampleFactors(int *h, int *v, int format){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
58 switch(format){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
59 case IMGFMT_YV12:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
60 case IMGFMT_I420:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
61 *h=1;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
62 *v=1;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
63 break;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
64 case IMGFMT_YVU9:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
65 *h=2;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
66 *v=2;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
67 break;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
68 case IMGFMT_444P:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
69 *h=0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
70 *v=0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
71 break;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
72 case IMGFMT_422P:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
73 *h=1;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
74 *v=0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
75 break;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
76 case IMGFMT_411P:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
77 *h=2;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
78 *v=0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
79 break;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
80 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
81 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
82
7aa3dba949f1 smartblur
michael
parents:
diff changeset
83 static int allocStuff(FilterParam *f, int width, int height){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
84 SwsVector *vec;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
85 SwsFilter swsF;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
86
7aa3dba949f1 smartblur
michael
parents:
diff changeset
87 vec = getGaussianVec(f->radius, f->quality);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
88 scaleVec(vec, f->strength);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
89 vec->coeff[vec->length/2]+= 1.0 - f->strength;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
90 swsF.lumH= swsF.lumV= vec;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
91 swsF.chrH= swsF.chrV= NULL;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
92 f->filterContext= getSwsContext(
7aa3dba949f1 smartblur
michael
parents:
diff changeset
93 width, height, IMGFMT_Y8, width, height, IMGFMT_Y8, 0, &swsF, NULL);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
94
7aa3dba949f1 smartblur
michael
parents:
diff changeset
95 freeVec(vec);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
96
7aa3dba949f1 smartblur
michael
parents:
diff changeset
97 return 0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
98 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
99
7aa3dba949f1 smartblur
michael
parents:
diff changeset
100 static int config(struct vf_instance_s* vf,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
101 int width, int height, int d_width, int d_height,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
102 unsigned int flags, unsigned int outfmt){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
103
7aa3dba949f1 smartblur
michael
parents:
diff changeset
104 int sw, sh;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
105
7aa3dba949f1 smartblur
michael
parents:
diff changeset
106 allocStuff(&vf->priv->luma, width, height);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
107
7aa3dba949f1 smartblur
michael
parents:
diff changeset
108 getSubSampleFactors(&sw, &sh, outfmt);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
109 allocStuff(&vf->priv->chroma, width>>sw, height>>sh);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
110
7aa3dba949f1 smartblur
michael
parents:
diff changeset
111 return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
112 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
113
7aa3dba949f1 smartblur
michael
parents:
diff changeset
114 static void freeBuffers(FilterParam *f){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
115 if(f->filterContext) freeSwsContext(f->filterContext);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
116 f->filterContext=NULL;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
117 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
118
7aa3dba949f1 smartblur
michael
parents:
diff changeset
119 static void uninit(struct vf_instance_s* vf){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
120 if(!vf->priv) return;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
121
7aa3dba949f1 smartblur
michael
parents:
diff changeset
122 freeBuffers(&vf->priv->luma);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
123 freeBuffers(&vf->priv->chroma);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
124
7aa3dba949f1 smartblur
michael
parents:
diff changeset
125 free(vf->priv);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
126 vf->priv=NULL;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
127 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
128
7aa3dba949f1 smartblur
michael
parents:
diff changeset
129 static inline void blur(uint8_t *dst, uint8_t *src, int w, int h, int dstStride, int srcStride, FilterParam *fp){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
130 int x, y;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
131 FilterParam f= *fp;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
132 uint8_t *srcArray[3]= {src, NULL, NULL};
7aa3dba949f1 smartblur
michael
parents:
diff changeset
133 uint8_t *dstArray[3]= {dst, NULL, NULL};
7aa3dba949f1 smartblur
michael
parents:
diff changeset
134 int srcStrideArray[3]= {srcStride, 0, 0};
7aa3dba949f1 smartblur
michael
parents:
diff changeset
135 int dstStrideArray[3]= {dstStride, 0, 0};
7aa3dba949f1 smartblur
michael
parents:
diff changeset
136
7aa3dba949f1 smartblur
michael
parents:
diff changeset
137 f.filterContext->swScale(f.filterContext, srcArray, srcStrideArray, 0, h, dstArray, dstStrideArray);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
138
7aa3dba949f1 smartblur
michael
parents:
diff changeset
139 if(f.threshold > 0){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
140 for(y=0; y<h; y++){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
141 for(x=0; x<w; x++){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
142 const int orig= src[x + y*srcStride];
7aa3dba949f1 smartblur
michael
parents:
diff changeset
143 const int filtered= dst[x + y*dstStride];
7aa3dba949f1 smartblur
michael
parents:
diff changeset
144 const int diff= orig - filtered;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
145
7aa3dba949f1 smartblur
michael
parents:
diff changeset
146 if(diff > 0){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
147 if(diff > 2*f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
148 dst[x + y*dstStride]= orig;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
149 }else if(diff > f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
150 dst[x + y*dstStride]= filtered + diff - f.threshold;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
151 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
152 }else{
7aa3dba949f1 smartblur
michael
parents:
diff changeset
153 if(-diff > 2*f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
154 dst[x + y*dstStride]= orig;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
155 }else if(-diff > f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
156 dst[x + y*dstStride]= filtered + diff + f.threshold;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
157 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
158 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
159 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
160 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
161 }else if(f.threshold < 0){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
162 for(y=0; y<h; y++){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
163 for(x=0; x<w; x++){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
164 const int orig= src[x + y*srcStride];
7aa3dba949f1 smartblur
michael
parents:
diff changeset
165 const int filtered= dst[x + y*dstStride];
7aa3dba949f1 smartblur
michael
parents:
diff changeset
166 const int diff= orig - filtered;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
167
7aa3dba949f1 smartblur
michael
parents:
diff changeset
168 if(diff > 0){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
169 if(diff > -2*f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
170 }else if(diff > -f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
171 dst[x + y*dstStride]= orig - diff - f.threshold;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
172 }else
7aa3dba949f1 smartblur
michael
parents:
diff changeset
173 dst[x + y*dstStride]= orig;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
174 }else{
7aa3dba949f1 smartblur
michael
parents:
diff changeset
175 if(diff < 2*f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
176 }else if(diff < f.threshold){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
177 dst[x + y*dstStride]= orig - diff + f.threshold;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
178 }else
7aa3dba949f1 smartblur
michael
parents:
diff changeset
179 dst[x + y*dstStride]= orig;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
180 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
181 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
182 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
183 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
184 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
185
7aa3dba949f1 smartblur
michael
parents:
diff changeset
186 static int put_image(struct vf_instance_s* vf, mp_image_t *mpi){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
187 int cw= mpi->w >> mpi->chroma_x_shift;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
188 int ch= mpi->h >> mpi->chroma_y_shift;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
189
7aa3dba949f1 smartblur
michael
parents:
diff changeset
190 mp_image_t *dmpi=vf_get_image(vf->next,mpi->imgfmt,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
191 MP_IMGTYPE_TEMP, MP_IMGFLAG_ACCEPT_STRIDE,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
192 mpi->w,mpi->h);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
193
7aa3dba949f1 smartblur
michael
parents:
diff changeset
194 assert(mpi->flags&MP_IMGFLAG_PLANAR);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
195
7aa3dba949f1 smartblur
michael
parents:
diff changeset
196 blur(dmpi->planes[0], mpi->planes[0], mpi->w,mpi->h, dmpi->stride[0], mpi->stride[0], &vf->priv->luma);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
197 blur(dmpi->planes[1], mpi->planes[1], cw , ch , dmpi->stride[1], mpi->stride[1], &vf->priv->chroma);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
198 blur(dmpi->planes[2], mpi->planes[2], cw , ch , dmpi->stride[2], mpi->stride[2], &vf->priv->chroma);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
199
7aa3dba949f1 smartblur
michael
parents:
diff changeset
200 return vf_next_put_image(vf,dmpi);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
201 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
202
7aa3dba949f1 smartblur
michael
parents:
diff changeset
203 //===========================================================================//
7aa3dba949f1 smartblur
michael
parents:
diff changeset
204
7aa3dba949f1 smartblur
michael
parents:
diff changeset
205 static int query_format(struct vf_instance_s* vf, unsigned int fmt){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
206 switch(fmt)
7aa3dba949f1 smartblur
michael
parents:
diff changeset
207 {
7aa3dba949f1 smartblur
michael
parents:
diff changeset
208 case IMGFMT_YV12:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
209 case IMGFMT_I420:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
210 case IMGFMT_IYUV:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
211 case IMGFMT_YVU9:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
212 case IMGFMT_444P:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
213 case IMGFMT_422P:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
214 case IMGFMT_411P:
7aa3dba949f1 smartblur
michael
parents:
diff changeset
215 return vf_next_query_format(vf, fmt);
7aa3dba949f1 smartblur
michael
parents:
diff changeset
216 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
217 return 0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
218 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
219
7aa3dba949f1 smartblur
michael
parents:
diff changeset
220 static int open(vf_instance_t *vf, char* args){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
221 int e;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
222
7aa3dba949f1 smartblur
michael
parents:
diff changeset
223 vf->config=config;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
224 vf->put_image=put_image;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
225 // vf->get_image=get_image;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
226 vf->query_format=query_format;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
227 vf->uninit=uninit;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
228 vf->priv=malloc(sizeof(struct vf_priv_s));
7aa3dba949f1 smartblur
michael
parents:
diff changeset
229 memset(vf->priv, 0, sizeof(struct vf_priv_s));
7aa3dba949f1 smartblur
michael
parents:
diff changeset
230
7aa3dba949f1 smartblur
michael
parents:
diff changeset
231 if(args==NULL) return 0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
232
7aa3dba949f1 smartblur
michael
parents:
diff changeset
233 e=sscanf(args, "%f:%f:%d:%f:%f:%d",
7aa3dba949f1 smartblur
michael
parents:
diff changeset
234 &vf->priv->luma.radius,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
235 &vf->priv->luma.strength,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
236 &vf->priv->luma.threshold,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
237 &vf->priv->chroma.radius,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
238 &vf->priv->chroma.strength,
7aa3dba949f1 smartblur
michael
parents:
diff changeset
239 &vf->priv->chroma.threshold
7aa3dba949f1 smartblur
michael
parents:
diff changeset
240 );
7aa3dba949f1 smartblur
michael
parents:
diff changeset
241
7aa3dba949f1 smartblur
michael
parents:
diff changeset
242 vf->priv->luma.quality = vf->priv->chroma.quality= 3.0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
243
7aa3dba949f1 smartblur
michael
parents:
diff changeset
244 if(e==3){
7aa3dba949f1 smartblur
michael
parents:
diff changeset
245 vf->priv->chroma.radius= vf->priv->luma.radius;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
246 vf->priv->chroma.strength= vf->priv->luma.strength;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
247 vf->priv->chroma.threshold = vf->priv->luma.threshold;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
248 }else if(e!=6)
7aa3dba949f1 smartblur
michael
parents:
diff changeset
249 return 0;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
250
7aa3dba949f1 smartblur
michael
parents:
diff changeset
251 return 1;
7aa3dba949f1 smartblur
michael
parents:
diff changeset
252 }
7aa3dba949f1 smartblur
michael
parents:
diff changeset
253
7aa3dba949f1 smartblur
michael
parents:
diff changeset
254 vf_info_t vf_info_smartblur = {
7aa3dba949f1 smartblur
michael
parents:
diff changeset
255 "smart blur",
7aa3dba949f1 smartblur
michael
parents:
diff changeset
256 "smartblur",
7aa3dba949f1 smartblur
michael
parents:
diff changeset
257 "Michael Niedermayer",
7aa3dba949f1 smartblur
michael
parents:
diff changeset
258 "",
7aa3dba949f1 smartblur
michael
parents:
diff changeset
259 open
7aa3dba949f1 smartblur
michael
parents:
diff changeset
260 };
7aa3dba949f1 smartblur
michael
parents:
diff changeset
261
7aa3dba949f1 smartblur
michael
parents:
diff changeset
262 //===========================================================================//