mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-27 12:11:13 +00:00
yadif: Fix non-x86_64 builds
This commit is contained in:
parent
aeee2084ff
commit
e5e7fccd03
2 changed files with 23 additions and 21 deletions
|
@ -21,6 +21,8 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#include "config.h"
|
||||||
|
|
||||||
#include <gstyadif.h>
|
#include <gstyadif.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
@ -111,9 +113,11 @@ FILTER}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
void yadif_filter (GstYadif * yadif, int parity, int tff);
|
void yadif_filter (GstYadif * yadif, int parity, int tff);
|
||||||
void filter_line_x86 (guint8 * dst,
|
#ifdef HAVE_CPU_X86_64
|
||||||
|
void filter_line_x86_64 (guint8 * dst,
|
||||||
guint8 * prev, guint8 * cur, guint8 * next,
|
guint8 * prev, guint8 * cur, guint8 * next,
|
||||||
int w, int prefs, int mrefs, int parity, int mode);
|
int w, int prefs, int mrefs, int parity, int mode);
|
||||||
|
#endif
|
||||||
|
|
||||||
void
|
void
|
||||||
yadif_filter (GstYadif * yadif, int parity, int tff)
|
yadif_filter (GstYadif * yadif, int parity, int tff)
|
||||||
|
@ -139,13 +143,18 @@ yadif_filter (GstYadif * yadif, int parity, int tff)
|
||||||
guint8 *next = next_data + y * refs;
|
guint8 *next = next_data + y * refs;
|
||||||
guint8 *dst = dest_data + y * refs;
|
guint8 *dst = dest_data + y * refs;
|
||||||
int mode = ((y == 1) || (y + 2 == h)) ? 2 : yadif->mode;
|
int mode = ((y == 1) || (y + 2 == h)) ? 2 : yadif->mode;
|
||||||
|
#if HAVE_CPU_X86_64
|
||||||
if (0) {
|
if (0) {
|
||||||
filter_line_c (dst, prev, cur, next, w,
|
filter_line_c (dst, prev, cur, next, w,
|
||||||
y + 1 < h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);
|
y + 1 < h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);
|
||||||
} else {
|
} else {
|
||||||
filter_line_x86 (dst, prev, cur, next, w,
|
filter_line_x86_64 (dst, prev, cur, next, w,
|
||||||
y + 1 < h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);
|
y + 1 < h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);
|
||||||
}
|
}
|
||||||
|
#else
|
||||||
|
filter_line_c (dst, prev, cur, next, w,
|
||||||
|
y + 1 < h ? refs : -refs, y ? -refs : refs, parity ^ tff, mode);
|
||||||
|
#endif
|
||||||
} else {
|
} else {
|
||||||
guint8 *dst = dest_data + y * refs;
|
guint8 *dst = dest_data + y * refs;
|
||||||
guint8 *cur = cur_data + y * refs;
|
guint8 *cur = cur_data + y * refs;
|
||||||
|
|
|
@ -18,18 +18,11 @@
|
||||||
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <glib.h>
|
#include "config.h"
|
||||||
#if 0
|
|
||||||
#include "libavutil/attributes.h"
|
|
||||||
#include "libavutil/cpu.h"
|
|
||||||
#include "libavutil/internal.h"
|
|
||||||
#include "libavutil/mem.h"
|
|
||||||
#include "libavutil/x86/asm.h"
|
|
||||||
#include "libavcodec/x86/dsputil_mmx.h"
|
|
||||||
#include "libavfilter/yadif.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
//#if HAVE_INLINE_ASM
|
#include <glib.h>
|
||||||
|
|
||||||
|
#if HAVE_CPU_X86_64
|
||||||
|
|
||||||
typedef struct xmm_reg
|
typedef struct xmm_reg
|
||||||
{
|
{
|
||||||
|
@ -39,9 +32,7 @@ typedef gint64 x86_reg;
|
||||||
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
#define DECLARE_ALIGNED(n,t,v) t __attribute__ ((aligned (n))) v
|
||||||
#define DECLARE_ASM_CONST(n,t,v) static const t __attribute__((used)) __attribute__ ((aligned (n))) v
|
#define DECLARE_ASM_CONST(n,t,v) static const t __attribute__((used)) __attribute__ ((aligned (n))) v
|
||||||
|
|
||||||
#define ARCH_X86_64 1
|
#if defined(__PIC__)
|
||||||
//#if ARCH_X86_64 && defined(__PIC__)
|
|
||||||
#if 1
|
|
||||||
# define LOCAL_MANGLE(a) #a "(%%rip)"
|
# define LOCAL_MANGLE(a) #a "(%%rip)"
|
||||||
#else
|
#else
|
||||||
# define LOCAL_MANGLE(a) #a
|
# define LOCAL_MANGLE(a) #a
|
||||||
|
@ -57,6 +48,7 @@ DECLARE_ASM_CONST (16, const xmm_reg, pw_1) = {
|
||||||
0x0001000100010001ULL, 0x0001000100010001ULL};
|
0x0001000100010001ULL, 0x0001000100010001ULL};
|
||||||
|
|
||||||
|
|
||||||
|
#define HAVE_SSE2_INLINE 1
|
||||||
|
|
||||||
#if HAVE_SSSE3_INLINE
|
#if HAVE_SSSE3_INLINE
|
||||||
#define COMPILE_TEMPLATE_SSE2 1
|
#define COMPILE_TEMPLATE_SSE2 1
|
||||||
|
@ -67,12 +59,12 @@ DECLARE_ASM_CONST (16, const xmm_reg, pw_1) = {
|
||||||
#undef COMPILE_TEMPLATE_SSSE3
|
#undef COMPILE_TEMPLATE_SSSE3
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#if HAVE_SSE2_INLINE
|
#if HAVE_SSE2_INLINE
|
||||||
#undef RENAME
|
#undef RENAME
|
||||||
#define RENAME(a) a ## _sse2
|
#define RENAME(a) a ## _sse2
|
||||||
#include "yadif_template.c"
|
#include "yadif_template.c"
|
||||||
#undef COMPILE_TEMPLATE_SSE2
|
#undef COMPILE_TEMPLATE_SSE2
|
||||||
//#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_MMXEXT_INLINE
|
#if HAVE_MMXEXT_INLINE
|
||||||
#undef RENAME
|
#undef RENAME
|
||||||
|
@ -80,14 +72,13 @@ DECLARE_ASM_CONST (16, const xmm_reg, pw_1) = {
|
||||||
#include "yadif_template.c"
|
#include "yadif_template.c"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//#endif /* HAVE_INLINE_ASM */
|
|
||||||
|
|
||||||
void filter_line_x86 (guint8 * dst,
|
void filter_line_x86_64 (guint8 * dst,
|
||||||
guint8 * prev, guint8 * cur, guint8 * next,
|
guint8 * prev, guint8 * cur, guint8 * next,
|
||||||
int w, int prefs, int mrefs, int parity, int mode);
|
int w, int prefs, int mrefs, int parity, int mode);
|
||||||
|
|
||||||
void
|
void
|
||||||
filter_line_x86 (guint8 * dst,
|
filter_line_x86_64 (guint8 * dst,
|
||||||
guint8 * prev, guint8 * cur, guint8 * next,
|
guint8 * prev, guint8 * cur, guint8 * next,
|
||||||
int w, int prefs, int mrefs, int parity, int mode)
|
int w, int prefs, int mrefs, int parity, int mode)
|
||||||
{
|
{
|
||||||
|
@ -107,3 +98,5 @@ filter_line_x86 (guint8 * dst,
|
||||||
#endif
|
#endif
|
||||||
yadif_filter_line_sse2 (dst, prev, cur, next, w, prefs, mrefs, parity, mode);
|
yadif_filter_line_sse2 (dst, prev, cur, next, w, prefs, mrefs, parity, mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue