rotate_row.h 8.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228
  1. /*
  2. * Copyright 2013 The LibYuv Project Authors. All rights reserved.
  3. *
  4. * Use of this source code is governed by a BSD-style license
  5. * that can be found in the LICENSE file in the root of the source
  6. * tree. An additional intellectual property rights grant can be found
  7. * in the file PATENTS. All contributing project authors may
  8. * be found in the AUTHORS file in the root of the source tree.
  9. */
  10. #ifndef INCLUDE_LIBYUV_ROTATE_ROW_H_
  11. #define INCLUDE_LIBYUV_ROTATE_ROW_H_
  12. #include "libyuv/basic_types.h"
  13. #ifdef __cplusplus
  14. namespace libyuv {
  15. extern "C" {
  16. #endif
  17. #if defined(__pnacl__) || defined(__CLR_VER) || \
  18. (defined(__i386__) && !defined(__SSE__) && !defined(__clang__))
  19. #define LIBYUV_DISABLE_X86
  20. #endif
  21. // MemorySanitizer does not support assembly code yet. http://crbug.com/344505
  22. #if defined(__has_feature)
  23. #if __has_feature(memory_sanitizer)
  24. #define LIBYUV_DISABLE_X86
  25. #endif
  26. #endif
  27. // The following are available for Visual C and clangcl 32 bit:
  28. #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER)
  29. #define HAS_TRANSPOSEWX8_SSSE3
  30. #define HAS_TRANSPOSEUVWX8_SSE2
  31. #endif
  32. // The following are available for GCC 32 or 64 bit but not NaCL for 64 bit:
  33. #if !defined(LIBYUV_DISABLE_X86) && \
  34. (defined(__i386__) || \
  35. (defined(__x86_64__) && !defined(__native_client__)))
  36. #define HAS_TRANSPOSEWX8_SSSE3
  37. #endif
  38. // The following are available for 64 bit GCC but not NaCL:
  39. #if !defined(LIBYUV_DISABLE_X86) && !defined(__native_client__) && \
  40. defined(__x86_64__)
  41. #define HAS_TRANSPOSEWX8_FAST_SSSE3
  42. #define HAS_TRANSPOSEUVWX8_SSE2
  43. #endif
  44. #if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \
  45. (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
  46. #define HAS_TRANSPOSEWX8_NEON
  47. #define HAS_TRANSPOSEUVWX8_NEON
  48. #endif
  49. #if !defined(LIBYUV_DISABLE_DSPR2) && !defined(__native_client__) && \
  50. defined(__mips__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2)
  51. #define HAS_TRANSPOSEWX8_DSPR2
  52. #define HAS_TRANSPOSEUVWX8_DSPR2
  53. #endif // defined(__mips__)
  54. #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
  55. #define HAS_TRANSPOSEWX16_MSA
  56. #define HAS_TRANSPOSEUVWX16_MSA
  57. #endif
  58. void TransposeWxH_C(const uint8* src,
  59. int src_stride,
  60. uint8* dst,
  61. int dst_stride,
  62. int width,
  63. int height);
  64. void TransposeWx8_C(const uint8* src,
  65. int src_stride,
  66. uint8* dst,
  67. int dst_stride,
  68. int width);
  69. void TransposeWx16_C(const uint8* src,
  70. int src_stride,
  71. uint8* dst,
  72. int dst_stride,
  73. int width);
  74. void TransposeWx8_NEON(const uint8* src,
  75. int src_stride,
  76. uint8* dst,
  77. int dst_stride,
  78. int width);
  79. void TransposeWx8_SSSE3(const uint8* src,
  80. int src_stride,
  81. uint8* dst,
  82. int dst_stride,
  83. int width);
  84. void TransposeWx8_Fast_SSSE3(const uint8* src,
  85. int src_stride,
  86. uint8* dst,
  87. int dst_stride,
  88. int width);
  89. void TransposeWx8_DSPR2(const uint8* src,
  90. int src_stride,
  91. uint8* dst,
  92. int dst_stride,
  93. int width);
  94. void TransposeWx8_Fast_DSPR2(const uint8* src,
  95. int src_stride,
  96. uint8* dst,
  97. int dst_stride,
  98. int width);
  99. void TransposeWx16_MSA(const uint8* src,
  100. int src_stride,
  101. uint8* dst,
  102. int dst_stride,
  103. int width);
  104. void TransposeWx8_Any_NEON(const uint8* src,
  105. int src_stride,
  106. uint8* dst,
  107. int dst_stride,
  108. int width);
  109. void TransposeWx8_Any_SSSE3(const uint8* src,
  110. int src_stride,
  111. uint8* dst,
  112. int dst_stride,
  113. int width);
  114. void TransposeWx8_Fast_Any_SSSE3(const uint8* src,
  115. int src_stride,
  116. uint8* dst,
  117. int dst_stride,
  118. int width);
  119. void TransposeWx8_Any_DSPR2(const uint8* src,
  120. int src_stride,
  121. uint8* dst,
  122. int dst_stride,
  123. int width);
  124. void TransposeWx16_Any_MSA(const uint8* src,
  125. int src_stride,
  126. uint8* dst,
  127. int dst_stride,
  128. int width);
  129. void TransposeUVWxH_C(const uint8* src,
  130. int src_stride,
  131. uint8* dst_a,
  132. int dst_stride_a,
  133. uint8* dst_b,
  134. int dst_stride_b,
  135. int width,
  136. int height);
  137. void TransposeUVWx8_C(const uint8* src,
  138. int src_stride,
  139. uint8* dst_a,
  140. int dst_stride_a,
  141. uint8* dst_b,
  142. int dst_stride_b,
  143. int width);
  144. void TransposeUVWx16_C(const uint8* src,
  145. int src_stride,
  146. uint8* dst_a,
  147. int dst_stride_a,
  148. uint8* dst_b,
  149. int dst_stride_b,
  150. int width);
  151. void TransposeUVWx8_SSE2(const uint8* src,
  152. int src_stride,
  153. uint8* dst_a,
  154. int dst_stride_a,
  155. uint8* dst_b,
  156. int dst_stride_b,
  157. int width);
  158. void TransposeUVWx8_NEON(const uint8* src,
  159. int src_stride,
  160. uint8* dst_a,
  161. int dst_stride_a,
  162. uint8* dst_b,
  163. int dst_stride_b,
  164. int width);
  165. void TransposeUVWx8_DSPR2(const uint8* src,
  166. int src_stride,
  167. uint8* dst_a,
  168. int dst_stride_a,
  169. uint8* dst_b,
  170. int dst_stride_b,
  171. int width);
  172. void TransposeUVWx16_MSA(const uint8* src,
  173. int src_stride,
  174. uint8* dst_a,
  175. int dst_stride_a,
  176. uint8* dst_b,
  177. int dst_stride_b,
  178. int width);
  179. void TransposeUVWx8_Any_SSE2(const uint8* src,
  180. int src_stride,
  181. uint8* dst_a,
  182. int dst_stride_a,
  183. uint8* dst_b,
  184. int dst_stride_b,
  185. int width);
  186. void TransposeUVWx8_Any_NEON(const uint8* src,
  187. int src_stride,
  188. uint8* dst_a,
  189. int dst_stride_a,
  190. uint8* dst_b,
  191. int dst_stride_b,
  192. int width);
  193. void TransposeUVWx8_Any_DSPR2(const uint8* src,
  194. int src_stride,
  195. uint8* dst_a,
  196. int dst_stride_a,
  197. uint8* dst_b,
  198. int dst_stride_b,
  199. int width);
  200. void TransposeUVWx16_Any_MSA(const uint8* src,
  201. int src_stride,
  202. uint8* dst_a,
  203. int dst_stride_a,
  204. uint8* dst_b,
  205. int dst_stride_b,
  206. int width);
  207. #ifdef __cplusplus
  208. } // extern "C"
  209. } // namespace libyuv
  210. #endif
  211. #endif // INCLUDE_LIBYUV_ROTATE_ROW_H_