summaryrefslogtreecommitdiffstats
path: root/libmpcodecs
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-06-10 05:06:34 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2004-06-10 05:06:34 +0000
commitff86bb362e7ecb66a24894b820b39d3407b0cff9 (patch)
treea216540ab3461d0ec89641f369e57e2add11de79 /libmpcodecs
parent8e68ace3ab3ce423723ce5b94ee01390fb0894a9 (diff)
downloadmpv-ff86bb362e7ecb66a24894b820b39d3407b0cff9.tar.bz2
mpv-ff86bb362e7ecb66a24894b820b39d3407b0cff9.tar.xz
old changes in my local tree i forgot to commit - minor fixes
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@12549 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs')
-rw-r--r--libmpcodecs/pullup.c7
-rw-r--r--libmpcodecs/vf_pullup.c51
2 files changed, 56 insertions, 2 deletions
diff --git a/libmpcodecs/pullup.c b/libmpcodecs/pullup.c
index 6914d114c6..4ed0e9a10f 100644
--- a/libmpcodecs/pullup.c
+++ b/libmpcodecs/pullup.c
@@ -424,10 +424,13 @@ static void compute_breaks(struct pullup_context *c, struct pullup_field *f0)
/* Special case when fields are 100% identical */
if (f0->buffer == f2->buffer && f1->buffer != f3->buffer) {
- f0->breaks |= BREAK_LEFT;
f2->breaks |= BREAK_RIGHT;
return;
}
+ if (f0->buffer != f2->buffer && f1->buffer == f3->buffer) {
+ f1->breaks |= BREAK_LEFT;
+ return;
+ }
for (i = 0; i < c->metric_len; i++) {
l = f2->diffs[i] - f3->diffs[i];
@@ -677,7 +680,7 @@ void pullup_init_context(struct pullup_context *c)
c->comb = licomb_y_mmx;
}
#endif
- //c->comb = qpcomb_y;
+ /* c->comb = qpcomb_y; */
break;
#if 0
case PULLUP_FMT_YUY2:
diff --git a/libmpcodecs/vf_pullup.c b/libmpcodecs/vf_pullup.c
index 07a38c2deb..08a293f23e 100644
--- a/libmpcodecs/vf_pullup.c
+++ b/libmpcodecs/vf_pullup.c
@@ -14,6 +14,9 @@
#include "pullup.h"
+#undef MAX
+#define MAX(a,b) ((a)>(b)?(a):(b))
+
struct vf_priv_s {
struct pullup_context *ctx;
int init;
@@ -36,6 +39,25 @@ static inline void *my_memcpy_pic(void * dst, void * src, int bytesPerLine, int
return retval;
}
+static inline void *il_memcpy_pic(void *dst, void *src0, void *src1, int w, int h, int ds, int ss)
+{
+ int i;
+ void *retval=dst;
+ ss += ss;
+
+ for(i=h>>1; i; i--)
+ {
+ memcpy(dst, src0, w);
+ src0 += ss;
+ dst += ds;
+ memcpy(dst, src1, w);
+ src1 += ss;
+ dst += ds;
+ }
+
+ return retval;
+}
+
static void init_pullup(struct vf_instance_s* vf, mp_image_t *mpi)
{
struct pullup_context *c = vf->priv->ctx;
@@ -58,6 +80,7 @@ static void init_pullup(struct vf_instance_s* vf, mp_image_t *mpi)
c->metric_plane = 0;
}
+ c->strict_breaks = 0;
c->junk_left = c->junk_right = 1;
c->junk_top = c->junk_bottom = 4;
c->verbose = verbose;
@@ -165,6 +188,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
}
}
+#if 0
/* Average qscale tables from both frames. */
if (mpi->qscale) {
for (i=0; i<c->w[3]; i++) {
@@ -172,6 +196,14 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
+ f->ofields[1]->planes[3][i+c->w[3]])>>1;
}
}
+#else
+ /* Take worst of qscale tables from both frames. */
+ if (mpi->qscale) {
+ for (i=0; i<c->w[3]; i++) {
+ vf->priv->qbuf[i] = MAX(f->ofields[0]->planes[3][i], f->ofields[1]->planes[3][i+c->w[3]]);
+ }
+ }
+#endif
/* If the frame isn't already exportable... */
while (!f->buffer) {
@@ -184,6 +216,24 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
break;
}
/* Direct render fields into output buffer */
+#if 0
+ /* Write-order copy seems to have worse cache performance
+ * than read-order, but both should be checked on
+ * various cpus to see which is actually better...*/
+ il_memcpy_pic(dmpi->planes[0], f->ofields[0]->planes[0],
+ f->ofields[1]->planes[0] + c->stride[0],
+ mpi->w, mpi->h, dmpi->stride[0], c->stride[0]);
+ if (mpi->flags & MP_IMGFLAG_PLANAR) {
+ il_memcpy_pic(dmpi->planes[1], f->ofields[0]->planes[1],
+ f->ofields[1]->planes[1] + c->stride[1],
+ mpi->chroma_width, mpi->chroma_height,
+ dmpi->stride[1], c->stride[1]);
+ il_memcpy_pic(dmpi->planes[2], f->ofields[0]->planes[2],
+ f->ofields[1]->planes[2] + c->stride[2],
+ mpi->chroma_width, mpi->chroma_height,
+ dmpi->stride[2], c->stride[2]);
+ }
+#else
my_memcpy_pic(dmpi->planes[0], f->ofields[0]->planes[0],
mpi->w, mpi->h/2, dmpi->stride[0]*2, c->stride[0]*2);
my_memcpy_pic(dmpi->planes[0] + dmpi->stride[0],
@@ -205,6 +255,7 @@ static int put_image(struct vf_instance_s* vf, mp_image_t *mpi)
mpi->chroma_width, mpi->chroma_height/2,
dmpi->stride[2]*2, c->stride[2]*2);
}
+#endif
pullup_release_frame(f);
if (mpi->qscale) {
dmpi->qscale = vf->priv->qbuf;