row_any.cc 46 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112
  1. /*
  2. * Copyright 2012 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. #include "libyuv/row.h"
  11. #include <string.h> // For memset.
  12. #include "libyuv/basic_types.h"
  13. #ifdef __cplusplus
  14. namespace libyuv {
  15. extern "C" {
  16. #endif
  17. // memset for temp is meant to clear the source buffer (not dest) so that
  18. // SIMD that reads full multiple of 16 bytes will not trigger msan errors.
  19. // memset is not needed for production, as the garbage values are processed but
  20. // not used, although there may be edge cases for subsampling.
  21. // The size of the buffer is based on the largest read, which can be inferred
  22. // by the source type (e.g. ARGB) and the mask (last parameter), or by examining
  23. // the source code for how much the source pointers are advanced.
  24. // Subsampled source needs to be increase by 1 of not even.
  25. #define SS(width, shift) (((width) + (1 << (shift)) - 1) >> (shift))
  26. // Any 4 planes to 1 with yuvconstants
  27. #define ANY41C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \
  28. void NAMEANY(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, \
  29. const uint8* a_buf, uint8* dst_ptr, \
  30. const struct YuvConstants* yuvconstants, int width) { \
  31. SIMD_ALIGNED(uint8 temp[64 * 5]); \
  32. memset(temp, 0, 64 * 4); /* for msan */ \
  33. int r = width & MASK; \
  34. int n = width & ~MASK; \
  35. if (n > 0) { \
  36. ANY_SIMD(y_buf, u_buf, v_buf, a_buf, dst_ptr, yuvconstants, n); \
  37. } \
  38. memcpy(temp, y_buf + n, r); \
  39. memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \
  40. memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \
  41. memcpy(temp + 192, a_buf + n, r); \
  42. ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, temp + 256, \
  43. yuvconstants, MASK + 1); \
  44. memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 256, \
  45. SS(r, DUVSHIFT) * BPP); \
  46. }
  47. #ifdef HAS_I422ALPHATOARGBROW_SSSE3
  48. ANY41C(I422AlphaToARGBRow_Any_SSSE3, I422AlphaToARGBRow_SSSE3, 1, 0, 4, 7)
  49. #endif
  50. #ifdef HAS_I422ALPHATOARGBROW_AVX2
  51. ANY41C(I422AlphaToARGBRow_Any_AVX2, I422AlphaToARGBRow_AVX2, 1, 0, 4, 15)
  52. #endif
  53. #ifdef HAS_I422ALPHATOARGBROW_NEON
  54. ANY41C(I422AlphaToARGBRow_Any_NEON, I422AlphaToARGBRow_NEON, 1, 0, 4, 7)
  55. #endif
  56. #ifdef HAS_I422ALPHATOARGBROW_MSA
  57. ANY41C(I422AlphaToARGBRow_Any_MSA, I422AlphaToARGBRow_MSA, 1, 0, 4, 7)
  58. #endif
  59. #undef ANY41C
  60. // Any 3 planes to 1.
  61. #define ANY31(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \
  62. void NAMEANY(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, \
  63. uint8* dst_ptr, int width) { \
  64. SIMD_ALIGNED(uint8 temp[64 * 4]); \
  65. memset(temp, 0, 64 * 3); /* for YUY2 and msan */ \
  66. int r = width & MASK; \
  67. int n = width & ~MASK; \
  68. if (n > 0) { \
  69. ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, n); \
  70. } \
  71. memcpy(temp, y_buf + n, r); \
  72. memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \
  73. memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \
  74. ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, MASK + 1); \
  75. memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192, \
  76. SS(r, DUVSHIFT) * BPP); \
  77. }
  78. // Merge functions.
  79. #ifdef HAS_MERGERGBROW_SSSE3
  80. ANY31(MergeRGBRow_Any_SSSE3, MergeRGBRow_SSSE3, 0, 0, 3, 15)
  81. #endif
  82. #ifdef HAS_MERGERGBROW_NEON
  83. ANY31(MergeRGBRow_Any_NEON, MergeRGBRow_NEON, 0, 0, 3, 15)
  84. #endif
  85. #ifdef HAS_I422TOYUY2ROW_SSE2
  86. ANY31(I422ToYUY2Row_Any_SSE2, I422ToYUY2Row_SSE2, 1, 1, 4, 15)
  87. ANY31(I422ToUYVYRow_Any_SSE2, I422ToUYVYRow_SSE2, 1, 1, 4, 15)
  88. #endif
  89. #ifdef HAS_I422TOYUY2ROW_NEON
  90. ANY31(I422ToYUY2Row_Any_NEON, I422ToYUY2Row_NEON, 1, 1, 4, 15)
  91. #endif
  92. #ifdef HAS_I422TOYUY2ROW_MSA
  93. ANY31(I422ToYUY2Row_Any_MSA, I422ToYUY2Row_MSA, 1, 1, 4, 31)
  94. #endif
  95. #ifdef HAS_I422TOUYVYROW_NEON
  96. ANY31(I422ToUYVYRow_Any_NEON, I422ToUYVYRow_NEON, 1, 1, 4, 15)
  97. #endif
  98. #ifdef HAS_I422TOUYVYROW_MSA
  99. ANY31(I422ToUYVYRow_Any_MSA, I422ToUYVYRow_MSA, 1, 1, 4, 31)
  100. #endif
  101. #ifdef HAS_BLENDPLANEROW_AVX2
  102. ANY31(BlendPlaneRow_Any_AVX2, BlendPlaneRow_AVX2, 0, 0, 1, 31)
  103. #endif
  104. #ifdef HAS_BLENDPLANEROW_SSSE3
  105. ANY31(BlendPlaneRow_Any_SSSE3, BlendPlaneRow_SSSE3, 0, 0, 1, 7)
  106. #endif
  107. #undef ANY31
  108. // Note that odd width replication includes 444 due to implementation
  109. // on arm that subsamples 444 to 422 internally.
  110. // Any 3 planes to 1 with yuvconstants
  111. #define ANY31C(NAMEANY, ANY_SIMD, UVSHIFT, DUVSHIFT, BPP, MASK) \
  112. void NAMEANY(const uint8* y_buf, const uint8* u_buf, const uint8* v_buf, \
  113. uint8* dst_ptr, const struct YuvConstants* yuvconstants, \
  114. int width) { \
  115. SIMD_ALIGNED(uint8 temp[64 * 4]); \
  116. memset(temp, 0, 64 * 3); /* for YUY2 and msan */ \
  117. int r = width & MASK; \
  118. int n = width & ~MASK; \
  119. if (n > 0) { \
  120. ANY_SIMD(y_buf, u_buf, v_buf, dst_ptr, yuvconstants, n); \
  121. } \
  122. memcpy(temp, y_buf + n, r); \
  123. memcpy(temp + 64, u_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \
  124. memcpy(temp + 128, v_buf + (n >> UVSHIFT), SS(r, UVSHIFT)); \
  125. if (width & 1) { \
  126. temp[64 + SS(r, UVSHIFT)] = temp[64 + SS(r, UVSHIFT) - 1]; \
  127. temp[128 + SS(r, UVSHIFT)] = temp[128 + SS(r, UVSHIFT) - 1]; \
  128. } \
  129. ANY_SIMD(temp, temp + 64, temp + 128, temp + 192, yuvconstants, MASK + 1); \
  130. memcpy(dst_ptr + (n >> DUVSHIFT) * BPP, temp + 192, \
  131. SS(r, DUVSHIFT) * BPP); \
  132. }
  133. #ifdef HAS_I422TOARGBROW_SSSE3
  134. ANY31C(I422ToARGBRow_Any_SSSE3, I422ToARGBRow_SSSE3, 1, 0, 4, 7)
  135. #endif
  136. #ifdef HAS_I444TOARGBROW_SSSE3
  137. ANY31C(I444ToARGBRow_Any_SSSE3, I444ToARGBRow_SSSE3, 0, 0, 4, 7)
  138. ANY31C(I422ToRGBARow_Any_SSSE3, I422ToRGBARow_SSSE3, 1, 0, 4, 7)
  139. ANY31C(I422ToARGB4444Row_Any_SSSE3, I422ToARGB4444Row_SSSE3, 1, 0, 2, 7)
  140. ANY31C(I422ToARGB1555Row_Any_SSSE3, I422ToARGB1555Row_SSSE3, 1, 0, 2, 7)
  141. ANY31C(I422ToRGB565Row_Any_SSSE3, I422ToRGB565Row_SSSE3, 1, 0, 2, 7)
  142. ANY31C(I422ToRGB24Row_Any_SSSE3, I422ToRGB24Row_SSSE3, 1, 0, 3, 7)
  143. #endif // HAS_I444TOARGBROW_SSSE3
  144. #ifdef HAS_I422TORGB24ROW_AVX2
  145. ANY31C(I422ToRGB24Row_Any_AVX2, I422ToRGB24Row_AVX2, 1, 0, 3, 15)
  146. #endif
  147. #ifdef HAS_I422TOARGBROW_AVX2
  148. ANY31C(I422ToARGBRow_Any_AVX2, I422ToARGBRow_AVX2, 1, 0, 4, 15)
  149. #endif
  150. #ifdef HAS_I422TORGBAROW_AVX2
  151. ANY31C(I422ToRGBARow_Any_AVX2, I422ToRGBARow_AVX2, 1, 0, 4, 15)
  152. #endif
  153. #ifdef HAS_I444TOARGBROW_AVX2
  154. ANY31C(I444ToARGBRow_Any_AVX2, I444ToARGBRow_AVX2, 0, 0, 4, 15)
  155. #endif
  156. #ifdef HAS_I422TOARGB4444ROW_AVX2
  157. ANY31C(I422ToARGB4444Row_Any_AVX2, I422ToARGB4444Row_AVX2, 1, 0, 2, 15)
  158. #endif
  159. #ifdef HAS_I422TOARGB1555ROW_AVX2
  160. ANY31C(I422ToARGB1555Row_Any_AVX2, I422ToARGB1555Row_AVX2, 1, 0, 2, 15)
  161. #endif
  162. #ifdef HAS_I422TORGB565ROW_AVX2
  163. ANY31C(I422ToRGB565Row_Any_AVX2, I422ToRGB565Row_AVX2, 1, 0, 2, 15)
  164. #endif
  165. #ifdef HAS_I422TOARGBROW_NEON
  166. ANY31C(I444ToARGBRow_Any_NEON, I444ToARGBRow_NEON, 0, 0, 4, 7)
  167. ANY31C(I422ToARGBRow_Any_NEON, I422ToARGBRow_NEON, 1, 0, 4, 7)
  168. ANY31C(I422ToRGBARow_Any_NEON, I422ToRGBARow_NEON, 1, 0, 4, 7)
  169. ANY31C(I422ToRGB24Row_Any_NEON, I422ToRGB24Row_NEON, 1, 0, 3, 7)
  170. ANY31C(I422ToARGB4444Row_Any_NEON, I422ToARGB4444Row_NEON, 1, 0, 2, 7)
  171. ANY31C(I422ToARGB1555Row_Any_NEON, I422ToARGB1555Row_NEON, 1, 0, 2, 7)
  172. ANY31C(I422ToRGB565Row_Any_NEON, I422ToRGB565Row_NEON, 1, 0, 2, 7)
  173. #endif
  174. #ifdef HAS_I422TOARGBROW_DSPR2
  175. ANY31C(I444ToARGBRow_Any_DSPR2, I444ToARGBRow_DSPR2, 0, 0, 4, 7)
  176. ANY31C(I422ToARGBRow_Any_DSPR2, I422ToARGBRow_DSPR2, 1, 0, 4, 7)
  177. ANY31C(I422ToARGB4444Row_Any_DSPR2, I422ToARGB4444Row_DSPR2, 1, 0, 2, 7)
  178. ANY31C(I422ToARGB1555Row_Any_DSPR2, I422ToARGB1555Row_DSPR2, 1, 0, 2, 7)
  179. #endif
  180. #ifdef HAS_I422TOARGBROW_MSA
  181. ANY31C(I444ToARGBRow_Any_MSA, I444ToARGBRow_MSA, 0, 0, 4, 7)
  182. ANY31C(I422ToARGBRow_Any_MSA, I422ToARGBRow_MSA, 1, 0, 4, 7)
  183. ANY31C(I422ToRGBARow_Any_MSA, I422ToRGBARow_MSA, 1, 0, 4, 7)
  184. ANY31C(I422ToRGB24Row_Any_MSA, I422ToRGB24Row_MSA, 1, 0, 3, 15)
  185. ANY31C(I422ToARGB4444Row_Any_MSA, I422ToARGB4444Row_MSA, 1, 0, 2, 7)
  186. ANY31C(I422ToARGB1555Row_Any_MSA, I422ToARGB1555Row_MSA, 1, 0, 2, 7)
  187. ANY31C(I422ToRGB565Row_Any_MSA, I422ToRGB565Row_MSA, 1, 0, 2, 7)
  188. #endif
  189. #undef ANY31C
  190. // Any 2 planes to 1.
  191. #define ANY21(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, SBPP2, BPP, MASK) \
  192. void NAMEANY(const uint8* y_buf, const uint8* uv_buf, uint8* dst_ptr, \
  193. int width) { \
  194. SIMD_ALIGNED(uint8 temp[64 * 3]); \
  195. memset(temp, 0, 64 * 2); /* for msan */ \
  196. int r = width & MASK; \
  197. int n = width & ~MASK; \
  198. if (n > 0) { \
  199. ANY_SIMD(y_buf, uv_buf, dst_ptr, n); \
  200. } \
  201. memcpy(temp, y_buf + n * SBPP, r * SBPP); \
  202. memcpy(temp + 64, uv_buf + (n >> UVSHIFT) * SBPP2, \
  203. SS(r, UVSHIFT) * SBPP2); \
  204. ANY_SIMD(temp, temp + 64, temp + 128, MASK + 1); \
  205. memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \
  206. }
  207. // Merge functions.
  208. #ifdef HAS_MERGEUVROW_SSE2
  209. ANY21(MergeUVRow_Any_SSE2, MergeUVRow_SSE2, 0, 1, 1, 2, 15)
  210. #endif
  211. #ifdef HAS_MERGEUVROW_AVX2
  212. ANY21(MergeUVRow_Any_AVX2, MergeUVRow_AVX2, 0, 1, 1, 2, 31)
  213. #endif
  214. #ifdef HAS_MERGEUVROW_NEON
  215. ANY21(MergeUVRow_Any_NEON, MergeUVRow_NEON, 0, 1, 1, 2, 15)
  216. #endif
  217. #ifdef HAS_MERGEUVROW_MSA
  218. ANY21(MergeUVRow_Any_MSA, MergeUVRow_MSA, 0, 1, 1, 2, 15)
  219. #endif
  220. // Math functions.
  221. #ifdef HAS_ARGBMULTIPLYROW_SSE2
  222. ANY21(ARGBMultiplyRow_Any_SSE2, ARGBMultiplyRow_SSE2, 0, 4, 4, 4, 3)
  223. #endif
  224. #ifdef HAS_ARGBADDROW_SSE2
  225. ANY21(ARGBAddRow_Any_SSE2, ARGBAddRow_SSE2, 0, 4, 4, 4, 3)
  226. #endif
  227. #ifdef HAS_ARGBSUBTRACTROW_SSE2
  228. ANY21(ARGBSubtractRow_Any_SSE2, ARGBSubtractRow_SSE2, 0, 4, 4, 4, 3)
  229. #endif
  230. #ifdef HAS_ARGBMULTIPLYROW_AVX2
  231. ANY21(ARGBMultiplyRow_Any_AVX2, ARGBMultiplyRow_AVX2, 0, 4, 4, 4, 7)
  232. #endif
  233. #ifdef HAS_ARGBADDROW_AVX2
  234. ANY21(ARGBAddRow_Any_AVX2, ARGBAddRow_AVX2, 0, 4, 4, 4, 7)
  235. #endif
  236. #ifdef HAS_ARGBSUBTRACTROW_AVX2
  237. ANY21(ARGBSubtractRow_Any_AVX2, ARGBSubtractRow_AVX2, 0, 4, 4, 4, 7)
  238. #endif
  239. #ifdef HAS_ARGBMULTIPLYROW_NEON
  240. ANY21(ARGBMultiplyRow_Any_NEON, ARGBMultiplyRow_NEON, 0, 4, 4, 4, 7)
  241. #endif
  242. #ifdef HAS_ARGBADDROW_NEON
  243. ANY21(ARGBAddRow_Any_NEON, ARGBAddRow_NEON, 0, 4, 4, 4, 7)
  244. #endif
  245. #ifdef HAS_ARGBSUBTRACTROW_NEON
  246. ANY21(ARGBSubtractRow_Any_NEON, ARGBSubtractRow_NEON, 0, 4, 4, 4, 7)
  247. #endif
  248. #ifdef HAS_ARGBMULTIPLYROW_MSA
  249. ANY21(ARGBMultiplyRow_Any_MSA, ARGBMultiplyRow_MSA, 0, 4, 4, 4, 3)
  250. #endif
  251. #ifdef HAS_ARGBADDROW_MSA
  252. ANY21(ARGBAddRow_Any_MSA, ARGBAddRow_MSA, 0, 4, 4, 4, 7)
  253. #endif
  254. #ifdef HAS_ARGBSUBTRACTROW_MSA
  255. ANY21(ARGBSubtractRow_Any_MSA, ARGBSubtractRow_MSA, 0, 4, 4, 4, 7)
  256. #endif
  257. #ifdef HAS_SOBELROW_SSE2
  258. ANY21(SobelRow_Any_SSE2, SobelRow_SSE2, 0, 1, 1, 4, 15)
  259. #endif
  260. #ifdef HAS_SOBELROW_NEON
  261. ANY21(SobelRow_Any_NEON, SobelRow_NEON, 0, 1, 1, 4, 7)
  262. #endif
  263. #ifdef HAS_SOBELROW_MSA
  264. ANY21(SobelRow_Any_MSA, SobelRow_MSA, 0, 1, 1, 4, 15)
  265. #endif
  266. #ifdef HAS_SOBELTOPLANEROW_SSE2
  267. ANY21(SobelToPlaneRow_Any_SSE2, SobelToPlaneRow_SSE2, 0, 1, 1, 1, 15)
  268. #endif
  269. #ifdef HAS_SOBELTOPLANEROW_NEON
  270. ANY21(SobelToPlaneRow_Any_NEON, SobelToPlaneRow_NEON, 0, 1, 1, 1, 15)
  271. #endif
  272. #ifdef HAS_SOBELTOPLANEROW_MSA
  273. ANY21(SobelToPlaneRow_Any_MSA, SobelToPlaneRow_MSA, 0, 1, 1, 1, 31)
  274. #endif
  275. #ifdef HAS_SOBELXYROW_SSE2
  276. ANY21(SobelXYRow_Any_SSE2, SobelXYRow_SSE2, 0, 1, 1, 4, 15)
  277. #endif
  278. #ifdef HAS_SOBELXYROW_NEON
  279. ANY21(SobelXYRow_Any_NEON, SobelXYRow_NEON, 0, 1, 1, 4, 7)
  280. #endif
  281. #ifdef HAS_SOBELXYROW_MSA
  282. ANY21(SobelXYRow_Any_MSA, SobelXYRow_MSA, 0, 1, 1, 4, 15)
  283. #endif
  284. #undef ANY21
  285. // Any 2 planes to 1 with yuvconstants
  286. #define ANY21C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, SBPP2, BPP, MASK) \
  287. void NAMEANY(const uint8* y_buf, const uint8* uv_buf, uint8* dst_ptr, \
  288. const struct YuvConstants* yuvconstants, int width) { \
  289. SIMD_ALIGNED(uint8 temp[64 * 3]); \
  290. memset(temp, 0, 64 * 2); /* for msan */ \
  291. int r = width & MASK; \
  292. int n = width & ~MASK; \
  293. if (n > 0) { \
  294. ANY_SIMD(y_buf, uv_buf, dst_ptr, yuvconstants, n); \
  295. } \
  296. memcpy(temp, y_buf + n * SBPP, r * SBPP); \
  297. memcpy(temp + 64, uv_buf + (n >> UVSHIFT) * SBPP2, \
  298. SS(r, UVSHIFT) * SBPP2); \
  299. ANY_SIMD(temp, temp + 64, temp + 128, yuvconstants, MASK + 1); \
  300. memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \
  301. }
  302. // Biplanar to RGB.
  303. #ifdef HAS_NV12TOARGBROW_SSSE3
  304. ANY21C(NV12ToARGBRow_Any_SSSE3, NV12ToARGBRow_SSSE3, 1, 1, 2, 4, 7)
  305. #endif
  306. #ifdef HAS_NV12TOARGBROW_AVX2
  307. ANY21C(NV12ToARGBRow_Any_AVX2, NV12ToARGBRow_AVX2, 1, 1, 2, 4, 15)
  308. #endif
  309. #ifdef HAS_NV12TOARGBROW_NEON
  310. ANY21C(NV12ToARGBRow_Any_NEON, NV12ToARGBRow_NEON, 1, 1, 2, 4, 7)
  311. #endif
  312. #ifdef HAS_NV12TOARGBROW_DSPR2
  313. ANY21C(NV12ToARGBRow_Any_DSPR2, NV12ToARGBRow_DSPR2, 1, 1, 2, 4, 7)
  314. #endif
  315. #ifdef HAS_NV12TOARGBROW_MSA
  316. ANY21C(NV12ToARGBRow_Any_MSA, NV12ToARGBRow_MSA, 1, 1, 2, 4, 7)
  317. #endif
  318. #ifdef HAS_NV21TOARGBROW_SSSE3
  319. ANY21C(NV21ToARGBRow_Any_SSSE3, NV21ToARGBRow_SSSE3, 1, 1, 2, 4, 7)
  320. #endif
  321. #ifdef HAS_NV21TOARGBROW_AVX2
  322. ANY21C(NV21ToARGBRow_Any_AVX2, NV21ToARGBRow_AVX2, 1, 1, 2, 4, 15)
  323. #endif
  324. #ifdef HAS_NV21TOARGBROW_NEON
  325. ANY21C(NV21ToARGBRow_Any_NEON, NV21ToARGBRow_NEON, 1, 1, 2, 4, 7)
  326. #endif
  327. #ifdef HAS_NV21TOARGBROW_MSA
  328. ANY21C(NV21ToARGBRow_Any_MSA, NV21ToARGBRow_MSA, 1, 1, 2, 4, 7)
  329. #endif
  330. #ifdef HAS_NV12TORGB565ROW_SSSE3
  331. ANY21C(NV12ToRGB565Row_Any_SSSE3, NV12ToRGB565Row_SSSE3, 1, 1, 2, 2, 7)
  332. #endif
  333. #ifdef HAS_NV12TORGB565ROW_AVX2
  334. ANY21C(NV12ToRGB565Row_Any_AVX2, NV12ToRGB565Row_AVX2, 1, 1, 2, 2, 15)
  335. #endif
  336. #ifdef HAS_NV12TORGB565ROW_NEON
  337. ANY21C(NV12ToRGB565Row_Any_NEON, NV12ToRGB565Row_NEON, 1, 1, 2, 2, 7)
  338. #endif
  339. #ifdef HAS_NV12TORGB565ROW_MSA
  340. ANY21C(NV12ToRGB565Row_Any_MSA, NV12ToRGB565Row_MSA, 1, 1, 2, 2, 7)
  341. #endif
  342. #undef ANY21C
  343. // Any 1 to 1.
  344. #define ANY11(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \
  345. void NAMEANY(const uint8* src_ptr, uint8* dst_ptr, int width) { \
  346. SIMD_ALIGNED(uint8 temp[128 * 2]); \
  347. memset(temp, 0, 128); /* for YUY2 and msan */ \
  348. int r = width & MASK; \
  349. int n = width & ~MASK; \
  350. if (n > 0) { \
  351. ANY_SIMD(src_ptr, dst_ptr, n); \
  352. } \
  353. memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \
  354. ANY_SIMD(temp, temp + 128, MASK + 1); \
  355. memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \
  356. }
  357. #ifdef HAS_COPYROW_AVX
  358. ANY11(CopyRow_Any_AVX, CopyRow_AVX, 0, 1, 1, 63)
  359. #endif
  360. #ifdef HAS_COPYROW_SSE2
  361. ANY11(CopyRow_Any_SSE2, CopyRow_SSE2, 0, 1, 1, 31)
  362. #endif
  363. #ifdef HAS_COPYROW_NEON
  364. ANY11(CopyRow_Any_NEON, CopyRow_NEON, 0, 1, 1, 31)
  365. #endif
  366. #if defined(HAS_ARGBTORGB24ROW_SSSE3)
  367. ANY11(ARGBToRGB24Row_Any_SSSE3, ARGBToRGB24Row_SSSE3, 0, 4, 3, 15)
  368. ANY11(ARGBToRAWRow_Any_SSSE3, ARGBToRAWRow_SSSE3, 0, 4, 3, 15)
  369. ANY11(ARGBToRGB565Row_Any_SSE2, ARGBToRGB565Row_SSE2, 0, 4, 2, 3)
  370. ANY11(ARGBToARGB1555Row_Any_SSE2, ARGBToARGB1555Row_SSE2, 0, 4, 2, 3)
  371. ANY11(ARGBToARGB4444Row_Any_SSE2, ARGBToARGB4444Row_SSE2, 0, 4, 2, 3)
  372. #endif
  373. #if defined(HAS_ARGBTORGB565ROW_AVX2)
  374. ANY11(ARGBToRGB565Row_Any_AVX2, ARGBToRGB565Row_AVX2, 0, 4, 2, 7)
  375. #endif
  376. #if defined(HAS_ARGBTOARGB4444ROW_AVX2)
  377. ANY11(ARGBToARGB1555Row_Any_AVX2, ARGBToARGB1555Row_AVX2, 0, 4, 2, 7)
  378. ANY11(ARGBToARGB4444Row_Any_AVX2, ARGBToARGB4444Row_AVX2, 0, 4, 2, 7)
  379. #endif
  380. #if defined(HAS_J400TOARGBROW_SSE2)
  381. ANY11(J400ToARGBRow_Any_SSE2, J400ToARGBRow_SSE2, 0, 1, 4, 7)
  382. #endif
  383. #if defined(HAS_J400TOARGBROW_AVX2)
  384. ANY11(J400ToARGBRow_Any_AVX2, J400ToARGBRow_AVX2, 0, 1, 4, 15)
  385. #endif
  386. #if defined(HAS_I400TOARGBROW_SSE2)
  387. ANY11(I400ToARGBRow_Any_SSE2, I400ToARGBRow_SSE2, 0, 1, 4, 7)
  388. #endif
  389. #if defined(HAS_I400TOARGBROW_AVX2)
  390. ANY11(I400ToARGBRow_Any_AVX2, I400ToARGBRow_AVX2, 0, 1, 4, 15)
  391. #endif
  392. #if defined(HAS_RGB24TOARGBROW_SSSE3)
  393. ANY11(RGB24ToARGBRow_Any_SSSE3, RGB24ToARGBRow_SSSE3, 0, 3, 4, 15)
  394. ANY11(RAWToARGBRow_Any_SSSE3, RAWToARGBRow_SSSE3, 0, 3, 4, 15)
  395. ANY11(RGB565ToARGBRow_Any_SSE2, RGB565ToARGBRow_SSE2, 0, 2, 4, 7)
  396. ANY11(ARGB1555ToARGBRow_Any_SSE2, ARGB1555ToARGBRow_SSE2, 0, 2, 4, 7)
  397. ANY11(ARGB4444ToARGBRow_Any_SSE2, ARGB4444ToARGBRow_SSE2, 0, 2, 4, 7)
  398. #endif
  399. #if defined(HAS_RAWTORGB24ROW_SSSE3)
  400. ANY11(RAWToRGB24Row_Any_SSSE3, RAWToRGB24Row_SSSE3, 0, 3, 3, 7)
  401. #endif
  402. #if defined(HAS_RGB565TOARGBROW_AVX2)
  403. ANY11(RGB565ToARGBRow_Any_AVX2, RGB565ToARGBRow_AVX2, 0, 2, 4, 15)
  404. #endif
  405. #if defined(HAS_ARGB1555TOARGBROW_AVX2)
  406. ANY11(ARGB1555ToARGBRow_Any_AVX2, ARGB1555ToARGBRow_AVX2, 0, 2, 4, 15)
  407. #endif
  408. #if defined(HAS_ARGB4444TOARGBROW_AVX2)
  409. ANY11(ARGB4444ToARGBRow_Any_AVX2, ARGB4444ToARGBRow_AVX2, 0, 2, 4, 15)
  410. #endif
  411. #if defined(HAS_ARGBTORGB24ROW_NEON)
  412. ANY11(ARGBToRGB24Row_Any_NEON, ARGBToRGB24Row_NEON, 0, 4, 3, 7)
  413. ANY11(ARGBToRAWRow_Any_NEON, ARGBToRAWRow_NEON, 0, 4, 3, 7)
  414. ANY11(ARGBToRGB565Row_Any_NEON, ARGBToRGB565Row_NEON, 0, 4, 2, 7)
  415. ANY11(ARGBToARGB1555Row_Any_NEON, ARGBToARGB1555Row_NEON, 0, 4, 2, 7)
  416. ANY11(ARGBToARGB4444Row_Any_NEON, ARGBToARGB4444Row_NEON, 0, 4, 2, 7)
  417. ANY11(J400ToARGBRow_Any_NEON, J400ToARGBRow_NEON, 0, 1, 4, 7)
  418. ANY11(I400ToARGBRow_Any_NEON, I400ToARGBRow_NEON, 0, 1, 4, 7)
  419. #endif
  420. #if defined(HAS_ARGBTORGB24ROW_MSA)
  421. ANY11(ARGBToRGB24Row_Any_MSA, ARGBToRGB24Row_MSA, 0, 4, 3, 15)
  422. ANY11(ARGBToRAWRow_Any_MSA, ARGBToRAWRow_MSA, 0, 4, 3, 15)
  423. ANY11(ARGBToRGB565Row_Any_MSA, ARGBToRGB565Row_MSA, 0, 4, 2, 7)
  424. ANY11(ARGBToARGB1555Row_Any_MSA, ARGBToARGB1555Row_MSA, 0, 4, 2, 7)
  425. ANY11(ARGBToARGB4444Row_Any_MSA, ARGBToARGB4444Row_MSA, 0, 4, 2, 7)
  426. ANY11(J400ToARGBRow_Any_MSA, J400ToARGBRow_MSA, 0, 1, 4, 15)
  427. ANY11(I400ToARGBRow_Any_MSA, I400ToARGBRow_MSA, 0, 1, 4, 15)
  428. #endif
  429. #if defined(HAS_RAWTORGB24ROW_NEON)
  430. ANY11(RAWToRGB24Row_Any_NEON, RAWToRGB24Row_NEON, 0, 3, 3, 7)
  431. #endif
  432. #if defined(HAS_RAWTORGB24ROW_MSA)
  433. ANY11(RAWToRGB24Row_Any_MSA, RAWToRGB24Row_MSA, 0, 3, 3, 15)
  434. #endif
  435. #ifdef HAS_ARGBTOYROW_AVX2
  436. ANY11(ARGBToYRow_Any_AVX2, ARGBToYRow_AVX2, 0, 4, 1, 31)
  437. #endif
  438. #ifdef HAS_ARGBTOYJROW_AVX2
  439. ANY11(ARGBToYJRow_Any_AVX2, ARGBToYJRow_AVX2, 0, 4, 1, 31)
  440. #endif
  441. #ifdef HAS_UYVYTOYROW_AVX2
  442. ANY11(UYVYToYRow_Any_AVX2, UYVYToYRow_AVX2, 0, 2, 1, 31)
  443. #endif
  444. #ifdef HAS_YUY2TOYROW_AVX2
  445. ANY11(YUY2ToYRow_Any_AVX2, YUY2ToYRow_AVX2, 1, 4, 1, 31)
  446. #endif
  447. #ifdef HAS_ARGBTOYROW_SSSE3
  448. ANY11(ARGBToYRow_Any_SSSE3, ARGBToYRow_SSSE3, 0, 4, 1, 15)
  449. #endif
  450. #ifdef HAS_BGRATOYROW_SSSE3
  451. ANY11(BGRAToYRow_Any_SSSE3, BGRAToYRow_SSSE3, 0, 4, 1, 15)
  452. ANY11(ABGRToYRow_Any_SSSE3, ABGRToYRow_SSSE3, 0, 4, 1, 15)
  453. ANY11(RGBAToYRow_Any_SSSE3, RGBAToYRow_SSSE3, 0, 4, 1, 15)
  454. ANY11(YUY2ToYRow_Any_SSE2, YUY2ToYRow_SSE2, 1, 4, 1, 15)
  455. ANY11(UYVYToYRow_Any_SSE2, UYVYToYRow_SSE2, 1, 4, 1, 15)
  456. #endif
  457. #ifdef HAS_ARGBTOYJROW_SSSE3
  458. ANY11(ARGBToYJRow_Any_SSSE3, ARGBToYJRow_SSSE3, 0, 4, 1, 15)
  459. #endif
  460. #ifdef HAS_ARGBTOYROW_NEON
  461. ANY11(ARGBToYRow_Any_NEON, ARGBToYRow_NEON, 0, 4, 1, 7)
  462. #endif
  463. #ifdef HAS_ARGBTOYROW_MSA
  464. ANY11(ARGBToYRow_Any_MSA, ARGBToYRow_MSA, 0, 4, 1, 15)
  465. #endif
  466. #ifdef HAS_ARGBTOYJROW_NEON
  467. ANY11(ARGBToYJRow_Any_NEON, ARGBToYJRow_NEON, 0, 4, 1, 7)
  468. #endif
  469. #ifdef HAS_ARGBTOYJROW_MSA
  470. ANY11(ARGBToYJRow_Any_MSA, ARGBToYJRow_MSA, 0, 4, 1, 15)
  471. #endif
  472. #ifdef HAS_BGRATOYROW_NEON
  473. ANY11(BGRAToYRow_Any_NEON, BGRAToYRow_NEON, 0, 4, 1, 7)
  474. #endif
  475. #ifdef HAS_BGRATOYROW_MSA
  476. ANY11(BGRAToYRow_Any_MSA, BGRAToYRow_MSA, 0, 4, 1, 15)
  477. #endif
  478. #ifdef HAS_ABGRTOYROW_NEON
  479. ANY11(ABGRToYRow_Any_NEON, ABGRToYRow_NEON, 0, 4, 1, 7)
  480. #endif
  481. #ifdef HAS_ABGRTOYROW_MSA
  482. ANY11(ABGRToYRow_Any_MSA, ABGRToYRow_MSA, 0, 4, 1, 7)
  483. #endif
  484. #ifdef HAS_RGBATOYROW_NEON
  485. ANY11(RGBAToYRow_Any_NEON, RGBAToYRow_NEON, 0, 4, 1, 7)
  486. #endif
  487. #ifdef HAS_RGBATOYROW_MSA
  488. ANY11(RGBAToYRow_Any_MSA, RGBAToYRow_MSA, 0, 4, 1, 15)
  489. #endif
  490. #ifdef HAS_RGB24TOYROW_NEON
  491. ANY11(RGB24ToYRow_Any_NEON, RGB24ToYRow_NEON, 0, 3, 1, 7)
  492. #endif
  493. #ifdef HAS_RGB24TOYROW_MSA
  494. ANY11(RGB24ToYRow_Any_MSA, RGB24ToYRow_MSA, 0, 3, 1, 15)
  495. #endif
  496. #ifdef HAS_RAWTOYROW_NEON
  497. ANY11(RAWToYRow_Any_NEON, RAWToYRow_NEON, 0, 3, 1, 7)
  498. #endif
  499. #ifdef HAS_RAWTOYROW_MSA
  500. ANY11(RAWToYRow_Any_MSA, RAWToYRow_MSA, 0, 3, 1, 15)
  501. #endif
  502. #ifdef HAS_RGB565TOYROW_NEON
  503. ANY11(RGB565ToYRow_Any_NEON, RGB565ToYRow_NEON, 0, 2, 1, 7)
  504. #endif
  505. #ifdef HAS_RGB565TOYROW_MSA
  506. ANY11(RGB565ToYRow_Any_MSA, RGB565ToYRow_MSA, 0, 2, 1, 15)
  507. #endif
  508. #ifdef HAS_ARGB1555TOYROW_NEON
  509. ANY11(ARGB1555ToYRow_Any_NEON, ARGB1555ToYRow_NEON, 0, 2, 1, 7)
  510. #endif
  511. #ifdef HAS_ARGB1555TOYROW_MSA
  512. ANY11(ARGB1555ToYRow_Any_MSA, ARGB1555ToYRow_MSA, 0, 2, 1, 15)
  513. #endif
  514. #ifdef HAS_ARGB4444TOYROW_NEON
  515. ANY11(ARGB4444ToYRow_Any_NEON, ARGB4444ToYRow_NEON, 0, 2, 1, 7)
  516. #endif
  517. #ifdef HAS_YUY2TOYROW_NEON
  518. ANY11(YUY2ToYRow_Any_NEON, YUY2ToYRow_NEON, 1, 4, 1, 15)
  519. #endif
  520. #ifdef HAS_UYVYTOYROW_NEON
  521. ANY11(UYVYToYRow_Any_NEON, UYVYToYRow_NEON, 1, 4, 1, 15)
  522. #endif
  523. #ifdef HAS_YUY2TOYROW_MSA
  524. ANY11(YUY2ToYRow_Any_MSA, YUY2ToYRow_MSA, 1, 4, 1, 31)
  525. #endif
  526. #ifdef HAS_UYVYTOYROW_MSA
  527. ANY11(UYVYToYRow_Any_MSA, UYVYToYRow_MSA, 1, 4, 1, 31)
  528. #endif
  529. #ifdef HAS_RGB24TOARGBROW_NEON
  530. ANY11(RGB24ToARGBRow_Any_NEON, RGB24ToARGBRow_NEON, 0, 3, 4, 7)
  531. #endif
  532. #ifdef HAS_RGB24TOARGBROW_MSA
  533. ANY11(RGB24ToARGBRow_Any_MSA, RGB24ToARGBRow_MSA, 0, 3, 4, 15)
  534. #endif
  535. #ifdef HAS_RAWTOARGBROW_NEON
  536. ANY11(RAWToARGBRow_Any_NEON, RAWToARGBRow_NEON, 0, 3, 4, 7)
  537. #endif
  538. #ifdef HAS_RAWTOARGBROW_MSA
  539. ANY11(RAWToARGBRow_Any_MSA, RAWToARGBRow_MSA, 0, 3, 4, 15)
  540. #endif
  541. #ifdef HAS_RGB565TOARGBROW_NEON
  542. ANY11(RGB565ToARGBRow_Any_NEON, RGB565ToARGBRow_NEON, 0, 2, 4, 7)
  543. #endif
  544. #ifdef HAS_RGB565TOARGBROW_MSA
  545. ANY11(RGB565ToARGBRow_Any_MSA, RGB565ToARGBRow_MSA, 0, 2, 4, 15)
  546. #endif
  547. #ifdef HAS_ARGB1555TOARGBROW_NEON
  548. ANY11(ARGB1555ToARGBRow_Any_NEON, ARGB1555ToARGBRow_NEON, 0, 2, 4, 7)
  549. #endif
  550. #ifdef HAS_ARGB1555TOARGBROW_MSA
  551. ANY11(ARGB1555ToARGBRow_Any_MSA, ARGB1555ToARGBRow_MSA, 0, 2, 4, 15)
  552. #endif
  553. #ifdef HAS_ARGB4444TOARGBROW_NEON
  554. ANY11(ARGB4444ToARGBRow_Any_NEON, ARGB4444ToARGBRow_NEON, 0, 2, 4, 7)
  555. #endif
  556. #ifdef HAS_RGB24TOARGBROW_DSPR2
  557. ANY11(RGB24ToARGBRow_Any_DSPR2, RGB24ToARGBRow_DSPR2, 0, 3, 4, 7)
  558. #endif
  559. #ifdef HAS_RAWTOARGBROW_DSPR2
  560. ANY11(RAWToARGBRow_Any_DSPR2, RAWToARGBRow_DSPR2, 0, 3, 4, 7)
  561. #endif
  562. #ifdef HAS_RGB565TOARGBROW_DSPR2
  563. ANY11(RGB565ToARGBRow_Any_DSPR2, RGB565ToARGBRow_DSPR2, 0, 2, 4, 7)
  564. #endif
  565. #ifdef HAS_ARGB1555TOARGBROW_DSPR2
  566. ANY11(ARGB1555ToARGBRow_Any_DSPR2, ARGB1555ToARGBRow_DSPR2, 0, 2, 4, 7)
  567. #endif
  568. #ifdef HAS_ARGB4444TOARGBROW_DSPR2
  569. ANY11(ARGB4444ToARGBRow_Any_DSPR2, ARGB4444ToARGBRow_DSPR2, 0, 2, 4, 7)
  570. #endif
  571. #ifdef HAS_BGRATOYROW_DSPR2
  572. ANY11(BGRAToYRow_Any_DSPR2, BGRAToYRow_DSPR2, 0, 4, 1, 7)
  573. #endif
  574. #ifdef HAS_ARGBTOYROW_DSPR2
  575. ANY11(ARGBToYRow_Any_DSPR2, ARGBToYRow_DSPR2, 0, 4, 1, 7)
  576. #endif
  577. #ifdef HAS_ABGRTOYROW_DSPR2
  578. ANY11(ABGRToYRow_Any_DSPR2, ABGRToYRow_DSPR2, 0, 4, 1, 7)
  579. #endif
  580. #ifdef HAS_RGBATOYROW_DSPR2
  581. ANY11(RGBAToYRow_Any_DSPR2, RGBAToYRow_DSPR2, 0, 4, 1, 7)
  582. #endif
  583. #ifdef HAS_ARGB4444TOARGBROW_MSA
  584. ANY11(ARGB4444ToARGBRow_Any_MSA, ARGB4444ToARGBRow_MSA, 0, 2, 4, 15)
  585. #endif
  586. #ifdef HAS_ARGBATTENUATEROW_SSSE3
  587. ANY11(ARGBAttenuateRow_Any_SSSE3, ARGBAttenuateRow_SSSE3, 0, 4, 4, 3)
  588. #endif
  589. #ifdef HAS_ARGBUNATTENUATEROW_SSE2
  590. ANY11(ARGBUnattenuateRow_Any_SSE2, ARGBUnattenuateRow_SSE2, 0, 4, 4, 3)
  591. #endif
  592. #ifdef HAS_ARGBATTENUATEROW_AVX2
  593. ANY11(ARGBAttenuateRow_Any_AVX2, ARGBAttenuateRow_AVX2, 0, 4, 4, 7)
  594. #endif
  595. #ifdef HAS_ARGBUNATTENUATEROW_AVX2
  596. ANY11(ARGBUnattenuateRow_Any_AVX2, ARGBUnattenuateRow_AVX2, 0, 4, 4, 7)
  597. #endif
  598. #ifdef HAS_ARGBATTENUATEROW_NEON
  599. ANY11(ARGBAttenuateRow_Any_NEON, ARGBAttenuateRow_NEON, 0, 4, 4, 7)
  600. #endif
  601. #ifdef HAS_ARGBATTENUATEROW_MSA
  602. ANY11(ARGBAttenuateRow_Any_MSA, ARGBAttenuateRow_MSA, 0, 4, 4, 7)
  603. #endif
  604. #ifdef HAS_ARGBEXTRACTALPHAROW_SSE2
  605. ANY11(ARGBExtractAlphaRow_Any_SSE2, ARGBExtractAlphaRow_SSE2, 0, 4, 1, 7)
  606. #endif
  607. #ifdef HAS_ARGBEXTRACTALPHAROW_AVX2
  608. ANY11(ARGBExtractAlphaRow_Any_AVX2, ARGBExtractAlphaRow_AVX2, 0, 4, 1, 32)
  609. #endif
  610. #ifdef HAS_ARGBEXTRACTALPHAROW_NEON
  611. ANY11(ARGBExtractAlphaRow_Any_NEON, ARGBExtractAlphaRow_NEON, 0, 4, 1, 15)
  612. #endif
  613. #ifdef HAS_ARGBEXTRACTALPHAROW_MSA
  614. ANY11(ARGBExtractAlphaRow_Any_MSA, ARGBExtractAlphaRow_MSA, 0, 4, 1, 15)
  615. #endif
  616. #undef ANY11
  617. // Any 1 to 1 blended. Destination is read, modify, write.
  618. #define ANY11B(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \
  619. void NAMEANY(const uint8* src_ptr, uint8* dst_ptr, int width) { \
  620. SIMD_ALIGNED(uint8 temp[64 * 2]); \
  621. memset(temp, 0, 64 * 2); /* for msan */ \
  622. int r = width & MASK; \
  623. int n = width & ~MASK; \
  624. if (n > 0) { \
  625. ANY_SIMD(src_ptr, dst_ptr, n); \
  626. } \
  627. memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \
  628. memcpy(temp + 64, dst_ptr + n * BPP, r * BPP); \
  629. ANY_SIMD(temp, temp + 64, MASK + 1); \
  630. memcpy(dst_ptr + n * BPP, temp + 64, r * BPP); \
  631. }
  632. #ifdef HAS_ARGBCOPYALPHAROW_AVX2
  633. ANY11B(ARGBCopyAlphaRow_Any_AVX2, ARGBCopyAlphaRow_AVX2, 0, 4, 4, 15)
  634. #endif
  635. #ifdef HAS_ARGBCOPYALPHAROW_SSE2
  636. ANY11B(ARGBCopyAlphaRow_Any_SSE2, ARGBCopyAlphaRow_SSE2, 0, 4, 4, 7)
  637. #endif
  638. #ifdef HAS_ARGBCOPYYTOALPHAROW_AVX2
  639. ANY11B(ARGBCopyYToAlphaRow_Any_AVX2, ARGBCopyYToAlphaRow_AVX2, 0, 1, 4, 15)
  640. #endif
  641. #ifdef HAS_ARGBCOPYYTOALPHAROW_SSE2
  642. ANY11B(ARGBCopyYToAlphaRow_Any_SSE2, ARGBCopyYToAlphaRow_SSE2, 0, 1, 4, 7)
  643. #endif
  644. #undef ANY11B
  645. // Any 1 to 1 with parameter.
  646. #define ANY11P(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK) \
  647. void NAMEANY(const uint8* src_ptr, uint8* dst_ptr, T param, int width) { \
  648. SIMD_ALIGNED(uint8 temp[64 * 2]); \
  649. memset(temp, 0, 64); /* for msan */ \
  650. int r = width & MASK; \
  651. int n = width & ~MASK; \
  652. if (n > 0) { \
  653. ANY_SIMD(src_ptr, dst_ptr, param, n); \
  654. } \
  655. memcpy(temp, src_ptr + n * SBPP, r * SBPP); \
  656. ANY_SIMD(temp, temp + 64, param, MASK + 1); \
  657. memcpy(dst_ptr + n * BPP, temp + 64, r * BPP); \
  658. }
  659. #if defined(HAS_ARGBTORGB565DITHERROW_SSE2)
  660. ANY11P(ARGBToRGB565DitherRow_Any_SSE2,
  661. ARGBToRGB565DitherRow_SSE2,
  662. const uint32,
  663. 4,
  664. 2,
  665. 3)
  666. #endif
  667. #if defined(HAS_ARGBTORGB565DITHERROW_AVX2)
  668. ANY11P(ARGBToRGB565DitherRow_Any_AVX2,
  669. ARGBToRGB565DitherRow_AVX2,
  670. const uint32,
  671. 4,
  672. 2,
  673. 7)
  674. #endif
  675. #if defined(HAS_ARGBTORGB565DITHERROW_NEON)
  676. ANY11P(ARGBToRGB565DitherRow_Any_NEON,
  677. ARGBToRGB565DitherRow_NEON,
  678. const uint32,
  679. 4,
  680. 2,
  681. 7)
  682. #endif
  683. #if defined(HAS_ARGBTORGB565DITHERROW_MSA)
  684. ANY11P(ARGBToRGB565DitherRow_Any_MSA,
  685. ARGBToRGB565DitherRow_MSA,
  686. const uint32,
  687. 4,
  688. 2,
  689. 7)
  690. #endif
  691. #ifdef HAS_ARGBSHUFFLEROW_SSE2
  692. ANY11P(ARGBShuffleRow_Any_SSE2, ARGBShuffleRow_SSE2, const uint8*, 4, 4, 3)
  693. #endif
  694. #ifdef HAS_ARGBSHUFFLEROW_SSSE3
  695. ANY11P(ARGBShuffleRow_Any_SSSE3, ARGBShuffleRow_SSSE3, const uint8*, 4, 4, 7)
  696. #endif
  697. #ifdef HAS_ARGBSHUFFLEROW_AVX2
  698. ANY11P(ARGBShuffleRow_Any_AVX2, ARGBShuffleRow_AVX2, const uint8*, 4, 4, 15)
  699. #endif
  700. #ifdef HAS_ARGBSHUFFLEROW_NEON
  701. ANY11P(ARGBShuffleRow_Any_NEON, ARGBShuffleRow_NEON, const uint8*, 4, 4, 3)
  702. #endif
  703. #ifdef HAS_ARGBSHUFFLEROW_MSA
  704. ANY11P(ARGBShuffleRow_Any_MSA, ARGBShuffleRow_MSA, const uint8*, 4, 4, 7)
  705. #endif
  706. #undef ANY11P
  707. // Any 1 to 1 with parameter and shorts. BPP measures in shorts.
  708. #define ANY11P16(NAMEANY, ANY_SIMD, T, SBPP, BPP, MASK) \
  709. void NAMEANY(const uint16* src_ptr, uint16* dst_ptr, T param, int width) { \
  710. SIMD_ALIGNED(uint16 temp[16 * 2]); \
  711. memset(temp, 0, 32); /* for msan */ \
  712. int r = width & MASK; \
  713. int n = width & ~MASK; \
  714. if (n > 0) { \
  715. ANY_SIMD(src_ptr, dst_ptr, param, n); \
  716. } \
  717. memcpy(temp, src_ptr + n, r * SBPP); \
  718. ANY_SIMD(temp, temp + 16, param, MASK + 1); \
  719. memcpy(dst_ptr + n, temp + 16, r * BPP); \
  720. }
  721. #ifdef HAS_HALFFLOATROW_SSE2
  722. ANY11P16(HalfFloatRow_Any_SSE2, HalfFloatRow_SSE2, float, 2, 2, 7)
  723. #endif
  724. #ifdef HAS_HALFFLOATROW_AVX2
  725. ANY11P16(HalfFloatRow_Any_AVX2, HalfFloatRow_AVX2, float, 2, 2, 15)
  726. #endif
  727. #ifdef HAS_HALFFLOATROW_F16C
  728. ANY11P16(HalfFloatRow_Any_F16C, HalfFloatRow_F16C, float, 2, 2, 15)
  729. ANY11P16(HalfFloat1Row_Any_F16C, HalfFloat1Row_F16C, float, 2, 2, 15)
  730. #endif
  731. #ifdef HAS_HALFFLOATROW_NEON
  732. ANY11P16(HalfFloatRow_Any_NEON, HalfFloatRow_NEON, float, 2, 2, 7)
  733. ANY11P16(HalfFloat1Row_Any_NEON, HalfFloat1Row_NEON, float, 2, 2, 7)
  734. #endif
  735. #ifdef HAS_HALFFLOATROW_MSA
  736. ANY11P16(HalfFloatRow_Any_MSA, HalfFloatRow_MSA, float, 2, 2, 31)
  737. #endif
  738. #undef ANY11P16
  739. // Any 1 to 1 with yuvconstants
  740. #define ANY11C(NAMEANY, ANY_SIMD, UVSHIFT, SBPP, BPP, MASK) \
  741. void NAMEANY(const uint8* src_ptr, uint8* dst_ptr, \
  742. const struct YuvConstants* yuvconstants, int width) { \
  743. SIMD_ALIGNED(uint8 temp[128 * 2]); \
  744. memset(temp, 0, 128); /* for YUY2 and msan */ \
  745. int r = width & MASK; \
  746. int n = width & ~MASK; \
  747. if (n > 0) { \
  748. ANY_SIMD(src_ptr, dst_ptr, yuvconstants, n); \
  749. } \
  750. memcpy(temp, src_ptr + (n >> UVSHIFT) * SBPP, SS(r, UVSHIFT) * SBPP); \
  751. ANY_SIMD(temp, temp + 128, yuvconstants, MASK + 1); \
  752. memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \
  753. }
  754. #if defined(HAS_YUY2TOARGBROW_SSSE3)
  755. ANY11C(YUY2ToARGBRow_Any_SSSE3, YUY2ToARGBRow_SSSE3, 1, 4, 4, 15)
  756. ANY11C(UYVYToARGBRow_Any_SSSE3, UYVYToARGBRow_SSSE3, 1, 4, 4, 15)
  757. #endif
  758. #if defined(HAS_YUY2TOARGBROW_AVX2)
  759. ANY11C(YUY2ToARGBRow_Any_AVX2, YUY2ToARGBRow_AVX2, 1, 4, 4, 31)
  760. ANY11C(UYVYToARGBRow_Any_AVX2, UYVYToARGBRow_AVX2, 1, 4, 4, 31)
  761. #endif
  762. #if defined(HAS_YUY2TOARGBROW_NEON)
  763. ANY11C(YUY2ToARGBRow_Any_NEON, YUY2ToARGBRow_NEON, 1, 4, 4, 7)
  764. ANY11C(UYVYToARGBRow_Any_NEON, UYVYToARGBRow_NEON, 1, 4, 4, 7)
  765. #endif
  766. #if defined(HAS_YUY2TOARGBROW_MSA)
  767. ANY11C(YUY2ToARGBRow_Any_MSA, YUY2ToARGBRow_MSA, 1, 4, 4, 7)
  768. ANY11C(UYVYToARGBRow_Any_MSA, UYVYToARGBRow_MSA, 1, 4, 4, 7)
  769. #endif
  770. #undef ANY11C
  771. // Any 1 to 1 interpolate. Takes 2 rows of source via stride.
  772. #define ANY11T(NAMEANY, ANY_SIMD, SBPP, BPP, MASK) \
  773. void NAMEANY(uint8* dst_ptr, const uint8* src_ptr, ptrdiff_t src_stride_ptr, \
  774. int width, int source_y_fraction) { \
  775. SIMD_ALIGNED(uint8 temp[64 * 3]); \
  776. memset(temp, 0, 64 * 2); /* for msan */ \
  777. int r = width & MASK; \
  778. int n = width & ~MASK; \
  779. if (n > 0) { \
  780. ANY_SIMD(dst_ptr, src_ptr, src_stride_ptr, n, source_y_fraction); \
  781. } \
  782. memcpy(temp, src_ptr + n * SBPP, r * SBPP); \
  783. memcpy(temp + 64, src_ptr + src_stride_ptr + n * SBPP, r * SBPP); \
  784. ANY_SIMD(temp + 128, temp, 64, MASK + 1, source_y_fraction); \
  785. memcpy(dst_ptr + n * BPP, temp + 128, r * BPP); \
  786. }
  787. #ifdef HAS_INTERPOLATEROW_AVX2
  788. ANY11T(InterpolateRow_Any_AVX2, InterpolateRow_AVX2, 1, 1, 31)
  789. #endif
  790. #ifdef HAS_INTERPOLATEROW_SSSE3
  791. ANY11T(InterpolateRow_Any_SSSE3, InterpolateRow_SSSE3, 1, 1, 15)
  792. #endif
  793. #ifdef HAS_INTERPOLATEROW_NEON
  794. ANY11T(InterpolateRow_Any_NEON, InterpolateRow_NEON, 1, 1, 15)
  795. #endif
  796. #ifdef HAS_INTERPOLATEROW_DSPR2
  797. ANY11T(InterpolateRow_Any_DSPR2, InterpolateRow_DSPR2, 1, 1, 3)
  798. #endif
  799. #ifdef HAS_INTERPOLATEROW_MSA
  800. ANY11T(InterpolateRow_Any_MSA, InterpolateRow_MSA, 1, 1, 31)
  801. #endif
  802. #undef ANY11T
  803. // Any 1 to 1 mirror.
  804. #define ANY11M(NAMEANY, ANY_SIMD, BPP, MASK) \
  805. void NAMEANY(const uint8* src_ptr, uint8* dst_ptr, int width) { \
  806. SIMD_ALIGNED(uint8 temp[64 * 2]); \
  807. memset(temp, 0, 64); /* for msan */ \
  808. int r = width & MASK; \
  809. int n = width & ~MASK; \
  810. if (n > 0) { \
  811. ANY_SIMD(src_ptr + r * BPP, dst_ptr, n); \
  812. } \
  813. memcpy(temp, src_ptr, r* BPP); \
  814. ANY_SIMD(temp, temp + 64, MASK + 1); \
  815. memcpy(dst_ptr + n * BPP, temp + 64 + (MASK + 1 - r) * BPP, r * BPP); \
  816. }
  817. #ifdef HAS_MIRRORROW_AVX2
  818. ANY11M(MirrorRow_Any_AVX2, MirrorRow_AVX2, 1, 31)
  819. #endif
  820. #ifdef HAS_MIRRORROW_SSSE3
  821. ANY11M(MirrorRow_Any_SSSE3, MirrorRow_SSSE3, 1, 15)
  822. #endif
  823. #ifdef HAS_MIRRORROW_NEON
  824. ANY11M(MirrorRow_Any_NEON, MirrorRow_NEON, 1, 15)
  825. #endif
  826. #ifdef HAS_MIRRORROW_MSA
  827. ANY11M(MirrorRow_Any_MSA, MirrorRow_MSA, 1, 63)
  828. #endif
  829. #ifdef HAS_ARGBMIRRORROW_AVX2
  830. ANY11M(ARGBMirrorRow_Any_AVX2, ARGBMirrorRow_AVX2, 4, 7)
  831. #endif
  832. #ifdef HAS_ARGBMIRRORROW_SSE2
  833. ANY11M(ARGBMirrorRow_Any_SSE2, ARGBMirrorRow_SSE2, 4, 3)
  834. #endif
  835. #ifdef HAS_ARGBMIRRORROW_NEON
  836. ANY11M(ARGBMirrorRow_Any_NEON, ARGBMirrorRow_NEON, 4, 3)
  837. #endif
  838. #ifdef HAS_ARGBMIRRORROW_MSA
  839. ANY11M(ARGBMirrorRow_Any_MSA, ARGBMirrorRow_MSA, 4, 15)
  840. #endif
  841. #undef ANY11M
  842. // Any 1 plane. (memset)
  843. #define ANY1(NAMEANY, ANY_SIMD, T, BPP, MASK) \
  844. void NAMEANY(uint8* dst_ptr, T v32, int width) { \
  845. SIMD_ALIGNED(uint8 temp[64]); \
  846. int r = width & MASK; \
  847. int n = width & ~MASK; \
  848. if (n > 0) { \
  849. ANY_SIMD(dst_ptr, v32, n); \
  850. } \
  851. ANY_SIMD(temp, v32, MASK + 1); \
  852. memcpy(dst_ptr + n * BPP, temp, r * BPP); \
  853. }
  854. #ifdef HAS_SETROW_X86
  855. ANY1(SetRow_Any_X86, SetRow_X86, uint8, 1, 3)
  856. #endif
  857. #ifdef HAS_SETROW_NEON
  858. ANY1(SetRow_Any_NEON, SetRow_NEON, uint8, 1, 15)
  859. #endif
  860. #ifdef HAS_ARGBSETROW_NEON
  861. ANY1(ARGBSetRow_Any_NEON, ARGBSetRow_NEON, uint32, 4, 3)
  862. #endif
  863. #ifdef HAS_ARGBSETROW_MSA
  864. ANY1(ARGBSetRow_Any_MSA, ARGBSetRow_MSA, uint32, 4, 3)
  865. #endif
  866. #undef ANY1
  867. // Any 1 to 2. Outputs UV planes.
  868. #define ANY12(NAMEANY, ANY_SIMD, UVSHIFT, BPP, DUVSHIFT, MASK) \
  869. void NAMEANY(const uint8* src_ptr, uint8* dst_u, uint8* dst_v, int width) { \
  870. SIMD_ALIGNED(uint8 temp[128 * 3]); \
  871. memset(temp, 0, 128); /* for msan */ \
  872. int r = width & MASK; \
  873. int n = width & ~MASK; \
  874. if (n > 0) { \
  875. ANY_SIMD(src_ptr, dst_u, dst_v, n); \
  876. } \
  877. memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \
  878. ANY_SIMD(temp, temp + 128, temp + 256, MASK + 1); \
  879. memcpy(dst_u + (n >> DUVSHIFT), temp + 128, SS(r, DUVSHIFT)); \
  880. memcpy(dst_v + (n >> DUVSHIFT), temp + 256, SS(r, DUVSHIFT)); \
  881. }
  882. #ifdef HAS_SPLITUVROW_SSE2
  883. ANY12(SplitUVRow_Any_SSE2, SplitUVRow_SSE2, 0, 2, 0, 15)
  884. #endif
  885. #ifdef HAS_SPLITUVROW_AVX2
  886. ANY12(SplitUVRow_Any_AVX2, SplitUVRow_AVX2, 0, 2, 0, 31)
  887. #endif
  888. #ifdef HAS_SPLITUVROW_NEON
  889. ANY12(SplitUVRow_Any_NEON, SplitUVRow_NEON, 0, 2, 0, 15)
  890. #endif
  891. #ifdef HAS_SPLITUVROW_DSPR2
  892. ANY12(SplitUVRow_Any_DSPR2, SplitUVRow_DSPR2, 0, 2, 0, 15)
  893. #endif
  894. #ifdef HAS_SPLITUVROW_MSA
  895. ANY12(SplitUVRow_Any_MSA, SplitUVRow_MSA, 0, 2, 0, 31)
  896. #endif
  897. #ifdef HAS_ARGBTOUV444ROW_SSSE3
  898. ANY12(ARGBToUV444Row_Any_SSSE3, ARGBToUV444Row_SSSE3, 0, 4, 0, 15)
  899. #endif
  900. #ifdef HAS_YUY2TOUV422ROW_AVX2
  901. ANY12(YUY2ToUV422Row_Any_AVX2, YUY2ToUV422Row_AVX2, 1, 4, 1, 31)
  902. ANY12(UYVYToUV422Row_Any_AVX2, UYVYToUV422Row_AVX2, 1, 4, 1, 31)
  903. #endif
  904. #ifdef HAS_YUY2TOUV422ROW_SSE2
  905. ANY12(YUY2ToUV422Row_Any_SSE2, YUY2ToUV422Row_SSE2, 1, 4, 1, 15)
  906. ANY12(UYVYToUV422Row_Any_SSE2, UYVYToUV422Row_SSE2, 1, 4, 1, 15)
  907. #endif
  908. #ifdef HAS_YUY2TOUV422ROW_NEON
  909. ANY12(ARGBToUV444Row_Any_NEON, ARGBToUV444Row_NEON, 0, 4, 0, 7)
  910. ANY12(YUY2ToUV422Row_Any_NEON, YUY2ToUV422Row_NEON, 1, 4, 1, 15)
  911. ANY12(UYVYToUV422Row_Any_NEON, UYVYToUV422Row_NEON, 1, 4, 1, 15)
  912. #endif
  913. #ifdef HAS_YUY2TOUV422ROW_MSA
  914. ANY12(ARGBToUV444Row_Any_MSA, ARGBToUV444Row_MSA, 0, 4, 0, 15)
  915. ANY12(YUY2ToUV422Row_Any_MSA, YUY2ToUV422Row_MSA, 1, 4, 1, 31)
  916. ANY12(UYVYToUV422Row_Any_MSA, UYVYToUV422Row_MSA, 1, 4, 1, 31)
  917. #endif
  918. #undef ANY12
  919. // Any 1 to 3. Outputs RGB planes.
  920. #define ANY13(NAMEANY, ANY_SIMD, BPP, MASK) \
  921. void NAMEANY(const uint8* src_ptr, uint8* dst_r, uint8* dst_g, uint8* dst_b, \
  922. int width) { \
  923. SIMD_ALIGNED(uint8 temp[16 * 6]); \
  924. memset(temp, 0, 16 * 3); /* for msan */ \
  925. int r = width & MASK; \
  926. int n = width & ~MASK; \
  927. if (n > 0) { \
  928. ANY_SIMD(src_ptr, dst_r, dst_g, dst_b, n); \
  929. } \
  930. memcpy(temp, src_ptr + n * BPP, r * BPP); \
  931. ANY_SIMD(temp, temp + 16 * 3, temp + 16 * 4, temp + 16 * 5, MASK + 1); \
  932. memcpy(dst_r + n, temp + 16 * 3, r); \
  933. memcpy(dst_g + n, temp + 16 * 4, r); \
  934. memcpy(dst_b + n, temp + 16 * 5, r); \
  935. }
  936. #ifdef HAS_SPLITRGBROW_SSSE3
  937. ANY13(SplitRGBRow_Any_SSSE3, SplitRGBRow_SSSE3, 3, 15)
  938. #endif
  939. #ifdef HAS_SPLITRGBROW_NEON
  940. ANY13(SplitRGBRow_Any_NEON, SplitRGBRow_NEON, 3, 15)
  941. #endif
  942. // Any 1 to 2 with source stride (2 rows of source). Outputs UV planes.
  943. // 128 byte row allows for 32 avx ARGB pixels.
  944. #define ANY12S(NAMEANY, ANY_SIMD, UVSHIFT, BPP, MASK) \
  945. void NAMEANY(const uint8* src_ptr, int src_stride_ptr, uint8* dst_u, \
  946. uint8* dst_v, int width) { \
  947. SIMD_ALIGNED(uint8 temp[128 * 4]); \
  948. memset(temp, 0, 128 * 2); /* for msan */ \
  949. int r = width & MASK; \
  950. int n = width & ~MASK; \
  951. if (n > 0) { \
  952. ANY_SIMD(src_ptr, src_stride_ptr, dst_u, dst_v, n); \
  953. } \
  954. memcpy(temp, src_ptr + (n >> UVSHIFT) * BPP, SS(r, UVSHIFT) * BPP); \
  955. memcpy(temp + 128, src_ptr + src_stride_ptr + (n >> UVSHIFT) * BPP, \
  956. SS(r, UVSHIFT) * BPP); \
  957. if ((width & 1) && UVSHIFT == 0) { /* repeat last pixel for subsample */ \
  958. memcpy(temp + SS(r, UVSHIFT) * BPP, temp + SS(r, UVSHIFT) * BPP - BPP, \
  959. BPP); \
  960. memcpy(temp + 128 + SS(r, UVSHIFT) * BPP, \
  961. temp + 128 + SS(r, UVSHIFT) * BPP - BPP, BPP); \
  962. } \
  963. ANY_SIMD(temp, 128, temp + 256, temp + 384, MASK + 1); \
  964. memcpy(dst_u + (n >> 1), temp + 256, SS(r, 1)); \
  965. memcpy(dst_v + (n >> 1), temp + 384, SS(r, 1)); \
  966. }
  967. #ifdef HAS_ARGBTOUVROW_AVX2
  968. ANY12S(ARGBToUVRow_Any_AVX2, ARGBToUVRow_AVX2, 0, 4, 31)
  969. #endif
  970. #ifdef HAS_ARGBTOUVJROW_AVX2
  971. ANY12S(ARGBToUVJRow_Any_AVX2, ARGBToUVJRow_AVX2, 0, 4, 31)
  972. #endif
  973. #ifdef HAS_ARGBTOUVROW_SSSE3
  974. ANY12S(ARGBToUVRow_Any_SSSE3, ARGBToUVRow_SSSE3, 0, 4, 15)
  975. ANY12S(ARGBToUVJRow_Any_SSSE3, ARGBToUVJRow_SSSE3, 0, 4, 15)
  976. ANY12S(BGRAToUVRow_Any_SSSE3, BGRAToUVRow_SSSE3, 0, 4, 15)
  977. ANY12S(ABGRToUVRow_Any_SSSE3, ABGRToUVRow_SSSE3, 0, 4, 15)
  978. ANY12S(RGBAToUVRow_Any_SSSE3, RGBAToUVRow_SSSE3, 0, 4, 15)
  979. #endif
  980. #ifdef HAS_YUY2TOUVROW_AVX2
  981. ANY12S(YUY2ToUVRow_Any_AVX2, YUY2ToUVRow_AVX2, 1, 4, 31)
  982. ANY12S(UYVYToUVRow_Any_AVX2, UYVYToUVRow_AVX2, 1, 4, 31)
  983. #endif
  984. #ifdef HAS_YUY2TOUVROW_SSE2
  985. ANY12S(YUY2ToUVRow_Any_SSE2, YUY2ToUVRow_SSE2, 1, 4, 15)
  986. ANY12S(UYVYToUVRow_Any_SSE2, UYVYToUVRow_SSE2, 1, 4, 15)
  987. #endif
  988. #ifdef HAS_ARGBTOUVROW_NEON
  989. ANY12S(ARGBToUVRow_Any_NEON, ARGBToUVRow_NEON, 0, 4, 15)
  990. #endif
  991. #ifdef HAS_ARGBTOUVROW_MSA
  992. ANY12S(ARGBToUVRow_Any_MSA, ARGBToUVRow_MSA, 0, 4, 31)
  993. #endif
  994. #ifdef HAS_ARGBTOUVJROW_NEON
  995. ANY12S(ARGBToUVJRow_Any_NEON, ARGBToUVJRow_NEON, 0, 4, 15)
  996. #endif
  997. #ifdef HAS_ARGBTOUVJROW_MSA
  998. ANY12S(ARGBToUVJRow_Any_MSA, ARGBToUVJRow_MSA, 0, 4, 31)
  999. #endif
  1000. #ifdef HAS_BGRATOUVROW_NEON
  1001. ANY12S(BGRAToUVRow_Any_NEON, BGRAToUVRow_NEON, 0, 4, 15)
  1002. #endif
  1003. #ifdef HAS_BGRATOUVROW_MSA
  1004. ANY12S(BGRAToUVRow_Any_MSA, BGRAToUVRow_MSA, 0, 4, 31)
  1005. #endif
  1006. #ifdef HAS_ABGRTOUVROW_NEON
  1007. ANY12S(ABGRToUVRow_Any_NEON, ABGRToUVRow_NEON, 0, 4, 15)
  1008. #endif
  1009. #ifdef HAS_ABGRTOUVROW_MSA
  1010. ANY12S(ABGRToUVRow_Any_MSA, ABGRToUVRow_MSA, 0, 4, 31)
  1011. #endif
  1012. #ifdef HAS_RGBATOUVROW_NEON
  1013. ANY12S(RGBAToUVRow_Any_NEON, RGBAToUVRow_NEON, 0, 4, 15)
  1014. #endif
  1015. #ifdef HAS_RGBATOUVROW_MSA
  1016. ANY12S(RGBAToUVRow_Any_MSA, RGBAToUVRow_MSA, 0, 4, 31)
  1017. #endif
  1018. #ifdef HAS_RGB24TOUVROW_NEON
  1019. ANY12S(RGB24ToUVRow_Any_NEON, RGB24ToUVRow_NEON, 0, 3, 15)
  1020. #endif
  1021. #ifdef HAS_RGB24TOUVROW_MSA
  1022. ANY12S(RGB24ToUVRow_Any_MSA, RGB24ToUVRow_MSA, 0, 3, 15)
  1023. #endif
  1024. #ifdef HAS_RAWTOUVROW_NEON
  1025. ANY12S(RAWToUVRow_Any_NEON, RAWToUVRow_NEON, 0, 3, 15)
  1026. #endif
  1027. #ifdef HAS_RAWTOUVROW_MSA
  1028. ANY12S(RAWToUVRow_Any_MSA, RAWToUVRow_MSA, 0, 3, 15)
  1029. #endif
  1030. #ifdef HAS_RGB565TOUVROW_NEON
  1031. ANY12S(RGB565ToUVRow_Any_NEON, RGB565ToUVRow_NEON, 0, 2, 15)
  1032. #endif
  1033. #ifdef HAS_RGB565TOUVROW_MSA
  1034. ANY12S(RGB565ToUVRow_Any_MSA, RGB565ToUVRow_MSA, 0, 2, 15)
  1035. #endif
  1036. #ifdef HAS_ARGB1555TOUVROW_NEON
  1037. ANY12S(ARGB1555ToUVRow_Any_NEON, ARGB1555ToUVRow_NEON, 0, 2, 15)
  1038. #endif
  1039. #ifdef HAS_ARGB1555TOUVROW_MSA
  1040. ANY12S(ARGB1555ToUVRow_Any_MSA, ARGB1555ToUVRow_MSA, 0, 2, 15)
  1041. #endif
  1042. #ifdef HAS_ARGB4444TOUVROW_NEON
  1043. ANY12S(ARGB4444ToUVRow_Any_NEON, ARGB4444ToUVRow_NEON, 0, 2, 15)
  1044. #endif
  1045. #ifdef HAS_YUY2TOUVROW_NEON
  1046. ANY12S(YUY2ToUVRow_Any_NEON, YUY2ToUVRow_NEON, 1, 4, 15)
  1047. #endif
  1048. #ifdef HAS_UYVYTOUVROW_NEON
  1049. ANY12S(UYVYToUVRow_Any_NEON, UYVYToUVRow_NEON, 1, 4, 15)
  1050. #endif
  1051. #ifdef HAS_BGRATOUVROW_DSPR2
  1052. ANY12S(BGRAToUVRow_Any_DSPR2, BGRAToUVRow_DSPR2, 0, 4, 15)
  1053. #endif
  1054. #ifdef HAS_ABGRTOUVROW_DSPR2
  1055. ANY12S(ABGRToUVRow_Any_DSPR2, ABGRToUVRow_DSPR2, 0, 4, 15)
  1056. #endif
  1057. #ifdef HAS_RGBATOUVROW_DSPR2
  1058. ANY12S(RGBAToUVRow_Any_DSPR2, RGBAToUVRow_DSPR2, 0, 4, 15)
  1059. #endif
  1060. #ifdef HAS_ARGBTOUVROW_DSPR2
  1061. ANY12S(ARGBToUVRow_Any_DSPR2, ARGBToUVRow_DSPR2, 0, 4, 15)
  1062. #endif
  1063. #ifdef HAS_YUY2TOUVROW_MSA
  1064. ANY12S(YUY2ToUVRow_Any_MSA, YUY2ToUVRow_MSA, 1, 4, 31)
  1065. #endif
  1066. #ifdef HAS_UYVYTOUVROW_MSA
  1067. ANY12S(UYVYToUVRow_Any_MSA, UYVYToUVRow_MSA, 1, 4, 31)
  1068. #endif
  1069. #undef ANY12S
  1070. #ifdef __cplusplus
  1071. } // extern "C"
  1072. } // namespace libyuv
  1073. #endif