Commit 9ff3ef0c authored by David Schleef's avatar David Schleef

deinterlace: orcify some deinterlacing methods

parent f14972bf
plugin_LTLIBRARIES = libgstdeinterlace.la
ORC_SOURCE=tvtime
include $(top_srcdir)/common/orc.mak
libgstdeinterlace_la_SOURCES = \
gstdeinterlace.c \
gstdeinterlacemethod.c \
......@@ -13,6 +16,7 @@ libgstdeinterlace_la_SOURCES = \
tvtime/linear.c \
tvtime/linearblend.c \
tvtime/scalerbob.c
nodist_libgstdeinterlace_la_SOURCES = $(ORC_NODIST_SOURCES)
libgstdeinterlace_la_CFLAGS = \
$(GST_PLUGINS_BASE_CFLAGS) $(GST_BASE_CFLAGS) $(GST_CFLAGS) $(ORC_CFLAGS)
......
This diff is collapsed.
/* autogenerated from tvtime.orc */
#ifndef _TVTIME_H_
#define _TVTIME_H_
#include <glib.h>
#ifdef __cplusplus
extern "C" {
#endif
void deinterlace_line_vfir (guint8 * d1, const guint8 * s1, const guint8 * s2, const guint8 * s3, const guint8 * s4, const guint8 * s5, int n);
void deinterlace_line_linear (guint8 * d1, const guint8 * s1, const guint8 * s2, int n);
void deinterlace_line_linear_blend (guint8 * d1, const guint8 * s1, const guint8 * s2, const guint8 * s3, int n);
#ifdef __cplusplus
}
#endif
#endif
.function deinterlace_line_vfir
.dest 1 d1 guint8
.source 1 s1 guint8
.source 1 s2 guint8
.source 1 s3 guint8
.source 1 s4 guint8
.source 1 s5 guint8
.temp 2 t1
.temp 2 t2
.temp 2 t3
convubw t1, s1
convubw t2, s5
addw t1, t1, t2
convubw t2, s2
convubw t3, s4
addw t2, t2, t3
shlw t2, t2, 2
convubw t3, s3
shlw t3, t3, 1
subw t2, t2, t1
addw t2, t2, t3
addw t2, t2, 4
shrsw t2, t2, 3
convsuswb d1, t2
.function deinterlace_line_linear
.dest 1 d1 guint8
.source 1 s1 guint8
.source 1 s2 guint8
avgub d1, s1, s2
.function deinterlace_line_linear_blend
.dest 1 d1 guint8
.source 1 s1 guint8
.source 1 s2 guint8
.source 1 s3 guint8
.temp 2 t1
.temp 2 t2
.temp 2 t3
convubw t1, s1
convubw t2, s2
convubw t3, s3
addw t1, t1, t2
addw t3, t3, t3
addw t1, t1, t3
addw t1, t1, 2
shrsw t1, t1, 2
convsuswb d1, t1
......@@ -32,6 +32,7 @@
#ifdef HAVE_ORC
#include <orc/orc.h>
#endif
#include "tvtime.h"
#define GST_TYPE_DEINTERLACE_METHOD_LINEAR (gst_deinterlace_method_linear_get_type ())
#define GST_IS_DEINTERLACE_METHOD_LINEAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEINTERLACE_METHOD_LINEAR))
......@@ -50,10 +51,7 @@ static void
deinterlace_scanline_linear_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const guint8 * s1, const guint8 * s2, gint size)
{
gint i;
for (i = 0; i < size; i++)
out[i] = (s1[i] + s2[i]) / 2;
deinterlace_line_linear (out, s1, s2, size);
}
static void
......
......@@ -36,6 +36,7 @@
#ifdef HAVE_ORC
#include <orc/orc.h>
#endif
#include "tvtime.h"
#define GST_TYPE_DEINTERLACE_METHOD_LINEAR_BLEND (gst_deinterlace_method_linear_blend_get_type ())
#define GST_IS_DEINTERLACE_METHOD_LINEAR_BLEND(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEINTERLACE_METHOD_LINEAR_BLEND))
......@@ -55,9 +56,7 @@ deinterlace_scanline_linear_blend_c (GstDeinterlaceSimpleMethod * self,
guint8 * out, const guint8 * t0, const guint8 * b0, const guint8 * m1,
gint size)
{
while (size--) {
*out++ = (*t0++ + *b0++ + (*m1++ << 1)) >> 2;
}
deinterlace_line_linear_blend (out, t0, b0, m1, size);
}
static void
......
......@@ -38,6 +38,7 @@
#ifdef HAVE_ORC
#include <orc/orc.h>
#endif
#include "tvtime.h"
#define GST_TYPE_DEINTERLACE_METHOD_VFIR (gst_deinterlace_method_vfir_get_type ())
#define GST_IS_DEINTERLACE_METHOD_VFIR(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GST_TYPE_DEINTERLACE_METHOD_VFIR))
......@@ -67,22 +68,7 @@ static inline void
deinterlace_c (guint8 * dst, const guint8 * lum_m4, const guint8 * lum_m3,
const guint8 * lum_m2, const guint8 * lum_m1, const guint8 * lum, gint size)
{
gint sum;
for (; size >= 0; size--) {
sum = -lum_m4[0];
sum += lum_m3[0] << 2;
sum += lum_m2[0] << 1;
sum += lum_m1[0] << 2;
sum += -lum[0];
dst[0] = (sum + 4) >> 3; // This needs to be clipped at 0 and 255: cm[(sum + 4) >> 3];
lum_m4++;
lum_m3++;
lum_m2++;
lum_m1++;
lum++;
dst++;
}
deinterlace_line_vfir (dst, lum_m4, lum_m3, lum_m2, lum_m1, lum, size);
}
static void
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment