summaryrefslogtreecommitdiffstats
path: root/gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc
diff options
context:
space:
mode:
authorSebastian Dröge <slomo@circular-chaos.org>2008-08-25 14:37:45 +0000
committerSebastian Dröge <slomo@circular-chaos.org>2008-08-25 14:37:45 +0000
commit3e4982542b8b085e037da35c65975d7ad1b96e90 (patch)
tree3be2924abb1854dc3beebd17ee78b4516a357616 /gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc
parentc980279fa4ab6bdf782cb3c7c6832caea71c3ee6 (diff)
downloadgst-plugins-bad-3e4982542b8b085e037da35c65975d7ad1b96e90.tar.gz
gst-plugins-bad-3e4982542b8b085e037da35c65975d7ad1b96e90.tar.bz2
gst-plugins-bad-3e4982542b8b085e037da35c65975d7ad1b96e90.zip
gst/deinterlace2/: First part of the C implementation of the tomsmocomp deinterlacing algorithm. This only supports s...
Original commit message from CVS: * gst/deinterlace2/gstdeinterlace2.c: (gst_deinterlace_method_class_init): * gst/deinterlace2/gstdeinterlace2.h: * gst/deinterlace2/tvtime/tomsmocomp.c: (gst_deinterlace_method_tomsmocomp_class_init): * gst/deinterlace2/tvtime/tomsmocomp/SearchLoopBottom.inc: * gst/deinterlace2/tvtime/tomsmocomp/SearchLoopTop.inc: * gst/deinterlace2/tvtime/tomsmocomp/StrangeBob.inc: * gst/deinterlace2/tvtime/tomsmocomp/TomsMoCompAll.inc: * gst/deinterlace2/tvtime/tomsmocomp/TomsMoCompAll2.inc: * gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc: * gst/deinterlace2/tvtime/tomsmocomp/tomsmocompmacros.h: First part of the C implementation of the tomsmocomp deinterlacing algorithm. This only supports search-effort=0 currently, is painfully slow and needs some cleanup later when all search-effort settings are implemented in C.
Diffstat (limited to 'gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc')
-rw-r--r--gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc58
1 files changed, 58 insertions, 0 deletions
diff --git a/gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc b/gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc
index 36fd9d22..6cbd1b8d 100644
--- a/gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc
+++ b/gst/deinterlace2/tvtime/tomsmocomp/WierdBob.inc
@@ -13,6 +13,7 @@
// selected for the smallest of abs(a,f), abs(c,d), or abs(b,e), etc.
+#ifndef IS_C
// a,f
"movq -2(%%"XBX"), %%mm0\n\t" // value a from top left
"movq 2(%%"XBX", %%"XCX"), %%mm1\n\t" // value f from bottom right
@@ -175,6 +176,7 @@
"pxor %%mm4, %%mm4\n\t"
"psubusb %%mm7, %%mm3\n\t" // nonzero where new weights bigger, else 0
"pcmpeqb %%mm4, %%mm3\n\t" // now ff where new better, else 00
+
"pcmpeqb %%mm3, %%mm4\n\t" // here ff where old better, else 00
"pand %%mm3, %%mm1\n\t"
@@ -187,3 +189,59 @@
"por %%mm1, %%mm7\n\t" // our x2 diffs
"movq %%mm7, %%mm4\n\t" // save as bob uncertainty indicator
+#else
+
+ // a,f
+ best = (pBob[-2] + pBob[src_pitch2 + 2]) / 2;
+ diff = ABS (pBob[-2] - pBob[src_pitch2 + 2]);
+
+ // c,d
+ if (ABS (pBob[2] - pBob[src_pitch2 - 2]) < diff) {
+ best = (pBob[2] + pBob[src_pitch2 - 2]) / 2;
+ diff = ABS (pBob[2] - pBob[src_pitch2 - 2]);
+ }
+
+ // j,n
+ if (ABS (pBob[-4] - pBob[src_pitch2 + 4]) < diff) {
+ best = (pBob[-4] + pBob[src_pitch2 + 4]) / 2;
+ diff = ABS (pBob[-4] - pBob[src_pitch2 + 4]);
+ }
+
+ // k,m
+ if (ABS (pBob[4] - pBob[src_pitch2 - 4]) < diff) {
+ best = (pBob[4] + pBob[src_pitch2 - 4]) / 2;
+ diff = ABS (pBob[-4] - pBob[src_pitch2 - 4]);
+ }
+
+ // k,m
+ if (ABS (pBob[4] - pBob[src_pitch2 - 4]) < diff) {
+ best = (pBob[4] + pBob[src_pitch2 - 4]) / 2;
+ diff = ABS (pBob[-4] - pBob[src_pitch2 - 4]);
+ }
+
+// We will also calc here the max/min values to later limit comb
+// so the max excursion will not exceed the Max_Comb constant
+
+#ifdef SKIP_SEARCH
+ best = CLAMP (best, MIN (pBob[src_pitch2], pBob[0]), MAX (pBob[src_pitch2], pBob[0]));
+#else
+ mov = MAX (ABS (pBob[0] - pBobP[0]), ABS (pBob[src_pitch2] - pBobP[src_pitch2]));
+
+ MinVals = 0;
+ MaxVals = 255;
+ if (mov > Max_Mov) {
+ MinVals = MAX (MIN (pBob[0], pBob[src_pitch2]), best);
+ MaxVals = MIN (MAX (pBob[0], pBob[src_pitch2]), best);
+ }
+
+ best = CLAMP (best, MIN (pBob[src_pitch2], pBob[0]), MAX (pBob[src_pitch2], pBob[0]));
+#endif
+
+ avg = (pBob[src_pitch2] + pBob[0]) / 2;
+ diff2 = ABS (pBob[src_pitch2] - pBob[0]);
+
+ if (diff2 < diff) {
+ best = avg;
+ diff = diff2;
+ }
+#endif