diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-04-22 22:26:42 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-04-22 22:26:42 +0200 |
commit | 92ef4be4ab9fbb7d901b22e0036a4ca90b00a476 (patch) | |
tree | c04ededf84f089de4f9ef417ca6ecc715b84fa4b /libavcodec/arm | |
parent | 2e07f42957666df6d7c63a62263b8447e97b1442 (diff) | |
parent | d526c5338d50d12a54fd95130030c60070707d3e (diff) | |
download | ffmpeg-92ef4be4ab9fbb7d901b22e0036a4ca90b00a476.tar.gz |
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>
Diffstat (limited to 'libavcodec/arm')
-rw-r--r-- | libavcodec/arm/ac3dsp_init_arm.c | 8 | ||||
-rw-r--r-- | libavcodec/arm/dcadsp_init_arm.c | 6 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_arm.c | 12 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_armv5te.c | 2 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_armv6.c | 2 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_neon.c | 2 | ||||
-rw-r--r-- | libavcodec/arm/dsputil_init_vfp.c | 5 | ||||
-rw-r--r-- | libavcodec/arm/fft_fixed_init_arm.c | 6 | ||||
-rw-r--r-- | libavcodec/arm/fft_init_arm.c | 13 | ||||
-rw-r--r-- | libavcodec/arm/fmtconvert_init_arm.c | 7 | ||||
-rw-r--r-- | libavcodec/arm/h264dsp_init_arm.c | 6 | ||||
-rw-r--r-- | libavcodec/arm/h264pred_init_arm.c | 6 | ||||
-rw-r--r-- | libavcodec/arm/mpegaudiodsp_init_arm.c | 6 | ||||
-rw-r--r-- | libavcodec/arm/mpegvideo_arm.c | 10 | ||||
-rw-r--r-- | libavcodec/arm/sbrdsp_init_arm.c | 5 | ||||
-rw-r--r-- | libavcodec/arm/vp56dsp_init_arm.c | 6 | ||||
-rw-r--r-- | libavcodec/arm/vp8dsp_init_arm.c | 6 |
17 files changed, 80 insertions, 28 deletions
diff --git a/libavcodec/arm/ac3dsp_init_arm.c b/libavcodec/arm/ac3dsp_init_arm.c index 8ab685496d..ffe0747b86 100644 --- a/libavcodec/arm/ac3dsp_init_arm.c +++ b/libavcodec/arm/ac3dsp_init_arm.c @@ -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; diff --git a/libavcodec/arm/dcadsp_init_arm.c b/libavcodec/arm/dcadsp_init_arm.c index 8b57ad3d05..56568e0038 100644 --- a/libavcodec/arm/dcadsp_init_arm.c +++ b/libavcodec/arm/dcadsp_init_arm.c @@ -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; } diff --git a/libavcodec/arm/dsputil_init_arm.c b/libavcodec/arm/dsputil_init_arm.c index 82af718b66..2bc97bfa4e 100644 --- a/libavcodec/arm/dsputil_init_arm.c +++ b/libavcodec/arm/dsputil_init_arm.c @@ -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); } diff --git a/libavcodec/arm/dsputil_init_armv5te.c b/libavcodec/arm/dsputil_init_armv5te.c index 9fedb7a123..6b2300b3ea 100644 --- a/libavcodec/arm/dsputil_init_armv5te.c +++ b/libavcodec/arm/dsputil_init_armv5te.c @@ -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; diff --git a/libavcodec/arm/dsputil_init_armv6.c b/libavcodec/arm/dsputil_init_armv6.c index cd5744d3b3..8401aaceaa 100644 --- a/libavcodec/arm/dsputil_init_armv6.c +++ b/libavcodec/arm/dsputil_init_armv6.c @@ -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; diff --git a/libavcodec/arm/dsputil_init_neon.c b/libavcodec/arm/dsputil_init_neon.c index 4c73276a95..1aa39de7e7 100644 --- a/libavcodec/arm/dsputil_init_neon.c +++ b/libavcodec/arm/dsputil_init_neon.c @@ -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; diff --git a/libavcodec/arm/dsputil_init_vfp.c b/libavcodec/arm/dsputil_init_vfp.c index ee092dca10..91fb3d24e4 100644 --- a/libavcodec/arm/dsputil_init_vfp.c +++ b/libavcodec/arm/dsputil_init_vfp.c @@ -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; } diff --git a/libavcodec/arm/fft_fixed_init_arm.c b/libavcodec/arm/fft_fixed_init_arm.c index df71e7fe09..94081d72ee 100644 --- a/libavcodec/arm/fft_fixed_init_arm.c +++ b/libavcodec/arm/fft_fixed_init_arm.c @@ -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; diff --git a/libavcodec/arm/fft_init_arm.c b/libavcodec/arm/fft_init_arm.c index cdb64e7404..12d28a3efd 100644 --- a/libavcodec/arm/fft_init_arm.c +++ b/libavcodec/arm/fft_init_arm.c @@ -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 diff --git a/libavcodec/arm/fmtconvert_init_arm.c b/libavcodec/arm/fmtconvert_init_arm.c index 4b6e3939f5..5b3e3c1e98 100644 --- a/libavcodec/arm/fmtconvert_init_arm.c +++ b/libavcodec/arm/fmtconvert_init_arm.c @@ -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)) { diff --git a/libavcodec/arm/h264dsp_init_arm.c b/libavcodec/arm/h264dsp_init_arm.c index cc4c688c8b..367ba8134b 100644 --- a/libavcodec/arm/h264dsp_init_arm.c +++ b/libavcodec/arm/h264dsp_init_arm.c @@ -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); } diff --git a/libavcodec/arm/h264pred_init_arm.c b/libavcodec/arm/h264pred_init_arm.c index 75653ff7a5..13aea3212f 100644 --- a/libavcodec/arm/h264pred_init_arm.c +++ b/libavcodec/arm/h264pred_init_arm.c @@ -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); } diff --git a/libavcodec/arm/mpegaudiodsp_init_arm.c b/libavcodec/arm/mpegaudiodsp_init_arm.c index 94a55787ad..a9804e976c 100644 --- a/libavcodec/arm/mpegaudiodsp_init_arm.c +++ b/libavcodec/arm/mpegaudiodsp_init_arm.c @@ -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; } } diff --git a/libavcodec/arm/mpegvideo_arm.c b/libavcodec/arm/mpegvideo_arm.c index 73d03c1a5e..28838bb039 100644 --- a/libavcodec/arm/mpegvideo_arm.c +++ b/libavcodec/arm/mpegvideo_arm.c @@ -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_armv5te(cpu_flags)) + ff_MPV_common_init_armv5te(s); - if (HAVE_NEON) { + 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; } diff --git a/libavcodec/arm/sbrdsp_init_arm.c b/libavcodec/arm/sbrdsp_init_arm.c index 04294cc401..4da7967b49 100644 --- a/libavcodec/arm/sbrdsp_init_arm.c +++ b/libavcodec/arm/sbrdsp_init_arm.c @@ -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; diff --git a/libavcodec/arm/vp56dsp_init_arm.c b/libavcodec/arm/vp56dsp_init_arm.c index ceab9a87d2..ab227ce3af 100644 --- a/libavcodec/arm/vp56dsp_init_arm.c +++ b/libavcodec/arm/vp56dsp_init_arm.c @@ -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; } diff --git a/libavcodec/arm/vp8dsp_init_arm.c b/libavcodec/arm/vp8dsp_init_arm.c index 407dfd2cae..2b105dbe1d 100644 --- a/libavcodec/arm/vp8dsp_init_arm.c +++ b/libavcodec/arm/vp8dsp_init_arm.c @@ -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); |