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
[]={
98 // RGB and grayscale (Y8 and Y800):
125 * A list of preferred conversions, in order of preference.
126 * This should be used for conversions that e.g. involve no scaling
127 * or to stop vf_scale from choosing a conversion that has no
128 * fast assembler implementation.
130 static int preferred_conversions
[][2] = {
131 {IMGFMT_YUY2
, IMGFMT_UYVY
},
132 {IMGFMT_YUY2
, IMGFMT_422P
},
133 {IMGFMT_UYVY
, IMGFMT_YUY2
},
134 {IMGFMT_UYVY
, IMGFMT_422P
},
135 {IMGFMT_422P
, IMGFMT_YUY2
},
136 {IMGFMT_422P
, IMGFMT_UYVY
},
140 static unsigned int find_best_out(vf_instance_t
*vf
, int in_format
){
146 // find the best outfmt:
153 while (preferred_conversions
[j
][0] &&
154 preferred_conversions
[j
][0] != in_format
)
156 format
= preferred_conversions
[j
++][1];
157 // switch to standard list
162 format
= outfmt_list
[i
++];
165 ret
= vf_next_query_format(vf
, format
);
167 mp_msg(MSGT_VFILTER
,MSGL_DBG2
,"scale: query(%s) -> %d\n",vo_format_name(format
),ret
&3);
168 if(ret
&VFCAP_CSP_SUPPORTED_BY_HW
){
169 best
=format
; // no conversion -> bingo!
172 if(ret
&VFCAP_CSP_SUPPORTED
&& !best
)
173 best
=format
; // best with conversion
178 static int config(struct vf_instance
*vf
,
179 int width
, int height
, int d_width
, int d_height
,
180 unsigned int flags
, unsigned int outfmt
){
181 struct MPOpts
*opts
= vf
->opts
;
182 unsigned int best
=find_best_out(vf
, outfmt
);
185 int round_w
=0, round_h
=0;
187 SwsFilter
*srcFilter
, *dstFilter
;
188 enum PixelFormat dfmt
, sfmt
;
191 mp_msg(MSGT_VFILTER
,MSGL_WARN
,"SwScale: no supported outfmt found :(\n");
194 sfmt
= imgfmt2pixfmt(outfmt
);
195 if (outfmt
== IMGFMT_RGB8
|| outfmt
== IMGFMT_BGR8
) sfmt
= PIX_FMT_PAL8
;
196 dfmt
= imgfmt2pixfmt(best
);
198 vo_flags
=vf
->next
->query_format(vf
->next
,best
);
200 // scaling to dwidth*d_height, if all these TRUE:
202 // - no other sw/hw up/down scaling avail.
203 // - we're after postproc
204 // - user didn't set w:h
205 if(!(vo_flags
&VFCAP_POSTPROC
) && (flags
&4) &&
206 vf
->priv
->w
<0 && vf
->priv
->h
<0){ // -zoom
207 int x
=(vo_flags
&VFCAP_SWSCALE
) ? 0 : 1;
208 if(d_width
<width
|| d_height
<height
){
210 if(vo_flags
&VFCAP_HWSCALE_DOWN
) x
=0;
213 if(vo_flags
&VFCAP_HWSCALE_UP
) x
=0;
216 // user wants sw scaling! (-zoom)
218 vf
->priv
->h
=d_height
;
223 if((vf
->priv
->w
> width
) + (vf
->priv
->h
> height
) >= vf
->priv
->noup
){
229 if (vf
->priv
->w
<= -8) {
233 if (vf
->priv
->h
<= -8) {
238 if (vf
->priv
->w
< -3 || vf
->priv
->h
< -3 ||
239 (vf
->priv
->w
< -1 && vf
->priv
->h
< -1)) {
240 // TODO: establish a direct connection to the user's brain
241 // and find out what the heck he thinks MPlayer should do
242 // with this nonsense.
243 mp_msg(MSGT_VFILTER
, MSGL_ERR
, "SwScale: EUSERBROKEN Check your parameters, they make no sense!\n");
247 if (vf
->priv
->w
== -1)
249 if (vf
->priv
->w
== 0)
250 vf
->priv
->w
= d_width
;
252 if (vf
->priv
->h
== -1)
253 vf
->priv
->h
= height
;
254 if (vf
->priv
->h
== 0)
255 vf
->priv
->h
= d_height
;
257 if (vf
->priv
->w
== -3)
258 vf
->priv
->w
= vf
->priv
->h
* width
/ height
;
259 if (vf
->priv
->w
== -2)
260 vf
->priv
->w
= vf
->priv
->h
* d_width
/ d_height
;
262 if (vf
->priv
->h
== -3)
263 vf
->priv
->h
= vf
->priv
->w
* height
/ width
;
264 if (vf
->priv
->h
== -2)
265 vf
->priv
->h
= vf
->priv
->w
* d_height
/ d_width
;
268 vf
->priv
->w
= ((vf
->priv
->w
+ 8) / 16) * 16;
270 vf
->priv
->h
= ((vf
->priv
->h
+ 8) / 16) * 16;
272 // calculate the missing parameters:
274 case IMGFMT_YV12
: /* YV12 needs w & h rounded to 2 */
279 vf
->priv
->h
= (vf
->priv
->h
+ 1) & ~1;
280 case IMGFMT_YUY2
: /* YUY2 needs w rounded to 2 */
282 vf
->priv
->w
= (vf
->priv
->w
+ 1) & ~1;
285 mp_msg(MSGT_VFILTER
,MSGL_DBG2
,"SwScale: scaling %dx%d %s to %dx%d %s \n",
286 width
,height
,vo_format_name(outfmt
),
287 vf
->priv
->w
,vf
->priv
->h
,vo_format_name(best
));
290 if(vf
->priv
->ctx
) sws_freeContext(vf
->priv
->ctx
);
291 if(vf
->priv
->ctx2
)sws_freeContext(vf
->priv
->ctx2
);
294 sws_getFlagsAndFilterFromCmdLine(&int_sws_flags
, &srcFilter
, &dstFilter
);
295 int_sws_flags
|= vf
->priv
->v_chr_drop
<< SWS_SRC_V_CHR_DROP_SHIFT
;
296 int_sws_flags
|= vf
->priv
->accurate_rnd
* SWS_ACCURATE_RND
;
297 vf
->priv
->ctx
=sws_getContext(width
, height
>> vf
->priv
->interlaced
,
299 vf
->priv
->w
, vf
->priv
->h
>> vf
->priv
->interlaced
,
301 int_sws_flags
| get_sws_cpuflags(), srcFilter
, dstFilter
, vf
->priv
->param
);
302 if(vf
->priv
->interlaced
){
303 vf
->priv
->ctx2
=sws_getContext(width
, height
>> 1,
305 vf
->priv
->w
, vf
->priv
->h
>> 1,
307 int_sws_flags
| get_sws_cpuflags(), srcFilter
, dstFilter
, vf
->priv
->param
);
311 mp_msg(MSGT_VFILTER
,MSGL_WARN
,"Couldn't init SwScaler for this setup\n");
316 free(vf
->priv
->palette
);
317 vf
->priv
->palette
=NULL
;
320 /* set 332 palette for 8 bpp */
321 vf
->priv
->palette
=malloc(4*256);
322 for(i
=0; i
<256; i
++){
323 vf
->priv
->palette
[4*i
+0]=4*(i
>>6)*21;
324 vf
->priv
->palette
[4*i
+1]=4*((i
>>3)&7)*9;
325 vf
->priv
->palette
[4*i
+2]=4*((i
&7)&7)*9;
326 vf
->priv
->palette
[4*i
+3]=0;
330 /* set 332 palette for 8 bpp */
331 vf
->priv
->palette
=malloc(4*256);
332 for(i
=0; i
<256; i
++){
333 vf
->priv
->palette
[4*i
+0]=4*(i
&3)*21;
334 vf
->priv
->palette
[4*i
+1]=4*((i
>>2)&7)*9;
335 vf
->priv
->palette
[4*i
+2]=4*((i
>>5)&7)*9;
336 vf
->priv
->palette
[4*i
+3]=0;
341 vf
->priv
->palette
=malloc(4*16);
343 vf
->priv
->palette
[4*i
+0]=4*(i
&1)*63;
344 vf
->priv
->palette
[4*i
+1]=4*((i
>>1)&3)*21;
345 vf
->priv
->palette
[4*i
+2]=4*((i
>>3)&1)*63;
346 vf
->priv
->palette
[4*i
+3]=0;
351 vf
->priv
->palette
=malloc(4*16);
353 vf
->priv
->palette
[4*i
+0]=4*(i
>>3)*63;
354 vf
->priv
->palette
[4*i
+1]=4*((i
>>1)&3)*21;
355 vf
->priv
->palette
[4*i
+2]=4*((i
&1)&1)*63;
356 vf
->priv
->palette
[4*i
+3]=0;
361 if (!opts
->screen_size_x
&& !opts
->screen_size_y
362 && !(opts
->screen_size_xy
>= 0.001)) {
363 // Compute new d_width and d_height, preserving aspect
364 // while ensuring that both are >= output size in pixels.
365 if (vf
->priv
->h
* d_width
> vf
->priv
->w
* d_height
) {
366 d_width
= vf
->priv
->h
* d_width
/ d_height
;
367 d_height
= vf
->priv
->h
;
369 d_height
= vf
->priv
->w
* d_height
/ d_width
;
370 d_width
= vf
->priv
->w
;
372 //d_width=d_width*vf->priv->w/width;
373 //d_height=d_height*vf->priv->h/height;
375 return vf_next_config(vf
,vf
->priv
->w
,vf
->priv
->h
,d_width
,d_height
,flags
,best
);
378 static void start_slice(struct vf_instance
*vf
, mp_image_t
*mpi
){
379 // printf("start_slice called! flag=%d\n",mpi->flags&MP_IMGFLAG_DRAW_CALLBACK);
380 if(!(mpi
->flags
&MP_IMGFLAG_DRAW_CALLBACK
)) return; // shouldn't happen
381 // they want slices!!! allocate the buffer.
382 mpi
->priv
=vf
->dmpi
=vf_get_image(vf
->next
,vf
->priv
->fmt
,
383 // mpi->type, mpi->flags & (~MP_IMGFLAG_DRAW_CALLBACK),
384 MP_IMGTYPE_TEMP
, MP_IMGFLAG_ACCEPT_STRIDE
| MP_IMGFLAG_PREFER_ALIGNED_STRIDE
,
385 vf
->priv
->w
, vf
->priv
->h
);
388 static void scale(struct SwsContext
*sws1
, struct SwsContext
*sws2
, uint8_t *src
[MP_MAX_PLANES
], int src_stride
[MP_MAX_PLANES
],
389 int y
, int h
, uint8_t *dst
[MP_MAX_PLANES
], int dst_stride
[MP_MAX_PLANES
], int interlaced
){
390 const uint8_t *src2
[MP_MAX_PLANES
]={src
[0], src
[1], src
[2], src
[3]};
393 if (src
[1] && !src
[2]){
396 pal2
[i
]= bswap_32(((uint32_t*)src
[1])[i
]);
403 uint8_t *dst2
[MP_MAX_PLANES
]={dst
[0], dst
[1], dst
[2], dst
[3]};
404 int src_stride2
[MP_MAX_PLANES
]={2*src_stride
[0], 2*src_stride
[1], 2*src_stride
[2], 2*src_stride
[3]};
405 int dst_stride2
[MP_MAX_PLANES
]={2*dst_stride
[0], 2*dst_stride
[1], 2*dst_stride
[2], 2*dst_stride
[3]};
407 sws_scale(sws1
, src2
, src_stride2
, y
>>1, h
>>1, dst2
, dst_stride2
);
408 for(i
=0; i
<MP_MAX_PLANES
; i
++){
409 src2
[i
] += src_stride
[i
];
410 dst2
[i
] += dst_stride
[i
];
412 sws_scale(sws2
, src2
, src_stride2
, y
>>1, h
>>1, dst2
, dst_stride2
);
414 sws_scale(sws1
, src2
, src_stride
, y
, h
, dst
, dst_stride
);
418 static void draw_slice(struct vf_instance
*vf
,
419 unsigned char** src
, int* stride
, int w
,int h
, int x
, int y
){
420 mp_image_t
*dmpi
=vf
->dmpi
;
422 mp_msg(MSGT_VFILTER
,MSGL_FATAL
,"vf_scale: draw_slice() called with dmpi=NULL (no get_image?)\n");
425 // printf("vf_scale::draw_slice() y=%d h=%d\n",y,h);
426 scale(vf
->priv
->ctx
, vf
->priv
->ctx2
, src
, stride
, y
, h
, dmpi
->planes
, dmpi
->stride
, vf
->priv
->interlaced
);
429 static int put_image(struct vf_instance
*vf
, mp_image_t
*mpi
, double pts
){
430 mp_image_t
*dmpi
=mpi
->priv
;
432 // printf("vf_scale::put_image(): processing whole frame! dmpi=%p flag=%d\n",
433 // dmpi, (mpi->flags&MP_IMGFLAG_DRAW_CALLBACK));
435 if(!(mpi
->flags
&MP_IMGFLAG_DRAW_CALLBACK
&& dmpi
)){
437 // hope we'll get DR buffer:
438 dmpi
=vf_get_image(vf
->next
,vf
->priv
->fmt
,
439 MP_IMGTYPE_TEMP
, MP_IMGFLAG_ACCEPT_STRIDE
| MP_IMGFLAG_PREFER_ALIGNED_STRIDE
,
440 vf
->priv
->w
, vf
->priv
->h
);
442 scale(vf
->priv
->ctx
, vf
->priv
->ctx
, mpi
->planes
,mpi
->stride
,0,mpi
->h
,dmpi
->planes
,dmpi
->stride
, vf
->priv
->interlaced
);
445 if(vf
->priv
->w
==mpi
->w
&& vf
->priv
->h
==mpi
->h
){
446 // just conversion, no scaling -> keep postprocessing data
447 // this way we can apply pp filter to non-yv12 source using scaler
448 vf_clone_mpi_attributes(dmpi
, mpi
);
451 if(vf
->priv
->palette
) dmpi
->planes
[1]=vf
->priv
->palette
; // export palette!
453 return vf_next_put_image(vf
,dmpi
, pts
);
456 static int control(struct vf_instance
*vf
, int request
, void* data
){
460 int brightness
, contrast
, saturation
, srcRange
, dstRange
;
465 case VFCTRL_GET_EQUALIZER
:
466 r
= sws_getColorspaceDetails(vf
->priv
->ctx
, &inv_table
, &srcRange
, &table
, &dstRange
, &brightness
, &contrast
, &saturation
);
470 if (!strcmp(eq
->item
,"brightness")) {
471 eq
->value
= ((brightness
*100) + (1<<15))>>16;
473 else if (!strcmp(eq
->item
,"contrast")) {
474 eq
->value
= (((contrast
*100) + (1<<15))>>16) - 100;
476 else if (!strcmp(eq
->item
,"saturation")) {
477 eq
->value
= (((saturation
*100) + (1<<15))>>16) - 100;
482 case VFCTRL_SET_EQUALIZER
:
483 r
= sws_getColorspaceDetails(vf
->priv
->ctx
, &inv_table
, &srcRange
, &table
, &dstRange
, &brightness
, &contrast
, &saturation
);
485 //printf("set %f %f %f\n", brightness/(float)(1<<16), contrast/(float)(1<<16), saturation/(float)(1<<16));
488 if (!strcmp(eq
->item
,"brightness")) {
489 brightness
= (( eq
->value
<<16) + 50)/100;
491 else if (!strcmp(eq
->item
,"contrast")) {
492 contrast
= (((eq
->value
+100)<<16) + 50)/100;
494 else if (!strcmp(eq
->item
,"saturation")) {
495 saturation
= (((eq
->value
+100)<<16) + 50)/100;
500 r
= sws_setColorspaceDetails(vf
->priv
->ctx
, inv_table
, srcRange
, table
, dstRange
, brightness
, contrast
, saturation
);
503 r
= sws_setColorspaceDetails(vf
->priv
->ctx2
, inv_table
, srcRange
, table
, dstRange
, brightness
, contrast
, saturation
);
512 return vf_next_control(vf
,request
,data
);
515 //===========================================================================//
517 // supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800
519 static int query_format(struct vf_instance
*vf
, unsigned int fmt
){
520 if (!IMGFMT_IS_HWACCEL(fmt
) && imgfmt2pixfmt(fmt
) != PIX_FMT_NONE
) {
521 unsigned int best
=find_best_out(vf
, fmt
);
523 if(!best
) return 0; // no matching out-fmt
524 flags
=vf_next_query_format(vf
,best
);
525 if(!(flags
&(VFCAP_CSP_SUPPORTED
|VFCAP_CSP_SUPPORTED_BY_HW
))) return 0; // huh?
526 if(fmt
!=best
) flags
&=~VFCAP_CSP_SUPPORTED_BY_HW
;
527 // do not allow scaling, if we are before the PP fliter!
528 if(!(flags
&VFCAP_POSTPROC
)) flags
|=VFCAP_SWSCALE
;
531 return 0; // nomatching in-fmt
534 static void uninit(struct vf_instance
*vf
){
535 if(vf
->priv
->ctx
) sws_freeContext(vf
->priv
->ctx
);
536 if(vf
->priv
->ctx2
) sws_freeContext(vf
->priv
->ctx2
);
537 free(vf
->priv
->palette
);
541 static int vf_open(vf_instance_t
*vf
, char *args
){
543 vf
->start_slice
=start_slice
;
544 vf
->draw_slice
=draw_slice
;
545 vf
->put_image
=put_image
;
546 vf
->query_format
=query_format
;
547 vf
->control
= control
;
549 mp_msg(MSGT_VFILTER
,MSGL_V
,"SwScale params: %d x %d (-1=no scaling)\n",
556 //global sws_flags from the command line
560 static SwsFilter
*src_filter
= NULL
;
562 float sws_lum_gblur
= 0.0;
563 float sws_chr_gblur
= 0.0;
564 int sws_chr_vshift
= 0;
565 int sws_chr_hshift
= 0;
566 float sws_chr_sharpen
= 0.0;
567 float sws_lum_sharpen
= 0.0;
569 int get_sws_cpuflags(void){
571 (gCpuCaps
.hasMMX
? SWS_CPU_CAPS_MMX
: 0)
572 | (gCpuCaps
.hasMMX2
? SWS_CPU_CAPS_MMX2
: 0)
573 | (gCpuCaps
.has3DNow
? SWS_CPU_CAPS_3DNOW
: 0)
574 | (gCpuCaps
.hasAltiVec
? SWS_CPU_CAPS_ALTIVEC
: 0);
577 void sws_getFlagsAndFilterFromCmdLine(int *flags
, SwsFilter
**srcFilterParam
, SwsFilter
**dstFilterParam
)
579 static int firstTime
=1;
584 __asm__
volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
589 *flags
= SWS_PRINT_INFO
;
591 else if( mp_msg_test(MSGT_VFILTER
,MSGL_DBG2
) ) *flags
= SWS_PRINT_INFO
;
593 if(src_filter
) sws_freeFilter(src_filter
);
595 src_filter
= sws_getDefaultFilter(
596 sws_lum_gblur
, sws_chr_gblur
,
597 sws_lum_sharpen
, sws_chr_sharpen
,
598 sws_chr_hshift
, sws_chr_vshift
, verbose
>1);
602 case 0: *flags
|= SWS_FAST_BILINEAR
; break;
603 case 1: *flags
|= SWS_BILINEAR
; break;
604 case 2: *flags
|= SWS_BICUBIC
; break;
605 case 3: *flags
|= SWS_X
; break;
606 case 4: *flags
|= SWS_POINT
; break;
607 case 5: *flags
|= SWS_AREA
; break;
608 case 6: *flags
|= SWS_BICUBLIN
; break;
609 case 7: *flags
|= SWS_GAUSS
; break;
610 case 8: *flags
|= SWS_SINC
; break;
611 case 9: *flags
|= SWS_LANCZOS
; break;
612 case 10:*flags
|= SWS_SPLINE
; break;
613 default:*flags
|= SWS_BILINEAR
; break;
616 *srcFilterParam
= src_filter
;
617 *dstFilterParam
= NULL
;
620 // will use sws_flags & src_filter (from cmd line)
621 struct SwsContext
*sws_getContextFromCmdLine(int srcW
, int srcH
, int srcFormat
, int dstW
, int dstH
, int dstFormat
)
624 SwsFilter
*dstFilterParam
, *srcFilterParam
;
625 enum PixelFormat dfmt
, sfmt
;
627 dfmt
= imgfmt2pixfmt(dstFormat
);
628 sfmt
= imgfmt2pixfmt(srcFormat
);
629 if (srcFormat
== IMGFMT_RGB8
|| srcFormat
== IMGFMT_BGR8
) sfmt
= PIX_FMT_PAL8
;
630 sws_getFlagsAndFilterFromCmdLine(&flags
, &srcFilterParam
, &dstFilterParam
);
632 return sws_getContext(srcW
, srcH
, sfmt
, dstW
, dstH
, dfmt
, flags
| get_sws_cpuflags(), srcFilterParam
, dstFilterParam
, NULL
);
635 /// An example of presets usage
636 static const struct size_preset
{
639 } vf_size_presets_defs
[] = {
640 // TODO add more 'standard' resolutions
641 { "qntsc", 352, 240 },
642 { "qpal", 352, 288 },
643 { "ntsc", 720, 480 },
645 { "sntsc", 640, 480 },
646 { "spal", 768, 576 },
650 #define ST_OFF(f) M_ST_OFF(struct size_preset,f)
651 static const m_option_t vf_size_preset_fields
[] = {
652 {"w", ST_OFF(w
), CONF_TYPE_INT
, M_OPT_MIN
,1 ,0, NULL
},
653 {"h", ST_OFF(h
), CONF_TYPE_INT
, M_OPT_MIN
,1 ,0, NULL
},
654 { NULL
, NULL
, 0, 0, 0, 0, NULL
}
657 static const m_struct_t vf_size_preset
= {
659 sizeof(struct size_preset
),
661 vf_size_preset_fields
664 static const m_struct_t vf_opts
;
665 static const m_obj_presets_t size_preset
= {
666 &vf_size_preset
, // Input struct desc
667 &vf_opts
, // Output struct desc
668 vf_size_presets_defs
, // The list of presets
669 ST_OFF(name
) // At wich offset is the name field in the preset struct
674 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
675 static const m_option_t vf_opts_fields
[] = {
676 {"w", ST_OFF(w
), CONF_TYPE_INT
, M_OPT_MIN
,-11,0, NULL
},
677 {"h", ST_OFF(h
), CONF_TYPE_INT
, M_OPT_MIN
,-11,0, NULL
},
678 {"interlaced", ST_OFF(interlaced
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 1, NULL
},
679 {"chr-drop", ST_OFF(v_chr_drop
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 3, NULL
},
680 {"param" , ST_OFF(param
[0]), CONF_TYPE_DOUBLE
, M_OPT_RANGE
, 0.0, 100.0, NULL
},
681 {"param2", ST_OFF(param
[1]), CONF_TYPE_DOUBLE
, M_OPT_RANGE
, 0.0, 100.0, NULL
},
682 // Note that here the 2 field is NULL (ie 0)
683 // As we want this option to act on the option struct itself
684 {"presize", 0, CONF_TYPE_OBJ_PRESETS
, 0, 0, 0, (void *)&size_preset
},
685 {"noup", ST_OFF(noup
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 2, NULL
},
686 {"arnd", ST_OFF(accurate_rnd
), CONF_TYPE_FLAG
, 0, 0, 1, NULL
},
687 { NULL
, NULL
, 0, 0, 0, 0, NULL
}
690 static const m_struct_t vf_opts
= {
692 sizeof(struct vf_priv_s
),
697 const vf_info_t vf_info_scale
= {
706 //===========================================================================//