[Mplayer-cvslog] CVS: main/libmpcodecs pullup.c,1.3,1.4 pullup.h,1.1,1.2 vf_pullup.c,1.1,1.2
Richard Felker CVS
rfelker at mplayerhq.hu
Sun Aug 31 21:56:49 CEST 2003
Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv486/libmpcodecs
Modified Files:
pullup.c pullup.h vf_pullup.c
Log Message:
tweaks and cleanup
Index: pullup.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- pullup.c 31 Aug 2003 19:18:21 -0000 1.3
+++ pullup.c 31 Aug 2003 19:56:13 -0000 1.4
@@ -321,10 +321,9 @@
if (-l > max_r) max_r = -l;
}
/* Don't get tripped up when differences are mostly quant error */
- if (max_l + max_r < 256) return;
+ if (max_l + max_r < 128) return;
if (max_l > 4*max_r) f1->breaks |= BREAK_LEFT;
if (max_r > 4*max_l) f2->breaks |= BREAK_RIGHT;
- //printf("max_l=%d max_r=%d\n", max_l, max_r);
}
static void compute_affinity(struct pullup_context *c, struct pullup_field *f)
@@ -338,9 +337,9 @@
if (l > max_l) max_l = l;
if (-l > max_r) max_r = -l;
}
- if (max_l + max_r < 256) return;
- if (max_r > 3*max_l) f->affinity = -1;
- else if (max_l > 3*max_r) f->affinity = 1;
+ if (max_l + max_r < 128) return;
+ if (max_r > 2*max_l) f->affinity = -1;
+ else if (max_l > 2*max_r) f->affinity = 1;
else if (max_l + max_r > 2048) {
l = t = 0;
for (i = 0; i < c->metric_len; i++) {
@@ -349,7 +348,6 @@
}
if (-l*4 > t) f->affinity = -1;
else if (l*4 > t) f->affinity = 1;
- //printf("affinity from avg: %d\n", f->affinity);
}
}
@@ -396,6 +394,7 @@
else if (f1->affinity == -1) return 2;
else if (f2->affinity == 1) return 2;
else if (f0->affinity == 1 && f2->affinity == -1) return 3;
+ else if (f2->affinity == -1) return 1;
else if (f2->affinity == 0 && f3->affinity == 1) return 3;
else return 2;
}
@@ -435,8 +434,10 @@
if (!n) return 0;
if (fr->lock) return 0;
- print_aff_and_breaks(c, c->first);
- printf("duration: %d \n", n);
+ if (c->verbose) {
+ print_aff_and_breaks(c, c->first);
+ printf("duration: %d \n", n);
+ }
fr->lock++;
fr->length = n;
@@ -569,7 +570,17 @@
void pullup_free_context(struct pullup_context *c)
{
- /* FIXME: free! */
+ struct pullup_field *f;
+ free(c->buffers);
+ f = c->head;
+ do {
+ free(f->diffs);
+ free(f->licomb);
+ f = f->next;
+ free(f->prev);
+ } while (f != c->head);
+ free(c->frame);
+ free(c);
}
Index: pullup.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- pullup.h 18 Aug 2003 15:24:08 -0000 1.1
+++ pullup.h 31 Aug 2003 19:56:13 -0000 1.2
@@ -47,6 +47,7 @@
int *bpp, *w, *h, *stride, *background;
unsigned int cpu;
int junk_left, junk_right, junk_top, junk_bottom;
+ int verbose;
/* 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.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- vf_pullup.c 18 Aug 2003 15:24:08 -0000 1.1
+++ vf_pullup.c 31 Aug 2003 19:56:13 -0000 1.2
@@ -55,6 +55,7 @@
c->junk_left = c->junk_right = 1;
c->junk_top = c->junk_bottom = 4;
+ c->verbose = 1;
if (gCpuCaps.hasMMX) c->cpu |= PULLUP_CPU_MMX;
if (gCpuCaps.hasMMX2) c->cpu |= PULLUP_CPU_MMX2;
More information about the MPlayer-cvslog
mailing list