summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-16 22:28:12 +0300
committerUoti Urpala <uau@glyph.nonexistent.invalid>2009-09-16 22:28:12 +0300
commite1ecc4315265c465080616b8d8d9257b3aab6ee9 (patch)
treed8a3aacf1b5468c59da202e44c5035924f5c1a3e /libmpcodecs
parent0e1b7765be878491565cf5e471f22b15e106164c (diff)
parent4dae2a980c4313deed6ddb69556d2ead4417119c (diff)
downloadmpv-e1ecc4315265c465080616b8d8d9257b3aab6ee9.tar.bz2
mpv-e1ecc4315265c465080616b8d8d9257b3aab6ee9.tar.xz
Merge svn changes up to r29684
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/vf_expand.c31
-rw-r--r--libmpcodecs/vf_ilpack.c4
-rw-r--r--libmpcodecs/vf_ivtc.c4
-rw-r--r--libmpcodecs/vf_tfields.c4
4 files changed, 31 insertions, 12 deletions
diff --git a/libmpcodecs/vf_expand.c b/libmpcodecs/vf_expand.c
index 7d91e3a236..b6a2822745 100644
--- a/libmpcodecs/vf_expand.c
+++ b/libmpcodecs/vf_expand.c
@@ -26,6 +26,13 @@
#include "m_struct.h"
static struct vf_priv_s {
+ // These four values are a backup of the values parsed from the command line.
+ // This is necessary so that we do not get a mess upon filter reinit due to
+ // e.g. aspect changes and with only aspect specified on the command line,
+ // where we would otherwise use the values calculated for a different aspect
+ // instead of recalculating them again.
+ int cfg_exp_w, cfg_exp_h;
+ int cfg_exp_x, cfg_exp_y;
int exp_w,exp_h;
int exp_x,exp_y;
int osd_enabled;
@@ -196,6 +203,10 @@ static int config(struct vf_instance* vf,
return vf_next_config(vf,width,height,d_width,d_height,flags,outfmt);
}
if (outfmt == IMGFMT_IF09) return 0;
+ vf->priv->exp_x = vf->priv->cfg_exp_x;
+ vf->priv->exp_y = vf->priv->cfg_exp_y;
+ vf->priv->exp_w = vf->priv->cfg_exp_w;
+ vf->priv->exp_h = vf->priv->cfg_exp_h;
// calculate the missing parameters:
#if 0
if(vf->priv->exp_w<width) vf->priv->exp_w=width;
@@ -441,11 +452,11 @@ static int open(vf_instance_t *vf, char* args){
vf->draw_slice=draw_slice;
vf->get_image=get_image;
vf->put_image=put_image;
- mp_msg(MSGT_VFILTER, MSGL_INFO, "Expand: %d x %d, %d ; %d, osd: %d, aspect: %lf, round: %d\n",
- vf->priv->exp_w,
- vf->priv->exp_h,
- vf->priv->exp_x,
- vf->priv->exp_y,
+ mp_msg(MSGT_VFILTER, MSGL_INFO, "Expand: %d x %d, %d ; %d, osd: %d, aspect: %f, round: %d\n",
+ vf->priv->cfg_exp_w,
+ vf->priv->cfg_exp_h,
+ vf->priv->cfg_exp_x,
+ vf->priv->cfg_exp_y,
vf->priv->osd_enabled,
vf->priv->aspect,
vf->priv->round);
@@ -453,11 +464,11 @@ static int open(vf_instance_t *vf, char* args){
}
#define ST_OFF(f) M_ST_OFF(struct vf_priv_s,f)
-static const m_option_t vf_opts_fields[] = {
- {"w", ST_OFF(exp_w), CONF_TYPE_INT, 0, 0 ,0, NULL},
- {"h", ST_OFF(exp_h), CONF_TYPE_INT, 0, 0 ,0, NULL},
- {"x", ST_OFF(exp_x), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
- {"y", ST_OFF(exp_y), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
+static m_option_t vf_opts_fields[] = {
+ {"w", ST_OFF(cfg_exp_w), CONF_TYPE_INT, 0, 0 ,0, NULL},
+ {"h", ST_OFF(cfg_exp_h), CONF_TYPE_INT, 0, 0 ,0, NULL},
+ {"x", ST_OFF(cfg_exp_x), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
+ {"y", ST_OFF(cfg_exp_y), CONF_TYPE_INT, M_OPT_MIN, -1, 0, NULL},
{"osd", ST_OFF(osd_enabled), CONF_TYPE_FLAG, 0 , 0, 1, NULL},
{"aspect", ST_OFF(aspect), CONF_TYPE_DOUBLE, M_OPT_MIN, 0, 0, NULL},
{"round", ST_OFF(round), CONF_TYPE_INT, M_OPT_MIN, 1, 0, NULL},
diff --git a/libmpcodecs/vf_ilpack.c b/libmpcodecs/vf_ilpack.c
index dc586762b4..14ff407412 100644
--- a/libmpcodecs/vf_ilpack.c
+++ b/libmpcodecs/vf_ilpack.c
@@ -88,6 +88,7 @@ static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
pack_nn_C(dst, y, u, v, (w&7));
}
+#if HAVE_EBX_AVAILABLE
static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
unsigned char *u, unsigned char *v, int w, int us, int vs)
{
@@ -307,6 +308,7 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
);
pack_li_1_C(dst, y, u, v, (w&15), us, vs);
}
+#endif /* HAVE_EBX_AVAILABLE */
#endif
static pack_func_t *pack_nn;
@@ -399,8 +401,10 @@ static int open(vf_instance_t *vf, char* args)
#if HAVE_MMX
if(gCpuCaps.hasMMX) {
pack_nn = (pack_func_t *)pack_nn_MMX;
+#if HAVE_EBX_AVAILABLE
pack_li_0 = pack_li_0_MMX;
pack_li_1 = pack_li_1_MMX;
+#endif
}
#endif
diff --git a/libmpcodecs/vf_ivtc.c b/libmpcodecs/vf_ivtc.c
index a5e2356eaa..3f1fc7de69 100644
--- a/libmpcodecs/vf_ivtc.c
+++ b/libmpcodecs/vf_ivtc.c
@@ -40,7 +40,7 @@ enum {
F_SHOW
};
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_EBX_AVAILABLE
static void block_diffs_MMX(struct metrics *m, unsigned char *old, unsigned char *new, int os, int ns)
{
int i;
@@ -516,7 +516,7 @@ static int open(vf_instance_t *vf, char* args)
p->first = 1;
if (args) sscanf(args, "%d", &p->drop);
block_diffs = block_diffs_C;
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_EBX_AVAILABLE
if(gCpuCaps.hasMMX) block_diffs = block_diffs_MMX;
#endif
return 1;
diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c
index 5ec60e3cde..395e55a323 100644
--- a/libmpcodecs/vf_tfields.c
+++ b/libmpcodecs/vf_tfields.c
@@ -169,6 +169,7 @@ static void qpel_li_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds
__asm__ volatile("emms \n\t" : : : "memory");
}
+#if HAVE_EBX_AVAILABLE
static void qpel_4tap_MMX(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up)
{
int i, j, ssd=ss;
@@ -248,6 +249,7 @@ static void qpel_4tap_MMX(unsigned char *d, unsigned char *s, int w, int h, int
if (!up) fast_memcpy(d, s, w);
__asm__ volatile("emms \n\t" : : : "memory");
}
+#endif /* HAVE_EBX_AVAILABLE */
#endif
static inline int clamp(int a)
@@ -482,8 +484,10 @@ static int open(vf_instance_t *vf, char* args)
qpel_4tap = qpel_4tap_C;
#if HAVE_MMX
if(gCpuCaps.hasMMX) qpel_li = qpel_li_MMX;
+#if HAVE_EBX_AVAILABLE
if(gCpuCaps.hasMMX) qpel_4tap = qpel_4tap_MMX;
#endif
+#endif
#if HAVE_MMX2
if(gCpuCaps.hasMMX2) qpel_li = qpel_li_MMX2;
#endif