]> git.sesse.net Git - vlc/blob - extras/contrib/src/Patches/ffmpeg-svn-mmx_removal-darwin9.patch
libass: upgrade libass contrib with the latest enhancements from Mplayer.
[vlc] / extras / contrib / src / Patches / ffmpeg-svn-mmx_removal-darwin9.patch
1 diff --git a/libpostproc/postprocess.c b/libpostproc/postprocess.c
2 index 572e607..4608d9d 100644
3 --- a/libpostproc/postprocess.c
4 +++ b/libpostproc/postprocess.c
5 @@ -563,10 +563,6 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride,
6  
7  //Note: we have C, MMX, MMX2, 3DNOW version there is no 3DNOW+MMX2 one
8  //Plain C versions
9 -#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT)
10 -#define COMPILE_C
11 -#endif
12 -
13  #ifdef ARCH_POWERPC
14  #ifdef HAVE_ALTIVEC
15  #define COMPILE_ALTIVEC
16 @@ -575,17 +571,8 @@ static av_always_inline void do_a_deblock_C(uint8_t *src, int step, int stride,
17  
18  #if defined(ARCH_X86)
19  
20 -#if (defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
21 -#define COMPILE_MMX
22 -#endif
23 -
24 -#if defined (HAVE_MMX2) || defined (RUNTIME_CPUDETECT)
25 -#define COMPILE_MMX2
26 -#endif
27 +#define COMPILE_C
28  
29 -#if (defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)
30 -#define COMPILE_3DNOW
31 -#endif
32  #endif /* defined(ARCH_X86) */
33  
34  #undef HAVE_MMX
35 @@ -655,15 +642,7 @@ static inline void postProcess(const uint8_t src[], int srcStride, uint8_t dst[]
36          // someone might exchange the CPU whithout restarting MPlayer ;)
37  #ifdef RUNTIME_CPUDETECT
38  #if defined(ARCH_X86)
39 -        // ordered per speed fastest first
40 -        if(c->cpuCaps & PP_CPU_CAPS_MMX2)
41 -                postProcess_MMX2(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
42 -        else if(c->cpuCaps & PP_CPU_CAPS_3DNOW)
43 -                postProcess_3DNow(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
44 -        else if(c->cpuCaps & PP_CPU_CAPS_MMX)
45 -                postProcess_MMX(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
46 -        else
47 -                postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
48 +        postProcess_C(src, srcStride, dst, dstStride, width, height, QPs, QPStride, isColor, c);
49  #else
50  #ifdef ARCH_POWERPC
51  #ifdef HAVE_ALTIVEC
52 diff --git a/libswscale/rgb2rgb.c b/libswscale/rgb2rgb.c
53 index faf3e95..d226e49 100644
54 --- a/libswscale/rgb2rgb.c
55 +++ b/libswscale/rgb2rgb.c
56 @@ -158,6 +158,7 @@ static uint64_t __attribute__((aligned(8))) dither8[2]={
57  #define RENAME(a) a ## _C
58  #include "rgb2rgb_template.c"
59  
60 +#if 0
61  #if defined(ARCH_X86) && defined(CONFIG_GPL)
62  
63  //MMX versions
64 @@ -188,6 +189,7 @@ static uint64_t __attribute__((aligned(8))) dither8[2]={
65  #include "rgb2rgb_template.c"
66  
67  #endif //ARCH_X86 || ARCH_X86_64
68 +#endif
69  
70  /*
71   rgb15->rgb16 Original by Strepto/Astral
72 diff --git a/libswscale/swscale.c b/libswscale/swscale.c
73 index 5e3c0a9..359ef14 100644
74 --- a/libswscale/swscale.c
75 +++ b/libswscale/swscale.c
76 @@ -875,9 +875,7 @@ static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **l
77  
78  //Note: we have C, X86, MMX, MMX2, 3DNOW version therse no 3DNOW+MMX2 one
79  //Plain C versions
80 -#if !defined (HAVE_MMX) || defined (RUNTIME_CPUDETECT) || !defined(CONFIG_GPL)
81  #define COMPILE_C
82 -#endif
83  
84  #ifdef ARCH_POWERPC
85  #if (defined (HAVE_ALTIVEC) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL)
86 @@ -885,6 +883,7 @@ static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **l
87  #endif //HAVE_ALTIVEC
88  #endif //ARCH_POWERPC
89  
90 +#if 0
91  #if defined(ARCH_X86)
92  
93  #if ((defined (HAVE_MMX) && !defined (HAVE_3DNOW) && !defined (HAVE_MMX2)) || defined (RUNTIME_CPUDETECT)) && defined (CONFIG_GPL)
94 @@ -899,6 +898,7 @@ static inline void yuv2packedXinC(SwsContext *c, int16_t *lumFilter, int16_t **l
95  #define COMPILE_3DNOW
96  #endif
97  #endif //ARCH_X86 || ARCH_X86_64
98 +#endif
99  
100  #undef HAVE_MMX
101  #undef HAVE_MMX2
102 @@ -1544,15 +1544,8 @@ static SwsFunc getSwsFunc(int flags){
103  #if defined(RUNTIME_CPUDETECT) && defined (CONFIG_GPL)
104  #if defined(ARCH_X86)
105      // ordered per speed fastest first
106 -    if (flags & SWS_CPU_CAPS_MMX2)
107 -        return swScale_MMX2;
108 -    else if (flags & SWS_CPU_CAPS_3DNOW)
109 -        return swScale_3DNow;
110 -    else if (flags & SWS_CPU_CAPS_MMX)
111 -        return swScale_MMX;
112 -    else
113 -        return swScale_C;
114 -
115 +    /* VLC Hack: only C */
116 +    return swScale_C;
117  #else
118  #ifdef ARCH_POWERPC
119      if (flags & SWS_CPU_CAPS_ALTIVEC)
120 diff --git a/libswscale/yuv2rgb.c b/libswscale/yuv2rgb.c
121 index 8ece0f6..6dac051 100644
122 --- a/libswscale/yuv2rgb.c
123 +++ b/libswscale/yuv2rgb.c
124 @@ -156,6 +156,7 @@ const uint8_t  __attribute__((aligned(8))) dither_8x8_220[8][8]={
125  };
126  #endif
127  
128 +#if 0
129  #ifdef HAVE_MMX
130  
131  /* hope these constant values are cache line aligned */
132 @@ -189,6 +190,7 @@ static volatile uint64_t attribute_used __attribute__((aligned(8))) r5Dither;
133  #include "yuv2rgb_template.c"
134  
135  #endif /* defined(ARCH_X86) */
136 +#endif
137  
138  const int32_t Inverse_Table_6_9[8][4] = {
139      {117504, 138453, 13954, 34903}, /* no sequence_display_extension */