s3tc.h 1.83 KB
Newer Older
1 2 3 4
/*
 * S3 Texture Compression (S3TC) decoding functions
 * Copyright (c) 2007 by Ivo van Poorten
 *
5
 * This file is part of Libav.
6
 *
7
 * Libav is free software; you can redistribute it and/or
8 9 10 11
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
12
 * Libav is distributed in the hope that it will be useful,
13 14 15 16 17
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
18
 * License along with Libav; if not, write to the Free Software
19 20 21
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
 */

22 23
#ifndef AVCODEC_S3TC_H
#define AVCODEC_S3TC_H
24

25 26
#include <stdint.h>

27 28 29
#define FF_S3TC_DXT1    0x31545844
#define FF_S3TC_DXT3    0x33545844

Ivo van Poorten's avatar
Ivo van Poorten committed
30 31
/**
 * Decode DXT1 encoded data to RGB32
32 33
 * @param src source buffer, has to be aligned on a 4-byte boundary
 * @param dst destination buffer
Ivo van Poorten's avatar
Ivo van Poorten committed
34 35 36 37
 * @param w width of output image
 * @param h height of output image
 * @param stride line size of output image
 */
38 39 40
void ff_decode_dxt1(const uint8_t *src, uint8_t *dst,
                    const unsigned int w, const unsigned int h,
                    const unsigned int stride);
Ivo van Poorten's avatar
Ivo van Poorten committed
41 42
/**
 * Decode DXT3 encoded data to RGB32
43 44
 * @param src source buffer, has to be aligned on a 4-byte boundary
 * @param dst destination buffer
Ivo van Poorten's avatar
Ivo van Poorten committed
45 46 47 48
 * @param w width of output image
 * @param h height of output image
 * @param stride line size of output image
 */
49 50 51 52
void ff_decode_dxt3(const uint8_t *src, uint8_t *dst,
                    const unsigned int w, const unsigned int h,
                    const unsigned int stride);

53
#endif /* AVCODEC_S3TC_H */