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.

66 lines
2.3KB

  1. /*
  2. * Half-pel DSP functions.
  3. * Copyright (c) 2000, 2001 Fabrice Bellard
  4. * Copyright (c) 2002-2004 Michael Niedermayer <michaelni@gmx.at>
  5. *
  6. * gmc & q-pel & 32/64 bit based MC by Michael Niedermayer <michaelni@gmx.at>
  7. *
  8. * This file is part of FFmpeg.
  9. *
  10. * FFmpeg is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU Lesser General Public
  12. * License as published by the Free Software Foundation; either
  13. * version 2.1 of the License, or (at your option) any later version.
  14. *
  15. * FFmpeg is distributed in the hope that it will be useful,
  16. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * Lesser General Public License for more details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with FFmpeg; if not, write to the Free Software
  22. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  23. */
  24. /**
  25. * @file
  26. * Half-pel DSP functions.
  27. */
  28. #include "libavutil/attributes.h"
  29. #include "hpeldsp.h"
  30. #define BIT_DEPTH 8
  31. #include "hpeldsp_template.c"
  32. av_cold void ff_hpeldsp_init(HpelDSPContext* c, int flags)
  33. {
  34. #define hpel_funcs(prefix, idx, num) \
  35. c->prefix ## _pixels_tab idx [0] = prefix ## _pixels ## num ## _8_c; \
  36. c->prefix ## _pixels_tab idx [1] = prefix ## _pixels ## num ## _x2_8_c; \
  37. c->prefix ## _pixels_tab idx [2] = prefix ## _pixels ## num ## _y2_8_c; \
  38. c->prefix ## _pixels_tab idx [3] = prefix ## _pixels ## num ## _xy2_8_c
  39. hpel_funcs(put, [0], 16);
  40. hpel_funcs(put, [1], 8);
  41. hpel_funcs(put, [2], 4);
  42. hpel_funcs(put, [3], 2);
  43. hpel_funcs(put_no_rnd, [0], 16);
  44. hpel_funcs(put_no_rnd, [1], 8);
  45. hpel_funcs(avg, [0], 16);
  46. hpel_funcs(avg, [1], 8);
  47. hpel_funcs(avg, [2], 4);
  48. hpel_funcs(avg, [3], 2);
  49. hpel_funcs(avg_no_rnd,, 16);
  50. #if 0
  51. if (ARCH_X86) ff_hpeldsp_init_x86 (c, flags);
  52. if (ARCH_ARM) ff_hpeldsp_init_arm (c, flags);
  53. if (HAVE_VIS) ff_hpeldsp_init_vis (c, flags);
  54. if (ARCH_ALPHA) ff_hpeldsp_init_alpha (c, flags);
  55. if (ARCH_PPC) ff_hpeldsp_init_ppc (c, flags);
  56. if (ARCH_SH4) ff_hpeldsp_init_sh4 (c, flags);
  57. if (ARCH_BFIN) ff_hpeldsp_init_bfin (c, flags);
  58. #endif
  59. }