Commit 82a79151 authored by Tim-Philipp Müller's avatar Tim-Philipp Müller

gst: update disted orc backup code

parent 09e01255
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#ifndef DISABLE_ORC
#include <orc/orc.h>
#endif
#include <glib.h> #include <glib.h>
#ifndef _ORC_INTEGER_TYPEDEFS_ #ifndef _ORC_INTEGER_TYPEDEFS_
...@@ -32,6 +29,7 @@ typedef unsigned __int16 orc_uint16; ...@@ -32,6 +29,7 @@ typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32; typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64; typedef unsigned __int64 orc_uint64;
#define ORC_UINT64_C(x) (x##Ui64) #define ORC_UINT64_C(x) (x##Ui64)
#define inline __inline
#else #else
#include <limits.h> #include <limits.h>
typedef signed char orc_int8; typedef signed char orc_int8;
...@@ -71,14 +69,31 @@ typedef union ...@@ -71,14 +69,31 @@ typedef union
orc_int16 x4[4]; orc_int16 x4[4];
} orc_union64; } orc_union64;
#endif #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 add_int32 (gint32 * d1, const gint32 * s1, int n); #ifndef DISABLE_ORC
void add_int16 (gint16 * d1, const gint16 * s1, int n); #include <orc/orc.h>
void add_int8 (gint8 * d1, const gint8 * s1, int n); #endif
void add_uint32 (guint32 * d1, const guint32 * s1, int n); void add_int32 (gint32 * ORC_RESTRICT d1, const gint32 * ORC_RESTRICT s1,
void add_uint16 (guint16 * d1, const guint16 * s1, int n); int n);
void add_uint8 (guint8 * d1, const guint8 * s1, int n); void add_int16 (gint16 * ORC_RESTRICT d1, const gint16 * ORC_RESTRICT s1,
void add_float32 (float *d1, const float *s1, int n); int n);
void add_int8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1, int n);
void add_uint32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1,
int n);
void add_uint16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1,
int n);
void add_uint8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1,
int n);
void add_float32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1, int n);
void gst_adder_orc_init (void); void gst_adder_orc_init (void);
...@@ -114,6 +129,7 @@ void gst_adder_orc_init (void); ...@@ -114,6 +129,7 @@ void gst_adder_orc_init (void);
#define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #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_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)) #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 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict #define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4 #elif defined(__GNUC__) && __GNUC__ >= 4
...@@ -121,6 +137,7 @@ void gst_adder_orc_init (void); ...@@ -121,6 +137,7 @@ void gst_adder_orc_init (void);
#else #else
#define ORC_RESTRICT #define ORC_RESTRICT
#endif #endif
#endif
/* end Orc C target preamble */ /* end Orc C target preamble */
...@@ -128,7 +145,7 @@ void gst_adder_orc_init (void); ...@@ -128,7 +145,7 @@ void gst_adder_orc_init (void);
/* add_int32 */ /* add_int32 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
add_int32 (gint32 * d1, const gint32 * s1, int n) add_int32 (gint32 * ORC_RESTRICT d1, const gint32 * ORC_RESTRICT s1, int n)
{ {
int i; int i;
orc_union32 *ORC_RESTRICT ptr0; orc_union32 *ORC_RESTRICT ptr0;
...@@ -185,7 +202,7 @@ _backup_add_int32 (OrcExecutor * ORC_RESTRICT ex) ...@@ -185,7 +202,7 @@ _backup_add_int32 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_add_int32; static OrcProgram *_orc_program_add_int32;
void void
add_int32 (gint32 * d1, const gint32 * s1, int n) add_int32 (gint32 * ORC_RESTRICT d1, const gint32 * ORC_RESTRICT s1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_add_int32; OrcProgram *p = _orc_program_add_int32;
...@@ -206,7 +223,7 @@ add_int32 (gint32 * d1, const gint32 * s1, int n) ...@@ -206,7 +223,7 @@ add_int32 (gint32 * d1, const gint32 * s1, int n)
/* add_int16 */ /* add_int16 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
add_int16 (gint16 * d1, const gint16 * s1, int n) add_int16 (gint16 * ORC_RESTRICT d1, const gint16 * ORC_RESTRICT s1, int n)
{ {
int i; int i;
orc_union16 *ORC_RESTRICT ptr0; orc_union16 *ORC_RESTRICT ptr0;
...@@ -263,7 +280,7 @@ _backup_add_int16 (OrcExecutor * ORC_RESTRICT ex) ...@@ -263,7 +280,7 @@ _backup_add_int16 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_add_int16; static OrcProgram *_orc_program_add_int16;
void void
add_int16 (gint16 * d1, const gint16 * s1, int n) add_int16 (gint16 * ORC_RESTRICT d1, const gint16 * ORC_RESTRICT s1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_add_int16; OrcProgram *p = _orc_program_add_int16;
...@@ -284,7 +301,7 @@ add_int16 (gint16 * d1, const gint16 * s1, int n) ...@@ -284,7 +301,7 @@ add_int16 (gint16 * d1, const gint16 * s1, int n)
/* add_int8 */ /* add_int8 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
add_int8 (gint8 * d1, const gint8 * s1, int n) add_int8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1, int n)
{ {
int i; int i;
orc_int8 *ORC_RESTRICT ptr0; orc_int8 *ORC_RESTRICT ptr0;
...@@ -341,7 +358,7 @@ _backup_add_int8 (OrcExecutor * ORC_RESTRICT ex) ...@@ -341,7 +358,7 @@ _backup_add_int8 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_add_int8; static OrcProgram *_orc_program_add_int8;
void void
add_int8 (gint8 * d1, const gint8 * s1, int n) add_int8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_add_int8; OrcProgram *p = _orc_program_add_int8;
...@@ -362,7 +379,7 @@ add_int8 (gint8 * d1, const gint8 * s1, int n) ...@@ -362,7 +379,7 @@ add_int8 (gint8 * d1, const gint8 * s1, int n)
/* add_uint32 */ /* add_uint32 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
add_uint32 (guint32 * d1, const guint32 * s1, int n) add_uint32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n)
{ {
int i; int i;
orc_union32 *ORC_RESTRICT ptr0; orc_union32 *ORC_RESTRICT ptr0;
...@@ -423,7 +440,7 @@ _backup_add_uint32 (OrcExecutor * ORC_RESTRICT ex) ...@@ -423,7 +440,7 @@ _backup_add_uint32 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_add_uint32; static OrcProgram *_orc_program_add_uint32;
void void
add_uint32 (guint32 * d1, const guint32 * s1, int n) add_uint32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_add_uint32; OrcProgram *p = _orc_program_add_uint32;
...@@ -444,7 +461,7 @@ add_uint32 (guint32 * d1, const guint32 * s1, int n) ...@@ -444,7 +461,7 @@ add_uint32 (guint32 * d1, const guint32 * s1, int n)
/* add_uint16 */ /* add_uint16 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
add_uint16 (guint16 * d1, const guint16 * s1, int n) add_uint16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n)
{ {
int i; int i;
orc_union16 *ORC_RESTRICT ptr0; orc_union16 *ORC_RESTRICT ptr0;
...@@ -501,7 +518,7 @@ _backup_add_uint16 (OrcExecutor * ORC_RESTRICT ex) ...@@ -501,7 +518,7 @@ _backup_add_uint16 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_add_uint16; static OrcProgram *_orc_program_add_uint16;
void void
add_uint16 (guint16 * d1, const guint16 * s1, int n) add_uint16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_add_uint16; OrcProgram *p = _orc_program_add_uint16;
...@@ -522,7 +539,7 @@ add_uint16 (guint16 * d1, const guint16 * s1, int n) ...@@ -522,7 +539,7 @@ add_uint16 (guint16 * d1, const guint16 * s1, int n)
/* add_uint8 */ /* add_uint8 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
add_uint8 (guint8 * d1, const guint8 * s1, int n) add_uint8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n)
{ {
int i; int i;
orc_int8 *ORC_RESTRICT ptr0; orc_int8 *ORC_RESTRICT ptr0;
...@@ -579,7 +596,7 @@ _backup_add_uint8 (OrcExecutor * ORC_RESTRICT ex) ...@@ -579,7 +596,7 @@ _backup_add_uint8 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_add_uint8; static OrcProgram *_orc_program_add_uint8;
void void
add_uint8 (guint8 * d1, const guint8 * s1, int n) add_uint8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_add_uint8; OrcProgram *p = _orc_program_add_uint8;
...@@ -600,7 +617,7 @@ add_uint8 (guint8 * d1, const guint8 * s1, int n) ...@@ -600,7 +617,7 @@ add_uint8 (guint8 * d1, const guint8 * s1, int n)
/* add_float32 */ /* add_float32 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
add_float32 (float *d1, const float *s1, int n) add_float32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1, int n)
{ {
int i; int i;
orc_union32 *ORC_RESTRICT ptr0; orc_union32 *ORC_RESTRICT ptr0;
...@@ -673,7 +690,7 @@ _backup_add_float32 (OrcExecutor * ORC_RESTRICT ex) ...@@ -673,7 +690,7 @@ _backup_add_float32 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_add_float32; static OrcProgram *_orc_program_add_float32;
void void
add_float32 (float *d1, const float *s1, int n) add_float32 (float *ORC_RESTRICT d1, const float *ORC_RESTRICT s1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_add_float32; OrcProgram *p = _orc_program_add_float32;
...@@ -698,7 +715,6 @@ gst_adder_orc_init (void) ...@@ -698,7 +715,6 @@ gst_adder_orc_init (void)
{ {
/* add_int32 */ /* add_int32 */
OrcProgram *p; OrcProgram *p;
OrcCompileResult result;
p = orc_program_new (); p = orc_program_new ();
orc_program_set_name (p, "add_int32"); orc_program_set_name (p, "add_int32");
...@@ -709,14 +725,13 @@ gst_adder_orc_init (void) ...@@ -709,14 +725,13 @@ gst_adder_orc_init (void)
orc_program_append_2 (p, "addssl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, orc_program_append_2 (p, "addssl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
ORC_VAR_D1); ORC_VAR_D1);
result = orc_program_compile (p); orc_program_compile (p);
_orc_program_add_int32 = p; _orc_program_add_int32 = p;
} }
{ {
/* add_int16 */ /* add_int16 */
OrcProgram *p; OrcProgram *p;
OrcCompileResult result;
p = orc_program_new (); p = orc_program_new ();
orc_program_set_name (p, "add_int16"); orc_program_set_name (p, "add_int16");
...@@ -727,14 +742,13 @@ gst_adder_orc_init (void) ...@@ -727,14 +742,13 @@ gst_adder_orc_init (void)
orc_program_append_2 (p, "addssw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, orc_program_append_2 (p, "addssw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
ORC_VAR_D1); ORC_VAR_D1);
result = orc_program_compile (p); orc_program_compile (p);
_orc_program_add_int16 = p; _orc_program_add_int16 = p;
} }
{ {
/* add_int8 */ /* add_int8 */
OrcProgram *p; OrcProgram *p;
OrcCompileResult result;
p = orc_program_new (); p = orc_program_new ();
orc_program_set_name (p, "add_int8"); orc_program_set_name (p, "add_int8");
...@@ -745,14 +759,13 @@ gst_adder_orc_init (void) ...@@ -745,14 +759,13 @@ gst_adder_orc_init (void)
orc_program_append_2 (p, "addssb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, orc_program_append_2 (p, "addssb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
ORC_VAR_D1); ORC_VAR_D1);
result = orc_program_compile (p); orc_program_compile (p);
_orc_program_add_int8 = p; _orc_program_add_int8 = p;
} }
{ {
/* add_uint32 */ /* add_uint32 */
OrcProgram *p; OrcProgram *p;
OrcCompileResult result;
p = orc_program_new (); p = orc_program_new ();
orc_program_set_name (p, "add_uint32"); orc_program_set_name (p, "add_uint32");
...@@ -763,14 +776,13 @@ gst_adder_orc_init (void) ...@@ -763,14 +776,13 @@ gst_adder_orc_init (void)
orc_program_append_2 (p, "addusl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, orc_program_append_2 (p, "addusl", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
ORC_VAR_D1); ORC_VAR_D1);
result = orc_program_compile (p); orc_program_compile (p);
_orc_program_add_uint32 = p; _orc_program_add_uint32 = p;
} }
{ {
/* add_uint16 */ /* add_uint16 */
OrcProgram *p; OrcProgram *p;
OrcCompileResult result;
p = orc_program_new (); p = orc_program_new ();
orc_program_set_name (p, "add_uint16"); orc_program_set_name (p, "add_uint16");
...@@ -781,14 +793,13 @@ gst_adder_orc_init (void) ...@@ -781,14 +793,13 @@ gst_adder_orc_init (void)
orc_program_append_2 (p, "addusw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, orc_program_append_2 (p, "addusw", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
ORC_VAR_D1); ORC_VAR_D1);
result = orc_program_compile (p); orc_program_compile (p);
_orc_program_add_uint16 = p; _orc_program_add_uint16 = p;
} }
{ {
/* add_uint8 */ /* add_uint8 */
OrcProgram *p; OrcProgram *p;
OrcCompileResult result;
p = orc_program_new (); p = orc_program_new ();
orc_program_set_name (p, "add_uint8"); orc_program_set_name (p, "add_uint8");
...@@ -799,14 +810,13 @@ gst_adder_orc_init (void) ...@@ -799,14 +810,13 @@ gst_adder_orc_init (void)
orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, orc_program_append_2 (p, "addusb", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
ORC_VAR_D1); ORC_VAR_D1);
result = orc_program_compile (p); orc_program_compile (p);
_orc_program_add_uint8 = p; _orc_program_add_uint8 = p;
} }
{ {
/* add_float32 */ /* add_float32 */
OrcProgram *p; OrcProgram *p;
OrcCompileResult result;
p = orc_program_new (); p = orc_program_new ();
orc_program_set_name (p, "add_float32"); orc_program_set_name (p, "add_float32");
...@@ -817,7 +827,7 @@ gst_adder_orc_init (void) ...@@ -817,7 +827,7 @@ gst_adder_orc_init (void)
orc_program_append_2 (p, "addf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1, orc_program_append_2 (p, "addf", 0, ORC_VAR_D1, ORC_VAR_D1, ORC_VAR_S1,
ORC_VAR_D1); ORC_VAR_D1);
result = orc_program_compile (p); orc_program_compile (p);
_orc_program_add_float32 = p; _orc_program_add_float32 = p;
} }
......
...@@ -37,6 +37,7 @@ typedef unsigned __int16 orc_uint16; ...@@ -37,6 +37,7 @@ typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32; typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64; typedef unsigned __int64 orc_uint64;
#define ORC_UINT64_C(x) (x##Ui64) #define ORC_UINT64_C(x) (x##Ui64)
#define inline __inline
#else #else
#include <limits.h> #include <limits.h>
typedef signed char orc_int8; typedef signed char orc_int8;
...@@ -59,13 +60,22 @@ typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; ...@@ -59,13 +60,22 @@ typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;
typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32;
typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64;
#endif #endif
void add_int32 (gint32 * d1, const gint32 * s1, int n); #ifndef ORC_RESTRICT
void add_int16 (gint16 * d1, const gint16 * s1, int n); #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
void add_int8 (gint8 * d1, const gint8 * s1, int n); #define ORC_RESTRICT restrict
void add_uint32 (guint32 * d1, const guint32 * s1, int n); #elif defined(__GNUC__) && __GNUC__ >= 4
void add_uint16 (guint16 * d1, const guint16 * s1, int n); #define ORC_RESTRICT __restrict__
void add_uint8 (guint8 * d1, const guint8 * s1, int n); #else
void add_float32 (float * d1, const float * s1, int n); #define ORC_RESTRICT
#endif
#endif
void add_int32 (gint32 * ORC_RESTRICT d1, const gint32 * ORC_RESTRICT s1, int n);
void add_int16 (gint16 * ORC_RESTRICT d1, const gint16 * ORC_RESTRICT s1, int n);
void add_int8 (gint8 * ORC_RESTRICT d1, const gint8 * ORC_RESTRICT s1, int n);
void add_uint32 (guint32 * ORC_RESTRICT d1, const guint32 * ORC_RESTRICT s1, int n);
void add_uint16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
void add_uint8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n);
void add_float32 (float * ORC_RESTRICT d1, const float * ORC_RESTRICT s1, int n);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
This source diff could not be displayed because it is too large. You can view the blob instead.
This diff is collapsed.
This diff is collapsed.
...@@ -60,21 +60,30 @@ typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16; ...@@ -60,21 +60,30 @@ typedef union { orc_int16 i; orc_int8 x2[2]; } orc_union16;
typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32; typedef union { orc_int32 i; float f; orc_int16 x2[2]; orc_int8 x4[4]; } orc_union32;
typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64; typedef union { orc_int64 i; double f; orc_int32 x2[2]; float x2f[2]; orc_int16 x4[4]; } orc_union64;
#endif #endif
void orc_merge_linear_u8 (orc_uint8 * d1, const orc_uint8 * s1, const orc_uint8 * s2, int p1, int n); #ifndef ORC_RESTRICT
void orc_merge_linear_u16 (orc_uint16 * d1, const orc_uint16 * s1, const orc_uint16 * s2, int p1, int p2, int n); #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
void orc_splat_u16 (orc_uint16 * d1, int p1, int n); #define ORC_RESTRICT restrict
void orc_splat_u32 (orc_uint32 * d1, int p1, int n); #elif defined(__GNUC__) && __GNUC__ >= 4
void orc_splat_u64 (orc_uint64 * d1, orc_int64 p1, int n); #define ORC_RESTRICT __restrict__
void orc_downsample_u8 (guint8 * d1, const guint8 * s1, int n); #else
void orc_downsample_u16 (guint16 * d1, const guint16 * s1, int n); #define ORC_RESTRICT
void gst_videoscale_orc_downsample_u32 (guint8 * d1, const guint8 * s1, int n); #endif
void gst_videoscale_orc_downsample_yuyv (guint8 * d1, const guint8 * s1, int n); #endif
void gst_videoscale_orc_resample_nearest_u8 (guint8 * d1, const guint8 * s1, int p1, int p2, int n); void orc_merge_linear_u8 (orc_uint8 * ORC_RESTRICT d1, const orc_uint8 * ORC_RESTRICT s1, const orc_uint8 * ORC_RESTRICT s2, int p1, int n);
void gst_videoscale_orc_resample_bilinear_u8 (guint8 * d1, const guint8 * s1, int p1, int p2, int n); void orc_merge_linear_u16 (orc_uint16 * ORC_RESTRICT d1, const orc_uint16 * ORC_RESTRICT s1, const orc_uint16 * ORC_RESTRICT s2, int p1, int p2, int n);
void gst_videoscale_orc_resample_nearest_u32 (guint8 * d1, const guint8 * s1, int p1, int p2, int n); void orc_splat_u16 (orc_uint16 * ORC_RESTRICT d1, int p1, int n);
void gst_videoscale_orc_resample_bilinear_u32 (guint8 * d1, const guint8 * s1, int p1, int p2, int n); void orc_splat_u32 (orc_uint32 * ORC_RESTRICT d1, int p1, int n);
void gst_videoscale_orc_resample_merge_bilinear_u32 (guint8 * d1, guint8 * d2, const guint8 * s1, const guint8 * s2, int p1, int p2, int p3, int n); void orc_splat_u64 (orc_uint64 * ORC_RESTRICT d1, orc_int64 p1, int n);
void gst_videoscale_orc_merge_bicubic_u8 (guint8 * d1, const guint8 * s1, const guint8 * s2, const guint8 * s3, const guint8 * s4, int p1, int p2, int p3, int p4, int n); void orc_downsample_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n);
void orc_downsample_u16 (guint16 * ORC_RESTRICT d1, const guint16 * ORC_RESTRICT s1, int n);
void gst_videoscale_orc_downsample_u32 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n);
void gst_videoscale_orc_downsample_yuyv (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int n);
void gst_videoscale_orc_resample_nearest_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
void gst_videoscale_orc_resample_bilinear_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
void gst_videoscale_orc_resample_nearest_u32 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
void gst_videoscale_orc_resample_bilinear_u32 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, int p1, int p2, int n);
void gst_videoscale_orc_resample_merge_bilinear_u32 (guint8 * ORC_RESTRICT d1, guint8 * ORC_RESTRICT d2, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, int p1, int p2, int p3, int n);
void gst_videoscale_orc_merge_bicubic_u8 (guint8 * ORC_RESTRICT d1, const guint8 * ORC_RESTRICT s1, const guint8 * ORC_RESTRICT s2, const guint8 * ORC_RESTRICT s3, const guint8 * ORC_RESTRICT s4, int p1, int p2, int p3, int p4, int n);
#ifdef __cplusplus #ifdef __cplusplus
} }
......
...@@ -4,9 +4,6 @@ ...@@ -4,9 +4,6 @@
#ifdef HAVE_CONFIG_H #ifdef HAVE_CONFIG_H
#include "config.h" #include "config.h"
#endif #endif
#ifndef DISABLE_ORC
#include <orc/orc.h>
#endif
#include <glib.h> #include <glib.h>
#ifndef _ORC_INTEGER_TYPEDEFS_ #ifndef _ORC_INTEGER_TYPEDEFS_
...@@ -32,6 +29,7 @@ typedef unsigned __int16 orc_uint16; ...@@ -32,6 +29,7 @@ typedef unsigned __int16 orc_uint16;
typedef unsigned __int32 orc_uint32; typedef unsigned __int32 orc_uint32;
typedef unsigned __int64 orc_uint64; typedef unsigned __int64 orc_uint64;
#define ORC_UINT64_C(x) (x##Ui64) #define ORC_UINT64_C(x) (x##Ui64)
#define inline __inline
#else #else
#include <limits.h> #include <limits.h>
typedef signed char orc_int8; typedef signed char orc_int8;
...@@ -71,11 +69,23 @@ typedef union ...@@ -71,11 +69,23 @@ typedef union
orc_int16 x4[4]; orc_int16 x4[4];
} orc_union64; } orc_union64;
#endif #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 gst_orc_splat_u8 (guint8 * d1, int p1, int n); #ifndef DISABLE_ORC
void gst_orc_splat_s16 (gint8 * d1, int p1, int n); #include <orc/orc.h>
void gst_orc_splat_u16 (guint8 * d1, int p1, int n); #endif
void gst_orc_splat_u32 (guint8 * d1, int p1, int n); void gst_orc_splat_u8 (guint8 * ORC_RESTRICT d1, int p1, int n);
void gst_orc_splat_s16 (gint8 * ORC_RESTRICT d1, int p1, int n);
void gst_orc_splat_u16 (guint8 * ORC_RESTRICT d1, int p1, int n);
void gst_orc_splat_u32 (guint8 * ORC_RESTRICT d1, int p1, int n);
void gst_videotestsrc_orc_init (void); void gst_videotestsrc_orc_init (void);
...@@ -111,6 +121,7 @@ void gst_videotestsrc_orc_init (void); ...@@ -111,6 +121,7 @@ void gst_videotestsrc_orc_init (void);
#define ORC_ISNAN(x) ((((x)&0x7f800000) == 0x7f800000) && (((x)&0x007fffff) != 0)) #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_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)) #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 #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
#define ORC_RESTRICT restrict #define ORC_RESTRICT restrict
#elif defined(__GNUC__) && __GNUC__ >= 4 #elif defined(__GNUC__) && __GNUC__ >= 4
...@@ -118,6 +129,7 @@ void gst_videotestsrc_orc_init (void); ...@@ -118,6 +129,7 @@ void gst_videotestsrc_orc_init (void);
#else #else
#define ORC_RESTRICT #define ORC_RESTRICT
#endif #endif
#endif
/* end Orc C target preamble */ /* end Orc C target preamble */
...@@ -125,7 +137,7 @@ void gst_videotestsrc_orc_init (void); ...@@ -125,7 +137,7 @@ void gst_videotestsrc_orc_init (void);
/* gst_orc_splat_u8 */ /* gst_orc_splat_u8 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
gst_orc_splat_u8 (guint8 * d1, int p1, int n) gst_orc_splat_u8 (guint8 * ORC_RESTRICT d1, int p1, int n)
{ {
int i; int i;
orc_int8 *ORC_RESTRICT ptr0; orc_int8 *ORC_RESTRICT ptr0;
...@@ -172,7 +184,7 @@ _backup_gst_orc_splat_u8 (OrcExecutor * ORC_RESTRICT ex) ...@@ -172,7 +184,7 @@ _backup_gst_orc_splat_u8 (OrcExecutor * ORC_RESTRICT ex)
static OrcProgram *_orc_program_gst_orc_splat_u8; static OrcProgram *_orc_program_gst_orc_splat_u8;
void void
gst_orc_splat_u8 (guint8 * d1, int p1, int n) gst_orc_splat_u8 (guint8 * ORC_RESTRICT d1, int p1, int n)
{ {
OrcExecutor _ex, *ex = &_ex; OrcExecutor _ex, *ex = &_ex;
OrcProgram *p = _orc_program_gst_orc_splat_u8; OrcProgram *p = _orc_program_gst_orc_splat_u8;
...@@ -193,7 +205,7 @@ gst_orc_splat_u8 (guint8 * d1, int p1, int n) ...@@ -193,7 +205,7 @@ gst_orc_splat_u8 (guint8 * d1, int p1, int n)
/* gst_orc_splat_s16 */ /* gst_orc_splat_s16 */
#ifdef DISABLE_ORC #ifdef DISABLE_ORC
void void
gst_orc_splat_s16 (gint8 * d1, int p1, int n) gst_orc_splat_s16 (gint8 * ORC_RESTRICT d1, int p1, int n)
{ {
int i; int i;
orc_union16 *ORC_RESTRICT ptr0; orc_union16 *ORC_RESTRICT ptr0;
...