1 /*
2 * Texture block module
3 * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
4 *
5 * This file is part of FFmpeg.
6 *
7 * FFmpeg is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
11 *
12 * FFmpeg is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
16 *
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with FFmpeg; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
20 */
21
22 /**
23 * @file
24 * Texture block (4x4) module
25 *
26 * References:
27 * https://www.opengl.org/wiki/S3_Texture_Compression
28 * https://www.opengl.org/wiki/Red_Green_Texture_Compression
29 * https://msdn.microsoft.com/en-us/library/bb694531%28v=vs.85%29.aspx
30 *
31 * All functions return how much data has been written or read.
32 *
33 * Pixel input or output format is always AV_PIX_FMT_RGBA.
34 */
35
36 #ifndef AVCODEC_TEXTUREDSP_H
37 #define AVCODEC_TEXTUREDSP_H
38
39 #include <stddef.h>
40 #include <stdint.h>
41
42 #define TEXTURE_BLOCK_W 4
43 #define TEXTURE_BLOCK_H 4
44
62
68
70 union {
71 const uint8_t *
in;
// Input frame data
72 uint8_t *
out;
// Output frame data
76 union {
77 const uint8_t *
in;
// Compressed texture for decompression
78 uint8_t *
out;
// Compressed texture of compression
80 int tex_ratio;
// Number of compressed bytes in a texture block
81 int raw_ratio;
// Number bytes in a line of a raw block
83
84 /* Pointer to the selected compress or decompress function. */
87
90
96
97 #endif /* AVCODEC_TEXTUREDSP_H */