diff options
author | wm4 <wm4@nowhere> | 2012-07-29 17:31:38 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2012-07-30 01:38:14 +0200 |
commit | 43da1e78c40ba4f948bfe20536ccc18b2f25c8f7 (patch) | |
tree | e92a83bd2f1aeb0945092dbe24540c9eba84ca94 /libmpcodecs | |
parent | 74df1d8e05aa226c7e82a6d84f43c873ee234561 (diff) | |
download | mpv-43da1e78c40ba4f948bfe20536ccc18b2f25c8f7.tar.bz2 mpv-43da1e78c40ba4f948bfe20536ccc18b2f25c8f7.tar.xz |
Rip out 3DNOW support
Ancient AMD specific enhancement to the MMX instruction set. Officually
discontinued by AMD.
Note that support for this was already disabled in the previous commit.
This commit removes the actual code.
Diffstat (limited to 'libmpcodecs')
-rw-r--r-- | libmpcodecs/ad_liba52.c | 4 | ||||
-rw-r--r-- | libmpcodecs/dec_video.c | 4 | ||||
-rw-r--r-- | libmpcodecs/pullup.h | 2 | ||||
-rw-r--r-- | libmpcodecs/vf_filmdint.c | 25 | ||||
-rw-r--r-- | libmpcodecs/vf_pp.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_pullup.c | 2 | ||||
-rw-r--r-- | libmpcodecs/vf_scale.c | 3 | ||||
-rw-r--r-- | libmpcodecs/vf_tfields.c | 39 |
8 files changed, 4 insertions, 78 deletions
diff --git a/libmpcodecs/ad_liba52.c b/libmpcodecs/ad_liba52.c index e6f0a7e7f7..505532af6b 100644 --- a/libmpcodecs/ad_liba52.c +++ b/libmpcodecs/ad_liba52.c @@ -189,10 +189,6 @@ static int init(sh_audio_t *sh_audio) #endif if(gCpuCaps.hasMMX) a52_accel|=MM_ACCEL_X86_MMX; if(gCpuCaps.hasMMX2) a52_accel|=MM_ACCEL_X86_MMXEXT; - if(gCpuCaps.has3DNow) a52_accel|=MM_ACCEL_X86_3DNOW; -#ifdef MM_ACCEL_X86_3DNOWEXT - if(gCpuCaps.has3DNowExt) a52_accel|=MM_ACCEL_X86_3DNOWEXT; -#endif a52_state=a52_init (a52_accel); if (a52_state == NULL) { mp_msg(MSGT_DECAUDIO,MSGL_ERR,"A52 init failed\n"); diff --git a/libmpcodecs/dec_video.c b/libmpcodecs/dec_video.c index baa8467c1e..1f4ce7497e 100644 --- a/libmpcodecs/dec_video.c +++ b/libmpcodecs/dec_video.c @@ -455,9 +455,7 @@ void *decode_video(sh_video_t *sh_video, struct demux_packet *packet, #if HAVE_MMX // some codecs are broken, and doesn't restore MMX state :( // it happens usually with broken/damaged files. - if (gCpuCaps.has3DNow) { - __asm__ volatile("femms\n\t":::"memory"); - } else if (gCpuCaps.hasMMX) { + if (gCpuCaps.hasMMX) { __asm__ volatile("emms\n\t":::"memory"); } #endif diff --git a/libmpcodecs/pullup.h b/libmpcodecs/pullup.h index 0db8f6f894..99aaa45dc2 100644 --- a/libmpcodecs/pullup.h +++ b/libmpcodecs/pullup.h @@ -21,8 +21,6 @@ #define PULLUP_CPU_MMX 1 #define PULLUP_CPU_MMX2 2 -#define PULLUP_CPU_3DNOW 4 -#define PULLUP_CPU_3DNOWEXT 8 #define PULLUP_CPU_SSE 16 #define PULLUP_CPU_SSE2 32 diff --git a/libmpcodecs/vf_filmdint.c b/libmpcodecs/vf_filmdint.c index 9c34b4aa07..28eb1e77af 100644 --- a/libmpcodecs/vf_filmdint.c +++ b/libmpcodecs/vf_filmdint.c @@ -445,23 +445,6 @@ block_metrics_faster_c(unsigned char *a, unsigned char *b, int as, int bs, ); \ } while (--lines); -static inline struct metrics -block_metrics_3dnow(unsigned char *a, unsigned char *b, int as, int bs, - int lines, struct vf_priv_s *p, struct frame_stats *s) -{ - struct metrics tm; -#if !HAVE_AMD3DNOW - mp_msg(MSGT_VFILTER, MSGL_FATAL, "block_metrics_3dnow: internal error\n"); -#else - static const unsigned long long ones = 0x0101010101010101ull; - - BLOCK_METRICS_TEMPLATE(); - __asm__ volatile("movq %%mm7, %0\n\temms" : "=m" (tm)); - get_block_stats(&tm, p, s); -#endif - return tm; -} - #undef PSUMBW #undef PSADBW #undef PMAXUB @@ -797,9 +780,6 @@ static void diff_planes(struct vf_priv_s *p, struct frame_stats *s, if (p->mmx2 == 1) { for (i = 0; i < w; i += 8) block_metrics_mmx2(of+i, nf+i, os, ns, 4, p, s); - } else if (p->mmx2 == 2) { - for (i = 0; i < w; i += 8) - block_metrics_3dnow(of+i, nf+i, os, ns, 4, p, s); } else if (p->fast > 3) { for (i = 0; i < w; i += 8) block_metrics_faster_c(of+i, nf+i, os, ns, 4, p, s); @@ -1426,7 +1406,7 @@ static int vf_open(vf_instance_t *vf, char *args) p->dint_thres = 4; p->luma_only = 0; p->fast = 3; - p->mmx2 = gCpuCaps.hasMMX2 ? 1 : gCpuCaps.has3DNow ? 2 : 0; + p->mmx2 = gCpuCaps.hasMMX2; if (args) { const char *args_remain = parse_args(p, args); if (args_remain) { @@ -1445,9 +1425,6 @@ static int vf_open(vf_instance_t *vf, char *args) #if !HAVE_MMX p->mmx2 = 0; #endif -#if !HAVE_AMD3DNOW - p->mmx2 &= 1; -#endif p->thres.odd = p->thres.even; p->thres.temp = p->thres.noise; p->diff_time = 0; diff --git a/libmpcodecs/vf_pp.c b/libmpcodecs/vf_pp.c index 694fa09bf2..ae055f8069 100644 --- a/libmpcodecs/vf_pp.c +++ b/libmpcodecs/vf_pp.c @@ -49,8 +49,7 @@ static int config(struct vf_instance *vf, unsigned int voflags, unsigned int outfmt){ int flags= (gCpuCaps.hasMMX ? PP_CPU_CAPS_MMX : 0) - | (gCpuCaps.hasMMX2 ? PP_CPU_CAPS_MMX2 : 0) - | (gCpuCaps.has3DNow ? PP_CPU_CAPS_3DNOW : 0); + | (gCpuCaps.hasMMX2 ? PP_CPU_CAPS_MMX2 : 0); switch(outfmt){ case IMGFMT_444P: flags|= PP_FORMAT_444; break; diff --git a/libmpcodecs/vf_pullup.c b/libmpcodecs/vf_pullup.c index 056f952839..83f2f88fb6 100644 --- a/libmpcodecs/vf_pullup.c +++ b/libmpcodecs/vf_pullup.c @@ -66,8 +66,6 @@ static void init_pullup(struct vf_instance *vf, mp_image_t *mpi) if (gCpuCaps.hasMMX) c->cpu |= PULLUP_CPU_MMX; if (gCpuCaps.hasMMX2) c->cpu |= PULLUP_CPU_MMX2; - if (gCpuCaps.has3DNow) c->cpu |= PULLUP_CPU_3DNOW; - if (gCpuCaps.has3DNowExt) c->cpu |= PULLUP_CPU_3DNOWEXT; if (gCpuCaps.hasSSE) c->cpu |= PULLUP_CPU_SSE; if (gCpuCaps.hasSSE2) c->cpu |= PULLUP_CPU_SSE2; diff --git a/libmpcodecs/vf_scale.c b/libmpcodecs/vf_scale.c index 2d56840fd5..66434d0d56 100644 --- a/libmpcodecs/vf_scale.c +++ b/libmpcodecs/vf_scale.c @@ -661,8 +661,7 @@ float sws_lum_sharpen= 0.0; int get_sws_cpuflags(void){ return (gCpuCaps.hasMMX ? SWS_CPU_CAPS_MMX : 0) - | (gCpuCaps.hasMMX2 ? SWS_CPU_CAPS_MMX2 : 0) - | (gCpuCaps.has3DNow ? SWS_CPU_CAPS_3DNOW : 0); + | (gCpuCaps.hasMMX2 ? SWS_CPU_CAPS_MMX2 : 0); } void sws_getFlagsAndFilterFromCmdLine(int *flags, SwsFilter **srcFilterParam, SwsFilter **dstFilterParam) diff --git a/libmpcodecs/vf_tfields.c b/libmpcodecs/vf_tfields.c index 4823ef463c..b4fa7a46bf 100644 --- a/libmpcodecs/vf_tfields.c +++ b/libmpcodecs/vf_tfields.c @@ -71,42 +71,6 @@ static void deint(unsigned char *dest, int ds, unsigned char *src, int ss, int w fast_memcpy(dest, src, w); } -#if HAVE_AMD3DNOW -static void qpel_li_3DNOW(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up) -{ - int i, j, ssd=ss; - long crap1, crap2; - if (up) { - ssd = -ss; - fast_memcpy(d, s, w); - d += ds; - s += ss; - } - for (i=h-1; i; i--) { - __asm__ volatile( - "1: \n\t" - "movq (%%"REG_S"), %%mm0 \n\t" - "movq (%%"REG_S",%%"REG_a"), %%mm1 \n\t" - "pavgusb %%mm0, %%mm1 \n\t" - "add $8, %%"REG_S" \n\t" - "pavgusb %%mm0, %%mm1 \n\t" - "movq %%mm1, (%%"REG_D") \n\t" - "add $8, %%"REG_D" \n\t" - "decl %%ecx \n\t" - "jnz 1b \n\t" - : "=S"(crap1), "=D"(crap2) - : "c"(w>>3), "S"(s), "D"(d), "a"((long)ssd) - ); - for (j=w-(w&7); j<w; j++) - d[j] = (s[j+ssd] + 3*s[j])>>2; - d += ds; - s += ss; - } - if (!up) fast_memcpy(d, s, w); - __asm__ volatile("emms \n\t" : : : "memory"); -} -#endif - #if HAVE_MMX2 static void qpel_li_MMX2(unsigned char *d, unsigned char *s, int w, int h, int ds, int ss, int up) { @@ -499,9 +463,6 @@ static int vf_open(vf_instance_t *vf, char *args) #if HAVE_MMX2 if(gCpuCaps.hasMMX2) qpel_li = qpel_li_MMX2; #endif -#if HAVE_AMD3DNOW - if(gCpuCaps.has3DNow) qpel_li = qpel_li_3DNOW; -#endif return 1; } |