summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-09-18 00:08:17 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-09-18 00:08:17 +0000
commit54df7e4a3e18fd212bae3bdf665cd0455f031eb6 (patch)
tree43d1dfd83eaa1c4472be09f234377cf2af6fc422 /libmpcodecs
parent5e71ad8c1ee1248b32924aecc0b4bce42265e3b8 (diff)
downloadmpv-54df7e4a3e18fd212bae3bdf665cd0455f031eb6.tar.bz2
mpv-54df7e4a3e18fd212bae3bdf665cd0455f031eb6.tar.xz
passing an array or double precission parameters for the scaling function, instead of missusing a few bits of the flags
fixing the naming of the scaling functions a little git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@13374 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_sab.c2
-rw-r--r--libmpcodecs/vf_scale.c22
-rw-r--r--libmpcodecs/vf_smartblur.c2
3 files changed, 14 insertions, 12 deletions
diff --git a/libmpcodecs/vf_sab.c b/libmpcodecs/vf_sab.c
index 58729b1957..6c2ddb81c3 100644
--- a/libmpcodecs/vf_sab.c
+++ b/libmpcodecs/vf_sab.c
@@ -100,7 +100,7 @@ static int allocStuff(FilterParam *f, int width, int height){
swsF.lumH= swsF.lumV= vec;
swsF.chrH= swsF.chrV= NULL;
f->preFilterContext= sws_getContext(
- width, height, IMGFMT_Y8, width, height, IMGFMT_Y8, get_sws_cpuflags(), &swsF, NULL);
+ width, height, IMGFMT_Y8, width, height, IMGFMT_Y8, get_sws_cpuflags(), &swsF, NULL, NULL);
sws_freeVec(vec);
vec = sws_getGaussianVec(f->strength, 5.0);
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index 899b095876..ff0e291640 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -21,7 +21,7 @@
static struct vf_priv_s {
int w,h;
int v_chr_drop;
- int param;
+ double param[2];
unsigned int fmt;
struct SwsContext *ctx;
struct SwsContext *ctx2; //for interlaced slices only
@@ -31,7 +31,7 @@ static struct vf_priv_s {
} vf_priv_dflt = {
-1,-1,
0,
- 0,
+ {SWS_PARAM_DEFAULT, SWS_PARAM_DEFAULT},
0,
NULL,
NULL,
@@ -186,18 +186,17 @@ static int config(struct vf_instance_s* vf,
// new swscaler:
sws_getFlagsAndFilterFromCmdLine(&int_sws_flags, &srcFilter, &dstFilter);
int_sws_flags|= vf->priv->v_chr_drop << SWS_SRC_V_CHR_DROP_SHIFT;
- int_sws_flags|= vf->priv->param << SWS_PARAM_SHIFT;
vf->priv->ctx=sws_getContext(width, height >> vf->priv->interlaced,
outfmt,
vf->priv->w, vf->priv->h >> vf->priv->interlaced,
best,
- int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter);
+ int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
if(vf->priv->interlaced){
vf->priv->ctx2=sws_getContext(width, height >> 1,
outfmt,
vf->priv->w, vf->priv->h >> 1,
best,
- int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter);
+ int_sws_flags | get_sws_cpuflags(), srcFilter, dstFilter, vf->priv->param);
}
if(!vf->priv->ctx){
// error...
@@ -438,14 +437,16 @@ static int open(vf_instance_t *vf, char* args){
vf->priv->w=
vf->priv->h=-1;
vf->priv->v_chr_drop=0;
- vf->priv->param=0;
+ vf->priv->param[0]=
+ vf->priv->param[1]=SWS_PARAM_DEFAULT;
vf->priv->palette=NULL;
} // if(!vf->priv)
- if(args) sscanf(args, "%d:%d:%d:%d",
+ if(args) sscanf(args, "%d:%d:%d:%lf:%lf",
&vf->priv->w,
&vf->priv->h,
&vf->priv->v_chr_drop,
- &vf->priv->param);
+ &vf->priv->param[0],
+ &vf->priv->param[1]);
mp_msg(MSGT_VFILTER,MSGL_V,"SwScale params: %d x %d (-1=no scaling)\n",
vf->priv->w,
vf->priv->h);
@@ -524,7 +525,7 @@ struct SwsContext *sws_getContextFromCmdLine(int srcW, int srcH, int srcFormat,
SwsFilter *dstFilterParam, *srcFilterParam;
sws_getFlagsAndFilterFromCmdLine(&flags, &srcFilterParam, &dstFilterParam);
- return sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat, flags | get_sws_cpuflags(), srcFilterParam, dstFilterParam);
+ return sws_getContext(srcW, srcH, srcFormat, dstW, dstH, dstFormat, flags | get_sws_cpuflags(), srcFilterParam, dstFilterParam, NULL);
}
/// An example of presets usage
@@ -572,7 +573,8 @@ static m_option_t vf_opts_fields[] = {
{"h", ST_OFF(h), CONF_TYPE_INT, M_OPT_MIN,-3 ,0, NULL},
{"interlaced", ST_OFF(interlaced), CONF_TYPE_INT, M_OPT_RANGE, 0, 1, NULL},
{"chr-drop", ST_OFF(v_chr_drop), CONF_TYPE_INT, M_OPT_RANGE, 0, 3, NULL},
- {"param", ST_OFF(param), CONF_TYPE_INT, M_OPT_RANGE, 0, 100, NULL},
+ {"param" , ST_OFF(param[0]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL},
+ {"param2", ST_OFF(param[1]), CONF_TYPE_DOUBLE, M_OPT_RANGE, 0.0, 100.0, NULL},
// Note that here the 2 field is NULL (ie 0)
// As we want this option to act on the option struct itself
{"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, &size_preset},
diff --git a/libmpcodecs/vf_smartblur.c b/libmpcodecs/vf_smartblur.c
index cd817de5d1..bdc4064ed2 100644
--- a/libmpcodecs/vf_smartblur.c
+++ b/libmpcodecs/vf_smartblur.c
@@ -95,7 +95,7 @@ static int allocStuff(FilterParam *f, int width, int height){
swsF.lumH= swsF.lumV= vec;
swsF.chrH= swsF.chrV= NULL;
f->filterContext= sws_getContext(
- width, height, IMGFMT_Y8, width, height, IMGFMT_Y8, get_sws_cpuflags(), &swsF, NULL);
+ width, height, IMGFMT_Y8, width, height, IMGFMT_Y8, get_sws_cpuflags(), &swsF, NULL, NULL);
sws_freeVec(vec);