1 /**************************************************************************
3 * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
4 * Copyright (c) 2008 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 "Software"),
8 * to deal in the Software without restriction, including without limitation
9 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
10 * and/or sell copies of the Software, and to permit persons to whom the
11 * Software is furnished to do so, subject to the following conditions:
13 * The above copyright notice and this permission notice shall be included
14 * in all copies or substantial portions of the Software.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
17 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
20 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
21 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
22 * OTHER DEALINGS IN THE SOFTWARE.
24 **************************************************************************/
28 #include "u_format_s3tc.h"
29 #include "util/format_srgb.h"
30 #include "util/u_math.h"
31 #include "../../../mesa/main/texcompress_s3tc_tmp.h"
34 util_format_dxtn_fetch_t util_format_dxt1_rgb_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgb_dxt1
;
35 util_format_dxtn_fetch_t util_format_dxt1_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt1
;
36 util_format_dxtn_fetch_t util_format_dxt3_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt3
;
37 util_format_dxtn_fetch_t util_format_dxt5_rgba_fetch
= (util_format_dxtn_fetch_t
)fetch_2d_texel_rgba_dxt5
;
39 util_format_dxtn_pack_t util_format_dxtn_pack
= (util_format_dxtn_pack_t
)tx_compress_dxtn
;
47 util_format_dxt1_rgb_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
49 util_format_dxt1_rgb_fetch(0, src
, i
, j
, dst
);
53 util_format_dxt1_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
55 util_format_dxt1_rgba_fetch(0, src
, i
, j
, dst
);
59 util_format_dxt3_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
61 util_format_dxt3_rgba_fetch(0, src
, i
, j
, dst
);
65 util_format_dxt5_rgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
67 util_format_dxt5_rgba_fetch(0, src
, i
, j
, dst
);
71 util_format_dxt1_rgb_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
74 util_format_dxt1_rgb_fetch(0, src
, i
, j
, tmp
);
75 dst
[0] = ubyte_to_float(tmp
[0]);
76 dst
[1] = ubyte_to_float(tmp
[1]);
77 dst
[2] = ubyte_to_float(tmp
[2]);
82 util_format_dxt1_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
85 util_format_dxt1_rgba_fetch(0, src
, i
, j
, tmp
);
86 dst
[0] = ubyte_to_float(tmp
[0]);
87 dst
[1] = ubyte_to_float(tmp
[1]);
88 dst
[2] = ubyte_to_float(tmp
[2]);
89 dst
[3] = ubyte_to_float(tmp
[3]);
93 util_format_dxt3_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
96 util_format_dxt3_rgba_fetch(0, src
, i
, j
, tmp
);
97 dst
[0] = ubyte_to_float(tmp
[0]);
98 dst
[1] = ubyte_to_float(tmp
[1]);
99 dst
[2] = ubyte_to_float(tmp
[2]);
100 dst
[3] = ubyte_to_float(tmp
[3]);
104 util_format_dxt5_rgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
107 util_format_dxt5_rgba_fetch(0, src
, i
, j
, tmp
);
108 dst
[0] = ubyte_to_float(tmp
[0]);
109 dst
[1] = ubyte_to_float(tmp
[1]);
110 dst
[2] = ubyte_to_float(tmp
[2]);
111 dst
[3] = ubyte_to_float(tmp
[3]);
116 * Block decompression.
120 util_format_dxtn_rgb_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
121 const uint8_t *src_row
, unsigned src_stride
,
122 unsigned width
, unsigned height
,
123 util_format_dxtn_fetch_t fetch
,
124 unsigned block_size
, boolean srgb
)
126 const unsigned bw
= 4, bh
= 4, comps
= 4;
128 for(y
= 0; y
< height
; y
+= bh
) {
129 const uint8_t *src
= src_row
;
130 for(x
= 0; x
< width
; x
+= bw
) {
131 for(j
= 0; j
< bh
; ++j
) {
132 for(i
= 0; i
< bw
; ++i
) {
133 uint8_t *dst
= dst_row
+ (y
+ j
)*dst_stride
/sizeof(*dst_row
) + (x
+ i
)*comps
;
134 fetch(0, src
, i
, j
, dst
);
136 dst
[0] = util_format_srgb_to_linear_8unorm(dst
[0]);
137 dst
[1] = util_format_srgb_to_linear_8unorm(dst
[1]);
138 dst
[2] = util_format_srgb_to_linear_8unorm(dst
[2]);
144 src_row
+= src_stride
;
149 util_format_dxt1_rgb_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
150 const uint8_t *src_row
, unsigned src_stride
,
151 unsigned width
, unsigned height
)
153 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
156 util_format_dxt1_rgb_fetch
,
161 util_format_dxt1_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
162 const uint8_t *src_row
, unsigned src_stride
,
163 unsigned width
, unsigned height
)
165 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
168 util_format_dxt1_rgba_fetch
,
173 util_format_dxt3_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
174 const uint8_t *src_row
, unsigned src_stride
,
175 unsigned width
, unsigned height
)
177 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
180 util_format_dxt3_rgba_fetch
,
185 util_format_dxt5_rgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
186 const uint8_t *src_row
, unsigned src_stride
,
187 unsigned width
, unsigned height
)
189 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
192 util_format_dxt5_rgba_fetch
,
197 util_format_dxtn_rgb_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
198 const uint8_t *src_row
, unsigned src_stride
,
199 unsigned width
, unsigned height
,
200 util_format_dxtn_fetch_t fetch
,
201 unsigned block_size
, boolean srgb
)
204 for(y
= 0; y
< height
; y
+= 4) {
205 const uint8_t *src
= src_row
;
206 for(x
= 0; x
< width
; x
+= 4) {
207 for(j
= 0; j
< 4; ++j
) {
208 for(i
= 0; i
< 4; ++i
) {
209 float *dst
= dst_row
+ (y
+ j
)*dst_stride
/sizeof(*dst_row
) + (x
+ i
)*4;
211 fetch(0, src
, i
, j
, tmp
);
213 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
214 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
215 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
218 dst
[0] = ubyte_to_float(tmp
[0]);
219 dst
[1] = ubyte_to_float(tmp
[1]);
220 dst
[2] = ubyte_to_float(tmp
[2]);
222 dst
[3] = ubyte_to_float(tmp
[3]);
227 src_row
+= src_stride
;
232 util_format_dxt1_rgb_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
233 const uint8_t *src_row
, unsigned src_stride
,
234 unsigned width
, unsigned height
)
236 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
239 util_format_dxt1_rgb_fetch
,
244 util_format_dxt1_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
245 const uint8_t *src_row
, unsigned src_stride
,
246 unsigned width
, unsigned height
)
248 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
251 util_format_dxt1_rgba_fetch
,
256 util_format_dxt3_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
257 const uint8_t *src_row
, unsigned src_stride
,
258 unsigned width
, unsigned height
)
260 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
263 util_format_dxt3_rgba_fetch
,
268 util_format_dxt5_rgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
,
269 const uint8_t *src_row
, unsigned src_stride
,
270 unsigned width
, unsigned height
)
272 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
275 util_format_dxt5_rgba_fetch
,
285 util_format_dxtn_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
286 const uint8_t *src
, unsigned src_stride
,
287 unsigned width
, unsigned height
,
288 enum util_format_dxtn format
,
289 unsigned block_size
, boolean srgb
)
291 const unsigned bw
= 4, bh
= 4, comps
= 4;
292 unsigned x
, y
, i
, j
, k
;
293 for(y
= 0; y
< height
; y
+= bh
) {
294 uint8_t *dst
= dst_row
;
295 for(x
= 0; x
< width
; x
+= bw
) {
296 uint8_t tmp
[4][4][4]; /* [bh][bw][comps] */
297 for(j
= 0; j
< bh
; ++j
) {
298 for(i
= 0; i
< bw
; ++i
) {
300 for(k
= 0; k
< 3; ++k
) {
301 src_tmp
= src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*comps
+ k
];
303 tmp
[j
][i
][k
] = util_format_linear_to_srgb_8unorm(src_tmp
);
306 tmp
[j
][i
][k
] = src_tmp
;
309 /* for sake of simplicity there's an unneeded 4th component for dxt1_rgb */
310 tmp
[j
][i
][3] = src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*comps
+ 3];
313 /* even for dxt1_rgb have 4 src comps */
314 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], format
, dst
, 0);
317 dst_row
+= dst_stride
/ sizeof(*dst_row
);
323 util_format_dxt1_rgb_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
324 const uint8_t *src
, unsigned src_stride
,
325 unsigned width
, unsigned height
)
327 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
328 width
, height
, UTIL_FORMAT_DXT1_RGB
,
333 util_format_dxt1_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
334 const uint8_t *src
, unsigned src_stride
,
335 unsigned width
, unsigned height
)
337 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
338 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
343 util_format_dxt3_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
344 const uint8_t *src
, unsigned src_stride
,
345 unsigned width
, unsigned height
)
347 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
348 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
353 util_format_dxt5_rgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
,
354 const uint8_t *src
, unsigned src_stride
,
355 unsigned width
, unsigned height
)
357 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src
, src_stride
,
358 width
, height
, UTIL_FORMAT_DXT5_RGBA
,
363 util_format_dxtn_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
364 const float *src
, unsigned src_stride
,
365 unsigned width
, unsigned height
,
366 enum util_format_dxtn format
,
367 unsigned block_size
, boolean srgb
)
369 unsigned x
, y
, i
, j
, k
;
370 for(y
= 0; y
< height
; y
+= 4) {
371 uint8_t *dst
= dst_row
;
372 for(x
= 0; x
< width
; x
+= 4) {
373 uint8_t tmp
[4][4][4];
374 for(j
= 0; j
< 4; ++j
) {
375 for(i
= 0; i
< 4; ++i
) {
377 for(k
= 0; k
< 3; ++k
) {
378 src_tmp
= src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*4 + k
];
380 tmp
[j
][i
][k
] = util_format_linear_float_to_srgb_8unorm(src_tmp
);
383 tmp
[j
][i
][k
] = float_to_ubyte(src_tmp
);
386 /* for sake of simplicity there's an unneeded 4th component for dxt1_rgb */
387 src_tmp
= src
[(y
+ j
)*src_stride
/sizeof(*src
) + (x
+i
)*4 + 3];
388 tmp
[j
][i
][3] = float_to_ubyte(src_tmp
);
391 util_format_dxtn_pack(4, 4, 4, &tmp
[0][0][0], format
, dst
, 0);
394 dst_row
+= 4*dst_stride
/sizeof(*dst_row
);
399 util_format_dxt1_rgb_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
400 const float *src
, unsigned src_stride
,
401 unsigned width
, unsigned height
)
403 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
404 width
, height
, UTIL_FORMAT_DXT1_RGB
,
409 util_format_dxt1_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
410 const float *src
, unsigned src_stride
,
411 unsigned width
, unsigned height
)
413 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
414 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
419 util_format_dxt3_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
420 const float *src
, unsigned src_stride
,
421 unsigned width
, unsigned height
)
423 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
424 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
429 util_format_dxt5_rgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
,
430 const float *src
, unsigned src_stride
,
431 unsigned width
, unsigned height
)
433 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src
, src_stride
,
434 width
, height
, UTIL_FORMAT_DXT5_RGBA
,
444 util_format_dxt1_srgb_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
447 util_format_dxt1_rgb_fetch(0, src
, i
, j
, tmp
);
448 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
449 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
450 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
455 util_format_dxt1_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
458 util_format_dxt1_rgba_fetch(0, src
, i
, j
, tmp
);
459 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
460 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
461 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
466 util_format_dxt3_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
469 util_format_dxt3_rgba_fetch(0, src
, i
, j
, tmp
);
470 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
471 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
472 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
477 util_format_dxt5_srgba_fetch_rgba_8unorm(uint8_t *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
480 util_format_dxt5_rgba_fetch(0, src
, i
, j
, tmp
);
481 dst
[0] = util_format_srgb_to_linear_8unorm(tmp
[0]);
482 dst
[1] = util_format_srgb_to_linear_8unorm(tmp
[1]);
483 dst
[2] = util_format_srgb_to_linear_8unorm(tmp
[2]);
488 util_format_dxt1_srgb_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
491 util_format_dxt1_rgb_fetch(0, src
, i
, j
, tmp
);
492 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
493 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
494 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
499 util_format_dxt1_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
502 util_format_dxt1_rgba_fetch(0, src
, i
, j
, tmp
);
503 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
504 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
505 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
506 dst
[3] = ubyte_to_float(tmp
[3]);
510 util_format_dxt3_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
513 util_format_dxt3_rgba_fetch(0, src
, i
, j
, tmp
);
514 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
515 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
516 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
517 dst
[3] = ubyte_to_float(tmp
[3]);
521 util_format_dxt5_srgba_fetch_rgba_float(float *dst
, const uint8_t *src
, unsigned i
, unsigned j
)
524 util_format_dxt5_rgba_fetch(0, src
, i
, j
, tmp
);
525 dst
[0] = util_format_srgb_8unorm_to_linear_float(tmp
[0]);
526 dst
[1] = util_format_srgb_8unorm_to_linear_float(tmp
[1]);
527 dst
[2] = util_format_srgb_8unorm_to_linear_float(tmp
[2]);
528 dst
[3] = ubyte_to_float(tmp
[3]);
532 util_format_dxt1_srgb_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
534 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
537 util_format_dxt1_rgb_fetch
,
542 util_format_dxt1_srgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
544 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
547 util_format_dxt1_rgba_fetch
,
552 util_format_dxt3_srgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
554 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
557 util_format_dxt3_rgba_fetch
,
562 util_format_dxt5_srgba_unpack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
564 util_format_dxtn_rgb_unpack_rgba_8unorm(dst_row
, dst_stride
,
567 util_format_dxt5_rgba_fetch
,
572 util_format_dxt1_srgb_unpack_rgba_float(float *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
574 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
577 util_format_dxt1_rgb_fetch
,
582 util_format_dxt1_srgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
584 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
587 util_format_dxt1_rgba_fetch
,
592 util_format_dxt3_srgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
594 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
597 util_format_dxt3_rgba_fetch
,
602 util_format_dxt5_srgba_unpack_rgba_float(float *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
604 util_format_dxtn_rgb_unpack_rgba_float(dst_row
, dst_stride
,
607 util_format_dxt5_rgba_fetch
,
612 util_format_dxt1_srgb_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
614 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
615 width
, height
, UTIL_FORMAT_DXT1_RGB
,
620 util_format_dxt1_srgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
622 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
623 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
628 util_format_dxt3_srgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
630 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
631 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
636 util_format_dxt5_srgba_pack_rgba_8unorm(uint8_t *dst_row
, unsigned dst_stride
, const uint8_t *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
638 util_format_dxtn_pack_rgba_8unorm(dst_row
, dst_stride
, src_row
, src_stride
,
639 width
, height
, UTIL_FORMAT_DXT5_RGBA
,
644 util_format_dxt1_srgb_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
, const float *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
646 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
647 width
, height
, UTIL_FORMAT_DXT1_RGB
,
652 util_format_dxt1_srgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
, const float *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
654 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
655 width
, height
, UTIL_FORMAT_DXT1_RGBA
,
660 util_format_dxt3_srgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
, const float *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
662 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
663 width
, height
, UTIL_FORMAT_DXT3_RGBA
,
668 util_format_dxt5_srgba_pack_rgba_float(uint8_t *dst_row
, unsigned dst_stride
, const float *src_row
, unsigned src_stride
, unsigned width
, unsigned height
)
670 util_format_dxtn_pack_rgba_float(dst_row
, dst_stride
, src_row
, src_stride
,
671 width
, height
, UTIL_FORMAT_DXT5_RGBA
,