summaryrefslogtreecommitdiffstats
path: root/libmpcodecs/pullup.c
diff options
context:
space:
mode:
authorrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-12-14 01:38:41 +0000
committerrfelker <rfelker@b3059339-0415-0410-9bf9-f77b7e298cf2>2003-12-14 01:38:41 +0000
commitbeb9c6afdcf737158d239f387082447f219487db (patch)
tree9af00d9560a30ce361890dbf965ff062d5eeb78c /libmpcodecs/pullup.c
parent75dc9534911ef4e80a0ac8cc039bf77513b3d45a (diff)
downloadmpv-beb9c6afdcf737158d239f387082447f219487db.tar.bz2
mpv-beb9c6afdcf737158d239f387082447f219487db.tar.xz
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 :) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11642 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpcodecs/pullup.c')
-rw-r--r--libmpcodecs/pullup.c26
1 files changed, 10 insertions, 16 deletions
diff --git a/libmpcodecs/pullup.c b/libmpcodecs/pullup.c
index 8a11d19bc9..6914d114c6 100644
--- a/libmpcodecs/pullup.c
+++ b/libmpcodecs/pullup.c
@@ -443,7 +443,7 @@ static void compute_breaks(struct pullup_context *c, struct pullup_field *f0)
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 @@ static void compute_affinity(struct pullup_context *c, struct pullup_field *f)
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 @@ static int decide_frame_length(struct pullup_context *c)
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 */