summaryrefslogtreecommitdiff
path: root/libavcodec/hap.h
diff options
context:
space:
mode:
Diffstat (limited to 'libavcodec/hap.h')
-rw-r--r--libavcodec/hap.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/libavcodec/hap.h b/libavcodec/hap.h
index 9d847f7b86..bbeed11e32 100644
--- a/libavcodec/hap.h
+++ b/libavcodec/hap.h
@@ -3,20 +3,20 @@
* Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
* Copyright (C) 2015 Tom Butterworth <bangnoise@gmail.com>
*
- * This file is part of Libav.
+ * This file is part of FFmpeg.
*
- * Libav is free software; you can redistribute it and/or
+ * 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.
*
- * Libav is distributed in the hope that it will be useful,
+ * 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 Libav; if not, write to the Free Software
+ * License along with FFmpeg; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
*/
@@ -34,6 +34,7 @@ enum HapTextureFormat {
HAP_FMT_RGBDXT1 = 0x0B,
HAP_FMT_RGBADXT5 = 0x0E,
HAP_FMT_YCOCGDXT5 = 0x0F,
+ HAP_FMT_RGTC1 = 0x01,
};
enum HapCompressor {
@@ -65,12 +66,14 @@ typedef struct HapContext {
enum HapTextureFormat opt_tex_fmt; /* Texture type (encoder only) */
int opt_chunk_count; /* User-requested chunk count (encoder only) */
+ int opt_compressor; /* User-requested compressor (encoder only) */
int chunk_count;
HapChunk *chunks;
int *chunk_results; /* Results from threaded operations */
int tex_rat; /* Compression ratio */
+ int tex_rat2; /* Compression ratio of the second texture */
const uint8_t *tex_data; /* Compressed texture */
uint8_t *tex_buf; /* Buffer for compressed texture */
size_t tex_size; /* Size of the compressed texture */
@@ -79,8 +82,13 @@ typedef struct HapContext {
int slice_count; /* Number of slices for threaded operations */
+ int texture_count; /* 2 for HAQA, 1 for other version */
+ int texture_section_size; /* size of the part of the texture section (for HAPQA) */
+ int uncompress_pix_size; /* nb of byte / pixel for the target picture */
+
/* Pointer to the selected compress or decompress function */
int (*tex_fun)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
+ int (*tex_fun2)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block);
} HapContext;
/*
@@ -95,4 +103,10 @@ int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame);
*/
av_cold void ff_hap_free_context(HapContext *ctx);
+/* The first three bytes are the size of the section past the header, or zero
+ * if the length is stored in the next long word. The fourth byte in the first
+ * long word indicates the type of the current section. */
+int ff_hap_parse_section_header(GetByteContext *gbc, int *section_size,
+ enum HapSectionType *section_type);
+
#endif /* AVCODEC_HAP_H */