Mercurial > mplayer.hg
comparison liba52/resample_c.c @ 3578:79759c05911e
mmx opt
author | michael |
---|---|
date | Tue, 18 Dec 2001 03:00:04 +0000 |
parents | 6bf4dbfb941c |
children | e22ff7ebdc05 |
comparison
equal
deleted
inserted
replaced
3577:6bf4dbfb941c | 3578:79759c05911e |
---|---|
309 s16[6*i+5] = convert (f[i]); | 309 s16[6*i+5] = convert (f[i]); |
310 } | 310 } |
311 #endif | 311 #endif |
312 break; | 312 break; |
313 case A52_3F | A52_LFE: | 313 case A52_3F | A52_LFE: |
314 #ifdef HAVE_MMX | |
315 asm volatile( | |
316 "movl $-1024, %%esi \n\t" | |
317 "movq magicF2W, %%mm7 \n\t" | |
318 "pxor %%mm6, %%mm6 \n\t" | |
319 "1: \n\t" | |
320 "movq 1024(%1, %%esi), %%mm0 \n\t" | |
321 "movq 3072(%1, %%esi), %%mm1 \n\t" | |
322 "movq 2048(%1, %%esi), %%mm4 \n\t" | |
323 "movq (%1, %%esi), %%mm5 \n\t" | |
324 "psubd %%mm7, %%mm0 \n\t" | |
325 "psubd %%mm7, %%mm1 \n\t" | |
326 "psubd %%mm7, %%mm4 \n\t" | |
327 "psubd %%mm7, %%mm5 \n\t" | |
328 "leal (%%esi, %%esi, 2), %%edi \n\t" | |
329 | |
330 "packssdw %%mm4, %%mm0 \n\t" // EeAa | |
331 "packssdw %%mm5, %%mm1 \n\t" // FfBb | |
332 "movq %%mm0, %%mm2 \n\t" // EeAa | |
333 "punpcklwd %%mm1, %%mm0 \n\t" // BAba | |
334 "punpckhwd %%mm1, %%mm2 \n\t" // FEfe | |
335 "movq %%mm0, %%mm1 \n\t" // BAba | |
336 "punpckldq %%mm6, %%mm0 \n\t" // 00ba | |
337 "punpckhdq %%mm1, %%mm1 \n\t" // BABA | |
338 | |
339 "movq %%mm0, (%0, %%edi) \n\t" | |
340 "punpckhdq %%mm2, %%mm0 \n\t" // FE00 | |
341 "punpckldq %%mm1, %%mm2 \n\t" // BAfe | |
342 "movq %%mm2, 8(%0, %%edi) \n\t" | |
343 "movq %%mm0, 16(%0, %%edi) \n\t" | |
344 "addl $8, %%esi \n\t" | |
345 " jnz 1b \n\t" | |
346 "emms \n\t" | |
347 :: "r" (s16+1536), "r" (f+256) | |
348 :"%esi", "%edi", "memory" | |
349 ); | |
350 #else | |
314 for (i = 0; i < 256; i++) { | 351 for (i = 0; i < 256; i++) { |
315 s16[6*i] = convert (f[i+256]); | 352 s16[6*i] = convert (f[i+256]); |
316 s16[6*i+1] = convert (f[i+768]); | 353 s16[6*i+1] = convert (f[i+768]); |
317 s16[6*i+2] = s16[6*i+3] = 0; | 354 s16[6*i+2] = s16[6*i+3] = 0; |
318 s16[6*i+4] = convert (f[i+512]); | 355 s16[6*i+4] = convert (f[i+512]); |
319 s16[6*i+5] = convert (f[i]); | 356 s16[6*i+5] = convert (f[i]); |
320 } | 357 } |
358 #endif | |
321 break; | 359 break; |
322 case A52_2F2R | A52_LFE: | 360 case A52_2F2R | A52_LFE: |
323 #ifdef HAVE_MMX | 361 #ifdef HAVE_MMX |
324 asm volatile( | 362 asm volatile( |
325 "movl $-1024, %%esi \n\t" | 363 "movl $-1024, %%esi \n\t" |