FreeRDP
Loading...
Searching...
No Matches
prim_colors.c
1/* FreeRDP: A Remote Desktop Protocol Client
2 * Color conversion operations.
3 * vi:ts=4 sw=4:
4 *
5 * Copyright 2011 Stephen Erisman
6 * Copyright 2011 Norbert Federa <norbert.federa@thincast.com>
7 * Copyright 2011 Martin Fleisz <martin.fleisz@thincast.com>
8 * (c) Copyright 2012 Hewlett-Packard Development Company, L.P.
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License. You may obtain
12 * a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express
16 * or implied. See the License for the specific language governing
17 * permissions and limitations under the License.
18 */
19
20#include <math.h>
21
22#include <freerdp/config.h>
23#include <winpr/assert.h>
24#include <winpr/cast.h>
25
26#include <freerdp/types.h>
27#include <freerdp/primitives.h>
28#include <freerdp/codec/color.h>
29
30#include "prim_internal.h"
31#include "prim_colors.h"
32
33#ifndef MINMAX
34#define MINMAX(_v_, _l_, _h_) ((_v_) < (_l_) ? (_l_) : ((_v_) > (_h_) ? (_h_) : (_v_)))
35#endif /* !MINMAX */
36/* ------------------------------------------------------------------------- */
37
38/* pregenerated table for ycbcr constants: [0,27]
39 *
40 * rounded integer values derived from the following formula:
41 *
42 * { (1.402525f * 2^divisor), (0.714401f * 2^divisor), (0.343730f * 2^divisor), (1.769905f *
43 * 2^divisor) }
44 */
45
46static const INT32 ycbcr_constants[][4] = { { 1, 1, 0, 2 },
47 { 3, 1, 1, 4 },
48 { 6, 3, 1, 7 },
49 { 11, 6, 3, 14 },
50 { 22, 11, 5, 28 },
51 { 45, 23, 11, 57 },
52 { 90, 46, 22, 113 },
53 { 180, 91, 44, 227 },
54 { 359, 183, 88, 453 },
55 { 718, 366, 176, 906 },
56 { 1436, 732, 352, 1812 },
57 { 2872, 1463, 704, 3625 },
58 { 5745, 2926, 1408, 7250 },
59 { 11489, 5852, 2816, 14499 },
60 { 22979, 11705, 5632, 28998 },
61 { 45958, 23409, 11263, 57996 },
62 { 91916, 46819, 22527, 115992 },
63 { 183832, 93638, 45053, 231985 },
64 { 367664, 187276, 90107, 463970 },
65 { 735327, 374552, 180214, 927940 },
66 { 1470654, 749104, 360427, 1855880 },
67 { 2941308, 1498207, 720854, 3711760 },
68 { 5882616, 2996415, 1441708, 7423520 },
69 { 11765232, 5992830, 2883416, 14847039 },
70 { 23530465, 11985660, 5766832, 29694078 },
71 { 47060930, 23971320, 11533665, 59388157 },
72 { 94121859, 47942640, 23067330, 118776314 },
73 { 188243719, 95885279, 46134660, 237552628 },
74 { 376487438, 191770558, 92269319, 475105256 },
75 { 752974876, 383541116, 184538639, 950210512 },
76 { 1505949752, 767082233, 369077277, 1900421023 } };
77
78static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_BGRX(const INT16* WINPR_RESTRICT pSrc[3],
79 UINT32 srcStep, BYTE* WINPR_RESTRICT pDst,
80 UINT32 dstStep, UINT32 DstFormat,
81 const prim_size_t* WINPR_RESTRICT roi)
82{
83 BYTE* pRGB = pDst;
84 const INT16* pY = pSrc[0];
85 const INT16* pCb = pSrc[1];
86 const INT16* pCr = pSrc[2];
87 const size_t srcPad = (srcStep - (roi->width * 2)) / 2;
88 const size_t dstPad = (dstStep - (roi->width * 4));
89 const DWORD formatSize = FreeRDPGetBytesPerPixel(DstFormat);
90
91 for (UINT32 y = 0; y < roi->height; y++)
92 {
93 for (UINT32 x = 0; x < roi->width; x++)
94 {
95 const INT32 divisor = 16;
96 const INT32 Y = (INT32)((UINT32)((*pY++) + 4096) << divisor);
97 const INT32 Cb = (*pCb++);
98 const INT32 Cr = (*pCr++);
99
100 /* unsigned arithmetic: wraps instead of overflowing for out of range input */
101 const UINT32 CrR = (UINT32)Cr * (UINT32)ycbcr_constants[divisor][0];
102 const UINT32 CrG = (UINT32)Cr * (UINT32)ycbcr_constants[divisor][1];
103 const UINT32 CbG = (UINT32)Cb * (UINT32)ycbcr_constants[divisor][2];
104 const UINT32 CbB = (UINT32)Cb * (UINT32)ycbcr_constants[divisor][3];
105 const INT32 R = (INT32)(CrR + (UINT32)Y) >> (divisor + 5);
106 const INT32 G = (INT32)((UINT32)Y - CbG - CrG) >> (divisor + 5);
107 const INT32 B = (INT32)(CbB + (UINT32)Y) >> (divisor + 5);
108 pRGB = writePixelBGRX(pRGB, formatSize, DstFormat, CLIP(R), CLIP(G), CLIP(B), 0);
109 }
110
111 pY += srcPad;
112 pCb += srcPad;
113 pCr += srcPad;
114 pRGB += dstPad;
115 }
116
117 return PRIMITIVES_SUCCESS;
118}
119
120static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R_general(const INT16* WINPR_RESTRICT pSrc[3],
121 UINT32 srcStep, BYTE* WINPR_RESTRICT pDst,
122 UINT32 dstStep, UINT32 DstFormat,
123 const prim_size_t* WINPR_RESTRICT roi)
124{
125 BYTE* pRGB = pDst;
126 const INT16* pY = pSrc[0];
127 const INT16* pCb = pSrc[1];
128 const INT16* pCr = pSrc[2];
129 const size_t srcPad = (srcStep - (roi->width * 2)) / 2;
130 const size_t dstPad = (dstStep - (roi->width * 4));
131 const fkt_writePixel writePixel = getPixelWriteFunction(DstFormat, FALSE);
132 const DWORD formatSize = FreeRDPGetBytesPerPixel(DstFormat);
133
134 for (UINT32 y = 0; y < roi->height; y++)
135 {
136 for (UINT32 x = 0; x < roi->width; x++)
137 {
138 const INT32 divisor = 16;
139 const INT32 Y = (INT32)((UINT32)((*pY++) + 4096) << divisor);
140 const INT32 Cb = (*pCb++);
141 const INT32 Cr = (*pCr++);
142 /* unsigned arithmetic: wraps instead of overflowing for out of range input */
143 const UINT32 CrR = (UINT32)Cr * (UINT32)ycbcr_constants[divisor][0];
144 const UINT32 CrG = (UINT32)Cr * (UINT32)ycbcr_constants[divisor][1];
145 const UINT32 CbG = (UINT32)Cb * (UINT32)ycbcr_constants[divisor][2];
146 const UINT32 CbB = (UINT32)Cb * (UINT32)ycbcr_constants[divisor][3];
147 const INT32 R = (INT32)(CrR + (UINT32)Y) >> (divisor + 5);
148 const INT32 G = (INT32)((UINT32)Y - CbG - CrG) >> (divisor + 5);
149 const INT32 B = (INT32)(CbB + (UINT32)Y) >> (divisor + 5);
150 pRGB = writePixel(pRGB, formatSize, DstFormat, CLIP(R), CLIP(G), CLIP(B), 0);
151 }
152
153 pY += srcPad;
154 pCb += srcPad;
155 pCr += srcPad;
156 pRGB += dstPad;
157 }
158
159 return PRIMITIVES_SUCCESS;
160}
161
162static pstatus_t general_yCbCrToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3],
163 UINT32 srcStep, BYTE* WINPR_RESTRICT pDst,
164 UINT32 dstStep, UINT32 DstFormat,
165 const prim_size_t* WINPR_RESTRICT roi)
166{
167 switch (DstFormat)
168 {
169 case PIXEL_FORMAT_BGRA32:
170 case PIXEL_FORMAT_BGRX32:
171 return general_yCbCrToRGB_16s8u_P3AC4R_BGRX(pSrc, srcStep, pDst, dstStep, DstFormat,
172 roi);
173
174 default:
175 return general_yCbCrToRGB_16s8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat,
176 roi);
177 }
178}
179
180/* ------------------------------------------------------------------------- */
181
182static pstatus_t
183general_yCbCrToRGB_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep,
184 INT16* WINPR_RESTRICT pDst[3], INT32 dstStep,
185 const prim_size_t* WINPR_RESTRICT roi) /* region of interest */
186{
198 const INT16* yptr = pSrc[0];
199 const INT16* cbptr = pSrc[1];
200 const INT16* crptr = pSrc[2];
201 INT16* rptr = pDst[0];
202 INT16* gptr = pDst[1];
203 INT16* bptr = pDst[2];
204 UINT32 srcbump = (WINPR_ASSERTING_INT_CAST(uint32_t, srcStep) - (roi->width * sizeof(UINT16))) /
205 sizeof(UINT16);
206 UINT32 dstbump = (WINPR_ASSERTING_INT_CAST(uint32_t, dstStep) - (roi->width * sizeof(UINT16))) /
207 sizeof(UINT16);
208
209 for (UINT32 y = 0; y < roi->height; y++)
210 {
211 for (UINT32 x = 0; x < roi->width; ++x)
212 {
213 /* INT32 is used intentionally because we calculate
214 * with shifted factors!
215 */
216 INT32 cy = (INT32)(*yptr++);
217 INT32 cb = (INT32)(*cbptr++);
218 INT32 cr = (INT32)(*crptr++);
219 INT64 r = 0;
220 INT64 g = 0;
221 INT64 b = 0;
222 /*
223 * This is the slow floating point version kept here for reference.
224 * y = y + 4096; // 128<<5=4096 so that we can scale the sum by>>5
225 * r = y + cr*1.403f;
226 * g = y - cb*0.344f - cr*0.714f;
227 * b = y + cb*1.770f;
228 * y_r_buf[i] = CLIP(r>>5);
229 * cb_g_buf[i] = CLIP(g>>5);
230 * cr_b_buf[i] = CLIP(b>>5);
231 */
232 /*
233 * We scale the factors by << 16 into 32-bit integers in order to
234 * avoid slower floating point multiplications. Since the final
235 * result needs to be scaled by >> 5 we will extract only the
236 * upper 11 bits (>> 21) from the final sum.
237 * Hence we also have to scale the other terms of the sum by << 16.
238 * R: 1.403 << 16 = 91947
239 * G: 0.344 << 16 = 22544, 0.714 << 16 = 46792
240 * B: 1.770 << 16 = 115998
241 */
242 cy = (INT32)((UINT32)(cy + 4096) << 16);
243
244 r = 1LL * cy + 1LL * cr * ycbcr_constants[16][0];
245 g = 1LL * cy - 1LL * cb * ycbcr_constants[16][1] - 1LL * cr * ycbcr_constants[16][2];
246 b = 1LL * cy + 1LL * cb * ycbcr_constants[16][3];
247 *rptr++ = CLIP(r >> 21);
248 *gptr++ = CLIP(g >> 21);
249 *bptr++ = CLIP(b >> 21);
250 }
251
252 yptr += srcbump;
253 cbptr += srcbump;
254 crptr += srcbump;
255 rptr += dstbump;
256 gptr += dstbump;
257 bptr += dstbump;
258 }
259
260 return PRIMITIVES_SUCCESS;
261}
262
263/* ------------------------------------------------------------------------- */
264static pstatus_t
265general_RGBToYCbCr_16s16s_P3P3(const INT16* WINPR_RESTRICT pSrc[3], INT32 srcStep,
266 INT16* WINPR_RESTRICT pDst[3], INT32 dstStep,
267 const prim_size_t* WINPR_RESTRICT roi) /* region of interest */
268{
269 /* The encoded YCbCr coefficients are represented as 11.5 fixed-point
270 * numbers:
271 *
272 * 1 sign bit + 10 integer bits + 5 fractional bits
273 *
274 * However only 7 integer bits will be actually used since the value
275 * range is [-128.0, 127.0]. In other words, the encoded coefficients
276 * is scaled by << 5 when interpreted as INT16.
277 * It will be scaled down to original during the quantization phase.
278 */
279 const INT16* rptr = pSrc[0];
280 const INT16* gptr = pSrc[1];
281 const INT16* bptr = pSrc[2];
282 INT16* yptr = pDst[0];
283 INT16* cbptr = pDst[1];
284 INT16* crptr = pDst[2];
285 UINT32 srcbump = (WINPR_ASSERTING_INT_CAST(uint32_t, srcStep) - (roi->width * sizeof(UINT16))) /
286 sizeof(UINT16);
287 UINT32 dstbump = (WINPR_ASSERTING_INT_CAST(uint32_t, dstStep) - (roi->width * sizeof(UINT16))) /
288 sizeof(UINT16);
289
290 for (UINT32 y = 0; y < roi->height; y++)
291 {
292 for (UINT32 x = 0; x < roi->width; ++x)
293 {
294 /* INT32 is used intentionally because we calculate with
295 * shifted factors!
296 */
297 INT32 r = (INT32)(*rptr++);
298 INT32 g = (INT32)(*gptr++);
299 INT32 b = (INT32)(*bptr++);
300 /* We scale the factors by << 15 into 32-bit integers in order
301 * to avoid slower floating point multiplications. Since the
302 * terms need to be scaled by << 5 we simply scale the final
303 * sum by >> 10
304 *
305 * Y: 0.299000 << 15 = 9798, 0.587000 << 15 = 19235,
306 * 0.114000 << 15 = 3735
307 * Cb: 0.168935 << 15 = 5535, 0.331665 << 15 = 10868,
308 * 0.500590 << 15 = 16403
309 * Cr: 0.499813 << 15 = 16377, 0.418531 << 15 = 13714,
310 * 0.081282 << 15 = 2663
311 */
312 INT32 cy = (r * 9798 + g * 19235 + b * 3735) >> 10;
313 INT32 cb = (r * -5535 + g * -10868 + b * 16403) >> 10;
314 INT32 cr = (r * 16377 + g * -13714 + b * -2663) >> 10;
315 *yptr++ = (INT16)MINMAX(cy - 4096, -4096, 4095);
316 *cbptr++ = (INT16)MINMAX(cb, -4096, 4095);
317 *crptr++ = (INT16)MINMAX(cr, -4096, 4095);
318 }
319
320 yptr += srcbump;
321 cbptr += srcbump;
322 crptr += srcbump;
323 rptr += dstbump;
324 gptr += dstbump;
325 bptr += dstbump;
326 }
327
328 return PRIMITIVES_SUCCESS;
329}
330
331static inline void writeScanlineGeneric(BYTE* dst, DWORD formatSize, UINT32 DstFormat,
332 const INT16* r, const INT16* g, const INT16* b, DWORD width)
333{
334 fkt_writePixel writePixel = getPixelWriteFunction(DstFormat, FALSE);
335
336 for (UINT32 x = 0; x < width; x++)
337 {
338 const INT16 pr = *r++;
339 const INT16 pg = *g++;
340 const INT16 pb = *b++;
341
342 dst =
343 writePixel(dst, formatSize, DstFormat, WINPR_ASSERTING_INT_CAST(UINT8, pr),
344 WINPR_ASSERTING_INT_CAST(UINT8, pg), WINPR_ASSERTING_INT_CAST(UINT8, pb), 0);
345 }
346}
347
348static inline void writeScanlineRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r,
349 const INT16* g, const INT16* b, DWORD width)
350{
351 WINPR_UNUSED(formatSize);
352 WINPR_UNUSED(DstFormat);
353
354 for (UINT32 x = 0; x < width; x++)
355 {
356 const BYTE R = CLIP(*r++);
357 const BYTE G = CLIP(*g++);
358 const BYTE B = CLIP(*b++);
359 *dst++ = R;
360 *dst++ = G;
361 *dst++ = B;
362 }
363}
364
365static inline void writeScanlineBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r,
366 const INT16* g, const INT16* b, DWORD width)
367{
368 WINPR_UNUSED(formatSize);
369 WINPR_UNUSED(DstFormat);
370
371 for (UINT32 x = 0; x < width; x++)
372 {
373 const BYTE R = CLIP(*r++);
374 const BYTE G = CLIP(*g++);
375 const BYTE B = CLIP(*b++);
376 *dst++ = B;
377 *dst++ = G;
378 *dst++ = R;
379 }
380}
381
382static inline void writeScanlineBGRX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r,
383 const INT16* g, const INT16* b, DWORD width)
384{
385 WINPR_UNUSED(formatSize);
386 WINPR_UNUSED(DstFormat);
387
388 for (UINT32 x = 0; x < width; x++)
389 {
390 const BYTE R = CLIP(*r++);
391 const BYTE G = CLIP(*g++);
392 const BYTE B = CLIP(*b++);
393 *dst++ = B;
394 *dst++ = G;
395 *dst++ = R;
396 *dst++ = 0xFF;
397 }
398}
399
400static inline void writeScanlineRGBX(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r,
401 const INT16* g, const INT16* b, DWORD width)
402{
403 WINPR_UNUSED(formatSize);
404 WINPR_UNUSED(DstFormat);
405
406 for (UINT32 x = 0; x < width; x++)
407 {
408 const BYTE R = CLIP(*r++);
409 const BYTE G = CLIP(*g++);
410 const BYTE B = CLIP(*b++);
411 *dst++ = R;
412 *dst++ = G;
413 *dst++ = B;
414 *dst++ = 0xFF;
415 }
416}
417
418static inline void writeScanlineXBGR(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r,
419 const INT16* g, const INT16* b, DWORD width)
420{
421 WINPR_UNUSED(formatSize);
422 WINPR_UNUSED(DstFormat);
423
424 for (UINT32 x = 0; x < width; x++)
425 {
426 const BYTE R = CLIP(*r++);
427 const BYTE G = CLIP(*g++);
428 const BYTE B = CLIP(*b++);
429 *dst++ = 0xFF;
430 *dst++ = B;
431 *dst++ = G;
432 *dst++ = R;
433 }
434}
435
436static inline void writeScanlineXRGB(BYTE* dst, DWORD formatSize, UINT32 DstFormat, const INT16* r,
437 const INT16* g, const INT16* b, DWORD width)
438{
439 WINPR_UNUSED(formatSize);
440 WINPR_UNUSED(DstFormat);
441
442 for (UINT32 x = 0; x < width; x++)
443 {
444 const BYTE R = CLIP(*r++);
445 const BYTE G = CLIP(*g++);
446 const BYTE B = CLIP(*b++);
447 *dst++ = 0xFF;
448 *dst++ = R;
449 *dst++ = G;
450 *dst++ = B;
451 }
452}
453
454typedef void (*fkt_writeScanline)(BYTE*, DWORD, UINT32, const INT16*, const INT16*, const INT16*,
455 DWORD);
456
457static inline fkt_writeScanline getScanlineWriteFunction(DWORD format)
458{
459 switch (format)
460 {
461 case PIXEL_FORMAT_ARGB32:
462 case PIXEL_FORMAT_XRGB32:
463 return writeScanlineXRGB;
464
465 case PIXEL_FORMAT_ABGR32:
466 case PIXEL_FORMAT_XBGR32:
467 return writeScanlineXBGR;
468
469 case PIXEL_FORMAT_RGBA32:
470 case PIXEL_FORMAT_RGBX32:
471 return writeScanlineRGBX;
472
473 case PIXEL_FORMAT_BGRA32:
474 case PIXEL_FORMAT_BGRX32:
475 return writeScanlineBGRX;
476
477 case PIXEL_FORMAT_BGR24:
478 return writeScanlineBGR;
479
480 case PIXEL_FORMAT_RGB24:
481 return writeScanlineRGB;
482
483 default:
484 return writeScanlineGeneric;
485 }
486}
487
488/* ------------------------------------------------------------------------- */
489static pstatus_t general_RGBToRGB_16s8u_P3AC4R_general(
490 const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */
491 UINT32 srcStep, /* bytes between rows in source data */
492 BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */
493 UINT32 dstStep, /* bytes between rows in dest data */
494 UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */
495{
496 const INT16* r = pSrc[0];
497 const INT16* g = pSrc[1];
498 const INT16* b = pSrc[2];
499 const DWORD srcAdd = srcStep / sizeof(INT16);
500 fkt_writeScanline writeScanline = getScanlineWriteFunction(DstFormat);
501 const DWORD formatSize = FreeRDPGetBytesPerPixel(DstFormat);
502
503 for (UINT32 y = 0; y < roi->height; ++y)
504 {
505 (*writeScanline)(pDst, formatSize, DstFormat, r, g, b, roi->width);
506 pDst += dstStep;
507 r += srcAdd;
508 g += srcAdd;
509 b += srcAdd;
510 }
511
512 return PRIMITIVES_SUCCESS;
513}
514
515static pstatus_t general_RGBToRGB_16s8u_P3AC4R_BGRX(
516 const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */
517 UINT32 srcStep, /* bytes between rows in source data */
518 BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */
519 UINT32 dstStep, /* bytes between rows in dest data */
520 UINT32 DstFormat, const prim_size_t* WINPR_RESTRICT roi) /* region of interest */
521{
522 const INT16* r = pSrc[0];
523 const INT16* g = pSrc[1];
524 const INT16* b = pSrc[2];
525 const DWORD srcAdd = srcStep / sizeof(INT16);
526 const DWORD formatSize = FreeRDPGetBytesPerPixel(DstFormat);
527
528 for (UINT32 y = 0; y < roi->height; ++y)
529 {
530 writeScanlineBGRX(pDst, formatSize, DstFormat, r, g, b, roi->width);
531 pDst += dstStep;
532 r += srcAdd;
533 g += srcAdd;
534 b += srcAdd;
535 }
536
537 return PRIMITIVES_SUCCESS;
538}
539
540static pstatus_t
541general_RGBToRGB_16s8u_P3AC4R(const INT16* WINPR_RESTRICT pSrc[3], /* 16-bit R,G, and B arrays */
542 UINT32 srcStep, /* bytes between rows in source data */
543 BYTE* WINPR_RESTRICT pDst, /* 32-bit interleaved ARGB (ABGR?) data */
544 UINT32 dstStep, /* bytes between rows in dest data */
545 UINT32 DstFormat,
546 const prim_size_t* WINPR_RESTRICT roi) /* region of interest */
547{
548 switch (DstFormat)
549 {
550 case PIXEL_FORMAT_BGRA32:
551 case PIXEL_FORMAT_BGRX32:
552 return general_RGBToRGB_16s8u_P3AC4R_BGRX(pSrc, srcStep, pDst, dstStep, DstFormat, roi);
553
554 default:
555 return general_RGBToRGB_16s8u_P3AC4R_general(pSrc, srcStep, pDst, dstStep, DstFormat,
556 roi);
557 }
558}
559/* ------------------------------------------------------------------------- */
560void primitives_init_colors(primitives_t* WINPR_RESTRICT prims)
561{
562 prims->yCbCrToRGB_16s8u_P3AC4R = general_yCbCrToRGB_16s8u_P3AC4R;
563 prims->yCbCrToRGB_16s16s_P3P3 = general_yCbCrToRGB_16s16s_P3P3;
564 prims->RGBToYCbCr_16s16s_P3P3 = general_RGBToYCbCr_16s16s_P3P3;
565 prims->RGBToRGB_16s8u_P3AC4R = general_RGBToRGB_16s8u_P3AC4R;
566}
567
568/* ------------------------------------------------------------------------- */
569void primitives_init_colors_opt(primitives_t* WINPR_RESTRICT prims)
570{
571 primitives_init_colors(prims);
572 primitives_init_colors_sse2(prims);
573 primitives_init_colors_neon(prims);
574}