PlusLib  2.9.0
Software library for tracked ultrasound image acquisition, calibration, and processing.
v2u_compression.h
Go to the documentation of this file.
1 /****************************************************************************
2  *
3  * $Id: v2u_compression.h 8063 2009-11-19 23:11:46Z rekjanov $
4  *
5  * Copyright (C) 2007-2009 Epiphan Systems Inc. All rights reserved.
6  *
7  * Defines and implements decompression library for EPIPHAN VGA2USB compression
8  *
9  ****************************************************************************/
10 
11 #ifndef _VGA2USB_COMPRESSION_H_
12 #define _VGA2USB_COMPRESSION_H_ 1
13 
14 #include "v2u_defs.h"
15 
16 #ifdef __cplusplus
17 extern "C" {
18 #endif /* __cplusplus */
19 
20 #ifndef V2UDEC_API
21 #ifdef _WIN32
22 #ifdef V2UDEC_EXPORTS
23 #define V2UDEC_API __declspec(dllexport)
24 #else
25 #define V2UDEC_API __declspec(dllimport)
26 #endif
27 #else
28 #define V2UDEC_API
29 #endif
30 #endif
31 
35 #ifndef EPROTO
36 # define EPROTO 105
37 #endif
38 
39 #ifndef ENOSR
40 # define ENOSR 106
41 #endif
42 
43 #ifndef EOK
44 # define EOK 0
45 #endif
46 
47 /****************************************************************************
48  *
49  *
50  * Public interface to the decompression engine
51  *
52  *
53  ****************************************************************************/
54 
58 #define V2U_COMPRESSION_LIB_VERSION 0x00000100
59 
60 
61 
68 typedef struct v2udec_ctx* V2U_DECOMPRESSION_LIB_CONTEXT;
71 
85 
95  const unsigned char * framebuf,
96  int framebuflen);
97 
98 
103  const unsigned char * framebuf,
104  int framebuflen);
105 
106 // Length of the single compressed frame in the framebuf (excluding compression
107 // header)
111  const unsigned char * framebuf,
112  int framebuflen);
113 
114 // Size of the buffer required to decompress the frame in the framebuf
115 // (function of frame resolution and palette)
116 V2UDEC_API int
119  const unsigned char * framebuf,
120  int framebuflen);
121 
122 // Palette of the frame in the framebuf (currently RGB24 or YUY2)
126  const unsigned char * framebuf,
127  int framebuflen);
128 
129 // Palette of the frame in the framebuf before decompression
133  const unsigned char * framebuf,
134  int framebuflen);
135 
136 // Set desired palette for the frame in the framebuf
140  const unsigned char * framebuf,
141  int framebuflen,
142  V2U_UINT32 palette);
143 
144 // Resolution of the frame in the framebuf
145 V2UDEC_API void
148  const unsigned char * framebuf,
149  int framebuflen,
150  V2URect * rect);
151 
152 // Video mode of the frame in the framebuf,
153 // that is width and height before cropping
154 // and vertical refresh rate.
155 V2UDEC_API void
158  const unsigned char * framebuf,
159  int framebuflen,
160  V2U_VideoMode * vmode);
161 
162 
163 // Keyframe if not 0
164 V2UDEC_API int
167  const unsigned char * framebuf,
168  int framebuflen);
169 
170 // Ordered if not 0
171 V2UDEC_API int
174  const unsigned char * framebuf,
175  int framebuflen);
176 
180 V2UDEC_API int
183  const unsigned char * framebuf,
184  int framebuflen,
185  unsigned char * bufout, // user-allocated buffer for decompressed frame
186  int bufoutlen);
187 
188 V2UDEC_API int
191  const unsigned char * framebuf,
192  int framebuflen,
193  unsigned char * bufout,
194  int bufoutlen,
195  const unsigned char *prev_frame,
196  int prev_frame_len,
197  int just_key_data);
198 
199 #ifdef __cplusplus
200 } /* end of extern "C" */
201 #endif /* __cplusplus */
202 
203 #endif //_VGA2USB_COMPRESSION_H_
V2UDEC_API void v2udec_deinit_context(V2U_DECOMPRESSION_LIB_CONTEXT uctx)
V2UDEC_API int v2udec_get_decompressed_framelen(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
#define V2UDEC_API
V2U_INT32 V2U_BOOL
Definition: v2u_defs.h:71
V2UDEC_API V2U_UINT32 v2udec_get_palette(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
V2UDEC_API V2U_UINT32 v2udec_get_minheaderlen(V2U_DECOMPRESSION_LIB_CONTEXT uctx)
V2UDEC_API int v2udec_decompress_frame2(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen, unsigned char *bufout, int bufoutlen, const unsigned char *prev_frame, int prev_frame_len, int just_key_data)
V2UDEC_API V2U_TIME v2udec_get_timestamp(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
uint32_t V2U_UINT32
Definition: v2u_defs.h:64
V2UDEC_API int v2udec_is_keyframe(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
struct v2udec_ctx * V2U_DECOMPRESSION_LIB_CONTEXT
V2UDEC_API V2U_BOOL v2udec_set_palette(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen, V2U_UINT32 palette)
V2UDEC_API int v2udec_is_ordered(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
V2UDEC_API V2U_UINT32 v2udec_get_cpalette(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
V2UDEC_API V2U_DECOMPRESSION_LIB_CONTEXT v2udec_init_context(void)
V2U_INT64 V2U_TIME
Definition: v2u_defs.h:73
V2UDEC_API void v2udec_get_videomode(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen, V2U_VideoMode *vmode)
V2UDEC_API V2U_UINT32 v2udec_get_headerlen(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
V2UDEC_API V2U_UINT32 v2udec_get_framelen(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen)
V2UDEC_API int v2udec_decompress_frame(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen, unsigned char *bufout, int bufoutlen)
V2UDEC_API void v2udec_get_frameres(V2U_DECOMPRESSION_LIB_CONTEXT uctx, const unsigned char *framebuf, int framebuflen, V2URect *rect)