1 /**************************************************************************
3 * Copyright 2010 VMware, Inc.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16 * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL
17 * THE COPYRIGHT HOLDERS, AUTHORS AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM,
18 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
19 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE
20 * USE OR OTHER DEALINGS IN THE SOFTWARE.
22 * The above copyright notice and this permission notice (including the
23 * next paragraph) shall be included in all copies or substantial portions
26 **************************************************************************/
31 * YUV colorspace conversion.
33 * @author Brian Paul <brianp@vmware.com>
34 * @author Michal Krol <michal@vmware.com>
35 * @author Jose Fonseca <jfonseca@vmware.com>
38 * - http://www.fourcc.org/fccyvrgb.php
39 * - http://msdn.microsoft.com/en-us/library/ms893078
40 * - http://en.wikipedia.org/wiki/YUV
44 #ifndef U_FORMAT_YUV_H_
45 #define U_FORMAT_YUV_H_
48 #include "pipe/p_compiler.h"
49 #include "util/u_math.h"
53 * TODO: Ensure we use consistent and right floating formulas, with enough
54 * precision in the coefficients.
58 util_format_rgb_float_to_yuv(float r
, float g
, float b
,
59 uint8_t *y
, uint8_t *u
, uint8_t *v
)
61 const float _r
= SATURATE(r
);
62 const float _g
= SATURATE(g
);
63 const float _b
= SATURATE(b
);
65 const float scale
= 255.0f
;
67 const int _y
= scale
* ( (0.257f
* _r
) + (0.504f
* _g
) + (0.098f
* _b
));
68 const int _u
= scale
* (-(0.148f
* _r
) - (0.291f
* _g
) + (0.439f
* _b
));
69 const int _v
= scale
* ( (0.439f
* _r
) - (0.368f
* _g
) - (0.071f
* _b
));
78 util_format_yuv_to_rgb_float(uint8_t y
, uint8_t u
, uint8_t v
,
79 float *r
, float *g
, float *b
)
81 const int _y
= y
- 16;
82 const int _u
= u
- 128;
83 const int _v
= v
- 128;
85 const float y_factor
= 255.0f
/ 219.0f
;
87 const float scale
= 1.0f
/ 255.0f
;
89 *r
= scale
* (y_factor
* _y
+ 1.596f
* _v
);
90 *g
= scale
* (y_factor
* _y
- 0.391f
* _u
- 0.813f
* _v
);
91 *b
= scale
* (y_factor
* _y
+ 2.018f
* _u
);
96 util_format_rgb_8unorm_to_yuv(uint8_t r
, uint8_t g
, uint8_t b
,
97 uint8_t *y
, uint8_t *u
, uint8_t *v
)
99 *y
= (( 66 * r
+ 129 * g
+ 25 * b
+ 128) >> 8) + 16;
100 *u
= (( -38 * r
- 74 * g
+ 112 * b
+ 128) >> 8) + 128;
101 *v
= (( 112 * r
- 94 * g
- 18 * b
+ 128) >> 8) + 128;
106 util_format_yuv_to_rgb_8unorm(uint8_t y
, uint8_t u
, uint8_t v
,
107 uint8_t *r
, uint8_t *g
, uint8_t *b
)
109 const int _y
= y
- 16;
110 const int _u
= u
- 128;
111 const int _v
= v
- 128;
113 const int _r
= (298 * _y
+ 409 * _v
+ 128) >> 8;
114 const int _g
= (298 * _y
- 100 * _u
- 208 * _v
+ 128) >> 8;
115 const int _b
= (298 * _y
+ 516 * _u
+ 128) >> 8;
117 *r
= CLAMP(_r
, 0, 255);
118 *g
= CLAMP(_g
, 0, 255);
119 *b
= CLAMP(_b
, 0, 255);
125 util_format_uyvy_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
126 const uint8_t *src_row
, unsigned src_stride
,
127 unsigned width
, unsigned height
);
130 util_format_uyvy_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
131 const uint8_t *src_row
, unsigned src_stride
,
132 unsigned width
, unsigned height
);
135 util_format_uyvy_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
136 const float *src_row
, unsigned src_stride
,
137 unsigned width
, unsigned height
);
140 util_format_uyvy_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
141 const uint8_t *src_row
, unsigned src_stride
,
142 unsigned width
, unsigned height
);
145 util_format_uyvy_fetch_rgba_float(float *dst
, const uint8_t *src
,
146 unsigned i
, unsigned j
);
149 util_format_yuyv_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
150 const uint8_t *src_row
, unsigned src_stride
,
151 unsigned width
, unsigned height
);
154 util_format_yuyv_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
155 const uint8_t *src_row
, unsigned src_stride
,
156 unsigned width
, unsigned height
);
159 util_format_yuyv_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
160 const float *src_row
, unsigned src_stride
,
161 unsigned width
, unsigned height
);
164 util_format_yuyv_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
165 const uint8_t *src_row
, unsigned src_stride
,
166 unsigned width
, unsigned height
);
169 util_format_yuyv_fetch_rgba_float(float *dst
, const uint8_t *src
,
170 unsigned i
, unsigned j
);
172 /* XXX: Stubbed for now */
174 util_format_yv12_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
175 const uint8_t *src_row
, unsigned src_stride
,
176 unsigned width
, unsigned height
);
178 util_format_yv12_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
179 const uint8_t *src_row
, unsigned src_stride
,
180 unsigned width
, unsigned height
);
182 util_format_yv12_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
183 const uint8_t *src_row
, unsigned src_stride
,
184 unsigned width
, unsigned height
);
186 util_format_yv12_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
187 const float *src_row
, unsigned src_stride
,
188 unsigned width
, unsigned height
);
190 util_format_yv12_fetch_rgba_float(float *dst
, const uint8_t *src
,
191 unsigned i
, unsigned j
);
193 util_format_yv16_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
194 const uint8_t *src_row
, unsigned src_stride
,
195 unsigned width
, unsigned height
);
197 util_format_yv16_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
198 const uint8_t *src_row
, unsigned src_stride
,
199 unsigned width
, unsigned height
);
201 util_format_yv16_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
202 const uint8_t *src_row
, unsigned src_stride
,
203 unsigned width
, unsigned height
);
205 util_format_yv16_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
206 const float *src_row
, unsigned src_stride
,
207 unsigned width
, unsigned height
);
209 util_format_yv16_fetch_rgba_float(float *dst
, const uint8_t *src
,
210 unsigned i
, unsigned j
);
212 util_format_iyuv_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
213 const uint8_t *src_row
, unsigned src_stride
,
214 unsigned width
, unsigned height
);
216 util_format_iyuv_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
217 const uint8_t *src_row
, unsigned src_stride
,
218 unsigned width
, unsigned height
);
220 util_format_iyuv_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
221 const uint8_t *src_row
, unsigned src_stride
,
222 unsigned width
, unsigned height
);
224 util_format_iyuv_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
225 const float *src_row
, unsigned src_stride
,
226 unsigned width
, unsigned height
);
228 util_format_iyuv_fetch_rgba_float(float *dst
, const uint8_t *src
,
229 unsigned i
, unsigned j
);
231 util_format_nv12_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
232 const uint8_t *src_row
, unsigned src_stride
,
233 unsigned width
, unsigned height
);
235 util_format_nv12_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
236 const uint8_t *src_row
, unsigned src_stride
,
237 unsigned width
, unsigned height
);
239 util_format_nv12_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
240 const uint8_t *src_row
, unsigned src_stride
,
241 unsigned width
, unsigned height
);
243 util_format_nv12_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
244 const float *src_row
, unsigned src_stride
,
245 unsigned width
, unsigned height
);
247 util_format_nv12_fetch_rgba_float(float *dst
, const uint8_t *src
,
248 unsigned i
, unsigned j
);
250 util_format_nv21_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
251 const uint8_t *src_row
, unsigned src_stride
,
252 unsigned width
, unsigned height
);
254 util_format_nv21_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
255 const uint8_t *src_row
, unsigned src_stride
,
256 unsigned width
, unsigned height
);
258 util_format_nv21_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
259 const uint8_t *src_row
, unsigned src_stride
,
260 unsigned width
, unsigned height
);
262 util_format_nv21_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
263 const float *src_row
, unsigned src_stride
,
264 unsigned width
, unsigned height
);
266 util_format_nv21_fetch_rgba_float(float *dst
, const uint8_t *src
,
267 unsigned i
, unsigned j
);
270 util_format_p010_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
271 const uint8_t *src_row
, unsigned src_stride
,
272 unsigned width
, unsigned height
);
274 util_format_p010_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
275 const uint8_t *src_row
, unsigned src_stride
,
276 unsigned width
, unsigned height
);
278 util_format_p010_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
279 const uint8_t *src_row
, unsigned src_stride
,
280 unsigned width
, unsigned height
);
282 util_format_p010_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
283 const float *src_row
, unsigned src_stride
,
284 unsigned width
, unsigned height
);
286 util_format_p010_fetch_rgba_float(float *dst
, const uint8_t *src
,
287 unsigned i
, unsigned j
);
290 util_format_p016_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
291 const uint8_t *src_row
, unsigned src_stride
,
292 unsigned width
, unsigned height
);
294 util_format_p016_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
295 const uint8_t *src_row
, unsigned src_stride
,
296 unsigned width
, unsigned height
);
298 util_format_p016_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
299 const uint8_t *src_row
, unsigned src_stride
,
300 unsigned width
, unsigned height
);
302 util_format_p016_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
303 const float *src_row
, unsigned src_stride
,
304 unsigned width
, unsigned height
);
306 util_format_p016_fetch_rgba_float(float *dst
, const uint8_t *src
,
307 unsigned i
, unsigned j
);
310 util_format_xyuv_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
311 const uint8_t *src_row
, unsigned src_stride
,
312 unsigned width
, unsigned height
);
315 util_format_xyuv_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
316 const uint8_t *src_row
, unsigned src_stride
,
317 unsigned width
, unsigned height
);
320 util_format_xyuv_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
321 const float *src_row
, unsigned src_stride
,
322 unsigned width
, unsigned height
);
325 util_format_xyuv_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
326 const uint8_t *src_row
, unsigned src_stride
,
327 unsigned width
, unsigned height
);
330 util_format_xyuv_fetch_rgba_float(float *dst
, const uint8_t *src
,
331 unsigned i
, unsigned j
);
333 util_format_ayuv_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
334 const uint8_t *src_row
, unsigned src_stride
,
335 unsigned width
, unsigned height
);
338 util_format_ayuv_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
339 const uint8_t *src_row
, unsigned src_stride
,
340 unsigned width
, unsigned height
);
343 util_format_ayuv_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
344 const float *src_row
, unsigned src_stride
,
345 unsigned width
, unsigned height
);
348 util_format_ayuv_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
349 const uint8_t *src_row
, unsigned src_stride
,
350 unsigned width
, unsigned height
);
353 util_format_ayuv_fetch_rgba_float(float *dst
, const uint8_t *src
,
354 unsigned i
, unsigned j
);
356 util_format_r8g8_b8g8_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
357 const uint8_t *src_row
, unsigned src_stride
,
358 unsigned width
, unsigned height
);
361 util_format_r8g8_b8g8_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
362 const uint8_t *src_row
, unsigned src_stride
,
363 unsigned width
, unsigned height
);
366 util_format_r8g8_b8g8_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
367 const float *src_row
, unsigned src_stride
,
368 unsigned width
, unsigned height
);
371 util_format_r8g8_b8g8_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
372 const uint8_t *src_row
, unsigned src_stride
,
373 unsigned width
, unsigned height
);
376 util_format_r8g8_b8g8_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
377 unsigned i
, unsigned j
);
380 util_format_g8r8_g8b8_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
381 const uint8_t *src_row
, unsigned src_stride
,
382 unsigned width
, unsigned height
);
385 util_format_g8r8_g8b8_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
386 const uint8_t *src_row
, unsigned src_stride
,
387 unsigned width
, unsigned height
);
390 util_format_g8r8_g8b8_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
391 const float *src_row
, unsigned src_stride
,
392 unsigned width
, unsigned height
);
395 util_format_g8r8_g8b8_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
396 const uint8_t *src_row
, unsigned src_stride
,
397 unsigned width
, unsigned height
);
400 util_format_g8r8_g8b8_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
401 unsigned i
, unsigned j
);
404 util_format_r8g8_r8b8_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
405 const uint8_t *src_row
, unsigned src_stride
,
406 unsigned width
, unsigned height
);
409 util_format_r8g8_r8b8_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
410 const uint8_t *src_row
, unsigned src_stride
,
411 unsigned width
, unsigned height
);
414 util_format_r8g8_r8b8_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
415 const float *src_row
, unsigned src_stride
,
416 unsigned width
, unsigned height
);
419 util_format_r8g8_r8b8_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
420 const uint8_t *src_row
, unsigned src_stride
,
421 unsigned width
, unsigned height
);
424 util_format_r8g8_r8b8_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
425 unsigned i
, unsigned j
);
428 util_format_g8r8_b8r8_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
429 const uint8_t *src_row
, unsigned src_stride
,
430 unsigned width
, unsigned height
);
433 util_format_g8r8_b8r8_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
434 const uint8_t *src_row
, unsigned src_stride
,
435 unsigned width
, unsigned height
);
438 util_format_g8r8_b8r8_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
439 const float *src_row
, unsigned src_stride
,
440 unsigned width
, unsigned height
);
443 util_format_g8r8_b8r8_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
444 const uint8_t *src_row
, unsigned src_stride
,
445 unsigned width
, unsigned height
);
448 util_format_g8r8_b8r8_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
449 unsigned i
, unsigned j
);
452 util_format_y8_u8_v8_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
453 const uint8_t *src_row
, unsigned src_stride
,
454 unsigned width
, unsigned height
);
456 util_format_y8_u8_v8_422_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
457 const uint8_t *src_row
, unsigned src_stride
,
458 unsigned width
, unsigned height
);
460 util_format_y8_u8_v8_422_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
461 const uint8_t *src_row
, unsigned src_stride
,
462 unsigned width
, unsigned height
);
464 util_format_y8_u8_v8_422_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
465 const float *src_row
, unsigned src_stride
,
466 unsigned width
, unsigned height
);
468 util_format_y8_u8_v8_422_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
469 unsigned i
, unsigned j
);
472 util_format_y8_u8v8_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
473 const uint8_t *src_row
, unsigned src_stride
,
474 unsigned width
, unsigned height
);
476 util_format_y8_u8v8_422_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
477 const uint8_t *src_row
, unsigned src_stride
,
478 unsigned width
, unsigned height
);
480 util_format_y8_u8v8_422_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
481 const uint8_t *src_row
, unsigned src_stride
,
482 unsigned width
, unsigned height
);
484 util_format_y8_u8v8_422_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
485 const float *src_row
, unsigned src_stride
,
486 unsigned width
, unsigned height
);
488 util_format_y8_u8v8_422_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
489 unsigned i
, unsigned j
);
492 util_format_y8_u8_v8_444_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
493 const uint8_t *src_row
, unsigned src_stride
,
494 unsigned width
, unsigned height
);
496 util_format_y8_u8_v8_444_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
497 const uint8_t *src_row
, unsigned src_stride
,
498 unsigned width
, unsigned height
);
500 util_format_y8_u8_v8_444_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
501 const uint8_t *src_row
, unsigned src_stride
,
502 unsigned width
, unsigned height
);
504 util_format_y8_u8_v8_444_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
505 const float *src_row
, unsigned src_stride
,
506 unsigned width
, unsigned height
);
508 util_format_y8_u8_v8_444_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
509 unsigned i
, unsigned j
);
512 util_format_y16_u16_v16_420_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
513 const uint8_t *src_row
, unsigned src_stride
,
514 unsigned width
, unsigned height
);
516 util_format_y16_u16_v16_420_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
517 const uint8_t *src_row
, unsigned src_stride
,
518 unsigned width
, unsigned height
);
520 util_format_y16_u16_v16_420_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
521 const uint8_t *src_row
, unsigned src_stride
,
522 unsigned width
, unsigned height
);
524 util_format_y16_u16_v16_420_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
525 const float *src_row
, unsigned src_stride
,
526 unsigned width
, unsigned height
);
528 util_format_y16_u16_v16_420_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
529 unsigned i
, unsigned j
);
532 util_format_y16_u16_v16_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
533 const uint8_t *src_row
, unsigned src_stride
,
534 unsigned width
, unsigned height
);
536 util_format_y16_u16_v16_422_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
537 const uint8_t *src_row
, unsigned src_stride
,
538 unsigned width
, unsigned height
);
540 util_format_y16_u16_v16_422_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
541 const uint8_t *src_row
, unsigned src_stride
,
542 unsigned width
, unsigned height
);
544 util_format_y16_u16_v16_422_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
545 const float *src_row
, unsigned src_stride
,
546 unsigned width
, unsigned height
);
548 util_format_y16_u16_v16_422_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
549 unsigned i
, unsigned j
);
552 util_format_y16_u16v16_422_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
553 const uint8_t *src_row
, unsigned src_stride
,
554 unsigned width
, unsigned height
);
556 util_format_y16_u16v16_422_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
557 const uint8_t *src_row
, unsigned src_stride
,
558 unsigned width
, unsigned height
);
560 util_format_y16_u16v16_422_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
561 const uint8_t *src_row
, unsigned src_stride
,
562 unsigned width
, unsigned height
);
564 util_format_y16_u16v16_422_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
565 const float *src_row
, unsigned src_stride
,
566 unsigned width
, unsigned height
);
568 util_format_y16_u16v16_422_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
569 unsigned i
, unsigned j
);
572 util_format_y16_u16_v16_444_unorm_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
573 const uint8_t *src_row
, unsigned src_stride
,
574 unsigned width
, unsigned height
);
576 util_format_y16_u16_v16_444_unorm_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
577 const uint8_t *src_row
, unsigned src_stride
,
578 unsigned width
, unsigned height
);
580 util_format_y16_u16_v16_444_unorm_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
581 const uint8_t *src_row
, unsigned src_stride
,
582 unsigned width
, unsigned height
);
584 util_format_y16_u16_v16_444_unorm_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
585 const float *src_row
, unsigned src_stride
,
586 unsigned width
, unsigned height
);
588 util_format_y16_u16_v16_444_unorm_fetch_rgba_float(float *dst
, const uint8_t *src
,
589 unsigned i
, unsigned j
);
591 #endif /* U_FORMAT_YUV_H_ */