FFmpeg: libavcodec/cfhd.h Source File

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 "avcodec.h"
27 #include "bytestream.h"
28 #include "get_bits.h"
29 #include "vlc.h"
30 #include "cfhddsp.h"
31 
32  enum CFHDParam {
33   SampleType = 1,
34   SampleIndexTable = 2,
35   BitstreamMarker = 4,
36   VersionMajor = 5,
37   VersionMinor = 6,
38   VersionRevision = 7,
39   VersionEdit = 8,
40   TransformType = 10,
41   NumFrames = 11,
42   ChannelCount = 12,
43   WaveletCount = 13,
44   SubbandCount = 14,
45   NumSpatial = 15,
46   FirstWavelet = 16,
47   GroupTrailer = 18,
48   FrameType = 19,
49   ImageWidth = 20,
50   ImageHeight = 21,
51   FrameIndex = 23,
52   LowpassSubband = 25,
53   NumLevels = 26,
54   LowpassWidth = 27,
55   LowpassHeight = 28,
56   PixelOffset = 33,
57   LowpassQuantization=34,
58   LowpassPrecision = 35,
59   WaveletType = 37,
60   WaveletNumber = 38,
61   WaveletLevel = 39,
62   NumBands = 40,
63   HighpassWidth = 41,
64   HighpassHeight = 42,
65   LowpassBorder = 43,
66   HighpassBorder = 44,
67   LowpassScale = 45,
68   LowpassDivisor = 46,
69   SubbandNumber = 48,
70   BandWidth = 49,
71   BandHeight = 50,
72   SubbandBand = 51,
73   BandEncoding = 52,
74   Quantization = 53,
75   BandScale = 54,
76   BandHeader = 55,
77   BandTrailer = 56,
78   ChannelNumber = 62,
79   SampleFlags = 68,
80   FrameNumber = 69,
81   Precision = 70,
82   InputFormat = 71,
83   BandCodingFlags = 72,
84   PeakLevel = 74,
85   PeakOffsetLow = 75,
86   PeakOffsetHigh = 76,
87   Version = 79,
88   BandSecondPass = 82,
89   PrescaleTable = 83,
90   EncodedFormat = 84,
91   DisplayHeight = 85,
92   ChannelWidth = 104,
93   ChannelHeight = 105,
94 };
95 
96  #define VLC_BITS 9
97  #define SUBBAND_COUNT 10
98  #define SUBBAND_COUNT_3D 17
99 
100  typedef struct CFHD_RL_VLC_ELEM {
101   int16_t level;
102   int8_t len;
103   uint16_t run;
104 } CFHD_RL_VLC_ELEM;
105 
106  #define DWT_LEVELS 3
107  #define DWT_LEVELS_3D 6
108 
109  typedef struct SubBand {
110   ptrdiff_t stride;
111   int a_width;
112   int width;
113   int a_height;
114   int height;
115   int8_t read_ok;
116 } SubBand;
117 
118  typedef struct Plane {
119   int width;
120   int height;
121   ptrdiff_t stride;
122 
123   int16_t *idwt_buf;
124   int16_t *idwt_tmp;
125   int idwt_size;
126 
127  /* TODO: merge this into SubBand structure */
128   int16_t *subband[SUBBAND_COUNT_3D];
129   int16_t *l_h[10];
130 
131   SubBand band[DWT_LEVELS_3D][4];
132 } Plane;
133 
134  typedef struct Peak {
135   int level;
136   int offset;
137   GetByteContext base;
138 } Peak;
139 
140  typedef struct CFHDContext {
141   AVCodecContext *avctx;
142 
143   CFHD_RL_VLC_ELEM table_9_rl_vlc[2088];
144   VLC vlc_9;
145 
146   CFHD_RL_VLC_ELEM table_18_rl_vlc[4572];
147   VLC vlc_18;
148 
149   int lut[2][256];
150 
151   GetBitContext gb;
152 
153   int planes;
154   int frame_type;
155   int frame_index;
156   int sample_type;
157   int transform_type;
158   int coded_width;
159   int coded_height;
160   int cropped_height;
161   enum AVPixelFormat coded_format;
162   int progressive;
163 
164   int a_width;
165   int a_height;
166   int a_format;
167   int a_transform_type;
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 */
ChannelNumber
@ ChannelNumber
Definition: cfhd.h:78
ChannelCount
@ ChannelCount
Definition: cfhd.h:42
BandSecondPass
@ BandSecondPass
Definition: cfhd.h:88
LowpassSubband
@ LowpassSubband
Definition: cfhd.h:52
AVPixelFormat
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
CFHDContext::channel_cnt
int channel_cnt
Definition: cfhd.h:170
Precision
@ Precision
Definition: cfhd.h:81
Peak::level
int level
Definition: cfhd.h:135
GroupTrailer
@ GroupTrailer
Definition: cfhd.h:47
CFHDContext::dsp
CFHDDSPContext dsp
Definition: cfhd.h:187
BandHeader
@ BandHeader
Definition: cfhd.h:76
PrescaleTable
@ PrescaleTable
Definition: cfhd.h:89
GetByteContext
Definition: bytestream.h:33
CFHDContext::progressive
int progressive
Definition: cfhd.h:162
BandHeight
@ BandHeight
Definition: cfhd.h:71
CFHDContext::lowpass_precision
uint8_t lowpass_precision
Definition: cfhd.h:174
CFHDContext::table_9_rl_vlc
CFHD_RL_VLC_ELEM table_9_rl_vlc[2088]
Definition: cfhd.h:143
CFHDContext::subband_cnt
int subband_cnt
Definition: cfhd.h:171
WaveletCount
@ WaveletCount
Definition: cfhd.h:43
NumSpatial
@ NumSpatial
Definition: cfhd.h:45
SampleType
int32_t SampleType
Definition: ac3enc.h:66
CFHDDSPContext
Definition: cfhddsp.h:25
SubBand::width
int width
Definition: cfhd.h:112
CFHDContext::a_format
int a_format
Definition: cfhd.h:166
BandScale
@ BandScale
Definition: cfhd.h:75
HighpassWidth
@ HighpassWidth
Definition: cfhd.h:63
WaveletNumber
@ WaveletNumber
Definition: cfhd.h:60
CFHDContext::bpc
int bpc
Definition: cfhd.h:169
FrameNumber
@ FrameNumber
Definition: cfhd.h:80
LowpassWidth
@ LowpassWidth
Definition: cfhd.h:54
ff_cfhd_init_vlcs
int ff_cfhd_init_vlcs(CFHDContext *s)
Definition: cfhddata.c:276
LowpassQuantization
@ LowpassQuantization
Definition: cfhd.h:57
CFHDContext::quantisation
uint16_t quantisation
Definition: cfhd.h:175
CFHDContext::channel_num
int channel_num
Definition: cfhd.h:173
VersionMajor
@ VersionMajor
Definition: cfhd.h:36
CFHDContext::level
int level
Definition: cfhd.h:180
GetBitContext
Definition: get_bits.h:61
LowpassDivisor
@ LowpassDivisor
Definition: cfhd.h:68
WaveletLevel
@ WaveletLevel
Definition: cfhd.h:61
FirstWavelet
@ FirstWavelet
Definition: cfhd.h:46
LowpassPrecision
@ LowpassPrecision
Definition: cfhd.h:58
Quantization
@ Quantization
Definition: cfhd.h:74
Plane::idwt_tmp
int16_t * idwt_tmp
Definition: cfhd.h:124
BandEncoding
@ BandEncoding
Definition: cfhd.h:73
WaveletType
@ WaveletType
Definition: cfhd.h:59
SubbandNumber
@ SubbandNumber
Definition: cfhd.h:69
NumFrames
@ NumFrames
Definition: cfhd.h:41
Plane::idwt_size
int idwt_size
Definition: cfhd.h:125
CFHDContext::peak
Peak peak
Definition: cfhd.h:185
Version
@ Version
Definition: cfhd.h:87
s
#define s(width, name)
Definition: cbs_vp9.c:256
TransformType
TransformType
Definition: webp.c:112
CFHDContext::codebook
int codebook
Definition: cfhd.h:177
LowpassScale
@ LowpassScale
Definition: cfhd.h:67
PeakOffsetHigh
@ PeakOffsetHigh
Definition: cfhd.h:86
VersionMinor
@ VersionMinor
Definition: cfhd.h:37
get_bits.h
DisplayHeight
@ DisplayHeight
Definition: cfhd.h:91
CFHDContext::band_encoding
int band_encoding
Definition: cfhd.h:172
CFHDContext::subband_num
int subband_num
Definition: cfhd.h:179
FrameType
FrameType
G723.1 frame types.
Definition: g723_1.h:63
Plane::subband
int16_t * subband[SUBBAND_COUNT_3D]
Definition: cfhd.h:128
FrameIndex
@ FrameIndex
Definition: cfhd.h:51
InputFormat
@ InputFormat
Definition: cfhd.h:82
CFHDContext::planes
int planes
Definition: cfhd.h:153
Peak
Definition: cfhd.h:134
CFHD_RL_VLC_ELEM
Definition: cfhd.h:100
HighpassHeight
@ HighpassHeight
Definition: cfhd.h:64
CFHDContext::avctx
AVCodecContext * avctx
Definition: cfhd.h:141
Peak::base
GetByteContext base
Definition: cfhd.h:137
VersionRevision
@ VersionRevision
Definition: cfhd.h:38
SubBand::stride
ptrdiff_t stride
Definition: cfhd.h:110
Plane::height
int height
Definition: cfhd.h:120
CFHDContext::frame_index
int frame_index
Definition: cfhd.h:155
BitstreamMarker
@ BitstreamMarker
Definition: cfhd.h:35
CFHD_RL_VLC_ELEM::level
int16_t level
Definition: cfhd.h:101
CFHDContext::gb
GetBitContext gb
Definition: cfhd.h:151
SubBand
Definition: cfhd.h:109
CFHDContext::a_width
int a_width
Definition: cfhd.h:164
Plane::width
int width
Definition: cfhd.h:119
CFHDContext::coded_height
int coded_height
Definition: cfhd.h:159
CFHDContext::prescale_table
uint8_t prescale_table[8]
Definition: cfhd.h:183
CFHDContext::difference_coding
int difference_coding
Definition: cfhd.h:178
NumBands
@ NumBands
Definition: cfhd.h:62
Plane::l_h
int16_t * l_h[10]
Definition: cfhd.h:129
VersionEdit
@ VersionEdit
Definition: cfhd.h:39
Plane::stride
ptrdiff_t stride
Definition: cfhd.h:121
CFHDContext::coded_format
enum AVPixelFormat coded_format
Definition: cfhd.h:161
CFHDContext::transform_type
int transform_type
Definition: cfhd.h:157
SubbandCount
@ SubbandCount
Definition: cfhd.h:44
CFHDContext::plane
Plane plane[4]
Definition: cfhd.h:184
CFHDContext
Definition: cfhd.h:140
LowpassBorder
@ LowpassBorder
Definition: cfhd.h:65
cfhddsp.h
SubbandBand
@ SubbandBand
Definition: cfhd.h:72
SubBand::read_ok
int8_t read_ok
Definition: cfhd.h:115
CFHDContext::vlc_9
VLC vlc_9
Definition: cfhd.h:144
CFHDContext::cropped_height
int cropped_height
Definition: cfhd.h:160
SUBBAND_COUNT_3D
#define SUBBAND_COUNT_3D
Definition: cfhd.h:98
ImageWidth
@ ImageWidth
Definition: cfhd.h:49
avcodec.h
ChannelHeight
@ ChannelHeight
Definition: cfhd.h:93
CFHDContext::sample_type
int sample_type
Definition: cfhd.h:156
CFHDContext::coded_width
int coded_width
Definition: cfhd.h:158
CFHDContext::vlc_18
VLC vlc_18
Definition: cfhd.h:147
PeakLevel
@ PeakLevel
Definition: cfhd.h:84
BandCodingFlags
@ BandCodingFlags
Definition: cfhd.h:83
EncodedFormat
@ EncodedFormat
Definition: cfhd.h:90
AVCodecContext
main external API structure.
Definition: avcodec.h:389
VLC
Definition: vlc.h:31
CFHDContext::a_transform_type
int a_transform_type
Definition: cfhd.h:167
CFHDParam
CFHDParam
Definition: cfhd.h:32
CFHDContext::lut
int lut[2][256]
Definition: cfhd.h:149
ImageHeight
@ ImageHeight
Definition: cfhd.h:50
BandTrailer
@ BandTrailer
Definition: cfhd.h:77
Plane
Definition: cfhd.h:118
BandWidth
@ BandWidth
Definition: cfhd.h:70
ChannelWidth
@ ChannelWidth
Definition: cfhd.h:92
SampleFlags
@ SampleFlags
Definition: cfhd.h:79
Plane::idwt_buf
int16_t * idwt_buf
Definition: cfhd.h:123
DWT_LEVELS_3D
#define DWT_LEVELS_3D
Definition: cfhd.h:107
Plane::band
SubBand band[DWT_LEVELS_3D][4]
Definition: cfhd.h:131
CFHDContext::frame_type
int frame_type
Definition: cfhd.h:154
NumLevels
@ NumLevels
Definition: cfhd.h:53
LowpassHeight
@ LowpassHeight
Definition: cfhd.h:55
HighpassBorder
@ HighpassBorder
Definition: cfhd.h:66
CFHDContext::subband_num_actual
int subband_num_actual
Definition: cfhd.h:181
vlc.h
bytestream.h
CFHD_RL_VLC_ELEM::run
uint16_t run
Definition: cfhd.h:103
CFHDContext::table_18_rl_vlc
CFHD_RL_VLC_ELEM table_18_rl_vlc[4572]
Definition: cfhd.h:146
SampleIndexTable
@ SampleIndexTable
Definition: cfhd.h:34
Peak::offset
int offset
Definition: cfhd.h:136
SubBand::a_height
int a_height
Definition: cfhd.h:113
SubBand::a_width
int a_width
Definition: cfhd.h:111
PeakOffsetLow
@ PeakOffsetLow
Definition: cfhd.h:85
CFHDContext::a_height
int a_height
Definition: cfhd.h:165
SubBand::height
int height
Definition: cfhd.h:114
PixelOffset
@ PixelOffset
Definition: cfhd.h:56
CFHD_RL_VLC_ELEM::len
int8_t len
Definition: cfhd.h:102

Generated on Wed Aug 24 2022 21:41:20 for FFmpeg by   doxygen 1.8.17

AltStyle によって変換されたページ (->オリジナル) /