From: Daniel Kang <daniel.d.k...@gmail.com> The only CPUs that have 3dnow and don't have mmxext are 12 years old. --- libavcodec/x86/dsputil_mmx.c | 11 ++--------- libavcodec/x86/dsputil_mmx_avg_template.c | 8 ++++++-- libavcodec/x86/h264_qpel_mmx.c | 4 ---- 3 files changed, 8 insertions(+), 15 deletions(-)
diff --git a/libavcodec/x86/dsputil_mmx.c b/libavcodec/x86/dsputil_mmx.c index afbb531..0adc6d4 100644 --- a/libavcodec/x86/dsputil_mmx.c +++ b/libavcodec/x86/dsputil_mmx.c @@ -198,12 +198,14 @@ DECLARE_ALIGNED(16, const double, ff_pd_2)[2] = { 2.0, 2.0 }; #define DEF(x) x ## _3dnow #define PAVGB "pavgusb" #define OP_AVG PAVGB +#define IS_3DNOW #include "dsputil_mmx_avg_template.c" #undef DEF #undef PAVGB #undef OP_AVG +#undef IS_3DNOW /***********************************/ /* MMX2 specific */ @@ -2807,15 +2809,6 @@ static void dsputil_init_3dnow(DSPContext *c, AVCodecContext *avctx, SET_QPEL_FUNCS(avg_qpel, 0, 16, 3dnow, ); SET_QPEL_FUNCS(avg_qpel, 1, 8, 3dnow, ); - if (!high_bit_depth) { - SET_QPEL_FUNCS(put_h264_qpel, 0, 16, 3dnow, ); - SET_QPEL_FUNCS(put_h264_qpel, 1, 8, 3dnow, ); - SET_QPEL_FUNCS(put_h264_qpel, 2, 4, 3dnow, ); - SET_QPEL_FUNCS(avg_h264_qpel, 0, 16, 3dnow, ); - SET_QPEL_FUNCS(avg_h264_qpel, 1, 8, 3dnow, ); - SET_QPEL_FUNCS(avg_h264_qpel, 2, 4, 3dnow, ); - } - SET_QPEL_FUNCS(put_2tap_qpel, 0, 16, 3dnow, ); SET_QPEL_FUNCS(put_2tap_qpel, 1, 8, 3dnow, ); SET_QPEL_FUNCS(avg_2tap_qpel, 0, 16, 3dnow, ); diff --git a/libavcodec/x86/dsputil_mmx_avg_template.c b/libavcodec/x86/dsputil_mmx_avg_template.c index 8b116b7..29d0e51 100644 --- a/libavcodec/x86/dsputil_mmx_avg_template.c +++ b/libavcodec/x86/dsputil_mmx_avg_template.c @@ -55,6 +55,7 @@ static void DEF(put_pixels8_x2)(uint8_t *block, const uint8_t *pixels, int line_ :"%"REG_a, "memory"); } +#ifndef IS_3DNOW static void DEF(put_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { __asm__ volatile( @@ -104,7 +105,7 @@ static void DEF(put_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int :"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride) :"memory"); } - +#endif static void DEF(put_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { @@ -226,6 +227,7 @@ static void DEF(put_no_rnd_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src :"memory");*/ } +#ifndef IS_3DNOW static void DEF(avg_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { __asm__ volatile( @@ -276,7 +278,7 @@ static void DEF(avg_pixels4_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int :"S"((x86_reg)src1Stride), "D"((x86_reg)dstStride) :"memory"); } - +#endif static void DEF(avg_pixels8_l2)(uint8_t *dst, uint8_t *src1, uint8_t *src2, int dstStride, int src1Stride, int h) { @@ -872,6 +874,7 @@ static void DEF(avg_pixels8_xy2)(uint8_t *block, const uint8_t *pixels, int line :"%"REG_a, "memory"); } +#ifndef IS_3DNOW static void DEF(avg_pixels4)(uint8_t *block, const uint8_t *pixels, int line_size, int h) { do { @@ -896,6 +899,7 @@ static void DEF(avg_pixels4)(uint8_t *block, const uint8_t *pixels, int line_siz h -= 4; } while(h > 0); } +#endif //FIXME the following could be optimized too ... static void DEF(put_no_rnd_pixels16_x2)(uint8_t *block, const uint8_t *pixels, int line_size, int h){ diff --git a/libavcodec/x86/h264_qpel_mmx.c b/libavcodec/x86/h264_qpel_mmx.c index fc1635d..e84e5a5 100644 --- a/libavcodec/x86/h264_qpel_mmx.c +++ b/libavcodec/x86/h264_qpel_mmx.c @@ -1163,9 +1163,6 @@ QPEL(put_, 16,XMM, 16)\ QPEL(avg_, 8, XMM, 16)\ QPEL(avg_, 16,XMM, 16)\ -#define PAVGB "pavgusb" -QPEL_H264(put_, PUT_OP, 3dnow) -QPEL_H264(avg_, AVG_3DNOW_OP, 3dnow) #undef PAVGB #define PAVGB "pavgb" QPEL_H264(put_, PUT_OP, mmx2) @@ -1184,7 +1181,6 @@ QPEL_H264_HV_XMM(avg_, AVG_MMX2_OP, ssse3) #endif #undef PAVGB -H264_MC_4816(3dnow) H264_MC_4816(mmx2) H264_MC_816(H264_MC_V, sse2) H264_MC_816(H264_MC_HV, sse2) -- 1.7.9.5 _______________________________________________ libav-devel mailing list libav-devel@libav.org https://lists.libav.org/mailman/listinfo/libav-devel