FFmpeg
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 {
43  NumFrames = 11,
47  NumSpatial = 15,
50  FrameType = 19,
51  ImageWidth = 20,
53  FrameIndex = 23,
55  NumLevels = 26,
64  NumBands = 40,
72  BandWidth = 49,
73  BandHeight = 50,
77  BandScale = 54,
78  BandHeader = 55,
83  Precision = 70,
86  PeakLevel = 74,
89  Version = 79,
94  ChannelWidth = 104,
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;
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;
127 
128  /* TODO: merge this into SubBand structure */
129  int16_t *subband[SUBBAND_COUNT_3D];
130  int16_t *l_h[10];
131 
133 } Plane;
134 
135 typedef struct Peak {
136  int level;
137  int offset;
139 } Peak;
140 
141 typedef struct CFHDContext {
143 
144  CFHD_RL_VLC_ELEM table_9_rl_vlc[2088];
146 
147  CFHD_RL_VLC_ELEM table_18_rl_vlc[4572];
149 
150  int lut[2][256];
151 
153 
154  int planes;
162  enum AVPixelFormat coded_format;
164 
165  int a_width;
166  int a_height;
167  int a_format;
168 
169  int bpc; // bits per channel/component
175  uint16_t quantisation;
176 
177  int codebook;
180  int level;
182 
183  uint8_t prescale_table[8];
184  Plane plane[4];
186 
188 } CFHDContext;
189 
191 
192 #endif /* AVCODEC_CFHD_H */
int channel_cnt
Definition: cfhd.h:170
int difference_coding
Definition: cfhd.h:178
VLC vlc_18
Definition: cfhd.h:148
AVCodecContext * avctx
Definition: cfhd.h:142
CFHDDSPContext dsp
Definition: cfhd.h:187
Definition: cfhd.h:86
Definition: cfhd.h:43
TransformType
Definition: webp.c:110
Definition: cfhd.h:89
int a_height
Definition: cfhd.h:115
int level
Definition: cfhd.h:136
Definition: cfhd.h:72
int transform_type
Definition: cfhd.h:158
int cropped_height
Definition: cfhd.h:161
int16_t * idwt_tmp
Definition: cfhd.h:125
int a_width
Definition: cfhd.h:165
ptrdiff_t stride
Definition: cfhd.h:112
int subband_num_actual
Definition: cfhd.h:181
int sample_type
Definition: cfhd.h:157
Definition: cfhd.h:83
int width
Definition: cfhd.h:114
uint8_t
int16_t * idwt_buf
Definition: cfhd.h:124
int a_format
Definition: cfhd.h:167
bitstream reader API header.
Definition: cfhd.h:111
int8_t len
Definition: cfhd.h:104
FrameType
G723.1 frame types.
Definition: g723_1.h:63
VLC vlc_9
Definition: cfhd.h:145
simple assert() macros that are a bit more flexible than ISO C assert().
Definition: cfhd.h:135
Definition: vlc.h:26
int a_width
Definition: cfhd.h:113
int16_t SampleType
Definition: ac3enc.h:70
uint16_t run
Definition: cfhd.h:105
GetByteContext base
Definition: cfhd.h:138
int subband_cnt
Definition: cfhd.h:171
uint16_t quantisation
Definition: cfhd.h:175
#define s(width, name)
Definition: cbs_vp9.c:257
int frame_type
Definition: cfhd.h:155
int channel_num
Definition: cfhd.h:173
#define DWT_LEVELS_3D
Definition: cfhd.h:109
GetBitContext gb
Definition: cfhd.h:152
CFHDParam
Definition: cfhd.h:34
Libavcodec external API header.
main external API structure.
Definition: avcodec.h:526
int codebook
Definition: cfhd.h:177
int planes
Definition: cfhd.h:154
int idwt_size
Definition: cfhd.h:126
int subband_num
Definition: cfhd.h:179
Peak peak
Definition: cfhd.h:185
int band_encoding
Definition: cfhd.h:172
int level
Definition: cfhd.h:180
Definition: cfhd.h:55
int frame_index
Definition: cfhd.h:156
int coded_width
Definition: cfhd.h:159
ptrdiff_t stride
Definition: cfhd.h:122
int bpc
Definition: cfhd.h:169
Definition: cfhd.h:77
int a_height
Definition: cfhd.h:166
#define SUBBAND_COUNT_3D
Definition: cfhd.h:100
int height
Definition: cfhd.h:116
int width
Definition: cfhd.h:120
int offset
Definition: cfhd.h:137
Definition: cfhd.h:64
int ff_cfhd_init_vlcs(CFHDContext *s)
Definition: cfhddata.c:276
int progressive
Definition: cfhd.h:163
int16_t level
Definition: cfhd.h:103
int height
Definition: cfhd.h:121
uint8_t lowpass_precision
Definition: cfhd.h:174
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
Definition: cfhd.h:119
int coded_height
Definition: cfhd.h:160