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.

164 lines
8.4KB

  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 "libavcodec/vp8dsp.h"
  20. void ff_vp8_luma_dc_wht_neon(DCTELEM block[4][4][16], DCTELEM dc[16]);
  21. void ff_vp8_luma_dc_wht_dc_neon(DCTELEM block[4][4][16], DCTELEM dc[16]);
  22. void ff_vp8_idct_add_neon(uint8_t *dst, DCTELEM block[16], int stride);
  23. void ff_vp8_idct_dc_add_neon(uint8_t *dst, DCTELEM block[16], int stride);
  24. void ff_vp8_idct_dc_add4y_neon(uint8_t *dst, DCTELEM block[4][16], int stride);
  25. void ff_vp8_idct_dc_add4uv_neon(uint8_t *dst, DCTELEM block[4][16], int stride);
  26. void ff_vp8_v_loop_filter16_neon(uint8_t *dst, int stride,
  27. int flim_E, int flim_I, int hev_thresh);
  28. void ff_vp8_h_loop_filter16_neon(uint8_t *dst, int stride,
  29. int flim_E, int flim_I, int hev_thresh);
  30. void ff_vp8_v_loop_filter8uv_neon(uint8_t *dstU, uint8_t *dstV, int stride,
  31. int flim_E, int flim_I, int hev_thresh);
  32. void ff_vp8_h_loop_filter8uv_neon(uint8_t *dstU, uint8_t *dstV, int stride,
  33. int flim_E, int flim_I, int hev_thresh);
  34. void ff_vp8_v_loop_filter16_inner_neon(uint8_t *dst, int stride,
  35. int flim_E, int flim_I, int hev_thresh);
  36. void ff_vp8_h_loop_filter16_inner_neon(uint8_t *dst, int stride,
  37. int flim_E, int flim_I, int hev_thresh);
  38. void ff_vp8_v_loop_filter8uv_inner_neon(uint8_t *dstU, uint8_t *dstV,
  39. int stride, int flim_E, int flim_I,
  40. int hev_thresh);
  41. void ff_vp8_h_loop_filter8uv_inner_neon(uint8_t *dstU, uint8_t *dstV,
  42. int stride, int flim_E, int flim_I,
  43. int hev_thresh);
  44. void ff_vp8_v_loop_filter16_simple_neon(uint8_t *dst, int stride, int flim);
  45. void ff_vp8_h_loop_filter16_simple_neon(uint8_t *dst, int stride, int flim);
  46. #define VP8_MC(n) \
  47. void ff_put_vp8_##n##_neon(uint8_t *dst, int dststride, \
  48. uint8_t *src, int srcstride, \
  49. int h, int x, int y)
  50. #define VP8_EPEL(w) \
  51. VP8_MC(pixels ## w); \
  52. VP8_MC(epel ## w ## _h4); \
  53. VP8_MC(epel ## w ## _h6); \
  54. VP8_MC(epel ## w ## _v4); \
  55. VP8_MC(epel ## w ## _h4v4); \
  56. VP8_MC(epel ## w ## _h6v4); \
  57. VP8_MC(epel ## w ## _v6); \
  58. VP8_MC(epel ## w ## _h4v6); \
  59. VP8_MC(epel ## w ## _h6v6)
  60. VP8_EPEL(16);
  61. VP8_EPEL(8);
  62. VP8_EPEL(4);
  63. VP8_MC(bilin16_h);
  64. VP8_MC(bilin16_v);
  65. VP8_MC(bilin16_hv);
  66. VP8_MC(bilin8_h);
  67. VP8_MC(bilin8_v);
  68. VP8_MC(bilin8_hv);
  69. VP8_MC(bilin4_h);
  70. VP8_MC(bilin4_v);
  71. VP8_MC(bilin4_hv);
  72. av_cold void ff_vp8dsp_init_arm(VP8DSPContext *dsp)
  73. {
  74. if (HAVE_NEON) {
  75. dsp->vp8_luma_dc_wht = ff_vp8_luma_dc_wht_neon;
  76. dsp->vp8_luma_dc_wht_dc = ff_vp8_luma_dc_wht_dc_neon;
  77. dsp->vp8_idct_add = ff_vp8_idct_add_neon;
  78. dsp->vp8_idct_dc_add = ff_vp8_idct_dc_add_neon;
  79. dsp->vp8_idct_dc_add4y = ff_vp8_idct_dc_add4y_neon;
  80. dsp->vp8_idct_dc_add4uv = ff_vp8_idct_dc_add4uv_neon;
  81. dsp->vp8_v_loop_filter16y = ff_vp8_v_loop_filter16_neon;
  82. dsp->vp8_h_loop_filter16y = ff_vp8_h_loop_filter16_neon;
  83. dsp->vp8_v_loop_filter8uv = ff_vp8_v_loop_filter8uv_neon;
  84. dsp->vp8_h_loop_filter8uv = ff_vp8_h_loop_filter8uv_neon;
  85. dsp->vp8_v_loop_filter16y_inner = ff_vp8_v_loop_filter16_inner_neon;
  86. dsp->vp8_h_loop_filter16y_inner = ff_vp8_h_loop_filter16_inner_neon;
  87. dsp->vp8_v_loop_filter8uv_inner = ff_vp8_v_loop_filter8uv_inner_neon;
  88. dsp->vp8_h_loop_filter8uv_inner = ff_vp8_h_loop_filter8uv_inner_neon;
  89. dsp->vp8_v_loop_filter_simple = ff_vp8_v_loop_filter16_simple_neon;
  90. dsp->vp8_h_loop_filter_simple = ff_vp8_h_loop_filter16_simple_neon;
  91. dsp->put_vp8_epel_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon;
  92. dsp->put_vp8_epel_pixels_tab[0][0][2] = ff_put_vp8_epel16_h6_neon;
  93. dsp->put_vp8_epel_pixels_tab[0][2][0] = ff_put_vp8_epel16_v6_neon;
  94. dsp->put_vp8_epel_pixels_tab[0][2][2] = ff_put_vp8_epel16_h6v6_neon;
  95. dsp->put_vp8_epel_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon;
  96. dsp->put_vp8_epel_pixels_tab[1][0][1] = ff_put_vp8_epel8_h4_neon;
  97. dsp->put_vp8_epel_pixels_tab[1][0][2] = ff_put_vp8_epel8_h6_neon;
  98. dsp->put_vp8_epel_pixels_tab[1][1][0] = ff_put_vp8_epel8_v4_neon;
  99. dsp->put_vp8_epel_pixels_tab[1][1][1] = ff_put_vp8_epel8_h4v4_neon;
  100. dsp->put_vp8_epel_pixels_tab[1][1][2] = ff_put_vp8_epel8_h6v4_neon;
  101. dsp->put_vp8_epel_pixels_tab[1][2][0] = ff_put_vp8_epel8_v6_neon;
  102. dsp->put_vp8_epel_pixels_tab[1][2][1] = ff_put_vp8_epel8_h4v6_neon;
  103. dsp->put_vp8_epel_pixels_tab[1][2][2] = ff_put_vp8_epel8_h6v6_neon;
  104. dsp->put_vp8_epel_pixels_tab[2][0][0] = ff_put_vp8_pixels4_neon;
  105. dsp->put_vp8_epel_pixels_tab[2][0][1] = ff_put_vp8_epel4_h4_neon;
  106. dsp->put_vp8_epel_pixels_tab[2][0][2] = ff_put_vp8_epel4_h6_neon;
  107. dsp->put_vp8_epel_pixels_tab[2][1][0] = ff_put_vp8_epel4_v4_neon;
  108. dsp->put_vp8_epel_pixels_tab[2][1][1] = ff_put_vp8_epel4_h4v4_neon;
  109. dsp->put_vp8_epel_pixels_tab[2][1][2] = ff_put_vp8_epel4_h6v4_neon;
  110. dsp->put_vp8_epel_pixels_tab[2][2][0] = ff_put_vp8_epel4_v6_neon;
  111. dsp->put_vp8_epel_pixels_tab[2][2][1] = ff_put_vp8_epel4_h4v6_neon;
  112. dsp->put_vp8_epel_pixels_tab[2][2][2] = ff_put_vp8_epel4_h6v6_neon;
  113. dsp->put_vp8_bilinear_pixels_tab[0][0][0] = ff_put_vp8_pixels16_neon;
  114. dsp->put_vp8_bilinear_pixels_tab[0][0][1] = ff_put_vp8_bilin16_h_neon;
  115. dsp->put_vp8_bilinear_pixels_tab[0][0][2] = ff_put_vp8_bilin16_h_neon;
  116. dsp->put_vp8_bilinear_pixels_tab[0][1][0] = ff_put_vp8_bilin16_v_neon;
  117. dsp->put_vp8_bilinear_pixels_tab[0][1][1] = ff_put_vp8_bilin16_hv_neon;
  118. dsp->put_vp8_bilinear_pixels_tab[0][1][2] = ff_put_vp8_bilin16_hv_neon;
  119. dsp->put_vp8_bilinear_pixels_tab[0][2][0] = ff_put_vp8_bilin16_v_neon;
  120. dsp->put_vp8_bilinear_pixels_tab[0][2][1] = ff_put_vp8_bilin16_hv_neon;
  121. dsp->put_vp8_bilinear_pixels_tab[0][2][2] = ff_put_vp8_bilin16_hv_neon;
  122. dsp->put_vp8_bilinear_pixels_tab[1][0][0] = ff_put_vp8_pixels8_neon;
  123. dsp->put_vp8_bilinear_pixels_tab[1][0][1] = ff_put_vp8_bilin8_h_neon;
  124. dsp->put_vp8_bilinear_pixels_tab[1][0][2] = ff_put_vp8_bilin8_h_neon;
  125. dsp->put_vp8_bilinear_pixels_tab[1][1][0] = ff_put_vp8_bilin8_v_neon;
  126. dsp->put_vp8_bilinear_pixels_tab[1][1][1] = ff_put_vp8_bilin8_hv_neon;
  127. dsp->put_vp8_bilinear_pixels_tab[1][1][2] = ff_put_vp8_bilin8_hv_neon;
  128. dsp->put_vp8_bilinear_pixels_tab[1][2][0] = ff_put_vp8_bilin8_v_neon;
  129. dsp->put_vp8_bilinear_pixels_tab[1][2][1] = ff_put_vp8_bilin8_hv_neon;
  130. dsp->put_vp8_bilinear_pixels_tab[1][2][2] = ff_put_vp8_bilin8_hv_neon;
  131. dsp->put_vp8_bilinear_pixels_tab[2][0][0] = ff_put_vp8_pixels4_neon;
  132. dsp->put_vp8_bilinear_pixels_tab[2][0][1] = ff_put_vp8_bilin4_h_neon;
  133. dsp->put_vp8_bilinear_pixels_tab[2][0][2] = ff_put_vp8_bilin4_h_neon;
  134. dsp->put_vp8_bilinear_pixels_tab[2][1][0] = ff_put_vp8_bilin4_v_neon;
  135. dsp->put_vp8_bilinear_pixels_tab[2][1][1] = ff_put_vp8_bilin4_hv_neon;
  136. dsp->put_vp8_bilinear_pixels_tab[2][1][2] = ff_put_vp8_bilin4_hv_neon;
  137. dsp->put_vp8_bilinear_pixels_tab[2][2][0] = ff_put_vp8_bilin4_v_neon;
  138. dsp->put_vp8_bilinear_pixels_tab[2][2][1] = ff_put_vp8_bilin4_hv_neon;
  139. dsp->put_vp8_bilinear_pixels_tab[2][2][2] = ff_put_vp8_bilin4_hv_neon;
  140. }
  141. }