2 * This file is part of MPlayer.
4 * MPlayer 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.
9 * MPlayer 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.
14 * You should have received a copy of the GNU General Public License along
15 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26 #include "cpudetect.h"
29 #include "img_format.h"
32 #include "fmt-conversion.h"
35 #include "libswscale/swscale.h"
41 static struct vf_priv_s
{
46 struct SwsContext
*ctx
;
47 struct SwsContext
*ctx2
; //for interlaced slices only
48 unsigned char* palette
;
52 } const vf_priv_dflt
= {
55 {SWS_PARAM_DEFAULT
, SWS_PARAM_DEFAULT
},
62 //===========================================================================//
64 void sws_getFlagsAndFilterFromCmdLine(int *flags
, SwsFilter
**srcFilterParam
, SwsFilter
**dstFilterParam
);
66 static const unsigned int outfmt_list
[]={
88 // RGB and grayscale (Y8 and Y800):
115 * A list of preferred conversions, in order of preference.
116 * This should be used for conversions that e.g. involve no scaling
117 * or to stop vf_scale from choosing a conversion that has no
118 * fast assembler implementation.
120 static int preferred_conversions
[][2] = {
121 {IMGFMT_YUY2
, IMGFMT_UYVY
},
122 {IMGFMT_YUY2
, IMGFMT_422P
},
123 {IMGFMT_UYVY
, IMGFMT_YUY2
},
124 {IMGFMT_UYVY
, IMGFMT_422P
},
125 {IMGFMT_422P
, IMGFMT_YUY2
},
126 {IMGFMT_422P
, IMGFMT_UYVY
},
130 static unsigned int find_best_out(vf_instance_t
*vf
, int in_format
){
136 // find the best outfmt:
143 while (preferred_conversions
[j
][0] &&
144 preferred_conversions
[j
][0] != in_format
)
146 format
= preferred_conversions
[j
++][1];
147 // switch to standard list
152 format
= outfmt_list
[i
++];
155 ret
= vf_next_query_format(vf
, format
);
157 mp_msg(MSGT_VFILTER
,MSGL_DBG2
,"scale: query(%s) -> %d\n",vo_format_name(format
),ret
&3);
158 if(ret
&VFCAP_CSP_SUPPORTED_BY_HW
){
159 best
=format
; // no conversion -> bingo!
162 if(ret
&VFCAP_CSP_SUPPORTED
&& !best
)
163 best
=format
; // best with conversion
168 static int config(struct vf_instance
*vf
,
169 int width
, int height
, int d_width
, int d_height
,
170 unsigned int flags
, unsigned int outfmt
){
171 struct MPOpts
*opts
= vf
->opts
;
172 unsigned int best
=find_best_out(vf
, outfmt
);
175 int round_w
=0, round_h
=0;
177 SwsFilter
*srcFilter
, *dstFilter
;
178 enum PixelFormat dfmt
, sfmt
;
181 mp_msg(MSGT_VFILTER
,MSGL_WARN
,"SwScale: no supported outfmt found :(\n");
184 sfmt
= imgfmt2pixfmt(outfmt
);
185 if (outfmt
== IMGFMT_RGB8
|| outfmt
== IMGFMT_BGR8
) sfmt
= PIX_FMT_PAL8
;
186 dfmt
= imgfmt2pixfmt(best
);
188 vo_flags
=vf
->next
->query_format(vf
->next
,best
);
190 // scaling to dwidth*d_height, if all these TRUE:
192 // - no other sw/hw up/down scaling avail.
193 // - we're after postproc
194 // - user didn't set w:h
195 if(!(vo_flags
&VFCAP_POSTPROC
) && (flags
&4) &&
196 vf
->priv
->w
<0 && vf
->priv
->h
<0){ // -zoom
197 int x
=(vo_flags
&VFCAP_SWSCALE
) ? 0 : 1;
198 if(d_width
<width
|| d_height
<height
){
200 if(vo_flags
&VFCAP_HWSCALE_DOWN
) x
=0;
203 if(vo_flags
&VFCAP_HWSCALE_UP
) x
=0;
206 // user wants sw scaling! (-zoom)
208 vf
->priv
->h
=d_height
;
213 if((vf
->priv
->w
> width
) + (vf
->priv
->h
> height
) >= vf
->priv
->noup
){
219 if (vf
->priv
->w
<= -8) {
223 if (vf
->priv
->h
<= -8) {
228 if (vf
->priv
->w
< -3 || vf
->priv
->h
< -3 ||
229 (vf
->priv
->w
< -1 && vf
->priv
->h
< -1)) {
230 // TODO: establish a direct connection to the user's brain
231 // and find out what the heck he thinks MPlayer should do
232 // with this nonsense.
233 mp_msg(MSGT_VFILTER
, MSGL_ERR
, "SwScale: EUSERBROKEN Check your parameters, they make no sense!\n");
237 if (vf
->priv
->w
== -1)
239 if (vf
->priv
->w
== 0)
240 vf
->priv
->w
= d_width
;
242 if (vf
->priv
->h
== -1)
243 vf
->priv
->h
= height
;
244 if (vf
->priv
->h
== 0)
245 vf
->priv
->h
= d_height
;
247 if (vf
->priv
->w
== -3)
248 vf
->priv
->w
= vf
->priv
->h
* width
/ height
;
249 if (vf
->priv
->w
== -2)
250 vf
->priv
->w
= vf
->priv
->h
* d_width
/ d_height
;
252 if (vf
->priv
->h
== -3)
253 vf
->priv
->h
= vf
->priv
->w
* height
/ width
;
254 if (vf
->priv
->h
== -2)
255 vf
->priv
->h
= vf
->priv
->w
* d_height
/ d_width
;
258 vf
->priv
->w
= ((vf
->priv
->w
+ 8) / 16) * 16;
260 vf
->priv
->h
= ((vf
->priv
->h
+ 8) / 16) * 16;
262 // calculate the missing parameters:
264 case IMGFMT_YV12
: /* YV12 needs w & h rounded to 2 */
269 vf
->priv
->h
= (vf
->priv
->h
+ 1) & ~1;
270 case IMGFMT_YUY2
: /* YUY2 needs w rounded to 2 */
272 vf
->priv
->w
= (vf
->priv
->w
+ 1) & ~1;
275 mp_msg(MSGT_VFILTER
,MSGL_DBG2
,"SwScale: scaling %dx%d %s to %dx%d %s \n",
276 width
,height
,vo_format_name(outfmt
),
277 vf
->priv
->w
,vf
->priv
->h
,vo_format_name(best
));
280 if(vf
->priv
->ctx
) sws_freeContext(vf
->priv
->ctx
);
281 if(vf
->priv
->ctx2
)sws_freeContext(vf
->priv
->ctx2
);
284 sws_getFlagsAndFilterFromCmdLine(&int_sws_flags
, &srcFilter
, &dstFilter
);
285 int_sws_flags
|= vf
->priv
->v_chr_drop
<< SWS_SRC_V_CHR_DROP_SHIFT
;
286 int_sws_flags
|= vf
->priv
->accurate_rnd
* SWS_ACCURATE_RND
;
287 vf
->priv
->ctx
=sws_getContext(width
, height
>> vf
->priv
->interlaced
,
289 vf
->priv
->w
, vf
->priv
->h
>> vf
->priv
->interlaced
,
291 int_sws_flags
| get_sws_cpuflags(), srcFilter
, dstFilter
, vf
->priv
->param
);
292 if(vf
->priv
->interlaced
){
293 vf
->priv
->ctx2
=sws_getContext(width
, height
>> 1,
295 vf
->priv
->w
, vf
->priv
->h
>> 1,
297 int_sws_flags
| get_sws_cpuflags(), srcFilter
, dstFilter
, vf
->priv
->param
);
301 mp_msg(MSGT_VFILTER
,MSGL_WARN
,"Couldn't init SwScaler for this setup\n");
306 if(vf
->priv
->palette
){
307 free(vf
->priv
->palette
);
308 vf
->priv
->palette
=NULL
;
312 /* set 332 palette for 8 bpp */
313 vf
->priv
->palette
=malloc(4*256);
314 for(i
=0; i
<256; i
++){
315 vf
->priv
->palette
[4*i
+0]=4*(i
>>6)*21;
316 vf
->priv
->palette
[4*i
+1]=4*((i
>>3)&7)*9;
317 vf
->priv
->palette
[4*i
+2]=4*((i
&7)&7)*9;
318 vf
->priv
->palette
[4*i
+3]=0;
322 /* set 332 palette for 8 bpp */
323 vf
->priv
->palette
=malloc(4*256);
324 for(i
=0; i
<256; i
++){
325 vf
->priv
->palette
[4*i
+0]=4*(i
&3)*21;
326 vf
->priv
->palette
[4*i
+1]=4*((i
>>2)&7)*9;
327 vf
->priv
->palette
[4*i
+2]=4*((i
>>5)&7)*9;
328 vf
->priv
->palette
[4*i
+3]=0;
333 vf
->priv
->palette
=malloc(4*16);
335 vf
->priv
->palette
[4*i
+0]=4*(i
&1)*63;
336 vf
->priv
->palette
[4*i
+1]=4*((i
>>1)&3)*21;
337 vf
->priv
->palette
[4*i
+2]=4*((i
>>3)&1)*63;
338 vf
->priv
->palette
[4*i
+3]=0;
343 vf
->priv
->palette
=malloc(4*16);
345 vf
->priv
->palette
[4*i
+0]=4*(i
>>3)*63;
346 vf
->priv
->palette
[4*i
+1]=4*((i
>>1)&3)*21;
347 vf
->priv
->palette
[4*i
+2]=4*((i
&1)&1)*63;
348 vf
->priv
->palette
[4*i
+3]=0;
353 if (!opts
->screen_size_x
&& !opts
->screen_size_y
354 && !(opts
->screen_size_xy
>= 0.001)) {
355 // Compute new d_width and d_height, preserving aspect
356 // while ensuring that both are >= output size in pixels.
357 if (vf
->priv
->h
* d_width
> vf
->priv
->w
* d_height
) {
358 d_width
= vf
->priv
->h
* d_width
/ d_height
;
359 d_height
= vf
->priv
->h
;
361 d_height
= vf
->priv
->w
* d_height
/ d_width
;
362 d_width
= vf
->priv
->w
;
364 //d_width=d_width*vf->priv->w/width;
365 //d_height=d_height*vf->priv->h/height;
367 return vf_next_config(vf
,vf
->priv
->w
,vf
->priv
->h
,d_width
,d_height
,flags
,best
);
370 static void start_slice(struct vf_instance
*vf
, mp_image_t
*mpi
){
371 // printf("start_slice called! flag=%d\n",mpi->flags&MP_IMGFLAG_DRAW_CALLBACK);
372 if(!(mpi
->flags
&MP_IMGFLAG_DRAW_CALLBACK
)) return; // shouldn't happen
373 // they want slices!!! allocate the buffer.
374 mpi
->priv
=vf
->dmpi
=vf_get_image(vf
->next
,vf
->priv
->fmt
,
375 // mpi->type, mpi->flags & (~MP_IMGFLAG_DRAW_CALLBACK),
376 MP_IMGTYPE_TEMP
, MP_IMGFLAG_ACCEPT_STRIDE
| MP_IMGFLAG_PREFER_ALIGNED_STRIDE
,
377 vf
->priv
->w
, vf
->priv
->h
);
380 static void scale(struct SwsContext
*sws1
, struct SwsContext
*sws2
, uint8_t *src
[MP_MAX_PLANES
], int src_stride
[MP_MAX_PLANES
],
381 int y
, int h
, uint8_t *dst
[MP_MAX_PLANES
], int dst_stride
[MP_MAX_PLANES
], int interlaced
){
382 uint8_t *src2
[MP_MAX_PLANES
]={src
[0], src
[1], src
[2], src
[3]};
385 if (src
[1] && !src
[2]){
388 pal2
[i
]= bswap_32(((uint32_t*)src
[1])[i
]);
395 uint8_t *dst2
[MP_MAX_PLANES
]={dst
[0], dst
[1], dst
[2], dst
[3]};
396 int src_stride2
[MP_MAX_PLANES
]={2*src_stride
[0], 2*src_stride
[1], 2*src_stride
[2], 2*src_stride
[3]};
397 int dst_stride2
[MP_MAX_PLANES
]={2*dst_stride
[0], 2*dst_stride
[1], 2*dst_stride
[2], 2*dst_stride
[3]};
399 sws_scale(sws1
, src2
, src_stride2
, y
>>1, h
>>1, dst2
, dst_stride2
);
400 for(i
=0; i
<MP_MAX_PLANES
; i
++){
401 src2
[i
] += src_stride
[i
];
402 dst2
[i
] += dst_stride
[i
];
404 sws_scale(sws2
, src2
, src_stride2
, y
>>1, h
>>1, dst2
, dst_stride2
);
406 sws_scale(sws1
, src2
, src_stride
, y
, h
, dst
, dst_stride
);
410 static void draw_slice(struct vf_instance
*vf
,
411 unsigned char** src
, int* stride
, int w
,int h
, int x
, int y
){
412 mp_image_t
*dmpi
=vf
->dmpi
;
414 mp_msg(MSGT_VFILTER
,MSGL_FATAL
,"vf_scale: draw_slice() called with dmpi=NULL (no get_image?)\n");
417 // printf("vf_scale::draw_slice() y=%d h=%d\n",y,h);
418 scale(vf
->priv
->ctx
, vf
->priv
->ctx2
, src
, stride
, y
, h
, dmpi
->planes
, dmpi
->stride
, vf
->priv
->interlaced
);
421 static int put_image(struct vf_instance
*vf
, mp_image_t
*mpi
, double pts
){
422 mp_image_t
*dmpi
=mpi
->priv
;
424 // printf("vf_scale::put_image(): processing whole frame! dmpi=%p flag=%d\n",
425 // dmpi, (mpi->flags&MP_IMGFLAG_DRAW_CALLBACK));
427 if(!(mpi
->flags
&MP_IMGFLAG_DRAW_CALLBACK
&& dmpi
)){
429 // hope we'll get DR buffer:
430 dmpi
=vf_get_image(vf
->next
,vf
->priv
->fmt
,
431 MP_IMGTYPE_TEMP
, MP_IMGFLAG_ACCEPT_STRIDE
| MP_IMGFLAG_PREFER_ALIGNED_STRIDE
,
432 vf
->priv
->w
, vf
->priv
->h
);
434 scale(vf
->priv
->ctx
, vf
->priv
->ctx
, mpi
->planes
,mpi
->stride
,0,mpi
->h
,dmpi
->planes
,dmpi
->stride
, vf
->priv
->interlaced
);
437 if(vf
->priv
->w
==mpi
->w
&& vf
->priv
->h
==mpi
->h
){
438 // just conversion, no scaling -> keep postprocessing data
439 // this way we can apply pp filter to non-yv12 source using scaler
440 vf_clone_mpi_attributes(dmpi
, mpi
);
443 if(vf
->priv
->palette
) dmpi
->planes
[1]=vf
->priv
->palette
; // export palette!
445 return vf_next_put_image(vf
,dmpi
, pts
);
448 static int control(struct vf_instance
*vf
, int request
, void* data
){
452 int brightness
, contrast
, saturation
, srcRange
, dstRange
;
457 case VFCTRL_GET_EQUALIZER
:
458 r
= sws_getColorspaceDetails(vf
->priv
->ctx
, &inv_table
, &srcRange
, &table
, &dstRange
, &brightness
, &contrast
, &saturation
);
462 if (!strcmp(eq
->item
,"brightness")) {
463 eq
->value
= ((brightness
*100) + (1<<15))>>16;
465 else if (!strcmp(eq
->item
,"contrast")) {
466 eq
->value
= (((contrast
*100) + (1<<15))>>16) - 100;
468 else if (!strcmp(eq
->item
,"saturation")) {
469 eq
->value
= (((saturation
*100) + (1<<15))>>16) - 100;
474 case VFCTRL_SET_EQUALIZER
:
475 r
= sws_getColorspaceDetails(vf
->priv
->ctx
, &inv_table
, &srcRange
, &table
, &dstRange
, &brightness
, &contrast
, &saturation
);
477 //printf("set %f %f %f\n", brightness/(float)(1<<16), contrast/(float)(1<<16), saturation/(float)(1<<16));
480 if (!strcmp(eq
->item
,"brightness")) {
481 brightness
= (( eq
->value
<<16) + 50)/100;
483 else if (!strcmp(eq
->item
,"contrast")) {
484 contrast
= (((eq
->value
+100)<<16) + 50)/100;
486 else if (!strcmp(eq
->item
,"saturation")) {
487 saturation
= (((eq
->value
+100)<<16) + 50)/100;
492 r
= sws_setColorspaceDetails(vf
->priv
->ctx
, inv_table
, srcRange
, table
, dstRange
, brightness
, contrast
, saturation
);
495 r
= sws_setColorspaceDetails(vf
->priv
->ctx2
, inv_table
, srcRange
, table
, dstRange
, brightness
, contrast
, saturation
);
504 return vf_next_control(vf
,request
,data
);
507 //===========================================================================//
509 // supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800
511 static int query_format(struct vf_instance
*vf
, unsigned int fmt
){
533 case IMGFMT_444P16_LE
:
534 case IMGFMT_444P16_BE
:
535 case IMGFMT_422P16_LE
:
536 case IMGFMT_422P16_BE
:
537 case IMGFMT_420P16_LE
:
538 case IMGFMT_420P16_BE
:
546 unsigned int best
=find_best_out(vf
, fmt
);
548 if(!best
) return 0; // no matching out-fmt
549 flags
=vf_next_query_format(vf
,best
);
550 if(!(flags
&(VFCAP_CSP_SUPPORTED
|VFCAP_CSP_SUPPORTED_BY_HW
))) return 0; // huh?
551 if(fmt
!=best
) flags
&=~VFCAP_CSP_SUPPORTED_BY_HW
;
552 // do not allow scaling, if we are before the PP fliter!
553 if(!(flags
&VFCAP_POSTPROC
)) flags
|=VFCAP_SWSCALE
;
557 return 0; // nomatching in-fmt
560 static void uninit(struct vf_instance
*vf
){
561 if(vf
->priv
->ctx
) sws_freeContext(vf
->priv
->ctx
);
562 if(vf
->priv
->ctx2
) sws_freeContext(vf
->priv
->ctx2
);
563 if(vf
->priv
->palette
) free(vf
->priv
->palette
);
567 static int vf_open(vf_instance_t
*vf
, char *args
){
569 vf
->start_slice
=start_slice
;
570 vf
->draw_slice
=draw_slice
;
571 vf
->put_image
=put_image
;
572 vf
->query_format
=query_format
;
573 vf
->control
= control
;
575 mp_msg(MSGT_VFILTER
,MSGL_V
,"SwScale params: %d x %d (-1=no scaling)\n",
582 //global sws_flags from the command line
586 static SwsFilter
*src_filter
= NULL
;
588 float sws_lum_gblur
= 0.0;
589 float sws_chr_gblur
= 0.0;
590 int sws_chr_vshift
= 0;
591 int sws_chr_hshift
= 0;
592 float sws_chr_sharpen
= 0.0;
593 float sws_lum_sharpen
= 0.0;
595 int get_sws_cpuflags(void){
597 (gCpuCaps
.hasMMX
? SWS_CPU_CAPS_MMX
: 0)
598 | (gCpuCaps
.hasMMX2
? SWS_CPU_CAPS_MMX2
: 0)
599 | (gCpuCaps
.has3DNow
? SWS_CPU_CAPS_3DNOW
: 0)
600 | (gCpuCaps
.hasAltiVec
? SWS_CPU_CAPS_ALTIVEC
: 0);
603 void sws_getFlagsAndFilterFromCmdLine(int *flags
, SwsFilter
**srcFilterParam
, SwsFilter
**dstFilterParam
)
605 static int firstTime
=1;
610 __asm__
volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
615 *flags
= SWS_PRINT_INFO
;
617 else if( mp_msg_test(MSGT_VFILTER
,MSGL_DBG2
) ) *flags
= SWS_PRINT_INFO
;
619 if(src_filter
) sws_freeFilter(src_filter
);
621 src_filter
= sws_getDefaultFilter(
622 sws_lum_gblur
, sws_chr_gblur
,
623 sws_lum_sharpen
, sws_chr_sharpen
,
624 sws_chr_hshift
, sws_chr_vshift
, verbose
>1);
628 case 0: *flags
|= SWS_FAST_BILINEAR
; break;
629 case 1: *flags
|= SWS_BILINEAR
; break;
630 case 2: *flags
|= SWS_BICUBIC
; break;
631 case 3: *flags
|= SWS_X
; break;
632 case 4: *flags
|= SWS_POINT
; break;
633 case 5: *flags
|= SWS_AREA
; break;
634 case 6: *flags
|= SWS_BICUBLIN
; break;
635 case 7: *flags
|= SWS_GAUSS
; break;
636 case 8: *flags
|= SWS_SINC
; break;
637 case 9: *flags
|= SWS_LANCZOS
; break;
638 case 10:*flags
|= SWS_SPLINE
; break;
639 default:*flags
|= SWS_BILINEAR
; break;
642 *srcFilterParam
= src_filter
;
643 *dstFilterParam
= NULL
;
646 // will use sws_flags & src_filter (from cmd line)
647 struct SwsContext
*sws_getContextFromCmdLine(int srcW
, int srcH
, int srcFormat
, int dstW
, int dstH
, int dstFormat
)
650 SwsFilter
*dstFilterParam
, *srcFilterParam
;
651 enum PixelFormat dfmt
, sfmt
;
653 dfmt
= imgfmt2pixfmt(dstFormat
);
654 sfmt
= imgfmt2pixfmt(srcFormat
);
655 if (srcFormat
== IMGFMT_RGB8
|| srcFormat
== IMGFMT_BGR8
) sfmt
= PIX_FMT_PAL8
;
656 sws_getFlagsAndFilterFromCmdLine(&flags
, &srcFilterParam
, &dstFilterParam
);
658 return sws_getContext(srcW
, srcH
, sfmt
, dstW
, dstH
, dfmt
, flags
| get_sws_cpuflags(), srcFilterParam
, dstFilterParam
, NULL
);
661 /// An example of presets usage
662 static const struct size_preset
{
665 } vf_size_presets_defs
[] = {
666 // TODO add more 'standard' resolutions
667 { "qntsc", 352, 240 },
668 { "qpal", 352, 288 },
669 { "ntsc", 720, 480 },
671 { "sntsc", 640, 480 },
672 { "spal", 768, 576 },
676 #define ST_OFF(f) M_ST_OFF(struct size_preset,f)
677 static const m_option_t vf_size_preset_fields
[] = {
678 {"w", ST_OFF(w
), CONF_TYPE_INT
, M_OPT_MIN
,1 ,0, NULL
},
679 {"h", ST_OFF(h
), CONF_TYPE_INT
, M_OPT_MIN
,1 ,0, NULL
},
680 { NULL
, NULL
, 0, 0, 0, 0, NULL
}
683 static const m_struct_t vf_size_preset
= {
685 sizeof(struct size_preset
),
687 vf_size_preset_fields
690 static const m_struct_t vf_opts
;
691 static const m_obj_presets_t size_preset
= {
692 &vf_size_preset
, // Input struct desc
693 &vf_opts
, // Output struct desc
694 vf_size_presets_defs
, // The list of presets
695 ST_OFF(name
) // At wich offset is the name field in the preset struct
700 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
701 static const m_option_t vf_opts_fields
[] = {
702 {"w", ST_OFF(w
), CONF_TYPE_INT
, M_OPT_MIN
,-11,0, NULL
},
703 {"h", ST_OFF(h
), CONF_TYPE_INT
, M_OPT_MIN
,-11,0, NULL
},
704 {"interlaced", ST_OFF(interlaced
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 1, NULL
},
705 {"chr-drop", ST_OFF(v_chr_drop
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 3, NULL
},
706 {"param" , ST_OFF(param
[0]), CONF_TYPE_DOUBLE
, M_OPT_RANGE
, 0.0, 100.0, NULL
},
707 {"param2", ST_OFF(param
[1]), CONF_TYPE_DOUBLE
, M_OPT_RANGE
, 0.0, 100.0, NULL
},
708 // Note that here the 2 field is NULL (ie 0)
709 // As we want this option to act on the option struct itself
710 {"presize", 0, CONF_TYPE_OBJ_PRESETS
, 0, 0, 0, &size_preset
},
711 {"noup", ST_OFF(noup
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 2, NULL
},
712 {"arnd", ST_OFF(accurate_rnd
), CONF_TYPE_FLAG
, 0, 0, 1, NULL
},
713 { NULL
, NULL
, 0, 0, 0, 0, NULL
}
716 static const m_struct_t vf_opts
= {
718 sizeof(struct vf_priv_s
),
723 const vf_info_t vf_info_scale
= {
732 //===========================================================================//