FFmpeg
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
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 
33 #define VLC_BITS 9
34 #define SUBBAND_COUNT 10
35 
36 typedef struct CFHD_RL_VLC_ELEM {
37  int16_t level;
38  int8_t len;
39  uint16_t run;
41 
42 #define DWT_LEVELS 3
43 
44 typedef struct SubBand {
45  int level;
47  ptrdiff_t stride;
48  int a_width;
49  int width;
50  int a_height;
51  int height;
52  int pshift;
53  int quant;
55 } SubBand;
56 
57 typedef struct Plane {
58  int width;
59  int height;
60  ptrdiff_t stride;
61 
62  int16_t *idwt_buf;
63  int16_t *idwt_tmp;
64 
65  /* TODO: merge this into SubBand structure */
67  int16_t *l_h[8];
68 
70 } Plane;
71 
72 typedef struct Peak {
73  int level;
74  int offset;
76 } Peak;
77 
78 typedef struct CFHDContext {
80 
83 
86 
88 
94 
95  int a_width;
96  int a_height;
97  int a_format;
98 
99  int bpc; // bits per channel/component
104  uint16_t quantisation;
106  int pshift;
107 
108  int codebook;
111  int level;
113 
117 } CFHDContext;
118 
120 
121 #endif /* AVCODEC_CFHD_H */
int quant
Definition: cfhd.h:53
int channel_cnt
Definition: cfhd.h:100
int difference_coding
Definition: cfhd.h:109
VLC vlc_18
Definition: cfhd.h:85
AVCodecContext * avctx
Definition: cfhd.h:79
int a_height
Definition: cfhd.h:50
int level
Definition: cfhd.h:73
int cropped_height
Definition: cfhd.h:91
int16_t * idwt_tmp
Definition: cfhd.h:63
int a_width
Definition: cfhd.h:95
ptrdiff_t stride
Definition: cfhd.h:47
int subband_num_actual
Definition: cfhd.h:112
int width
Definition: cfhd.h:49
uint8_t
int16_t * idwt_buf
Definition: cfhd.h:62
int a_format
Definition: cfhd.h:97
bitstream reader API header.
#define SUBBAND_COUNT
Definition: cfhd.h:34
Definition: cfhd.h:44
int8_t len
Definition: cfhd.h:38
CFHD_RL_VLC_ELEM table_18_rl_vlc[4572]
Definition: cfhd.h:84
CFHD_RL_VLC_ELEM table_9_rl_vlc[2088]
Definition: cfhd.h:81
uint8_t prescale_shift[3]
Definition: cfhd.h:114
VLC vlc_9
Definition: cfhd.h:82
int16_t * l_h[8]
Definition: cfhd.h:67
#define DWT_LEVELS
Definition: cfhd.h:42
simple assert() macros that are a bit more flexible than ISO C assert().
Definition: cfhd.h:72
Definition: vlc.h:26
int a_width
Definition: cfhd.h:48
int orientation
Definition: cfhd.h:46
uint16_t run
Definition: cfhd.h:39
SubBand band[DWT_LEVELS][4]
Definition: cfhd.h:69
GetByteContext base
Definition: cfhd.h:75
uint8_t * ibuf
Definition: cfhd.h:54
int subband_cnt
Definition: cfhd.h:101
uint16_t quantisation
Definition: cfhd.h:104
#define s(width, name)
Definition: cbs_vp9.c:257
int channel_num
Definition: cfhd.h:102
GetBitContext gb
Definition: cfhd.h:87
int wavelet_depth
Definition: cfhd.h:105
Libavcodec external API header.
main external API structure.
Definition: avcodec.h:1533
int codebook
Definition: cfhd.h:108
int subband_num
Definition: cfhd.h:110
int pshift
Definition: cfhd.h:106
enum AVPixelFormat coded_format
Definition: cfhd.h:92
Peak peak
Definition: cfhd.h:116
int level
Definition: cfhd.h:111
int pshift
Definition: cfhd.h:52
int coded_width
Definition: cfhd.h:89
ptrdiff_t stride
Definition: cfhd.h:60
int bpc
Definition: cfhd.h:99
int a_height
Definition: cfhd.h:96
int height
Definition: cfhd.h:51
int width
Definition: cfhd.h:58
int offset
Definition: cfhd.h:74
int ff_cfhd_init_vlcs(CFHDContext *s)
Definition: cfhddata.c:276
int progressive
Definition: cfhd.h:93
int16_t level
Definition: cfhd.h:37
Plane plane[4]
Definition: cfhd.h:115
int height
Definition: cfhd.h:59
uint8_t lowpass_precision
Definition: cfhd.h:103
int16_t * subband[SUBBAND_COUNT]
Definition: cfhd.h:66
AVPixelFormat
Pixel format.
Definition: pixfmt.h:64
Definition: cfhd.h:57
int level
Definition: cfhd.h:45
int coded_height
Definition: cfhd.h:90