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.

433 lines
16KB

  1. /*
  2. * Copyright (C) 2001-2003 Michael Niedermayer <michaelni@gmx.at>
  3. *
  4. * This file is part of Libav.
  5. *
  6. * Libav is free software; you can redistribute it and/or
  7. * modify it under the terms of the GNU Lesser General Public
  8. * License as published by the Free Software Foundation; either
  9. * version 2.1 of the License, or (at your option) any later version.
  10. *
  11. * Libav is distributed in the hope that it will be useful,
  12. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  14. * Lesser General Public License for more details.
  15. *
  16. * You should have received a copy of the GNU Lesser General Public
  17. * License along with Libav; if not, write to the Free Software
  18. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  19. */
  20. #include <inttypes.h>
  21. #include "config.h"
  22. #include "libswscale/swscale.h"
  23. #include "libswscale/swscale_internal.h"
  24. #include "libavutil/intreadwrite.h"
  25. #include "libavutil/x86_cpu.h"
  26. #include "libavutil/cpu.h"
  27. #include "libavutil/pixdesc.h"
  28. #define DITHER1XBPP
  29. DECLARE_ASM_CONST(8, uint64_t, bF8)= 0xF8F8F8F8F8F8F8F8LL;
  30. DECLARE_ASM_CONST(8, uint64_t, bFC)= 0xFCFCFCFCFCFCFCFCLL;
  31. DECLARE_ASM_CONST(8, uint64_t, w10)= 0x0010001000100010LL;
  32. DECLARE_ASM_CONST(8, uint64_t, w02)= 0x0002000200020002LL;
  33. const DECLARE_ALIGNED(8, uint64_t, ff_dither4)[2] = {
  34. 0x0103010301030103LL,
  35. 0x0200020002000200LL,};
  36. const DECLARE_ALIGNED(8, uint64_t, ff_dither8)[2] = {
  37. 0x0602060206020602LL,
  38. 0x0004000400040004LL,};
  39. DECLARE_ASM_CONST(8, uint64_t, b16Mask)= 0x001F001F001F001FLL;
  40. DECLARE_ASM_CONST(8, uint64_t, g16Mask)= 0x07E007E007E007E0LL;
  41. DECLARE_ASM_CONST(8, uint64_t, r16Mask)= 0xF800F800F800F800LL;
  42. DECLARE_ASM_CONST(8, uint64_t, b15Mask)= 0x001F001F001F001FLL;
  43. DECLARE_ASM_CONST(8, uint64_t, g15Mask)= 0x03E003E003E003E0LL;
  44. DECLARE_ASM_CONST(8, uint64_t, r15Mask)= 0x7C007C007C007C00LL;
  45. DECLARE_ALIGNED(8, const uint64_t, ff_M24A) = 0x00FF0000FF0000FFLL;
  46. DECLARE_ALIGNED(8, const uint64_t, ff_M24B) = 0xFF0000FF0000FF00LL;
  47. DECLARE_ALIGNED(8, const uint64_t, ff_M24C) = 0x0000FF0000FF0000LL;
  48. #ifdef FAST_BGR2YV12
  49. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff) = 0x000000210041000DULL;
  50. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff) = 0x0000FFEEFFDC0038ULL;
  51. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff) = 0x00000038FFD2FFF8ULL;
  52. #else
  53. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YCoeff) = 0x000020E540830C8BULL;
  54. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UCoeff) = 0x0000ED0FDAC23831ULL;
  55. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2VCoeff) = 0x00003831D0E6F6EAULL;
  56. #endif /* FAST_BGR2YV12 */
  57. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2YOffset) = 0x1010101010101010ULL;
  58. DECLARE_ALIGNED(8, const uint64_t, ff_bgr2UVOffset) = 0x8080808080808080ULL;
  59. DECLARE_ALIGNED(8, const uint64_t, ff_w1111) = 0x0001000100010001ULL;
  60. //MMX versions
  61. #if HAVE_MMX
  62. #undef RENAME
  63. #define COMPILE_TEMPLATE_MMX2 0
  64. #define RENAME(a) a ## _MMX
  65. #include "swscale_template.c"
  66. #endif
  67. //MMX2 versions
  68. #if HAVE_MMX2
  69. #undef RENAME
  70. #undef COMPILE_TEMPLATE_MMX2
  71. #define COMPILE_TEMPLATE_MMX2 1
  72. #define RENAME(a) a ## _MMX2
  73. #include "swscale_template.c"
  74. #endif
  75. void updateMMXDitherTables(SwsContext *c, int dstY, int lumBufIndex, int chrBufIndex,
  76. int lastInLumBuf, int lastInChrBuf)
  77. {
  78. const int dstH= c->dstH;
  79. const int flags= c->flags;
  80. int16_t **lumPixBuf= c->lumPixBuf;
  81. int16_t **chrUPixBuf= c->chrUPixBuf;
  82. const int vLumBufSize= c->vLumBufSize;
  83. const int vChrBufSize= c->vChrBufSize;
  84. int16_t *vLumFilterPos= c->vLumFilterPos;
  85. int16_t *vChrFilterPos= c->vChrFilterPos;
  86. int16_t *vLumFilter= c->vLumFilter;
  87. int16_t *vChrFilter= c->vChrFilter;
  88. int32_t *lumMmxFilter= c->lumMmxFilter;
  89. int32_t *chrMmxFilter= c->chrMmxFilter;
  90. const int vLumFilterSize= c->vLumFilterSize;
  91. const int vChrFilterSize= c->vChrFilterSize;
  92. const int chrDstY= dstY>>c->chrDstVSubSample;
  93. const int firstLumSrcY= vLumFilterPos[dstY]; //First line needed as input
  94. const int firstChrSrcY= vChrFilterPos[chrDstY]; //First line needed as input
  95. c->blueDither= ff_dither8[dstY&1];
  96. if (c->dstFormat == PIX_FMT_RGB555 || c->dstFormat == PIX_FMT_BGR555)
  97. c->greenDither= ff_dither8[dstY&1];
  98. else
  99. c->greenDither= ff_dither4[dstY&1];
  100. c->redDither= ff_dither8[(dstY+1)&1];
  101. if (dstY < dstH - 2) {
  102. const int16_t **lumSrcPtr= (const int16_t **) lumPixBuf + lumBufIndex + firstLumSrcY - lastInLumBuf + vLumBufSize;
  103. const int16_t **chrUSrcPtr= (const int16_t **) chrUPixBuf + chrBufIndex + firstChrSrcY - lastInChrBuf + vChrBufSize;
  104. int i;
  105. if (flags & SWS_ACCURATE_RND) {
  106. int s= APCK_SIZE / 8;
  107. for (i=0; i<vLumFilterSize; i+=2) {
  108. *(const void**)&lumMmxFilter[s*i ]= lumSrcPtr[i ];
  109. *(const void**)&lumMmxFilter[s*i+APCK_PTR2/4 ]= lumSrcPtr[i+(vLumFilterSize>1)];
  110. lumMmxFilter[s*i+APCK_COEF/4 ]=
  111. lumMmxFilter[s*i+APCK_COEF/4+1]= vLumFilter[dstY*vLumFilterSize + i ]
  112. + (vLumFilterSize>1 ? vLumFilter[dstY*vLumFilterSize + i + 1]<<16 : 0);
  113. }
  114. for (i=0; i<vChrFilterSize; i+=2) {
  115. *(const void**)&chrMmxFilter[s*i ]= chrUSrcPtr[i ];
  116. *(const void**)&chrMmxFilter[s*i+APCK_PTR2/4 ]= chrUSrcPtr[i+(vChrFilterSize>1)];
  117. chrMmxFilter[s*i+APCK_COEF/4 ]=
  118. chrMmxFilter[s*i+APCK_COEF/4+1]= vChrFilter[chrDstY*vChrFilterSize + i ]
  119. + (vChrFilterSize>1 ? vChrFilter[chrDstY*vChrFilterSize + i + 1]<<16 : 0);
  120. }
  121. } else {
  122. for (i=0; i<vLumFilterSize; i++) {
  123. *(const void**)&lumMmxFilter[4*i+0]= lumSrcPtr[i];
  124. lumMmxFilter[4*i+2]=
  125. lumMmxFilter[4*i+3]=
  126. ((uint16_t)vLumFilter[dstY*vLumFilterSize + i])*0x10001;
  127. }
  128. for (i=0; i<vChrFilterSize; i++) {
  129. *(const void**)&chrMmxFilter[4*i+0]= chrUSrcPtr[i];
  130. chrMmxFilter[4*i+2]=
  131. chrMmxFilter[4*i+3]=
  132. ((uint16_t)vChrFilter[chrDstY*vChrFilterSize + i])*0x10001;
  133. }
  134. }
  135. }
  136. }
  137. #define SCALE_FUNC(filter_n, from_bpc, to_bpc, opt) \
  138. extern void ff_hscale ## from_bpc ## to ## to_bpc ## _ ## filter_n ## _ ## opt( \
  139. SwsContext *c, int16_t *data, \
  140. int dstW, const uint8_t *src, \
  141. const int16_t *filter, \
  142. const int16_t *filterPos, int filterSize)
  143. #define SCALE_FUNCS(filter_n, opt) \
  144. SCALE_FUNC(filter_n, 8, 15, opt); \
  145. SCALE_FUNC(filter_n, 9, 15, opt); \
  146. SCALE_FUNC(filter_n, 10, 15, opt); \
  147. SCALE_FUNC(filter_n, 16, 15, opt); \
  148. SCALE_FUNC(filter_n, 8, 19, opt); \
  149. SCALE_FUNC(filter_n, 9, 19, opt); \
  150. SCALE_FUNC(filter_n, 10, 19, opt); \
  151. SCALE_FUNC(filter_n, 16, 19, opt)
  152. #define SCALE_FUNCS_MMX(opt) \
  153. SCALE_FUNCS(4, opt); \
  154. SCALE_FUNCS(8, opt); \
  155. SCALE_FUNCS(X, opt)
  156. #define SCALE_FUNCS_SSE(opt) \
  157. SCALE_FUNCS(4, opt); \
  158. SCALE_FUNCS(8, opt); \
  159. SCALE_FUNCS(X4, opt); \
  160. SCALE_FUNCS(X8, opt)
  161. #if ARCH_X86_32
  162. SCALE_FUNCS_MMX(mmx);
  163. #endif
  164. SCALE_FUNCS_SSE(sse2);
  165. SCALE_FUNCS_SSE(ssse3);
  166. SCALE_FUNCS_SSE(sse4);
  167. #define VSCALEX_FUNC(size, opt) \
  168. extern void ff_yuv2planeX_ ## size ## _ ## opt(const int16_t *filter, int filterSize, \
  169. const int16_t **src, uint8_t *dest, int dstW, \
  170. const uint8_t *dither, int offset)
  171. #define VSCALEX_FUNCS(opt) \
  172. VSCALEX_FUNC(8, opt); \
  173. VSCALEX_FUNC(9, opt); \
  174. VSCALEX_FUNC(10, opt)
  175. #if ARCH_X86_32
  176. VSCALEX_FUNCS(mmx2);
  177. #endif
  178. VSCALEX_FUNCS(sse2);
  179. VSCALEX_FUNCS(sse4);
  180. VSCALEX_FUNC(16, sse4);
  181. VSCALEX_FUNCS(avx);
  182. #define VSCALE_FUNC(size, opt) \
  183. extern void ff_yuv2plane1_ ## size ## _ ## opt(const int16_t *src, uint8_t *dst, int dstW, \
  184. const uint8_t *dither, int offset)
  185. #define VSCALE_FUNCS(opt1, opt2) \
  186. VSCALE_FUNC(8, opt1); \
  187. VSCALE_FUNC(9, opt2); \
  188. VSCALE_FUNC(10, opt2); \
  189. VSCALE_FUNC(16, opt1)
  190. #if ARCH_X86_32
  191. VSCALE_FUNCS(mmx, mmx2);
  192. #endif
  193. VSCALE_FUNCS(sse2, sse2);
  194. VSCALE_FUNC(16, sse4);
  195. VSCALE_FUNCS(avx, avx);
  196. #define INPUT_Y_FUNC(fmt, opt) \
  197. extern void ff_ ## fmt ## ToY_ ## opt(uint8_t *dst, const uint8_t *src, \
  198. int w, uint32_t *unused)
  199. #define INPUT_UV_FUNC(fmt, opt) \
  200. extern void ff_ ## fmt ## ToUV_ ## opt(uint8_t *dstU, uint8_t *dstV, \
  201. const uint8_t *src, const uint8_t *unused1, \
  202. int w, uint32_t *unused2)
  203. #define INPUT_FUNC(fmt, opt) \
  204. INPUT_Y_FUNC(fmt, opt); \
  205. INPUT_UV_FUNC(fmt, opt)
  206. #define INPUT_FUNCS(opt) \
  207. INPUT_FUNC(uyvy, opt); \
  208. INPUT_FUNC(yuyv, opt); \
  209. INPUT_UV_FUNC(nv12, opt); \
  210. INPUT_UV_FUNC(nv21, opt); \
  211. INPUT_FUNC(rgba, opt); \
  212. INPUT_FUNC(bgra, opt); \
  213. INPUT_FUNC(argb, opt); \
  214. INPUT_FUNC(abgr, opt); \
  215. INPUT_FUNC(rgb24, opt); \
  216. INPUT_FUNC(bgr24, opt)
  217. #if ARCH_X86_32
  218. INPUT_FUNCS(mmx);
  219. #endif
  220. INPUT_FUNCS(sse2);
  221. INPUT_FUNCS(ssse3);
  222. INPUT_FUNCS(avx);
  223. void ff_sws_init_swScale_mmx(SwsContext *c)
  224. {
  225. int cpu_flags = av_get_cpu_flags();
  226. if (cpu_flags & AV_CPU_FLAG_MMX)
  227. sws_init_swScale_MMX(c);
  228. #if HAVE_MMX2
  229. if (cpu_flags & AV_CPU_FLAG_MMX2)
  230. sws_init_swScale_MMX2(c);
  231. #endif
  232. #if HAVE_YASM
  233. #define ASSIGN_SCALE_FUNC2(hscalefn, filtersize, opt1, opt2) do { \
  234. if (c->srcBpc == 8) { \
  235. hscalefn = c->dstBpc <= 10 ? ff_hscale8to15_ ## filtersize ## _ ## opt2 : \
  236. ff_hscale8to19_ ## filtersize ## _ ## opt1; \
  237. } else if (c->srcBpc == 9) { \
  238. hscalefn = c->dstBpc <= 10 ? ff_hscale9to15_ ## filtersize ## _ ## opt2 : \
  239. ff_hscale9to19_ ## filtersize ## _ ## opt1; \
  240. } else if (c->srcBpc == 10) { \
  241. hscalefn = c->dstBpc <= 10 ? ff_hscale10to15_ ## filtersize ## _ ## opt2 : \
  242. ff_hscale10to19_ ## filtersize ## _ ## opt1; \
  243. } else /* c->srcBpc == 16 */ { \
  244. hscalefn = c->dstBpc <= 10 ? ff_hscale16to15_ ## filtersize ## _ ## opt2 : \
  245. ff_hscale16to19_ ## filtersize ## _ ## opt1; \
  246. } \
  247. } while (0)
  248. #define ASSIGN_MMX_SCALE_FUNC(hscalefn, filtersize, opt1, opt2) \
  249. switch (filtersize) { \
  250. case 4: ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \
  251. case 8: ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \
  252. default: ASSIGN_SCALE_FUNC2(hscalefn, X, opt1, opt2); break; \
  253. }
  254. #define ASSIGN_VSCALEX_FUNC(vscalefn, opt, do_16_case) \
  255. switch(c->dstBpc){ \
  256. case 16: do_16_case; break; \
  257. case 10: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_10_ ## opt; break; \
  258. case 9: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2planeX_9_ ## opt; break; \
  259. default: vscalefn = ff_yuv2planeX_8_ ## opt; break; \
  260. }
  261. #define ASSIGN_VSCALE_FUNC(vscalefn, opt1, opt2, opt2chk) \
  262. switch(c->dstBpc){ \
  263. case 16: if (!isBE(c->dstFormat)) vscalefn = ff_yuv2plane1_16_ ## opt1; break; \
  264. case 10: if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_10_ ## opt2; break; \
  265. case 9: if (!isBE(c->dstFormat) && opt2chk) vscalefn = ff_yuv2plane1_9_ ## opt2; break; \
  266. default: vscalefn = ff_yuv2plane1_8_ ## opt1; break; \
  267. }
  268. #define case_rgb(x, X, opt) \
  269. case PIX_FMT_ ## X: \
  270. c->lumToYV12 = ff_ ## x ## ToY_ ## opt; \
  271. if (!c->chrSrcHSubSample) \
  272. c->chrToYV12 = ff_ ## x ## ToUV_ ## opt; \
  273. break
  274. #if ARCH_X86_32
  275. if (cpu_flags & AV_CPU_FLAG_MMX) {
  276. ASSIGN_MMX_SCALE_FUNC(c->hyScale, c->hLumFilterSize, mmx, mmx);
  277. ASSIGN_MMX_SCALE_FUNC(c->hcScale, c->hChrFilterSize, mmx, mmx);
  278. ASSIGN_VSCALE_FUNC(c->yuv2plane1, mmx, mmx2, cpu_flags & AV_CPU_FLAG_MMX2);
  279. switch (c->srcFormat) {
  280. case PIX_FMT_Y400A:
  281. c->lumToYV12 = ff_yuyvToY_mmx;
  282. if (c->alpPixBuf)
  283. c->alpToYV12 = ff_uyvyToY_mmx;
  284. break;
  285. case PIX_FMT_YUYV422:
  286. c->lumToYV12 = ff_yuyvToY_mmx;
  287. c->chrToYV12 = ff_yuyvToUV_mmx;
  288. break;
  289. case PIX_FMT_UYVY422:
  290. c->lumToYV12 = ff_uyvyToY_mmx;
  291. c->chrToYV12 = ff_uyvyToUV_mmx;
  292. break;
  293. case PIX_FMT_NV12:
  294. c->chrToYV12 = ff_nv12ToUV_mmx;
  295. break;
  296. case PIX_FMT_NV21:
  297. c->chrToYV12 = ff_nv21ToUV_mmx;
  298. break;
  299. case_rgb(rgb24, RGB24, mmx);
  300. case_rgb(bgr24, BGR24, mmx);
  301. case_rgb(bgra, BGRA, mmx);
  302. case_rgb(rgba, RGBA, mmx);
  303. case_rgb(abgr, ABGR, mmx);
  304. case_rgb(argb, ARGB, mmx);
  305. default:
  306. break;
  307. }
  308. }
  309. if (cpu_flags & AV_CPU_FLAG_MMX2) {
  310. ASSIGN_VSCALEX_FUNC(c->yuv2planeX, mmx2,);
  311. }
  312. #endif
  313. #define ASSIGN_SSE_SCALE_FUNC(hscalefn, filtersize, opt1, opt2) \
  314. switch (filtersize) { \
  315. case 4: ASSIGN_SCALE_FUNC2(hscalefn, 4, opt1, opt2); break; \
  316. case 8: ASSIGN_SCALE_FUNC2(hscalefn, 8, opt1, opt2); break; \
  317. default: if (filtersize & 4) ASSIGN_SCALE_FUNC2(hscalefn, X4, opt1, opt2); \
  318. else ASSIGN_SCALE_FUNC2(hscalefn, X8, opt1, opt2); \
  319. break; \
  320. }
  321. if (cpu_flags & AV_CPU_FLAG_SSE2) {
  322. ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse2, sse2);
  323. ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse2, sse2);
  324. ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse2,);
  325. ASSIGN_VSCALE_FUNC(c->yuv2plane1, sse2, sse2, 1);
  326. switch (c->srcFormat) {
  327. case PIX_FMT_Y400A:
  328. c->lumToYV12 = ff_yuyvToY_sse2;
  329. if (c->alpPixBuf)
  330. c->alpToYV12 = ff_uyvyToY_sse2;
  331. break;
  332. case PIX_FMT_YUYV422:
  333. c->lumToYV12 = ff_yuyvToY_sse2;
  334. c->chrToYV12 = ff_yuyvToUV_sse2;
  335. break;
  336. case PIX_FMT_UYVY422:
  337. c->lumToYV12 = ff_uyvyToY_sse2;
  338. c->chrToYV12 = ff_uyvyToUV_sse2;
  339. break;
  340. case PIX_FMT_NV12:
  341. c->chrToYV12 = ff_nv12ToUV_sse2;
  342. break;
  343. case PIX_FMT_NV21:
  344. c->chrToYV12 = ff_nv21ToUV_sse2;
  345. break;
  346. case_rgb(rgb24, RGB24, sse2);
  347. case_rgb(bgr24, BGR24, sse2);
  348. case_rgb(bgra, BGRA, sse2);
  349. case_rgb(rgba, RGBA, sse2);
  350. case_rgb(abgr, ABGR, sse2);
  351. case_rgb(argb, ARGB, sse2);
  352. default:
  353. break;
  354. }
  355. }
  356. if (cpu_flags & AV_CPU_FLAG_SSSE3) {
  357. ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, ssse3, ssse3);
  358. ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, ssse3, ssse3);
  359. switch (c->srcFormat) {
  360. case_rgb(rgb24, RGB24, ssse3);
  361. case_rgb(bgr24, BGR24, ssse3);
  362. default:
  363. break;
  364. }
  365. }
  366. if (cpu_flags & AV_CPU_FLAG_SSE4) {
  367. /* Xto15 don't need special sse4 functions */
  368. ASSIGN_SSE_SCALE_FUNC(c->hyScale, c->hLumFilterSize, sse4, ssse3);
  369. ASSIGN_SSE_SCALE_FUNC(c->hcScale, c->hChrFilterSize, sse4, ssse3);
  370. ASSIGN_VSCALEX_FUNC(c->yuv2planeX, sse4,
  371. if (!isBE(c->dstFormat)) c->yuv2planeX = ff_yuv2planeX_16_sse4);
  372. if (c->dstBpc == 16 && !isBE(c->dstFormat))
  373. c->yuv2plane1 = ff_yuv2plane1_16_sse4;
  374. }
  375. if (cpu_flags & AV_CPU_FLAG_AVX) {
  376. ASSIGN_VSCALEX_FUNC(c->yuv2planeX, avx,);
  377. ASSIGN_VSCALE_FUNC(c->yuv2plane1, avx, avx, 1);
  378. switch (c->srcFormat) {
  379. case PIX_FMT_YUYV422:
  380. c->chrToYV12 = ff_yuyvToUV_avx;
  381. break;
  382. case PIX_FMT_UYVY422:
  383. c->chrToYV12 = ff_uyvyToUV_avx;
  384. break;
  385. case PIX_FMT_NV12:
  386. c->chrToYV12 = ff_nv12ToUV_avx;
  387. break;
  388. case PIX_FMT_NV21:
  389. c->chrToYV12 = ff_nv21ToUV_avx;
  390. break;
  391. case_rgb(rgb24, RGB24, avx);
  392. case_rgb(bgr24, BGR24, avx);
  393. case_rgb(bgra, BGRA, avx);
  394. case_rgb(rgba, RGBA, avx);
  395. case_rgb(abgr, ABGR, avx);
  396. case_rgb(argb, ARGB, avx);
  397. default:
  398. break;
  399. }
  400. }
  401. #endif
  402. }