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.

124 lines
4.3KB

  1. /*
  2. * This file is part of FFmpeg.
  3. *
  4. * FFmpeg is free software; you can redistribute it and/or
  5. * modify it under the terms of the GNU Lesser General Public
  6. * License as published by the Free Software Foundation; either
  7. * version 2.1 of the License, or (at your option) any later version.
  8. *
  9. * FFmpeg is distributed in the hope that it will be useful,
  10. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  12. * Lesser General Public License for more details.
  13. *
  14. * You should have received a copy of the GNU Lesser General Public
  15. * License along with FFmpeg; if not, write to the Free Software
  16. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  17. */
  18. #include <stdint.h>
  19. #include "libavutil/attributes.h"
  20. #include "libavcodec/vc1dsp.h"
  21. #include "vc1dsp.h"
  22. #include "config.h"
  23. void ff_vc1_inv_trans_8x8_neon(int16_t *block);
  24. void ff_vc1_inv_trans_4x8_neon(uint8_t *dest, int linesize, int16_t *block);
  25. void ff_vc1_inv_trans_8x4_neon(uint8_t *dest, int linesize, int16_t *block);
  26. void ff_vc1_inv_trans_4x4_neon(uint8_t *dest, int linesize, int16_t *block);
  27. void ff_vc1_inv_trans_8x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
  28. void ff_vc1_inv_trans_4x8_dc_neon(uint8_t *dest, int linesize, int16_t *block);
  29. void ff_vc1_inv_trans_8x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
  30. void ff_vc1_inv_trans_4x4_dc_neon(uint8_t *dest, int linesize, int16_t *block);
  31. void ff_put_pixels8x8_neon(uint8_t *block, const uint8_t *pixels,
  32. ptrdiff_t line_size, int rnd);
  33. #define DECL_PUT(X, Y) \
  34. void ff_put_vc1_mspel_mc##X##Y##_neon(uint8_t *dst, const uint8_t *src, \
  35. ptrdiff_t stride, int rnd); \
  36. static void ff_put_vc1_mspel_mc##X##Y##_16_neon(uint8_t *dst, const uint8_t *src, \
  37. ptrdiff_t stride, int rnd) \
  38. { \
  39. ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
  40. ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
  41. dst += 8*stride; src += 8*stride; \
  42. ff_put_vc1_mspel_mc##X##Y##_neon(dst+0, src+0, stride, rnd); \
  43. ff_put_vc1_mspel_mc##X##Y##_neon(dst+8, src+8, stride, rnd); \
  44. }
  45. DECL_PUT(1, 0)
  46. DECL_PUT(2, 0)
  47. DECL_PUT(3, 0)
  48. DECL_PUT(0, 1)
  49. DECL_PUT(0, 2)
  50. DECL_PUT(0, 3)
  51. DECL_PUT(1, 1)
  52. DECL_PUT(1, 2)
  53. DECL_PUT(1, 3)
  54. DECL_PUT(2, 1)
  55. DECL_PUT(2, 2)
  56. DECL_PUT(2, 3)
  57. DECL_PUT(3, 1)
  58. DECL_PUT(3, 2)
  59. DECL_PUT(3, 3)
  60. void ff_put_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
  61. int x, int y);
  62. void ff_avg_vc1_chroma_mc8_neon(uint8_t *dst, uint8_t *src, int stride, int h,
  63. int x, int y);
  64. void ff_put_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
  65. int x, int y);
  66. void ff_avg_vc1_chroma_mc4_neon(uint8_t *dst, uint8_t *src, int stride, int h,
  67. int x, int y);
  68. #define FN_ASSIGN(X, Y) \
  69. dsp->put_vc1_mspel_pixels_tab[0][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_16_neon; \
  70. dsp->put_vc1_mspel_pixels_tab[1][X+4*Y] = ff_put_vc1_mspel_mc##X##Y##_neon
  71. av_cold void ff_vc1dsp_init_neon(VC1DSPContext *dsp)
  72. {
  73. dsp->vc1_inv_trans_8x8 = ff_vc1_inv_trans_8x8_neon;
  74. dsp->vc1_inv_trans_4x8 = ff_vc1_inv_trans_4x8_neon;
  75. dsp->vc1_inv_trans_8x4 = ff_vc1_inv_trans_8x4_neon;
  76. dsp->vc1_inv_trans_4x4 = ff_vc1_inv_trans_4x4_neon;
  77. dsp->vc1_inv_trans_8x8_dc = ff_vc1_inv_trans_8x8_dc_neon;
  78. dsp->vc1_inv_trans_4x8_dc = ff_vc1_inv_trans_4x8_dc_neon;
  79. dsp->vc1_inv_trans_8x4_dc = ff_vc1_inv_trans_8x4_dc_neon;
  80. dsp->vc1_inv_trans_4x4_dc = ff_vc1_inv_trans_4x4_dc_neon;
  81. dsp->put_vc1_mspel_pixels_tab[1][ 0] = ff_put_pixels8x8_neon;
  82. if (HAVE_AS_DN_DIRECTIVE) {
  83. FN_ASSIGN(1, 0);
  84. FN_ASSIGN(2, 0);
  85. FN_ASSIGN(3, 0);
  86. FN_ASSIGN(0, 1);
  87. FN_ASSIGN(1, 1);
  88. FN_ASSIGN(2, 1);
  89. FN_ASSIGN(3, 1);
  90. FN_ASSIGN(0, 2);
  91. FN_ASSIGN(1, 2);
  92. FN_ASSIGN(2, 2);
  93. FN_ASSIGN(3, 2);
  94. FN_ASSIGN(0, 3);
  95. FN_ASSIGN(1, 3);
  96. FN_ASSIGN(2, 3);
  97. FN_ASSIGN(3, 3);
  98. }
  99. dsp->put_no_rnd_vc1_chroma_pixels_tab[0] = ff_put_vc1_chroma_mc8_neon;
  100. dsp->avg_no_rnd_vc1_chroma_pixels_tab[0] = ff_avg_vc1_chroma_mc8_neon;
  101. dsp->put_no_rnd_vc1_chroma_pixels_tab[1] = ff_put_vc1_chroma_mc4_neon;
  102. dsp->avg_no_rnd_vc1_chroma_pixels_tab[1] = ff_avg_vc1_chroma_mc4_neon;
  103. }