FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
All
Data Structures
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libavcodec
hap.h
Go to the documentation of this file.
1
/*
2
* Vidvox Hap
3
* Copyright (C) 2015 Vittorio Giovara <vittorio.giovara@gmail.com>
4
* Copyright (C) 2015 Tom Butterworth <bangnoise@gmail.com>
5
*
6
* This file is part of FFmpeg.
7
*
8
* FFmpeg is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public
10
* License as published by the Free Software Foundation; either
11
* version 2.1 of the License, or (at your option) any later version.
12
*
13
* FFmpeg is distributed in the hope that it will be useful,
14
* but WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with FFmpeg; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
21
*/
22
23
#ifndef AVCODEC_HAP_H
24
#define AVCODEC_HAP_H
25
26
#include <stdint.h>
27
28
#include "
libavutil/opt.h
"
29
30
#include "
bytestream.h
"
31
#include "
texturedsp.h
"
32
33
enum
HapTextureFormat
{
34
HAP_FMT_RGBDXT1
= 0x0B,
35
HAP_FMT_RGBADXT5
= 0x0E,
36
HAP_FMT_YCOCGDXT5
= 0x0F,
37
};
38
39
enum
HapCompressor
{
40
HAP_COMP_NONE
= 0xA0,
41
HAP_COMP_SNAPPY
= 0xB0,
42
HAP_COMP_COMPLEX
= 0xC0,
43
};
44
45
enum
HapSectionType
{
46
HAP_ST_DECODE_INSTRUCTIONS
= 0x01,
47
HAP_ST_COMPRESSOR_TABLE
= 0x02,
48
HAP_ST_SIZE_TABLE
= 0x03,
49
HAP_ST_OFFSET_TABLE
= 0x04,
50
};
51
52
typedef
struct
HapChunk
{
53
enum
HapCompressor
compressor
;
54
int
compressed_offset
;
55
size_t
compressed_size
;
56
int
uncompressed_offset
;
57
size_t
uncompressed_size
;
58
}
HapChunk
;
59
60
typedef
struct
HapContext
{
61
AVClass
*
class
;
62
63
TextureDSPContext
dxtc
;
64
GetByteContext
gbc
;
65
66
enum
HapTextureFormat
opt_tex_fmt
;
/* Texture type (encoder only) */
67
int
opt_chunk_count
;
/* User-requested chunk count (encoder only) */
68
int
opt_compressor
;
/* User-requested compressor (encoder only) */
69
70
int
chunk_count
;
71
HapChunk
*
chunks
;
72
int
*
chunk_results
;
/* Results from threaded operations */
73
74
int
tex_rat
;
/* Compression ratio */
75
const
uint8_t
*
tex_data
;
/* Compressed texture */
76
uint8_t
*
tex_buf
;
/* Buffer for compressed texture */
77
size_t
tex_size
;
/* Size of the compressed texture */
78
79
size_t
max_snappy
;
/* Maximum compressed size for snappy buffer */
80
81
int
slice_count
;
/* Number of slices for threaded operations */
82
83
/* Pointer to the selected compress or decompress function */
84
int
(*
tex_fun
)(
uint8_t
*dst, ptrdiff_t
stride
,
const
uint8_t
*
block
);
85
}
HapContext
;
86
87
/*
88
* Set the number of chunks in the frame. Returns 0 on success or an error if:
89
* - first_in_frame is 0 and the number of chunks has changed
90
* - any other error occurs
91
*/
92
int
ff_hap_set_chunk_count
(
HapContext
*
ctx
,
int
count
,
int
first_in_frame);
93
94
/*
95
* Free resources associated with the context
96
*/
97
av_cold
void
ff_hap_free_context
(
HapContext
*
ctx
);
98
99
#endif
/* AVCODEC_HAP_H */
HapContext
Definition:
hap.h:60
GetByteContext
Definition:
bytestream.h:33
HapContext::chunks
HapChunk * chunks
Definition:
hap.h:71
HapSectionType
HapSectionType
Definition:
hap.h:45
HapContext::tex_fun
int(* tex_fun)(uint8_t *dst, ptrdiff_t stride, const uint8_t *block)
Definition:
hap.h:84
texturedsp.h
Texture block (4x4) module.
HAP_FMT_RGBADXT5
Definition:
hap.h:35
HapChunk::compressed_size
size_t compressed_size
Definition:
hap.h:55
HapChunk::compressed_offset
int compressed_offset
Definition:
hap.h:54
HapCompressor
HapCompressor
Definition:
hap.h:39
HAP_ST_DECODE_INSTRUCTIONS
Definition:
hap.h:46
HAP_COMP_COMPLEX
Definition:
hap.h:42
HapChunk::uncompressed_size
size_t uncompressed_size
Definition:
hap.h:57
block
static int16_t block[64]
Definition:
dct.c:115
uint8_t
uint8_t
Definition:
audio_convert.c:194
av_cold
#define av_cold
Definition:
attributes.h:82
opt.h
AVOptions.
HapContext::opt_compressor
int opt_compressor
Definition:
hap.h:68
HapContext::dxtc
TextureDSPContext dxtc
Definition:
hap.h:63
HapContext::gbc
GetByteContext gbc
Definition:
hap.h:64
HapContext::chunk_results
int * chunk_results
Definition:
hap.h:72
HAP_ST_OFFSET_TABLE
Definition:
hap.h:49
HapContext::opt_chunk_count
int opt_chunk_count
Definition:
hap.h:67
count
GLsizei count
Definition:
opengl_enc.c:109
bytestream.h
TextureDSPContext
Definition:
texturedsp.h:45
HapChunk::uncompressed_offset
int uncompressed_offset
Definition:
hap.h:56
ctx
AVFormatContext * ctx
Definition:
movenc.c:48
HapContext::max_snappy
size_t max_snappy
Definition:
hap.h:79
HAP_COMP_NONE
Definition:
hap.h:40
HapContext::tex_rat
int tex_rat
Definition:
hap.h:74
HAP_COMP_SNAPPY
Definition:
hap.h:41
HapContext::tex_data
const uint8_t * tex_data
Definition:
hap.h:75
HapContext::chunk_count
int chunk_count
Definition:
hap.h:70
ff_hap_set_chunk_count
int ff_hap_set_chunk_count(HapContext *ctx, int count, int first_in_frame)
Definition:
hap.c:28
AVClass
Describe the class of an AVClass context structure.
Definition:
log.h:67
HapContext::slice_count
int slice_count
Definition:
hap.h:81
HAP_FMT_YCOCGDXT5
Definition:
hap.h:36
HapContext::opt_tex_fmt
enum HapTextureFormat opt_tex_fmt
Definition:
hap.h:66
HapTextureFormat
HapTextureFormat
Definition:
hap.h:33
HapContext::tex_buf
uint8_t * tex_buf
Definition:
hap.h:76
int
int
Definition:
ffmpeg_filter.c:190
HapContext::tex_size
size_t tex_size
Definition:
hap.h:77
HapChunk
Definition:
hap.h:52
HAP_ST_COMPRESSOR_TABLE
Definition:
hap.h:47
HAP_ST_SIZE_TABLE
Definition:
hap.h:48
ff_hap_free_context
av_cold void ff_hap_free_context(HapContext *ctx)
Definition:
hap.c:50
stride
#define stride
HAP_FMT_RGBDXT1
Definition:
hap.h:34
HapChunk::compressor
enum HapCompressor compressor
Definition:
hap.h:53
Generated on Fri Jan 12 2018 01:45:39 for FFmpeg by
1.8.6