comparison libmpcodecs/vf_eq.c @ 9599:77bddc6d9266

Support for the new options stuff
author albeu
date Sat, 15 Mar 2003 20:45:03 +0000
parents e9a2af584986
children 821f464b4d90
comparison
equal deleted inserted replaced
9598:ec21eefff17e 9599:77bddc6d9266
13 13
14 #include "../libvo/video_out.h" 14 #include "../libvo/video_out.h"
15 #include "../libvo/fastmemcpy.h" 15 #include "../libvo/fastmemcpy.h"
16 #include "../postproc/rgb2rgb.h" 16 #include "../postproc/rgb2rgb.h"
17 17
18 struct vf_priv_s { 18 #include "m_option.h"
19 #include "m_struct.h"
20
21 static struct vf_priv_s {
19 unsigned char *buf; 22 unsigned char *buf;
20 int brightness; 23 int brightness;
21 int contrast; 24 int contrast;
25 } vf_priv_dflt = {
26 NULL,
27 0,
28 0
22 }; 29 };
23 30
24 #ifdef HAVE_MMX 31 #ifdef HAVE_MMX
25 static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride, 32 static void process_MMX(unsigned char *dest, int dstride, unsigned char *src, int sstride,
26 int w, int h, int brightness, int contrast) 33 int w, int h, int brightness, int contrast)
200 vf->control=control; 207 vf->control=control;
201 vf->query_format=query_format; 208 vf->query_format=query_format;
202 vf->put_image=put_image; 209 vf->put_image=put_image;
203 vf->uninit=uninit; 210 vf->uninit=uninit;
204 211
212 if(!vf->priv) {
205 vf->priv = malloc(sizeof(struct vf_priv_s)); 213 vf->priv = malloc(sizeof(struct vf_priv_s));
206 memset(vf->priv, 0, sizeof(struct vf_priv_s)); 214 memset(vf->priv, 0, sizeof(struct vf_priv_s));
215 }
207 if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast); 216 if (args) sscanf(args, "%d:%d", &vf->priv->brightness, &vf->priv->contrast);
208 217
209 process = process_C; 218 process = process_C;
210 #ifdef HAVE_MMX 219 #ifdef HAVE_MMX
211 if(gCpuCaps.hasMMX) process = process_MMX; 220 if(gCpuCaps.hasMMX) process = process_MMX;
212 #endif 221 #endif
213 222
214 return 1; 223 return 1;
215 } 224 }
225
226 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
227 static m_option_t vf_opts_fields[] = {
228 {"brightness", ST_OFF(brightness), CONF_TYPE_INT, M_OPT_RANGE,-100 ,100, NULL},
229 {"contrast", ST_OFF(contrast), CONF_TYPE_INT, M_OPT_RANGE,-100 ,100, NULL},
230 { NULL, NULL, 0, 0, 0, 0, NULL }
231 };
232
233 static m_struct_t vf_opts = {
234 "eq",
235 sizeof(struct vf_priv_s),
236 &vf_priv_dflt,
237 vf_opts_fields
238 };
216 239
217 vf_info_t vf_info_eq = { 240 vf_info_t vf_info_eq = {
218 "soft video equalizer", 241 "soft video equalizer",
219 "eq", 242 "eq",
220 "Richard Felker", 243 "Richard Felker",
221 "", 244 "",
222 open, 245 open,
223 NULL 246 &vf_opts
224 }; 247 };
225 248