1 #ifndef _VIDEO_HUFFMAN_H_
2 #define _VIDEO_HUFFMAN_H_
4 #include <VP_Os/vp_os_types.h>
5 #include <VLIB/video_controller.h>
9 typedef struct _huffman_code_t {
20 # pragma pack () // resets packsize to default value
22 typedef struct _huffman_tree_data_t {
25 } huffman_tree_data_t;
27 typedef struct _huffman_tree_t {
28 int32_t num_used_codes;
29 int32_t num_max_codes;
30 int32_t max_code_length;
32 huffman_tree_data_t data[];
35 huffman_tree_t* huffman_alloc( int32_t num_max_codes, int32_t max_code_length );
36 void huffman_free( huffman_tree_t* tree );
38 C_RESULT huffman_add_codes( huffman_tree_t* tree, huffman_code_t* codes, int32_t num_codes );
39 C_RESULT huffman_sort_codes( huffman_tree_t* tree );
41 C_RESULT huffman_check_code( huffman_tree_t* tree, uint32_t code, uint32_t length );
42 int32_t huffman_stream_code( huffman_tree_t* tree, video_stream_t* stream );
44 #endif // _VIDEO_HUFFMAN_H_