FreeRDP
Loading...
Searching...
No Matches
rfx_types.h
1
20#ifndef FREERDP_LIB_CODEC_RFX_TYPES_H
21#define FREERDP_LIB_CODEC_RFX_TYPES_H
22
23#include <freerdp/config.h>
24
25#include <winpr/crt.h>
26#include <winpr/pool.h>
27#include <winpr/wlog.h>
28#include <winpr/collections.h>
29
30#include <freerdp/codec/rfx.h>
31#include <freerdp/log.h>
32#include <freerdp/utils/profiler.h>
33
34#define RFX_TAG FREERDP_TAG("codec.rfx")
35#ifdef WITH_DEBUG_RFX
36#define DEBUG_RFX(...) WLog_DBG(RFX_TAG, __VA_ARGS__)
37#else
38#define DEBUG_RFX(...) \
39 do \
40 { \
41 } while (0)
42#endif
43
44#define RFX_DECODED_SYNC 0x00000001
45#define RFX_DECODED_CONTEXT 0x00000002
46#define RFX_DECODED_VERSIONS 0x00000004
47#define RFX_DECODED_CHANNELS 0x00000008
48#define RFX_DECODED_HEADERS 0x0000000F
49
50typedef enum
51{
52 RFX_STATE_INITIAL,
53 RFX_STATE_SERVER_UNINITIALIZED,
54 RFX_STATE_SEND_HEADERS,
55 RFX_STATE_SEND_FRAME_DATA,
56 RFX_STATE_FRAME_DATA_SENT,
57 RFX_STATE_FINAL
58} RFX_STATE;
59
60typedef struct S_RFX_TILE_COMPOSE_WORK_PARAM RFX_TILE_COMPOSE_WORK_PARAM;
61
62typedef struct S_RFX_CONTEXT_PRIV RFX_CONTEXT_PRIV;
64{
65 wLog* log;
66 wObjectPool* TilePool;
67
68 BOOL UseThreads;
69 PTP_WORK* workObjects;
70 RFX_TILE_COMPOSE_WORK_PARAM* tileWorkParams;
71
72 wBufferPool* BufferPool;
73
74 /* profilers */
75 PROFILER_DEFINE(prof_rfx_decode_rgb)
76 PROFILER_DEFINE(prof_rfx_decode_component)
77 PROFILER_DEFINE(prof_rfx_rlgr_decode)
78 PROFILER_DEFINE(prof_rfx_differential_decode)
79 PROFILER_DEFINE(prof_rfx_quantization_decode)
80 PROFILER_DEFINE(prof_rfx_dwt_2d_decode)
81 PROFILER_DEFINE(prof_rfx_ycbcr_to_rgb)
82
83 PROFILER_DEFINE(prof_rfx_encode_rgb)
84 PROFILER_DEFINE(prof_rfx_encode_component)
85 PROFILER_DEFINE(prof_rfx_rlgr_encode)
86 PROFILER_DEFINE(prof_rfx_differential_encode)
87 PROFILER_DEFINE(prof_rfx_quantization_encode)
88 PROFILER_DEFINE(prof_rfx_dwt_2d_encode)
89 PROFILER_DEFINE(prof_rfx_rgb_to_ycbcr)
90 PROFILER_DEFINE(prof_rfx_encode_format_rgb)
91};
92
94{
95 UINT32 frameIdx;
96
101 UINT16 numRects;
102 RFX_RECT* rects;
103
110 UINT16 numTiles;
111 size_t allocatedTiles;
112 RFX_TILE** tiles;
113
114 UINT16 numQuant;
115 UINT32* quantVals;
116
117 UINT32 tilesDataSize;
118
119 BOOL freeArray;
120};
121
123{
124 struct S_RFX_MESSAGE* list;
125 size_t count;
126 RFX_CONTEXT* context;
127};
128
130{
131 RFX_STATE state;
132
133 BOOL encoder;
134 UINT16 flags;
135 UINT16 properties;
136 UINT16 width;
137 UINT16 height;
138 RLGR_MODE mode;
139 UINT32 version;
140 UINT32 codec_id;
141 UINT32 codec_version;
142 UINT32 pixel_format;
143 BYTE bits_per_pixel;
144
145 /* color palette allocated by the application */
146 const BYTE* palette;
147
148 /* temporary data within a frame */
149 UINT32 frameIdx;
150 BYTE numQuant;
151 UINT32* quants;
152 BYTE quantIdxY;
153 BYTE quantIdxCb;
154 BYTE quantIdxCr;
155
156 /* decoded header blocks */
157 UINT32 decodedHeaderBlocks;
158 UINT16 expectedDataBlockType;
159 struct S_RFX_MESSAGE currentMessage;
160
161 /* routines */
162 void (*quantization_decode)(INT16* WINPR_RESTRICT buffer,
163 const UINT32* WINPR_RESTRICT quantization_values);
164 void (*quantization_encode)(INT16* WINPR_RESTRICT buffer,
165 const UINT32* WINPR_RESTRICT quantization_values);
166 void (*dwt_2d_decode)(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT dwt_buffer);
167 void (*dwt_2d_extrapolate_decode)(INT16* WINPR_RESTRICT src, INT16* WINPR_RESTRICT temp);
168 void (*dwt_2d_encode)(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT dwt_buffer);
169 int (*rlgr_decode)(RLGR_MODE mode, const BYTE* WINPR_RESTRICT data, UINT32 data_size,
170 INT16* WINPR_RESTRICT buffer, UINT32 buffer_size);
171 int (*rlgr_encode)(RLGR_MODE mode, const INT16* WINPR_RESTRICT data, UINT32 data_size,
172 BYTE* WINPR_RESTRICT buffer, UINT32 buffer_size);
173
174 /* private definitions */
175 RFX_CONTEXT_PRIV* priv;
176};
177
178#endif /* FREERDP_LIB_CODEC_RFX_TYPES_H */
Definition rfx.h:44
Definition rfx.h:52
UINT16 numTiles
Definition rfx_types.h:110
UINT16 numRects
Definition rfx_types.h:101