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.

76 lines
2.1KB

  1. /*
  2. * Copyright (c) 2002 Brian Foley
  3. * Copyright (c) 2002 Dieter Shirley
  4. *
  5. * This library is free software; you can redistribute it and/or
  6. * modify it under the terms of the GNU Lesser General Public
  7. * License as published by the Free Software Foundation; either
  8. * version 2 of the License, or (at your option) any later version.
  9. *
  10. * This library is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  13. * Lesser General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU Lesser General Public
  16. * License along with this library; if not, write to the Free Software
  17. * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
  18. */
  19. #include "../dsputil.h"
  20. #ifdef HAVE_ALTIVEC
  21. #include "dsputil_altivec.h"
  22. #endif
  23. int mm_flags = 0;
  24. int mm_support(void)
  25. {
  26. int result = 0;
  27. #if HAVE_ALTIVEC
  28. if (has_altivec()) {
  29. result |= MM_ALTIVEC;
  30. }
  31. #endif /* result */
  32. return result;
  33. }
  34. void dsputil_init_ppc(DSPContext* c, unsigned mask)
  35. {
  36. // Common optimisations whether Altivec or not
  37. // ... pending ...
  38. #if HAVE_ALTIVEC
  39. if (has_altivec()) {
  40. mm_flags |= MM_ALTIVEC;
  41. // Altivec specific optimisations
  42. c->pix_abs16x16_x2 = pix_abs16x16_x2_altivec;
  43. c->pix_abs16x16_y2 = pix_abs16x16_y2_altivec;
  44. c->pix_abs16x16_xy2 = pix_abs16x16_xy2_altivec;
  45. c->pix_abs16x16 = pix_abs16x16_altivec;
  46. c->pix_abs8x8 = pix_abs8x8_altivec;
  47. c->sad[0]= sad16x16_altivec;
  48. c->sad[1]= sad8x8_altivec;
  49. c->pix_norm1 = pix_norm1_altivec;
  50. c->sse[1]= sse8_altivec;
  51. c->sse[0]= sse16_altivec;
  52. c->pix_sum = pix_sum_altivec;
  53. c->diff_pixels = diff_pixels_altivec;
  54. c->get_pixels = get_pixels_altivec;
  55. // next one disabled as it it untested.
  56. #if 0
  57. c->add_bytes= add_bytes_altivec;
  58. #endif
  59. c->gmc1 = gmc1_altivec;
  60. } else
  61. #endif
  62. {
  63. // Non-AltiVec PPC optimisations
  64. // ... pending ...
  65. }
  66. }