s3tc.h 1.78 KB
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
/*
 * S3 Texture Compression (S3TC) decoding functions
 * Copyright (c) 2007 by Ivo van Poorten
 *
 * This file is part of FFmpeg.
 *
 * FFmpeg is free software; you can redistribute it and/or
 * 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.
 *
 * FFmpeg is distributed in the hope that it will be useful,
 * 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
 * License along with FFmpeg; if not, write to the Free Software
 * 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
#include "bytestream.h"

29 30 31
#define FF_S3TC_DXT1    0x31545844
#define FF_S3TC_DXT3    0x33545844

Ivo van Poorten's avatar
Ivo van Poorten committed
32 33
/**
 * Decode DXT1 encoded data to RGB32
34
 * @param gb GetByteContext
35
 * @param dst destination buffer
Ivo van Poorten's avatar
Ivo van Poorten committed
36 37 38 39
 * @param w width of output image
 * @param h height of output image
 * @param stride line size of output image
 */
40
void ff_decode_dxt1(GetByteContext *gb, uint8_t *dst,
41 42
                    const unsigned int w, const unsigned int h,
                    const unsigned int stride);
Ivo van Poorten's avatar
Ivo van Poorten committed
43 44
/**
 * Decode DXT3 encoded data to RGB32
45
 * @param gb GetByteContext
46
 * @param dst destination buffer
Ivo van Poorten's avatar
Ivo van Poorten committed
47 48 49 50
 * @param w width of output image
 * @param h height of output image
 * @param stride line size of output image
 */
51
void ff_decode_dxt3(GetByteContext *gb, uint8_t *dst,
52 53 54
                    const unsigned int w, const unsigned int h,
                    const unsigned int stride);

55
#endif /* AVCODEC_S3TC_H */