20 #ifndef FREERDP_LIB_CODEC_RFX_TYPES_H
21 #define FREERDP_LIB_CODEC_RFX_TYPES_H
23 #include <freerdp/config.h>
25 #include <winpr/crt.h>
26 #include <winpr/pool.h>
27 #include <winpr/wlog.h>
28 #include <winpr/collections.h>
30 #include <freerdp/codec/rfx.h>
31 #include <freerdp/log.h>
32 #include <freerdp/utils/profiler.h>
34 #define RFX_TAG FREERDP_TAG("codec.rfx")
36 #define DEBUG_RFX(...) WLog_DBG(RFX_TAG, __VA_ARGS__)
38 #define DEBUG_RFX(...) \
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
53 RFX_STATE_SERVER_UNINITIALIZED,
54 RFX_STATE_SEND_HEADERS,
55 RFX_STATE_SEND_FRAME_DATA,
56 RFX_STATE_FRAME_DATA_SENT,
60 typedef struct S_RFX_TILE_COMPOSE_WORK_PARAM RFX_TILE_COMPOSE_WORK_PARAM;
66 wObjectPool* TilePool;
69 PTP_WORK* workObjects;
70 RFX_TILE_COMPOSE_WORK_PARAM* tileWorkParams;
78 wBufferPool* BufferPool;
81 PROFILER_DEFINE(prof_rfx_decode_rgb)
82 PROFILER_DEFINE(prof_rfx_decode_component)
83 PROFILER_DEFINE(prof_rfx_rlgr_decode)
84 PROFILER_DEFINE(prof_rfx_differential_decode)
85 PROFILER_DEFINE(prof_rfx_quantization_decode)
86 PROFILER_DEFINE(prof_rfx_dwt_2d_decode)
87 PROFILER_DEFINE(prof_rfx_ycbcr_to_rgb)
89 PROFILER_DEFINE(prof_rfx_encode_rgb)
90 PROFILER_DEFINE(prof_rfx_encode_component)
91 PROFILER_DEFINE(prof_rfx_rlgr_encode)
92 PROFILER_DEFINE(prof_rfx_differential_encode)
93 PROFILER_DEFINE(prof_rfx_quantization_encode)
94 PROFILER_DEFINE(prof_rfx_dwt_2d_encode)
95 PROFILER_DEFINE(prof_rfx_rgb_to_ycbcr)
96 PROFILER_DEFINE(prof_rfx_encode_format_rgb)
117 size_t allocatedTiles;
123 UINT32 tilesDataSize;
132 RFX_CONTEXT* context;
147 UINT32 codec_version;
163 UINT32 decodedHeaderBlocks;
164 UINT16 expectedDataBlockType;
168 void (*quantization_decode)(INT16* WINPR_RESTRICT buffer,
169 const UINT32* WINPR_RESTRICT quantization_values);
170 void (*quantization_encode)(INT16* WINPR_RESTRICT buffer,
171 const UINT32* WINPR_RESTRICT quantization_values);
172 void (*dwt_2d_decode)(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT dwt_buffer);
173 void (*dwt_2d_extrapolate_decode)(INT16* WINPR_RESTRICT src, INT16* WINPR_RESTRICT temp);
174 void (*dwt_2d_encode)(INT16* WINPR_RESTRICT buffer, INT16* WINPR_RESTRICT dwt_buffer);
175 int (*rlgr_decode)(RLGR_MODE mode,
const BYTE* WINPR_RESTRICT data, UINT32 data_size,
176 INT16* WINPR_RESTRICT buffer, UINT32 buffer_size);
177 int (*rlgr_encode)(RLGR_MODE mode,
const INT16* WINPR_RESTRICT data, UINT32 data_size,
178 BYTE* WINPR_RESTRICT buffer, UINT32 buffer_size);
181 RFX_CONTEXT_PRIV* priv;