hpeldsp_init_arm.c 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. /*
  2. * ARM-optimized halfpel functions
  3. * Copyright (c) 2001 Lionel Ulmer
  4. *
  5. * This file is part of FFmpeg.
  6. *
  7. * FFmpeg is free software; you can redistribute it and/or
  8. * modify it under the terms of the GNU Lesser General Public
  9. * License as published by the Free Software Foundation; either
  10. * version 2.1 of the License, or (at your option) any later version.
  11. *
  12. * FFmpeg is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. * Lesser General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU Lesser General Public
  18. * License along with FFmpeg; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  20. */
  21. #include "libavutil/arm/cpu.h"
  22. #include "libavutil/attributes.h"
  23. #include "libavcodec/pixels.h"
  24. #include "hpeldsp_arm.h"
  25. void ff_put_pixels8_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  26. void ff_put_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  27. void ff_put_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  28. void ff_put_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  29. void ff_put_no_rnd_pixels8_x2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  30. void ff_put_no_rnd_pixels8_y2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  31. void ff_put_no_rnd_pixels8_xy2_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  32. void ff_put_pixels16_arm(uint8_t *block, const uint8_t *pixels, ptrdiff_t line_size, int h);
  33. CALL_2X_PIXELS(ff_put_pixels16_x2_arm, ff_put_pixels8_x2_arm, 8)
  34. CALL_2X_PIXELS(ff_put_pixels16_y2_arm, ff_put_pixels8_y2_arm, 8)
  35. CALL_2X_PIXELS(ff_put_pixels16_xy2_arm, ff_put_pixels8_xy2_arm, 8)
  36. CALL_2X_PIXELS(ff_put_no_rnd_pixels16_x2_arm, ff_put_no_rnd_pixels8_x2_arm, 8)
  37. CALL_2X_PIXELS(ff_put_no_rnd_pixels16_y2_arm, ff_put_no_rnd_pixels8_y2_arm, 8)
  38. CALL_2X_PIXELS(ff_put_no_rnd_pixels16_xy2_arm, ff_put_no_rnd_pixels8_xy2_arm,8)
  39. av_cold void ff_hpeldsp_init_arm(HpelDSPContext *c, int flags)
  40. {
  41. int cpu_flags = av_get_cpu_flags();
  42. c->put_pixels_tab[0][0] = ff_put_pixels16_arm;
  43. c->put_pixels_tab[0][1] = ff_put_pixels16_x2_arm;
  44. c->put_pixels_tab[0][2] = ff_put_pixels16_y2_arm;
  45. c->put_pixels_tab[0][3] = ff_put_pixels16_xy2_arm;
  46. c->put_pixels_tab[1][0] = ff_put_pixels8_arm;
  47. c->put_pixels_tab[1][1] = ff_put_pixels8_x2_arm;
  48. c->put_pixels_tab[1][2] = ff_put_pixels8_y2_arm;
  49. c->put_pixels_tab[1][3] = ff_put_pixels8_xy2_arm;
  50. c->put_no_rnd_pixels_tab[0][0] = ff_put_pixels16_arm;
  51. c->put_no_rnd_pixels_tab[0][1] = ff_put_no_rnd_pixels16_x2_arm;
  52. c->put_no_rnd_pixels_tab[0][2] = ff_put_no_rnd_pixels16_y2_arm;
  53. c->put_no_rnd_pixels_tab[0][3] = ff_put_no_rnd_pixels16_xy2_arm;
  54. c->put_no_rnd_pixels_tab[1][0] = ff_put_pixels8_arm;
  55. c->put_no_rnd_pixels_tab[1][1] = ff_put_no_rnd_pixels8_x2_arm;
  56. c->put_no_rnd_pixels_tab[1][2] = ff_put_no_rnd_pixels8_y2_arm;
  57. c->put_no_rnd_pixels_tab[1][3] = ff_put_no_rnd_pixels8_xy2_arm;
  58. if (have_armv6(cpu_flags))
  59. ff_hpeldsp_init_armv6(c, flags);
  60. if (have_neon(cpu_flags))
  61. ff_hpeldsp_init_neon(c, flags);
  62. }