rotate_row.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223
  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(__native_client__) && defined(__x86_64__)) || \
  19. (defined(__i386__) && !defined(__SSE__) && !defined(__clang__))
  20. #define LIBYUV_DISABLE_X86
  21. #endif
  22. #if defined(__native_client__)
  23. #define LIBYUV_DISABLE_NEON
  24. #endif
  25. // MemorySanitizer does not support assembly code yet. http://crbug.com/344505
  26. #if defined(__has_feature)
  27. #if __has_feature(memory_sanitizer)
  28. #define LIBYUV_DISABLE_X86
  29. #endif
  30. #endif
  31. // The following are available for Visual C and clangcl 32 bit:
  32. #if !defined(LIBYUV_DISABLE_X86) && defined(_M_IX86) && defined(_MSC_VER)
  33. #define HAS_TRANSPOSEWX8_SSSE3
  34. #define HAS_TRANSPOSEUVWX8_SSE2
  35. #endif
  36. // The following are available for GCC 32 or 64 bit:
  37. #if !defined(LIBYUV_DISABLE_X86) && (defined(__i386__) || defined(__x86_64__))
  38. #define HAS_TRANSPOSEWX8_SSSE3
  39. #endif
  40. // The following are available for 64 bit GCC:
  41. #if !defined(LIBYUV_DISABLE_X86) && defined(__x86_64__)
  42. #define HAS_TRANSPOSEWX8_FAST_SSSE3
  43. #define HAS_TRANSPOSEUVWX8_SSE2
  44. #endif
  45. #if !defined(LIBYUV_DISABLE_NEON) && \
  46. (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
  47. #define HAS_TRANSPOSEWX8_NEON
  48. #define HAS_TRANSPOSEUVWX8_NEON
  49. #endif
  50. #if !defined(LIBYUV_DISABLE_MSA) && defined(__mips_msa)
  51. #define HAS_TRANSPOSEWX16_MSA
  52. #define HAS_TRANSPOSEUVWX16_MSA
  53. #endif
  54. #if !defined(LIBYUV_DISABLE_MMI) && defined(_MIPS_ARCH_LOONGSON3A)
  55. #define HAS_TRANSPOSEWX8_MMI
  56. #define HAS_TRANSPOSEUVWX8_MMI
  57. #endif
  58. void TransposeWxH_C(const uint8_t* src,
  59. int src_stride,
  60. uint8_t* dst,
  61. int dst_stride,
  62. int width,
  63. int height);
  64. void TransposeWx8_C(const uint8_t* src,
  65. int src_stride,
  66. uint8_t* dst,
  67. int dst_stride,
  68. int width);
  69. void TransposeWx16_C(const uint8_t* src,
  70. int src_stride,
  71. uint8_t* dst,
  72. int dst_stride,
  73. int width);
  74. void TransposeWx8_NEON(const uint8_t* src,
  75. int src_stride,
  76. uint8_t* dst,
  77. int dst_stride,
  78. int width);
  79. void TransposeWx8_SSSE3(const uint8_t* src,
  80. int src_stride,
  81. uint8_t* dst,
  82. int dst_stride,
  83. int width);
  84. void TransposeWx8_MMI(const uint8_t* src,
  85. int src_stride,
  86. uint8_t* dst,
  87. int dst_stride,
  88. int width);
  89. void TransposeWx8_Fast_SSSE3(const uint8_t* src,
  90. int src_stride,
  91. uint8_t* dst,
  92. int dst_stride,
  93. int width);
  94. void TransposeWx16_MSA(const uint8_t* src,
  95. int src_stride,
  96. uint8_t* dst,
  97. int dst_stride,
  98. int width);
  99. void TransposeWx8_Any_NEON(const uint8_t* src,
  100. int src_stride,
  101. uint8_t* dst,
  102. int dst_stride,
  103. int width);
  104. void TransposeWx8_Any_SSSE3(const uint8_t* src,
  105. int src_stride,
  106. uint8_t* dst,
  107. int dst_stride,
  108. int width);
  109. void TransposeWx8_Any_MMI(const uint8_t* src,
  110. int src_stride,
  111. uint8_t* dst,
  112. int dst_stride,
  113. int width);
  114. void TransposeWx8_Fast_Any_SSSE3(const uint8_t* src,
  115. int src_stride,
  116. uint8_t* dst,
  117. int dst_stride,
  118. int width);
  119. void TransposeWx16_Any_MSA(const uint8_t* src,
  120. int src_stride,
  121. uint8_t* dst,
  122. int dst_stride,
  123. int width);
  124. void TransposeUVWxH_C(const uint8_t* src,
  125. int src_stride,
  126. uint8_t* dst_a,
  127. int dst_stride_a,
  128. uint8_t* dst_b,
  129. int dst_stride_b,
  130. int width,
  131. int height);
  132. void TransposeUVWx8_C(const uint8_t* src,
  133. int src_stride,
  134. uint8_t* dst_a,
  135. int dst_stride_a,
  136. uint8_t* dst_b,
  137. int dst_stride_b,
  138. int width);
  139. void TransposeUVWx16_C(const uint8_t* src,
  140. int src_stride,
  141. uint8_t* dst_a,
  142. int dst_stride_a,
  143. uint8_t* dst_b,
  144. int dst_stride_b,
  145. int width);
  146. void TransposeUVWx8_SSE2(const uint8_t* src,
  147. int src_stride,
  148. uint8_t* dst_a,
  149. int dst_stride_a,
  150. uint8_t* dst_b,
  151. int dst_stride_b,
  152. int width);
  153. void TransposeUVWx8_NEON(const uint8_t* src,
  154. int src_stride,
  155. uint8_t* dst_a,
  156. int dst_stride_a,
  157. uint8_t* dst_b,
  158. int dst_stride_b,
  159. int width);
  160. void TransposeUVWx8_MMI(const uint8_t* src,
  161. int src_stride,
  162. uint8_t* dst_a,
  163. int dst_stride_a,
  164. uint8_t* dst_b,
  165. int dst_stride_b,
  166. int width);
  167. void TransposeUVWx16_MSA(const uint8_t* src,
  168. int src_stride,
  169. uint8_t* dst_a,
  170. int dst_stride_a,
  171. uint8_t* dst_b,
  172. int dst_stride_b,
  173. int width);
  174. void TransposeUVWx8_Any_SSE2(const uint8_t* src,
  175. int src_stride,
  176. uint8_t* dst_a,
  177. int dst_stride_a,
  178. uint8_t* dst_b,
  179. int dst_stride_b,
  180. int width);
  181. void TransposeUVWx8_Any_NEON(const uint8_t* src,
  182. int src_stride,
  183. uint8_t* dst_a,
  184. int dst_stride_a,
  185. uint8_t* dst_b,
  186. int dst_stride_b,
  187. int width);
  188. void TransposeUVWx8_Any_MMI(const uint8_t* src,
  189. int src_stride,
  190. uint8_t* dst_a,
  191. int dst_stride_a,
  192. uint8_t* dst_b,
  193. int dst_stride_b,
  194. int width);
  195. void TransposeUVWx16_Any_MSA(const uint8_t* src,
  196. int src_stride,
  197. uint8_t* dst_a,
  198. int dst_stride_a,
  199. uint8_t* dst_b,
  200. int dst_stride_b,
  201. int width);
  202. #ifdef __cplusplus
  203. } // extern "C"
  204. } // namespace libyuv
  205. #endif
  206. #endif // INCLUDE_LIBYUV_ROTATE_ROW_H_