mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
For #1685: Cross build RTC with FFmpeg
This commit is contained in:
parent
1c75a270b3
commit
1e9de0e191
267 changed files with 12603 additions and 1451 deletions
8
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/Makefile
vendored
Normal file
8
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/Makefile
vendored
Normal file
|
@ -0,0 +1,8 @@
|
|||
OBJS += arm/cpu.o \
|
||||
arm/float_dsp_init_arm.o \
|
||||
|
||||
VFP-OBJS += arm/float_dsp_init_vfp.o \
|
||||
arm/float_dsp_vfp.o \
|
||||
|
||||
NEON-OBJS += arm/float_dsp_init_neon.o \
|
||||
arm/float_dsp_neon.o \
|
67
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/bswap.h
vendored
Normal file
67
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/bswap.h
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ARM_BSWAP_H
|
||||
#define AVUTIL_ARM_BSWAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
#ifdef __ARMCC_VERSION
|
||||
|
||||
#if HAVE_ARMV6
|
||||
#define av_bswap32 av_bswap32
|
||||
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
|
||||
{
|
||||
return __rev(x);
|
||||
}
|
||||
#endif /* HAVE_ARMV6 */
|
||||
|
||||
#elif HAVE_INLINE_ASM
|
||||
|
||||
#if HAVE_ARMV6_INLINE
|
||||
#define av_bswap16 av_bswap16
|
||||
static av_always_inline av_const unsigned av_bswap16(unsigned x)
|
||||
{
|
||||
__asm__("rev16 %0, %0" : "+r"(x));
|
||||
return x;
|
||||
}
|
||||
#endif
|
||||
|
||||
#if AV_GCC_VERSION_AT_MOST(4,4)
|
||||
#define av_bswap32 av_bswap32
|
||||
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
|
||||
{
|
||||
#if HAVE_ARMV6_INLINE
|
||||
__asm__("rev %0, %0" : "+r"(x));
|
||||
#else
|
||||
uint32_t t;
|
||||
__asm__ ("eor %1, %0, %0, ror #16 \n\t"
|
||||
"bic %1, %1, #0xFF0000 \n\t"
|
||||
"mov %0, %0, ror #8 \n\t"
|
||||
"eor %0, %0, %1, lsr #8 \n\t"
|
||||
: "+r"(x), "=&r"(t));
|
||||
#endif /* HAVE_ARMV6_INLINE */
|
||||
return x;
|
||||
}
|
||||
#endif /* AV_GCC_VERSION_AT_MOST(4,4) */
|
||||
|
||||
#endif /* __ARMCC_VERSION */
|
||||
|
||||
#endif /* AVUTIL_ARM_BSWAP_H */
|
170
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/cpu.c
vendored
Normal file
170
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/cpu.c
vendored
Normal file
|
@ -0,0 +1,170 @@
|
|||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/cpu_internal.h"
|
||||
#include "config.h"
|
||||
|
||||
#define CORE_FLAG(f) \
|
||||
(AV_CPU_FLAG_ ## f * (HAVE_ ## f ## _EXTERNAL || HAVE_ ## f ## _INLINE))
|
||||
|
||||
#define CORE_CPU_FLAGS \
|
||||
(CORE_FLAG(ARMV5TE) | \
|
||||
CORE_FLAG(ARMV6) | \
|
||||
CORE_FLAG(ARMV6T2) | \
|
||||
CORE_FLAG(VFP) | \
|
||||
CORE_FLAG(VFPV3) | \
|
||||
CORE_FLAG(NEON))
|
||||
|
||||
#if defined __linux__ || defined __ANDROID__
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include "libavutil/avstring.h"
|
||||
|
||||
#define AT_HWCAP 16
|
||||
|
||||
/* Relevant HWCAP values from kernel headers */
|
||||
#define HWCAP_VFP (1 << 6)
|
||||
#define HWCAP_EDSP (1 << 7)
|
||||
#define HWCAP_THUMBEE (1 << 11)
|
||||
#define HWCAP_NEON (1 << 12)
|
||||
#define HWCAP_VFPv3 (1 << 13)
|
||||
#define HWCAP_TLS (1 << 15)
|
||||
|
||||
static int get_hwcap(uint32_t *hwcap)
|
||||
{
|
||||
struct { uint32_t a_type; uint32_t a_val; } auxv;
|
||||
FILE *f = fopen("/proc/self/auxv", "r");
|
||||
int err = -1;
|
||||
|
||||
if (!f)
|
||||
return -1;
|
||||
|
||||
while (fread(&auxv, sizeof(auxv), 1, f) > 0) {
|
||||
if (auxv.a_type == AT_HWCAP) {
|
||||
*hwcap = auxv.a_val;
|
||||
err = 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
return err;
|
||||
}
|
||||
|
||||
static int get_cpuinfo(uint32_t *hwcap)
|
||||
{
|
||||
FILE *f = fopen("/proc/cpuinfo", "r");
|
||||
char buf[200];
|
||||
|
||||
if (!f)
|
||||
return -1;
|
||||
|
||||
*hwcap = 0;
|
||||
while (fgets(buf, sizeof(buf), f)) {
|
||||
if (av_strstart(buf, "Features", NULL)) {
|
||||
if (strstr(buf, " edsp "))
|
||||
*hwcap |= HWCAP_EDSP;
|
||||
if (strstr(buf, " tls "))
|
||||
*hwcap |= HWCAP_TLS;
|
||||
if (strstr(buf, " thumbee "))
|
||||
*hwcap |= HWCAP_THUMBEE;
|
||||
if (strstr(buf, " vfp "))
|
||||
*hwcap |= HWCAP_VFP;
|
||||
if (strstr(buf, " vfpv3 "))
|
||||
*hwcap |= HWCAP_VFPv3;
|
||||
if (strstr(buf, " neon ") || strstr(buf, " asimd "))
|
||||
*hwcap |= HWCAP_NEON;
|
||||
if (strstr(buf, " fp ")) // Listed on 64 bit ARMv8 kernels
|
||||
*hwcap |= HWCAP_VFP | HWCAP_VFPv3;
|
||||
break;
|
||||
}
|
||||
}
|
||||
fclose(f);
|
||||
return 0;
|
||||
}
|
||||
|
||||
int ff_get_cpu_flags_arm(void)
|
||||
{
|
||||
int flags = CORE_CPU_FLAGS;
|
||||
uint32_t hwcap;
|
||||
|
||||
if (get_hwcap(&hwcap) < 0)
|
||||
if (get_cpuinfo(&hwcap) < 0)
|
||||
return flags;
|
||||
|
||||
#define check_cap(cap, flag) do { \
|
||||
if (hwcap & HWCAP_ ## cap) \
|
||||
flags |= AV_CPU_FLAG_ ## flag; \
|
||||
} while (0)
|
||||
|
||||
/* No flags explicitly indicate v6 or v6T2 so check others which
|
||||
imply support. */
|
||||
check_cap(EDSP, ARMV5TE);
|
||||
check_cap(TLS, ARMV6);
|
||||
check_cap(THUMBEE, ARMV6T2);
|
||||
check_cap(VFP, VFP);
|
||||
check_cap(VFPv3, VFPV3);
|
||||
check_cap(NEON, NEON);
|
||||
|
||||
/* The v6 checks above are not reliable so let higher flags
|
||||
trickle down. */
|
||||
if (flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON))
|
||||
flags |= AV_CPU_FLAG_ARMV6T2;
|
||||
else if (flags & (AV_CPU_FLAG_ARMV6T2 | AV_CPU_FLAG_ARMV6))
|
||||
/* Some functions use the 'setend' instruction which is deprecated on ARMv8
|
||||
* and serializing on some ARMv7 cores. This ensures such functions
|
||||
* are only enabled on ARMv6. */
|
||||
flags |= AV_CPU_FLAG_SETEND;
|
||||
|
||||
if (flags & AV_CPU_FLAG_ARMV6T2)
|
||||
flags |= AV_CPU_FLAG_ARMV6;
|
||||
|
||||
/* set the virtual VFPv2 vector mode flag */
|
||||
if ((flags & AV_CPU_FLAG_VFP) && !(flags & (AV_CPU_FLAG_VFPV3 | AV_CPU_FLAG_NEON)))
|
||||
flags |= AV_CPU_FLAG_VFP_VM;
|
||||
|
||||
return flags;
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
int ff_get_cpu_flags_arm(void)
|
||||
{
|
||||
return AV_CPU_FLAG_ARMV5TE * HAVE_ARMV5TE |
|
||||
AV_CPU_FLAG_ARMV6 * HAVE_ARMV6 |
|
||||
AV_CPU_FLAG_ARMV6T2 * HAVE_ARMV6T2 |
|
||||
AV_CPU_FLAG_VFP * HAVE_VFP |
|
||||
AV_CPU_FLAG_VFPV3 * HAVE_VFPV3 |
|
||||
AV_CPU_FLAG_NEON * HAVE_NEON |
|
||||
AV_CPU_FLAG_SETEND * !(HAVE_NEON | HAVE_VFPV3);
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
size_t ff_get_cpu_max_align_arm(void)
|
||||
{
|
||||
int flags = av_get_cpu_flags();
|
||||
|
||||
if (flags & AV_CPU_FLAG_NEON)
|
||||
return 16;
|
||||
|
||||
return 8;
|
||||
}
|
38
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/cpu.h
vendored
Normal file
38
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/cpu.h
vendored
Normal file
|
@ -0,0 +1,38 @@
|
|||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ARM_CPU_H
|
||||
#define AVUTIL_ARM_CPU_H
|
||||
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/cpu_internal.h"
|
||||
|
||||
#define have_armv5te(flags) CPUEXT(flags, ARMV5TE)
|
||||
#define have_armv6(flags) CPUEXT(flags, ARMV6)
|
||||
#define have_armv6t2(flags) CPUEXT(flags, ARMV6T2)
|
||||
#define have_vfp(flags) CPUEXT(flags, VFP)
|
||||
#define have_vfpv3(flags) CPUEXT(flags, VFPV3)
|
||||
#define have_neon(flags) CPUEXT(flags, NEON)
|
||||
#define have_setend(flags) CPUEXT(flags, SETEND)
|
||||
|
||||
/* some functions use the VFPv2 vector mode which is deprecated in ARMv7-A
|
||||
* and might trap on such CPU depending on the OS configuration */
|
||||
#define have_vfp_vm(flags) \
|
||||
(HAVE_VFP && ((flags) & AV_CPU_FLAG_VFP_VM))
|
||||
|
||||
#endif /* AVUTIL_ARM_CPU_H */
|
29
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_arm.h
vendored
Normal file
29
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_arm.h
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ARM_FLOAT_DSP_ARM_H
|
||||
#define AVUTIL_ARM_FLOAT_DSP_ARM_H
|
||||
|
||||
#include "libavutil/float_dsp.h"
|
||||
|
||||
void ff_float_dsp_init_vfp(AVFloatDSPContext *fdsp, int cpu_flags);
|
||||
void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp);
|
||||
|
||||
#endif /* AVUTIL_ARM_FLOAT_DSP_ARM_H */
|
32
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_init_arm.c
vendored
Normal file
32
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_init_arm.c
vendored
Normal file
|
@ -0,0 +1,32 @@
|
|||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "cpu.h"
|
||||
#include "float_dsp_arm.h"
|
||||
|
||||
av_cold void ff_float_dsp_init_arm(AVFloatDSPContext *fdsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_vfp(cpu_flags))
|
||||
ff_float_dsp_init_vfp(fdsp, cpu_flags);
|
||||
if (have_neon(cpu_flags))
|
||||
ff_float_dsp_init_neon(fdsp);
|
||||
}
|
59
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_init_neon.c
vendored
Normal file
59
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_init_neon.c
vendored
Normal file
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* ARM NEON optimised Float DSP functions
|
||||
* Copyright (c) 2008 Mans Rullgard <mans@mansr.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "float_dsp_arm.h"
|
||||
|
||||
void ff_vector_fmul_neon(float *dst, const float *src0, const float *src1, int len);
|
||||
|
||||
void ff_vector_fmac_scalar_neon(float *dst, const float *src, float mul,
|
||||
int len);
|
||||
|
||||
void ff_vector_fmul_scalar_neon(float *dst, const float *src, float mul,
|
||||
int len);
|
||||
|
||||
void ff_vector_fmul_window_neon(float *dst, const float *src0,
|
||||
const float *src1, const float *win, int len);
|
||||
|
||||
void ff_vector_fmul_add_neon(float *dst, const float *src0, const float *src1,
|
||||
const float *src2, int len);
|
||||
|
||||
void ff_vector_fmul_reverse_neon(float *dst, const float *src0,
|
||||
const float *src1, int len);
|
||||
|
||||
void ff_butterflies_float_neon(float *v1, float *v2, int len);
|
||||
|
||||
float ff_scalarproduct_float_neon(const float *v1, const float *v2, int len);
|
||||
|
||||
av_cold void ff_float_dsp_init_neon(AVFloatDSPContext *fdsp)
|
||||
{
|
||||
fdsp->vector_fmul = ff_vector_fmul_neon;
|
||||
fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_neon;
|
||||
fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_neon;
|
||||
fdsp->vector_fmul_window = ff_vector_fmul_window_neon;
|
||||
fdsp->vector_fmul_add = ff_vector_fmul_add_neon;
|
||||
fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_neon;
|
||||
fdsp->butterflies_float = ff_butterflies_float_neon;
|
||||
fdsp->scalarproduct_float = ff_scalarproduct_float_neon;
|
||||
}
|
46
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_init_vfp.c
vendored
Normal file
46
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/float_dsp_init_vfp.c
vendored
Normal file
|
@ -0,0 +1,46 @@
|
|||
/*
|
||||
* Copyright (c) 2008 Siarhei Siamashka <ssvb@users.sourceforge.net>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "cpu.h"
|
||||
#include "float_dsp_arm.h"
|
||||
|
||||
void ff_vector_fmul_vfp(float *dst, const float *src0, const float *src1,
|
||||
int len);
|
||||
|
||||
void ff_vector_fmul_window_vfp(float *dst, const float *src0,
|
||||
const float *src1, const float *win, int len);
|
||||
|
||||
void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
|
||||
const float *src1, int len);
|
||||
|
||||
void ff_butterflies_float_vfp(float *av_restrict v1, float *av_restrict v2, int len);
|
||||
|
||||
av_cold void ff_float_dsp_init_vfp(AVFloatDSPContext *fdsp, int cpu_flags)
|
||||
{
|
||||
if (have_vfp_vm(cpu_flags)) {
|
||||
fdsp->vector_fmul = ff_vector_fmul_vfp;
|
||||
fdsp->vector_fmul_window = ff_vector_fmul_window_vfp;
|
||||
}
|
||||
fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
|
||||
if (have_vfp_vm(cpu_flags))
|
||||
fdsp->butterflies_float = ff_butterflies_float_vfp;
|
||||
}
|
134
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/intmath.h
vendored
Normal file
134
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/intmath.h
vendored
Normal file
|
@ -0,0 +1,134 @@
|
|||
/*
|
||||
* Copyright (c) 2010 Mans Rullgard <mans@mansr.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ARM_INTMATH_H
|
||||
#define AVUTIL_ARM_INTMATH_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
|
||||
#if HAVE_ARMV6_INLINE
|
||||
|
||||
#define av_clip_uint8 av_clip_uint8_arm
|
||||
static av_always_inline av_const int av_clip_uint8_arm(int a)
|
||||
{
|
||||
int x;
|
||||
__asm__ ("usat %0, #8, %1" : "=r"(x) : "r"(a));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_clip_int8 av_clip_int8_arm
|
||||
static av_always_inline av_const int av_clip_int8_arm(int a)
|
||||
{
|
||||
int x;
|
||||
__asm__ ("ssat %0, #8, %1" : "=r"(x) : "r"(a));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_clip_uint16 av_clip_uint16_arm
|
||||
static av_always_inline av_const int av_clip_uint16_arm(int a)
|
||||
{
|
||||
int x;
|
||||
__asm__ ("usat %0, #16, %1" : "=r"(x) : "r"(a));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_clip_int16 av_clip_int16_arm
|
||||
static av_always_inline av_const int av_clip_int16_arm(int a)
|
||||
{
|
||||
int x;
|
||||
__asm__ ("ssat %0, #16, %1" : "=r"(x) : "r"(a));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_clip_intp2 av_clip_intp2_arm
|
||||
static av_always_inline av_const int av_clip_intp2_arm(int a, int p)
|
||||
{
|
||||
unsigned x;
|
||||
__asm__ ("ssat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p+1));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_clip_uintp2 av_clip_uintp2_arm
|
||||
static av_always_inline av_const unsigned av_clip_uintp2_arm(int a, int p)
|
||||
{
|
||||
unsigned x;
|
||||
__asm__ ("usat %0, %2, %1" : "=r"(x) : "r"(a), "i"(p));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_sat_add32 av_sat_add32_arm
|
||||
static av_always_inline int av_sat_add32_arm(int a, int b)
|
||||
{
|
||||
int r;
|
||||
__asm__ ("qadd %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
|
||||
return r;
|
||||
}
|
||||
|
||||
#define av_sat_dadd32 av_sat_dadd32_arm
|
||||
static av_always_inline int av_sat_dadd32_arm(int a, int b)
|
||||
{
|
||||
int r;
|
||||
__asm__ ("qdadd %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
|
||||
return r;
|
||||
}
|
||||
|
||||
#define av_sat_sub32 av_sat_sub32_arm
|
||||
static av_always_inline int av_sat_sub32_arm(int a, int b)
|
||||
{
|
||||
int r;
|
||||
__asm__ ("qsub %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
|
||||
return r;
|
||||
}
|
||||
|
||||
#define av_sat_dsub32 av_sat_dsub32_arm
|
||||
static av_always_inline int av_sat_dsub32_arm(int a, int b)
|
||||
{
|
||||
int r;
|
||||
__asm__ ("qdsub %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
|
||||
return r;
|
||||
}
|
||||
|
||||
#endif /* HAVE_ARMV6_INLINE */
|
||||
|
||||
#if HAVE_ASM_MOD_Q
|
||||
|
||||
#define av_clipl_int32 av_clipl_int32_arm
|
||||
static av_always_inline av_const int32_t av_clipl_int32_arm(int64_t a)
|
||||
{
|
||||
int x, y;
|
||||
__asm__ ("adds %1, %R2, %Q2, lsr #31 \n\t"
|
||||
"itet ne \n\t"
|
||||
"mvnne %1, #1<<31 \n\t"
|
||||
"moveq %0, %Q2 \n\t"
|
||||
"eorne %0, %1, %R2, asr #31 \n\t"
|
||||
: "=r"(x), "=&r"(y) : "r"(a) : "cc");
|
||||
return x;
|
||||
}
|
||||
|
||||
#endif /* HAVE_ASM_MOD_Q */
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
#endif /* AVUTIL_ARM_INTMATH_H */
|
91
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/intreadwrite.h
vendored
Normal file
91
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/intreadwrite.h
vendored
Normal file
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ARM_INTREADWRITE_H
|
||||
#define AVUTIL_ARM_INTREADWRITE_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
#if HAVE_FAST_UNALIGNED && HAVE_INLINE_ASM && AV_GCC_VERSION_AT_MOST(4,6)
|
||||
|
||||
#define AV_RN16 AV_RN16
|
||||
static av_always_inline unsigned AV_RN16(const void *p)
|
||||
{
|
||||
const uint8_t *q = p;
|
||||
unsigned v;
|
||||
#if AV_GCC_VERSION_AT_MOST(4,5)
|
||||
__asm__ ("ldrh %0, %1" : "=r"(v) : "m"(*(const uint16_t *)q));
|
||||
#elif defined __thumb__
|
||||
__asm__ ("ldrh %0, %1" : "=r"(v) : "m"(q[0]), "m"(q[1]));
|
||||
#else
|
||||
__asm__ ("ldrh %0, %1" : "=r"(v) : "Uq"(q[0]), "m"(q[1]));
|
||||
#endif
|
||||
return v;
|
||||
}
|
||||
|
||||
#define AV_WN16 AV_WN16
|
||||
static av_always_inline void AV_WN16(void *p, uint16_t v)
|
||||
{
|
||||
__asm__ ("strh %1, %0" : "=m"(*(uint16_t *)p) : "r"(v));
|
||||
}
|
||||
|
||||
#define AV_RN32 AV_RN32
|
||||
static av_always_inline uint32_t AV_RN32(const void *p)
|
||||
{
|
||||
const struct __attribute__((packed)) { uint32_t v; } *q = p;
|
||||
uint32_t v;
|
||||
__asm__ ("ldr %0, %1" : "=r"(v) : "m"(*q));
|
||||
return v;
|
||||
}
|
||||
|
||||
#define AV_WN32 AV_WN32
|
||||
static av_always_inline void AV_WN32(void *p, uint32_t v)
|
||||
{
|
||||
__asm__ ("str %1, %0" : "=m"(*(uint32_t *)p) : "r"(v));
|
||||
}
|
||||
|
||||
#if HAVE_ASM_MOD_Q
|
||||
|
||||
#define AV_RN64 AV_RN64
|
||||
static av_always_inline uint64_t AV_RN64(const void *p)
|
||||
{
|
||||
const struct __attribute__((packed)) { uint32_t v; } *q = p;
|
||||
uint64_t v;
|
||||
__asm__ ("ldr %Q0, %1 \n\t"
|
||||
"ldr %R0, %2 \n\t"
|
||||
: "=&r"(v)
|
||||
: "m"(q[0]), "m"(q[1]));
|
||||
return v;
|
||||
}
|
||||
|
||||
#define AV_WN64 AV_WN64
|
||||
static av_always_inline void AV_WN64(void *p, uint64_t v)
|
||||
{
|
||||
__asm__ ("str %Q2, %0 \n\t"
|
||||
"str %R2, %1 \n\t"
|
||||
: "=m"(*(uint32_t*)p), "=m"(*((uint32_t*)p+1))
|
||||
: "r"(v));
|
||||
}
|
||||
|
||||
#endif /* HAVE_ASM_MOD_Q */
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
#endif /* AVUTIL_ARM_INTREADWRITE_H */
|
67
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/neontest.h
vendored
Normal file
67
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/neontest.h
vendored
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* check NEON registers for clobbering
|
||||
* Copyright (c) 2008 Ramiro Polla <ramiro.polla@gmail.com>
|
||||
* Copyright (c) 2013 Martin Storsjo
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ARM_NEONTEST_H
|
||||
#define AVUTIL_ARM_NEONTEST_H
|
||||
|
||||
#include <inttypes.h>
|
||||
#include <stdint.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdarg.h>
|
||||
#include <string.h>
|
||||
|
||||
#include "libavutil/bswap.h"
|
||||
|
||||
#define storeneonregs(mem) \
|
||||
__asm__ volatile( \
|
||||
"vstm %0, {d8-d15}\n\t" \
|
||||
:: "r"(mem) : "memory")
|
||||
|
||||
#define testneonclobbers(func, ctx, ...) \
|
||||
uint64_t neon[2][8]; \
|
||||
int ret; \
|
||||
storeneonregs(neon[0]); \
|
||||
ret = __real_ ## func(ctx, __VA_ARGS__); \
|
||||
storeneonregs(neon[1]); \
|
||||
if (memcmp(neon[0], neon[1], sizeof(neon[0]))) { \
|
||||
int i; \
|
||||
av_log(ctx, AV_LOG_ERROR, \
|
||||
"NEON REGS CLOBBERED IN %s!\n", #func); \
|
||||
for (i = 0; i < 8; i ++) \
|
||||
if (neon[0][i] != neon[1][i]) { \
|
||||
av_log(ctx, AV_LOG_ERROR, \
|
||||
"d%-2d = %016"PRIx64"\n", \
|
||||
8 + i, av_bswap64(neon[0][i])); \
|
||||
av_log(ctx, AV_LOG_ERROR, \
|
||||
" -> %016"PRIx64"\n", \
|
||||
av_bswap64(neon[1][i])); \
|
||||
} \
|
||||
abort(); \
|
||||
} \
|
||||
return ret
|
||||
|
||||
#define wrap(func) \
|
||||
int __real_ ## func; \
|
||||
int __wrap_ ## func; \
|
||||
int __wrap_ ## func
|
||||
|
||||
#endif /* AVUTIL_ARM_NEONTEST_H */
|
40
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/timer.h
vendored
Normal file
40
trunk/3rdparty/ffmpeg-4-fit/libavutil/arm/arm/timer.h
vendored
Normal file
|
@ -0,0 +1,40 @@
|
|||
/*
|
||||
* Copyright (c) 2009 Mans Rullgard <mans@mansr.com>
|
||||
*
|
||||
* This file is part of FFmpeg.
|
||||
*
|
||||
* FFmpeg is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later version.
|
||||
*
|
||||
* FFmpeg is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
|
||||
* Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with FFmpeg; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_ARM_TIMER_H
|
||||
#define AVUTIL_ARM_TIMER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_INLINE_ASM && defined(__ARM_ARCH_7A__)
|
||||
|
||||
#define AV_READ_TIME read_time
|
||||
|
||||
static inline uint64_t read_time(void)
|
||||
{
|
||||
unsigned cc;
|
||||
__asm__ volatile ("mrc p15, 0, %0, c9, c13, 0" : "=r"(cc));
|
||||
return cc;
|
||||
}
|
||||
|
||||
#endif /* HAVE_INLINE_ASM && __ARM_ARCH_7A__ */
|
||||
|
||||
#endif /* AVUTIL_ARM_TIMER_H */
|
Loading…
Add table
Add a link
Reference in a new issue