deinterlace: implement greedy in Orc

This commit is contained in:
David Schleef 2010-06-08 14:54:49 -07:00
parent 294d5c48da
commit 02196850dd
2 changed files with 58 additions and 0 deletions

View file

@ -53,3 +53,51 @@ addw t1, t1, 2
shrsw t1, t1, 2
convsuswb d1, t1
.function deinterlace_line_greedy
.dest 1 d1
.source 1 m0
.source 1 t1
.source 1 b1
.source 1 m2
.param 1 max_comb
.temp 1 avg
.temp 1 l2_diff
.temp 1 lp2_diff
.temp 1 t2
.temp 1 t3
.temp 1 best
.temp 1 min
.temp 1 max
avgub avg, t1, b1
#absdiffb l2_diff, m0, avg
maxub t2, m0, avg
minub t3, m0, avg
subb l2_diff, t2, t3
#absdiffb lp2_diff, m2, avg
maxub t2, m2, avg
minub t3, m2, avg
subb lp2_diff, t2, t3
#cmpgtub t1, l2_diff, lp2_diff
xorb l2_diff, l2_diff, 0x80
xorb lp2_diff, lp2_diff, 0x80
cmpgtsb t3, l2_diff, lp2_diff
#selectb best, m0, m2, t3
andb t2, m0, t3
andnb t3, m2, t3
orb best, t2, t3
maxub max, t1, b1
minub min, t1, b1
addusb max, max, max_comb
subusb min, min, max_comb
minub best, best, max
maxub d1, best, min

View file

@ -37,6 +37,7 @@
#ifdef HAVE_ORC
#include <orc/orc.h>
#endif
#include "tvtime.h"
#define GST_TYPE_DEINTERLACE_METHOD_GREEDY_L (gst_deinterlace_method_greedy_l_get_type ())
@ -126,6 +127,14 @@ deinterlace_greedy_scanline_c (GstDeinterlaceMethodGreedyL * self,
}
}
static inline void
deinterlace_greedy_scanline_orc (GstDeinterlaceMethodGreedyL * self,
const guint8 * m0, const guint8 * t1,
const guint8 * b1, const guint8 * m2, guint8 * output, gint width)
{
deinterlace_line_greedy (output, m0, t1, b1, m2, self->max_comb, width);
}
#ifdef BUILD_X86_ASM
#include "mmx.h"
static void
@ -597,6 +606,7 @@ gst_deinterlace_method_greedy_l_class_init (GstDeinterlaceMethodGreedyLClass *
}
#else
klass->scanline = deinterlace_greedy_scanline_c;
klass->scanline = deinterlace_greedy_scanline_orc;
#endif
}