1 --- libmpeg2-0.5.1/libmpeg2/idct_mmx.c.orig 2011-05-13 09:23:02.557758717 -0300
2 +++ libmpeg2-0.5.1/libmpeg2/idct_mmx.c 2011-05-13 09:23:06.346778580 -0300
4 #define rounder(bias) {round (bias), round (bias)}
5 #define rounder_sse2(bias) {round (bias), round (bias), round (bias), round (bias)}
9 /* C row IDCT - it is just here to document the MMXEXT and MMX versions */
10 static inline void idct_row (int16_t * row, int offset,
11 @@ -464,10 +463,10 @@ static inline void sse2_idct_col (int16_
12 /* Almost identical to mmxext version: */
13 /* just do both 4x8 columns in paraller */
15 - static const short t1_vector[] ATTR_ALIGN(16) = {T1,T1,T1,T1,T1,T1,T1,T1};
16 - static const short t2_vector[] ATTR_ALIGN(16) = {T2,T2,T2,T2,T2,T2,T2,T2};
17 - static const short t3_vector[] ATTR_ALIGN(16) = {T3,T3,T3,T3,T3,T3,T3,T3};
18 - static const short c4_vector[] ATTR_ALIGN(16) = {C4,C4,C4,C4,C4,C4,C4,C4};
19 + static/* const*/ short t1_vector[] ATTR_ALIGN(16) = {T1,T1,T1,T1,T1,T1,T1,T1};
20 + static/* const*/ short t2_vector[] ATTR_ALIGN(16) = {T2,T2,T2,T2,T2,T2,T2,T2};
21 + static/* const*/ short t3_vector[] ATTR_ALIGN(16) = {T3,T3,T3,T3,T3,T3,T3,T3};
22 + static/* const*/ short c4_vector[] ATTR_ALIGN(16) = {C4,C4,C4,C4,C4,C4,C4,C4};
24 #if defined(__x86_64__)
26 @@ -710,10 +709,10 @@ static inline void sse2_idct_col (int16_
28 static inline void idct_col (int16_t * const col, const int offset)
30 - static const short t1_vector[] ATTR_ALIGN(8) = {T1,T1,T1,T1};
31 - static const short t2_vector[] ATTR_ALIGN(8) = {T2,T2,T2,T2};
32 - static const short t3_vector[] ATTR_ALIGN(8) = {T3,T3,T3,T3};
33 - static const short c4_vector[] ATTR_ALIGN(8) = {C4,C4,C4,C4};
34 + static/* const*/ short t1_vector[] ATTR_ALIGN(8) = {T1,T1,T1,T1};
35 + static/* const*/ short t2_vector[] ATTR_ALIGN(8) = {T2,T2,T2,T2};
36 + static/* const*/ short t3_vector[] ATTR_ALIGN(8) = {T3,T3,T3,T3};
37 + static/* const*/ short c4_vector[] ATTR_ALIGN(8) = {C4,C4,C4,C4};
39 /* column code adapted from peter gubanov */
40 /* http://www.elecard.com/peter/idct.shtml */
41 @@ -847,33 +846,33 @@ static inline void idct_col (int16_t * c
45 -static const int32_t rounder0[] ATTR_ALIGN(8) =
46 +static/* const*/ int32_t rounder0[] ATTR_ALIGN(8) =
47 rounder ((1 << (COL_SHIFT - 1)) - 0.5);
48 -static const int32_t rounder4[] ATTR_ALIGN(8) = rounder (0);
49 -static const int32_t rounder1[] ATTR_ALIGN(8) =
50 +static/* const*/ int32_t rounder4[] ATTR_ALIGN(8) = rounder (0);
51 +static/* const*/ int32_t rounder1[] ATTR_ALIGN(8) =
52 rounder (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */
53 -static const int32_t rounder7[] ATTR_ALIGN(8) =
54 +static/* const*/ int32_t rounder7[] ATTR_ALIGN(8) =
55 rounder (-0.25); /* C1*(C7/C4+C7-C1)/2 */
56 -static const int32_t rounder2[] ATTR_ALIGN(8) =
57 +static/* const*/ int32_t rounder2[] ATTR_ALIGN(8) =
58 rounder (0.60355339059); /* C2 * (C6+C2)/2 */
59 -static const int32_t rounder6[] ATTR_ALIGN(8) =
60 +static/* const*/ int32_t rounder6[] ATTR_ALIGN(8) =
61 rounder (-0.25); /* C2 * (C6-C2)/2 */
62 -static const int32_t rounder3[] ATTR_ALIGN(8) =
63 +static/* const*/ int32_t rounder3[] ATTR_ALIGN(8) =
64 rounder (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */
65 -static const int32_t rounder5[] ATTR_ALIGN(8) =
66 +static/* const*/ int32_t rounder5[] ATTR_ALIGN(8) =
67 rounder (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */
70 #define declare_idct(idct,table,idct_row_head,idct_row,idct_row_tail,idct_row_mid) \
71 static inline void idct (int16_t * const block) \
73 - static const int16_t table04[] ATTR_ALIGN(16) = \
74 + static/* const*/ int16_t table04[] ATTR_ALIGN(16) = \
75 table (22725, 21407, 19266, 16384, 12873, 8867, 4520); \
76 - static const int16_t table17[] ATTR_ALIGN(16) = \
77 + static/* const*/ int16_t table17[] ATTR_ALIGN(16) = \
78 table (31521, 29692, 26722, 22725, 17855, 12299, 6270); \
79 - static const int16_t table26[] ATTR_ALIGN(16) = \
80 + static/* const*/ int16_t table26[] ATTR_ALIGN(16) = \
81 table (29692, 27969, 25172, 21407, 16819, 11585, 5906); \
82 - static const int16_t table35[] ATTR_ALIGN(16) = \
83 + static/* const*/ int16_t table35[] ATTR_ALIGN(16) = \
84 table (26722, 25172, 22654, 19266, 15137, 10426, 5315); \
86 idct_row_head (block, 0*8, table04); \
87 @@ -900,29 +899,29 @@ static inline void idct (int16_t * const
89 static inline void sse2_idct (int16_t * const block)
91 - static const int16_t table04[] ATTR_ALIGN(16) =
92 + static/* const*/ int16_t table04[] ATTR_ALIGN(16) =
93 sse2_table (22725, 21407, 19266, 16384, 12873, 8867, 4520);
94 - static const int16_t table17[] ATTR_ALIGN(16) =
95 + static/* const*/ int16_t table17[] ATTR_ALIGN(16) =
96 sse2_table (31521, 29692, 26722, 22725, 17855, 12299, 6270);
97 - static const int16_t table26[] ATTR_ALIGN(16) =
98 + static/* const*/ int16_t table26[] ATTR_ALIGN(16) =
99 sse2_table (29692, 27969, 25172, 21407, 16819, 11585, 5906);
100 - static const int16_t table35[] ATTR_ALIGN(16) =
101 + static/* const*/ int16_t table35[] ATTR_ALIGN(16) =
102 sse2_table (26722, 25172, 22654, 19266, 15137, 10426, 5315);
104 - static const int32_t rounder0_128[] ATTR_ALIGN(16) =
105 + static/* const*/ int32_t rounder0_128[] ATTR_ALIGN(16) =
106 rounder_sse2 ((1 << (COL_SHIFT - 1)) - 0.5);
107 - static const int32_t rounder4_128[] ATTR_ALIGN(16) = rounder_sse2 (0);
108 - static const int32_t rounder1_128[] ATTR_ALIGN(16) =
109 + static/* const*/ int32_t rounder4_128[] ATTR_ALIGN(16) = rounder_sse2 (0);
110 + static/* const*/ int32_t rounder1_128[] ATTR_ALIGN(16) =
111 rounder_sse2 (1.25683487303); /* C1*(C1/C4+C1+C7)/2 */
112 - static const int32_t rounder7_128[] ATTR_ALIGN(16) =
113 + static/* const*/ int32_t rounder7_128[] ATTR_ALIGN(16) =
114 rounder_sse2 (-0.25); /* C1*(C7/C4+C7-C1)/2 */
115 - static const int32_t rounder2_128[] ATTR_ALIGN(16) =
116 + static/* const*/ int32_t rounder2_128[] ATTR_ALIGN(16) =
117 rounder_sse2 (0.60355339059); /* C2 * (C6+C2)/2 */
118 - static const int32_t rounder6_128[] ATTR_ALIGN(16) =
119 + static/* const*/ int32_t rounder6_128[] ATTR_ALIGN(16) =
120 rounder_sse2 (-0.25); /* C2 * (C6-C2)/2 */
121 - static const int32_t rounder3_128[] ATTR_ALIGN(16) =
122 + static/* const*/ int32_t rounder3_128[] ATTR_ALIGN(16) =
123 rounder_sse2 (0.087788325588); /* C3*(-C3/C4+C3+C5)/2 */
124 - static const int32_t rounder5_128[] ATTR_ALIGN(16) =
125 + static/* const*/ int32_t rounder5_128[] ATTR_ALIGN(16) =
126 rounder_sse2 (-0.441341716183); /* C3*(-C5/C4+C5-C3)/2 */
128 #if defined(__x86_64__)