comparison liba52/resample_mmx.c @ 3908:0cc94b1eec0f

runtime cpudetect in liba52 way
author michael
date Sun, 30 Dec 2001 21:38:53 +0000
parents 6312aa265429
children ef32c8bdee81
comparison
equal deleted inserted replaced
3907:6312aa265429 3908:0cc94b1eec0f
16 */ 16 */
17 17
18 #include <inttypes.h> 18 #include <inttypes.h>
19 #include <stdio.h> 19 #include <stdio.h>
20 #include "a52.h" 20 #include "a52.h"
21 #include "mm_accel.h"
21 #include "../config.h" 22 #include "../config.h"
22 #include "../cpudetect.h"
23 23
24 int (* a52_resample) (float * _f, int16_t * s16)=NULL; 24 int (* a52_resample) (float * _f, int16_t * s16)=NULL;
25 25
26 #ifdef ARCH_X86 26 #ifdef ARCH_X86
27 static uint64_t __attribute__((aligned(8))) magicF2W= 0x43c0000043c00000LL; 27 static uint64_t __attribute__((aligned(8))) magicF2W= 0x43c0000043c00000LL;
590 chans=_chans; 590 chans=_chans;
591 flags=_flags; 591 flags=_flags;
592 592
593 if(a52_resample==NULL) // only once please ;) 593 if(a52_resample==NULL) // only once please ;)
594 { 594 {
595 if(gCpuCaps.hasMMX) fprintf(stderr, "Using MMX optimized resampler\n"); 595 if(mm_accel & MM_ACCEL_X86_MMX) fprintf(stderr, "Using MMX optimized resampler\n");
596 else fprintf(stderr, "No accelerated resampler found\n"); 596 else fprintf(stderr, "No accelerated resampler found\n");
597 } 597 }
598 598
599 #ifdef ARCH_X86 599 #ifdef ARCH_X86
600 if(gCpuCaps.hasMMX) a52_resample= a52_resample_MMX; 600 if(mm_accel & MM_ACCEL_X86_MMX) a52_resample= a52_resample_MMX;
601 #else 601 #else
602 if(0); 602 if(0);
603 #endif 603 #endif
604 else a52_resample= a52_resample_C; 604 else a52_resample= a52_resample_C;
605 } 605 }