FFmpeg
Main Page
Related Pages
Modules
Namespaces
Data Structures
Files
Examples
File List
Globals
libavcodec
cfhd.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2015 Kieran Kunhya
3
*
4
* This file is part of FFmpeg.
5
*
6
* FFmpeg is free software; you can redistribute it and/or
7
* modify it under the terms of the GNU Lesser General Public
8
* License as published by the Free Software Foundation; either
9
* version 2.1 of the License, or (at your option) any later version.
10
*
11
* FFmpeg is distributed in the hope that it will be useful,
12
* but WITHOUT ANY WARRANTY; without even the implied warranty of
13
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14
* Lesser General Public License for more details.
15
*
16
* You should have received a copy of the GNU Lesser General Public
17
* License along with FFmpeg; if not, write to the Free Software
18
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
19
*/
20
21
#ifndef AVCODEC_CFHD_H
22
#define AVCODEC_CFHD_H
23
24
#include <stdint.h>
25
26
#include "
libavutil/avassert.h
"
27
28
#include "
avcodec.h
"
29
#include "
bytestream.h
"
30
#include "
get_bits.h
"
31
#include "
vlc.h
"
32
#include "
cfhddsp.h
"
33
34
enum
CFHDParam
{
35
SampleType
= 1,
36
SampleIndexTable
= 2,
37
BitstreamMarker
= 4,
38
VersionMajor
= 5,
39
VersionMinor
= 6,
40
VersionRevision
= 7,
41
VersionEdit
= 8,
42
TransformType
= 10,
43
NumFrames
= 11,
44
ChannelCount
= 12,
45
WaveletCount
= 13,
46
SubbandCount
= 14,
47
NumSpatial
= 15,
48
FirstWavelet
= 16,
49
GroupTrailer
= 18,
50
FrameType
= 19,
51
ImageWidth
= 20,
52
ImageHeight
= 21,
53
FrameIndex
= 23,
54
LowpassSubband
= 25,
55
NumLevels
= 26,
56
LowpassWidth
= 27,
57
LowpassHeight
= 28,
58
PixelOffset
= 33,
59
LowpassQuantization
=34,
60
LowpassPrecision
= 35,
61
WaveletType
= 37,
62
WaveletNumber
= 38,
63
WaveletLevel
= 39,
64
NumBands
= 40,
65
HighpassWidth
= 41,
66
HighpassHeight
= 42,
67
LowpassBorder
= 43,
68
HighpassBorder
= 44,
69
LowpassScale
= 45,
70
LowpassDivisor
= 46,
71
SubbandNumber
= 48,
72
BandWidth
= 49,
73
BandHeight
= 50,
74
SubbandBand
= 51,
75
BandEncoding
= 52,
76
Quantization
= 53,
77
BandScale
= 54,
78
BandHeader
= 55,
79
BandTrailer
= 56,
80
ChannelNumber
= 62,
81
SampleFlags
= 68,
82
FrameNumber
= 69,
83
Precision
= 70,
84
InputFormat
= 71,
85
BandCodingFlags
= 72,
86
PeakLevel
= 74,
87
PeakOffsetLow
= 75,
88
PeakOffsetHigh
= 76,
89
Version
= 79,
90
BandSecondPass
= 82,
91
PrescaleTable
= 83,
92
EncodedFormat
= 84,
93
DisplayHeight
= 85,
94
ChannelWidth
= 104,
95
ChannelHeight
= 105,
96
};
97
98
#define VLC_BITS 9
99
#define SUBBAND_COUNT 10
100
#define SUBBAND_COUNT_3D 17
101
102
typedef
struct
CFHD_RL_VLC_ELEM
{
103
int16_t
level
;
104
int8_t
len
;
105
uint16_t
run
;
106
}
CFHD_RL_VLC_ELEM
;
107
108
#define DWT_LEVELS 3
109
#define DWT_LEVELS_3D 6
110
111
typedef
struct
SubBand
{
112
ptrdiff_t
stride
;
113
int
a_width
;
114
int
width
;
115
int
a_height
;
116
int
height
;
117
}
SubBand
;
118
119
typedef
struct
Plane
{
120
int
width
;
121
int
height
;
122
ptrdiff_t
stride
;
123
124
int16_t *
idwt_buf
;
125
int16_t *
idwt_tmp
;
126
int
idwt_size
;
127
128
/* TODO: merge this into SubBand structure */
129
int16_t *subband[
SUBBAND_COUNT_3D
];
130
int16_t *l_h[10];
131
132
SubBand
band[
DWT_LEVELS_3D
][4];
133
}
Plane
;
134
135
typedef
struct
Peak
{
136
int
level
;
137
int
offset
;
138
GetByteContext
base
;
139
}
Peak
;
140
141
typedef
struct
CFHDContext
{
142
AVCodecContext
*
avctx
;
143
144
CFHD_RL_VLC_ELEM
table_9_rl_vlc[2088];
145
VLC
vlc_9
;
146
147
CFHD_RL_VLC_ELEM
table_18_rl_vlc[4572];
148
VLC
vlc_18
;
149
150
int
lut[2][256];
151
152
GetBitContext
gb
;
153
154
int
planes
;
155
int
frame_type
;
156
int
frame_index
;
157
int
sample_type
;
158
int
transform_type
;
159
int
coded_width
;
160
int
coded_height
;
161
int
cropped_height
;
162
enum
AVPixelFormat
coded_format;
163
int
progressive
;
164
165
int
a_width
;
166
int
a_height
;
167
int
a_format
;
168
169
int
bpc
;
// bits per channel/component
170
int
channel_cnt
;
171
int
subband_cnt
;
172
int
band_encoding
;
173
int
channel_num
;
174
uint8_t
lowpass_precision
;
175
uint16_t
quantisation
;
176
177
int
codebook
;
178
int
difference_coding
;
179
int
subband_num
;
180
int
level
;
181
int
subband_num_actual
;
182
183
uint8_t
prescale_table[8];
184
Plane
plane[4];
185
Peak
peak
;
186
187
CFHDDSPContext
dsp
;
188
}
CFHDContext
;
189
190
int
ff_cfhd_init_vlcs
(
CFHDContext
*
s
);
191
192
#endif
/* AVCODEC_CFHD_H */
LowpassDivisor
Definition:
cfhd.h:70
CFHDContext::channel_cnt
int channel_cnt
Definition:
cfhd.h:170
FirstWavelet
Definition:
cfhd.h:48
GetByteContext
Definition:
bytestream.h:33
CFHDContext::difference_coding
int difference_coding
Definition:
cfhd.h:178
LowpassWidth
Definition:
cfhd.h:56
BandCodingFlags
Definition:
cfhd.h:85
CFHDContext::vlc_18
VLC vlc_18
Definition:
cfhd.h:148
CFHDContext::avctx
AVCodecContext * avctx
Definition:
cfhd.h:142
CFHDContext::dsp
CFHDDSPContext dsp
Definition:
cfhd.h:187
PeakLevel
Definition:
cfhd.h:86
NumFrames
Definition:
cfhd.h:43
EncodedFormat
Definition:
cfhd.h:92
SubbandNumber
Definition:
cfhd.h:71
TransformType
TransformType
Definition:
webp.c:110
HighpassBorder
Definition:
cfhd.h:68
CFHDDSPContext
Definition:
cfhddsp.h:25
Version
Definition:
cfhd.h:89
SubBand::a_height
int a_height
Definition:
cfhd.h:115
Peak::level
int level
Definition:
cfhd.h:136
BandTrailer
Definition:
cfhd.h:79
BandWidth
Definition:
cfhd.h:72
SampleIndexTable
Definition:
cfhd.h:36
vlc.h
CFHDContext::transform_type
int transform_type
Definition:
cfhd.h:158
LowpassPrecision
Definition:
cfhd.h:60
CFHDContext::cropped_height
int cropped_height
Definition:
cfhd.h:161
Plane::idwt_tmp
int16_t * idwt_tmp
Definition:
cfhd.h:125
WaveletType
Definition:
cfhd.h:61
CFHDContext::a_width
int a_width
Definition:
cfhd.h:165
SubBand::stride
ptrdiff_t stride
Definition:
cfhd.h:112
CFHDContext::subband_num_actual
int subband_num_actual
Definition:
cfhd.h:181
CFHDContext::sample_type
int sample_type
Definition:
cfhd.h:157
CFHDContext
Definition:
cfhd.h:141
LowpassSubband
Definition:
cfhd.h:54
FrameIndex
Definition:
cfhd.h:53
Precision
Definition:
cfhd.h:83
PeakOffsetHigh
Definition:
cfhd.h:88
SubBand::width
int width
Definition:
cfhd.h:114
PrescaleTable
Definition:
cfhd.h:91
BandHeight
Definition:
cfhd.h:73
PeakOffsetLow
Definition:
cfhd.h:87
DisplayHeight
Definition:
cfhd.h:93
uint8_t
uint8_t
Definition:
audio_convert.c:194
ChannelNumber
Definition:
cfhd.h:80
Plane::idwt_buf
int16_t * idwt_buf
Definition:
cfhd.h:124
BandSecondPass
Definition:
cfhd.h:90
CFHDContext::a_format
int a_format
Definition:
cfhd.h:167
GroupTrailer
Definition:
cfhd.h:49
get_bits.h
bitstream reader API header.
VersionRevision
Definition:
cfhd.h:40
FrameNumber
Definition:
cfhd.h:82
SubBand
Definition:
cfhd.h:111
CFHD_RL_VLC_ELEM::len
int8_t len
Definition:
cfhd.h:104
HighpassHeight
Definition:
cfhd.h:66
FrameType
FrameType
G723.1 frame types.
Definition:
g723_1.h:63
VersionMajor
Definition:
cfhd.h:38
CFHDContext::vlc_9
VLC vlc_9
Definition:
cfhd.h:145
cfhddsp.h
WaveletLevel
Definition:
cfhd.h:63
avassert.h
simple assert() macros that are a bit more flexible than ISO C assert().
LowpassBorder
Definition:
cfhd.h:67
BandEncoding
Definition:
cfhd.h:75
CFHD_RL_VLC_ELEM
Definition:
cfhd.h:102
bytestream.h
Peak
Definition:
cfhd.h:135
SubbandBand
Definition:
cfhd.h:74
VLC
Definition:
vlc.h:26
SubBand::a_width
int a_width
Definition:
cfhd.h:113
SampleType
int32_t SampleType
Definition:
ac3enc.h:70
CFHD_RL_VLC_ELEM::run
uint16_t run
Definition:
cfhd.h:105
Peak::base
GetByteContext base
Definition:
cfhd.h:138
CFHDContext::subband_cnt
int subband_cnt
Definition:
cfhd.h:171
LowpassScale
Definition:
cfhd.h:69
CFHDContext::quantisation
uint16_t quantisation
Definition:
cfhd.h:175
Quantization
Definition:
cfhd.h:76
s
#define s(width, name)
Definition:
cbs_vp9.c:257
CFHDContext::frame_type
int frame_type
Definition:
cfhd.h:155
ImageWidth
Definition:
cfhd.h:51
CFHDContext::channel_num
int channel_num
Definition:
cfhd.h:173
ChannelHeight
Definition:
cfhd.h:95
ChannelWidth
Definition:
cfhd.h:94
DWT_LEVELS_3D
#define DWT_LEVELS_3D
Definition:
cfhd.h:109
CFHDContext::gb
GetBitContext gb
Definition:
cfhd.h:152
VersionMinor
Definition:
cfhd.h:39
CFHDParam
CFHDParam
Definition:
cfhd.h:34
avcodec.h
Libavcodec external API header.
AVCodecContext
main external API structure.
Definition:
avcodec.h:531
CFHDContext::codebook
int codebook
Definition:
cfhd.h:177
CFHDContext::planes
int planes
Definition:
cfhd.h:154
Plane::idwt_size
int idwt_size
Definition:
cfhd.h:126
CFHDContext::subband_num
int subband_num
Definition:
cfhd.h:179
InputFormat
Definition:
cfhd.h:84
SampleFlags
Definition:
cfhd.h:81
CFHDContext::peak
Peak peak
Definition:
cfhd.h:185
CFHDContext::band_encoding
int band_encoding
Definition:
cfhd.h:172
CFHDContext::level
int level
Definition:
cfhd.h:180
NumLevels
Definition:
cfhd.h:55
LowpassHeight
Definition:
cfhd.h:57
BitstreamMarker
Definition:
cfhd.h:37
PixelOffset
Definition:
cfhd.h:58
CFHDContext::frame_index
int frame_index
Definition:
cfhd.h:156
CFHDContext::coded_width
int coded_width
Definition:
cfhd.h:159
BandHeader
Definition:
cfhd.h:78
GetBitContext
Definition:
get_bits.h:61
Plane::stride
ptrdiff_t stride
Definition:
cfhd.h:122
VersionEdit
Definition:
cfhd.h:41
CFHDContext::bpc
int bpc
Definition:
cfhd.h:169
WaveletCount
Definition:
cfhd.h:45
ChannelCount
Definition:
cfhd.h:44
BandScale
Definition:
cfhd.h:77
CFHDContext::a_height
int a_height
Definition:
cfhd.h:166
WaveletNumber
Definition:
cfhd.h:62
SUBBAND_COUNT_3D
#define SUBBAND_COUNT_3D
Definition:
cfhd.h:100
SubBand::height
int height
Definition:
cfhd.h:116
Plane::width
int width
Definition:
cfhd.h:120
Peak::offset
int offset
Definition:
cfhd.h:137
NumBands
Definition:
cfhd.h:64
ff_cfhd_init_vlcs
int ff_cfhd_init_vlcs(CFHDContext *s)
Definition:
cfhddata.c:276
CFHDContext::progressive
int progressive
Definition:
cfhd.h:163
CFHD_RL_VLC_ELEM::level
int16_t level
Definition:
cfhd.h:103
SubbandCount
Definition:
cfhd.h:46
Plane::height
int height
Definition:
cfhd.h:121
NumSpatial
Definition:
cfhd.h:47
LowpassQuantization
Definition:
cfhd.h:59
CFHDContext::lowpass_precision
uint8_t lowpass_precision
Definition:
cfhd.h:174
AVPixelFormat
AVPixelFormat
Pixel format.
Definition:
pixfmt.h:64
HighpassWidth
Definition:
cfhd.h:65
Plane
Definition:
cfhd.h:119
ImageHeight
Definition:
cfhd.h:52
CFHDContext::coded_height
int coded_height
Definition:
cfhd.h:160
Generated on Tue Jan 26 2021 19:21:35 for FFmpeg by
1.8.11