You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.1KB

  1. // a52_resample_init should find the requested converter (from type flags ->
  2. // given number of channels) and set up some function pointers...
  3. // a52_resample() should do the conversion.
  4. #include <inttypes.h>
  5. #include <stdio.h>
  6. #include "a52.h"
  7. #include "mm_accel.h"
  8. #include "config.h"
  9. #include "../libpostproc/mangle.h"
  10. int (* a52_resample) (float * _f, int16_t * s16)=NULL;
  11. #include "resample_c.c"
  12. #ifdef ARCH_X86
  13. #include "resample_mmx.c"
  14. #endif
  15. void* a52_resample_init(uint32_t mm_accel,int flags,int chans){
  16. void* tmp;
  17. #ifdef ARCH_X86
  18. if(mm_accel&MM_ACCEL_X86_MMX){
  19. tmp=a52_resample_MMX(flags,chans);
  20. if(tmp){
  21. if(a52_resample==NULL) fprintf(stderr, "Using MMX optimized resampler\n");
  22. a52_resample=tmp;
  23. return tmp;
  24. }
  25. }
  26. #endif
  27. tmp=a52_resample_C(flags,chans);
  28. if(tmp){
  29. if(a52_resample==NULL) fprintf(stderr, "No accelerated resampler found\n");
  30. a52_resample=tmp;
  31. return tmp;
  32. }
  33. fprintf(stderr, "Unimplemented resampler for mode 0x%X -> %d channels conversion - Contact MPlayer developers!\n", flags, chans);
  34. return NULL;
  35. }