mirror of https://github.com/ossrs/srs.git
For #1685: Cross build RTC with FFmpeg
parent
1c75a270b3
commit
1e9de0e191
@ -0,0 +1,154 @@
|
||||
ARCH_HEADERS = mathops.h
|
||||
|
||||
# subsystems
|
||||
OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
|
||||
arm/ac3dsp_arm.o
|
||||
OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o
|
||||
OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \
|
||||
arm/fft_fixed_init_arm.o
|
||||
OBJS-$(CONFIG_FLACDSP) += arm/flacdsp_init_arm.o \
|
||||
arm/flacdsp_arm.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_init_arm.o
|
||||
OBJS-$(CONFIG_G722DSP) += arm/g722dsp_init_arm.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
|
||||
OBJS-$(CONFIG_H264DSP) += arm/h264dsp_init_arm.o
|
||||
OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o
|
||||
OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o
|
||||
OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \
|
||||
arm/hpeldsp_arm.o
|
||||
OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \
|
||||
arm/idctdsp_arm.o \
|
||||
arm/jrevdct_arm.o \
|
||||
arm/simple_idct_arm.o
|
||||
OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_ME_CMP) += arm/me_cmp_init_arm.o
|
||||
OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
|
||||
OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_init_arm.o
|
||||
OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
|
||||
OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_init_arm.o
|
||||
OBJS-$(CONFIG_RDFT) += arm/rdft_init_arm.o
|
||||
OBJS-$(CONFIG_RV34DSP) += arm/rv34dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_arm.o
|
||||
|
||||
# decoders/encoders
|
||||
OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \
|
||||
arm/sbrdsp_init_arm.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_init_arm.o
|
||||
OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o
|
||||
OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += arm/rv40dsp_init_arm.o
|
||||
OBJS-$(CONFIG_SBC_ENCODER) += arm/sbcdsp_init_arm.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP9_DECODER) += arm/vp9dsp_init_10bpp_arm.o \
|
||||
arm/vp9dsp_init_12bpp_arm.o \
|
||||
arm/vp9dsp_init_arm.o
|
||||
|
||||
|
||||
# ARMv5 optimizations
|
||||
# subsystems
|
||||
ARMV5TE-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv5te.o \
|
||||
arm/simple_idct_armv5te.o
|
||||
ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \
|
||||
arm/mpegvideo_armv5te_s.o
|
||||
ARMV5TE-OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_armv5te.o \
|
||||
arm/videodsp_armv5te.o
|
||||
|
||||
# decoders/encoders
|
||||
ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o
|
||||
|
||||
|
||||
# ARMv6 optimizations
|
||||
# subsystems
|
||||
ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \
|
||||
arm/hpeldsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \
|
||||
arm/idctdsp_armv6.o \
|
||||
arm/simple_idct_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_ME_CMP) += arm/me_cmp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_STARTCODE) += arm/startcode_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_VP8DSP) += arm/vp8_armv6.o \
|
||||
arm/vp8dsp_init_armv6.o \
|
||||
arm/vp8dsp_armv6.o
|
||||
|
||||
# decoders/encoders
|
||||
ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_SBC_ENCODER) += arm/sbcdsp_armv6.o
|
||||
|
||||
|
||||
# VFP optimizations
|
||||
|
||||
# subsystems
|
||||
VFP-OBJS-$(CONFIG_FFT) += arm/fft_vfp.o
|
||||
VFP-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_vfp.o
|
||||
VFP-OBJS-$(CONFIG_MDCT) += arm/mdct_vfp.o
|
||||
|
||||
# decoders/encoders
|
||||
VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_vfp.o
|
||||
|
||||
|
||||
# NEON optimizations
|
||||
|
||||
# subsystems
|
||||
NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \
|
||||
arm/audiodsp_neon.o \
|
||||
arm/int_neon.o
|
||||
NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \
|
||||
arm/blockdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
|
||||
arm/fft_fixed_neon.o
|
||||
NEON-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_neon.o
|
||||
NEON-OBJS-$(CONFIG_G722DSP) += arm/g722dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_neon.o \
|
||||
arm/h264idct_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264PRED) += arm/h264pred_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \
|
||||
arm/hpeldsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \
|
||||
arm/hpeldsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \
|
||||
arm/idctdsp_neon.o \
|
||||
arm/simple_idct_neon.o
|
||||
NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
|
||||
arm/mdct_fixed_neon.o
|
||||
NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
|
||||
NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o
|
||||
NEON-OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_neon.o \
|
||||
arm/vc1dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_neon.o \
|
||||
arm/vp8dsp_neon.o
|
||||
|
||||
# decoders/encoders
|
||||
NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_neon.o \
|
||||
arm/sbrdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_neon.o
|
||||
NEON-OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_neon.o \
|
||||
arm/hevcdsp_deblock_neon.o \
|
||||
arm/hevcdsp_idct_neon.o \
|
||||
arm/hevcdsp_qpel_neon.o \
|
||||
arm/hevcdsp_sao_neon.o
|
||||
NEON-OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_neon.o \
|
||||
arm/rv40dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_SBC_ENCODER) += arm/sbcdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP9_DECODER) += arm/vp9itxfm_16bpp_neon.o \
|
||||
arm/vp9itxfm_neon.o \
|
||||
arm/vp9lpf_16bpp_neon.o \
|
||||
arm/vp9lpf_neon.o \
|
||||
arm/vp9mc_16bpp_neon.o \
|
||||
arm/vp9mc_neon.o
|
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_AAC_H
|
||||
#define AVCODEC_ARM_AAC_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_NEON_INLINE
|
||||
|
||||
#define VMUL2 VMUL2
|
||||
static inline float *VMUL2(float *dst, const float *v, unsigned idx,
|
||||
const float *scale)
|
||||
{
|
||||
unsigned v0, v1;
|
||||
__asm__ ("ubfx %0, %6, #0, #4 \n\t"
|
||||
"ubfx %1, %6, #4, #4 \n\t"
|
||||
"ldr %0, [%5, %0, lsl #2] \n\t"
|
||||
"ldr %1, [%5, %1, lsl #2] \n\t"
|
||||
"vld1.32 {d1[]}, [%7,:32] \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"vmul.f32 d0, d0, d1 \n\t"
|
||||
"vst1.32 {d0}, [%2,:64]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "+r"(dst), "=m"(dst[0]), "=m"(dst[1])
|
||||
: "r"(v), "r"(idx), "r"(scale)
|
||||
: "d0", "d1");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define VMUL4 VMUL4
|
||||
static inline float *VMUL4(float *dst, const float *v, unsigned idx,
|
||||
const float *scale)
|
||||
{
|
||||
unsigned v0, v1, v2, v3;
|
||||
__asm__ ("ubfx %0, %10, #0, #2 \n\t"
|
||||
"ubfx %1, %10, #2, #2 \n\t"
|
||||
"ldr %0, [%9, %0, lsl #2] \n\t"
|
||||
"ubfx %2, %10, #4, #2 \n\t"
|
||||
"ldr %1, [%9, %1, lsl #2] \n\t"
|
||||
"ubfx %3, %10, #6, #2 \n\t"
|
||||
"ldr %2, [%9, %2, lsl #2] \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"ldr %3, [%9, %3, lsl #2] \n\t"
|
||||
"vld1.32 {d2[],d3[]},[%11,:32] \n\t"
|
||||
"vmov d1, %2, %3 \n\t"
|
||||
"vmul.f32 q0, q0, q1 \n\t"
|
||||
"vst1.32 {q0}, [%4,:128]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
|
||||
"=m"(dst[0]), "=m"(dst[1]), "=m"(dst[2]), "=m"(dst[3])
|
||||
: "r"(v), "r"(idx), "r"(scale)
|
||||
: "d0", "d1", "d2", "d3");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define VMUL2S VMUL2S
|
||||
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
|
||||
unsigned sign, const float *scale)
|
||||
{
|
||||
unsigned v0, v1, v2, v3;
|
||||
__asm__ ("ubfx %0, %8, #0, #4 \n\t"
|
||||
"ubfx %1, %8, #4, #4 \n\t"
|
||||
"ldr %0, [%7, %0, lsl #2] \n\t"
|
||||
"lsl %2, %10, #30 \n\t"
|
||||
"ldr %1, [%7, %1, lsl #2] \n\t"
|
||||
"lsl %3, %10, #31 \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"bic %2, %2, #1<<30 \n\t"
|
||||
"vld1.32 {d1[]}, [%9,:32] \n\t"
|
||||
"vmov d2, %2, %3 \n\t"
|
||||
"veor d0, d0, d2 \n\t"
|
||||
"vmul.f32 d0, d0, d1 \n\t"
|
||||
"vst1.32 {d0}, [%4,:64]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
|
||||
"=m"(dst[0]), "=m"(dst[1])
|
||||
: "r"(v), "r"(idx), "r"(scale), "r"(sign)
|
||||
: "d0", "d1", "d2");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define VMUL4S VMUL4S
|
||||
static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
|
||||
unsigned sign, const float *scale)
|
||||
{
|
||||
unsigned v0, v1, v2, v3, nz;
|
||||
__asm__ ("vld1.32 {d2[],d3[]},[%13,:32] \n\t"
|
||||
"ubfx %0, %12, #0, #2 \n\t"
|
||||
"ubfx %1, %12, #2, #2 \n\t"
|
||||
"ldr %0, [%11,%0, lsl #2] \n\t"
|
||||
"ubfx %2, %12, #4, #2 \n\t"
|
||||
"ldr %1, [%11,%1, lsl #2] \n\t"
|
||||
"ubfx %3, %12, #6, #2 \n\t"
|
||||
"ldr %2, [%11,%2, lsl #2] \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"ldr %3, [%11,%3, lsl #2] \n\t"
|
||||
"lsr %6, %12, #12 \n\t"
|
||||
"rbit %6, %6 \n\t"
|
||||
"vmov d1, %2, %3 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %0, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %1, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %2, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"vmov d4, %0, %1 \n\t"
|
||||
"and %3, %5, #1<<31 \n\t"
|
||||
"vmov d5, %2, %3 \n\t"
|
||||
"veor q0, q0, q2 \n\t"
|
||||
"vmul.f32 q0, q0, q1 \n\t"
|
||||
"vst1.32 {q0}, [%4,:128]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
|
||||
"+r"(sign), "=r"(nz),
|
||||
"=m"(dst[0]), "=m"(dst[1]), "=m"(dst[2]), "=m"(dst[3])
|
||||
: "r"(v), "r"(idx), "r"(scale)
|
||||
: "cc", "d0", "d1", "d2", "d3", "d4", "d5");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#endif /* HAVE_NEON_INLINE */
|
||||
|
||||
#endif /* AVCODEC_ARM_AAC_H */
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Mans Rullgard
|
||||
*
|
||||
* 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 "config.h"
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/aacpsdsp.h"
|
||||
|
||||
void ff_ps_add_squares_neon(float *dst, const float (*src)[2], int n);
|
||||
void ff_ps_mul_pair_single_neon(float (*dst)[2], float (*src0)[2],
|
||||
float *src1, int n);
|
||||
void ff_ps_hybrid_analysis_neon(float (*out)[2], float (*in)[2],
|
||||
const float (*filter)[8][2],
|
||||
ptrdiff_t stride, int n);
|
||||
void ff_ps_hybrid_analysis_ileave_neon(float (*out)[32][2], float L[2][38][64],
|
||||
int i, int len);
|
||||
void ff_ps_hybrid_synthesis_deint_neon(float out[2][38][64], float (*in)[32][2],
|
||||
int i, int len);
|
||||
void ff_ps_decorrelate_neon(float (*out)[2], float (*delay)[2],
|
||||
float (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
|
||||
const float phi_fract[2], float (*Q_fract)[2],
|
||||
const float *transient_gain, float g_decay_slope,
|
||||
int len);
|
||||
void ff_ps_stereo_interpolate_neon(float (*l)[2], float (*r)[2],
|
||||
float h[2][4], float h_step[2][4],
|
||||
int len);
|
||||
|
||||
av_cold void ff_psdsp_init_arm(PSDSPContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->add_squares = ff_ps_add_squares_neon;
|
||||
s->mul_pair_single = ff_ps_mul_pair_single_neon;
|
||||
s->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_neon;
|
||||
s->hybrid_analysis = ff_ps_hybrid_analysis_neon;
|
||||
s->stereo_interpolate[0] = ff_ps_stereo_interpolate_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2011 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/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/ac3dsp.h"
|
||||
#include "config.h"
|
||||
|
||||
void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
|
||||
int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
|
||||
void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift);
|
||||
void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift);
|
||||
void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
|
||||
void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
|
||||
void ff_apply_window_int16_neon(int16_t *dst, const int16_t *src,
|
||||
const int16_t *window, unsigned n);
|
||||
void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4],
|
||||
const int32_t *coef0,
|
||||
const int32_t *coef1,
|
||||
int len);
|
||||
void ff_ac3_sum_square_butterfly_float_neon(float sum[4],
|
||||
const float *coef0,
|
||||
const float *coef1,
|
||||
int len);
|
||||
|
||||
void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd,
|
||||
int start, int end,
|
||||
int snr_offset, int floor,
|
||||
const uint8_t *bap_tab, uint8_t *bap);
|
||||
|
||||
void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len);
|
||||
|
||||
av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
c->update_bap_counts = ff_ac3_update_bap_counts_arm;
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
c->bit_alloc_calc_bap = ff_ac3_bit_alloc_calc_bap_armv6;
|
||||
}
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->ac3_exponent_min = ff_ac3_exponent_min_neon;
|
||||
c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
|
||||
c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon;
|
||||
c->ac3_rshift_int32 = ff_ac3_rshift_int32_neon;
|
||||
c->float_to_fixed24 = ff_float_to_fixed24_neon;
|
||||
c->extract_exponents = ff_ac3_extract_exponents_neon;
|
||||
c->apply_window_int16 = ff_apply_window_int16_neon;
|
||||
c->sum_square_butterfly_int32 = ff_ac3_sum_square_butterfly_int32_neon;
|
||||
c->sum_square_butterfly_float = ff_ac3_sum_square_butterfly_float_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,154 @@
|
||||
ARCH_HEADERS = mathops.h
|
||||
|
||||
# subsystems
|
||||
OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_init_arm.o \
|
||||
arm/ac3dsp_arm.o
|
||||
OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_arm.o
|
||||
OBJS-$(CONFIG_FFT) += arm/fft_init_arm.o \
|
||||
arm/fft_fixed_init_arm.o
|
||||
OBJS-$(CONFIG_FLACDSP) += arm/flacdsp_init_arm.o \
|
||||
arm/flacdsp_arm.o
|
||||
OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_init_arm.o
|
||||
OBJS-$(CONFIG_G722DSP) += arm/g722dsp_init_arm.o
|
||||
OBJS-$(CONFIG_H264CHROMA) += arm/h264chroma_init_arm.o
|
||||
OBJS-$(CONFIG_H264DSP) += arm/h264dsp_init_arm.o
|
||||
OBJS-$(CONFIG_H264PRED) += arm/h264pred_init_arm.o
|
||||
OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_init_arm.o
|
||||
OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_arm.o \
|
||||
arm/hpeldsp_arm.o
|
||||
OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_arm.o \
|
||||
arm/idctdsp_arm.o \
|
||||
arm/jrevdct_arm.o \
|
||||
arm/simple_idct_arm.o
|
||||
OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_ME_CMP) += arm/me_cmp_init_arm.o
|
||||
OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_init_arm.o
|
||||
OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_arm.o
|
||||
OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_init_arm.o
|
||||
OBJS-$(CONFIG_NEON_CLOBBER_TEST) += arm/neontest.o
|
||||
OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_init_arm.o
|
||||
OBJS-$(CONFIG_RDFT) += arm/rdft_init_arm.o
|
||||
OBJS-$(CONFIG_RV34DSP) += arm/rv34dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_arm.o
|
||||
|
||||
# decoders/encoders
|
||||
OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_init_arm.o \
|
||||
arm/sbrdsp_init_arm.o
|
||||
OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_init_arm.o
|
||||
OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_arm.o
|
||||
OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_init_arm.o
|
||||
OBJS-$(CONFIG_RV40_DECODER) += arm/rv40dsp_init_arm.o
|
||||
OBJS-$(CONFIG_SBC_ENCODER) += arm/sbcdsp_init_arm.o
|
||||
OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_init_arm.o
|
||||
OBJS-$(CONFIG_VP9_DECODER) += arm/vp9dsp_init_10bpp_arm.o \
|
||||
arm/vp9dsp_init_12bpp_arm.o \
|
||||
arm/vp9dsp_init_arm.o
|
||||
|
||||
|
||||
# ARMv5 optimizations
|
||||
# subsystems
|
||||
ARMV5TE-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv5te.o \
|
||||
arm/simple_idct_armv5te.o
|
||||
ARMV5TE-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_armv5te.o \
|
||||
arm/mpegvideo_armv5te_s.o
|
||||
ARMV5TE-OBJS-$(CONFIG_VIDEODSP) += arm/videodsp_init_armv5te.o \
|
||||
arm/videodsp_armv5te.o
|
||||
|
||||
# decoders/encoders
|
||||
ARMV5TE-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv5te.o
|
||||
|
||||
|
||||
# ARMv6 optimizations
|
||||
# subsystems
|
||||
ARMV6-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_armv6.o \
|
||||
arm/hpeldsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_armv6.o \
|
||||
arm/idctdsp_armv6.o \
|
||||
arm/simple_idct_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_ME_CMP) += arm/me_cmp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_MPEGAUDIODSP) += arm/mpegaudiodsp_fixed_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_MPEGVIDEOENC) += arm/mpegvideoencdsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_PIXBLOCKDSP) += arm/pixblockdsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_STARTCODE) += arm/startcode_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_VP8DSP) += arm/vp8_armv6.o \
|
||||
arm/vp8dsp_init_armv6.o \
|
||||
arm/vp8dsp_armv6.o
|
||||
|
||||
# decoders/encoders
|
||||
ARMV6-OBJS-$(CONFIG_MLP_DECODER) += arm/mlpdsp_armv6.o
|
||||
ARMV6-OBJS-$(CONFIG_SBC_ENCODER) += arm/sbcdsp_armv6.o
|
||||
|
||||
|
||||
# VFP optimizations
|
||||
|
||||
# subsystems
|
||||
VFP-OBJS-$(CONFIG_FFT) += arm/fft_vfp.o
|
||||
VFP-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_vfp.o
|
||||
VFP-OBJS-$(CONFIG_MDCT) += arm/mdct_vfp.o
|
||||
|
||||
# decoders/encoders
|
||||
VFP-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_vfp.o
|
||||
|
||||
|
||||
# NEON optimizations
|
||||
|
||||
# subsystems
|
||||
NEON-OBJS-$(CONFIG_AC3DSP) += arm/ac3dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_AUDIODSP) += arm/audiodsp_init_neon.o \
|
||||
arm/audiodsp_neon.o \
|
||||
arm/int_neon.o
|
||||
NEON-OBJS-$(CONFIG_BLOCKDSP) += arm/blockdsp_init_neon.o \
|
||||
arm/blockdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_FFT) += arm/fft_neon.o \
|
||||
arm/fft_fixed_neon.o
|
||||
NEON-OBJS-$(CONFIG_FMTCONVERT) += arm/fmtconvert_neon.o
|
||||
NEON-OBJS-$(CONFIG_G722DSP) += arm/g722dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264CHROMA) += arm/h264cmc_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264DSP) += arm/h264dsp_neon.o \
|
||||
arm/h264idct_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264PRED) += arm/h264pred_neon.o
|
||||
NEON-OBJS-$(CONFIG_H264QPEL) += arm/h264qpel_neon.o \
|
||||
arm/hpeldsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_HPELDSP) += arm/hpeldsp_init_neon.o \
|
||||
arm/hpeldsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_IDCTDSP) += arm/idctdsp_init_neon.o \
|
||||
arm/idctdsp_neon.o \
|
||||
arm/simple_idct_neon.o
|
||||
NEON-OBJS-$(CONFIG_MDCT) += arm/mdct_neon.o \
|
||||
arm/mdct_fixed_neon.o
|
||||
NEON-OBJS-$(CONFIG_MPEGVIDEO) += arm/mpegvideo_neon.o
|
||||
NEON-OBJS-$(CONFIG_RDFT) += arm/rdft_neon.o
|
||||
NEON-OBJS-$(CONFIG_VC1DSP) += arm/vc1dsp_init_neon.o \
|
||||
arm/vc1dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP3DSP) += arm/vp3dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP8DSP) += arm/vp8dsp_init_neon.o \
|
||||
arm/vp8dsp_neon.o
|
||||
|
||||
# decoders/encoders
|
||||
NEON-OBJS-$(CONFIG_AAC_DECODER) += arm/aacpsdsp_neon.o \
|
||||
arm/sbrdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_LLAUDDSP) += arm/lossless_audiodsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_DCA_DECODER) += arm/synth_filter_neon.o
|
||||
NEON-OBJS-$(CONFIG_HEVC_DECODER) += arm/hevcdsp_init_neon.o \
|
||||
arm/hevcdsp_deblock_neon.o \
|
||||
arm/hevcdsp_idct_neon.o \
|
||||
arm/hevcdsp_qpel_neon.o \
|
||||
arm/hevcdsp_sao_neon.o
|
||||
NEON-OBJS-$(CONFIG_RV30_DECODER) += arm/rv34dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_RV40_DECODER) += arm/rv34dsp_neon.o \
|
||||
arm/rv40dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_SBC_ENCODER) += arm/sbcdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VORBIS_DECODER) += arm/vorbisdsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP6_DECODER) += arm/vp6dsp_neon.o
|
||||
NEON-OBJS-$(CONFIG_VP9_DECODER) += arm/vp9itxfm_16bpp_neon.o \
|
||||
arm/vp9itxfm_neon.o \
|
||||
arm/vp9lpf_16bpp_neon.o \
|
||||
arm/vp9lpf_neon.o \
|
||||
arm/vp9mc_16bpp_neon.o \
|
||||
arm/vp9mc_neon.o
|
@ -0,0 +1,143 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_AAC_H
|
||||
#define AVCODEC_ARM_AAC_H
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#if HAVE_NEON_INLINE
|
||||
|
||||
#define VMUL2 VMUL2
|
||||
static inline float *VMUL2(float *dst, const float *v, unsigned idx,
|
||||
const float *scale)
|
||||
{
|
||||
unsigned v0, v1;
|
||||
__asm__ ("ubfx %0, %6, #0, #4 \n\t"
|
||||
"ubfx %1, %6, #4, #4 \n\t"
|
||||
"ldr %0, [%5, %0, lsl #2] \n\t"
|
||||
"ldr %1, [%5, %1, lsl #2] \n\t"
|
||||
"vld1.32 {d1[]}, [%7,:32] \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"vmul.f32 d0, d0, d1 \n\t"
|
||||
"vst1.32 {d0}, [%2,:64]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "+r"(dst), "=m"(dst[0]), "=m"(dst[1])
|
||||
: "r"(v), "r"(idx), "r"(scale)
|
||||
: "d0", "d1");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define VMUL4 VMUL4
|
||||
static inline float *VMUL4(float *dst, const float *v, unsigned idx,
|
||||
const float *scale)
|
||||
{
|
||||
unsigned v0, v1, v2, v3;
|
||||
__asm__ ("ubfx %0, %10, #0, #2 \n\t"
|
||||
"ubfx %1, %10, #2, #2 \n\t"
|
||||
"ldr %0, [%9, %0, lsl #2] \n\t"
|
||||
"ubfx %2, %10, #4, #2 \n\t"
|
||||
"ldr %1, [%9, %1, lsl #2] \n\t"
|
||||
"ubfx %3, %10, #6, #2 \n\t"
|
||||
"ldr %2, [%9, %2, lsl #2] \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"ldr %3, [%9, %3, lsl #2] \n\t"
|
||||
"vld1.32 {d2[],d3[]},[%11,:32] \n\t"
|
||||
"vmov d1, %2, %3 \n\t"
|
||||
"vmul.f32 q0, q0, q1 \n\t"
|
||||
"vst1.32 {q0}, [%4,:128]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
|
||||
"=m"(dst[0]), "=m"(dst[1]), "=m"(dst[2]), "=m"(dst[3])
|
||||
: "r"(v), "r"(idx), "r"(scale)
|
||||
: "d0", "d1", "d2", "d3");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define VMUL2S VMUL2S
|
||||
static inline float *VMUL2S(float *dst, const float *v, unsigned idx,
|
||||
unsigned sign, const float *scale)
|
||||
{
|
||||
unsigned v0, v1, v2, v3;
|
||||
__asm__ ("ubfx %0, %8, #0, #4 \n\t"
|
||||
"ubfx %1, %8, #4, #4 \n\t"
|
||||
"ldr %0, [%7, %0, lsl #2] \n\t"
|
||||
"lsl %2, %10, #30 \n\t"
|
||||
"ldr %1, [%7, %1, lsl #2] \n\t"
|
||||
"lsl %3, %10, #31 \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"bic %2, %2, #1<<30 \n\t"
|
||||
"vld1.32 {d1[]}, [%9,:32] \n\t"
|
||||
"vmov d2, %2, %3 \n\t"
|
||||
"veor d0, d0, d2 \n\t"
|
||||
"vmul.f32 d0, d0, d1 \n\t"
|
||||
"vst1.32 {d0}, [%4,:64]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
|
||||
"=m"(dst[0]), "=m"(dst[1])
|
||||
: "r"(v), "r"(idx), "r"(scale), "r"(sign)
|
||||
: "d0", "d1", "d2");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#define VMUL4S VMUL4S
|
||||
static inline float *VMUL4S(float *dst, const float *v, unsigned idx,
|
||||
unsigned sign, const float *scale)
|
||||
{
|
||||
unsigned v0, v1, v2, v3, nz;
|
||||
__asm__ ("vld1.32 {d2[],d3[]},[%13,:32] \n\t"
|
||||
"ubfx %0, %12, #0, #2 \n\t"
|
||||
"ubfx %1, %12, #2, #2 \n\t"
|
||||
"ldr %0, [%11,%0, lsl #2] \n\t"
|
||||
"ubfx %2, %12, #4, #2 \n\t"
|
||||
"ldr %1, [%11,%1, lsl #2] \n\t"
|
||||
"ubfx %3, %12, #6, #2 \n\t"
|
||||
"ldr %2, [%11,%2, lsl #2] \n\t"
|
||||
"vmov d0, %0, %1 \n\t"
|
||||
"ldr %3, [%11,%3, lsl #2] \n\t"
|
||||
"lsr %6, %12, #12 \n\t"
|
||||
"rbit %6, %6 \n\t"
|
||||
"vmov d1, %2, %3 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %0, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %1, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"lsls %6, %6, #1 \n\t"
|
||||
"and %2, %5, #1<<31 \n\t"
|
||||
"it cs \n\t"
|
||||
"lslcs %5, %5, #1 \n\t"
|
||||
"vmov d4, %0, %1 \n\t"
|
||||
"and %3, %5, #1<<31 \n\t"
|
||||
"vmov d5, %2, %3 \n\t"
|
||||
"veor q0, q0, q2 \n\t"
|
||||
"vmul.f32 q0, q0, q1 \n\t"
|
||||
"vst1.32 {q0}, [%4,:128]! \n\t"
|
||||
: "=&r"(v0), "=&r"(v1), "=&r"(v2), "=&r"(v3), "+r"(dst),
|
||||
"+r"(sign), "=r"(nz),
|
||||
"=m"(dst[0]), "=m"(dst[1]), "=m"(dst[2]), "=m"(dst[3])
|
||||
: "r"(v), "r"(idx), "r"(scale)
|
||||
: "cc", "d0", "d1", "d2", "d3", "d4", "d5");
|
||||
return dst;
|
||||
}
|
||||
|
||||
#endif /* HAVE_NEON_INLINE */
|
||||
|
||||
#endif /* AVCODEC_ARM_AAC_H */
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Mans Rullgard
|
||||
*
|
||||
* 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 "config.h"
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/aacpsdsp.h"
|
||||
|
||||
void ff_ps_add_squares_neon(float *dst, const float (*src)[2], int n);
|
||||
void ff_ps_mul_pair_single_neon(float (*dst)[2], float (*src0)[2],
|
||||
float *src1, int n);
|
||||
void ff_ps_hybrid_analysis_neon(float (*out)[2], float (*in)[2],
|
||||
const float (*filter)[8][2],
|
||||
ptrdiff_t stride, int n);
|
||||
void ff_ps_hybrid_analysis_ileave_neon(float (*out)[32][2], float L[2][38][64],
|
||||
int i, int len);
|
||||
void ff_ps_hybrid_synthesis_deint_neon(float out[2][38][64], float (*in)[32][2],
|
||||
int i, int len);
|
||||
void ff_ps_decorrelate_neon(float (*out)[2], float (*delay)[2],
|
||||
float (*ap_delay)[PS_QMF_TIME_SLOTS+PS_MAX_AP_DELAY][2],
|
||||
const float phi_fract[2], float (*Q_fract)[2],
|
||||
const float *transient_gain, float g_decay_slope,
|
||||
int len);
|
||||
void ff_ps_stereo_interpolate_neon(float (*l)[2], float (*r)[2],
|
||||
float h[2][4], float h_step[2][4],
|
||||
int len);
|
||||
|
||||
av_cold void ff_psdsp_init_arm(PSDSPContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->add_squares = ff_ps_add_squares_neon;
|
||||
s->mul_pair_single = ff_ps_mul_pair_single_neon;
|
||||
s->hybrid_synthesis_deint = ff_ps_hybrid_synthesis_deint_neon;
|
||||
s->hybrid_analysis = ff_ps_hybrid_analysis_neon;
|
||||
s->stereo_interpolate[0] = ff_ps_stereo_interpolate_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2011 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/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/ac3dsp.h"
|
||||
#include "config.h"
|
||||
|
||||
void ff_ac3_exponent_min_neon(uint8_t *exp, int num_reuse_blocks, int nb_coefs);
|
||||
int ff_ac3_max_msb_abs_int16_neon(const int16_t *src, int len);
|
||||
void ff_ac3_lshift_int16_neon(int16_t *src, unsigned len, unsigned shift);
|
||||
void ff_ac3_rshift_int32_neon(int32_t *src, unsigned len, unsigned shift);
|
||||
void ff_float_to_fixed24_neon(int32_t *dst, const float *src, unsigned int len);
|
||||
void ff_ac3_extract_exponents_neon(uint8_t *exp, int32_t *coef, int nb_coefs);
|
||||
void ff_apply_window_int16_neon(int16_t *dst, const int16_t *src,
|
||||
const int16_t *window, unsigned n);
|
||||
void ff_ac3_sum_square_butterfly_int32_neon(int64_t sum[4],
|
||||
const int32_t *coef0,
|
||||
const int32_t *coef1,
|
||||
int len);
|
||||
void ff_ac3_sum_square_butterfly_float_neon(float sum[4],
|
||||
const float *coef0,
|
||||
const float *coef1,
|
||||
int len);
|
||||
|
||||
void ff_ac3_bit_alloc_calc_bap_armv6(int16_t *mask, int16_t *psd,
|
||||
int start, int end,
|
||||
int snr_offset, int floor,
|
||||
const uint8_t *bap_tab, uint8_t *bap);
|
||||
|
||||
void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len);
|
||||
|
||||
av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
c->update_bap_counts = ff_ac3_update_bap_counts_arm;
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
c->bit_alloc_calc_bap = ff_ac3_bit_alloc_calc_bap_armv6;
|
||||
}
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->ac3_exponent_min = ff_ac3_exponent_min_neon;
|
||||
c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
|
||||
c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon;
|
||||
c->ac3_rshift_int32 = ff_ac3_rshift_int32_neon;
|
||||
c->float_to_fixed24 = ff_float_to_fixed24_neon;
|
||||
c->extract_exponents = ff_ac3_extract_exponents_neon;
|
||||
c->apply_window_int16 = ff_apply_window_int16_neon;
|
||||
c->sum_square_butterfly_int32 = ff_ac3_sum_square_butterfly_int32_neon;
|
||||
c->sum_square_butterfly_float = ff_ac3_sum_square_butterfly_float_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Mans Rullgard
|
||||
*
|
||||
* 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 AVCODEC_ARM_ASM_OFFSETS_H
|
||||
#define AVCODEC_ARM_ASM_OFFSETS_H
|
||||
|
||||
/* MpegEncContext */
|
||||
#define Y_DC_SCALE 0x04
|
||||
#define C_DC_SCALE 0x08
|
||||
#define AC_PRED 0x0c
|
||||
#define BLOCK_LAST_INDEX 0x10
|
||||
#define H263_AIC 0x40
|
||||
#define INTER_SCANTAB_RASTER_END 0x88
|
||||
|
||||
#endif /* AVCODEC_ARM_ASM_OFFSETS_H */
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_AUDIODSP_ARM_H
|
||||
#define AVCODEC_ARM_AUDIODSP_ARM_H
|
||||
|
||||
#include "libavcodec/audiodsp.h"
|
||||
|
||||
void ff_audiodsp_init_neon(AudioDSPContext *c);
|
||||
|
||||
#endif /* AVCODEC_ARM_AUDIODSP_ARM_H */
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* ARM optimized audio functions
|
||||
*
|
||||
* 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/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/audiodsp.h"
|
||||
#include "audiodsp_arm.h"
|
||||
|
||||
av_cold void ff_audiodsp_init_arm(AudioDSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
ff_audiodsp_init_neon(c);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* ARM NEON optimised audio 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 "libavcodec/audiodsp.h"
|
||||
#include "audiodsp_arm.h"
|
||||
|
||||
void ff_vector_clipf_neon(float *dst, const float *src, int len, float min, float max);
|
||||
void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
|
||||
int32_t max, unsigned int len);
|
||||
|
||||
int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len);
|
||||
|
||||
av_cold void ff_audiodsp_init_neon(AudioDSPContext *c)
|
||||
{
|
||||
c->vector_clip_int32 = ff_vector_clip_int32_neon;
|
||||
c->vector_clipf = ff_vector_clipf_neon;
|
||||
|
||||
c->scalarproduct_int16 = ff_scalarproduct_int16_neon;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_BLOCKDSP_ARM_H
|
||||
#define AVCODEC_ARM_BLOCKDSP_ARM_H
|
||||
|
||||
#include "libavcodec/blockdsp.h"
|
||||
|
||||
void ff_blockdsp_init_neon(BlockDSPContext *c);
|
||||
|
||||
#endif /* AVCODEC_ARM_BLOCKDSP_ARM_H */
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* ARM optimized block operations
|
||||
*
|
||||
* 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/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/blockdsp.h"
|
||||
#include "blockdsp_arm.h"
|
||||
|
||||
av_cold void ff_blockdsp_init_arm(BlockDSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
ff_blockdsp_init_neon(c);
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* ARM NEON optimised block operations
|
||||
* 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 "libavcodec/blockdsp.h"
|
||||
#include "blockdsp_arm.h"
|
||||
|
||||
void ff_clear_block_neon(int16_t *block);
|
||||
void ff_clear_blocks_neon(int16_t *blocks);
|
||||
|
||||
av_cold void ff_blockdsp_init_neon(BlockDSPContext *c)
|
||||
{
|
||||
c->clear_block = ff_clear_block_neon;
|
||||
c->clear_blocks = ff_clear_blocks_neon;
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_CABAC_H
|
||||
#define AVCODEC_ARM_CABAC_H
|
||||
|
||||
#include "config.h"
|
||||
#if HAVE_ARMV6T2_INLINE
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavcodec/cabac.h"
|
||||
|
||||
#define get_cabac_inline get_cabac_inline_arm
|
||||
static av_always_inline int get_cabac_inline_arm(CABACContext *c,
|
||||
uint8_t *const state)
|
||||
{
|
||||
int bit;
|
||||
void *reg_b, *reg_c, *tmp;
|
||||
|
||||
__asm__ volatile(
|
||||
"ldrb %[bit] , [%[state]] \n\t"
|
||||
"add %[r_b] , %[tables] , %[lps_off] \n\t"
|
||||
"mov %[tmp] , %[range] \n\t"
|
||||
"and %[range] , %[range] , #0xC0 \n\t"
|
||||
"add %[r_b] , %[r_b] , %[bit] \n\t"
|
||||
"ldrb %[range] , [%[r_b], %[range], lsl #1] \n\t"
|
||||
"add %[r_b] , %[tables] , %[norm_off] \n\t"
|
||||
"sub %[r_c] , %[tmp] , %[range] \n\t"
|
||||
"lsl %[tmp] , %[r_c] , #17 \n\t"
|
||||
"cmp %[tmp] , %[low] \n\t"
|
||||
"it gt \n\t"
|
||||
"movgt %[range] , %[r_c] \n\t"
|
||||
"itt cc \n\t"
|
||||
"mvncc %[bit] , %[bit] \n\t"
|
||||
"subcc %[low] , %[low] , %[tmp] \n\t"
|
||||
"add %[r_c] , %[tables] , %[mlps_off] \n\t"
|
||||
"ldrb %[tmp] , [%[r_b], %[range]] \n\t"
|
||||
"ldrb %[r_b] , [%[r_c], %[bit]] \n\t"
|
||||
"lsl %[low] , %[low] , %[tmp] \n\t"
|
||||
"lsl %[range] , %[range] , %[tmp] \n\t"
|
||||
"uxth %[r_c] , %[low] \n\t"
|
||||
"strb %[r_b] , [%[state]] \n\t"
|
||||
"tst %[r_c] , %[r_c] \n\t"
|
||||
"bne 2f \n\t"
|
||||
"ldr %[r_c] , [%[c], %[byte]] \n\t"
|
||||
#if UNCHECKED_BITSTREAM_READER
|
||||
"ldrh %[tmp] , [%[r_c]] \n\t"
|
||||
"add %[r_c] , %[r_c] , #2 \n\t"
|
||||
"str %[r_c] , [%[c], %[byte]] \n\t"
|
||||
#else
|
||||
"ldr %[r_b] , [%[c], %[end]] \n\t"
|
||||
"ldrh %[tmp] , [%[r_c]] \n\t"
|
||||
"cmp %[r_c] , %[r_b] \n\t"
|
||||
"itt lt \n\t"
|
||||
"addlt %[r_c] , %[r_c] , #2 \n\t"
|
||||
"strlt %[r_c] , [%[c], %[byte]] \n\t"
|
||||
#endif
|
||||
"sub %[r_c] , %[low] , #1 \n\t"
|
||||
"add %[r_b] , %[tables] , %[norm_off] \n\t"
|
||||
"eor %[r_c] , %[low] , %[r_c] \n\t"
|
||||
"rev %[tmp] , %[tmp] \n\t"
|
||||
"lsr %[r_c] , %[r_c] , #15 \n\t"
|
||||
"lsr %[tmp] , %[tmp] , #15 \n\t"
|
||||
"ldrb %[r_c] , [%[r_b], %[r_c]] \n\t"
|
||||
"movw %[r_b] , #0xFFFF \n\t"
|
||||
"sub %[tmp] , %[tmp] , %[r_b] \n\t"
|
||||
"rsb %[r_c] , %[r_c] , #7 \n\t"
|
||||
"lsl %[tmp] , %[tmp] , %[r_c] \n\t"
|
||||
"add %[low] , %[low] , %[tmp] \n\t"
|
||||
"2: \n\t"
|
||||
: [bit]"=&r"(bit),
|
||||
[low]"+&r"(c->low),
|
||||
[range]"+&r"(c->range),
|
||||
[r_b]"=&r"(reg_b),
|
||||
[r_c]"=&r"(reg_c),
|
||||
[tmp]"=&r"(tmp)
|
||||
: [c]"r"(c),
|
||||
[state]"r"(state),
|
||||
[tables]"r"(ff_h264_cabac_tables),
|
||||
[byte]"M"(offsetof(CABACContext, bytestream)),
|
||||
[end]"M"(offsetof(CABACContext, bytestream_end)),
|
||||
[norm_off]"I"(H264_NORM_SHIFT_OFFSET),
|
||||
[lps_off]"I"(H264_LPS_RANGE_OFFSET),
|
||||
[mlps_off]"I"(H264_MLPS_STATE_OFFSET + 128)
|
||||
: "memory", "cc"
|
||||
);
|
||||
|
||||
return bit & 1;
|
||||
}
|
||||
#endif /* HAVE_ARMV6T2_INLINE */
|
||||
|
||||
#endif /* AVCODEC_ARM_CABAC_H */
|
@ -0,0 +1,81 @@
|
||||
/*
|
||||
* Copyright (c) 2011 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 AVCODEC_ARM_DCA_H
|
||||
#define AVCODEC_ARM_DCA_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "libavcodec/mathops.h"
|
||||
|
||||
#if HAVE_ARMV6_INLINE && AV_GCC_VERSION_AT_LEAST(4,4) && !CONFIG_THUMB
|
||||
|
||||
#define decode_blockcodes decode_blockcodes
|
||||
static inline int decode_blockcodes(int code1, int code2, int levels,
|
||||
int32_t *values)
|
||||
{
|
||||
int32_t v0, v1, v2, v3, v4, v5;
|
||||
|
||||
__asm__ ("smmul %0, %6, %10 \n"
|
||||
"smmul %3, %7, %10 \n"
|
||||
"smlabb %6, %0, %9, %6 \n"
|
||||
"smlabb %7, %3, %9, %7 \n"
|
||||
"smmul %1, %0, %10 \n"
|
||||
"smmul %4, %3, %10 \n"
|
||||
"sub %6, %6, %8, lsr #1 \n"
|
||||
"sub %7, %7, %8, lsr #1 \n"
|
||||
"smlabb %0, %1, %9, %0 \n"
|
||||
"smlabb %3, %4, %9, %3 \n"
|
||||
"smmul %2, %1, %10 \n"
|
||||
"smmul %5, %4, %10 \n"
|
||||
"str %6, [%11, #0] \n"
|
||||
"str %7, [%11, #16] \n"
|
||||
"sub %0, %0, %8, lsr #1 \n"
|
||||
"sub %3, %3, %8, lsr #1 \n"
|
||||
"smlabb %1, %2, %9, %1 \n"
|
||||
"smlabb %4, %5, %9, %4 \n"
|
||||
"smmul %6, %2, %10 \n"
|
||||
"smmul %7, %5, %10 \n"
|
||||
"str %0, [%11, #4] \n"
|
||||
"str %3, [%11, #20] \n"
|
||||
"sub %1, %1, %8, lsr #1 \n"
|
||||
"sub %4, %4, %8, lsr #1 \n"
|
||||
"smlabb %2, %6, %9, %2 \n"
|
||||
"smlabb %5, %7, %9, %5 \n"
|
||||
"str %1, [%11, #8] \n"
|
||||
"str %4, [%11, #24] \n"
|
||||
"sub %2, %2, %8, lsr #1 \n"
|
||||
"sub %5, %5, %8, lsr #1 \n"
|
||||
"str %2, [%11, #12] \n"
|
||||
"str %5, [%11, #28] \n"
|
||||
: "=&r"(v0), "=&r"(v1), "=&r"(v2),
|
||||
"=&r"(v3), "=&r"(v4), "=&r"(v5),
|
||||
"+&r"(code1), "+&r"(code2)
|
||||
: "r"(levels - 1), "r"(-levels),
|
||||
"r"(ff_inverse[levels]), "r"(values)
|
||||
: "memory");
|
||||
|
||||
return code1 | code2;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_ARM_DCA_H */
|
@ -0,0 +1,50 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#define FFT_FLOAT 0
|
||||
#include "libavcodec/fft.h"
|
||||
|
||||
void ff_fft_fixed_calc_neon(FFTContext *s, FFTComplex *z);
|
||||
void ff_mdct_fixed_calc_neon(FFTContext *s, FFTSample *o, const FFTSample *i);
|
||||
void ff_mdct_fixed_calcw_neon(FFTContext *s, FFTDouble *o, const FFTSample *i);
|
||||
|
||||
av_cold void ff_fft_fixed_init_arm(FFTContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
|
||||
#if CONFIG_FFT
|
||||
s->fft_calc = ff_fft_fixed_calc_neon;
|
||||
#endif
|
||||
|
||||
#if CONFIG_MDCT
|
||||
if (!s->inverse && s->nbits >= 3) {
|
||||
s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
|
||||
s->mdct_calc = ff_mdct_fixed_calc_neon;
|
||||
s->mdct_calcw = ff_mdct_fixed_calcw_neon;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#include "libavcodec/fft.h"
|
||||
|
||||
void ff_fft_calc_vfp(FFTContext *s, FFTComplex *z);
|
||||
|
||||
void ff_fft_permute_neon(FFTContext *s, FFTComplex *z);
|
||||
void ff_fft_calc_neon(FFTContext *s, FFTComplex *z);
|
||||
|
||||
void ff_imdct_half_vfp(FFTContext *s, FFTSample *output, const FFTSample *input);
|
||||
|
||||
void ff_imdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
|
||||
void ff_imdct_half_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
|
||||
void ff_mdct_calc_neon(FFTContext *s, FFTSample *output, const FFTSample *input);
|
||||
|
||||
av_cold void ff_fft_init_arm(FFTContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_vfp_vm(cpu_flags)) {
|
||||
s->fft_calc = ff_fft_calc_vfp;
|
||||
#if CONFIG_MDCT
|
||||
s->imdct_half = ff_imdct_half_vfp;
|
||||
#endif
|
||||
}
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
#if CONFIG_FFT
|
||||
s->fft_permute = ff_fft_permute_neon;
|
||||
s->fft_calc = ff_fft_calc_neon;
|
||||
#endif
|
||||
#if CONFIG_MDCT
|
||||
s->imdct_calc = ff_imdct_calc_neon;
|
||||
s->imdct_half = ff_imdct_half_neon;
|
||||
s->mdct_calc = ff_mdct_calc_neon;
|
||||
s->mdct_permutation = FF_MDCT_PERM_INTERLEAVE;
|
||||
#endif
|
||||
}
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2012 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 "libavcodec/flacdsp.h"
|
||||
#include "config.h"
|
||||
|
||||
void ff_flac_lpc_16_arm(int32_t *samples, const int coeffs[32], int order,
|
||||
int qlevel, int len);
|
||||
|
||||
av_cold void ff_flacdsp_init_arm(FLACDSPContext *c, enum AVSampleFormat fmt, int channels,
|
||||
int bps)
|
||||
{
|
||||
if (CONFIG_FLAC_DECODER)
|
||||
c->lpc16 = ff_flac_lpc_16_arm;
|
||||
}
|
@ -0,0 +1,53 @@
|
||||
/*
|
||||
* ARM optimized Format Conversion Utils
|
||||
*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
void ff_int32_to_float_fmul_array8_neon(FmtConvertContext *c, float *dst,
|
||||
const int32_t *src, const float *mul,
|
||||
int len);
|
||||
void ff_int32_to_float_fmul_scalar_neon(float *dst, const int32_t *src,
|
||||
float mul, int len);
|
||||
|
||||
void ff_int32_to_float_fmul_scalar_vfp(float *dst, const int32_t *src,
|
||||
float mul, int len);
|
||||
void ff_int32_to_float_fmul_array8_vfp(FmtConvertContext *c, float *dst,
|
||||
const int32_t *src, const float *mul,
|
||||
int len);
|
||||
|
||||
av_cold void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_vfp_vm(cpu_flags)) {
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_vfp;
|
||||
c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_vfp;
|
||||
}
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->int32_to_float_fmul_array8 = ff_int32_to_float_fmul_array8_neon;
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* Copyright (c) 2015 Peter Meerwald <pmeerw@pmeerw.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 <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/g722dsp.h"
|
||||
|
||||
extern void ff_g722_apply_qmf_neon(const int16_t *prev_samples, int xout[2]);
|
||||
|
||||
av_cold void ff_g722dsp_init_arm(G722DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
dsp->apply_qmf = ff_g722_apply_qmf_neon;
|
||||
}
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* ARM NEON optimised H.264 chroma 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/arm/cpu.h"
|
||||
#include "libavcodec/h264chroma.h"
|
||||
|
||||
void ff_put_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
void ff_put_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
void ff_put_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
|
||||
void ff_avg_h264_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
void ff_avg_h264_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
void ff_avg_h264_chroma_mc2_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
|
||||
av_cold void ff_h264chroma_init_arm(H264ChromaContext *c, int bit_depth)
|
||||
{
|
||||
const int high_bit_depth = bit_depth > 8;
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags) && !high_bit_depth) {
|
||||
c->put_h264_chroma_pixels_tab[0] = ff_put_h264_chroma_mc8_neon;
|
||||
c->put_h264_chroma_pixels_tab[1] = ff_put_h264_chroma_mc4_neon;
|
||||
c->put_h264_chroma_pixels_tab[2] = ff_put_h264_chroma_mc2_neon;
|
||||
|
||||
c->avg_h264_chroma_pixels_tab[0] = ff_avg_h264_chroma_mc8_neon;
|
||||
c->avg_h264_chroma_pixels_tab[1] = ff_avg_h264_chroma_mc4_neon;
|
||||
c->avg_h264_chroma_pixels_tab[2] = ff_avg_h264_chroma_mc2_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/h264dsp.h"
|
||||
#include "libavcodec/arm/startcode.h"
|
||||
|
||||
void ff_h264_v_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
|
||||
int beta, int8_t *tc0);
|
||||
void ff_h264_h_loop_filter_luma_neon(uint8_t *pix, int stride, int alpha,
|
||||
int beta, int8_t *tc0);
|
||||
void ff_h264_v_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
|
||||
int beta, int8_t *tc0);
|
||||
void ff_h264_h_loop_filter_chroma_neon(uint8_t *pix, int stride, int alpha,
|
||||
int beta, int8_t *tc0);
|
||||
|
||||
void ff_weight_h264_pixels_16_neon(uint8_t *dst, int stride, int height,
|
||||
int log2_den, int weight, int offset);
|
||||
void ff_weight_h264_pixels_8_neon(uint8_t *dst, int stride, int height,
|
||||
int log2_den, int weight, int offset);
|
||||
void ff_weight_h264_pixels_4_neon(uint8_t *dst, int stride, int height,
|
||||
int log2_den, int weight, int offset);
|
||||
|
||||
void ff_biweight_h264_pixels_16_neon(uint8_t *dst, uint8_t *src, int stride,
|
||||
int height, int log2_den, int weightd,
|
||||
int weights, int offset);
|
||||
void ff_biweight_h264_pixels_8_neon(uint8_t *dst, uint8_t *src, int stride,
|
||||
int height, int log2_den, int weightd,
|
||||
int weights, int offset);
|
||||
void ff_biweight_h264_pixels_4_neon(uint8_t *dst, uint8_t *src, int stride,
|
||||
int height, int log2_den, int weightd,
|
||||
int weights, int offset);
|
||||
|
||||
void ff_h264_idct_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||
void ff_h264_idct_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||
void ff_h264_idct_add16_neon(uint8_t *dst, const int *block_offset,
|
||||
int16_t *block, int stride,
|
||||
const uint8_t nnzc[6*8]);
|
||||
void ff_h264_idct_add16intra_neon(uint8_t *dst, const int *block_offset,
|
||||
int16_t *block, int stride,
|
||||
const uint8_t nnzc[6*8]);
|
||||
void ff_h264_idct_add8_neon(uint8_t **dest, const int *block_offset,
|
||||
int16_t *block, int stride,
|
||||
const uint8_t nnzc[6*8]);
|
||||
|
||||
void ff_h264_idct8_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||
void ff_h264_idct8_dc_add_neon(uint8_t *dst, int16_t *block, int stride);
|
||||
void ff_h264_idct8_add4_neon(uint8_t *dst, const int *block_offset,
|
||||
int16_t *block, int stride,
|
||||
const uint8_t nnzc[6*8]);
|
||||
|
||||
static av_cold void h264dsp_init_neon(H264DSPContext *c, const int bit_depth,
|
||||
const int chroma_format_idc)
|
||||
{
|
||||
#if HAVE_NEON
|
||||
if (bit_depth == 8) {
|
||||
c->h264_v_loop_filter_luma = ff_h264_v_loop_filter_luma_neon;
|
||||
c->h264_h_loop_filter_luma = ff_h264_h_loop_filter_luma_neon;
|
||||
c->h264_v_loop_filter_chroma = ff_h264_v_loop_filter_chroma_neon;
|
||||
if(chroma_format_idc == 1){
|
||||
c->h264_h_loop_filter_chroma = ff_h264_h_loop_filter_chroma_neon;
|
||||
}
|
||||
|
||||
c->weight_h264_pixels_tab[0] = ff_weight_h264_pixels_16_neon;
|
||||
c->weight_h264_pixels_tab[1] = ff_weight_h264_pixels_8_neon;
|
||||
c->weight_h264_pixels_tab[2] = ff_weight_h264_pixels_4_neon;
|
||||
|
||||
c->biweight_h264_pixels_tab[0] = ff_biweight_h264_pixels_16_neon;
|
||||
c->biweight_h264_pixels_tab[1] = ff_biweight_h264_pixels_8_neon;
|
||||
c->biweight_h264_pixels_tab[2] = ff_biweight_h264_pixels_4_neon;
|
||||
|
||||
c->h264_idct_add = ff_h264_idct_add_neon;
|
||||
c->h264_idct_dc_add = ff_h264_idct_dc_add_neon;
|
||||
c->h264_idct_add16 = ff_h264_idct_add16_neon;
|
||||
c->h264_idct_add16intra = ff_h264_idct_add16intra_neon;
|
||||
if (chroma_format_idc <= 1)
|
||||
c->h264_idct_add8 = ff_h264_idct_add8_neon;
|
||||
c->h264_idct8_add = ff_h264_idct8_add_neon;
|
||||
c->h264_idct8_dc_add = ff_h264_idct8_dc_add_neon;
|
||||
c->h264_idct8_add4 = ff_h264_idct8_add4_neon;
|
||||
}
|
||||
#endif // HAVE_NEON
|
||||
}
|
||||
|
||||
av_cold void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth,
|
||||
const int chroma_format_idc)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
#if HAVE_ARMV6
|
||||
if (have_setend(cpu_flags))
|
||||
c->startcode_find_candidate = ff_startcode_find_candidate_armv6;
|
||||
#endif
|
||||
if (have_neon(cpu_flags))
|
||||
h264dsp_init_neon(c, bit_depth, chroma_format_idc);
|
||||
}
|
@ -0,0 +1,95 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/h264pred.h"
|
||||
|
||||
void ff_pred16x16_vert_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred16x16_hor_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred16x16_plane_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred16x16_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred16x16_128_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred16x16_left_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred16x16_top_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_pred8x8_vert_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_hor_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_plane_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_128_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_left_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_top_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_l0t_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_0lt_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_l00_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
void ff_pred8x8_0l0_dc_neon(uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
static av_cold void h264_pred_init_neon(H264PredContext *h, int codec_id,
|
||||
const int bit_depth,
|
||||
const int chroma_format_idc)
|
||||
{
|
||||
#if HAVE_NEON
|
||||
const int high_depth = bit_depth > 8;
|
||||
|
||||
if (high_depth)
|
||||
return;
|
||||
|
||||
if (chroma_format_idc <= 1) {
|
||||
h->pred8x8[VERT_PRED8x8 ] = ff_pred8x8_vert_neon;
|
||||
h->pred8x8[HOR_PRED8x8 ] = ff_pred8x8_hor_neon;
|
||||
if (codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
|
||||
h->pred8x8[PLANE_PRED8x8] = ff_pred8x8_plane_neon;
|
||||
h->pred8x8[DC_128_PRED8x8 ] = ff_pred8x8_128_dc_neon;
|
||||
if (codec_id != AV_CODEC_ID_RV40 && codec_id != AV_CODEC_ID_VP7 &&
|
||||
codec_id != AV_CODEC_ID_VP8) {
|
||||
h->pred8x8[DC_PRED8x8 ] = ff_pred8x8_dc_neon;
|
||||
h->pred8x8[LEFT_DC_PRED8x8] = ff_pred8x8_left_dc_neon;
|
||||
h->pred8x8[TOP_DC_PRED8x8 ] = ff_pred8x8_top_dc_neon;
|
||||
h->pred8x8[ALZHEIMER_DC_L0T_PRED8x8] = ff_pred8x8_l0t_dc_neon;
|
||||
h->pred8x8[ALZHEIMER_DC_0LT_PRED8x8] = ff_pred8x8_0lt_dc_neon;
|
||||
h->pred8x8[ALZHEIMER_DC_L00_PRED8x8] = ff_pred8x8_l00_dc_neon;
|
||||
h->pred8x8[ALZHEIMER_DC_0L0_PRED8x8] = ff_pred8x8_0l0_dc_neon;
|
||||
}
|
||||
}
|
||||
|
||||
h->pred16x16[DC_PRED8x8 ] = ff_pred16x16_dc_neon;
|
||||
h->pred16x16[VERT_PRED8x8 ] = ff_pred16x16_vert_neon;
|
||||
h->pred16x16[HOR_PRED8x8 ] = ff_pred16x16_hor_neon;
|
||||
h->pred16x16[LEFT_DC_PRED8x8] = ff_pred16x16_left_dc_neon;
|
||||
h->pred16x16[TOP_DC_PRED8x8 ] = ff_pred16x16_top_dc_neon;
|
||||
h->pred16x16[DC_128_PRED8x8 ] = ff_pred16x16_128_dc_neon;
|
||||
if (codec_id != AV_CODEC_ID_SVQ3 && codec_id != AV_CODEC_ID_RV40 &&
|
||||
codec_id != AV_CODEC_ID_VP7 && codec_id != AV_CODEC_ID_VP8)
|
||||
h->pred16x16[PLANE_PRED8x8 ] = ff_pred16x16_plane_neon;
|
||||
#endif // HAVE_NEON
|
||||
}
|
||||
|
||||
av_cold void ff_h264_pred_init_arm(H264PredContext *h, int codec_id,
|
||||
int bit_depth, const int chroma_format_idc)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
h264_pred_init_neon(h, codec_id, bit_depth, chroma_format_idc);
|
||||
}
|
@ -0,0 +1,171 @@
|
||||
/*
|
||||
* ARM NEON optimised 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 "config.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/h264qpel.h"
|
||||
|
||||
void ff_put_h264_qpel16_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel16_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_put_h264_qpel8_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_put_h264_qpel8_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_avg_h264_qpel16_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel16_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
void ff_avg_h264_qpel8_mc00_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc10_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc20_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc30_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc01_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc11_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc21_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc31_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc02_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc12_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc22_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc32_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc03_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc13_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc23_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
void ff_avg_h264_qpel8_mc33_neon(uint8_t *dst, const uint8_t *src, ptrdiff_t stride);
|
||||
|
||||
av_cold void ff_h264qpel_init_arm(H264QpelContext *c, int bit_depth)
|
||||
{
|
||||
const int high_bit_depth = bit_depth > 8;
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags) && !high_bit_depth) {
|
||||
c->put_h264_qpel_pixels_tab[0][ 0] = ff_put_h264_qpel16_mc00_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 1] = ff_put_h264_qpel16_mc10_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 2] = ff_put_h264_qpel16_mc20_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 3] = ff_put_h264_qpel16_mc30_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 4] = ff_put_h264_qpel16_mc01_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 5] = ff_put_h264_qpel16_mc11_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 6] = ff_put_h264_qpel16_mc21_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 7] = ff_put_h264_qpel16_mc31_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 8] = ff_put_h264_qpel16_mc02_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][ 9] = ff_put_h264_qpel16_mc12_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][10] = ff_put_h264_qpel16_mc22_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][11] = ff_put_h264_qpel16_mc32_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][12] = ff_put_h264_qpel16_mc03_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][13] = ff_put_h264_qpel16_mc13_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][14] = ff_put_h264_qpel16_mc23_neon;
|
||||
c->put_h264_qpel_pixels_tab[0][15] = ff_put_h264_qpel16_mc33_neon;
|
||||
|
||||
c->put_h264_qpel_pixels_tab[1][ 0] = ff_put_h264_qpel8_mc00_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 1] = ff_put_h264_qpel8_mc10_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 2] = ff_put_h264_qpel8_mc20_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 3] = ff_put_h264_qpel8_mc30_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 4] = ff_put_h264_qpel8_mc01_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 5] = ff_put_h264_qpel8_mc11_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 6] = ff_put_h264_qpel8_mc21_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 7] = ff_put_h264_qpel8_mc31_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 8] = ff_put_h264_qpel8_mc02_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][ 9] = ff_put_h264_qpel8_mc12_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][10] = ff_put_h264_qpel8_mc22_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][11] = ff_put_h264_qpel8_mc32_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][12] = ff_put_h264_qpel8_mc03_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][13] = ff_put_h264_qpel8_mc13_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][14] = ff_put_h264_qpel8_mc23_neon;
|
||||
c->put_h264_qpel_pixels_tab[1][15] = ff_put_h264_qpel8_mc33_neon;
|
||||
|
||||
c->avg_h264_qpel_pixels_tab[0][ 0] = ff_avg_h264_qpel16_mc00_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 1] = ff_avg_h264_qpel16_mc10_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 2] = ff_avg_h264_qpel16_mc20_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 3] = ff_avg_h264_qpel16_mc30_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 4] = ff_avg_h264_qpel16_mc01_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 5] = ff_avg_h264_qpel16_mc11_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 6] = ff_avg_h264_qpel16_mc21_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 7] = ff_avg_h264_qpel16_mc31_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 8] = ff_avg_h264_qpel16_mc02_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][ 9] = ff_avg_h264_qpel16_mc12_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][10] = ff_avg_h264_qpel16_mc22_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][11] = ff_avg_h264_qpel16_mc32_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][12] = ff_avg_h264_qpel16_mc03_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][13] = ff_avg_h264_qpel16_mc13_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][14] = ff_avg_h264_qpel16_mc23_neon;
|
||||
c->avg_h264_qpel_pixels_tab[0][15] = ff_avg_h264_qpel16_mc33_neon;
|
||||
|
||||
c->avg_h264_qpel_pixels_tab[1][ 0] = ff_avg_h264_qpel8_mc00_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 1] = ff_avg_h264_qpel8_mc10_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 2] = ff_avg_h264_qpel8_mc20_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 3] = ff_avg_h264_qpel8_mc30_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 4] = ff_avg_h264_qpel8_mc01_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 5] = ff_avg_h264_qpel8_mc11_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 6] = ff_avg_h264_qpel8_mc21_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 7] = ff_avg_h264_qpel8_mc31_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 8] = ff_avg_h264_qpel8_mc02_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][ 9] = ff_avg_h264_qpel8_mc12_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][10] = ff_avg_h264_qpel8_mc22_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][11] = ff_avg_h264_qpel8_mc32_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][12] = ff_avg_h264_qpel8_mc03_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][13] = ff_avg_h264_qpel8_mc13_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][14] = ff_avg_h264_qpel8_mc23_neon;
|
||||
c->avg_h264_qpel_pixels_tab[1][15] = ff_avg_h264_qpel8_mc33_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_HEVCDSP_ARM_H
|
||||
#define AVCODEC_ARM_HEVCDSP_ARM_H
|
||||
|
||||
#include "libavcodec/hevcdsp.h"
|
||||
|
||||
void ff_hevc_dsp_init_neon(HEVCDSPContext *c, const int bit_depth);
|
||||
|
||||
#endif /* AVCODEC_ARM_HEVCDSP_ARM_H */
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Seppo Tomperi <seppo.tomperi@vtt.fi>
|
||||
*
|
||||
* 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/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#include "libavcodec/hevcdsp.h"
|
||||
#include "hevcdsp_arm.h"
|
||||
|
||||
av_cold void ff_hevc_dsp_init_arm(HEVCDSPContext *c, const int bit_depth)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
ff_hevc_dsp_init_neon(c, bit_depth);
|
||||
}
|
@ -0,0 +1,320 @@
|
||||
/*
|
||||
* Copyright (c) 2014 Seppo Tomperi <seppo.tomperi@vtt.fi>
|
||||
*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/hevcdsp.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "hevcdsp_arm.h"
|
||||
|
||||
void ff_hevc_sao_band_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src,
|
||||
ptrdiff_t stride_dst, ptrdiff_t stride_src,
|
||||
int16_t *sao_offset_val, int sao_left_class,
|
||||
int width, int height);
|
||||
void ff_hevc_sao_edge_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val,
|
||||
int eo, int width, int height);
|
||||
|
||||
void ff_hevc_v_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
|
||||
void ff_hevc_h_loop_filter_luma_neon(uint8_t *_pix, ptrdiff_t _stride, int _beta, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
|
||||
void ff_hevc_v_loop_filter_chroma_neon(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
|
||||
void ff_hevc_h_loop_filter_chroma_neon(uint8_t *_pix, ptrdiff_t _stride, int *_tc, uint8_t *_no_p, uint8_t *_no_q);
|
||||
void ff_hevc_add_residual_4x4_8_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_4x4_10_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_8x8_8_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_8x8_10_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_16x16_8_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_16x16_10_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_32x32_8_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_add_residual_32x32_10_neon(uint8_t *_dst, int16_t *coeffs,
|
||||
ptrdiff_t stride);
|
||||
void ff_hevc_idct_4x4_dc_8_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_8x8_dc_8_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_16x16_dc_8_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_32x32_dc_8_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_4x4_dc_10_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_8x8_dc_10_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_16x16_dc_10_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_32x32_dc_10_neon(int16_t *coeffs);
|
||||
void ff_hevc_idct_4x4_8_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_idct_8x8_8_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_idct_16x16_8_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_idct_32x32_8_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_idct_4x4_10_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_idct_8x8_10_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_idct_16x16_10_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_idct_32x32_10_neon(int16_t *coeffs, int col_limit);
|
||||
void ff_hevc_transform_luma_4x4_neon_8(int16_t *coeffs);
|
||||
|
||||
#define PUT_PIXELS(name) \
|
||||
void name(int16_t *dst, uint8_t *src, \
|
||||
ptrdiff_t srcstride, int height, \
|
||||
intptr_t mx, intptr_t my, int width)
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w2_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w4_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w6_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w8_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w12_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w16_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w24_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w32_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w48_neon_8);
|
||||
PUT_PIXELS(ff_hevc_put_pixels_w64_neon_8);
|
||||
#undef PUT_PIXELS
|
||||
|
||||
static void (*put_hevc_qpel_neon[4][4])(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, int width);
|
||||
static void (*put_hevc_qpel_uw_neon[4][4])(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride,
|
||||
int width, int height, int16_t* src2, ptrdiff_t src2stride);
|
||||
void ff_hevc_put_qpel_neon_wrapper(int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
void ff_hevc_put_qpel_uni_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
#define QPEL_FUNC(name) \
|
||||
void name(int16_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride, \
|
||||
int height, int width)
|
||||
|
||||
QPEL_FUNC(ff_hevc_put_qpel_v1_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_v2_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_v3_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h1_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h2_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h3_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h1v1_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h1v2_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h1v3_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h2v1_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h2v2_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h2v3_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h3v1_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h3v2_neon_8);
|
||||
QPEL_FUNC(ff_hevc_put_qpel_h3v3_neon_8);
|
||||
#undef QPEL_FUNC
|
||||
|
||||
#define QPEL_FUNC_UW_PIX(name) \
|
||||
void name(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, \
|
||||
int height, intptr_t mx, intptr_t my, int width);
|
||||
QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w4_neon_8);
|
||||
QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w8_neon_8);
|
||||
QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w16_neon_8);
|
||||
QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w24_neon_8);
|
||||
QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w32_neon_8);
|
||||
QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w48_neon_8);
|
||||
QPEL_FUNC_UW_PIX(ff_hevc_put_qpel_uw_pixels_w64_neon_8);
|
||||
#undef QPEL_FUNC_UW_PIX
|
||||
|
||||
#define QPEL_FUNC_UW(name) \
|
||||
void name(uint8_t *dst, ptrdiff_t dststride, uint8_t *_src, ptrdiff_t _srcstride, \
|
||||
int width, int height, int16_t* src2, ptrdiff_t src2stride);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_pixels_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_v1_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_v2_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_v3_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h1_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h2_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h3_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h1v1_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h1v2_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h1v3_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h2v1_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h2v2_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h2v3_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h3v1_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h3v2_neon_8);
|
||||
QPEL_FUNC_UW(ff_hevc_put_qpel_uw_h3v3_neon_8);
|
||||
#undef QPEL_FUNC_UW
|
||||
|
||||
void ff_hevc_sao_band_filter_neon_8(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, int width, int height, int16_t *offset_table);
|
||||
|
||||
void ff_hevc_sao_band_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src,
|
||||
ptrdiff_t stride_dst, ptrdiff_t stride_src,
|
||||
int16_t *sao_offset_val, int sao_left_class,
|
||||
int width, int height) {
|
||||
uint8_t *dst = _dst;
|
||||
uint8_t *src = _src;
|
||||
int16_t offset_table[32] = {0};
|
||||
int k;
|
||||
|
||||
for (k = 0; k < 4; k++) {
|
||||
offset_table[(k + sao_left_class) & 31] = sao_offset_val[k + 1];
|
||||
}
|
||||
|
||||
ff_hevc_sao_band_filter_neon_8(dst, src, stride_dst, stride_src, width, height, offset_table);
|
||||
}
|
||||
|
||||
void ff_hevc_sao_edge_filter_neon_8(uint8_t *dst, uint8_t *src, ptrdiff_t stride_dst, ptrdiff_t stride_src, int width, int height,
|
||||
int a_stride, int b_stride, int16_t *sao_offset_val, uint8_t *edge_idx);
|
||||
|
||||
void ff_hevc_sao_edge_filter_neon_8_wrapper(uint8_t *_dst, uint8_t *_src, ptrdiff_t stride_dst, int16_t *sao_offset_val,
|
||||
int eo, int width, int height) {
|
||||
static uint8_t edge_idx[] = { 1, 2, 0, 3, 4 };
|
||||
static const int8_t pos[4][2][2] = {
|
||||
{ { -1, 0 }, { 1, 0 } }, // horizontal
|
||||
{ { 0, -1 }, { 0, 1 } }, // vertical
|
||||
{ { -1, -1 }, { 1, 1 } }, // 45 degree
|
||||
{ { 1, -1 }, { -1, 1 } }, // 135 degree
|
||||
};
|
||||
uint8_t *dst = _dst;
|
||||
uint8_t *src = _src;
|
||||
int a_stride, b_stride;
|
||||
ptrdiff_t stride_src = (2*MAX_PB_SIZE + AV_INPUT_BUFFER_PADDING_SIZE);
|
||||
|
||||
a_stride = pos[eo][0][0] + pos[eo][0][1] * stride_src;
|
||||
b_stride = pos[eo][1][0] + pos[eo][1][1] * stride_src;
|
||||
|
||||
ff_hevc_sao_edge_filter_neon_8(dst, src, stride_dst, stride_src, width, height, a_stride, b_stride, sao_offset_val, edge_idx);
|
||||
}
|
||||
|
||||
void ff_hevc_put_qpel_neon_wrapper(int16_t *dst, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width) {
|
||||
|
||||
put_hevc_qpel_neon[my][mx](dst, MAX_PB_SIZE, src, srcstride, height, width);
|
||||
}
|
||||
|
||||
void ff_hevc_put_qpel_uni_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
|
||||
int height, intptr_t mx, intptr_t my, int width) {
|
||||
|
||||
put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, NULL, 0);
|
||||
}
|
||||
|
||||
void ff_hevc_put_qpel_bi_neon_wrapper(uint8_t *dst, ptrdiff_t dststride, uint8_t *src, ptrdiff_t srcstride,
|
||||
int16_t *src2,
|
||||
int height, intptr_t mx, intptr_t my, int width) {
|
||||
put_hevc_qpel_uw_neon[my][mx](dst, dststride, src, srcstride, width, height, src2, MAX_PB_SIZE);
|
||||
}
|
||||
|
||||
av_cold void ff_hevc_dsp_init_neon(HEVCDSPContext *c, const int bit_depth)
|
||||
{
|
||||
if (bit_depth == 8) {
|
||||
int x;
|
||||
c->hevc_v_loop_filter_luma = ff_hevc_v_loop_filter_luma_neon;
|
||||
c->hevc_h_loop_filter_luma = ff_hevc_h_loop_filter_luma_neon;
|
||||
c->hevc_v_loop_filter_chroma = ff_hevc_v_loop_filter_chroma_neon;
|
||||
c->hevc_h_loop_filter_chroma = ff_hevc_h_loop_filter_chroma_neon;
|
||||
c->sao_band_filter[0] = ff_hevc_sao_band_filter_neon_8_wrapper;
|
||||
c->sao_band_filter[1] = ff_hevc_sao_band_filter_neon_8_wrapper;
|
||||
c->sao_band_filter[2] = ff_hevc_sao_band_filter_neon_8_wrapper;
|
||||
c->sao_band_filter[3] = ff_hevc_sao_band_filter_neon_8_wrapper;
|
||||
c->sao_band_filter[4] = ff_hevc_sao_band_filter_neon_8_wrapper;
|
||||
c->sao_edge_filter[0] = ff_hevc_sao_edge_filter_neon_8_wrapper;
|
||||
c->sao_edge_filter[1] = ff_hevc_sao_edge_filter_neon_8_wrapper;
|
||||
c->sao_edge_filter[2] = ff_hevc_sao_edge_filter_neon_8_wrapper;
|
||||
c->sao_edge_filter[3] = ff_hevc_sao_edge_filter_neon_8_wrapper;
|
||||
c->sao_edge_filter[4] = ff_hevc_sao_edge_filter_neon_8_wrapper;
|
||||
c->add_residual[0] = ff_hevc_add_residual_4x4_8_neon;
|
||||
c->add_residual[1] = ff_hevc_add_residual_8x8_8_neon;
|
||||
c->add_residual[2] = ff_hevc_add_residual_16x16_8_neon;
|
||||
c->add_residual[3] = ff_hevc_add_residual_32x32_8_neon;
|
||||
c->idct_dc[0] = ff_hevc_idct_4x4_dc_8_neon;
|
||||
c->idct_dc[1] = ff_hevc_idct_8x8_dc_8_neon;
|
||||
c->idct_dc[2] = ff_hevc_idct_16x16_dc_8_neon;
|
||||
c->idct_dc[3] = ff_hevc_idct_32x32_dc_8_neon;
|
||||
c->idct[0] = ff_hevc_idct_4x4_8_neon;
|
||||
c->idct[1] = ff_hevc_idct_8x8_8_neon;
|
||||
c->idct[2] = ff_hevc_idct_16x16_8_neon;
|
||||
c->idct[3] = ff_hevc_idct_32x32_8_neon;
|
||||
c->transform_4x4_luma = ff_hevc_transform_luma_4x4_neon_8;
|
||||
put_hevc_qpel_neon[1][0] = ff_hevc_put_qpel_v1_neon_8;
|
||||
put_hevc_qpel_neon[2][0] = ff_hevc_put_qpel_v2_neon_8;
|
||||
put_hevc_qpel_neon[3][0] = ff_hevc_put_qpel_v3_neon_8;
|
||||
put_hevc_qpel_neon[0][1] = ff_hevc_put_qpel_h1_neon_8;
|
||||
put_hevc_qpel_neon[0][2] = ff_hevc_put_qpel_h2_neon_8;
|
||||
put_hevc_qpel_neon[0][3] = ff_hevc_put_qpel_h3_neon_8;
|
||||
put_hevc_qpel_neon[1][1] = ff_hevc_put_qpel_h1v1_neon_8;
|
||||
put_hevc_qpel_neon[1][2] = ff_hevc_put_qpel_h2v1_neon_8;
|
||||
put_hevc_qpel_neon[1][3] = ff_hevc_put_qpel_h3v1_neon_8;
|
||||
put_hevc_qpel_neon[2][1] = ff_hevc_put_qpel_h1v2_neon_8;
|
||||
put_hevc_qpel_neon[2][2] = ff_hevc_put_qpel_h2v2_neon_8;
|
||||
put_hevc_qpel_neon[2][3] = ff_hevc_put_qpel_h3v2_neon_8;
|
||||
put_hevc_qpel_neon[3][1] = ff_hevc_put_qpel_h1v3_neon_8;
|
||||
put_hevc_qpel_neon[3][2] = ff_hevc_put_qpel_h2v3_neon_8;
|
||||
put_hevc_qpel_neon[3][3] = ff_hevc_put_qpel_h3v3_neon_8;
|
||||
put_hevc_qpel_uw_neon[1][0] = ff_hevc_put_qpel_uw_v1_neon_8;
|
||||
put_hevc_qpel_uw_neon[2][0] = ff_hevc_put_qpel_uw_v2_neon_8;
|
||||
put_hevc_qpel_uw_neon[3][0] = ff_hevc_put_qpel_uw_v3_neon_8;
|
||||
put_hevc_qpel_uw_neon[0][1] = ff_hevc_put_qpel_uw_h1_neon_8;
|
||||
put_hevc_qpel_uw_neon[0][2] = ff_hevc_put_qpel_uw_h2_neon_8;
|
||||
put_hevc_qpel_uw_neon[0][3] = ff_hevc_put_qpel_uw_h3_neon_8;
|
||||
put_hevc_qpel_uw_neon[1][1] = ff_hevc_put_qpel_uw_h1v1_neon_8;
|
||||
put_hevc_qpel_uw_neon[1][2] = ff_hevc_put_qpel_uw_h2v1_neon_8;
|
||||
put_hevc_qpel_uw_neon[1][3] = ff_hevc_put_qpel_uw_h3v1_neon_8;
|
||||
put_hevc_qpel_uw_neon[2][1] = ff_hevc_put_qpel_uw_h1v2_neon_8;
|
||||
put_hevc_qpel_uw_neon[2][2] = ff_hevc_put_qpel_uw_h2v2_neon_8;
|
||||
put_hevc_qpel_uw_neon[2][3] = ff_hevc_put_qpel_uw_h3v2_neon_8;
|
||||
put_hevc_qpel_uw_neon[3][1] = ff_hevc_put_qpel_uw_h1v3_neon_8;
|
||||
put_hevc_qpel_uw_neon[3][2] = ff_hevc_put_qpel_uw_h2v3_neon_8;
|
||||
put_hevc_qpel_uw_neon[3][3] = ff_hevc_put_qpel_uw_h3v3_neon_8;
|
||||
for (x = 0; x < 10; x++) {
|
||||
c->put_hevc_qpel[x][1][0] = ff_hevc_put_qpel_neon_wrapper;
|
||||
c->put_hevc_qpel[x][0][1] = ff_hevc_put_qpel_neon_wrapper;
|
||||
c->put_hevc_qpel[x][1][1] = ff_hevc_put_qpel_neon_wrapper;
|
||||
c->put_hevc_qpel_uni[x][1][0] = ff_hevc_put_qpel_uni_neon_wrapper;
|
||||
c->put_hevc_qpel_uni[x][0][1] = ff_hevc_put_qpel_uni_neon_wrapper;
|
||||
c->put_hevc_qpel_uni[x][1][1] = ff_hevc_put_qpel_uni_neon_wrapper;
|
||||
c->put_hevc_qpel_bi[x][1][0] = ff_hevc_put_qpel_bi_neon_wrapper;
|
||||
c->put_hevc_qpel_bi[x][0][1] = ff_hevc_put_qpel_bi_neon_wrapper;
|
||||
c->put_hevc_qpel_bi[x][1][1] = ff_hevc_put_qpel_bi_neon_wrapper;
|
||||
}
|
||||
c->put_hevc_qpel[0][0][0] = ff_hevc_put_pixels_w2_neon_8;
|
||||
c->put_hevc_qpel[1][0][0] = ff_hevc_put_pixels_w4_neon_8;
|
||||
c->put_hevc_qpel[2][0][0] = ff_hevc_put_pixels_w6_neon_8;
|
||||
c->put_hevc_qpel[3][0][0] = ff_hevc_put_pixels_w8_neon_8;
|
||||
c->put_hevc_qpel[4][0][0] = ff_hevc_put_pixels_w12_neon_8;
|
||||
c->put_hevc_qpel[5][0][0] = ff_hevc_put_pixels_w16_neon_8;
|
||||
c->put_hevc_qpel[6][0][0] = ff_hevc_put_pixels_w24_neon_8;
|
||||
c->put_hevc_qpel[7][0][0] = ff_hevc_put_pixels_w32_neon_8;
|
||||
c->put_hevc_qpel[8][0][0] = ff_hevc_put_pixels_w48_neon_8;
|
||||
c->put_hevc_qpel[9][0][0] = ff_hevc_put_pixels_w64_neon_8;
|
||||
|
||||
c->put_hevc_qpel_uni[1][0][0] = ff_hevc_put_qpel_uw_pixels_w4_neon_8;
|
||||
c->put_hevc_qpel_uni[3][0][0] = ff_hevc_put_qpel_uw_pixels_w8_neon_8;
|
||||
c->put_hevc_qpel_uni[5][0][0] = ff_hevc_put_qpel_uw_pixels_w16_neon_8;
|
||||
c->put_hevc_qpel_uni[6][0][0] = ff_hevc_put_qpel_uw_pixels_w24_neon_8;
|
||||
c->put_hevc_qpel_uni[7][0][0] = ff_hevc_put_qpel_uw_pixels_w32_neon_8;
|
||||
c->put_hevc_qpel_uni[8][0][0] = ff_hevc_put_qpel_uw_pixels_w48_neon_8;
|
||||
c->put_hevc_qpel_uni[9][0][0] = ff_hevc_put_qpel_uw_pixels_w64_neon_8;
|
||||
}
|
||||
|
||||
if (bit_depth == 10) {
|
||||
c->add_residual[0] = ff_hevc_add_residual_4x4_10_neon;
|
||||
c->add_residual[1] = ff_hevc_add_residual_8x8_10_neon;
|
||||
c->add_residual[2] = ff_hevc_add_residual_16x16_10_neon;
|
||||
c->add_residual[3] = ff_hevc_add_residual_32x32_10_neon;
|
||||
|
||||
c->idct_dc[0] = ff_hevc_idct_4x4_dc_10_neon;
|
||||
c->idct_dc[1] = ff_hevc_idct_8x8_dc_10_neon;
|
||||
c->idct_dc[2] = ff_hevc_idct_16x16_dc_10_neon;
|
||||
c->idct_dc[3] = ff_hevc_idct_32x32_dc_10_neon;
|
||||
|
||||
c->idct[0] = ff_hevc_idct_4x4_10_neon;
|
||||
c->idct[1] = ff_hevc_idct_8x8_10_neon;
|
||||
c->idct[2] = ff_hevc_idct_16x16_10_neon;
|
||||
c->idct[3] = ff_hevc_idct_32x32_10_neon;
|
||||
}
|
||||
}
|
@ -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 AVCODEC_ARM_HPELDSP_ARM_H
|
||||
#define AVCODEC_ARM_HPELDSP_ARM_H
|
||||
|
||||
#include "libavcodec/hpeldsp.h"
|
||||
|
||||
void ff_hpeldsp_init_armv6(HpelDSPContext *c, int flags);
|
||||
void ff_hpeldsp_init_neon(HpelDSPContext *c, int flags);
|
||||
|
||||
#endif /* AVCODEC_ARM_HPELDSP_ARM_H */
|
@ -0,0 +1,71 @@
|
||||
/*
|
||||
* ARM-optimized halfpel functions
|
||||
* Copyright (c) 2001 Lionel Ulmer
|
||||
*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/pixels.h"
|
||||
#include "hpeldsp_arm.h"
|
||||
|
||||
void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
|
||||
void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
|
||||
void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
|
||||
|
||||
CALL_2X_PIXELS(ff_put_pixels16_x2_arm, ff_put_pixels8_x2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_pixels16_y2_arm, ff_put_pixels8_y2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_pixels16_xy2_arm, ff_put_pixels8_xy2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
|
||||
CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
|
||||
|
||||
av_cold void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
c->put_pixels_tab[0][0] = ff_put_pixels16_arm;
|
||||
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_arm;
|
||||
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_arm;
|
||||
c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_arm;
|
||||
c->put_pixels_tab[1][0] = ff_put_pixels8_arm;
|
||||
c->put_pixels_tab[1][1] = ff_put_pixels8_x2_arm;
|
||||
c->put_pixels_tab[1][2] = ff_put_pixels8_y2_arm;
|
||||
c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_arm;
|
||||
|
||||
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_arm;
|
||||
c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_arm;
|
||||
c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_arm;
|
||||
c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_arm;
|
||||
c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_arm;
|
||||
c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_arm;
|
||||
c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_arm;
|
||||
c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
|
||||
|
||||
if (have_armv6(cpu_flags))
|
||||
ff_hpeldsp_init_armv6(c, flags);
|
||||
if (have_neon(cpu_flags))
|
||||
ff_hpeldsp_init_neon(c, flags);
|
||||
}
|
@ -0,0 +1,67 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "hpeldsp_arm.h"
|
||||
|
||||
void ff_put_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
void ff_put_pixels16_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
void ff_avg_pixels16_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
void ff_put_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_x2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
void ff_put_pixels8_x2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_no_rnd_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
void ff_avg_pixels8_armv6(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
av_cold void ff_hpeldsp_init_armv6(HpelDSPContext *c, int flags)
|
||||
{
|
||||
c->put_pixels_tab[0][0] = ff_put_pixels16_armv6;
|
||||
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_armv6;
|
||||
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_armv6;
|
||||
/* c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_armv6; */
|
||||
c->put_pixels_tab[1][0] = ff_put_pixels8_armv6;
|
||||
c->put_pixels_tab[1][1] = ff_put_pixels8_x2_armv6;
|
||||
c->put_pixels_tab[1][2] = ff_put_pixels8_y2_armv6;
|
||||
/* c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_armv6; */
|
||||
|
||||
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_armv6;
|
||||
c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_armv6;
|
||||
c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_armv6;
|
||||
/* c->put_no_rnd_pixels_tab[0][3] = ff_put_pixels16_xy2_no_rnd_armv6; */
|
||||
c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_armv6;
|
||||
c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_armv6;
|
||||
c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_armv6;
|
||||
/* c->put_no_rnd_pixels_tab[1][3] = ff_put_pixels8_xy2_no_rnd_armv6; */
|
||||
|
||||
c->avg_pixels_tab[0][0] = ff_avg_pixels16_armv6;
|
||||
c->avg_pixels_tab[1][0] = ff_avg_pixels8_armv6;
|
||||
}
|
@ -0,0 +1,88 @@
|
||||
/*
|
||||
* ARM NEON optimised 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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "hpeldsp_arm.h"
|
||||
|
||||
void ff_put_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_put_pixels8_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
void ff_avg_pixels16_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_x2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_y2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels8_xy2_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_x2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_y2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
void ff_avg_pixels16_xy2_no_rnd_neon(uint8_t *, const uint8_t *, ptrdiff_t, int);
|
||||
|
||||
av_cold void ff_hpeldsp_init_neon(HpelDSPContext *c, int flags)
|
||||
{
|
||||
c->put_pixels_tab[0][0] = ff_put_pixels16_neon;
|
||||
c->put_pixels_tab[0][1] = ff_put_pixels16_x2_neon;
|
||||
c->put_pixels_tab[0][2] = ff_put_pixels16_y2_neon;
|
||||
c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_neon;
|
||||
c->put_pixels_tab[1][0] = ff_put_pixels8_neon;
|
||||
c->put_pixels_tab[1][1] = ff_put_pixels8_x2_neon;
|
||||
c->put_pixels_tab[1][2] = ff_put_pixels8_y2_neon;
|
||||
c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_neon;
|
||||
|
||||
c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_neon;
|
||||
c->put_no_rnd_pixels_tab[0][1] = ff_put_pixels16_x2_no_rnd_neon;
|
||||
c->put_no_rnd_pixels_tab[0][2] = ff_put_pixels16_y2_no_rnd_neon;
|
||||
c->put_no_rnd_pixels_tab[0][3] = ff_put_pixels16_xy2_no_rnd_neon;
|
||||
c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_neon;
|
||||
c->put_no_rnd_pixels_tab[1][1] = ff_put_pixels8_x2_no_rnd_neon;
|
||||
c->put_no_rnd_pixels_tab[1][2] = ff_put_pixels8_y2_no_rnd_neon;
|
||||
c->put_no_rnd_pixels_tab[1][3] = ff_put_pixels8_xy2_no_rnd_neon;
|
||||
|
||||
c->avg_pixels_tab[0][0] = ff_avg_pixels16_neon;
|
||||
c->avg_pixels_tab[0][1] = ff_avg_pixels16_x2_neon;
|
||||
c->avg_pixels_tab[0][2] = ff_avg_pixels16_y2_neon;
|
||||
c->avg_pixels_tab[0][3] = ff_avg_pixels16_xy2_neon;
|
||||
c->avg_pixels_tab[1][0] = ff_avg_pixels8_neon;
|
||||
c->avg_pixels_tab[1][1] = ff_avg_pixels8_x2_neon;
|
||||
c->avg_pixels_tab[1][2] = ff_avg_pixels8_y2_neon;
|
||||
c->avg_pixels_tab[1][3] = ff_avg_pixels8_xy2_neon;
|
||||
|
||||
c->avg_no_rnd_pixels_tab[0] = ff_avg_pixels16_neon;
|
||||
c->avg_no_rnd_pixels_tab[1] = ff_avg_pixels16_x2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[2] = ff_avg_pixels16_y2_no_rnd_neon;
|
||||
c->avg_no_rnd_pixels_tab[3] = ff_avg_pixels16_xy2_no_rnd_neon;
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_IDCT_H
|
||||
#define AVCODEC_ARM_IDCT_H
|
||||
|
||||
#include <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
void ff_j_rev_dct_arm(int16_t *data);
|
||||
|
||||
void ff_simple_idct_arm(int16_t *data);
|
||||
|
||||
void ff_simple_idct_armv5te(int16_t *data);
|
||||
void ff_simple_idct_put_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv5te(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
|
||||
void ff_simple_idct_armv6(int16_t *data);
|
||||
void ff_simple_idct_put_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
void ff_simple_idct_add_armv6(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
|
||||
void ff_simple_idct_neon(int16_t *data);
|
||||
void ff_simple_idct_put_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
void ff_simple_idct_add_neon(uint8_t *dest, ptrdiff_t line_size, int16_t *data);
|
||||
|
||||
#endif /* AVCODEC_ARM_IDCT_H */
|
@ -0,0 +1,34 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_IDCTDSP_ARM_H
|
||||
#define AVCODEC_ARM_IDCTDSP_ARM_H
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/idctdsp.h"
|
||||
|
||||
void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth);
|
||||
void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth);
|
||||
void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth);
|
||||
|
||||
#endif /* AVCODEC_ARM_IDCTDSP_ARM_H */
|
@ -0,0 +1,94 @@
|
||||
/*
|
||||
* ARM-optimized IDCT functions
|
||||
* Copyright (c) 2001 Lionel Ulmer
|
||||
*
|
||||
* 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 <stddef.h>
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/idctdsp.h"
|
||||
#include "idct.h"
|
||||
#include "idctdsp_arm.h"
|
||||
|
||||
void ff_add_pixels_clamped_arm(const int16_t *block, uint8_t *dest,
|
||||
ptrdiff_t line_size);
|
||||
|
||||
/* XXX: those functions should be suppressed ASAP when all IDCTs are
|
||||
* converted */
|
||||
static void j_rev_dct_arm_put(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_j_rev_dct_arm(block);
|
||||
ff_put_pixels_clamped_c(block, dest, line_size);
|
||||
}
|
||||
|
||||
static void j_rev_dct_arm_add(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_j_rev_dct_arm(block);
|
||||
ff_add_pixels_clamped_arm(block, dest, line_size);
|
||||
}
|
||||
|
||||
static void simple_idct_arm_put(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_simple_idct_arm(block);
|
||||
ff_put_pixels_clamped_c(block, dest, line_size);
|
||||
}
|
||||
|
||||
static void simple_idct_arm_add(uint8_t *dest, ptrdiff_t line_size,
|
||||
int16_t *block)
|
||||
{
|
||||
ff_simple_idct_arm(block);
|
||||
ff_add_pixels_clamped_arm(block, dest, line_size);
|
||||
}
|
||||
|
||||
av_cold void ff_idctdsp_init_arm(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (!avctx->lowres && !high_bit_depth) {
|
||||
if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) ||
|
||||
avctx->idct_algo == FF_IDCT_ARM) {
|
||||
c->idct_put = j_rev_dct_arm_put;
|
||||
c->idct_add = j_rev_dct_arm_add;
|
||||
c->idct = ff_j_rev_dct_arm;
|
||||
c->perm_type = FF_IDCT_PERM_LIBMPEG2;
|
||||
} else if (avctx->idct_algo == FF_IDCT_SIMPLEARM) {
|
||||
c->idct_put = simple_idct_arm_put;
|
||||
c->idct_add = simple_idct_arm_add;
|
||||
c->idct = ff_simple_idct_arm;
|
||||
c->perm_type = FF_IDCT_PERM_NONE;
|
||||
}
|
||||
}
|
||||
|
||||
c->add_pixels_clamped = ff_add_pixels_clamped_arm;
|
||||
|
||||
if (have_armv5te(cpu_flags))
|
||||
ff_idctdsp_init_armv5te(c, avctx, high_bit_depth);
|
||||
if (have_armv6(cpu_flags))
|
||||
ff_idctdsp_init_armv6(c, avctx, high_bit_depth);
|
||||
if (have_neon(cpu_flags))
|
||||
ff_idctdsp_init_neon(c, avctx, high_bit_depth);
|
||||
}
|
@ -0,0 +1,41 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/idctdsp.h"
|
||||
#include "idct.h"
|
||||
#include "idctdsp_arm.h"
|
||||
|
||||
av_cold void ff_idctdsp_init_armv5te(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth)
|
||||
{
|
||||
if (!avctx->lowres && !high_bit_depth &&
|
||||
(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
|
||||
c->idct_put = ff_simple_idct_put_armv5te;
|
||||
c->idct_add = ff_simple_idct_add_armv5te;
|
||||
c->idct = ff_simple_idct_armv5te;
|
||||
c->perm_type = FF_IDCT_PERM_NONE;
|
||||
}
|
||||
}
|
@ -0,0 +1,45 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/idctdsp.h"
|
||||
#include "idct.h"
|
||||
#include "idctdsp_arm.h"
|
||||
|
||||
void ff_add_pixels_clamped_armv6(const int16_t *block, uint8_t *pixels,
|
||||
ptrdiff_t line_size);
|
||||
|
||||
av_cold void ff_idctdsp_init_armv6(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth)
|
||||
{
|
||||
if (!avctx->lowres && !high_bit_depth) {
|
||||
if ((avctx->idct_algo == FF_IDCT_AUTO && !(avctx->flags & AV_CODEC_FLAG_BITEXACT)) ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV6) {
|
||||
c->idct_put = ff_simple_idct_put_armv6;
|
||||
c->idct_add = ff_simple_idct_add_armv6;
|
||||
c->idct = ff_simple_idct_armv6;
|
||||
c->perm_type = FF_IDCT_PERM_LIBMPEG2;
|
||||
}
|
||||
}
|
||||
c->add_pixels_clamped = ff_add_pixels_clamped_armv6;
|
||||
}
|
@ -0,0 +1,51 @@
|
||||
/*
|
||||
* ARM-NEON-optimized IDCT 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 "libavcodec/avcodec.h"
|
||||
#include "libavcodec/idctdsp.h"
|
||||
#include "idct.h"
|
||||
#include "idctdsp_arm.h"
|
||||
|
||||
void ff_add_pixels_clamped_neon(const int16_t *, uint8_t *, ptrdiff_t);
|
||||
void ff_put_pixels_clamped_neon(const int16_t *, uint8_t *, ptrdiff_t);
|
||||
void ff_put_signed_pixels_clamped_neon(const int16_t *, uint8_t *, ptrdiff_t);
|
||||
|
||||
av_cold void ff_idctdsp_init_neon(IDCTDSPContext *c, AVCodecContext *avctx,
|
||||
unsigned high_bit_depth)
|
||||
{
|
||||
if (!avctx->lowres && !high_bit_depth) {
|
||||
if (avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEAUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLENEON) {
|
||||
c->idct_put = ff_simple_idct_put_neon;
|
||||
c->idct_add = ff_simple_idct_add_neon;
|
||||
c->idct = ff_simple_idct_neon;
|
||||
c->perm_type = FF_IDCT_PERM_PARTTRANS;
|
||||
}
|
||||
}
|
||||
|
||||
c->add_pixels_clamped = ff_add_pixels_clamped_neon;
|
||||
c->put_pixels_clamped = ff_put_pixels_clamped_neon;
|
||||
c->put_signed_pixels_clamped = ff_put_signed_pixels_clamped_neon;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2011 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/arm/cpu.h"
|
||||
#include "libavcodec/lossless_audiodsp.h"
|
||||
|
||||
int32_t ff_scalarproduct_and_madd_int16_neon(int16_t *v1, const int16_t *v2,
|
||||
const int16_t *v3, int len, int mul);
|
||||
|
||||
av_cold void ff_llauddsp_init_arm(LLAudDSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->scalarproduct_and_madd_int16 = ff_scalarproduct_and_madd_int16_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,108 @@
|
||||
/*
|
||||
* simple math operations
|
||||
* Copyright (c) 2006 Michael Niedermayer <michaelni@gmx.at> et al
|
||||
*
|
||||
* 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 AVCODEC_ARM_MATHOPS_H
|
||||
#define AVCODEC_ARM_MATHOPS_H
|
||||
|
||||
#include <stdint.h>
|
||||
#include "config.h"
|
||||
#include "libavutil/common.h"
|
||||
|
||||
#if HAVE_INLINE_ASM
|
||||
|
||||
#if HAVE_ARMV6_INLINE
|
||||
#define MULH MULH
|
||||
static inline av_const int MULH(int a, int b)
|
||||
{
|
||||
int r;
|
||||
__asm__ ("smmul %0, %1, %2" : "=r"(r) : "r"(a), "r"(b));
|
||||
return r;
|
||||
}
|
||||
|
||||
#define FASTDIV FASTDIV
|
||||
static av_always_inline av_const int FASTDIV(int a, int b)
|
||||
{
|
||||
int r;
|
||||
__asm__ ("cmp %2, #2 \n\t"
|
||||
"ldr %0, [%3, %2, lsl #2] \n\t"
|
||||
"ite le \n\t"
|
||||
"lsrle %0, %1, #1 \n\t"
|
||||
"smmulgt %0, %0, %1 \n\t"
|
||||
: "=&r"(r) : "r"(a), "r"(b), "r"(ff_inverse) : "cc");
|
||||
return r;
|
||||
}
|
||||
|
||||
#else /* HAVE_ARMV6_INLINE */
|
||||
|
||||
#define FASTDIV FASTDIV
|
||||
static av_always_inline av_const int FASTDIV(int a, int b)
|
||||
{
|
||||
int r, t;
|
||||
__asm__ ("umull %1, %0, %2, %3"
|
||||
: "=&r"(r), "=&r"(t) : "r"(a), "r"(ff_inverse[b]));
|
||||
return r;
|
||||
}
|
||||
#endif
|
||||
|
||||
#define MLS64(d, a, b) MAC64(d, -(a), b)
|
||||
|
||||
#if HAVE_ARMV5TE_INLINE
|
||||
|
||||
/* signed 16x16 -> 32 multiply add accumulate */
|
||||
# define MAC16(rt, ra, rb) \
|
||||
__asm__ ("smlabb %0, %1, %2, %0" : "+r"(rt) : "r"(ra), "r"(rb));
|
||||
|
||||
/* signed 16x16 -> 32 multiply */
|
||||
# define MUL16 MUL16
|
||||
static inline av_const int MUL16(int ra, int rb)
|
||||
{
|
||||
int rt;
|
||||
__asm__ ("smulbb %0, %1, %2" : "=r"(rt) : "r"(ra), "r"(rb));
|
||||
return rt;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#define mid_pred mid_pred
|
||||
static inline av_const int mid_pred(int a, int b, int c)
|
||||
{
|
||||
int m;
|
||||
__asm__ (
|
||||
"mov %0, %2 \n\t"
|
||||
"cmp %1, %2 \n\t"
|
||||
"itt gt \n\t"
|
||||
"movgt %0, %1 \n\t"
|
||||
"movgt %1, %2 \n\t"
|
||||
"cmp %1, %3 \n\t"
|
||||
"it le \n\t"
|
||||
"movle %1, %3 \n\t"
|
||||
"cmp %0, %1 \n\t"
|
||||
"it gt \n\t"
|
||||
"movgt %0, %1 \n\t"
|
||||
: "=&r"(m), "+r"(a)
|
||||
: "r"(b), "r"(c)
|
||||
: "cc");
|
||||
return m;
|
||||
}
|
||||
|
||||
#endif /* HAVE_INLINE_ASM */
|
||||
|
||||
#endif /* AVCODEC_ARM_MATHOPS_H */
|
@ -0,0 +1,57 @@
|
||||
/*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/me_cmp.h"
|
||||
#include "libavcodec/mpegvideo.h"
|
||||
|
||||
int ff_pix_abs16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
|
||||
ptrdiff_t stride, int h);
|
||||
int ff_pix_abs16_x2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
|
||||
ptrdiff_t stride, int h);
|
||||
int ff_pix_abs16_y2_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
|
||||
ptrdiff_t stride, int h);
|
||||
|
||||
int ff_pix_abs8_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
|
||||
ptrdiff_t stride, int h);
|
||||
|
||||
int ff_sse16_armv6(MpegEncContext *s, uint8_t *blk1, uint8_t *blk2,
|
||||
ptrdiff_t stride, int h);
|
||||
|
||||
av_cold void ff_me_cmp_init_arm(MECmpContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
c->pix_abs[0][0] = ff_pix_abs16_armv6;
|
||||
c->pix_abs[0][1] = ff_pix_abs16_x2_armv6;
|
||||
c->pix_abs[0][2] = ff_pix_abs16_y2_armv6;
|
||||
|
||||
c->pix_abs[1][0] = ff_pix_abs8_armv6;
|
||||
|
||||
c->sad[0] = ff_pix_abs16_armv6;
|
||||
c->sad[1] = ff_pix_abs8_armv6;
|
||||
|
||||
c->sse[0] = ff_sse16_armv6;
|
||||
}
|
||||
}
|
@ -0,0 +1,146 @@
|
||||
/*
|
||||
* Copyright (c) 2014 RISC OS Open Ltd
|
||||
* Author: Ben Avison <bavison@riscosopen.org>
|
||||
*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/mlpdsp.h"
|
||||
|
||||
void ff_mlp_filter_channel_arm(int32_t *state, const int32_t *coeff,
|
||||
int firorder, int iirorder,
|
||||
unsigned int filter_shift, int32_t mask,
|
||||
int blocksize, int32_t *sample_buffer);
|
||||
void ff_mlp_rematrix_channel_arm(int32_t *samples,
|
||||
const int32_t *coeffs,
|
||||
const uint8_t *bypassed_lsbs,
|
||||
const int8_t *noise_buffer,
|
||||
int index,
|
||||
unsigned int dest_ch,
|
||||
uint16_t blockpos,
|
||||
unsigned int maxchan,
|
||||
int matrix_noise_shift,
|
||||
int access_unit_size_pow2,
|
||||
int32_t mask);
|
||||
|
||||
#define DECLARE_PACK(order,channels,shift) \
|
||||
int32_t ff_mlp_pack_output_##order##order_##channels##ch_##shift##shift_armv6(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int);
|
||||
#define ENUMERATE_PACK(order,channels,shift) \
|
||||
ff_mlp_pack_output_##order##order_##channels##ch_##shift##shift_armv6,
|
||||
#define PACK_CHANNELS(macro,order,channels) \
|
||||
macro(order,channels,0) \
|
||||
macro(order,channels,1) \
|
||||
macro(order,channels,2) \
|
||||
macro(order,channels,3) \
|
||||
macro(order,channels,4) \
|
||||
macro(order,channels,5) \
|
||||
macro(order,channels,mixed)
|
||||
#define PACK_ORDER(macro,order) \
|
||||
PACK_CHANNELS(macro,order,2) \
|
||||
PACK_CHANNELS(macro,order,6) \
|
||||
PACK_CHANNELS(macro,order,8)
|
||||
#define PACK_ALL(macro) \
|
||||
PACK_ORDER(macro,outof) \
|
||||
PACK_ORDER(macro,in)
|
||||
PACK_ALL(DECLARE_PACK)
|
||||
|
||||
#define ff_mlp_pack_output_outoforder_2ch_mixedshift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_6ch_mixedshift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_8ch_mixedshift_armv6 0
|
||||
#if CONFIG_THUMB
|
||||
#define ff_mlp_pack_output_outoforder_2ch_0shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_2ch_1shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_2ch_2shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_2ch_3shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_2ch_4shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_2ch_5shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_6ch_0shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_6ch_1shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_6ch_2shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_6ch_3shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_6ch_4shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_6ch_5shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_8ch_0shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_8ch_1shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_8ch_2shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_8ch_3shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_8ch_4shift_armv6 0
|
||||
#define ff_mlp_pack_output_outoforder_8ch_5shift_armv6 0
|
||||
#endif
|
||||
|
||||
static int32_t (*mlp_select_pack_output_armv6(uint8_t *ch_assign,
|
||||
int8_t *output_shift,
|
||||
uint8_t max_matrix_channel,
|
||||
int is32))(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int)
|
||||
{
|
||||
int ch_index;
|
||||
int shift = output_shift[0] < 0 || output_shift[0] > 5 ? 6 : output_shift[0];
|
||||
int inorder = 1;
|
||||
static int32_t (*const routine[2*3*7])(int32_t, uint16_t, int32_t (*)[], void *, uint8_t*, int8_t *, uint8_t, int) = {
|
||||
PACK_ALL(ENUMERATE_PACK)
|
||||
};
|
||||
int i;
|
||||
|
||||
if (!is32) // don't support 16-bit output (it's not used by TrueHD)
|
||||
return ff_mlp_pack_output;
|
||||
|
||||
switch (max_matrix_channel) {
|
||||
case 1:
|
||||
ch_index = 0;
|
||||
break;
|
||||
case 5:
|
||||
ch_index = 1;
|
||||
break;
|
||||
case 7:
|
||||
ch_index = 2;
|
||||
break;
|
||||
default:
|
||||
return ff_mlp_pack_output;
|
||||
}
|
||||
|
||||
for (i = 0; i <= max_matrix_channel; i++) {
|
||||
if (shift != 6 && output_shift[i] != shift)
|
||||
shift = 6; // indicate mixed shifts
|
||||
if (ch_assign[i] != i)
|
||||
inorder = 0;
|
||||
}
|
||||
#if CONFIG_THUMB
|
||||
if (!inorder)
|
||||
return ff_mlp_pack_output; // can't currently handle an order array except in ARM mode
|
||||
#else
|
||||
if (shift == 6 && !inorder)
|
||||
return ff_mlp_pack_output; // can't currently handle both an order array and a shift array
|
||||
#endif
|
||||
|
||||
return routine[(inorder*3+ch_index)*7+shift];
|
||||
}
|
||||
|
||||
av_cold void ff_mlpdsp_init_arm(MLPDSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv5te(cpu_flags)) {
|
||||
c->mlp_filter_channel = ff_mlp_filter_channel_arm;
|
||||
c->mlp_rematrix_channel = ff_mlp_rematrix_channel_arm;
|
||||
}
|
||||
if (have_armv6(cpu_flags))
|
||||
c->mlp_select_pack_output = mlp_select_pack_output_armv6;
|
||||
}
|
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* Copyright (c) 2011 Mans Rullgard
|
||||
*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/mpegaudiodsp.h"
|
||||
#include "config.h"
|
||||
|
||||
void ff_mpadsp_apply_window_fixed_armv6(int32_t *synth_buf, int32_t *window,
|
||||
int *dither, int16_t *out, ptrdiff_t incr);
|
||||
|
||||
av_cold void ff_mpadsp_init_arm(MPADSPContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
s->apply_window_fixed = ff_mpadsp_apply_window_fixed_armv6;
|
||||
}
|
||||
}
|
@ -0,0 +1,54 @@
|
||||
/*
|
||||
* Copyright (c) 2002 Michael Niedermayer
|
||||
*
|
||||
* 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/internal.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/mpegvideo.h"
|
||||
#include "mpegvideo_arm.h"
|
||||
#include "asm-offsets.h"
|
||||
|
||||
#if HAVE_NEON
|
||||
AV_CHECK_OFFSET(MpegEncContext, y_dc_scale, Y_DC_SCALE);
|
||||
AV_CHECK_OFFSET(MpegEncContext, c_dc_scale, C_DC_SCALE);
|
||||
AV_CHECK_OFFSET(MpegEncContext, ac_pred, AC_PRED);
|
||||
AV_CHECK_OFFSET(MpegEncContext, block_last_index, BLOCK_LAST_INDEX);
|
||||
AV_CHECK_OFFSET(MpegEncContext, inter_scantable.raster_end,
|
||||
INTER_SCANTAB_RASTER_END);
|
||||
AV_CHECK_OFFSET(MpegEncContext, h263_aic, H263_AIC);
|
||||
#endif
|
||||
|
||||
void ff_dct_unquantize_h263_inter_neon(MpegEncContext *s, int16_t *block,
|
||||
int n, int qscale);
|
||||
void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, int16_t *block,
|
||||
int n, int qscale);
|
||||
|
||||
av_cold void ff_mpv_common_init_arm(MpegEncContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv5te(cpu_flags))
|
||||
ff_mpv_common_init_armv5te(s);
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_neon;
|
||||
s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_MPEGVIDEO_ARM_H
|
||||
#define AVCODEC_ARM_MPEGVIDEO_ARM_H
|
||||
|
||||
#include "libavcodec/mpegvideo.h"
|
||||
|
||||
void ff_mpv_common_init_armv5te(MpegEncContext *s);
|
||||
|
||||
#endif /* AVCODEC_ARM_MPEGVIDEO_ARM_H */
|
@ -0,0 +1,102 @@
|
||||
/*
|
||||
* Optimization of some functions from mpegvideo.c for armv5te
|
||||
* Copyright (c) 2007 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/avassert.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/mpegvideo.h"
|
||||
#include "mpegvideo_arm.h"
|
||||
|
||||
void ff_dct_unquantize_h263_armv5te(int16_t *block, int qmul, int qadd, int count);
|
||||
|
||||
#ifdef ENABLE_ARM_TESTS
|
||||
/**
|
||||
* H.263 dequantizer supplementary function, it is performance critical and needs to
|
||||
* have optimized implementations for each architecture. Is also used as a reference
|
||||
* implementation in regression tests
|
||||
*/
|
||||
static inline void dct_unquantize_h263_helper_c(int16_t *block, int qmul, int qadd, int count)
|
||||
{
|
||||
int i, level;
|
||||
for (i = 0; i < count; i++) {
|
||||
level = block[i];
|
||||
if (level) {
|
||||
if (level < 0) {
|
||||
level = level * qmul - qadd;
|
||||
} else {
|
||||
level = level * qmul + qadd;
|
||||
}
|
||||
block[i] = level;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
static void dct_unquantize_h263_intra_armv5te(MpegEncContext *s,
|
||||
int16_t *block, int n, int qscale)
|
||||
{
|
||||
int level, qmul, qadd;
|
||||
int nCoeffs;
|
||||
|
||||
av_assert2(s->block_last_index[n]>=0);
|
||||
|
||||
qmul = qscale << 1;
|
||||
|
||||
if (!s->h263_aic) {
|
||||
if (n < 4)
|
||||
level = block[0] * s->y_dc_scale;
|
||||
else
|
||||
level = block[0] * s->c_dc_scale;
|
||||
qadd = (qscale - 1) | 1;
|
||||
}else{
|
||||
qadd = 0;
|
||||
level = block[0];
|
||||
}
|
||||
if(s->ac_pred)
|
||||
nCoeffs=63;
|
||||
else
|
||||
nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
|
||||
|
||||
ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
|
||||
block[0] = level;
|
||||
}
|
||||
|
||||
static void dct_unquantize_h263_inter_armv5te(MpegEncContext *s,
|
||||
int16_t *block, int n, int qscale)
|
||||
{
|
||||
int qmul, qadd;
|
||||
int nCoeffs;
|
||||
|
||||
av_assert2(s->block_last_index[n]>=0);
|
||||
|
||||
qadd = (qscale - 1) | 1;
|
||||
qmul = qscale << 1;
|
||||
|
||||
nCoeffs= s->inter_scantable.raster_end[ s->block_last_index[n] ];
|
||||
|
||||
ff_dct_unquantize_h263_armv5te(block, qmul, qadd, nCoeffs + 1);
|
||||
}
|
||||
|
||||
av_cold void ff_mpv_common_init_armv5te(MpegEncContext *s)
|
||||
{
|
||||
s->dct_unquantize_h263_intra = dct_unquantize_h263_intra_armv5te;
|
||||
s->dct_unquantize_h263_inter = dct_unquantize_h263_inter_armv5te;
|
||||
}
|
@ -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 <stdint.h>
|
||||
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/mpegvideoencdsp.h"
|
||||
|
||||
int ff_pix_norm1_armv6(uint8_t *pix, int line_size);
|
||||
int ff_pix_sum_armv6(uint8_t *pix, int line_size);
|
||||
|
||||
av_cold void ff_mpegvideoencdsp_init_arm(MpegvideoEncDSPContext *c,
|
||||
AVCodecContext *avctx)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
c->pix_norm1 = ff_pix_norm1_armv6;
|
||||
c->pix_sum = ff_pix_sum_armv6;
|
||||
}
|
||||
}
|
@ -0,0 +1,99 @@
|
||||
/*
|
||||
* check NEON registers for clobbers
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavutil/arm/neontest.h"
|
||||
|
||||
wrap(avcodec_open2(AVCodecContext *avctx,
|
||||
const AVCodec *codec,
|
||||
AVDictionary **options))
|
||||
{
|
||||
testneonclobbers(avcodec_open2, avctx, codec, options);
|
||||
}
|
||||
|
||||
wrap(avcodec_decode_audio4(AVCodecContext *avctx,
|
||||
AVFrame *frame,
|
||||
int *got_frame_ptr,
|
||||
AVPacket *avpkt))
|
||||
{
|
||||
testneonclobbers(avcodec_decode_audio4, avctx, frame,
|
||||
got_frame_ptr, avpkt);
|
||||
}
|
||||
|
||||
wrap(avcodec_decode_video2(AVCodecContext *avctx,
|
||||
AVFrame *picture,
|
||||
int *got_picture_ptr,
|
||||
AVPacket *avpkt))
|
||||
{
|
||||
testneonclobbers(avcodec_decode_video2, avctx, picture,
|
||||
got_picture_ptr, avpkt);
|
||||
}
|
||||
|
||||
wrap(avcodec_decode_subtitle2(AVCodecContext *avctx,
|
||||
AVSubtitle *sub,
|
||||
int *got_sub_ptr,
|
||||
AVPacket *avpkt))
|
||||
{
|
||||
testneonclobbers(avcodec_decode_subtitle2, avctx, sub,
|
||||
got_sub_ptr, avpkt);
|
||||
}
|
||||
|
||||
wrap(avcodec_encode_audio2(AVCodecContext *avctx,
|
||||
AVPacket *avpkt,
|
||||
const AVFrame *frame,
|
||||
int *got_packet_ptr))
|
||||
{
|
||||
testneonclobbers(avcodec_encode_audio2, avctx, avpkt, frame,
|
||||
got_packet_ptr);
|
||||
}
|
||||
|
||||
wrap(avcodec_encode_subtitle(AVCodecContext *avctx,
|
||||
uint8_t *buf, int buf_size,
|
||||
const AVSubtitle *sub))
|
||||
{
|
||||
testneonclobbers(avcodec_encode_subtitle, avctx, buf, buf_size, sub);
|
||||
}
|
||||
|
||||
wrap(avcodec_encode_video2(AVCodecContext *avctx, AVPacket *avpkt,
|
||||
const AVFrame *frame, int *got_packet_ptr))
|
||||
{
|
||||
testneonclobbers(avcodec_encode_video2, avctx, avpkt, frame, got_packet_ptr);
|
||||
}
|
||||
|
||||
wrap(avcodec_send_packet(AVCodecContext *avctx, const AVPacket *avpkt))
|
||||
{
|
||||
testneonclobbers(avcodec_send_packet, avctx, avpkt);
|
||||
}
|
||||
|
||||
wrap(avcodec_receive_packet(AVCodecContext *avctx, AVPacket *avpkt))
|
||||
{
|
||||
testneonclobbers(avcodec_receive_packet, avctx, avpkt);
|
||||
}
|
||||
|
||||
wrap(avcodec_send_frame(AVCodecContext *avctx, const AVFrame *frame))
|
||||
{
|
||||
testneonclobbers(avcodec_send_frame, avctx, frame);
|
||||
}
|
||||
|
||||
wrap(avcodec_receive_frame(AVCodecContext *avctx, AVFrame *frame))
|
||||
{
|
||||
testneonclobbers(avcodec_receive_frame, avctx, frame);
|
||||
}
|
@ -0,0 +1,43 @@
|
||||
/*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/pixblockdsp.h"
|
||||
|
||||
void ff_get_pixels_armv6(int16_t *block, const uint8_t *pixels,
|
||||
ptrdiff_t stride);
|
||||
void ff_diff_pixels_armv6(int16_t *block, const uint8_t *s1,
|
||||
const uint8_t *s2, ptrdiff_t stride);
|
||||
|
||||
av_cold void ff_pixblockdsp_init_arm(PixblockDSPContext *c,
|
||||
AVCodecContext *avctx,
|
||||
unsigned high_bit_depth)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
if (!high_bit_depth)
|
||||
c->get_pixels = ff_get_pixels_armv6;
|
||||
c->diff_pixels = ff_diff_pixels_armv6;
|
||||
}
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* 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/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#include "libavcodec/rdft.h"
|
||||
|
||||
void ff_rdft_calc_neon(struct RDFTContext *s, FFTSample *z);
|
||||
|
||||
av_cold void ff_rdft_init_arm(RDFTContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
s->rdft_calc = ff_rdft_calc_neon;
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
/*
|
||||
* Copyright (c) 2011 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/rv34dsp.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
void ff_rv34_inv_transform_noround_neon(int16_t *block);
|
||||
|
||||
void ff_rv34_inv_transform_noround_dc_neon(int16_t *block);
|
||||
|
||||
void ff_rv34_idct_add_neon(uint8_t *dst, ptrdiff_t stride, int16_t *block);
|
||||
void ff_rv34_idct_dc_add_neon(uint8_t *dst, ptrdiff_t stride, int dc);
|
||||
|
||||
av_cold void ff_rv34dsp_init_arm(RV34DSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->rv34_inv_transform = ff_rv34_inv_transform_noround_neon;
|
||||
c->rv34_inv_transform_dc = ff_rv34_inv_transform_noround_dc_neon;
|
||||
|
||||
c->rv34_idct_add = ff_rv34_idct_add_neon;
|
||||
c->rv34_idct_dc_add = ff_rv34_idct_dc_add_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,150 @@
|
||||
/*
|
||||
* Copyright (c) 2011 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/rv34dsp.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#define DECL_QPEL3(type, w, pos) \
|
||||
void ff_ ## type ## _rv40_qpel ## w ## _mc ## pos ## _neon(uint8_t *dst, \
|
||||
const uint8_t *src, \
|
||||
ptrdiff_t stride)
|
||||
|
||||
#define DECL_QPEL2(w, pos) \
|
||||
DECL_QPEL3(put, w, pos); \
|
||||
DECL_QPEL3(avg, w, pos)
|
||||
|
||||
#define DECL_QPEL_XY(x, y) \
|
||||
DECL_QPEL2(16, x ## y); \
|
||||
DECL_QPEL2(8, x ## y)
|
||||
|
||||
#define DECL_QPEL_Y(y) \
|
||||
DECL_QPEL_XY(0, y); \
|
||||
DECL_QPEL_XY(1, y); \
|
||||
DECL_QPEL_XY(2, y); \
|
||||
DECL_QPEL_XY(3, y); \
|
||||
|
||||
DECL_QPEL_Y(0);
|
||||
DECL_QPEL_Y(1);
|
||||
DECL_QPEL_Y(2);
|
||||
DECL_QPEL_Y(3);
|
||||
|
||||
void ff_put_rv40_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
void ff_put_rv40_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
|
||||
void ff_avg_rv40_chroma_mc8_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
void ff_avg_rv40_chroma_mc4_neon(uint8_t *, uint8_t *, int, int, int, int);
|
||||
|
||||
void ff_rv40_weight_func_16_neon(uint8_t *, uint8_t *, uint8_t *, int, int, ptrdiff_t);
|
||||
void ff_rv40_weight_func_8_neon(uint8_t *, uint8_t *, uint8_t *, int, int, ptrdiff_t);
|
||||
|
||||
int ff_rv40_h_loop_filter_strength_neon(uint8_t *src, ptrdiff_t stride,
|
||||
int beta, int beta2, int edge,
|
||||
int *p1, int *q1);
|
||||
int ff_rv40_v_loop_filter_strength_neon(uint8_t *src, ptrdiff_t stride,
|
||||
int beta, int beta2, int edge,
|
||||
int *p1, int *q1);
|
||||
|
||||
void ff_rv40_h_weak_loop_filter_neon(uint8_t *src, ptrdiff_t stride, int filter_p1,
|
||||
int filter_q1, int alpha, int beta,
|
||||
int lim_p0q0, int lim_q1, int lim_p1);
|
||||
void ff_rv40_v_weak_loop_filter_neon(uint8_t *src, ptrdiff_t stride, int filter_p1,
|
||||
int filter_q1, int alpha, int beta,
|
||||
int lim_p0q0, int lim_q1, int lim_p1);
|
||||
|
||||
static av_cold void rv40dsp_init_neon(RV34DSPContext *c)
|
||||
{
|
||||
c->put_pixels_tab[0][ 1] = ff_put_rv40_qpel16_mc10_neon;
|
||||
c->put_pixels_tab[0][ 3] = ff_put_rv40_qpel16_mc30_neon;
|
||||
c->put_pixels_tab[0][ 4] = ff_put_rv40_qpel16_mc01_neon;
|
||||
c->put_pixels_tab[0][ 5] = ff_put_rv40_qpel16_mc11_neon;
|
||||
c->put_pixels_tab[0][ 6] = ff_put_rv40_qpel16_mc21_neon;
|
||||
c->put_pixels_tab[0][ 7] = ff_put_rv40_qpel16_mc31_neon;
|
||||
c->put_pixels_tab[0][ 9] = ff_put_rv40_qpel16_mc12_neon;
|
||||
c->put_pixels_tab[0][10] = ff_put_rv40_qpel16_mc22_neon;
|
||||
c->put_pixels_tab[0][11] = ff_put_rv40_qpel16_mc32_neon;
|
||||
c->put_pixels_tab[0][12] = ff_put_rv40_qpel16_mc03_neon;
|
||||
c->put_pixels_tab[0][13] = ff_put_rv40_qpel16_mc13_neon;
|
||||
c->put_pixels_tab[0][14] = ff_put_rv40_qpel16_mc23_neon;
|
||||
c->put_pixels_tab[0][15] = ff_put_rv40_qpel16_mc33_neon;
|
||||
c->avg_pixels_tab[0][ 1] = ff_avg_rv40_qpel16_mc10_neon;
|
||||
c->avg_pixels_tab[0][ 3] = ff_avg_rv40_qpel16_mc30_neon;
|
||||
c->avg_pixels_tab[0][ 4] = ff_avg_rv40_qpel16_mc01_neon;
|
||||
c->avg_pixels_tab[0][ 5] = ff_avg_rv40_qpel16_mc11_neon;
|
||||
c->avg_pixels_tab[0][ 6] = ff_avg_rv40_qpel16_mc21_neon;
|
||||
c->avg_pixels_tab[0][ 7] = ff_avg_rv40_qpel16_mc31_neon;
|
||||
c->avg_pixels_tab[0][ 9] = ff_avg_rv40_qpel16_mc12_neon;
|
||||
c->avg_pixels_tab[0][10] = ff_avg_rv40_qpel16_mc22_neon;
|
||||
c->avg_pixels_tab[0][11] = ff_avg_rv40_qpel16_mc32_neon;
|
||||
c->avg_pixels_tab[0][12] = ff_avg_rv40_qpel16_mc03_neon;
|
||||
c->avg_pixels_tab[0][13] = ff_avg_rv40_qpel16_mc13_neon;
|
||||
c->avg_pixels_tab[0][14] = ff_avg_rv40_qpel16_mc23_neon;
|
||||
c->avg_pixels_tab[0][15] = ff_avg_rv40_qpel16_mc33_neon;
|
||||
c->put_pixels_tab[1][ 1] = ff_put_rv40_qpel8_mc10_neon;
|
||||
c->put_pixels_tab[1][ 3] = ff_put_rv40_qpel8_mc30_neon;
|
||||
c->put_pixels_tab[1][ 4] = ff_put_rv40_qpel8_mc01_neon;
|
||||
c->put_pixels_tab[1][ 5] = ff_put_rv40_qpel8_mc11_neon;
|
||||
c->put_pixels_tab[1][ 6] = ff_put_rv40_qpel8_mc21_neon;
|
||||
c->put_pixels_tab[1][ 7] = ff_put_rv40_qpel8_mc31_neon;
|
||||
c->put_pixels_tab[1][ 9] = ff_put_rv40_qpel8_mc12_neon;
|
||||
c->put_pixels_tab[1][10] = ff_put_rv40_qpel8_mc22_neon;
|
||||
c->put_pixels_tab[1][11] = ff_put_rv40_qpel8_mc32_neon;
|
||||
c->put_pixels_tab[1][12] = ff_put_rv40_qpel8_mc03_neon;
|
||||
c->put_pixels_tab[1][13] = ff_put_rv40_qpel8_mc13_neon;
|
||||
c->put_pixels_tab[1][14] = ff_put_rv40_qpel8_mc23_neon;
|
||||
c->put_pixels_tab[1][15] = ff_put_rv40_qpel8_mc33_neon;
|
||||
c->avg_pixels_tab[1][ 1] = ff_avg_rv40_qpel8_mc10_neon;
|
||||
c->avg_pixels_tab[1][ 3] = ff_avg_rv40_qpel8_mc30_neon;
|
||||
c->avg_pixels_tab[1][ 4] = ff_avg_rv40_qpel8_mc01_neon;
|
||||
c->avg_pixels_tab[1][ 5] = ff_avg_rv40_qpel8_mc11_neon;
|
||||
c->avg_pixels_tab[1][ 6] = ff_avg_rv40_qpel8_mc21_neon;
|
||||
c->avg_pixels_tab[1][ 7] = ff_avg_rv40_qpel8_mc31_neon;
|
||||
c->avg_pixels_tab[1][ 9] = ff_avg_rv40_qpel8_mc12_neon;
|
||||
c->avg_pixels_tab[1][10] = ff_avg_rv40_qpel8_mc22_neon;
|
||||
c->avg_pixels_tab[1][11] = ff_avg_rv40_qpel8_mc32_neon;
|
||||
c->avg_pixels_tab[1][12] = ff_avg_rv40_qpel8_mc03_neon;
|
||||
c->avg_pixels_tab[1][13] = ff_avg_rv40_qpel8_mc13_neon;
|
||||
c->avg_pixels_tab[1][14] = ff_avg_rv40_qpel8_mc23_neon;
|
||||
c->avg_pixels_tab[1][15] = ff_avg_rv40_qpel8_mc33_neon;
|
||||
|
||||
c->put_chroma_pixels_tab[0] = ff_put_rv40_chroma_mc8_neon;
|
||||
c->put_chroma_pixels_tab[1] = ff_put_rv40_chroma_mc4_neon;
|
||||
c->avg_chroma_pixels_tab[0] = ff_avg_rv40_chroma_mc8_neon;
|
||||
c->avg_chroma_pixels_tab[1] = ff_avg_rv40_chroma_mc4_neon;
|
||||
|
||||
c->rv40_weight_pixels_tab[0][0] = ff_rv40_weight_func_16_neon;
|
||||
c->rv40_weight_pixels_tab[0][1] = ff_rv40_weight_func_8_neon;
|
||||
|
||||
c->rv40_loop_filter_strength[0] = ff_rv40_h_loop_filter_strength_neon;
|
||||
c->rv40_loop_filter_strength[1] = ff_rv40_v_loop_filter_strength_neon;
|
||||
c->rv40_weak_loop_filter[0] = ff_rv40_h_weak_loop_filter_neon;
|
||||
c->rv40_weak_loop_filter[1] = ff_rv40_v_weak_loop_filter_neon;
|
||||
}
|
||||
|
||||
av_cold void ff_rv40dsp_init_arm(RV34DSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
rv40dsp_init_neon(c);
|
||||
}
|
@ -0,0 +1,105 @@
|
||||
/*
|
||||
* Bluetooth low-complexity, subband codec (SBC)
|
||||
*
|
||||
* Copyright (C) 2017 Aurelien Jacobs <aurel@gnuage.org>
|
||||
* Copyright (C) 2008-2010 Nokia Corporation
|
||||
* Copyright (C) 2004-2010 Marcel Holtmann <marcel@holtmann.org>
|
||||
* Copyright (C) 2004-2005 Henryk Ploetz <henryk@ploetzli.ch>
|
||||
* Copyright (C) 2005-2006 Brad Midgley <bmidgley@xmission.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
|
||||
*/
|
||||
|
||||
/**
|
||||
* @file
|
||||
* SBC ARMv6 optimization for some basic "building bricks"
|
||||
*/
|
||||
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/sbcdsp.h"
|
||||
|
||||
void ff_sbc_analyze_4_armv6(const int16_t *in, int32_t *out, const int16_t *consts);
|
||||
void ff_sbc_analyze_8_armv6(const int16_t *in, int32_t *out, const int16_t *consts);
|
||||
|
||||
void ff_sbc_analyze_4_neon(const int16_t *in, int32_t *out, const int16_t *consts);
|
||||
void ff_sbc_analyze_8_neon(const int16_t *in, int32_t *out, const int16_t *consts);
|
||||
void ff_sbc_calc_scalefactors_neon(int32_t sb_sample_f[16][2][8],
|
||||
uint32_t scale_factor[2][8],
|
||||
int blocks, int channels, int subbands);
|
||||
int ff_sbc_calc_scalefactors_j_neon(int32_t sb_sample_f[16][2][8],
|
||||
uint32_t scale_factor[2][8],
|
||||
int blocks, int subbands);
|
||||
int ff_sbc_enc_process_input_4s_neon(int position, const uint8_t *pcm,
|
||||
int16_t X[2][SBC_X_BUFFER_SIZE],
|
||||
int nsamples, int nchannels);
|
||||
int ff_sbc_enc_process_input_8s_neon(int position, const uint8_t *pcm,
|
||||
int16_t X[2][SBC_X_BUFFER_SIZE],
|
||||
int nsamples, int nchannels);
|
||||
|
||||
DECLARE_ALIGNED(SBC_ALIGN, int32_t, ff_sbcdsp_joint_bits_mask)[8] = {
|
||||
8, 4, 2, 1, 128, 64, 32, 16
|
||||
};
|
||||
|
||||
#if HAVE_BIGENDIAN
|
||||
#define PERM(a, b, c, d) { \
|
||||
(a * 2) + 1, (a * 2) + 0, \
|
||||
(b * 2) + 1, (b * 2) + 0, \
|
||||
(c * 2) + 1, (c * 2) + 0, \
|
||||
(d * 2) + 1, (d * 2) + 0 \
|
||||
}
|
||||
#else
|
||||
#define PERM(a, b, c, d) { \
|
||||
(a * 2) + 0, (a * 2) + 1, \
|
||||
(b * 2) + 0, (b * 2) + 1, \
|
||||
(c * 2) + 0, (c * 2) + 1, \
|
||||
(d * 2) + 0, (d * 2) + 1 \
|
||||
}
|
||||
#endif
|
||||
|
||||
DECLARE_ALIGNED(SBC_ALIGN, uint8_t, ff_sbc_input_perm_4)[2][8] = {
|
||||
PERM(7, 3, 6, 4),
|
||||
PERM(0, 2, 1, 5)
|
||||
};
|
||||
|
||||
DECLARE_ALIGNED(SBC_ALIGN, uint8_t, ff_sbc_input_perm_8)[4][8] = {
|
||||
PERM(15, 7, 14, 8),
|
||||
PERM(13, 9, 12, 10),
|
||||
PERM(11, 3, 6, 0),
|
||||
PERM( 5, 1, 4, 2)
|
||||
};
|
||||
|
||||
av_cold void ff_sbcdsp_init_arm(SBCDSPContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
s->sbc_analyze_4 = ff_sbc_analyze_4_armv6;
|
||||
s->sbc_analyze_8 = ff_sbc_analyze_8_armv6;
|
||||
}
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->sbc_analyze_4 = ff_sbc_analyze_4_neon;
|
||||
s->sbc_analyze_8 = ff_sbc_analyze_8_neon;
|
||||
s->sbc_calc_scalefactors = ff_sbc_calc_scalefactors_neon;
|
||||
s->sbc_calc_scalefactors_j = ff_sbc_calc_scalefactors_j_neon;
|
||||
if (s->increment != 1) {
|
||||
s->sbc_enc_process_input_4s = ff_sbc_enc_process_input_4s_neon;
|
||||
s->sbc_enc_process_input_8s = ff_sbc_enc_process_input_8s_neon;
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,73 @@
|
||||
/*
|
||||
* Copyright (c) 2012 Mans Rullgard
|
||||
*
|
||||
* 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 "config.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/sbrdsp.h"
|
||||
|
||||
void ff_sbr_sum64x5_neon(float *z);
|
||||
float ff_sbr_sum_square_neon(float (*x)[2], int n);
|
||||
void ff_sbr_neg_odd_64_neon(float *x);
|
||||
void ff_sbr_qmf_pre_shuffle_neon(float *z);
|
||||
void ff_sbr_qmf_post_shuffle_neon(float W[32][2], const float *z);
|
||||
void ff_sbr_qmf_deint_neg_neon(float *v, const float *src);
|
||||
void ff_sbr_qmf_deint_bfly_neon(float *v, const float *src0, const float *src1);
|
||||
void ff_sbr_hf_g_filt_neon(float (*Y)[2], const float (*X_high)[40][2],
|
||||
const float *g_filt, int m_max, intptr_t ixh);
|
||||
void ff_sbr_hf_gen_neon(float (*X_high)[2], const float (*X_low)[2],
|
||||
const float alpha0[2], const float alpha1[2],
|
||||
float bw, int start, int end);
|
||||
void ff_sbr_autocorrelate_neon(const float x[40][2], float phi[3][2][2]);
|
||||
|
||||
void ff_sbr_hf_apply_noise_0_neon(float Y[64][2], const float *s_m,
|
||||
const float *q_filt, int noise,
|
||||
int kx, int m_max);
|
||||
void ff_sbr_hf_apply_noise_1_neon(float Y[64][2], const float *s_m,
|
||||
const float *q_filt, int noise,
|
||||
int kx, int m_max);
|
||||
void ff_sbr_hf_apply_noise_2_neon(float Y[64][2], const float *s_m,
|
||||
const float *q_filt, int noise,
|
||||
int kx, int m_max);
|
||||
void ff_sbr_hf_apply_noise_3_neon(float Y[64][2], const float *s_m,
|
||||
const float *q_filt, int noise,
|
||||
int kx, int m_max);
|
||||
|
||||
av_cold void ff_sbrdsp_init_arm(SBRDSPContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->sum64x5 = ff_sbr_sum64x5_neon;
|
||||
s->sum_square = ff_sbr_sum_square_neon;
|
||||
s->neg_odd_64 = ff_sbr_neg_odd_64_neon;
|
||||
s->qmf_pre_shuffle = ff_sbr_qmf_pre_shuffle_neon;
|
||||
s->qmf_post_shuffle = ff_sbr_qmf_post_shuffle_neon;
|
||||
s->qmf_deint_neg = ff_sbr_qmf_deint_neg_neon;
|
||||
s->qmf_deint_bfly = ff_sbr_qmf_deint_bfly_neon;
|
||||
s->hf_g_filt = ff_sbr_hf_g_filt_neon;
|
||||
s->hf_gen = ff_sbr_hf_gen_neon;
|
||||
s->autocorrelate = ff_sbr_autocorrelate_neon;
|
||||
s->hf_apply_noise[0] = ff_sbr_hf_apply_noise_0_neon;
|
||||
s->hf_apply_noise[1] = ff_sbr_hf_apply_noise_1_neon;
|
||||
s->hf_apply_noise[2] = ff_sbr_hf_apply_noise_2_neon;
|
||||
s->hf_apply_noise[3] = ff_sbr_hf_apply_noise_3_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_STARTCODE_H
|
||||
#define AVCODEC_ARM_STARTCODE_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
int ff_startcode_find_candidate_armv6(const uint8_t *buf, int size);
|
||||
|
||||
#endif /* AVCODEC_ARM_STARTCODE_H */
|
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/internal.h"
|
||||
#include "libavcodec/fft.h"
|
||||
#include "libavcodec/synth_filter.h"
|
||||
|
||||
void ff_synth_filter_float_vfp(FFTContext *imdct,
|
||||
float *synth_buf_ptr, int *synth_buf_offset,
|
||||
float synth_buf2[32], const float window[512],
|
||||
float out[32], const float in[32],
|
||||
float scale);
|
||||
|
||||
void ff_synth_filter_float_neon(FFTContext *imdct,
|
||||
float *synth_buf_ptr, int *synth_buf_offset,
|
||||
float synth_buf2[32], const float window[512],
|
||||
float out[32], const float in[32],
|
||||
float scale);
|
||||
|
||||
av_cold void ff_synth_filter_init_arm(SynthFilterContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_vfp_vm(cpu_flags))
|
||||
s->synth_filter_float = ff_synth_filter_float_vfp;
|
||||
if (have_neon(cpu_flags))
|
||||
s->synth_filter_float = ff_synth_filter_float_neon;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_VC1DSP_H
|
||||
#define AVCODEC_ARM_VC1DSP_H
|
||||
|
||||
#include "libavcodec/vc1dsp.h"
|
||||
|
||||
void ff_vc1dsp_init_neon(VC1DSPContext *dsp);
|
||||
|
||||
#endif /* AVCODEC_ARM_VC1DSP_H */
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/arm/startcode.h"
|
||||
#include "libavcodec/vc1dsp.h"
|
||||
#include "vc1dsp.h"
|
||||
|
||||
av_cold void ff_vc1dsp_init_arm(VC1DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
#if HAVE_ARMV6
|
||||
if (have_setend(cpu_flags))
|
||||
dsp->startcode_find_candidate = ff_startcode_find_candidate_armv6;
|
||||
#endif
|
||||
if (have_neon(cpu_flags))
|
||||
ff_vc1dsp_init_neon(dsp);
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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 "libavcodec/vc1dsp.h"
|
||||
#include "vc1dsp.h"
|
||||
|
||||
void ff_vc1_inv_trans_8x8_neon(int16_t *block);
|
||||
void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
|
||||
void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, ptrdiff_t stride, int16_t *block);
|
||||
|
||||
void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels,
|
||||
ptrdiff_t line_size, int rnd);
|
||||
|
||||
#define DECL_PUT(X, Y) \
|
||||
void ff_put_vc1_mspel_mc##X##Y##_neon(uint8_t *dst, const uint8_t *src, \
|
||||
ptrdiff_t stride, int rnd); \
|
||||
static void ff_put_vc1_mspel_mc##X##Y##_16_neon(uint8_t *dst, const uint8_t *src, \
|
||||
ptrdiff_t stride, int rnd) \
|
||||
{ \
|
||||
ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
|
||||
ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
|
||||
dst += 8*stride; src += 8*stride; \
|
||||
ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
|
||||
ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
|
||||
}
|
||||
|
||||
DECL_PUT(1, 0)
|
||||
DECL_PUT(2, 0)
|
||||
DECL_PUT(3, 0)
|
||||
|
||||
DECL_PUT(0, 1)
|
||||
DECL_PUT(0, 2)
|
||||
DECL_PUT(0, 3)
|
||||
|
||||
DECL_PUT(1, 1)
|
||||
DECL_PUT(1, 2)
|
||||
DECL_PUT(1, 3)
|
||||
|
||||
DECL_PUT(2, 1)
|
||||
DECL_PUT(2, 2)
|
||||
DECL_PUT(2, 3)
|
||||
|
||||
DECL_PUT(3, 1)
|
||||
DECL_PUT(3, 2)
|
||||
DECL_PUT(3, 3)
|
||||
|
||||
void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, ptrdiff_t stride,
|
||||
int h, int x, int y);
|
||||
|
||||
#define FN_ASSIGN(X, Y) \
|
||||
dsp->put_vc1_mspel_pixels_tab[0][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_16_neon; \
|
||||
dsp->put_vc1_mspel_pixels_tab[1][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_neon
|
||||
|
||||
av_cold void ff_vc1dsp_init_neon(VC1DSPContext *dsp)
|
||||
{
|
||||
dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_neon;
|
||||
dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_neon;
|
||||
dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_neon;
|
||||
dsp->vc1_inv_trans_4x4 = ff_vc1_inv_trans_4x4_neon;
|
||||
dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_neon;
|
||||
dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_neon;
|
||||
dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_neon;
|
||||
dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_neon;
|
||||
|
||||
dsp->put_vc1_mspel_pixels_tab[1][ 0] = ff_put_pixels8x8_neon;
|
||||
FN_ASSIGN(1, 0);
|
||||
FN_ASSIGN(2, 0);
|
||||
FN_ASSIGN(3, 0);
|
||||
|
||||
FN_ASSIGN(0, 1);
|
||||
FN_ASSIGN(1, 1);
|
||||
FN_ASSIGN(2, 1);
|
||||
FN_ASSIGN(3, 1);
|
||||
|
||||
FN_ASSIGN(0, 2);
|
||||
FN_ASSIGN(1, 2);
|
||||
FN_ASSIGN(2, 2);
|
||||
FN_ASSIGN(3, 2);
|
||||
|
||||
FN_ASSIGN(0, 3);
|
||||
FN_ASSIGN(1, 3);
|
||||
FN_ASSIGN(2, 3);
|
||||
FN_ASSIGN(3, 3);
|
||||
|
||||
dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_neon;
|
||||
dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_neon;
|
||||
dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_vc1_chroma_mc4_neon;
|
||||
dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_vc1_chroma_mc4_neon;
|
||||
}
|
@ -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 AVCODEC_ARM_VIDEODSP_ARM_H
|
||||
#define AVCODEC_ARM_VIDEODSP_ARM_H
|
||||
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/videodsp.h"
|
||||
|
||||
void ff_videodsp_init_armv5te(VideoDSPContext* ctx, int bpc);
|
||||
|
||||
#endif /* AVCODEC_ARM_VIDEODSP_ARM_H */
|
@ -0,0 +1,30 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Ronald S. Bultje
|
||||
*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/videodsp.h"
|
||||
#include "videodsp_arm.h"
|
||||
|
||||
av_cold void ff_videodsp_init_arm(VideoDSPContext *ctx, int bpc)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
if (have_armv5te(cpu_flags)) ff_videodsp_init_armv5te(ctx, bpc);
|
||||
}
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* Copyright (C) 2012 Ronald S. Bultje
|
||||
*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/videodsp.h"
|
||||
#include "videodsp_arm.h"
|
||||
|
||||
void ff_prefetch_arm(uint8_t *mem, ptrdiff_t stride, int h);
|
||||
|
||||
av_cold void ff_videodsp_init_armv5te(VideoDSPContext *ctx, int bpc)
|
||||
{
|
||||
#if HAVE_ARMV5TE_EXTERNAL
|
||||
ctx->prefetch = ff_prefetch_arm;
|
||||
#endif
|
||||
}
|
@ -0,0 +1,37 @@
|
||||
/*
|
||||
* ARM NEON optimised 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 "libavutil/attributes.h"
|
||||
#include "libavutil/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/vorbisdsp.h"
|
||||
|
||||
void ff_vorbis_inverse_coupling_neon(float *mag, float *ang,
|
||||
intptr_t blocksize);
|
||||
|
||||
av_cold void ff_vorbisdsp_init_arm(VorbisDSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->vorbis_inverse_coupling = ff_vorbis_inverse_coupling_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/vp3dsp.h"
|
||||
|
||||
void ff_vp3_idct_put_neon(uint8_t *dest, ptrdiff_t stride, int16_t *data);
|
||||
void ff_vp3_idct_add_neon(uint8_t *dest, ptrdiff_t stride, int16_t *data);
|
||||
void ff_vp3_idct_dc_add_neon(uint8_t *dest, ptrdiff_t stride, int16_t *data);
|
||||
|
||||
void ff_vp3_v_loop_filter_neon(uint8_t *, int, int *);
|
||||
void ff_vp3_h_loop_filter_neon(uint8_t *, int, int *);
|
||||
|
||||
av_cold void ff_vp3dsp_init_arm(VP3DSPContext *c, int flags)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->idct_put = ff_vp3_idct_put_neon;
|
||||
c->idct_add = ff_vp3_idct_add_neon;
|
||||
c->idct_dc_add = ff_vp3_idct_dc_add_neon;
|
||||
c->v_loop_filter = ff_vp3_v_loop_filter_neon;
|
||||
c->h_loop_filter = ff_vp3_h_loop_filter_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,121 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_VP56_ARITH_H
|
||||
#define AVCODEC_ARM_VP56_ARITH_H
|
||||
|
||||
#if CONFIG_THUMB
|
||||
# define A(x)
|
||||
# define T(x) x
|
||||
#else
|
||||
# define A(x) x
|
||||
# define T(x)
|
||||
#endif
|
||||
|
||||
#if CONFIG_THUMB || defined __clang__
|
||||
# define L(x)
|
||||
# define U(x) x
|
||||
#else
|
||||
# define L(x) x
|
||||
# define U(x)
|
||||
#endif
|
||||
|
||||
#if HAVE_ARMV6_INLINE
|
||||
|
||||
#define vp56_rac_get_prob vp56_rac_get_prob_armv6
|
||||
static inline int vp56_rac_get_prob_armv6(VP56RangeCoder *c, int pr)
|
||||
{
|
||||
unsigned shift = ff_vp56_norm_shift[c->high];
|
||||
unsigned code_word = c->code_word << shift;
|
||||
unsigned high = c->high << shift;
|
||||
unsigned bit;
|
||||
|
||||
__asm__ ("adds %3, %3, %0 \n"
|
||||
"itt cs \n"
|
||||
"cmpcs %7, %4 \n"
|
||||
L("ldrcsh %2, [%4], #2 \n")
|
||||
U("ldrhcs %2, [%4], #2 \n")
|
||||
"rsb %0, %6, #256 \n"
|
||||
"smlabb %0, %5, %6, %0 \n"
|
||||
T("itttt cs \n")
|
||||
"rev16cs %2, %2 \n"
|
||||
T("lslcs %2, %2, %3 \n")
|
||||
T("orrcs %1, %1, %2 \n")
|
||||
A("orrcs %1, %1, %2, lsl %3 \n")
|
||||
"subcs %3, %3, #16 \n"
|
||||
"lsr %0, %0, #8 \n"
|
||||
"cmp %1, %0, lsl #16 \n"
|
||||
"ittte ge \n"
|
||||
"subge %1, %1, %0, lsl #16 \n"
|
||||
"subge %0, %5, %0 \n"
|
||||
"movge %2, #1 \n"
|
||||
"movlt %2, #0 \n"
|
||||
: "=&r"(c->high), "=&r"(c->code_word), "=&r"(bit),
|
||||
"+&r"(c->bits), "+&r"(c->buffer)
|
||||
: "r"(high), "r"(pr), "r"(c->end - 1),
|
||||
"0"(shift), "1"(code_word)
|
||||
: "cc");
|
||||
|
||||
return bit;
|
||||
}
|
||||
|
||||
#define vp56_rac_get_prob_branchy vp56_rac_get_prob_branchy_armv6
|
||||
static inline int vp56_rac_get_prob_branchy_armv6(VP56RangeCoder *c, int pr)
|
||||
{
|
||||
unsigned shift = ff_vp56_norm_shift[c->high];
|
||||
unsigned code_word = c->code_word << shift;
|
||||
unsigned high = c->high << shift;
|
||||
unsigned low;
|
||||
unsigned tmp;
|
||||
|
||||
__asm__ ("adds %3, %3, %0 \n"
|
||||
"itt cs \n"
|
||||
"cmpcs %7, %4 \n"
|
||||
L("ldrcsh %2, [%4], #2 \n")
|
||||
U("ldrhcs %2, [%4], #2 \n")
|
||||
"rsb %0, %6, #256 \n"
|
||||
"smlabb %0, %5, %6, %0 \n"
|
||||
T("itttt cs \n")
|
||||
"rev16cs %2, %2 \n"
|
||||
T("lslcs %2, %2, %3 \n")
|
||||
T("orrcs %1, %1, %2 \n")
|
||||
A("orrcs %1, %1, %2, lsl %3 \n")
|
||||
"subcs %3, %3, #16 \n"
|
||||
"lsr %0, %0, #8 \n"
|
||||
"lsl %2, %0, #16 \n"
|
||||
: "=&r"(low), "+&r"(code_word), "=&r"(tmp),
|
||||
"+&r"(c->bits), "+&r"(c->buffer)
|
||||
: "r"(high), "r"(pr), "r"(c->end - 1), "0"(shift)
|
||||
: "cc");
|
||||
|
||||
if (code_word >= tmp) {
|
||||
c->high = high - low;
|
||||
c->code_word = code_word - tmp;
|
||||
return 1;
|
||||
}
|
||||
|
||||
c->high = low;
|
||||
c->code_word = code_word;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_ARM_VP56_ARITH_H */
|
@ -0,0 +1,39 @@
|
||||
/*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#include "libavcodec/vp56dsp.h"
|
||||
|
||||
void ff_vp6_edge_filter_hor_neon(uint8_t *yuv, ptrdiff_t stride, int t);
|
||||
void ff_vp6_edge_filter_ver_neon(uint8_t *yuv, ptrdiff_t stride, int t);
|
||||
|
||||
av_cold void ff_vp6dsp_init_arm(VP56DSPContext *s)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->edge_filter_hor = ff_vp6_edge_filter_hor_neon;
|
||||
s->edge_filter_ver = ff_vp6_edge_filter_ver_neon;
|
||||
}
|
||||
}
|
@ -0,0 +1,35 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_VP8_H
|
||||
#define AVCODEC_ARM_VP8_H
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "config.h"
|
||||
#include "libavcodec/vp56.h"
|
||||
#include "libavcodec/vp8.h"
|
||||
|
||||
#if HAVE_ARMV6_EXTERNAL
|
||||
#define vp8_decode_block_coeffs_internal ff_decode_block_coeffs_armv6
|
||||
int ff_decode_block_coeffs_armv6(VP56RangeCoder *rc, int16_t block[16],
|
||||
uint8_t probs[8][3][NUM_DCT_TOKENS-1],
|
||||
int i, uint8_t *token_prob, int16_t qmul[2]);
|
||||
#endif
|
||||
|
||||
#endif /* AVCODEC_ARM_VP8_H */
|
@ -0,0 +1,80 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_VP8DSP_H
|
||||
#define AVCODEC_ARM_VP8DSP_H
|
||||
|
||||
#include "libavcodec/vp8dsp.h"
|
||||
|
||||
void ff_vp78dsp_init_armv6(VP8DSPContext *dsp);
|
||||
void ff_vp78dsp_init_neon(VP8DSPContext *dsp);
|
||||
void ff_vp8dsp_init_armv6(VP8DSPContext *dsp);
|
||||
void ff_vp8dsp_init_neon(VP8DSPContext *dsp);
|
||||
|
||||
#define VP8_LF_Y(hv, inner, opt) \
|
||||
void ff_vp8_##hv##_loop_filter16##inner##_##opt(uint8_t *dst, \
|
||||
ptrdiff_t stride, \
|
||||
int flim_E, int flim_I, \
|
||||
int hev_thresh)
|
||||
|
||||
#define VP8_LF_UV(hv, inner, opt) \
|
||||
void ff_vp8_##hv##_loop_filter8uv##inner##_##opt(uint8_t *dstU, \
|
||||
uint8_t *dstV, \
|
||||
ptrdiff_t stride, \
|
||||
int flim_E, int flim_I, \
|
||||
int hev_thresh)
|
||||
|
||||
#define VP8_LF_SIMPLE(hv, opt) \
|
||||
void ff_vp8_##hv##_loop_filter16_simple_##opt(uint8_t *dst, \
|
||||
ptrdiff_t stride, \
|
||||
int flim)
|
||||
|
||||
#define VP8_LF_HV(inner, opt) \
|
||||
VP8_LF_Y(h, inner, opt); \
|
||||
VP8_LF_Y(v, inner, opt); \
|
||||
VP8_LF_UV(h, inner, opt); \
|
||||
VP8_LF_UV(v, inner, opt)
|
||||
|
||||
#define VP8_LF(opt) \
|
||||
VP8_LF_HV(, opt); \
|
||||
VP8_LF_HV(_inner, opt); \
|
||||
VP8_LF_SIMPLE(h, opt); \
|
||||
VP8_LF_SIMPLE(v, opt)
|
||||
|
||||
#define VP8_MC(n, opt) \
|
||||
void ff_put_vp8_##n##_##opt(uint8_t *dst, ptrdiff_t dststride, \
|
||||
uint8_t *src, ptrdiff_t srcstride, \
|
||||
int h, int x, int y)
|
||||
|
||||
#define VP8_EPEL(w, opt) \
|
||||
VP8_MC(pixels ## w, opt); \
|
||||
VP8_MC(epel ## w ## _h4, opt); \
|
||||
VP8_MC(epel ## w ## _h6, opt); \
|
||||
VP8_MC(epel ## w ## _v4, opt); \
|
||||
VP8_MC(epel ## w ## _h4v4, opt); \
|
||||
VP8_MC(epel ## w ## _h6v4, opt); \
|
||||
VP8_MC(epel ## w ## _v6, opt); \
|
||||
VP8_MC(epel ## w ## _h4v6, opt); \
|
||||
VP8_MC(epel ## w ## _h6v6, opt)
|
||||
|
||||
#define VP8_BILIN(w, opt) \
|
||||
VP8_MC(bilin ## w ## _h, opt); \
|
||||
VP8_MC(bilin ## w ## _v, opt); \
|
||||
VP8_MC(bilin ## w ## _hv, opt)
|
||||
|
||||
#endif /* AVCODEC_ARM_VP8DSP_H */
|
@ -0,0 +1,44 @@
|
||||
/*
|
||||
* 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/arm/cpu.h"
|
||||
#include "libavcodec/vp8dsp.h"
|
||||
#include "vp8dsp.h"
|
||||
|
||||
av_cold void ff_vp78dsp_init_arm(VP8DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags))
|
||||
ff_vp78dsp_init_armv6(dsp);
|
||||
if (have_neon(cpu_flags))
|
||||
ff_vp78dsp_init_neon(dsp);
|
||||
}
|
||||
|
||||
av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags))
|
||||
ff_vp8dsp_init_armv6(dsp);
|
||||
if (have_neon(cpu_flags))
|
||||
ff_vp8dsp_init_neon(dsp);
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
/*
|
||||
* 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 "libavcodec/vp8dsp.h"
|
||||
#include "vp8dsp.h"
|
||||
|
||||
void ff_vp8_luma_dc_wht_armv6(int16_t block[4][4][16], int16_t dc[16]);
|
||||
void ff_vp8_luma_dc_wht_dc_armv6(int16_t block[4][4][16], int16_t dc[16]);
|
||||
|
||||
void ff_vp8_idct_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
|
||||
void ff_vp8_idct_dc_add_armv6(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
|
||||
void ff_vp8_idct_dc_add4y_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
|
||||
void ff_vp8_idct_dc_add4uv_armv6(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
|
||||
|
||||
VP8_LF(armv6);
|
||||
|
||||
VP8_EPEL(16, armv6);
|
||||
VP8_EPEL(8, armv6);
|
||||
VP8_EPEL(4, armv6);
|
||||
|
||||
VP8_BILIN(16, armv6);
|
||||
VP8_BILIN(8, armv6);
|
||||
VP8_BILIN(4, armv6);
|
||||
|
||||
av_cold void ff_vp78dsp_init_armv6(VP8DSPContext *dsp)
|
||||
{
|
||||
dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_armv6;
|
||||
|
||||
dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_armv6;
|
||||
|
||||
dsp->put_vp8_epel_pixels_tab[2][0][0] = ff_put_vp8_pixels4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_armv6;
|
||||
dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_armv6;
|
||||
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilin16_h_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilin16_h_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilin16_v_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilin16_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilin16_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilin16_v_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilin16_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilin16_hv_armv6;
|
||||
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilin8_h_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilin8_v_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilin8_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilin8_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilin8_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilin8_hv_armv6;
|
||||
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][0][0] = ff_put_vp8_pixels4_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilin4_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilin4_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_armv6;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_armv6;
|
||||
}
|
||||
|
||||
av_cold void ff_vp8dsp_init_armv6(VP8DSPContext *dsp)
|
||||
{
|
||||
dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_armv6;
|
||||
dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_armv6;
|
||||
|
||||
dsp->vp8_idct_add = ff_vp8_idct_add_armv6;
|
||||
dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_armv6;
|
||||
dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_armv6;
|
||||
dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_armv6;
|
||||
|
||||
dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_armv6;
|
||||
dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_armv6;
|
||||
dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_armv6;
|
||||
dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_armv6;
|
||||
|
||||
dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_armv6;
|
||||
dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_armv6;
|
||||
dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_armv6;
|
||||
dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_armv6;
|
||||
|
||||
dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_armv6;
|
||||
dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_armv6;
|
||||
}
|
@ -0,0 +1,119 @@
|
||||
/*
|
||||
* 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 "libavcodec/vp8dsp.h"
|
||||
#include "vp8dsp.h"
|
||||
|
||||
void ff_vp8_luma_dc_wht_neon(int16_t block[4][4][16], int16_t dc[16]);
|
||||
|
||||
void ff_vp8_idct_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
|
||||
void ff_vp8_idct_dc_add_neon(uint8_t *dst, int16_t block[16], ptrdiff_t stride);
|
||||
void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
|
||||
void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, int16_t block[4][16], ptrdiff_t stride);
|
||||
|
||||
VP8_LF(neon);
|
||||
|
||||
VP8_EPEL(16, neon);
|
||||
VP8_EPEL(8, neon);
|
||||
VP8_EPEL(4, neon);
|
||||
|
||||
VP8_BILIN(16, neon);
|
||||
VP8_BILIN(8, neon);
|
||||
VP8_BILIN(4, neon);
|
||||
|
||||
av_cold void ff_vp78dsp_init_neon(VP8DSPContext *dsp)
|
||||
{
|
||||
dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_neon;
|
||||
|
||||
dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_neon;
|
||||
|
||||
dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_neon;
|
||||
dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_neon;
|
||||
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilin16_h_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilin16_h_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilin16_v_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilin16_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilin16_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilin16_v_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilin16_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilin16_hv_neon;
|
||||
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilin8_h_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilin8_v_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilin8_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilin8_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilin8_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilin8_hv_neon;
|
||||
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilin4_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilin4_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_neon;
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_neon;
|
||||
}
|
||||
|
||||
av_cold void ff_vp8dsp_init_neon(VP8DSPContext *dsp)
|
||||
{
|
||||
dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_neon;
|
||||
|
||||
dsp->vp8_idct_add = ff_vp8_idct_add_neon;
|
||||
dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_neon;
|
||||
dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_neon;
|
||||
dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon;
|
||||
|
||||
dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon;
|
||||
dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon;
|
||||
dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon;
|
||||
dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon;
|
||||
|
||||
dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon;
|
||||
dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon;
|
||||
dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon;
|
||||
dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon;
|
||||
|
||||
dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon;
|
||||
dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon;
|
||||
}
|
@ -0,0 +1,29 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Google Inc.
|
||||
*
|
||||
* 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 AVCODEC_ARM_VP9DSP_INIT_H
|
||||
#define AVCODEC_ARM_VP9DSP_INIT_H
|
||||
|
||||
#include "libavcodec/vp9dsp.h"
|
||||
|
||||
void ff_vp9dsp_init_10bpp_arm(VP9DSPContext *dsp);
|
||||
void ff_vp9dsp_init_12bpp_arm(VP9DSPContext *dsp);
|
||||
|
||||
#endif /* AVCODEC_ARM_VP9DSP_INIT_H */
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Google Inc.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define BPP 10
|
||||
#define INIT_FUNC ff_vp9dsp_init_10bpp_arm
|
||||
#include "vp9dsp_init_16bpp_arm_template.c"
|
@ -0,0 +1,23 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Google Inc.
|
||||
*
|
||||
* 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
|
||||
*/
|
||||
|
||||
#define BPP 12
|
||||
#define INIT_FUNC ff_vp9dsp_init_12bpp_arm
|
||||
#include "vp9dsp_init_16bpp_arm_template.c"
|
@ -0,0 +1,257 @@
|
||||
/*
|
||||
* Copyright (c) 2017 Google Inc.
|
||||
*
|
||||
* 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/internal.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "vp9dsp_init.h"
|
||||
|
||||
#define declare_fpel(type, sz, suffix) \
|
||||
void ff_vp9_##type##sz##suffix##_neon(uint8_t *dst, ptrdiff_t dst_stride, \
|
||||
const uint8_t *src, ptrdiff_t src_stride, \
|
||||
int h, int mx, int my)
|
||||
|
||||
#define decl_mc_func(op, filter, dir, sz, bpp) \
|
||||
void ff_vp9_##op##_##filter##sz##_##dir##_##bpp##_neon(uint8_t *dst, ptrdiff_t dst_stride, \
|
||||
const uint8_t *src, ptrdiff_t src_stride, \
|
||||
int h, int mx, int my)
|
||||
|
||||
#define define_8tap_2d_fn(op, filter, sz, bpp) \
|
||||
static void op##_##filter##sz##_hv_##bpp##_neon(uint8_t *dst, ptrdiff_t dst_stride, \
|
||||
const uint8_t *src, \
|
||||
ptrdiff_t src_stride, \
|
||||
int h, int mx, int my) \
|
||||
{ \
|
||||
LOCAL_ALIGNED_16(uint8_t, temp, [((1 + (sz < 64)) * sz + 8) * sz * 2]); \
|
||||
/* We only need h + 7 lines, but the horizontal filter assumes an \
|
||||
* even number of rows, so filter h + 8 lines here. */ \
|
||||
ff_vp9_put_##filter##sz##_h_##bpp##_neon(temp, 2 * sz, \
|
||||
src - 3 * src_stride, src_stride, \
|
||||
h + 8, mx, 0); \
|
||||
ff_vp9_##op##_##filter##sz##_v_##bpp##_neon(dst, dst_stride, \
|
||||
temp + 3 * 2 * sz, 2 * sz, \
|
||||
h, 0, my); \
|
||||
}
|
||||
|
||||
#define decl_filter_funcs(op, dir, sz, bpp) \
|
||||
decl_mc_func(op, regular, dir, sz, bpp); \
|
||||
decl_mc_func(op, sharp, dir, sz, bpp); \
|
||||
decl_mc_func(op, smooth, dir, sz, bpp)
|
||||
|
||||
#define decl_mc_funcs(sz, bpp) \
|
||||
decl_filter_funcs(put, h, sz, bpp); \
|
||||
decl_filter_funcs(avg, h, sz, bpp); \
|
||||
decl_filter_funcs(put, v, sz, bpp); \
|
||||
decl_filter_funcs(avg, v, sz, bpp); \
|
||||
decl_filter_funcs(put, hv, sz, bpp); \
|
||||
decl_filter_funcs(avg, hv, sz, bpp)
|
||||
|
||||
declare_fpel(copy, 128, );
|
||||
declare_fpel(copy, 64, );
|
||||
declare_fpel(copy, 32, );
|
||||
declare_fpel(copy, 16, );
|
||||
declare_fpel(copy, 8, );
|
||||
declare_fpel(avg, 64, _16);
|
||||
declare_fpel(avg, 32, _16);
|
||||
declare_fpel(avg, 16, _16);
|
||||
declare_fpel(avg, 8, _16);
|
||||
declare_fpel(avg, 4, _16);
|
||||
|
||||
decl_mc_funcs(64, BPP);
|
||||
decl_mc_funcs(32, BPP);
|
||||
decl_mc_funcs(16, BPP);
|
||||
decl_mc_funcs(8, BPP);
|
||||
decl_mc_funcs(4, BPP);
|
||||
|
||||
#define define_8tap_2d_funcs(sz, bpp) \
|
||||
define_8tap_2d_fn(put, regular, sz, bpp) \
|
||||
define_8tap_2d_fn(put, sharp, sz, bpp) \
|
||||
define_8tap_2d_fn(put, smooth, sz, bpp) \
|
||||
define_8tap_2d_fn(avg, regular, sz, bpp) \
|
||||
define_8tap_2d_fn(avg, sharp, sz, bpp) \
|
||||
define_8tap_2d_fn(avg, smooth, sz, bpp)
|
||||
|
||||
define_8tap_2d_funcs(64, BPP)
|
||||
define_8tap_2d_funcs(32, BPP)
|
||||
define_8tap_2d_funcs(16, BPP)
|
||||
define_8tap_2d_funcs(8, BPP)
|
||||
define_8tap_2d_funcs(4, BPP)
|
||||
|
||||
|
||||
static av_cold void vp9dsp_mc_init_arm(VP9DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
#define init_fpel(idx1, idx2, sz, type, suffix) \
|
||||
dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][0][0] = \
|
||||
dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] = \
|
||||
dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][0][0] = \
|
||||
dsp->mc[idx1][FILTER_BILINEAR ][idx2][0][0] = ff_vp9_##type##sz##suffix##_neon
|
||||
|
||||
#define init_copy_avg(idx, sz1, sz2) \
|
||||
init_fpel(idx, 0, sz2, copy, ); \
|
||||
init_fpel(idx, 1, sz1, avg, _16)
|
||||
|
||||
#define init_mc_func(idx1, idx2, op, filter, fname, dir, mx, my, sz, pfx, bpp) \
|
||||
dsp->mc[idx1][filter][idx2][mx][my] = pfx##op##_##fname##sz##_##dir##_##bpp##_neon
|
||||
|
||||
#define init_mc_funcs(idx, dir, mx, my, sz, pfx, bpp) \
|
||||
init_mc_func(idx, 0, put, FILTER_8TAP_REGULAR, regular, dir, mx, my, sz, pfx, bpp); \
|
||||
init_mc_func(idx, 0, put, FILTER_8TAP_SHARP, sharp, dir, mx, my, sz, pfx, bpp); \
|
||||
init_mc_func(idx, 0, put, FILTER_8TAP_SMOOTH, smooth, dir, mx, my, sz, pfx, bpp); \
|
||||
init_mc_func(idx, 1, avg, FILTER_8TAP_REGULAR, regular, dir, mx, my, sz, pfx, bpp); \
|
||||
init_mc_func(idx, 1, avg, FILTER_8TAP_SHARP, sharp, dir, mx, my, sz, pfx, bpp); \
|
||||
init_mc_func(idx, 1, avg, FILTER_8TAP_SMOOTH, smooth, dir, mx, my, sz, pfx, bpp)
|
||||
|
||||
#define init_mc_funcs_dirs(idx, sz, bpp) \
|
||||
init_mc_funcs(idx, h, 1, 0, sz, ff_vp9_, bpp); \
|
||||
init_mc_funcs(idx, v, 0, 1, sz, ff_vp9_, bpp); \
|
||||
init_mc_funcs(idx, hv, 1, 1, sz, , bpp)
|
||||
|
||||
init_copy_avg(0, 64, 128);
|
||||
init_copy_avg(1, 32, 64);
|
||||
init_copy_avg(2, 16, 32);
|
||||
init_copy_avg(3, 8, 16);
|
||||
init_copy_avg(4, 4, 8);
|
||||
|
||||
init_mc_funcs_dirs(0, 64, BPP);
|
||||
init_mc_funcs_dirs(1, 32, BPP);
|
||||
init_mc_funcs_dirs(2, 16, BPP);
|
||||
init_mc_funcs_dirs(3, 8, BPP);
|
||||
init_mc_funcs_dirs(4, 4, BPP);
|
||||
}
|
||||
}
|
||||
|
||||
#define define_itxfm2(type_a, type_b, sz, bpp) \
|
||||
void ff_vp9_##type_a##_##type_b##_##sz##x##sz##_add_##bpp##_neon(uint8_t *_dst, \
|
||||
ptrdiff_t stride, \
|
||||
int16_t *_block, int eob)
|
||||
#define define_itxfm(type_a, type_b, sz, bpp) define_itxfm2(type_a, type_b, sz, bpp)
|
||||
|
||||
#define define_itxfm_funcs(sz, bpp) \
|
||||
define_itxfm(idct, idct, sz, bpp); \
|
||||
define_itxfm(iadst, idct, sz, bpp); \
|
||||
define_itxfm(idct, iadst, sz, bpp); \
|
||||
define_itxfm(iadst, iadst, sz, bpp)
|
||||
|
||||
define_itxfm_funcs(4, BPP);
|
||||
define_itxfm_funcs(8, BPP);
|
||||
define_itxfm_funcs(16, BPP);
|
||||
define_itxfm(idct, idct, 32, BPP);
|
||||
define_itxfm(iwht, iwht, 4, BPP);
|
||||
|
||||
|
||||
static av_cold void vp9dsp_itxfm_init_arm(VP9DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
#define init_itxfm2(tx, sz, bpp) \
|
||||
dsp->itxfm_add[tx][DCT_DCT] = ff_vp9_idct_idct_##sz##_add_##bpp##_neon; \
|
||||
dsp->itxfm_add[tx][DCT_ADST] = ff_vp9_iadst_idct_##sz##_add_##bpp##_neon; \
|
||||
dsp->itxfm_add[tx][ADST_DCT] = ff_vp9_idct_iadst_##sz##_add_##bpp##_neon; \
|
||||
dsp->itxfm_add[tx][ADST_ADST] = ff_vp9_iadst_iadst_##sz##_add_##bpp##_neon
|
||||
#define init_itxfm(tx, sz, bpp) init_itxfm2(tx, sz, bpp)
|
||||
|
||||
#define init_idct2(tx, nm, bpp) \
|
||||
dsp->itxfm_add[tx][DCT_DCT] = \
|
||||
dsp->itxfm_add[tx][ADST_DCT] = \
|
||||
dsp->itxfm_add[tx][DCT_ADST] = \
|
||||
dsp->itxfm_add[tx][ADST_ADST] = ff_vp9_##nm##_add_##bpp##_neon
|
||||
#define init_idct(tx, nm, bpp) init_idct2(tx, nm, bpp)
|
||||
|
||||
init_itxfm(TX_4X4, 4x4, BPP);
|
||||
init_itxfm(TX_8X8, 8x8, BPP);
|
||||
init_itxfm(TX_16X16, 16x16, BPP);
|
||||
init_idct(TX_32X32, idct_idct_32x32, BPP);
|
||||
init_idct(4, iwht_iwht_4x4, BPP);
|
||||
}
|
||||
}
|
||||
|
||||
#define define_loop_filter(dir, wd, size, bpp) \
|
||||
void ff_vp9_loop_filter_##dir##_##wd##_##size##_##bpp##_neon(uint8_t *dst, ptrdiff_t stride, int E, int I, int H)
|
||||
|
||||
#define define_loop_filters(wd, size, bpp) \
|
||||
define_loop_filter(h, wd, size, bpp); \
|
||||
define_loop_filter(v, wd, size, bpp)
|
||||
|
||||
define_loop_filters(4, 8, BPP);
|
||||
define_loop_filters(8, 8, BPP);
|
||||
define_loop_filters(16, 8, BPP);
|
||||
|
||||
define_loop_filters(16, 16, BPP);
|
||||
|
||||
define_loop_filters(44, 16, BPP);
|
||||
define_loop_filters(48, 16, BPP);
|
||||
define_loop_filters(84, 16, BPP);
|
||||
define_loop_filters(88, 16, BPP);
|
||||
|
||||
static av_cold void vp9dsp_loopfilter_init_arm(VP9DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
#define init_lpf_func_8(idx1, idx2, dir, wd, bpp) \
|
||||
dsp->loop_filter_8[idx1][idx2] = ff_vp9_loop_filter_##dir##_##wd##_8_##bpp##_neon
|
||||
|
||||
#define init_lpf_func_16(idx, dir, bpp) \
|
||||
dsp->loop_filter_16[idx] = ff_vp9_loop_filter_##dir##_16_16_##bpp##_neon
|
||||
|
||||
#define init_lpf_func_mix2(idx1, idx2, idx3, dir, wd, bpp) \
|
||||
dsp->loop_filter_mix2[idx1][idx2][idx3] = ff_vp9_loop_filter_##dir##_##wd##_16_##bpp##_neon
|
||||
|
||||
#define init_lpf_funcs_8_wd(idx, wd, bpp) \
|
||||
init_lpf_func_8(idx, 0, h, wd, bpp); \
|
||||
init_lpf_func_8(idx, 1, v, wd, bpp)
|
||||
|
||||
#define init_lpf_funcs_16(bpp) \
|
||||
init_lpf_func_16(0, h, bpp); \
|
||||
init_lpf_func_16(1, v, bpp)
|
||||
|
||||
#define init_lpf_funcs_mix2_wd(idx1, idx2, wd, bpp) \
|
||||
init_lpf_func_mix2(idx1, idx2, 0, h, wd, bpp); \
|
||||
init_lpf_func_mix2(idx1, idx2, 1, v, wd, bpp)
|
||||
|
||||
#define init_lpf_funcs_8(bpp) \
|
||||
init_lpf_funcs_8_wd(0, 4, bpp); \
|
||||
init_lpf_funcs_8_wd(1, 8, bpp); \
|
||||
init_lpf_funcs_8_wd(2, 16, bpp)
|
||||
|
||||
#define init_lpf_funcs_mix2(bpp) \
|
||||
init_lpf_funcs_mix2_wd(0, 0, 44, bpp); \
|
||||
init_lpf_funcs_mix2_wd(0, 1, 48, bpp); \
|
||||
init_lpf_funcs_mix2_wd(1, 0, 84, bpp); \
|
||||
init_lpf_funcs_mix2_wd(1, 1, 88, bpp)
|
||||
|
||||
init_lpf_funcs_8(BPP);
|
||||
init_lpf_funcs_16(BPP);
|
||||
init_lpf_funcs_mix2(BPP);
|
||||
}
|
||||
}
|
||||
|
||||
av_cold void INIT_FUNC(VP9DSPContext *dsp)
|
||||
{
|
||||
vp9dsp_mc_init_arm(dsp);
|
||||
vp9dsp_loopfilter_init_arm(dsp);
|
||||
vp9dsp_itxfm_init_arm(dsp);
|
||||
}
|
@ -0,0 +1,258 @@
|
||||
/*
|
||||
* Copyright (c) 2016 Google Inc.
|
||||
*
|
||||
* 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/internal.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/vp9dsp.h"
|
||||
#include "vp9dsp_init.h"
|
||||
|
||||
#define declare_fpel(type, sz) \
|
||||
void ff_vp9_##type##sz##_neon(uint8_t *dst, ptrdiff_t dst_stride, \
|
||||
const uint8_t *src, ptrdiff_t src_stride, \
|
||||
int h, int mx, int my)
|
||||
|
||||
#define declare_copy_avg(sz) \
|
||||
declare_fpel(copy, sz); \
|
||||
declare_fpel(avg , sz)
|
||||
|
||||
#define decl_mc_func(op, filter, dir, sz) \
|
||||
void ff_vp9_##op##_##filter##sz##_##dir##_neon(uint8_t *dst, ptrdiff_t dst_stride, \
|
||||
const uint8_t *src, ptrdiff_t src_stride, \
|
||||
int h, int mx, int my)
|
||||
|
||||
#define define_8tap_2d_fn(op, filter, sz) \
|
||||
static void op##_##filter##sz##_hv_neon(uint8_t *dst, ptrdiff_t dst_stride, \
|
||||
const uint8_t *src, ptrdiff_t src_stride, \
|
||||
int h, int mx, int my) \
|
||||
{ \
|
||||
LOCAL_ALIGNED_16(uint8_t, temp, [((1 + (sz < 64)) * sz + 8) * sz]); \
|
||||
/* We only need h + 7 lines, but the horizontal filter assumes an \
|
||||
* even number of rows, so filter h + 8 lines here. */ \
|
||||
ff_vp9_put_##filter##sz##_h_neon(temp, sz, \
|
||||
src - 3 * src_stride, src_stride, \
|
||||
h + 8, mx, 0); \
|
||||
ff_vp9_##op##_##filter##sz##_v_neon(dst, dst_stride, \
|
||||
temp + 3 * sz, sz, \
|
||||
h, 0, my); \
|
||||
}
|
||||
|
||||
#define decl_filter_funcs(op, dir, sz) \
|
||||
decl_mc_func(op, regular, dir, sz); \
|
||||
decl_mc_func(op, sharp, dir, sz); \
|
||||
decl_mc_func(op, smooth, dir, sz)
|
||||
|
||||
#define decl_mc_funcs(sz) \
|
||||
decl_filter_funcs(put, h, sz); \
|
||||
decl_filter_funcs(avg, h, sz); \
|
||||
decl_filter_funcs(put, v, sz); \
|
||||
decl_filter_funcs(avg, v, sz); \
|
||||
decl_filter_funcs(put, hv, sz); \
|
||||
decl_filter_funcs(avg, hv, sz)
|
||||
|
||||
declare_copy_avg(64);
|
||||
declare_copy_avg(32);
|
||||
declare_copy_avg(16);
|
||||
declare_copy_avg(8);
|
||||
declare_copy_avg(4);
|
||||
|
||||
decl_mc_funcs(64);
|
||||
decl_mc_funcs(32);
|
||||
decl_mc_funcs(16);
|
||||
decl_mc_funcs(8);
|
||||
decl_mc_funcs(4);
|
||||
|
||||
#define define_8tap_2d_funcs(sz) \
|
||||
define_8tap_2d_fn(put, regular, sz) \
|
||||
define_8tap_2d_fn(put, sharp, sz) \
|
||||
define_8tap_2d_fn(put, smooth, sz) \
|
||||
define_8tap_2d_fn(avg, regular, sz) \
|
||||
define_8tap_2d_fn(avg, sharp, sz) \
|
||||
define_8tap_2d_fn(avg, smooth, sz)
|
||||
|
||||
define_8tap_2d_funcs(64)
|
||||
define_8tap_2d_funcs(32)
|
||||
define_8tap_2d_funcs(16)
|
||||
define_8tap_2d_funcs(8)
|
||||
define_8tap_2d_funcs(4)
|
||||
|
||||
|
||||
static av_cold void vp9dsp_mc_init_arm(VP9DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
#define init_fpel(idx1, idx2, sz, type) \
|
||||
dsp->mc[idx1][FILTER_8TAP_SMOOTH ][idx2][0][0] = \
|
||||
dsp->mc[idx1][FILTER_8TAP_REGULAR][idx2][0][0] = \
|
||||
dsp->mc[idx1][FILTER_8TAP_SHARP ][idx2][0][0] = \
|
||||
dsp->mc[idx1][FILTER_BILINEAR ][idx2][0][0] = ff_vp9_##type##sz##_neon
|
||||
|
||||
#define init_copy_avg(idx, sz) \
|
||||
init_fpel(idx, 0, sz, copy); \
|
||||
init_fpel(idx, 1, sz, avg)
|
||||
|
||||
#define init_mc_func(idx1, idx2, op, filter, fname, dir, mx, my, sz, pfx) \
|
||||
dsp->mc[idx1][filter][idx2][mx][my] = pfx##op##_##fname##sz##_##dir##_neon
|
||||
|
||||
#define init_mc_funcs(idx, dir, mx, my, sz, pfx) \
|
||||
init_mc_func(idx, 0, put, FILTER_8TAP_REGULAR, regular, dir, mx, my, sz, pfx); \
|
||||
init_mc_func(idx, 0, put, FILTER_8TAP_SHARP, sharp, dir, mx, my, sz, pfx); \
|
||||
init_mc_func(idx, 0, put, FILTER_8TAP_SMOOTH, smooth, dir, mx, my, sz, pfx); \
|
||||
init_mc_func(idx, 1, avg, FILTER_8TAP_REGULAR, regular, dir, mx, my, sz, pfx); \
|
||||
init_mc_func(idx, 1, avg, FILTER_8TAP_SHARP, sharp, dir, mx, my, sz, pfx); \
|
||||
init_mc_func(idx, 1, avg, FILTER_8TAP_SMOOTH, smooth, dir, mx, my, sz, pfx)
|
||||
|
||||
#define init_mc_funcs_dirs(idx, sz) \
|
||||
init_mc_funcs(idx, h, 1, 0, sz, ff_vp9_); \
|
||||
init_mc_funcs(idx, v, 0, 1, sz, ff_vp9_); \
|
||||
init_mc_funcs(idx, hv, 1, 1, sz,)
|
||||
|
||||
init_copy_avg(0, 64);
|
||||
init_copy_avg(1, 32);
|
||||
init_copy_avg(2, 16);
|
||||
init_copy_avg(3, 8);
|
||||
init_copy_avg(4, 4);
|
||||
|
||||
init_mc_funcs_dirs(0, 64);
|
||||
init_mc_funcs_dirs(1, 32);
|
||||
init_mc_funcs_dirs(2, 16);
|
||||
init_mc_funcs_dirs(3, 8);
|
||||
init_mc_funcs_dirs(4, 4);
|
||||
}
|
||||
}
|
||||
|
||||
#define define_itxfm(type_a, type_b, sz) \
|
||||
void ff_vp9_##type_a##_##type_b##_##sz##x##sz##_add_neon(uint8_t *_dst, \
|
||||
ptrdiff_t stride, \
|
||||
int16_t *_block, int eob)
|
||||
|
||||
#define define_itxfm_funcs(sz) \
|
||||
define_itxfm(idct, idct, sz); \
|
||||
define_itxfm(iadst, idct, sz); \
|
||||
define_itxfm(idct, iadst, sz); \
|
||||
define_itxfm(iadst, iadst, sz)
|
||||
|
||||
define_itxfm_funcs(4);
|
||||
define_itxfm_funcs(8);
|
||||
define_itxfm_funcs(16);
|
||||
define_itxfm(idct, idct, 32);
|
||||
define_itxfm(iwht, iwht, 4);
|
||||
|
||||
|
||||
static av_cold void vp9dsp_itxfm_init_arm(VP9DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
#define init_itxfm(tx, sz) \
|
||||
dsp->itxfm_add[tx][DCT_DCT] = ff_vp9_idct_idct_##sz##_add_neon; \
|
||||
dsp->itxfm_add[tx][DCT_ADST] = ff_vp9_iadst_idct_##sz##_add_neon; \
|
||||
dsp->itxfm_add[tx][ADST_DCT] = ff_vp9_idct_iadst_##sz##_add_neon; \
|
||||
dsp->itxfm_add[tx][ADST_ADST] = ff_vp9_iadst_iadst_##sz##_add_neon
|
||||
|
||||
#define init_idct(tx, nm) \
|
||||
dsp->itxfm_add[tx][DCT_DCT] = \
|
||||
dsp->itxfm_add[tx][ADST_DCT] = \
|
||||
dsp->itxfm_add[tx][DCT_ADST] = \
|
||||
dsp->itxfm_add[tx][ADST_ADST] = ff_vp9_##nm##_add_neon
|
||||
|
||||
init_itxfm(TX_4X4, 4x4);
|
||||
init_itxfm(TX_8X8, 8x8);
|
||||
init_itxfm(TX_16X16, 16x16);
|
||||
init_idct(TX_32X32, idct_idct_32x32);
|
||||
init_idct(4, iwht_iwht_4x4);
|
||||
}
|
||||
}
|
||||
|
||||
#define define_loop_filter(dir, wd, size) \
|
||||
void ff_vp9_loop_filter_##dir##_##wd##_##size##_neon(uint8_t *dst, ptrdiff_t stride, int E, int I, int H)
|
||||
|
||||
#define define_loop_filters(wd, size) \
|
||||
define_loop_filter(h, wd, size); \
|
||||
define_loop_filter(v, wd, size)
|
||||
|
||||
define_loop_filters(4, 8);
|
||||
define_loop_filters(8, 8);
|
||||
define_loop_filters(16, 8);
|
||||
define_loop_filters(16, 16);
|
||||
|
||||
define_loop_filters(44, 16);
|
||||
|
||||
#define lf_mix_fn(dir, wd1, wd2, stridea) \
|
||||
static void loop_filter_##dir##_##wd1##wd2##_16_neon(uint8_t *dst, \
|
||||
ptrdiff_t stride, \
|
||||
int E, int I, int H) \
|
||||
{ \
|
||||
ff_vp9_loop_filter_##dir##_##wd1##_8_neon(dst, stride, E & 0xff, I & 0xff, H & 0xff); \
|
||||
ff_vp9_loop_filter_##dir##_##wd2##_8_neon(dst + 8 * stridea, stride, E >> 8, I >> 8, H >> 8); \
|
||||
}
|
||||
|
||||
#define lf_mix_fns(wd1, wd2) \
|
||||
lf_mix_fn(h, wd1, wd2, stride) \
|
||||
lf_mix_fn(v, wd1, wd2, sizeof(uint8_t))
|
||||
|
||||
lf_mix_fns(4, 8)
|
||||
lf_mix_fns(8, 4)
|
||||
lf_mix_fns(8, 8)
|
||||
|
||||
static av_cold void vp9dsp_loopfilter_init_arm(VP9DSPContext *dsp)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
dsp->loop_filter_8[0][1] = ff_vp9_loop_filter_v_4_8_neon;
|
||||
dsp->loop_filter_8[0][0] = ff_vp9_loop_filter_h_4_8_neon;
|
||||
dsp->loop_filter_8[1][1] = ff_vp9_loop_filter_v_8_8_neon;
|
||||
dsp->loop_filter_8[1][0] = ff_vp9_loop_filter_h_8_8_neon;
|
||||
dsp->loop_filter_8[2][1] = ff_vp9_loop_filter_v_16_8_neon;
|
||||
dsp->loop_filter_8[2][0] = ff_vp9_loop_filter_h_16_8_neon;
|
||||
|
||||
dsp->loop_filter_16[0] = ff_vp9_loop_filter_h_16_16_neon;
|
||||
dsp->loop_filter_16[1] = ff_vp9_loop_filter_v_16_16_neon;
|
||||
|
||||
dsp->loop_filter_mix2[0][0][0] = ff_vp9_loop_filter_h_44_16_neon;
|
||||
dsp->loop_filter_mix2[0][0][1] = ff_vp9_loop_filter_v_44_16_neon;
|
||||
dsp->loop_filter_mix2[0][1][0] = loop_filter_h_48_16_neon;
|
||||
dsp->loop_filter_mix2[0][1][1] = loop_filter_v_48_16_neon;
|
||||
dsp->loop_filter_mix2[1][0][0] = loop_filter_h_84_16_neon;
|
||||
dsp->loop_filter_mix2[1][0][1] = loop_filter_v_84_16_neon;
|
||||
dsp->loop_filter_mix2[1][1][0] = loop_filter_h_88_16_neon;
|
||||
dsp->loop_filter_mix2[1][1][1] = loop_filter_v_88_16_neon;
|
||||
}
|
||||
}
|
||||
|
||||
av_cold void ff_vp9dsp_init_arm(VP9DSPContext *dsp, int bpp)
|
||||
{
|
||||
if (bpp == 10) {
|
||||
ff_vp9dsp_init_10bpp_arm(dsp);
|
||||
return;
|
||||
} else if (bpp == 12) {
|
||||
ff_vp9dsp_init_12bpp_arm(dsp);
|
||||
return;
|
||||
} else if (bpp != 8)
|
||||
return;
|
||||
|
||||
vp9dsp_mc_init_arm(dsp);
|
||||
vp9dsp_loopfilter_init_arm(dsp);
|
||||
vp9dsp_itxfm_init_arm(dsp);
|
||||
}
|
@ -0,0 +1,32 @@
|
||||
/*
|
||||
* Copyright (c) 2010 Mans Rullgard
|
||||
*
|
||||
* 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 AVCODEC_ARM_ASM_OFFSETS_H
|
||||
#define AVCODEC_ARM_ASM_OFFSETS_H
|
||||
|
||||
/* MpegEncContext */
|
||||
#define Y_DC_SCALE 0x04
|
||||
#define C_DC_SCALE 0x08
|
||||
#define AC_PRED 0x0c
|
||||
#define BLOCK_LAST_INDEX 0x10
|
||||
#define H263_AIC 0x40
|
||||
#define INTER_SCANTAB_RASTER_END 0x88
|
||||
|
||||
#endif /* AVCODEC_ARM_ASM_OFFSETS_H */
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_AUDIODSP_ARM_H
|
||||
#define AVCODEC_ARM_AUDIODSP_ARM_H
|
||||
|
||||
#include "libavcodec/audiodsp.h"
|
||||
|
||||
void ff_audiodsp_init_neon(AudioDSPContext *c);
|
||||
|
||||
#endif /* AVCODEC_ARM_AUDIODSP_ARM_H */
|
@ -0,0 +1,33 @@
|
||||
/*
|
||||
* ARM optimized audio functions
|
||||
*
|
||||
* 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/cpu.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/audiodsp.h"
|
||||
#include "audiodsp_arm.h"
|
||||
|
||||
av_cold void ff_audiodsp_init_arm(AudioDSPContext *c)
|
||||
{
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
ff_audiodsp_init_neon(c);
|
||||
}
|
@ -0,0 +1,40 @@
|
||||
/*
|
||||
* ARM NEON optimised audio 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 "libavcodec/audiodsp.h"
|
||||
#include "audiodsp_arm.h"
|
||||
|
||||
void ff_vector_clipf_neon(float *dst, const float *src, int len, float min, float max);
|
||||
void ff_vector_clip_int32_neon(int32_t *dst, const int32_t *src, int32_t min,
|
||||
int32_t max, unsigned int len);
|
||||
|
||||
int32_t ff_scalarproduct_int16_neon(const int16_t *v1, const int16_t *v2, int len);
|
||||
|
||||
av_cold void ff_audiodsp_init_neon(AudioDSPContext *c)
|
||||
{
|
||||
c->vector_clip_int32 = ff_vector_clip_int32_neon;
|
||||
c->vector_clipf = ff_vector_clipf_neon;
|
||||
|
||||
c->scalarproduct_int16 = ff_scalarproduct_int16_neon;
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
/*
|
||||
* 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 AVCODEC_ARM_BLOCKDSP_ARM_H
|
||||
#define AVCODEC_ARM_BLOCKDSP_ARM_H
|
||||
|
||||
#include "libavcodec/blockdsp.h"
|
||||
|
||||
void ff_blockdsp_init_neon(BlockDSPContext *c);
|
||||
|
||||
#endif /* AVCODEC_ARM_BLOCKDSP_ARM_H */
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue