comparison libmpcodecs/vf_scale.c @ 17646:168d8eb397f1

no upscale flag so automatic downscaling is possible in mencoder
author michael
date Sat, 18 Feb 2006 21:12:56 +0000
parents f580a7755ac5
children 0f314c38ce57
comparison
equal deleted inserted replaced
17645:8db0816a9226 17646:168d8eb397f1
25 unsigned int fmt; 25 unsigned int fmt;
26 struct SwsContext *ctx; 26 struct SwsContext *ctx;
27 struct SwsContext *ctx2; //for interlaced slices only 27 struct SwsContext *ctx2; //for interlaced slices only
28 unsigned char* palette; 28 unsigned char* palette;
29 int interlaced; 29 int interlaced;
30 int noup;
30 int query_format_cache[64]; 31 int query_format_cache[64];
31 } vf_priv_dflt = { 32 } vf_priv_dflt = {
32 -1,-1, 33 -1,-1,
33 0, 34 0,
34 {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT}, 35 {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT},
142 vf->priv->w=d_width; 143 vf->priv->w=d_width;
143 vf->priv->h=d_height; 144 vf->priv->h=d_height;
144 } 145 }
145 } 146 }
146 147
148 if(vf->priv->noup){
149 if(vf->priv->w > width)
150 vf->priv->w= width;
151 if(vf->priv->h > height)
152 vf->priv->h= height;
153 }
154
147 if (vf->priv->w <= -8) { 155 if (vf->priv->w <= -8) {
148 vf->priv->w += 8; 156 vf->priv->w += 8;
149 round_w = 1; 157 round_w = 1;
150 } 158 }
151 if (vf->priv->h <= -8) { 159 if (vf->priv->h <= -8) {
601 {"param" , ST_OFF(param[0]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL}, 609 {"param" , ST_OFF(param[0]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL},
602 {"param2", ST_OFF(param[1]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL}, 610 {"param2", ST_OFF(param[1]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL},
603 // Note that here the 2 field is NULL (ie 0) 611 // Note that here the 2 field is NULL (ie 0)
604 // As we want this option to act on the option struct itself 612 // As we want this option to act on the option struct itself
605 {"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, &size_preset}, 613 {"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, &size_preset},
614 {"noup", ST_OFF(noup), CONF_TYPE_INT, M_OPT_RANGE, 0, 1, NULL},
606 { NULL, NULL, 0, 0, 0, 0, NULL } 615 { NULL, NULL, 0, 0, 0, 0, NULL }
607 }; 616 };
608 617
609 static m_struct_t vf_opts = { 618 static m_struct_t vf_opts = {
610 "scale", 619 "scale",