3 * Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
5 * This file is part of FFmpeg.
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.
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.
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
27 #include "libavutil/opt.h"
29 #include "bytestream.h"
30 #include "texturedsp.h"
32 typedef struct HapContext {
35 TextureDSPContext dxtc;
39 int section_type; /* Header type */
41 int tex_rat; /* Compression ratio */
42 const uint8_t *tex_data; /* Compressed texture */
43 uint8_t *tex_buf; /* Uncompressed texture */
44 size_t tex_size; /* Size of the compressed texture */
46 uint8_t *snappied; /* Buffer interacting with snappy */
47 size_t max_snappy; /* Maximum compressed size for snappy buffer */
49 /* Pointer to the selected compress or decompress function */
50 int (*tex_fun)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
54 HAP_FMT_RGBDXT1 = 0x0B,
55 HAP_FMT_RGBADXT5 = 0x0E,
56 HAP_FMT_YCOCGDXT5 = 0x0F,
61 HAP_COMP_SNAPPY = 0xB0,
62 HAP_COMP_COMPLEX = 0xC0,
65 #endif /* AVCODEC_HAP_H */