annotate s3tc.h @ 5154:b683b5f78fab libavcodec

replace endian detection hack with #ifdef WORDS_BIGENDIAN
author mru
date Sat, 16 Jun 2007 14:52:10 +0000
parents a65cd5b551c2
children 4394344397d8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
4933
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
1 /*
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
2 * S3 Texture Compression (S3TC) decoding functions
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
3 * Copyright (c) 2007 by Ivo van Poorten
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
4 *
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
5 * This file is part of FFmpeg.
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
6 *
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
7 * FFmpeg is free software; you can redistribute it and/or
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
8 * modify it under the terms of the GNU Lesser General Public
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
9 * License as published by the Free Software Foundation; either
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
10 * version 2.1 of the License, or (at your option) any later version.
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
11 *
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
12 * FFmpeg is distributed in the hope that it will be useful,
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
15 * Lesser General Public License for more details.
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
16 *
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
17 * You should have received a copy of the GNU Lesser General Public
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
18 * License along with FFmpeg; if not, write to the Free Software
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
20 *
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
21 */
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
22
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
23 #ifndef FF_S3TC_H
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
24 #define FF_S3TC_H
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
25
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
26 #define FF_S3TC_DXT1 0x31545844
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
27 #define FF_S3TC_DXT3 0x33545844
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
28
4937
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
29 /**
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
30 * Decode DXT1 encoded data to RGB32
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
31 * @param *src source buffer, has to be aligned on a 4-byte boundary
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
32 * @param *dst destination buffer
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
33 * @param w width of output image
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
34 * @param h height of output image
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
35 * @param stride line size of output image
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
36 */
4933
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
37 void ff_decode_dxt1(const uint8_t *src, uint8_t *dst,
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
38 const unsigned int w, const unsigned int h,
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
39 const unsigned int stride);
4937
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
40 /**
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
41 * Decode DXT3 encoded data to RGB32
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
42 * @param *src source buffer, has to be aligned on a 4-byte boundary
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
43 * @param *dst destination buffer
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
44 * @param w width of output image
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
45 * @param h height of output image
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
46 * @param stride line size of output image
a65cd5b551c2 add doxygen comments
ivo
parents: 4933
diff changeset
47 */
4933
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
48 void ff_decode_dxt3(const uint8_t *src, uint8_t *dst,
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
49 const unsigned int w, const unsigned int h,
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
50 const unsigned int stride);
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
51
ed67837533b0 generic S3TC DXT1 and DXT3 decoding functions
ivo
parents:
diff changeset
52 #endif