FreeRDP
libfreerdp/codec/progressive.h
1 
21 #ifndef INTERNAL_CODEC_PROGRESSIVE_H
22 #define INTERNAL_CODEC_PROGRESSIVE_H
23 
24 #include <winpr/wlog.h>
25 #include <winpr/pool.h>
26 #include <winpr/collections.h>
27 
28 #include <freerdp/codec/rfx.h>
29 
30 #define RFX_SUBBAND_DIFFING 0x01
31 
32 #define RFX_TILE_DIFFERENCE 0x01
33 
34 #define RFX_DWT_REDUCE_EXTRAPOLATE 0x01
35 
36 typedef struct
37 {
38  BYTE LL3;
39  BYTE HL3;
40  BYTE LH3;
41  BYTE HH3;
42  BYTE HL2;
43  BYTE LH2;
44  BYTE HH2;
45  BYTE HL1;
46  BYTE LH1;
47  BYTE HH1;
49 
50 typedef struct
51 {
52  BYTE quality;
53  RFX_COMPONENT_CODEC_QUANT yQuantValues;
54  RFX_COMPONENT_CODEC_QUANT cbQuantValues;
55  RFX_COMPONENT_CODEC_QUANT crQuantValues;
57 
58 typedef struct
59 {
60  UINT16 blockType;
61  UINT32 blockLen;
63 
64 typedef struct
65 {
66  UINT16 blockType;
67  UINT32 blockLen;
68 
69  UINT32 magic;
70  UINT16 version;
72 
73 typedef struct
74 {
75  UINT16 blockType;
76  UINT32 blockLen;
77 
78  BYTE ctxId;
79  UINT16 tileSize;
80  BYTE flags;
82 
83 typedef struct
84 {
85  UINT16 blockType;
86  UINT32 blockLen;
87 
88  BYTE quantIdxY;
89  BYTE quantIdxCb;
90  BYTE quantIdxCr;
91  UINT16 xIdx;
92  UINT16 yIdx;
93 
94  BYTE flags;
95  BYTE quality;
96  BOOL dirty;
97 
98  UINT16 yLen;
99  UINT16 cbLen;
100  UINT16 crLen;
101  UINT16 tailLen;
102  const BYTE* yData;
103  const BYTE* cbData;
104  const BYTE* crData;
105  const BYTE* tailData;
106 
107  UINT16 ySrlLen;
108  UINT16 yRawLen;
109  UINT16 cbSrlLen;
110  UINT16 cbRawLen;
111  UINT16 crSrlLen;
112  UINT16 crRawLen;
113  const BYTE* ySrlData;
114  const BYTE* yRawData;
115  const BYTE* cbSrlData;
116  const BYTE* cbRawData;
117  const BYTE* crSrlData;
118  const BYTE* crRawData;
119 
120  UINT32 x;
121  UINT32 y;
122  UINT32 width;
123  UINT32 height;
124  UINT32 stride;
125 
126  BYTE* data;
127  BYTE* current;
128 
129  UINT16 pass;
130  BYTE* sign;
131 
133  RFX_COMPONENT_CODEC_QUANT cbBitPos;
134  RFX_COMPONENT_CODEC_QUANT crBitPos;
138  RFX_COMPONENT_CODEC_QUANT yProgQuant;
139  RFX_COMPONENT_CODEC_QUANT cbProgQuant;
140  RFX_COMPONENT_CODEC_QUANT crProgQuant;
142 
143 typedef struct S_PROGRESSIVE_CONTEXT PROGRESSIVE_CONTEXT;
144 typedef struct S_PROGRESSIVE_BLOCK_REGION PROGRESSIVE_BLOCK_REGION;
145 
146 typedef struct
147 {
148  PROGRESSIVE_CONTEXT* progressive;
149  PROGRESSIVE_BLOCK_REGION* region;
150  const PROGRESSIVE_BLOCK_CONTEXT* context;
151  RFX_PROGRESSIVE_TILE* tile;
153 
155 {
156  UINT16 blockType;
157  UINT32 blockLen;
158 
159  BYTE tileSize;
160  UINT16 numRects;
161  BYTE numQuant;
162  BYTE numProgQuant;
163  BYTE flags;
164  UINT16 numTiles;
165  UINT16 usedTiles;
166  UINT32 tileDataSize;
167  RFX_RECT rects[0x10000];
168  RFX_COMPONENT_CODEC_QUANT quantVals[0x100];
169  RFX_PROGRESSIVE_CODEC_QUANT quantProgVals[0x100];
170  RFX_PROGRESSIVE_TILE* tiles[0x10000];
171 };
172 
173 typedef struct
174 {
175  UINT16 blockType;
176  UINT32 blockLen;
177 
178  UINT32 frameIndex;
179  UINT16 regionCount;
180  PROGRESSIVE_BLOCK_REGION* regions;
182 
183 typedef struct
184 {
185  UINT16 blockType;
186  UINT32 blockLen;
188 
189 typedef struct
190 {
191  UINT16 id;
192  UINT32 width;
193  UINT32 height;
194  UINT32 gridWidth;
195  UINT32 gridHeight;
196  UINT32 gridSize;
197  RFX_PROGRESSIVE_TILE** tiles;
198  size_t tilesSize;
199  UINT32 frameId;
200  UINT32 numUpdatedTiles;
201  UINT32* updatedTileIndices;
203 
204 typedef enum
205 {
206  FLAG_WBT_SYNC = 0x01,
207  FLAG_WBT_FRAME_BEGIN = 0x02,
208  FLAG_WBT_FRAME_END = 0x04,
209  FLAG_WBT_CONTEXT = 0x08,
210  FLAG_WBT_REGION = 0x10
211 } WBT_STATE_FLAG;
212 
214 {
215  BOOL Compressor;
216 
217  wBufferPool* bufferPool;
218 
219  UINT32 format;
220  UINT32 state;
221 
223  PROGRESSIVE_BLOCK_REGION region;
224  RFX_PROGRESSIVE_CODEC_QUANT quantProgValFull;
225 
226  wHashTable* SurfaceContexts;
227  wLog* log;
228  wStream* buffer;
229  wStream* rects;
230  RFX_CONTEXT* rfx_context;
231  PROGRESSIVE_TILE_PROCESS_WORK_PARAM params[0x10000];
232  PTP_WORK work_objects[0x10000];
233 };
234 
235 #endif /* INTERNAL_CODEC_PROGRESSIVE_H */
Definition: rfx.h:44