[Mplayer-cvslog] CVS: main/libmpcodecs pullup.c,1.15,1.16 pullup.h,1.6,1.7

Richard Felker CVS rfelker at mplayerhq.hu
Sun Dec 14 02:39:06 CET 2003


Update of /cvsroot/mplayer/main/libmpcodecs
In directory mail:/var/tmp.root/cvs-serv9881/libmpcodecs

Modified Files:
	pullup.c pullup.h 
Log Message:
various updates:

simplify logic
eliminate stupid alternative affinity calculations (gave bad results)
favor output of clean duration-3 over duration-2 plus broken-1
(will give a more steady 3:2 pattern during telecine, w/ no quality loss)
options to adjust strictness of tests (but no way to set them presently :)


Index: pullup.c
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.c,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -r1.15 -r1.16
--- pullup.c	11 Dec 2003 17:08:37 -0000	1.15
+++ pullup.c	14 Dec 2003 01:38:41 -0000	1.16
@@ -443,7 +443,7 @@
 static void compute_affinity(struct pullup_context *c, struct pullup_field *f)
 {
 	int i;
-	int max_l=0, max_r=0, l, t;
+	int max_l=0, max_r=0, l;
 	if (f->flags & F_HAVE_AFFINITY) return;
 	f->flags |= F_HAVE_AFFINITY;
 	for (i = 0; i < c->metric_len; i++) {
@@ -454,15 +454,6 @@
 	if (max_l + max_r < 64) 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 > 1024) {
-		l = t = 0;
-		for (i = 0; i < c->metric_len; i++) {
-			l += f->comb[i] - f->next->comb[i];
-			t += ABS(f->comb[i] - f->next->comb[i]);
-		}
-		if (-l*4 > t) f->affinity = -1;
-		else if (l*4 > t) f->affinity = 1;
-	}
 }
 
 static void foo(struct pullup_context *c)
@@ -490,16 +481,19 @@
 
 	switch (find_first_break(f0, 3)) {
 	case 1:
-		return 1;
+		if (!c->strict_breaks && f0->affinity == 1 && f1->affinity == -1)
+			return 2;
+		else return 1;
 	case 2:
+		/* FIXME: strictly speaking, f0->prev is no longer valid... :) */
+		if (c->strict_pairs
+			&& (f0->prev->breaks & BREAK_RIGHT) && (f2->breaks & BREAK_LEFT)
+			&& (f0->affinity != 1 || f1->affinity != -1) )
+			return 1;
 		if (f1->affinity == 1) return 1;
 		else return 2;
 	case 3:
-		if (f1->affinity == 1) {
-			if (f0->affinity == 1 && f2->affinity == -1) return 3;
-			else return 1;
-		}
-		else if (f2->affinity == 1) return 2;
+		if (f2->affinity == 1) return 2;
 		else return 3;
 	default:
 		/* 9 possibilities covered before switch */

Index: pullup.h
===================================================================
RCS file: /cvsroot/mplayer/main/libmpcodecs/pullup.h,v
retrieving revision 1.6
retrieving revision 1.7
diff -u -r1.6 -r1.7
--- pullup.h	11 Dec 2003 07:52:57 -0000	1.6
+++ pullup.h	14 Dec 2003 01:38:41 -0000	1.7
@@ -49,6 +49,8 @@
 	int junk_left, junk_right, junk_top, junk_bottom;
 	int verbose;
 	int metric_plane;
+	int strict_breaks;
+	int strict_pairs;
 	/* Internal data */
 	struct pullup_field *first, *last, *head;
 	struct pullup_buffer *buffers;



More information about the MPlayer-cvslog mailing list