[Mplayer-cvslog] CVS: main/libmpcodecs pullup.c,1.7,1.8 pullup.h,1.2,1.3 vf_pullup.c,1.3,1.4
Richard Felker CVS
rfelker at mplayerhq.hu
Sun Sep 28 05:38:06 CEST 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv3444/libmpcodecs
Modified Files:
pullup.c pullup.h vf_pullup.c
Log Message:
support for selecting which plane to use for metrics in the pullup
core (one of the chroma planes could be used for much lower cpu load
at the expense of some accuracy) and turning off verbose mode.
Index: pullup.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- pullup.c 8 Sep 2003 17:12:31 -0000 1.7
+++ pullup.c 28 Sep 2003 03:37:42 -0000 1.8
@@ -257,9 +257,10 @@
{
unsigned char *a, *b;
int x, y;
- int xstep = c->bpp[0];
- int ystep = c->stride[0]<<3;
- int s = c->stride[0]<<1; /* field stride */
+ int mp = c->metric_plane;
+ int xstep = c->bpp[mp];
+ int ystep = c->stride[mp]<<3;
+ int s = c->stride[mp]<<1; /* field stride */
int w = c->metric_w*xstep;
if (!fa->buffer || !fb->buffer) return;
@@ -270,8 +271,8 @@
return;
}
- a = fa->buffer->planes[0] + pa * c->stride[0] + c->metric_offset;
- b = fb->buffer->planes[0] + pb * c->stride[0] + c->metric_offset;
+ a = fa->buffer->planes[mp] + pa * c->stride[mp] + c->metric_offset;
+ b = fb->buffer->planes[mp] + pb * c->stride[mp] + c->metric_offset;
for (y = c->metric_h; y; y--) {
for (x = 0; x < w; x += xstep) {
@@ -634,12 +635,13 @@
void pullup_init_context(struct pullup_context *c)
{
+ int mp = c->metric_plane;
if (c->nbuffers < 10) c->nbuffers = 10;
c->buffers = calloc(c->nbuffers, sizeof (struct pullup_buffer));
- c->metric_w = (c->w[0] - (c->junk_left + c->junk_right << 3)) >> 3;
- c->metric_h = (c->h[0] - (c->junk_top + c->junk_bottom << 1)) >> 3;
- c->metric_offset = c->junk_left*c->bpp[0] + (c->junk_top<<1)*c->stride[0];
+ c->metric_w = (c->w[mp] - (c->junk_left + c->junk_right << 3)) >> 3;
+ c->metric_h = (c->h[mp] - (c->junk_top + c->junk_bottom << 1)) >> 3;
+ c->metric_offset = c->junk_left*c->bpp[mp] + (c->junk_top<<1)*c->stride[mp];
c->metric_len = c->metric_w * c->metric_h;
c->head = make_field_queue(c, 8);
Index: pullup.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- pullup.h 31 Aug 2003 19:56:13 -0000 1.2
+++ pullup.h 28 Sep 2003 03:37:42 -0000 1.3
@@ -48,6 +48,7 @@
unsigned int cpu;
int junk_left, junk_right, junk_top, junk_bottom;
int verbose;
+ int metric_plane;
/* Internal data */
struct pullup_field *first, *last, *head;
struct pullup_buffer *buffers;
Index: vf_pullup.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/vf_pullup.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- vf_pullup.c 1 Sep 2003 02:54:06 -0000 1.3
+++ vf_pullup.c 28 Sep 2003 03:37:42 -0000 1.4
@@ -51,11 +51,12 @@
c->stride[0] = mpi->width;
c->stride[1] = c->stride[2] = mpi->chroma_width;
c->background[1] = c->background[2] = 128;
+ c->metric_plane = 0;
}
c->junk_left = c->junk_right = 1;
c->junk_top = c->junk_bottom = 4;
- c->verbose = 1;
+ c->verbose = 0;
if (gCpuCaps.hasMMX) c->cpu |= PULLUP_CPU_MMX;
if (gCpuCaps.hasMMX2) c->cpu |= PULLUP_CPU_MMX2;
More information about the MPlayer-cvslog
mailing list