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"
28 #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 unsigned int best
=find_best_out(vf
, outfmt
);
174 int round_w
=0, round_h
=0;
176 SwsFilter
*srcFilter
, *dstFilter
;
177 enum PixelFormat dfmt
, sfmt
;
180 mp_msg(MSGT_VFILTER
,MSGL_WARN
,"SwScale: no supported outfmt found :(\n");
183 sfmt
= imgfmt2pixfmt(outfmt
);
184 if (outfmt
== IMGFMT_RGB8
|| outfmt
== IMGFMT_BGR8
) sfmt
= PIX_FMT_PAL8
;
185 dfmt
= imgfmt2pixfmt(best
);
187 vo_flags
=vf
->next
->query_format(vf
->next
,best
);
189 // scaling to dwidth*d_height, if all these TRUE:
191 // - no other sw/hw up/down scaling avail.
192 // - we're after postproc
193 // - user didn't set w:h
194 if(!(vo_flags
&VFCAP_POSTPROC
) && (flags
&4) &&
195 vf
->priv
->w
<0 && vf
->priv
->h
<0){ // -zoom
196 int x
=(vo_flags
&VFCAP_SWSCALE
) ? 0 : 1;
197 if(d_width
<width
|| d_height
<height
){
199 if(vo_flags
&VFCAP_HWSCALE_DOWN
) x
=0;
202 if(vo_flags
&VFCAP_HWSCALE_UP
) x
=0;
205 // user wants sw scaling! (-zoom)
207 vf
->priv
->h
=d_height
;
212 if((vf
->priv
->w
> width
) + (vf
->priv
->h
> height
) >= vf
->priv
->noup
){
218 if (vf
->priv
->w
<= -8) {
222 if (vf
->priv
->h
<= -8) {
227 if (vf
->priv
->w
< -3 || vf
->priv
->h
< -3 ||
228 (vf
->priv
->w
< -1 && vf
->priv
->h
< -1)) {
229 // TODO: establish a direct connection to the user's brain
230 // and find out what the heck he thinks MPlayer should do
231 // with this nonsense.
232 mp_msg(MSGT_VFILTER
, MSGL_ERR
, "SwScale: EUSERBROKEN Check your parameters, they make no sense!\n");
236 if (vf
->priv
->w
== -1)
238 if (vf
->priv
->w
== 0)
239 vf
->priv
->w
= d_width
;
241 if (vf
->priv
->h
== -1)
242 vf
->priv
->h
= height
;
243 if (vf
->priv
->h
== 0)
244 vf
->priv
->h
= d_height
;
246 if (vf
->priv
->w
== -3)
247 vf
->priv
->w
= vf
->priv
->h
* width
/ height
;
248 if (vf
->priv
->w
== -2)
249 vf
->priv
->w
= vf
->priv
->h
* d_width
/ d_height
;
251 if (vf
->priv
->h
== -3)
252 vf
->priv
->h
= vf
->priv
->w
* height
/ width
;
253 if (vf
->priv
->h
== -2)
254 vf
->priv
->h
= vf
->priv
->w
* d_height
/ d_width
;
257 vf
->priv
->w
= ((vf
->priv
->w
+ 8) / 16) * 16;
259 vf
->priv
->h
= ((vf
->priv
->h
+ 8) / 16) * 16;
261 // calculate the missing parameters:
263 case IMGFMT_YV12
: /* YV12 needs w & h rounded to 2 */
268 vf
->priv
->h
= (vf
->priv
->h
+ 1) & ~1;
269 case IMGFMT_YUY2
: /* YUY2 needs w rounded to 2 */
271 vf
->priv
->w
= (vf
->priv
->w
+ 1) & ~1;
274 mp_msg(MSGT_VFILTER
,MSGL_DBG2
,"SwScale: scaling %dx%d %s to %dx%d %s \n",
275 width
,height
,vo_format_name(outfmt
),
276 vf
->priv
->w
,vf
->priv
->h
,vo_format_name(best
));
279 if(vf
->priv
->ctx
) sws_freeContext(vf
->priv
->ctx
);
280 if(vf
->priv
->ctx2
)sws_freeContext(vf
->priv
->ctx2
);
283 sws_getFlagsAndFilterFromCmdLine(&int_sws_flags
, &srcFilter
, &dstFilter
);
284 int_sws_flags
|= vf
->priv
->v_chr_drop
<< SWS_SRC_V_CHR_DROP_SHIFT
;
285 int_sws_flags
|= vf
->priv
->accurate_rnd
* SWS_ACCURATE_RND
;
286 vf
->priv
->ctx
=sws_getContext(width
, height
>> vf
->priv
->interlaced
,
288 vf
->priv
->w
, vf
->priv
->h
>> vf
->priv
->interlaced
,
290 int_sws_flags
| get_sws_cpuflags(), srcFilter
, dstFilter
, vf
->priv
->param
);
291 if(vf
->priv
->interlaced
){
292 vf
->priv
->ctx2
=sws_getContext(width
, height
>> 1,
294 vf
->priv
->w
, vf
->priv
->h
>> 1,
296 int_sws_flags
| get_sws_cpuflags(), srcFilter
, dstFilter
, vf
->priv
->param
);
300 mp_msg(MSGT_VFILTER
,MSGL_WARN
,"Couldn't init SwScaler for this setup\n");
305 if(vf
->priv
->palette
){
306 free(vf
->priv
->palette
);
307 vf
->priv
->palette
=NULL
;
311 /* set 332 palette for 8 bpp */
312 vf
->priv
->palette
=malloc(4*256);
313 for(i
=0; i
<256; i
++){
314 vf
->priv
->palette
[4*i
+0]=4*(i
>>6)*21;
315 vf
->priv
->palette
[4*i
+1]=4*((i
>>3)&7)*9;
316 vf
->priv
->palette
[4*i
+2]=4*((i
&7)&7)*9;
317 vf
->priv
->palette
[4*i
+3]=0;
321 /* set 332 palette for 8 bpp */
322 vf
->priv
->palette
=malloc(4*256);
323 for(i
=0; i
<256; i
++){
324 vf
->priv
->palette
[4*i
+0]=4*(i
&3)*21;
325 vf
->priv
->palette
[4*i
+1]=4*((i
>>2)&7)*9;
326 vf
->priv
->palette
[4*i
+2]=4*((i
>>5)&7)*9;
327 vf
->priv
->palette
[4*i
+3]=0;
332 vf
->priv
->palette
=malloc(4*16);
334 vf
->priv
->palette
[4*i
+0]=4*(i
&1)*63;
335 vf
->priv
->palette
[4*i
+1]=4*((i
>>1)&3)*21;
336 vf
->priv
->palette
[4*i
+2]=4*((i
>>3)&1)*63;
337 vf
->priv
->palette
[4*i
+3]=0;
342 vf
->priv
->palette
=malloc(4*16);
344 vf
->priv
->palette
[4*i
+0]=4*(i
>>3)*63;
345 vf
->priv
->palette
[4*i
+1]=4*((i
>>1)&3)*21;
346 vf
->priv
->palette
[4*i
+2]=4*((i
&1)&1)*63;
347 vf
->priv
->palette
[4*i
+3]=0;
352 if(!opt_screen_size_x
&& !opt_screen_size_y
&& !(screen_size_xy
>= 0.001)){
353 // Compute new d_width and d_height, preserving aspect
354 // while ensuring that both are >= output size in pixels.
355 if (vf
->priv
->h
* d_width
> vf
->priv
->w
* d_height
) {
356 d_width
= vf
->priv
->h
* d_width
/ d_height
;
357 d_height
= vf
->priv
->h
;
359 d_height
= vf
->priv
->w
* d_height
/ d_width
;
360 d_width
= vf
->priv
->w
;
362 //d_width=d_width*vf->priv->w/width;
363 //d_height=d_height*vf->priv->h/height;
365 return vf_next_config(vf
,vf
->priv
->w
,vf
->priv
->h
,d_width
,d_height
,flags
,best
);
368 static void start_slice(struct vf_instance
*vf
, mp_image_t
*mpi
){
369 // printf("start_slice called! flag=%d\n",mpi->flags&MP_IMGFLAG_DRAW_CALLBACK);
370 if(!(mpi
->flags
&MP_IMGFLAG_DRAW_CALLBACK
)) return; // shouldn't happen
371 // they want slices!!! allocate the buffer.
372 mpi
->priv
=vf
->dmpi
=vf_get_image(vf
->next
,vf
->priv
->fmt
,
373 // mpi->type, mpi->flags & (~MP_IMGFLAG_DRAW_CALLBACK),
374 MP_IMGTYPE_TEMP
, MP_IMGFLAG_ACCEPT_STRIDE
| MP_IMGFLAG_PREFER_ALIGNED_STRIDE
,
375 vf
->priv
->w
, vf
->priv
->h
);
378 static void scale(struct SwsContext
*sws1
, struct SwsContext
*sws2
, uint8_t *src
[MP_MAX_PLANES
], int src_stride
[MP_MAX_PLANES
],
379 int y
, int h
, uint8_t *dst
[MP_MAX_PLANES
], int dst_stride
[MP_MAX_PLANES
], int interlaced
){
380 uint8_t *src2
[MP_MAX_PLANES
]={src
[0], src
[1], src
[2], src
[3]};
383 if (src
[1] && !src
[2]){
386 pal2
[i
]= bswap_32(((uint32_t*)src
[1])[i
]);
393 uint8_t *dst2
[MP_MAX_PLANES
]={dst
[0], dst
[1], dst
[2], dst
[3]};
394 int src_stride2
[MP_MAX_PLANES
]={2*src_stride
[0], 2*src_stride
[1], 2*src_stride
[2], 2*src_stride
[3]};
395 int dst_stride2
[MP_MAX_PLANES
]={2*dst_stride
[0], 2*dst_stride
[1], 2*dst_stride
[2], 2*dst_stride
[3]};
397 sws_scale(sws1
, src2
, src_stride2
, y
>>1, h
>>1, dst2
, dst_stride2
);
398 for(i
=0; i
<MP_MAX_PLANES
; i
++){
399 src2
[i
] += src_stride
[i
];
400 dst2
[i
] += dst_stride
[i
];
402 sws_scale(sws2
, src2
, src_stride2
, y
>>1, h
>>1, dst2
, dst_stride2
);
404 sws_scale(sws1
, src2
, src_stride
, y
, h
, dst
, dst_stride
);
408 static void draw_slice(struct vf_instance
*vf
,
409 unsigned char** src
, int* stride
, int w
,int h
, int x
, int y
){
410 mp_image_t
*dmpi
=vf
->dmpi
;
412 mp_msg(MSGT_VFILTER
,MSGL_FATAL
,"vf_scale: draw_slice() called with dmpi=NULL (no get_image?)\n");
415 // printf("vf_scale::draw_slice() y=%d h=%d\n",y,h);
416 scale(vf
->priv
->ctx
, vf
->priv
->ctx2
, src
, stride
, y
, h
, dmpi
->planes
, dmpi
->stride
, vf
->priv
->interlaced
);
419 static int put_image(struct vf_instance
*vf
, mp_image_t
*mpi
, double pts
){
420 mp_image_t
*dmpi
=mpi
->priv
;
422 // printf("vf_scale::put_image(): processing whole frame! dmpi=%p flag=%d\n",
423 // dmpi, (mpi->flags&MP_IMGFLAG_DRAW_CALLBACK));
425 if(!(mpi
->flags
&MP_IMGFLAG_DRAW_CALLBACK
&& dmpi
)){
427 // hope we'll get DR buffer:
428 dmpi
=vf_get_image(vf
->next
,vf
->priv
->fmt
,
429 MP_IMGTYPE_TEMP
, MP_IMGFLAG_ACCEPT_STRIDE
| MP_IMGFLAG_PREFER_ALIGNED_STRIDE
,
430 vf
->priv
->w
, vf
->priv
->h
);
432 scale(vf
->priv
->ctx
, vf
->priv
->ctx
, mpi
->planes
,mpi
->stride
,0,mpi
->h
,dmpi
->planes
,dmpi
->stride
, vf
->priv
->interlaced
);
435 if(vf
->priv
->w
==mpi
->w
&& vf
->priv
->h
==mpi
->h
){
436 // just conversion, no scaling -> keep postprocessing data
437 // this way we can apply pp filter to non-yv12 source using scaler
438 vf_clone_mpi_attributes(dmpi
, mpi
);
441 if(vf
->priv
->palette
) dmpi
->planes
[1]=vf
->priv
->palette
; // export palette!
443 return vf_next_put_image(vf
,dmpi
, pts
);
446 static int control(struct vf_instance
*vf
, int request
, void* data
){
450 int brightness
, contrast
, saturation
, srcRange
, dstRange
;
455 case VFCTRL_GET_EQUALIZER
:
456 r
= sws_getColorspaceDetails(vf
->priv
->ctx
, &inv_table
, &srcRange
, &table
, &dstRange
, &brightness
, &contrast
, &saturation
);
460 if (!strcmp(eq
->item
,"brightness")) {
461 eq
->value
= ((brightness
*100) + (1<<15))>>16;
463 else if (!strcmp(eq
->item
,"contrast")) {
464 eq
->value
= (((contrast
*100) + (1<<15))>>16) - 100;
466 else if (!strcmp(eq
->item
,"saturation")) {
467 eq
->value
= (((saturation
*100) + (1<<15))>>16) - 100;
472 case VFCTRL_SET_EQUALIZER
:
473 r
= sws_getColorspaceDetails(vf
->priv
->ctx
, &inv_table
, &srcRange
, &table
, &dstRange
, &brightness
, &contrast
, &saturation
);
475 //printf("set %f %f %f\n", brightness/(float)(1<<16), contrast/(float)(1<<16), saturation/(float)(1<<16));
478 if (!strcmp(eq
->item
,"brightness")) {
479 brightness
= (( eq
->value
<<16) + 50)/100;
481 else if (!strcmp(eq
->item
,"contrast")) {
482 contrast
= (((eq
->value
+100)<<16) + 50)/100;
484 else if (!strcmp(eq
->item
,"saturation")) {
485 saturation
= (((eq
->value
+100)<<16) + 50)/100;
490 r
= sws_setColorspaceDetails(vf
->priv
->ctx
, inv_table
, srcRange
, table
, dstRange
, brightness
, contrast
, saturation
);
493 r
= sws_setColorspaceDetails(vf
->priv
->ctx2
, inv_table
, srcRange
, table
, dstRange
, brightness
, contrast
, saturation
);
502 return vf_next_control(vf
,request
,data
);
505 //===========================================================================//
507 // supported Input formats: YV12, I420, IYUV, YUY2, UYVY, BGR32, BGR24, BGR16, BGR15, RGB32, RGB24, Y8, Y800
509 static int query_format(struct vf_instance
*vf
, unsigned int fmt
){
531 case IMGFMT_444P16_LE
:
532 case IMGFMT_444P16_BE
:
533 case IMGFMT_422P16_LE
:
534 case IMGFMT_422P16_BE
:
535 case IMGFMT_420P16_LE
:
536 case IMGFMT_420P16_BE
:
544 unsigned int best
=find_best_out(vf
, fmt
);
546 if(!best
) return 0; // no matching out-fmt
547 flags
=vf_next_query_format(vf
,best
);
548 if(!(flags
&(VFCAP_CSP_SUPPORTED
|VFCAP_CSP_SUPPORTED_BY_HW
))) return 0; // huh?
549 if(fmt
!=best
) flags
&=~VFCAP_CSP_SUPPORTED_BY_HW
;
550 // do not allow scaling, if we are before the PP fliter!
551 if(!(flags
&VFCAP_POSTPROC
)) flags
|=VFCAP_SWSCALE
;
555 return 0; // nomatching in-fmt
558 static void uninit(struct vf_instance
*vf
){
559 if(vf
->priv
->ctx
) sws_freeContext(vf
->priv
->ctx
);
560 if(vf
->priv
->ctx2
) sws_freeContext(vf
->priv
->ctx2
);
561 if(vf
->priv
->palette
) free(vf
->priv
->palette
);
565 static int vf_open(vf_instance_t
*vf
, char *args
){
567 vf
->start_slice
=start_slice
;
568 vf
->draw_slice
=draw_slice
;
569 vf
->put_image
=put_image
;
570 vf
->query_format
=query_format
;
571 vf
->control
= control
;
573 mp_msg(MSGT_VFILTER
,MSGL_V
,"SwScale params: %d x %d (-1=no scaling)\n",
580 //global sws_flags from the command line
584 static SwsFilter
*src_filter
= NULL
;
586 float sws_lum_gblur
= 0.0;
587 float sws_chr_gblur
= 0.0;
588 int sws_chr_vshift
= 0;
589 int sws_chr_hshift
= 0;
590 float sws_chr_sharpen
= 0.0;
591 float sws_lum_sharpen
= 0.0;
593 int get_sws_cpuflags(void){
595 (gCpuCaps
.hasMMX
? SWS_CPU_CAPS_MMX
: 0)
596 | (gCpuCaps
.hasMMX2
? SWS_CPU_CAPS_MMX2
: 0)
597 | (gCpuCaps
.has3DNow
? SWS_CPU_CAPS_3DNOW
: 0)
598 | (gCpuCaps
.hasAltiVec
? SWS_CPU_CAPS_ALTIVEC
: 0);
601 void sws_getFlagsAndFilterFromCmdLine(int *flags
, SwsFilter
**srcFilterParam
, SwsFilter
**dstFilterParam
)
603 static int firstTime
=1;
608 __asm__
volatile("emms\n\t"::: "memory"); //FIXME this should not be required but it IS (even for non-MMX versions)
613 *flags
= SWS_PRINT_INFO
;
615 else if( mp_msg_test(MSGT_VFILTER
,MSGL_DBG2
) ) *flags
= SWS_PRINT_INFO
;
617 if(src_filter
) sws_freeFilter(src_filter
);
619 src_filter
= sws_getDefaultFilter(
620 sws_lum_gblur
, sws_chr_gblur
,
621 sws_lum_sharpen
, sws_chr_sharpen
,
622 sws_chr_hshift
, sws_chr_vshift
, verbose
>1);
626 case 0: *flags
|= SWS_FAST_BILINEAR
; break;
627 case 1: *flags
|= SWS_BILINEAR
; break;
628 case 2: *flags
|= SWS_BICUBIC
; break;
629 case 3: *flags
|= SWS_X
; break;
630 case 4: *flags
|= SWS_POINT
; break;
631 case 5: *flags
|= SWS_AREA
; break;
632 case 6: *flags
|= SWS_BICUBLIN
; break;
633 case 7: *flags
|= SWS_GAUSS
; break;
634 case 8: *flags
|= SWS_SINC
; break;
635 case 9: *flags
|= SWS_LANCZOS
; break;
636 case 10:*flags
|= SWS_SPLINE
; break;
637 default:*flags
|= SWS_BILINEAR
; break;
640 *srcFilterParam
= src_filter
;
641 *dstFilterParam
= NULL
;
644 // will use sws_flags & src_filter (from cmd line)
645 struct SwsContext
*sws_getContextFromCmdLine(int srcW
, int srcH
, int srcFormat
, int dstW
, int dstH
, int dstFormat
)
648 SwsFilter
*dstFilterParam
, *srcFilterParam
;
649 enum PixelFormat dfmt
, sfmt
;
651 dfmt
= imgfmt2pixfmt(dstFormat
);
652 sfmt
= imgfmt2pixfmt(srcFormat
);
653 if (srcFormat
== IMGFMT_RGB8
|| srcFormat
== IMGFMT_BGR8
) sfmt
= PIX_FMT_PAL8
;
654 sws_getFlagsAndFilterFromCmdLine(&flags
, &srcFilterParam
, &dstFilterParam
);
656 return sws_getContext(srcW
, srcH
, sfmt
, dstW
, dstH
, dfmt
, flags
| get_sws_cpuflags(), srcFilterParam
, dstFilterParam
, NULL
);
659 /// An example of presets usage
660 static const struct size_preset
{
663 } vf_size_presets_defs
[] = {
664 // TODO add more 'standard' resolutions
665 { "qntsc", 352, 240 },
666 { "qpal", 352, 288 },
667 { "ntsc", 720, 480 },
669 { "sntsc", 640, 480 },
670 { "spal", 768, 576 },
674 #define ST_OFF(f) M_ST_OFF(struct size_preset,f)
675 static const m_option_t vf_size_preset_fields
[] = {
676 {"w", ST_OFF(w
), CONF_TYPE_INT
, M_OPT_MIN
,1 ,0, NULL
},
677 {"h", ST_OFF(h
), CONF_TYPE_INT
, M_OPT_MIN
,1 ,0, NULL
},
678 { NULL
, NULL
, 0, 0, 0, 0, NULL
}
681 static const m_struct_t vf_size_preset
= {
683 sizeof(struct size_preset
),
685 vf_size_preset_fields
688 static const m_struct_t vf_opts
;
689 static const m_obj_presets_t size_preset
= {
690 &vf_size_preset
, // Input struct desc
691 &vf_opts
, // Output struct desc
692 vf_size_presets_defs
, // The list of presets
693 ST_OFF(name
) // At wich offset is the name field in the preset struct
698 #define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
699 static const m_option_t vf_opts_fields
[] = {
700 {"w", ST_OFF(w
), CONF_TYPE_INT
, M_OPT_MIN
,-11,0, NULL
},
701 {"h", ST_OFF(h
), CONF_TYPE_INT
, M_OPT_MIN
,-11,0, NULL
},
702 {"interlaced", ST_OFF(interlaced
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 1, NULL
},
703 {"chr-drop", ST_OFF(v_chr_drop
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 3, NULL
},
704 {"param" , ST_OFF(param
[0]), CONF_TYPE_DOUBLE
, M_OPT_RANGE
, 0.0, 100.0, NULL
},
705 {"param2", ST_OFF(param
[1]), CONF_TYPE_DOUBLE
, M_OPT_RANGE
, 0.0, 100.0, NULL
},
706 // Note that here the 2 field is NULL (ie 0)
707 // As we want this option to act on the option struct itself
708 {"presize", 0, CONF_TYPE_OBJ_PRESETS
, 0, 0, 0, &size_preset
},
709 {"noup", ST_OFF(noup
), CONF_TYPE_INT
, M_OPT_RANGE
, 0, 2, NULL
},
710 {"arnd", ST_OFF(accurate_rnd
), CONF_TYPE_FLAG
, 0, 0, 1, NULL
},
711 { NULL
, NULL
, 0, 0, 0, 0, NULL
}
714 static const m_struct_t vf_opts
= {
716 sizeof(struct vf_priv_s
),
721 const vf_info_t vf_info_scale
= {
730 //===========================================================================//