diff options
author | Carl Eugen Hoyos <cehoyos@ag.or.at> | 2014-04-19 09:56:01 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-06-01 12:01:29 +0200 |
commit | 8580977e30e3c18feff11c8b0eb5658c91e4683e (patch) | |
tree | f73702450dc1a1343d7fc9b5ebd591eaea4ed938 | |
parent | d1423cf68f89d655ed395f052e4cf8915e7f7de0 (diff) | |
download | ffmpeg-8580977e30e3c18feff11c8b0eb5658c91e4683e.tar.gz |
Fix compilation with !HAVE_6REGS.
Can be tested with:
$ ./configure --cc='cc -m32' --disable-optimizations --enable-pic
(cherry picked from commit b38910c9790253b362839042a17e13252c1d4b90)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavcodec/x86/mathops.h | 3 | ||||
-rw-r--r-- | libavcodec/x86/mpegaudiodsp.c | 6 | ||||
-rw-r--r-- | libavcodec/x86/mpegvideoenc.c | 12 | ||||
-rw-r--r-- | libavcodec/x86/snowdsp.c | 6 | ||||
-rw-r--r-- | libavcodec/x86/vc1dsp_init.c | 5 | ||||
-rw-r--r-- | libavcodec/x86/vc1dsp_mmx.c | 4 | ||||
-rw-r--r-- | libavcodec/x86/vp3dsp_init.c | 6 | ||||
-rw-r--r-- | libavcodec/x86/vp56_arith.h | 2 | ||||
-rw-r--r-- | libavfilter/vf_noise.c | 4 | ||||
-rw-r--r-- | libswscale/x86/swscale_template.c | 6 | ||||
-rw-r--r-- | libswscale/x86/yuv2rgb.c | 12 |
11 files changed, 47 insertions, 19 deletions
diff --git a/libavcodec/x86/mathops.h b/libavcodec/x86/mathops.h index 9c48afeb20..4453032aba 100644 --- a/libavcodec/x86/mathops.h +++ b/libavcodec/x86/mathops.h @@ -24,6 +24,7 @@ #include "config.h" #include "libavutil/common.h" +#include "libavutil/x86/asm.h" #if HAVE_INLINE_ASM @@ -88,6 +89,7 @@ static inline av_const int mid_pred(int a, int b, int c) return i; } +#if HAVE_6REGS #define COPY3_IF_LT(x, y, a, b, c, d)\ __asm__ volatile(\ "cmpl %0, %3 \n\t"\ @@ -97,6 +99,7 @@ __asm__ volatile(\ : "+&r" (x), "+&r" (a), "+r" (c)\ : "r" (y), "r" (b), "r" (d)\ ); +#endif /* HAVE_6REGS */ #endif /* HAVE_I686 */ #define MASK_ABS(mask, level) \ diff --git a/libavcodec/x86/mpegaudiodsp.c b/libavcodec/x86/mpegaudiodsp.c index 3654c81248..bd9ec51773 100644 --- a/libavcodec/x86/mpegaudiodsp.c +++ b/libavcodec/x86/mpegaudiodsp.c @@ -45,7 +45,7 @@ void ff_four_imdct36_float_avx(float *out, float *buf, float *in, float *win, DECLARE_ALIGNED(16, static float, mdct_win_sse)[2][4][4*40]; -#if HAVE_SSE2_INLINE +#if HAVE_6REGS && HAVE_SSE2_INLINE #define MACS(rt, ra, rb) rt+=(ra)*(rb) #define MLSS(rt, ra, rb) rt-=(ra)*(rb) @@ -189,7 +189,7 @@ static void apply_window_mp3(float *in, float *win, int *unused, float *out, *out = sum; } -#endif /* HAVE_SSE2_INLINE */ +#endif /* HAVE_6REGS && HAVE_SSE2_INLINE */ #if HAVE_YASM #define DECL_IMDCT_BLOCKS(CPU1, CPU2) \ @@ -255,7 +255,7 @@ av_cold void ff_mpadsp_init_x86(MPADSPContext *s) } } -#if HAVE_SSE2_INLINE +#if HAVE_6REGS && HAVE_SSE2_INLINE if (INLINE_SSE2(cpu_flags)) { s->apply_window_float = apply_window_mp3; } diff --git a/libavcodec/x86/mpegvideoenc.c b/libavcodec/x86/mpegvideoenc.c index 7dd9959087..e8abfb4f05 100644 --- a/libavcodec/x86/mpegvideoenc.c +++ b/libavcodec/x86/mpegvideoenc.c @@ -31,6 +31,8 @@ /* not permutated inverse zigzag_direct + 1 for MMX quantizer */ DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64]; +#if HAVE_6REGS + #if HAVE_MMX_INLINE #define COMPILE_TEMPLATE_MMXEXT 0 #define COMPILE_TEMPLATE_SSE2 0 @@ -82,6 +84,8 @@ DECLARE_ALIGNED(16, static uint16_t, inv_zigzag_direct16)[64]; #include "mpegvideoenc_template.c" #endif /* HAVE_SSSE3_INLINE */ +#endif /* HAVE_6REGS */ + #if HAVE_INLINE_ASM static void denoise_dct_mmx(MpegEncContext *s, int16_t *block){ const int intra= s->mb_intra; @@ -206,21 +210,25 @@ av_cold void ff_dct_encode_init_x86(MpegEncContext *s) #if HAVE_MMX_INLINE int cpu_flags = av_get_cpu_flags(); if (INLINE_MMX(cpu_flags)) { +#if HAVE_6REGS s->dct_quantize = dct_quantize_MMX; +#endif s->denoise_dct = denoise_dct_mmx; } #endif -#if HAVE_MMXEXT_INLINE +#if HAVE_6REGS && HAVE_MMXEXT_INLINE if (INLINE_MMXEXT(cpu_flags)) s->dct_quantize = dct_quantize_MMXEXT; #endif #if HAVE_SSE2_INLINE if (INLINE_SSE2(cpu_flags)) { +#if HAVE_6REGS s->dct_quantize = dct_quantize_SSE2; +#endif s->denoise_dct = denoise_dct_sse2; } #endif -#if HAVE_SSSE3_INLINE +#if HAVE_6REGS && HAVE_SSSE3_INLINE if (INLINE_SSSE3(cpu_flags)) s->dct_quantize = dct_quantize_SSSE3; #endif diff --git a/libavcodec/x86/snowdsp.c b/libavcodec/x86/snowdsp.c index 735e7905a0..b5b6a834b9 100644 --- a/libavcodec/x86/snowdsp.c +++ b/libavcodec/x86/snowdsp.c @@ -606,6 +606,7 @@ static void ff_snow_vertical_compose97i_mmx(IDWTELEM *b0, IDWTELEM *b1, IDWTELEM } #endif //HAVE_7REGS +#if HAVE_6REGS #define snow_inner_add_yblock_sse2_header \ IDWTELEM * * dst_array = sb->line + src_y;\ x86_reg tmp;\ @@ -872,6 +873,7 @@ static void ff_snow_inner_add_yblock_mmx(const uint8_t *obmc, const int obmc_str else ff_snow_inner_add_yblock(obmc, obmc_stride, block, b_w, b_h, src_x,src_y, src_stride, sb, add, dst8); } +#endif /* HAVE_6REGS */ #endif /* HAVE_INLINE_ASM */ @@ -886,7 +888,9 @@ void ff_dwt_init_x86(SnowDWTContext *c) #if HAVE_7REGS c->vertical_compose97i = ff_snow_vertical_compose97i_sse2; #endif +#if HAVE_6REGS c->inner_add_yblock = ff_snow_inner_add_yblock_sse2; +#endif } else{ if (mm_flags & AV_CPU_FLAG_MMXEXT) { @@ -895,7 +899,9 @@ void ff_dwt_init_x86(SnowDWTContext *c) c->vertical_compose97i = ff_snow_vertical_compose97i_mmx; #endif } +#if HAVE_6REGS c->inner_add_yblock = ff_snow_inner_add_yblock_mmx; +#endif } } #endif /* HAVE_INLINE_ASM */ diff --git a/libavcodec/x86/vc1dsp_init.c b/libavcodec/x86/vc1dsp_init.c index 9bd5ae3666..adb5ab4a6c 100644 --- a/libavcodec/x86/vc1dsp_init.c +++ b/libavcodec/x86/vc1dsp_init.c @@ -27,6 +27,7 @@ #include "libavutil/attributes.h" #include "libavutil/cpu.h" #include "libavutil/x86/cpu.h" +#include "libavutil/x86/asm.h" #include "libavcodec/vc1dsp.h" #include "dsputil_x86.h" #include "vc1dsp.h" @@ -86,10 +87,10 @@ av_cold void ff_vc1dsp_init_x86(VC1DSPContext *dsp) { int cpu_flags = av_get_cpu_flags(); - if (INLINE_MMX(cpu_flags)) + if (HAVE_6REGS && INLINE_MMX(cpu_flags)) ff_vc1dsp_init_mmx(dsp); - if (INLINE_MMXEXT(cpu_flags)) + if (HAVE_6REGS && INLINE_MMXEXT(cpu_flags)) ff_vc1dsp_init_mmxext(dsp); #define ASSIGN_LF(EXT) \ diff --git a/libavcodec/x86/vc1dsp_mmx.c b/libavcodec/x86/vc1dsp_mmx.c index 5ceacd348e..488faba573 100644 --- a/libavcodec/x86/vc1dsp_mmx.c +++ b/libavcodec/x86/vc1dsp_mmx.c @@ -33,7 +33,7 @@ #include "dsputil_x86.h" #include "vc1dsp.h" -#if HAVE_INLINE_ASM +#if HAVE_6REGS && HAVE_INLINE_ASM #define OP_PUT(S,D) #define OP_AVG(S,D) "pavgb " #S ", " #D " \n\t" @@ -754,4 +754,4 @@ av_cold void ff_vc1dsp_init_mmxext(VC1DSPContext *dsp) dsp->vc1_inv_trans_8x4_dc = vc1_inv_trans_8x4_dc_mmxext; dsp->vc1_inv_trans_4x4_dc = vc1_inv_trans_4x4_dc_mmxext; } -#endif /* HAVE_INLINE_ASM */ +#endif /* HAVE_6REGS && HAVE_INLINE_ASM */ diff --git a/libavcodec/x86/vp3dsp_init.c b/libavcodec/x86/vp3dsp_init.c index 1f02a6f709..534374820f 100644 --- a/libavcodec/x86/vp3dsp_init.c +++ b/libavcodec/x86/vp3dsp_init.c @@ -64,6 +64,7 @@ void ff_vp3_h_loop_filter_mmxext(uint8_t *src, int stride, "paddb "#regb", "#regr" \n\t" \ "paddb "#regd", "#regp" \n\t" +#if HAVE_6REGS static void put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, const uint8_t *b, ptrdiff_t stride, int h) { // START_TIMER @@ -95,15 +96,16 @@ static void put_vp_no_rnd_pixels8_l2_mmx(uint8_t *dst, const uint8_t *a, const u :"memory"); // STOP_TIMER("put_vp_no_rnd_pixels8_l2_mmx") } +#endif /*HAVE_6REGS */ #endif /* HAVE_MMX_INLINE */ av_cold void ff_vp3dsp_init_x86(VP3DSPContext *c, int flags) { int cpu_flags = av_get_cpu_flags(); -#if HAVE_MMX_INLINE +#if HAVE_6REGS && HAVE_MMX_INLINE c->put_no_rnd_pixels_l2 = put_vp_no_rnd_pixels8_l2_mmx; -#endif /* HAVE_MMX_INLINE */ +#endif /* HAVE_6REGS && HAVE_MMX_INLINE */ #if ARCH_X86_32 if (EXTERNAL_MMX(cpu_flags)) { diff --git a/libavcodec/x86/vp56_arith.h b/libavcodec/x86/vp56_arith.h index e71dbf8ed0..752a92d046 100644 --- a/libavcodec/x86/vp56_arith.h +++ b/libavcodec/x86/vp56_arith.h @@ -24,7 +24,7 @@ #ifndef AVCODEC_X86_VP56_ARITH_H #define AVCODEC_X86_VP56_ARITH_H -#if HAVE_INLINE_ASM && HAVE_FAST_CMOV +#if HAVE_INLINE_ASM && HAVE_FAST_CMOV && HAVE_6REGS #define vp56_rac_get_prob vp56_rac_get_prob static av_always_inline int vp56_rac_get_prob(VP56RangeCoder *c, uint8_t prob) { diff --git a/libavfilter/vf_noise.c b/libavfilter/vf_noise.c index c29afa2721..07d1c276c3 100644 --- a/libavfilter/vf_noise.c +++ b/libavfilter/vf_noise.c @@ -289,7 +289,7 @@ static inline void line_noise_avg_c(uint8_t *dst, const uint8_t *src, static inline void line_noise_avg_mmx(uint8_t *dst, const uint8_t *src, int len, int8_t **shift) { -#if HAVE_MMX_INLINE +#if HAVE_MMX_INLINE && HAVE_6REGS x86_reg mmx_len= len&(~7); __asm__ volatile( @@ -438,7 +438,9 @@ static av_cold int init(AVFilterContext *ctx) if (HAVE_MMX_INLINE && cpu_flags & AV_CPU_FLAG_MMX) { n->line_noise = line_noise_mmx; +#if HAVE_6REGS n->line_noise_avg = line_noise_avg_mmx; +#endif } if (HAVE_MMXEXT_INLINE && cpu_flags & AV_CPU_FLAG_MMXEXT) diff --git a/libswscale/x86/swscale_template.c b/libswscale/x86/swscale_template.c index c72104bd09..fdd7eb8b39 100644 --- a/libswscale/x86/swscale_template.c +++ b/libswscale/x86/swscale_template.c @@ -660,6 +660,7 @@ static void RENAME(yuv2rgb555_X)(SwsContext *c, const int16_t *lumFilter, #define WRITEBGR24(dst, dstw, index) WRITEBGR24MMX(dst, dstw, index) #endif +#if HAVE_6REGS static void RENAME(yuv2bgr24_X_ar)(SwsContext *c, const int16_t *lumFilter, const int16_t **lumSrc, int lumFilterSize, const int16_t *chrFilter, const int16_t **chrUSrc, @@ -707,6 +708,7 @@ static void RENAME(yuv2bgr24_X)(SwsContext *c, const int16_t *lumFilter, : "%"REG_a, "%"REG_c, "%"REG_d, "%"REG_S ); } +#endif /* HAVE_6REGS */ #define REAL_WRITEYUY2(dst, dstw, index) \ "packuswb %%mm3, %%mm3 \n\t"\ @@ -1647,7 +1649,9 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c) if (!(c->flags & SWS_FULL_CHR_H_INT)) { switch (c->dstFormat) { case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X_ar); break; +#if HAVE_6REGS case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X_ar); break; +#endif case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X_ar); break; case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X_ar); break; case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X_ar); break; @@ -1660,7 +1664,9 @@ static av_cold void RENAME(sws_init_swscale)(SwsContext *c) if (!(c->flags & SWS_FULL_CHR_H_INT)) { switch (c->dstFormat) { case AV_PIX_FMT_RGB32: c->yuv2packedX = RENAME(yuv2rgb32_X); break; +#if HAVE_6REGS case AV_PIX_FMT_BGR24: c->yuv2packedX = RENAME(yuv2bgr24_X); break; +#endif case AV_PIX_FMT_RGB555: c->yuv2packedX = RENAME(yuv2rgb555_X); break; case AV_PIX_FMT_RGB565: c->yuv2packedX = RENAME(yuv2rgb565_X); break; case AV_PIX_FMT_YUYV422: c->yuv2packedX = RENAME(yuv2yuyv422_X); break; diff --git a/libswscale/x86/yuv2rgb.c b/libswscale/x86/yuv2rgb.c index a3370eec61..5e2f77c20f 100644 --- a/libswscale/x86/yuv2rgb.c +++ b/libswscale/x86/yuv2rgb.c @@ -50,28 +50,28 @@ DECLARE_ASM_CONST(8, uint64_t, pb_03) = 0x0303030303030303ULL; DECLARE_ASM_CONST(8, uint64_t, pb_07) = 0x0707070707070707ULL; //MMX versions -#if HAVE_MMX_INLINE +#if HAVE_MMX_INLINE && HAVE_6REGS #undef RENAME #undef COMPILE_TEMPLATE_MMXEXT #define COMPILE_TEMPLATE_MMXEXT 0 #define RENAME(a) a ## _mmx #include "yuv2rgb_template.c" -#endif /* HAVE_MMX_INLINE */ +#endif /* HAVE_MMX_INLINE && HAVE_6REGS */ // MMXEXT versions -#if HAVE_MMXEXT_INLINE +#if HAVE_MMXEXT_INLINE && HAVE_6REGS #undef RENAME #undef COMPILE_TEMPLATE_MMXEXT #define COMPILE_TEMPLATE_MMXEXT 1 #define RENAME(a) a ## _mmxext #include "yuv2rgb_template.c" -#endif /* HAVE_MMXEXT_INLINE */ +#endif /* HAVE_MMXEXT_INLINE && HAVE_6REGS */ #endif /* HAVE_INLINE_ASM */ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) { -#if HAVE_MMX_INLINE +#if HAVE_MMX_INLINE && HAVE_6REGS int cpu_flags = av_get_cpu_flags(); #if HAVE_MMXEXT_INLINE @@ -113,7 +113,7 @@ av_cold SwsFunc ff_yuv2rgb_init_x86(SwsContext *c) return yuv420_rgb15_mmx; } } -#endif /* HAVE_MMX_INLINE */ +#endif /* HAVE_MMX_INLINE && HAVE_6REGS */ return NULL; } |