mirror of
https://github.com/ossrs/srs.git
synced 2025-03-09 15:49:59 +00:00
Rename ffmpeg-4.2-fit to ffmpeg-4-fit
This commit is contained in:
parent
b19074721c
commit
27712fdda7
720 changed files with 14 additions and 14 deletions
4
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/Makefile
vendored
Normal file
4
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/Makefile
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
OBJS += aarch64/cpu.o \
|
||||
aarch64/float_dsp_init.o \
|
||||
|
||||
NEON-OBJS += aarch64/float_dsp_neon.o
|
50
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/bswap.h
vendored
Normal file
50
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/bswap.h
vendored
Normal file
|
@ -0,0 +1,50 @@
|
|||
/*
|
||||
* 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_AARCH64_BSWAP_H
|
||||
#define AVUTIL_AARCH64_BSWAP_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
|
||||
#define av_bswap16 av_bswap16
|
||||
static av_always_inline av_const unsigned av_bswap16(unsigned x)
|
||||
{
|
||||
__asm__("rev16 %w0, %w0" : "+r"(x));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_bswap32 av_bswap32
|
||||
static av_always_inline av_const uint32_t av_bswap32(uint32_t x)
|
||||
{
|
||||
__asm__("rev %w0, %w0" : "+r"(x));
|
||||
return x;
|
||||
}
|
||||
|
||||
#define av_bswap64 av_bswap64
|
||||
static av_always_inline av_const uint64_t av_bswap64(uint64_t x)
|
||||
{
|
||||
__asm__("rev %0, %0" : "+r"(x));
|
||||
return x;
|
||||
}
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
#endif /* AVUTIL_AARCH64_BSWAP_H */
|
38
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/cpu.c
vendored
Normal file
38
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/cpu.c
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
|
||||
*/
|
||||
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/cpu_internal.h"
|
||||
#include "config.h"
|
||||
|
||||
int ff_get_cpu_flags_aarch64(void)
|
||||
{
|
||||
return AV_CPU_FLAG_ARMV8 * HAVE_ARMV8 |
|
||||
AV_CPU_FLAG_NEON * HAVE_NEON |
|
||||
AV_CPU_FLAG_VFP * HAVE_VFP;
|
||||
}
|
||||
|
||||
size_t ff_get_cpu_max_align_aarch64(void)
|
||||
{
|
||||
int flags = av_get_cpu_flags();
|
||||
|
||||
if (flags & AV_CPU_FLAG_NEON)
|
||||
return 16;
|
||||
|
||||
return 8;
|
||||
}
|
29
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/cpu.h
vendored
Normal file
29
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/cpu.h
vendored
Normal file
|
@ -0,0 +1,29 @@
|
|||
/*
|
||||
* 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_AARCH64_CPU_H
|
||||
#define AVUTIL_AARCH64_CPU_H
|
||||
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/cpu_internal.h"
|
||||
|
||||
#define have_armv8(flags) CPUEXT(flags, ARMV8)
|
||||
#define have_neon(flags) CPUEXT(flags, NEON)
|
||||
#define have_vfp(flags) CPUEXT(flags, VFP)
|
||||
|
||||
#endif /* AVUTIL_AARCH64_CPU_H */
|
69
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/float_dsp_init.c
vendored
Normal file
69
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/float_dsp_init.c
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
/*
|
||||
* 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/cpu.h"
|
||||
#include "libavutil/float_dsp.h"
|
||||
#include "cpu.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_dmul_scalar_neon(double *dst, const double *src, double 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_aarch64(AVFloatDSPContext *fdsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
fdsp->butterflies_float = ff_butterflies_float_neon;
|
||||
fdsp->scalarproduct_float = ff_scalarproduct_float_neon;
|
||||
fdsp->vector_dmul_scalar = ff_vector_dmul_scalar_neon;
|
||||
fdsp->vector_fmul = ff_vector_fmul_neon;
|
||||
fdsp->vector_fmac_scalar = ff_vector_fmac_scalar_neon;
|
||||
fdsp->vector_fmul_add = ff_vector_fmul_add_neon;
|
||||
fdsp->vector_fmul_reverse = ff_vector_fmul_reverse_neon;
|
||||
fdsp->vector_fmul_scalar = ff_vector_fmul_scalar_neon;
|
||||
fdsp->vector_fmul_window = ff_vector_fmul_window_neon;
|
||||
}
|
||||
}
|
70
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/neontest.h
vendored
Normal file
70
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/neontest.h
vendored
Normal file
|
@ -0,0 +1,70 @@
|
|||
/*
|
||||
* 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_AARCH64_NEONTEST_H
|
||||
#define AVUTIL_AARCH64_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( \
|
||||
"stp d8, d9, [%0]\n\t" \
|
||||
"stp d10, d11, [%0, #16]\n\t" \
|
||||
"stp d12, d13, [%0, #32]\n\t" \
|
||||
"stp d14, d15, [%0, #48]\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_AARCH64_NEONTEST_H */
|
44
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/timer.h
vendored
Normal file
44
trunk/3rdparty/ffmpeg-4-fit/libavutil/aarch64/timer.h
vendored
Normal file
|
@ -0,0 +1,44 @@
|
|||
/*
|
||||
* Copyright (c) 2015 Janne Grunau <janne-libav@jannau.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
|
||||
*/
|
||||
|
||||
#ifndef AVUTIL_AARCH64_TIMER_H
|
||||
#define AVUTIL_AARCH64_TIMER_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
|
||||
#define AV_READ_TIME read_time
|
||||
|
||||
static inline uint64_t read_time(void)
|
||||
{
|
||||
uint64_t cycle_counter;
|
||||
__asm__ volatile(
|
||||
"isb \t\n"
|
||||
"mrs %0, pmccntr_el0 "
|
||||
: "=r"(cycle_counter) :: "memory" );
|
||||
|
||||
return cycle_counter;
|
||||
}
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
#endif /* AVUTIL_AARCH64_TIMER_H */
|
Loading…
Add table
Add a link
Reference in a new issue