[packages] add libmpeg2 (closes: #8317, thanks to W. Michael Petullo)
[openwrt/svn-archive/archive.git] / libs / libmpeg2 / patches / 101-ppc_no_altivec.patch
1 --- a/libmpeg2/motion_comp_altivec.c
2 +++ b/libmpeg2/motion_comp_altivec.c
3 @@ -25,6 +25,8 @@
4
5 #ifdef ARCH_PPC
6
7 +#ifdef __I_WANT_ALTIVEC__
8 +
9 #ifdef HAVE_ALTIVEC_H
10 #include <altivec.h>
11 #endif
12 @@ -1007,4 +1009,6 @@ static void MC_avg_xy_8_altivec (uint8_t
13
14 MPEG2_MC_EXTERN (altivec)
15
16 +#endif /* __I_WANT_ALTIVEC__ */
17 +
18 #endif
19 --- a/libmpeg2/idct_altivec.c
20 +++ b/libmpeg2/idct_altivec.c
21 @@ -25,6 +25,8 @@
22
23 #ifdef ARCH_PPC
24
25 +#ifdef __I_WANT_ALTIVEC__
26 +
27 #ifdef HAVE_ALTIVEC_H
28 #include <altivec.h>
29 #endif
30 @@ -283,4 +285,6 @@ void mpeg2_idct_altivec_init (void)
31 }
32 }
33
34 +#endif /* __I_WANT_ALTIVEC__ */
35 +
36 #endif
37 --- a/libmpeg2/idct.c
38 +++ b/libmpeg2/idct.c
39 @@ -251,11 +251,13 @@ void mpeg2_idct_init (uint32_t accel)
40 } else
41 #endif
42 #ifdef ARCH_PPC
43 +#ifdef __I_WANT_ALTIVEC__
44 if (accel & MPEG2_ACCEL_PPC_ALTIVEC) {
45 mpeg2_idct_copy = mpeg2_idct_copy_altivec;
46 mpeg2_idct_add = mpeg2_idct_add_altivec;
47 mpeg2_idct_altivec_init ();
48 } else
49 +#endif /* __I_WANT_ALTIVEC__ */
50 #endif
51 #ifdef ARCH_ALPHA
52 if (accel & MPEG2_ACCEL_ALPHA_MVI) {
53 --- a/libmpeg2/motion_comp.c
54 +++ b/libmpeg2/motion_comp.c
55 @@ -43,9 +43,11 @@ void mpeg2_mc_init (uint32_t accel)
56 else
57 #endif
58 #ifdef ARCH_PPC
59 +#ifdef __I_WANT_ALTIVEC__
60 if (accel & MPEG2_ACCEL_PPC_ALTIVEC)
61 mpeg2_mc = mpeg2_mc_altivec;
62 else
63 +#endif /* __I_WANT_ALTIVEC__ */
64 #endif
65 #ifdef ARCH_ALPHA
66 if (accel & MPEG2_ACCEL_ALPHA)