History

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

Michael Niedermayer committed 14 years ago

Commit 92ef4be2 parents 2e07f42 d526c5352 files · +219 −841Browse files

Showing the changes to libavcodec/arm (17 of 52 files). Show all

Unified · Split

17 files
  1. libavcodec/arm/ac3dsp_init_arm.c +6 −2
  2. libavcodec/arm/dcadsp_init_arm.c +5 −1
  3. libavcodec/arm/dsputil_init_arm.c +7 −5
  4. libavcodec/arm/dsputil_init_armv5te.c +1 −1
  5. libavcodec/arm/dsputil_init_armv6.c +1 −1
  6. libavcodec/arm/dsputil_init_neon.c +1 −1
  7. libavcodec/arm/dsputil_init_vfp.c +4 −1
  8. libavcodec/arm/fft_fixed_init_arm.c +5 −1
  9. libavcodec/arm/fft_init_arm.c +10 −3
  10. libavcodec/arm/fmtconvert_init_arm.c +5 −2
  11. libavcodec/arm/h264dsp_init_arm.c +5 −1
  12. libavcodec/arm/h264pred_init_arm.c +5 −1
  13. libavcodec/arm/mpegaudiodsp_init_arm.c +5 −1
  14. libavcodec/arm/mpegvideo_arm.c +6 −4
  15. libavcodec/arm/sbrdsp_init_arm.c +4 −1
  16. libavcodec/arm/vp56dsp_init_arm.c +5 −1
  17. libavcodec/arm/vp8dsp_init_arm.c +5 −1
libavcodec/arm/ac3dsp_init_arm.c+6−2
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 */
2020
2121 #include <stdint.h>
22+
23+#include "libavutil/arm/cpu.h"
2224 #include "libavutil/attributes.h"
2325 #include "libavcodec/ac3dsp.h"
2426 #include "config.h"
@@ -47,13 +49,15 @@ void ff_ac3_update_bap_counts_arm(uint16_t mant_cnt[16], uint8_t *bap, int len); · 22 unmodified lines
4749
4850 av_cold void ff_ac3dsp_init_arm(AC3DSPContext *c, int bit_exact)
4951 {
52+ int cpu_flags = av_get_cpu_flags();
53+
5054 c->update_bap_counts = ff_ac3_update_bap_counts_arm;
5155
52− if (HAVE_ARMV6) {
56+ if (have_armv6(cpu_flags)) {
5357 c->bit_alloc_calc_bap = ff_ac3_bit_alloc_calc_bap_armv6;
5458 }
5559
56− if (HAVE_NEON) {
60+ if (have_neon(cpu_flags)) {
5761 c->ac3_exponent_min = ff_ac3_exponent_min_neon;
5862 c->ac3_max_msb_abs_int16 = ff_ac3_max_msb_abs_int16_neon;
5963 c->ac3_lshift_int16 = ff_ac3_lshift_int16_neon;
libavcodec/arm/dcadsp_init_arm.c+5−1
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 */
2020
2121 #include "config.h"
22+
23+#include "libavutil/arm/cpu.h"
2224 #include "libavutil/attributes.h"
2325 #include "libavcodec/dcadsp.h"
2426
@@ -27,6 +29,8 @@ void ff_dca_lfe_fir_neon(float *out, const float *in, const float *coefs, · 2 unmodified lines
2729
2830 av_cold void ff_dcadsp_init_arm(DCADSPContext *s)
2931 {
30− if (HAVE_NEON)
32+ int cpu_flags = av_get_cpu_flags();
33+
34+ if (have_neon(cpu_flags))
3135 s->lfe_fir = ff_dca_lfe_fir_neon;
3236 }
libavcodec/arm/dsputil_init_arm.c+7−5
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
2020 */
2121
22+#include "libavutil/arm/cpu.h"
2223 #include "libavcodec/dsputil.h"
2324 #include "dsputil_arm.h"
2425
@@ -76,11 +77,12 @@ static void simple_idct_arm_add(uint8_t *dest, int line_size, DCTELEM *block) · 51 unmodified lines
7677 void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx)
7778 {
7879 const int high_bit_depth = avctx->bits_per_raw_sample > 8;
80+ int cpu_flags = av_get_cpu_flags();
7981
8082 ff_put_pixels_clamped = c->put_pixels_clamped;
8183 ff_add_pixels_clamped = c->add_pixels_clamped;
8284
83− if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
85+ if (avctx->bits_per_raw_sample <= 8) {
8486 if(avctx->idct_algo == FF_IDCT_AUTO ||
8587 avctx->idct_algo == FF_IDCT_ARM){
8688 c->idct_put = j_rev_dct_arm_put;
@@ -117,8 +119,8 @@ void ff_dsputil_init_arm(DSPContext* c, AVCodecContext *avctx) · 30 unmodified lines
117119 c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
118120 }
119121
120− if (HAVE_ARMV5TE) ff_dsputil_init_armv5te(c, avctx);
121− if (HAVE_ARMV6) ff_dsputil_init_armv6(c, avctx);
122− if (HAVE_ARMVFP) ff_dsputil_init_vfp(c, avctx);
123− if (HAVE_NEON) ff_dsputil_init_neon(c, avctx);
122+ if (have_armv5te(cpu_flags)) ff_dsputil_init_armv5te(c, avctx);
123+ if (have_armv6(cpu_flags)) ff_dsputil_init_armv6(c, avctx);
124+ if (have_vfp(cpu_flags)) ff_dsputil_init_vfp(c, avctx);
125+ if (have_neon(cpu_flags)) ff_dsputil_init_neon(c, avctx);
124126 }
libavcodec/arm/dsputil_init_armv5te.c+1−1
@@ -29,7 +29,7 @@ void ff_prefetch_arm(void *mem, int stride, int h); · 28 unmodified lines
2929
3030 av_cold void ff_dsputil_init_armv5te(DSPContext *c, AVCodecContext *avctx)
3131 {
32− if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
32+ if (avctx->bits_per_raw_sample <= 8 &&
3333 (avctx->idct_algo == FF_IDCT_AUTO ||
3434 avctx->idct_algo == FF_IDCT_SIMPLEARMV5TE)) {
3535 c->idct_put = ff_simple_idct_put_armv5te;
libavcodec/arm/dsputil_init_armv6.c+1−1
@@ -74,7 +74,7 @@ av_cold void ff_dsputil_init_armv6(DSPContext *c, AVCodecContext *avctx) · 73 unmodified lines
7474 {
7575 const int high_bit_depth = avctx->bits_per_raw_sample > 8;
7676
77− if (!avctx->lowres && avctx->bits_per_raw_sample <= 8 &&
77+ if (avctx->bits_per_raw_sample <= 8 &&
7878 (avctx->idct_algo == FF_IDCT_AUTO ||
7979 avctx->idct_algo == FF_IDCT_SIMPLEARMV6)) {
8080 c->idct_put = ff_simple_idct_put_armv6;
libavcodec/arm/dsputil_init_neon.c+1−1
@@ -182,7 +182,7 @@ void ff_dsputil_init_neon(DSPContext *c, AVCodecContext *avctx) · 181 unmodified lines
182182 {
183183 const int high_bit_depth = avctx->bits_per_raw_sample > 8;
184184
185− if (!avctx->lowres && avctx->bits_per_raw_sample <= 8) {
185+ if (avctx->bits_per_raw_sample <= 8) {
186186 if (avctx->idct_algo == FF_IDCT_AUTO ||
187187 avctx->idct_algo == FF_IDCT_SIMPLENEON) {
188188 c->idct_put = ff_simple_idct_put_neon;
libavcodec/arm/dsputil_init_vfp.c+4−1
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919 */
2020
21+#include "libavutil/arm/cpu.h"
2122 #include "libavcodec/dsputil.h"
2223 #include "dsputil_arm.h"
2324
@@ -28,7 +29,9 @@ void ff_vector_fmul_reverse_vfp(float *dst, const float *src0, · 4 unmodified lines
2829
2930 void ff_dsputil_init_vfp(DSPContext* c, AVCodecContext *avctx)
3031 {
31− if (!HAVE_VFPV3)
32+ int cpu_flags = av_get_cpu_flags();
33+
34+ if (!have_vfpv3(cpu_flags))
3235 c->vector_fmul = ff_vector_fmul_vfp;
3336 c->vector_fmul_reverse = ff_vector_fmul_reverse_vfp;
3437 }
libavcodec/arm/fft_fixed_init_arm.c+5−1
@@ -18,6 +18,8 @@ · 17 unmodified lines
1818 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919 */
2020
21+#include "libavutil/arm/cpu.h"
22+
2123 #define CONFIG_FFT_FLOAT 0
2224 #include "libavcodec/fft.h"
2325
@@ -27,7 +29,9 @@ void ff_mdct_fixed_calcw_neon(FFTContext *s, FFTDouble *o, const FFTSample *i); · 3 unmodified lines
2729
2830 av_cold void ff_fft_fixed_init_arm(FFTContext *s)
2931 {
30− if (HAVE_NEON) {
32+ int cpu_flags = av_get_cpu_flags();
33+
34+ if (have_neon(cpu_flags)) {
3135 s->fft_permutation = FF_FFT_PERM_SWAP_LSBS;
3236 s->fft_calc = ff_fft_fixed_calc_neon;
3337
libavcodec/arm/fft_init_arm.c+10−3
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919 */
2020
21+#include "libavutil/arm/cpu.h"
2122 #include "libavcodec/fft.h"
2223 #include "libavcodec/rdft.h"
2324 #include "libavcodec/synth_filter.h"
@@ -39,7 +40,9 @@ void ff_synth_filter_float_neon(FFTContext *imdct, · 15 unmodified lines
3940
4041 av_cold void ff_fft_init_arm(FFTContext *s)
4142 {
42− if (HAVE_NEON) {
43+ int cpu_flags = av_get_cpu_flags();
44+
45+ if (have_neon(cpu_flags)) {
4346 s->fft_permute = ff_fft_permute_neon;
4447 s->fft_calc = ff_fft_calc_neon;
4548 #if CONFIG_MDCT
@@ -54,7 +57,9 @@ av_cold void ff_fft_init_arm(FFTContext *s) · 8 unmodified lines
5457 #if CONFIG_RDFT
5558 av_cold void ff_rdft_init_arm(RDFTContext *s)
5659 {
57− if (HAVE_NEON)
60+ int cpu_flags = av_get_cpu_flags();
61+
62+ if (have_neon(cpu_flags))
5863 s->rdft_calc = ff_rdft_calc_neon;
5964 }
6065 #endif
@@ -62,7 +67,9 @@ av_cold void ff_rdft_init_arm(RDFTContext *s) · 1 unmodified line
6267 #if CONFIG_DCA_DECODER
6368 av_cold void ff_synth_filter_init_arm(SynthFilterContext *s)
6469 {
65− if (HAVE_NEON)
70+ int cpu_flags = av_get_cpu_flags();
71+
72+ if (have_neon(cpu_flags))
6673 s->synth_filter_float = ff_synth_filter_float_neon;
6774 }
6875 #endif
libavcodec/arm/fmtconvert_init_arm.c+5−2
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #include <stdint.h>
2222
23+#include "libavutil/arm/cpu.h"
2324 #include "libavcodec/avcodec.h"
2425 #include "libavcodec/fmtconvert.h"
2526
@@ -33,11 +34,13 @@ void ff_float_to_int16_vfp(int16_t *dst, const float *src, long len); · 7 unmodified lines
3334
3435 void ff_fmt_convert_init_arm(FmtConvertContext *c, AVCodecContext *avctx)
3536 {
36− if (HAVE_ARMVFP && HAVE_ARMV6) {
37+ int cpu_flags = av_get_cpu_flags();
38+
39+ if (have_vfp(cpu_flags) && have_armv6(cpu_flags)) {
3740 c->float_to_int16 = ff_float_to_int16_vfp;
3841 }
3942
40− if (HAVE_NEON) {
43+ if (have_neon(cpu_flags)) {
4144 c->int32_to_float_fmul_scalar = ff_int32_to_float_fmul_scalar_neon;
4245
4346 if (!(avctx->flags & CODEC_FLAG_BITEXACT)) {
libavcodec/arm/h264dsp_init_arm.c+5−1
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #include <stdint.h>
2222
23+#include "libavutil/arm/cpu.h"
2324 #include "libavcodec/dsputil.h"
2425 #include "libavcodec/h264dsp.h"
2526
@@ -99,5 +100,8 @@ static void ff_h264dsp_init_neon(H264DSPContext *c, const int bit_depth, const i · 73 unmodified lines
99100
100101 void ff_h264dsp_init_arm(H264DSPContext *c, const int bit_depth, const int chroma_format_idc)
101102 {
102− if (HAVE_NEON) ff_h264dsp_init_neon(c, bit_depth, chroma_format_idc);
103+ int cpu_flags = av_get_cpu_flags();
104+
105+ if (have_neon(cpu_flags))
106+ ff_h264dsp_init_neon(c, bit_depth, chroma_format_idc);
103107 }
libavcodec/arm/h264pred_init_arm.c+5−1
@@ -20,6 +20,7 @@ · 19 unmodified lines
2020
2121 #include <stdint.h>
2222
23+#include "libavutil/arm/cpu.h"
2324 #include "libavcodec/h264pred.h"
2425
2526 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 · 51 unmodified lines
7778
7879 void ff_h264_pred_init_arm(H264PredContext *h, int codec_id, int bit_depth, const int chroma_format_idc)
7980 {
80− if (HAVE_NEON) ff_h264_pred_init_neon(h, codec_id, bit_depth, chroma_format_idc);
81+ int cpu_flags = av_get_cpu_flags();
82+
83+ if (have_neon(cpu_flags))
84+ ff_h264_pred_init_neon(h, codec_id, bit_depth, chroma_format_idc);
8185 }
libavcodec/arm/mpegaudiodsp_init_arm.c+5−1
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 */
2020
2121 #include <stdint.h>
22+
23+#include "libavutil/arm/cpu.h"
2224 #include "libavcodec/mpegaudiodsp.h"
2325 #include "config.h"
2426
@@ -27,7 +29,9 @@ void ff_mpadsp_apply_window_fixed_armv6(int32_t *synth_buf, int32_t *window, · 2 unmodified lines
2729
2830 void ff_mpadsp_init_arm(MPADSPContext *s)
2931 {
30− if (HAVE_ARMV6) {
32+ int cpu_flags = av_get_cpu_flags();
33+
34+ if (have_armv6(cpu_flags)) {
3135 s->apply_window_fixed = ff_mpadsp_apply_window_fixed_armv6;
3236 }
3337 }
libavcodec/arm/mpegvideo_arm.c+6−4
@@ -18,6 +18,7 @@ · 17 unmodified lines
1818 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
1919 */
2020
21+#include "libavutil/arm/cpu.h"
2122 #include "libavcodec/avcodec.h"
2223 #include "libavcodec/dsputil.h"
2324 #include "libavcodec/mpegvideo.h"
@@ -40,11 +41,12 @@ void ff_dct_unquantize_h263_intra_neon(MpegEncContext *s, DCTELEM *block, · 16 unmodified lines
4041
4142 void ff_MPV_common_init_arm(MpegEncContext *s)
4243 {
43−#if HAVE_ARMV5TE
44− ff_MPV_common_init_armv5te(s);
45−#endif
44+ int cpu_flags = av_get_cpu_flags();
45+
46+ if (have_armv5te(cpu_flags))
47+ ff_MPV_common_init_armv5te(s);
4648
47− if (HAVE_NEON) {
49+ if (have_neon(cpu_flags)) {
4850 s->dct_unquantize_h263_intra = ff_dct_unquantize_h263_intra_neon;
4951 s->dct_unquantize_h263_inter = ff_dct_unquantize_h263_inter_neon;
5052 }
libavcodec/arm/sbrdsp_init_arm.c+4−1
@@ -19,6 +19,7 @@ · 18 unmodified lines
1919 */
2020
2121 #include "config.h"
22+#include "libavutil/arm/cpu.h"
2223 #include "libavutil/attributes.h"
2324 #include "libavcodec/sbrdsp.h"
2425
@@ -51,7 +52,9 @@ void ff_sbr_hf_apply_noise_3_neon(float Y[64][2], const float *s_m, · 26 unmodified lines
5152
5253 av_cold void ff_sbrdsp_init_arm(SBRDSPContext *s)
5354 {
54− if (HAVE_NEON) {
55+ int cpu_flags = av_get_cpu_flags();
56+
57+ if (have_neon(cpu_flags)) {
5558 s->sum64x5 = ff_sbr_sum64x5_neon;
5659 s->sum_square = ff_sbr_sum_square_neon;
5760 s->neg_odd_64 = ff_sbr_neg_odd_64_neon;
libavcodec/arm/vp56dsp_init_arm.c+5−1
@@ -19,6 +19,8 @@ · 18 unmodified lines
1919 */
2020
2121 #include <stdint.h>
22+
23+#include "libavutil/arm/cpu.h"
2224 #include "libavcodec/avcodec.h"
2325 #include "libavcodec/vp56dsp.h"
2426
@@ -27,7 +29,9 @@ void ff_vp6_edge_filter_ver_neon(uint8_t *yuv, int stride, int t); · 2 unmodified lines
2729
2830 void ff_vp56dsp_init_arm(VP56DSPContext *s, enum CodecID codec)
2931 {
30− if (codec != CODEC_ID_VP5 && HAVE_NEON) {
32+ int cpu_flags = av_get_cpu_flags();
33+
34+ if (codec != CODEC_ID_VP5 && have_neon(cpu_flags)) {
3135 s->edge_filter_hor = ff_vp6_edge_filter_hor_neon;
3236 s->edge_filter_ver = ff_vp6_edge_filter_ver_neon;
3337 }
libavcodec/arm/vp8dsp_init_arm.c+5−1
@@ -17,6 +17,8 @@ · 16 unmodified lines
1717 */
1818
1919 #include <stdint.h>
20+
21+#include "libavutil/arm/cpu.h"
2022 #include "libavcodec/vp8dsp.h"
2123
2224 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) · 278 unmodified lines
301303 dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_##opt; \
302304 dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_##opt; \
303305 dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_##opt
304− if (HAVE_NEON) {
306+ int cpu_flags = av_get_cpu_flags();
307+
308+ if (have_neon(cpu_flags)) {
305309 set_func_ptrs(neon);
306310 } else if (HAVE_ARMV6) {
307311 set_func_ptrs(armv6);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t