Originally committed as revision 12844 to svn://svn.ffmpeg.org/ffmpeg/trunk
Alexander Strange authored on 2008/04/16 10:54:16... | ... |
@@ -72,7 +72,7 @@ struct algo { |
72 | 72 |
enum { FDCT, IDCT } is_idct; |
73 | 73 |
void (* func) (DCTELEM *block); |
74 | 74 |
void (* ref) (DCTELEM *block); |
75 |
- enum formattag { NO_PERM,MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM } format; |
|
75 |
+ enum formattag { NO_PERM,MMX_PERM, MMX_SIMPLE_PERM, SCALE_PERM, SSE2_PERM } format; |
|
76 | 76 |
int mm_support; |
77 | 77 |
}; |
78 | 78 |
|
... | ... |
@@ -105,6 +105,7 @@ struct algo algos[] = { |
105 | 105 |
{"SIMPLE-MMX", 1, ff_simple_idct_mmx, idct, MMX_SIMPLE_PERM, MM_MMX}, |
106 | 106 |
{"XVID-MMX", 1, ff_idct_xvid_mmx, idct, NO_PERM, MM_MMX}, |
107 | 107 |
{"XVID-MMX2", 1, ff_idct_xvid_mmx2, idct, NO_PERM, MM_MMXEXT}, |
108 |
+ {"XVID-SSE2", 1, ff_idct_xvid_sse2, idct, SSE2_PERM, MM_SSE2}, |
|
108 | 109 |
#endif |
109 | 110 |
|
110 | 111 |
#ifdef HAVE_ALTIVEC |
... | ... |
@@ -157,6 +158,8 @@ static short idct_simple_mmx_perm[64]={ |
157 | 157 |
0x32, 0x3A, 0x36, 0x3B, 0x33, 0x3E, 0x37, 0x3F, |
158 | 158 |
}; |
159 | 159 |
|
160 |
+static const uint8_t idct_sse2_row_perm[8] = {0, 4, 1, 5, 2, 6, 3, 7}; |
|
161 |
+ |
|
160 | 162 |
void idct_mmx_init(void) |
161 | 163 |
{ |
162 | 164 |
int i; |
... | ... |
@@ -232,6 +235,9 @@ void dct_error(const char *name, int is_idct, |
232 | 232 |
for(i=0;i<64;i++) |
233 | 233 |
block[idct_simple_mmx_perm[i]] = block1[i]; |
234 | 234 |
|
235 |
+ } else if (form == SSE2_PERM) { |
|
236 |
+ for(i=0; i<64; i++) |
|
237 |
+ block[(i&0x38) | idct_sse2_row_perm[i&7]] = block1[i]; |
|
235 | 238 |
} else { |
236 | 239 |
for(i=0; i<64; i++) |
237 | 240 |
block[i]= block1[i]; |