summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/vf_scale.c
diff options
context:
space:
mode:
authormichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-24 10:36:06 +0000
committermichael <michael@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-07-24 10:36:06 +0000
commit14ddfdddf8697c478f005168d92333beaa7ba20c (patch)
tree755d64b6d869dc3a497edce4dd5402586cbb2b8f /libmpcodecs/vf_scale.c
parent53ab918dcf7c2655ca11a42d2343289ac86716f0 (diff)
downloadmpv-14ddfdddf8697c478f005168d92333beaa7ba20c.tar.bz2
mpv-14ddfdddf8697c478f005168d92333beaa7ba20c.tar.xz
vertical scaler with accurate rounding, some people on doom9 can see +-1 errors
the +-1 issue is limited to >2tap vertical filters, so bilinear upscale was unaffected the new code is sometime faster sometimes slower but the difference is significant (~20%) so its optional and enabled with arnd=1 git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@19177 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/vf_scale.c')
-rw-r--r--libmpcodecs/vf_scale.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c
index 008603e832..c65e0b2495 100644
--- a/libmpcodecs/vf_scale.c
+++ b/libmpcodecs/vf_scale.c
@@ -28,6 +28,7 @@ static struct vf_priv_s {
unsigned char* palette;
int interlaced;
int noup;
+ int accurate_rnd;
int query_format_cache[64];
} vf_priv_dflt = {
-1,-1,
@@ -219,6 +220,7 @@ 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->accurate_rnd * SWS_ACCURATE_RND;
vf->priv->ctx=sws_getContext(width, height >> vf->priv->interlaced,
outfmt,
vf->priv->w, vf->priv->h >> vf->priv->interlaced,
@@ -470,6 +472,7 @@ static int open(vf_instance_t *vf, char* args){
vf->priv->w=
vf->priv->h=-1;
vf->priv->v_chr_drop=0;
+ vf->priv->accurate_rnd=0;
vf->priv->param[0]=
vf->priv->param[1]=SWS_PARAM_DEFAULT;
vf->priv->palette=NULL;
@@ -612,6 +615,7 @@ static m_option_t vf_opts_fields[] = {
// As we want this option to act on the option struct itself
{"presize", 0, CONF_TYPE_OBJ_PRESETS, 0, 0, 0, &size_preset},
{"noup", ST_OFF(noup), CONF_TYPE_INT, M_OPT_RANGE, 0, 1, NULL},
+ {"arnd", ST_OFF(accurate_rnd), CONF_TYPE_FLAG, 0, 0, 1, NULL},
{ NULL, NULL, 0, 0, 0, 0, NULL }
};