Merge remote-tracking branch 'qatar/master'
* qatar/master: ARM: allow runtime masking of CPU features dsputil: remove unused functions mov: Treat keyframe indexes as 1-origin if starting at non-zero. mov: Take stps entries into consideration also about key_off. Remove lowres video decoding Conflicts: ffmpeg.c ffplay.c libavcodec/arm/vp8dsp_init_arm.c libavcodec/libopenjpegdec.c libavcodec/mjpegdec.c libavcodec/mpegvideo.c libavcodec/utils.c libavformat/mov.c Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
@@ -19,6 +19,8 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/ac3dsp.h"
|
||||
#include "config.h"
|
||||
@@ -47,13 +49,15 @@ 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) {
|
||||
if (have_armv6(cpu_flags)) {
|
||||
c->bit_alloc_calc_bap = ff_ac3_bit_alloc_calc_bap_armv6;
|
||||
}
|
||||
|
||||
if (HAVE_NEON) {
|
||||
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;
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/dcadsp.h"
|
||||
|
||||
@@ -27,6 +29,8 @@ void ff_dca_lfe_fir_neon(float *out, const float *in, const float *coefs,
|
||||
|
||||
av_cold void ff_dcadsp_init_arm(DCADSPContext *s)
|
||||
{
|
||||
if (HAVE_NEON)
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
s->lfe_fir = ff_dca_lfe_fir_neon;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_arm.h"
|
||||
|
||||
@@ -76,11 +77,12 @@ static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block)
|
||||
void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
ff_put_pixels_clamped = c->put_pixels_clamped;
|
||||
ff_add_pixels_clamped = c->add_pixels_clamped;
|
||||
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
|
||||
if (avctx->bits_per_raw_sample <= 8) {
|
||||
if(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_ARM){
|
||||
c->idct_put = j_rev_dct_arm_put;
|
||||
@@ -117,8 +119,8 @@ void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
|
||||
c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
|
||||
}
|
||||
|
||||
if (HAVE_ARMV5TE) ff_dsputil_init_armv5te(c, avctx);
|
||||
if (HAVE_ARMV6) ff_dsputil_init_armv6(c, avctx);
|
||||
if (HAVE_ARMVFP) ff_dsputil_init_vfp(c, avctx);
|
||||
if (HAVE_NEON) ff_dsputil_init_neon(c, avctx);
|
||||
if (have_armv5te(cpu_flags)) ff_dsputil_init_armv5te(c, avctx);
|
||||
if (have_armv6(cpu_flags)) ff_dsputil_init_armv6(c, avctx);
|
||||
if (have_vfp(cpu_flags)) ff_dsputil_init_vfp(c, avctx);
|
||||
if (have_neon(cpu_flags)) ff_dsputil_init_neon(c, avctx);
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ void ff_prefetch_arm(void *mem, int stride, int h);
|
||||
|
||||
av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
|
||||
if (avctx->bits_per_raw_sample <= 8 &&
|
||||
(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
|
||||
c->idct_put = ff_simple_idct_put_armv5te;
|
||||
|
||||
@@ -74,7 +74,7 @@ av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
|
||||
if (avctx->bits_per_raw_sample <= 8 &&
|
||||
(avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
|
||||
c->idct_put = ff_simple_idct_put_armv6;
|
||||
|
||||
@@ -182,7 +182,7 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
const int high_bit_depth = avctx->bits_per_raw_sample > 8;
|
||||
|
||||
if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
|
||||
if (avctx->bits_per_raw_sample <= 8) {
|
||||
if (avctx->idct_algo == FF_IDCT_AUTO ||
|
||||
avctx->idct_algo == FF_IDCT_SIMPLENEON) {
|
||||
c->idct_put = ff_simple_idct_put_neon;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "dsputil_arm.h"
|
||||
|
||||
@@ -28,7 +29,9 @@ void ff_vector_fmul_reverse_vfp(float *dst, const float *src0,
|
||||
|
||||
void ff_dsputil_init_vfp(DSPContext* c, AVCodecContext *avctx)
|
||||
{
|
||||
if (!HAVE_VFPV3)
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (!have_vfpv3(cpu_flags))
|
||||
c->vector_fmul = ff_vector_fmul_vfp;
|
||||
c->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
|
||||
#define CONFIG_FFT_FLOAT 0
|
||||
#include "libavcodec/fft.h"
|
||||
|
||||
@@ -27,7 +29,9 @@ void ff_mdct_fixed_calcw_neon(FFTContext *s, FFTDouble *o, const FFTSample *i);
|
||||
|
||||
av_cold void ff_fft_fixed_init_arm(FFTContext *s)
|
||||
{
|
||||
if (HAVE_NEON) {
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
|
||||
s->fft_calc = ff_fft_fixed_calc_neon;
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/fft.h"
|
||||
#include "libavcodec/rdft.h"
|
||||
#include "libavcodec/synth_filter.h"
|
||||
@@ -39,7 +40,9 @@ void ff_synth_filter_float_neon(FFTContext *imdct,
|
||||
|
||||
av_cold void ff_fft_init_arm(FFTContext *s)
|
||||
{
|
||||
if (HAVE_NEON) {
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
s->fft_permute = ff_fft_permute_neon;
|
||||
s->fft_calc = ff_fft_calc_neon;
|
||||
#if CONFIG_MDCT
|
||||
@@ -54,7 +57,9 @@ av_cold void ff_fft_init_arm(FFTContext *s)
|
||||
#if CONFIG_RDFT
|
||||
av_cold void ff_rdft_init_arm(RDFTContext *s)
|
||||
{
|
||||
if (HAVE_NEON)
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
s->rdft_calc = ff_rdft_calc_neon;
|
||||
}
|
||||
#endif
|
||||
@@ -62,7 +67,9 @@ av_cold void ff_rdft_init_arm(RDFTContext *s)
|
||||
#if CONFIG_DCA_DECODER
|
||||
av_cold void ff_synth_filter_init_arm(SynthFilterContext *s)
|
||||
{
|
||||
if (HAVE_NEON)
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
s->synth_filter_float = ff_synth_filter_float_neon;
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/fmtconvert.h"
|
||||
|
||||
@@ -33,11 +34,13 @@ void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len);
|
||||
|
||||
void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx)
|
||||
{
|
||||
if (HAVE_ARMVFP && HAVE_ARMV6) {
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_vfp(cpu_flags) && have_armv6(cpu_flags)) {
|
||||
c->float_to_int16 = ff_float_to_int16_vfp;
|
||||
}
|
||||
|
||||
if (HAVE_NEON) {
|
||||
if (have_neon(cpu_flags)) {
|
||||
c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon;
|
||||
|
||||
if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "libavcodec/h264dsp.h"
|
||||
|
||||
@@ -99,5 +100,8 @@ static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const i
|
||||
|
||||
void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
|
||||
{
|
||||
if (HAVE_NEON) ff_h264dsp_init_neon(c, bit_depth, chroma_format_idc);
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
ff_h264dsp_init_neon(c, bit_depth, chroma_format_idc);
|
||||
}
|
||||
|
||||
@@ -20,6 +20,7 @@
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/h264pred.h"
|
||||
|
||||
void ff_pred16x16_vert_neon(uint8_t *src, int stride);
|
||||
@@ -77,5 +78,8 @@ static void ff_h264_pred_init_neon(H264PredContext *h, int codec_id, const int b
|
||||
|
||||
void ff_h264_pred_init_arm(H264PredContext *h, int codec_id, int bit_depth, const int chroma_format_idc)
|
||||
{
|
||||
if (HAVE_NEON) ff_h264_pred_init_neon(h, codec_id, bit_depth, chroma_format_idc);
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags))
|
||||
ff_h264_pred_init_neon(h, codec_id, bit_depth, chroma_format_idc);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/mpegaudiodsp.h"
|
||||
#include "config.h"
|
||||
|
||||
@@ -27,7 +29,9 @@ void ff_mpadsp_apply_window_fixed_armv6(int32_t *synth_buf, int32_t *window,
|
||||
|
||||
void ff_mpadsp_init_arm(MPADSPContext *s)
|
||||
{
|
||||
if (HAVE_ARMV6) {
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_armv6(cpu_flags)) {
|
||||
s->apply_window_fixed = ff_mpadsp_apply_window_fixed_armv6;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
*/
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/dsputil.h"
|
||||
#include "libavcodec/mpegvideo.h"
|
||||
@@ -40,11 +41,12 @@ void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block,
|
||||
|
||||
void ff_MPV_common_init_arm(MpegEncContext *s)
|
||||
{
|
||||
#if HAVE_ARMV5TE
|
||||
ff_MPV_common_init_armv5te(s);
|
||||
#endif
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (HAVE_NEON) {
|
||||
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;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
*/
|
||||
|
||||
#include "config.h"
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavutil/attributes.h"
|
||||
#include "libavcodec/sbrdsp.h"
|
||||
|
||||
@@ -51,7 +52,9 @@ void ff_sbr_hf_apply_noise_3_neon(float Y[64][2], const float *s_m,
|
||||
|
||||
av_cold void ff_sbrdsp_init_arm(SBRDSPContext *s)
|
||||
{
|
||||
if (HAVE_NEON) {
|
||||
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;
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/avcodec.h"
|
||||
#include "libavcodec/vp56dsp.h"
|
||||
|
||||
@@ -27,7 +29,9 @@ void ff_vp6_edge_filter_ver_neon(uint8_t *yuv, int stride, int t);
|
||||
|
||||
void ff_vp56dsp_init_arm(VP56DSPContext *s, enum CodecID codec)
|
||||
{
|
||||
if (codec != CODEC_ID_VP5 && HAVE_NEON) {
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (codec != CODEC_ID_VP5 && have_neon(cpu_flags)) {
|
||||
s->edge_filter_hor = ff_vp6_edge_filter_hor_neon;
|
||||
s->edge_filter_ver = ff_vp6_edge_filter_ver_neon;
|
||||
}
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
*/
|
||||
|
||||
#include <stdint.h>
|
||||
|
||||
#include "libavutil/arm/cpu.h"
|
||||
#include "libavcodec/vp8dsp.h"
|
||||
|
||||
void ff_vp8_luma_dc_wht_dc_armv6(DCTELEM block[4][4][16], DCTELEM dc[16]);
|
||||
@@ -301,7 +303,9 @@ av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_##opt; \
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_##opt; \
|
||||
dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_##opt
|
||||
if (HAVE_NEON) {
|
||||
int cpu_flags = av_get_cpu_flags();
|
||||
|
||||
if (have_neon(cpu_flags)) {
|
||||
set_func_ptrs(neon);
|
||||
} else if (HAVE_ARMV6) {
|
||||
set_func_ptrs(armv6);
|
||||
|
||||
Reference in New Issue
Block a user