scale_row.h 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497
  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_SCALE_ROW_H_ // NOLINT
  11. #define INCLUDE_LIBYUV_SCALE_ROW_H_
  12. #include "basic_types.h"
  13. #include "scale.h"
  14. #ifdef __cplusplus
  15. namespace libyuv {
  16. extern "C" {
  17. #endif
  18. #if defined(__pnacl__) || defined(__CLR_VER) || \
  19. (defined(__i386__) && !defined(__SSE2__))
  20. #define LIBYUV_DISABLE_X86
  21. #endif
  22. // GCC >= 4.7.0 required for AVX2.
  23. #if defined(__GNUC__) && (defined(__x86_64__) || defined(__i386__))
  24. #if (__GNUC__ > 4) || (__GNUC__ == 4 && (__GNUC_MINOR__ >= 7))
  25. #define GCC_HAS_AVX2 1
  26. #endif // GNUC >= 4.7
  27. #endif // __GNUC__
  28. // clang >= 3.4.0 required for AVX2.
  29. #if defined(__clang__) && (defined(__x86_64__) || defined(__i386__))
  30. #if (__clang_major__ > 3) || (__clang_major__ == 3 && (__clang_minor__ >= 4))
  31. #define CLANG_HAS_AVX2 1
  32. #endif // clang >= 3.4
  33. #endif // __clang__
  34. // Visual C 2012 required for AVX2.
  35. #if defined(_M_IX86) && !defined(__clang__) && \
  36. defined(_MSC_VER) && _MSC_VER >= 1700
  37. #define VISUALC_HAS_AVX2 1
  38. #endif // VisualStudio >= 2012
  39. // The following are available on all x86 platforms:
  40. #if !defined(LIBYUV_DISABLE_X86) && \
  41. (defined(_M_IX86) || defined(__x86_64__) || defined(__i386__))
  42. #define HAS_FIXEDDIV1_X86
  43. #define HAS_FIXEDDIV_X86
  44. #define HAS_SCALEARGBCOLS_SSE2
  45. #define HAS_SCALEARGBCOLSUP2_SSE2
  46. #define HAS_SCALEARGBFILTERCOLS_SSSE3
  47. #define HAS_SCALEARGBROWDOWN2_SSE2
  48. #define HAS_SCALEARGBROWDOWNEVEN_SSE2
  49. #define HAS_SCALECOLSUP2_SSE2
  50. #define HAS_SCALEFILTERCOLS_SSSE3
  51. #define HAS_SCALEROWDOWN2_SSSE3
  52. #define HAS_SCALEROWDOWN34_SSSE3
  53. #define HAS_SCALEROWDOWN38_SSSE3
  54. #define HAS_SCALEROWDOWN4_SSSE3
  55. #define HAS_SCALEADDROW_SSE2
  56. #endif
  57. // The following are available on all x86 platforms, but
  58. // require VS2012, clang 3.4 or gcc 4.7.
  59. // The code supports NaCL but requires a new compiler and validator.
  60. #if !defined(LIBYUV_DISABLE_X86) && (defined(VISUALC_HAS_AVX2) || \
  61. defined(CLANG_HAS_AVX2) || defined(GCC_HAS_AVX2))
  62. #define HAS_SCALEADDROW_AVX2
  63. #define HAS_SCALEROWDOWN2_AVX2
  64. #define HAS_SCALEROWDOWN4_AVX2
  65. #endif
  66. // The following are available on Neon platforms:
  67. #if !defined(LIBYUV_DISABLE_NEON) && !defined(__native_client__) && \
  68. (defined(__ARM_NEON__) || defined(LIBYUV_NEON) || defined(__aarch64__))
  69. #define HAS_SCALEARGBCOLS_NEON
  70. #define HAS_SCALEARGBROWDOWN2_NEON
  71. #define HAS_SCALEARGBROWDOWNEVEN_NEON
  72. #define HAS_SCALEFILTERCOLS_NEON
  73. #define HAS_SCALEROWDOWN2_NEON
  74. #define HAS_SCALEROWDOWN34_NEON
  75. #define HAS_SCALEROWDOWN38_NEON
  76. #define HAS_SCALEROWDOWN4_NEON
  77. #define HAS_SCALEARGBFILTERCOLS_NEON
  78. #endif
  79. // The following are available on Mips platforms:
  80. #if !defined(LIBYUV_DISABLE_MIPS) && !defined(__native_client__) && \
  81. defined(__mips__) && defined(__mips_dsp) && (__mips_dsp_rev >= 2)
  82. #define HAS_SCALEROWDOWN2_DSPR2
  83. #define HAS_SCALEROWDOWN4_DSPR2
  84. #define HAS_SCALEROWDOWN34_DSPR2
  85. #define HAS_SCALEROWDOWN38_DSPR2
  86. #endif
  87. // Scale ARGB vertically with bilinear interpolation.
  88. void ScalePlaneVertical(int src_height,
  89. int dst_width, int dst_height,
  90. int src_stride, int dst_stride,
  91. const uint8* src_argb, uint8* dst_argb,
  92. int x, int y, int dy,
  93. int bpp, enum FilterMode filtering);
  94. void ScalePlaneVertical_16(int src_height,
  95. int dst_width, int dst_height,
  96. int src_stride, int dst_stride,
  97. const uint16* src_argb, uint16* dst_argb,
  98. int x, int y, int dy,
  99. int wpp, enum FilterMode filtering);
  100. // Simplify the filtering based on scale factors.
  101. enum FilterMode ScaleFilterReduce(int src_width, int src_height,
  102. int dst_width, int dst_height,
  103. enum FilterMode filtering);
  104. // Divide num by div and return as 16.16 fixed point result.
  105. int FixedDiv_C(int num, int div);
  106. int FixedDiv_X86(int num, int div);
  107. // Divide num - 1 by div - 1 and return as 16.16 fixed point result.
  108. int FixedDiv1_C(int num, int div);
  109. int FixedDiv1_X86(int num, int div);
  110. #ifdef HAS_FIXEDDIV_X86
  111. #define FixedDiv FixedDiv_X86
  112. #define FixedDiv1 FixedDiv1_X86
  113. #else
  114. #define FixedDiv FixedDiv_C
  115. #define FixedDiv1 FixedDiv1_C
  116. #endif
  117. // Compute slope values for stepping.
  118. void ScaleSlope(int src_width, int src_height,
  119. int dst_width, int dst_height,
  120. enum FilterMode filtering,
  121. int* x, int* y, int* dx, int* dy);
  122. void ScaleRowDown2_C(const uint8* src_ptr, ptrdiff_t src_stride,
  123. uint8* dst, int dst_width);
  124. void ScaleRowDown2_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  125. uint16* dst, int dst_width);
  126. void ScaleRowDown2Linear_C(const uint8* src_ptr, ptrdiff_t src_stride,
  127. uint8* dst, int dst_width);
  128. void ScaleRowDown2Linear_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  129. uint16* dst, int dst_width);
  130. void ScaleRowDown2Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
  131. uint8* dst, int dst_width);
  132. void ScaleRowDown2Box_Odd_C(const uint8* src_ptr, ptrdiff_t src_stride,
  133. uint8* dst, int dst_width);
  134. void ScaleRowDown2Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  135. uint16* dst, int dst_width);
  136. void ScaleRowDown4_C(const uint8* src_ptr, ptrdiff_t src_stride,
  137. uint8* dst, int dst_width);
  138. void ScaleRowDown4_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  139. uint16* dst, int dst_width);
  140. void ScaleRowDown4Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
  141. uint8* dst, int dst_width);
  142. void ScaleRowDown4Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  143. uint16* dst, int dst_width);
  144. void ScaleRowDown34_C(const uint8* src_ptr, ptrdiff_t src_stride,
  145. uint8* dst, int dst_width);
  146. void ScaleRowDown34_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  147. uint16* dst, int dst_width);
  148. void ScaleRowDown34_0_Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
  149. uint8* d, int dst_width);
  150. void ScaleRowDown34_0_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  151. uint16* d, int dst_width);
  152. void ScaleRowDown34_1_Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
  153. uint8* d, int dst_width);
  154. void ScaleRowDown34_1_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  155. uint16* d, int dst_width);
  156. void ScaleCols_C(uint8* dst_ptr, const uint8* src_ptr,
  157. int dst_width, int x, int dx);
  158. void ScaleCols_16_C(uint16* dst_ptr, const uint16* src_ptr,
  159. int dst_width, int x, int dx);
  160. void ScaleColsUp2_C(uint8* dst_ptr, const uint8* src_ptr,
  161. int dst_width, int, int);
  162. void ScaleColsUp2_16_C(uint16* dst_ptr, const uint16* src_ptr,
  163. int dst_width, int, int);
  164. void ScaleFilterCols_C(uint8* dst_ptr, const uint8* src_ptr,
  165. int dst_width, int x, int dx);
  166. void ScaleFilterCols_16_C(uint16* dst_ptr, const uint16* src_ptr,
  167. int dst_width, int x, int dx);
  168. void ScaleFilterCols64_C(uint8* dst_ptr, const uint8* src_ptr,
  169. int dst_width, int x, int dx);
  170. void ScaleFilterCols64_16_C(uint16* dst_ptr, const uint16* src_ptr,
  171. int dst_width, int x, int dx);
  172. void ScaleRowDown38_C(const uint8* src_ptr, ptrdiff_t src_stride,
  173. uint8* dst, int dst_width);
  174. void ScaleRowDown38_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  175. uint16* dst, int dst_width);
  176. void ScaleRowDown38_3_Box_C(const uint8* src_ptr,
  177. ptrdiff_t src_stride,
  178. uint8* dst_ptr, int dst_width);
  179. void ScaleRowDown38_3_Box_16_C(const uint16* src_ptr,
  180. ptrdiff_t src_stride,
  181. uint16* dst_ptr, int dst_width);
  182. void ScaleRowDown38_2_Box_C(const uint8* src_ptr, ptrdiff_t src_stride,
  183. uint8* dst_ptr, int dst_width);
  184. void ScaleRowDown38_2_Box_16_C(const uint16* src_ptr, ptrdiff_t src_stride,
  185. uint16* dst_ptr, int dst_width);
  186. void ScaleAddRow_C(const uint8* src_ptr, uint16* dst_ptr, int src_width);
  187. void ScaleAddRow_16_C(const uint16* src_ptr, uint32* dst_ptr, int src_width);
  188. void ScaleARGBRowDown2_C(const uint8* src_argb,
  189. ptrdiff_t src_stride,
  190. uint8* dst_argb, int dst_width);
  191. void ScaleARGBRowDown2Linear_C(const uint8* src_argb,
  192. ptrdiff_t src_stride,
  193. uint8* dst_argb, int dst_width);
  194. void ScaleARGBRowDown2Box_C(const uint8* src_argb, ptrdiff_t src_stride,
  195. uint8* dst_argb, int dst_width);
  196. void ScaleARGBRowDownEven_C(const uint8* src_argb, ptrdiff_t src_stride,
  197. int src_stepx,
  198. uint8* dst_argb, int dst_width);
  199. void ScaleARGBRowDownEvenBox_C(const uint8* src_argb,
  200. ptrdiff_t src_stride,
  201. int src_stepx,
  202. uint8* dst_argb, int dst_width);
  203. void ScaleARGBCols_C(uint8* dst_argb, const uint8* src_argb,
  204. int dst_width, int x, int dx);
  205. void ScaleARGBCols64_C(uint8* dst_argb, const uint8* src_argb,
  206. int dst_width, int x, int dx);
  207. void ScaleARGBColsUp2_C(uint8* dst_argb, const uint8* src_argb,
  208. int dst_width, int, int);
  209. void ScaleARGBFilterCols_C(uint8* dst_argb, const uint8* src_argb,
  210. int dst_width, int x, int dx);
  211. void ScaleARGBFilterCols64_C(uint8* dst_argb, const uint8* src_argb,
  212. int dst_width, int x, int dx);
  213. // Specialized scalers for x86.
  214. void ScaleRowDown2_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  215. uint8* dst_ptr, int dst_width);
  216. void ScaleRowDown2Linear_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  217. uint8* dst_ptr, int dst_width);
  218. void ScaleRowDown2Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  219. uint8* dst_ptr, int dst_width);
  220. void ScaleRowDown2_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  221. uint8* dst_ptr, int dst_width);
  222. void ScaleRowDown2Linear_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  223. uint8* dst_ptr, int dst_width);
  224. void ScaleRowDown2Box_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  225. uint8* dst_ptr, int dst_width);
  226. void ScaleRowDown4_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  227. uint8* dst_ptr, int dst_width);
  228. void ScaleRowDown4Box_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  229. uint8* dst_ptr, int dst_width);
  230. void ScaleRowDown4_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  231. uint8* dst_ptr, int dst_width);
  232. void ScaleRowDown4Box_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  233. uint8* dst_ptr, int dst_width);
  234. void ScaleRowDown34_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  235. uint8* dst_ptr, int dst_width);
  236. void ScaleRowDown34_1_Box_SSSE3(const uint8* src_ptr,
  237. ptrdiff_t src_stride,
  238. uint8* dst_ptr, int dst_width);
  239. void ScaleRowDown34_0_Box_SSSE3(const uint8* src_ptr,
  240. ptrdiff_t src_stride,
  241. uint8* dst_ptr, int dst_width);
  242. void ScaleRowDown38_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  243. uint8* dst_ptr, int dst_width);
  244. void ScaleRowDown38_3_Box_SSSE3(const uint8* src_ptr,
  245. ptrdiff_t src_stride,
  246. uint8* dst_ptr, int dst_width);
  247. void ScaleRowDown38_2_Box_SSSE3(const uint8* src_ptr,
  248. ptrdiff_t src_stride,
  249. uint8* dst_ptr, int dst_width);
  250. void ScaleRowDown2_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  251. uint8* dst_ptr, int dst_width);
  252. void ScaleRowDown2Linear_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  253. uint8* dst_ptr, int dst_width);
  254. void ScaleRowDown2Box_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  255. uint8* dst_ptr, int dst_width);
  256. void ScaleRowDown2Box_Odd_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  257. uint8* dst_ptr, int dst_width);
  258. void ScaleRowDown2_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  259. uint8* dst_ptr, int dst_width);
  260. void ScaleRowDown2Linear_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  261. uint8* dst_ptr, int dst_width);
  262. void ScaleRowDown2Box_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  263. uint8* dst_ptr, int dst_width);
  264. void ScaleRowDown2Box_Odd_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  265. uint8* dst_ptr, int dst_width);
  266. void ScaleRowDown4_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  267. uint8* dst_ptr, int dst_width);
  268. void ScaleRowDown4Box_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  269. uint8* dst_ptr, int dst_width);
  270. void ScaleRowDown4_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  271. uint8* dst_ptr, int dst_width);
  272. void ScaleRowDown4Box_Any_AVX2(const uint8* src_ptr, ptrdiff_t src_stride,
  273. uint8* dst_ptr, int dst_width);
  274. void ScaleRowDown34_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  275. uint8* dst_ptr, int dst_width);
  276. void ScaleRowDown34_1_Box_Any_SSSE3(const uint8* src_ptr,
  277. ptrdiff_t src_stride,
  278. uint8* dst_ptr, int dst_width);
  279. void ScaleRowDown34_0_Box_Any_SSSE3(const uint8* src_ptr,
  280. ptrdiff_t src_stride,
  281. uint8* dst_ptr, int dst_width);
  282. void ScaleRowDown38_Any_SSSE3(const uint8* src_ptr, ptrdiff_t src_stride,
  283. uint8* dst_ptr, int dst_width);
  284. void ScaleRowDown38_3_Box_Any_SSSE3(const uint8* src_ptr,
  285. ptrdiff_t src_stride,
  286. uint8* dst_ptr, int dst_width);
  287. void ScaleRowDown38_2_Box_Any_SSSE3(const uint8* src_ptr,
  288. ptrdiff_t src_stride,
  289. uint8* dst_ptr, int dst_width);
  290. void ScaleAddRow_SSE2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
  291. void ScaleAddRow_AVX2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
  292. void ScaleAddRow_Any_SSE2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
  293. void ScaleAddRow_Any_AVX2(const uint8* src_ptr, uint16* dst_ptr, int src_width);
  294. void ScaleFilterCols_SSSE3(uint8* dst_ptr, const uint8* src_ptr,
  295. int dst_width, int x, int dx);
  296. void ScaleColsUp2_SSE2(uint8* dst_ptr, const uint8* src_ptr,
  297. int dst_width, int x, int dx);
  298. // ARGB Column functions
  299. void ScaleARGBCols_SSE2(uint8* dst_argb, const uint8* src_argb,
  300. int dst_width, int x, int dx);
  301. void ScaleARGBFilterCols_SSSE3(uint8* dst_argb, const uint8* src_argb,
  302. int dst_width, int x, int dx);
  303. void ScaleARGBColsUp2_SSE2(uint8* dst_argb, const uint8* src_argb,
  304. int dst_width, int x, int dx);
  305. void ScaleARGBFilterCols_NEON(uint8* dst_argb, const uint8* src_argb,
  306. int dst_width, int x, int dx);
  307. void ScaleARGBCols_NEON(uint8* dst_argb, const uint8* src_argb,
  308. int dst_width, int x, int dx);
  309. void ScaleARGBFilterCols_Any_NEON(uint8* dst_argb, const uint8* src_argb,
  310. int dst_width, int x, int dx);
  311. void ScaleARGBCols_Any_NEON(uint8* dst_argb, const uint8* src_argb,
  312. int dst_width, int x, int dx);
  313. // ARGB Row functions
  314. void ScaleARGBRowDown2_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  315. uint8* dst_argb, int dst_width);
  316. void ScaleARGBRowDown2Linear_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  317. uint8* dst_argb, int dst_width);
  318. void ScaleARGBRowDown2Box_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  319. uint8* dst_argb, int dst_width);
  320. void ScaleARGBRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  321. uint8* dst, int dst_width);
  322. void ScaleARGBRowDown2Linear_NEON(const uint8* src_argb, ptrdiff_t src_stride,
  323. uint8* dst_argb, int dst_width);
  324. void ScaleARGBRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  325. uint8* dst, int dst_width);
  326. void ScaleARGBRowDown2_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  327. uint8* dst_argb, int dst_width);
  328. void ScaleARGBRowDown2Linear_Any_SSE2(const uint8* src_argb,
  329. ptrdiff_t src_stride,
  330. uint8* dst_argb, int dst_width);
  331. void ScaleARGBRowDown2Box_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  332. uint8* dst_argb, int dst_width);
  333. void ScaleARGBRowDown2_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  334. uint8* dst, int dst_width);
  335. void ScaleARGBRowDown2Linear_Any_NEON(const uint8* src_argb,
  336. ptrdiff_t src_stride,
  337. uint8* dst_argb, int dst_width);
  338. void ScaleARGBRowDown2Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  339. uint8* dst, int dst_width);
  340. void ScaleARGBRowDownEven_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  341. int src_stepx, uint8* dst_argb, int dst_width);
  342. void ScaleARGBRowDownEvenBox_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  343. int src_stepx,
  344. uint8* dst_argb, int dst_width);
  345. void ScaleARGBRowDownEven_NEON(const uint8* src_argb, ptrdiff_t src_stride,
  346. int src_stepx,
  347. uint8* dst_argb, int dst_width);
  348. void ScaleARGBRowDownEvenBox_NEON(const uint8* src_argb, ptrdiff_t src_stride,
  349. int src_stepx,
  350. uint8* dst_argb, int dst_width);
  351. void ScaleARGBRowDownEven_Any_SSE2(const uint8* src_argb, ptrdiff_t src_stride,
  352. int src_stepx,
  353. uint8* dst_argb, int dst_width);
  354. void ScaleARGBRowDownEvenBox_Any_SSE2(const uint8* src_argb,
  355. ptrdiff_t src_stride,
  356. int src_stepx,
  357. uint8* dst_argb, int dst_width);
  358. void ScaleARGBRowDownEven_Any_NEON(const uint8* src_argb, ptrdiff_t src_stride,
  359. int src_stepx,
  360. uint8* dst_argb, int dst_width);
  361. void ScaleARGBRowDownEvenBox_Any_NEON(const uint8* src_argb,
  362. ptrdiff_t src_stride,
  363. int src_stepx,
  364. uint8* dst_argb, int dst_width);
  365. // ScaleRowDown2Box also used by planar functions
  366. // NEON downscalers with interpolation.
  367. // Note - not static due to reuse in convert for 444 to 420.
  368. void ScaleRowDown2_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  369. uint8* dst, int dst_width);
  370. void ScaleRowDown2Linear_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  371. uint8* dst, int dst_width);
  372. void ScaleRowDown2Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  373. uint8* dst, int dst_width);
  374. void ScaleRowDown4_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  375. uint8* dst_ptr, int dst_width);
  376. void ScaleRowDown4Box_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  377. uint8* dst_ptr, int dst_width);
  378. // Down scale from 4 to 3 pixels. Use the neon multilane read/write
  379. // to load up the every 4th pixel into a 4 different registers.
  380. // Point samples 32 pixels to 24 pixels.
  381. void ScaleRowDown34_NEON(const uint8* src_ptr,
  382. ptrdiff_t src_stride,
  383. uint8* dst_ptr, int dst_width);
  384. void ScaleRowDown34_0_Box_NEON(const uint8* src_ptr,
  385. ptrdiff_t src_stride,
  386. uint8* dst_ptr, int dst_width);
  387. void ScaleRowDown34_1_Box_NEON(const uint8* src_ptr,
  388. ptrdiff_t src_stride,
  389. uint8* dst_ptr, int dst_width);
  390. // 32 -> 12
  391. void ScaleRowDown38_NEON(const uint8* src_ptr,
  392. ptrdiff_t src_stride,
  393. uint8* dst_ptr, int dst_width);
  394. // 32x3 -> 12x1
  395. void ScaleRowDown38_3_Box_NEON(const uint8* src_ptr,
  396. ptrdiff_t src_stride,
  397. uint8* dst_ptr, int dst_width);
  398. // 32x2 -> 12x1
  399. void ScaleRowDown38_2_Box_NEON(const uint8* src_ptr,
  400. ptrdiff_t src_stride,
  401. uint8* dst_ptr, int dst_width);
  402. void ScaleRowDown2_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  403. uint8* dst, int dst_width);
  404. void ScaleRowDown2Linear_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  405. uint8* dst, int dst_width);
  406. void ScaleRowDown2Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  407. uint8* dst, int dst_width);
  408. void ScaleRowDown2Box_Odd_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  409. uint8* dst, int dst_width);
  410. void ScaleRowDown4_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  411. uint8* dst_ptr, int dst_width);
  412. void ScaleRowDown4Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  413. uint8* dst_ptr, int dst_width);
  414. void ScaleRowDown34_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  415. uint8* dst_ptr, int dst_width);
  416. void ScaleRowDown34_0_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  417. uint8* dst_ptr, int dst_width);
  418. void ScaleRowDown34_1_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  419. uint8* dst_ptr, int dst_width);
  420. // 32 -> 12
  421. void ScaleRowDown38_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  422. uint8* dst_ptr, int dst_width);
  423. // 32x3 -> 12x1
  424. void ScaleRowDown38_3_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  425. uint8* dst_ptr, int dst_width);
  426. // 32x2 -> 12x1
  427. void ScaleRowDown38_2_Box_Any_NEON(const uint8* src_ptr, ptrdiff_t src_stride,
  428. uint8* dst_ptr, int dst_width);
  429. void ScaleAddRow_NEON(const uint8* src_ptr, uint16* dst_ptr, int src_width);
  430. void ScaleAddRow_Any_NEON(const uint8* src_ptr, uint16* dst_ptr, int src_width);
  431. void ScaleFilterCols_NEON(uint8* dst_ptr, const uint8* src_ptr,
  432. int dst_width, int x, int dx);
  433. void ScaleFilterCols_Any_NEON(uint8* dst_ptr, const uint8* src_ptr,
  434. int dst_width, int x, int dx);
  435. void ScaleRowDown2_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  436. uint8* dst, int dst_width);
  437. void ScaleRowDown2Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  438. uint8* dst, int dst_width);
  439. void ScaleRowDown4_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  440. uint8* dst, int dst_width);
  441. void ScaleRowDown4Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  442. uint8* dst, int dst_width);
  443. void ScaleRowDown34_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  444. uint8* dst, int dst_width);
  445. void ScaleRowDown34_0_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  446. uint8* d, int dst_width);
  447. void ScaleRowDown34_1_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  448. uint8* d, int dst_width);
  449. void ScaleRowDown38_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  450. uint8* dst, int dst_width);
  451. void ScaleRowDown38_2_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  452. uint8* dst_ptr, int dst_width);
  453. void ScaleRowDown38_3_Box_DSPR2(const uint8* src_ptr, ptrdiff_t src_stride,
  454. uint8* dst_ptr, int dst_width);
  455. #ifdef __cplusplus
  456. } // extern "C"
  457. } // namespace libyuv
  458. #endif
  459. #endif // INCLUDE_LIBYUV_SCALE_ROW_H_ NOLINT