summaryrefslogtreecommitdiff
path: root/gst/deinterlace/tvtime-dist.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/deinterlace/tvtime-dist.c')
-rw-r--r--gst/deinterlace/tvtime-dist.c110
1 files changed, 64 insertions, 46 deletions
diff --git a/gst/deinterlace/tvtime-dist.c b/gst/deinterlace/tvtime-dist.c
index 957f3beaa..e1f7ed307 100644
--- a/gst/deinterlace/tvtime-dist.c
+++ b/gst/deinterlace/tvtime-dist.c
@@ -4,9 +4,6 @@
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
-#ifndef DISABLE_ORC
-#include <orc/orc.h>
-#endif
#include <glib.h>
#ifndef _ORC_INTEGER_TYPEDEFS_
@@ -32,6 +29,7 @@ typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64;
#define ORC_UINT64_C(x) (x##Ui64)
+#define inline __inline
#else
#include <limits.h>
typedef signed char orc_int8;
@@ -71,16 +69,32 @@ typedef union
orc_int16 x4[4];
} orc_union64;
#endif
+#ifndef ORC_RESTRICT
+#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
+#define ORC_RESTRICT restrict
+#elif defined(__GNUC__) && __GNUC__ >= 4
+#define ORC_RESTRICT __restrict__
+#else
+#define ORC_RESTRICT
+#endif
+#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);
-void deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
- const orc_uint8 * s2, const orc_uint8 * s3, const orc_uint8 * s4, int p1,
- int n);
+#ifndef DISABLE_ORC
+#include <orc/orc.h>
+#endif
+void deinterlace_line_vfir (guint8 * ORC_RESTRICT d1,
+ const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
+ const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4,
+ const guint8 * ORC_RESTRICT s5, int n);
+void deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
+ const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n);
+void deinterlace_line_linear_blend (guint8 * ORC_RESTRICT d1,
+ const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
+ const guint8 * ORC_RESTRICT s3, int n);
+void deinterlace_line_greedy (orc_uint8 * ORC_RESTRICT d1,
+ const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
+ const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4,
+ int p1, int n);
/* begin Orc C target preamble */
@@ -114,6 +128,7 @@ void deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
#define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0))
#define ORC_DENORMAL_DOUBLE(x) ((x) & ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == 0) ? ORC_UINT64_C(0xfff0000000000000) : ORC_UINT64_C(0xffffffffffffffff)))
#define ORC_ISNAN_DOUBLE(x) ((((x)&ORC_UINT64_C(0x7ff0000000000000)) == ORC_UINT64_C(0x7ff0000000000000)) && (((x)&ORC_UINT64_C(0x000fffffffffffff)) != 0))
+#ifndef ORC_RESTRICT
#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4
@@ -121,6 +136,7 @@ void deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
#else
#define ORC_RESTRICT
#endif
+#endif
/* end Orc C target preamble */
@@ -128,8 +144,9 @@ void deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
/* deinterlace_line_vfir */
#ifdef DISABLE_ORC
void
-deinterlace_line_vfir (guint8 * d1, const guint8 * s1, const guint8 * s2,
- const guint8 * s3, const guint8 * s4, const guint8 * s5, int n)
+deinterlace_line_vfir (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
+ const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3,
+ const guint8 * ORC_RESTRICT s4, const guint8 * ORC_RESTRICT s5, int n)
{
int i;
orc_int8 *ORC_RESTRICT ptr0;
@@ -167,7 +184,7 @@ deinterlace_line_vfir (guint8 * d1, const guint8 * s1, const guint8 * s2,
ptr8 = (orc_int8 *) s5;
/* 16: loadpw */
- var40.i = 0x00000004; /* 4 or 1.97626e-323f */
+ var40.i = (int) 0x00000004; /* 4 or 1.97626e-323f */
for (i = 0; i < n; i++) {
/* 0: loadb */
@@ -255,7 +272,7 @@ _backup_deinterlace_line_vfir (OrcExecutor * ORC_RESTRICT ex)
ptr8 = (orc_int8 *) ex->arrays[8];
/* 16: loadpw */
- var40.i = 0x00000004; /* 4 or 1.97626e-323f */
+ var40.i = (int) 0x00000004; /* 4 or 1.97626e-323f */
for (i = 0; i < n; i++) {
/* 0: loadb */
@@ -303,8 +320,9 @@ _backup_deinterlace_line_vfir (OrcExecutor * ORC_RESTRICT ex)
}
void
-deinterlace_line_vfir (guint8 * d1, const guint8 * s1, const guint8 * s2,
- const guint8 * s3, const guint8 * s4, const guint8 * s5, int n)
+deinterlace_line_vfir (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
+ const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3,
+ const guint8 * ORC_RESTRICT s4, const guint8 * ORC_RESTRICT s5, int n)
{
OrcExecutor _ex, *ex = &_ex;
static int p_inited = 0;
@@ -314,7 +332,6 @@ deinterlace_line_vfir (guint8 * d1, const guint8 * s1, const guint8 * s2,
if (!p_inited) {
orc_once_mutex_lock ();
if (!p_inited) {
- OrcCompileResult result;
p = orc_program_new ();
orc_program_set_name (p, "deinterlace_line_vfir");
@@ -362,7 +379,7 @@ deinterlace_line_vfir (guint8 * d1, const guint8 * s1, const guint8 * s2,
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T2,
ORC_VAR_D1, ORC_VAR_D1);
- result = orc_program_compile (p);
+ orc_program_compile (p);
}
p_inited = TRUE;
orc_once_mutex_unlock ();
@@ -386,8 +403,8 @@ deinterlace_line_vfir (guint8 * d1, const guint8 * s1, const guint8 * s2,
/* deinterlace_line_linear */
#ifdef DISABLE_ORC
void
-deinterlace_line_linear (guint8 * d1, const guint8 * s1, const guint8 * s2,
- int n)
+deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
+ const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n)
{
int i;
orc_int8 *ORC_RESTRICT ptr0;
@@ -447,8 +464,8 @@ _backup_deinterlace_line_linear (OrcExecutor * ORC_RESTRICT ex)
}
void
-deinterlace_line_linear (guint8 * d1, const guint8 * s1, const guint8 * s2,
- int n)
+deinterlace_line_linear (guint8 * ORC_RESTRICT d1,
+ const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int n)
{
OrcExecutor _ex, *ex = &_ex;
static int p_inited = 0;
@@ -458,7 +475,6 @@ deinterlace_line_linear (guint8 * d1, const guint8 * s1, const guint8 * s2,
if (!p_inited) {
orc_once_mutex_lock ();
if (!p_inited) {
- OrcCompileResult result;
p = orc_program_new ();
orc_program_set_name (p, "deinterlace_line_linear");
@@ -470,7 +486,7 @@ deinterlace_line_linear (guint8 * d1, const guint8 * s1, const guint8 * s2,
orc_program_append_2 (p, "avgub", 0, ORC_VAR_D1, ORC_VAR_S1, ORC_VAR_S2,
ORC_VAR_D1);
- result = orc_program_compile (p);
+ orc_program_compile (p);
}
p_inited = TRUE;
orc_once_mutex_unlock ();
@@ -491,8 +507,9 @@ deinterlace_line_linear (guint8 * d1, const guint8 * s1, const guint8 * s2,
/* deinterlace_line_linear_blend */
#ifdef DISABLE_ORC
void
-deinterlace_line_linear_blend (guint8 * d1, const guint8 * s1,
- const guint8 * s2, const guint8 * s3, int n)
+deinterlace_line_linear_blend (guint8 * ORC_RESTRICT d1,
+ const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
+ const guint8 * ORC_RESTRICT s3, int n)
{
int i;
orc_int8 *ORC_RESTRICT ptr0;
@@ -519,7 +536,7 @@ deinterlace_line_linear_blend (guint8 * d1, const guint8 * s1,
ptr6 = (orc_int8 *) s3;
/* 9: loadpw */
- var38.i = 0x00000002; /* 2 or 9.88131e-324f */
+ var38.i = (int) 0x00000002; /* 2 or 9.88131e-324f */
for (i = 0; i < n; i++) {
/* 0: loadb */
@@ -582,7 +599,7 @@ _backup_deinterlace_line_linear_blend (OrcExecutor * ORC_RESTRICT ex)
ptr6 = (orc_int8 *) ex->arrays[6];
/* 9: loadpw */
- var38.i = 0x00000002; /* 2 or 9.88131e-324f */
+ var38.i = (int) 0x00000002; /* 2 or 9.88131e-324f */
for (i = 0; i < n; i++) {
/* 0: loadb */
@@ -616,8 +633,9 @@ _backup_deinterlace_line_linear_blend (OrcExecutor * ORC_RESTRICT ex)
}
void
-deinterlace_line_linear_blend (guint8 * d1, const guint8 * s1,
- const guint8 * s2, const guint8 * s3, int n)
+deinterlace_line_linear_blend (guint8 * ORC_RESTRICT d1,
+ const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2,
+ const guint8 * ORC_RESTRICT s3, int n)
{
OrcExecutor _ex, *ex = &_ex;
static int p_inited = 0;
@@ -627,7 +645,6 @@ deinterlace_line_linear_blend (guint8 * d1, const guint8 * s1,
if (!p_inited) {
orc_once_mutex_lock ();
if (!p_inited) {
- OrcCompileResult result;
p = orc_program_new ();
orc_program_set_name (p, "deinterlace_line_linear_blend");
@@ -661,7 +678,7 @@ deinterlace_line_linear_blend (guint8 * d1, const guint8 * s1,
orc_program_append_2 (p, "convsuswb", 0, ORC_VAR_D1, ORC_VAR_T1,
ORC_VAR_D1, ORC_VAR_D1);
- result = orc_program_compile (p);
+ orc_program_compile (p);
}
p_inited = TRUE;
orc_once_mutex_unlock ();
@@ -683,9 +700,10 @@ deinterlace_line_linear_blend (guint8 * d1, const guint8 * s1,
/* deinterlace_line_greedy */
#ifdef DISABLE_ORC
void
-deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
- const orc_uint8 * s2, const orc_uint8 * s3, const orc_uint8 * s4, int p1,
- int n)
+deinterlace_line_greedy (orc_uint8 * ORC_RESTRICT d1,
+ const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
+ const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4,
+ int p1, int n)
{
int i;
orc_int8 *ORC_RESTRICT ptr0;
@@ -728,9 +746,9 @@ deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
ptr7 = (orc_int8 *) s4;
/* 11: loadpb */
- var44 = 0x00000080; /* 128 or 6.32404e-322f */
+ var44 = (int) 0x00000080; /* 128 or 6.32404e-322f */
/* 13: loadpb */
- var45 = 0x00000080; /* 128 or 6.32404e-322f */
+ var45 = (int) 0x00000080; /* 128 or 6.32404e-322f */
/* 21: loadpb */
var46 = p1;
/* 23: loadpb */
@@ -835,9 +853,9 @@ _backup_deinterlace_line_greedy (OrcExecutor * ORC_RESTRICT ex)
ptr7 = (orc_int8 *) ex->arrays[7];
/* 11: loadpb */
- var44 = 0x00000080; /* 128 or 6.32404e-322f */
+ var44 = (int) 0x00000080; /* 128 or 6.32404e-322f */
/* 13: loadpb */
- var45 = 0x00000080; /* 128 or 6.32404e-322f */
+ var45 = (int) 0x00000080; /* 128 or 6.32404e-322f */
/* 21: loadpb */
var46 = ex->params[24];
/* 23: loadpb */
@@ -897,9 +915,10 @@ _backup_deinterlace_line_greedy (OrcExecutor * ORC_RESTRICT ex)
}
void
-deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
- const orc_uint8 * s2, const orc_uint8 * s3, const orc_uint8 * s4, int p1,
- int n)
+deinterlace_line_greedy (orc_uint8 * ORC_RESTRICT d1,
+ const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2,
+ const orc_uint8 * ORC_RESTRICT s3, const orc_uint8 * ORC_RESTRICT s4,
+ int p1, int n)
{
OrcExecutor _ex, *ex = &_ex;
static int p_inited = 0;
@@ -909,7 +928,6 @@ deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
if (!p_inited) {
orc_once_mutex_lock ();
if (!p_inited) {
- OrcCompileResult result;
p = orc_program_new ();
orc_program_set_name (p, "deinterlace_line_greedy");
@@ -981,7 +999,7 @@ deinterlace_line_greedy (orc_uint8 * d1, const orc_uint8 * s1,
orc_program_append_2 (p, "maxub", 0, ORC_VAR_D1, ORC_VAR_T10, ORC_VAR_T11,
ORC_VAR_D1);
- result = orc_program_compile (p);
+ orc_program_compile (p);
}
p_inited = TRUE;
orc_once_mutex_unlock ();