Mercurial > libavcodec.hg
comparison idcinvideo.c @ 8318:bc36a075bf35 libavcodec
The POSIX namespace shall be held sacrosanct. To that end,
continue eliminating _t from structure names in FFmpeg.
author | melanson |
---|---|
date | Sun, 14 Dec 2008 03:29:33 +0000 |
parents | e943e1409077 |
children | e9d9d946f213 |
comparison
equal
deleted
inserted
replaced
8317:08b0f63a91c5 | 8318:bc36a075bf35 |
---|---|
58 typedef struct | 58 typedef struct |
59 { | 59 { |
60 int count; | 60 int count; |
61 unsigned char used; | 61 unsigned char used; |
62 int children[2]; | 62 int children[2]; |
63 } hnode_t; | 63 } hnode; |
64 | 64 |
65 typedef struct IdcinContext { | 65 typedef struct IdcinContext { |
66 | 66 |
67 AVCodecContext *avctx; | 67 AVCodecContext *avctx; |
68 AVFrame frame; | 68 AVFrame frame; |
69 | 69 |
70 const unsigned char *buf; | 70 const unsigned char *buf; |
71 int size; | 71 int size; |
72 | 72 |
73 hnode_t huff_nodes[256][HUF_TOKENS*2]; | 73 hnode huff_nodes[256][HUF_TOKENS*2]; |
74 int num_huff_nodes[256]; | 74 int num_huff_nodes[256]; |
75 | 75 |
76 } IdcinContext; | 76 } IdcinContext; |
77 | 77 |
78 /* | 78 /* |
79 * Find the lowest probability node in a Huffman table, and mark it as | 79 * Find the lowest probability node in a Huffman table, and mark it as |
80 * being assigned to a higher probability. | 80 * being assigned to a higher probability. |
81 * Returns the node index of the lowest unused node, or -1 if all nodes | 81 * Returns the node index of the lowest unused node, or -1 if all nodes |
82 * are used. | 82 * are used. |
83 */ | 83 */ |
84 static int huff_smallest_node(hnode_t *hnodes, int num_hnodes) { | 84 static int huff_smallest_node(hnode *hnodes, int num_hnodes) { |
85 int i; | 85 int i; |
86 int best, best_node; | 86 int best, best_node; |
87 | 87 |
88 best = 99999999; | 88 best = 99999999; |
89 best_node = -1; | 89 best_node = -1; |
112 * huff_nodes[prev][i >= HUF_TOKENS] - are used to construct the tree. | 112 * huff_nodes[prev][i >= HUF_TOKENS] - are used to construct the tree. |
113 * num_huff_nodes[prev] - contains the index to the root node of the tree. | 113 * num_huff_nodes[prev] - contains the index to the root node of the tree. |
114 * That is: huff_nodes[prev][num_huff_nodes[prev]] is the root node. | 114 * That is: huff_nodes[prev][num_huff_nodes[prev]] is the root node. |
115 */ | 115 */ |
116 static av_cold void huff_build_tree(IdcinContext *s, int prev) { | 116 static av_cold void huff_build_tree(IdcinContext *s, int prev) { |
117 hnode_t *node, *hnodes; | 117 hnode *node, *hnodes; |
118 int num_hnodes, i; | 118 int num_hnodes, i; |
119 | 119 |
120 num_hnodes = HUF_TOKENS; | 120 num_hnodes = HUF_TOKENS; |
121 hnodes = s->huff_nodes[prev]; | 121 hnodes = s->huff_nodes[prev]; |
122 for(i = 0; i < HUF_TOKENS * 2; i++) | 122 for(i = 0; i < HUF_TOKENS * 2; i++) |
171 return 0; | 171 return 0; |
172 } | 172 } |
173 | 173 |
174 static void idcin_decode_vlcs(IdcinContext *s) | 174 static void idcin_decode_vlcs(IdcinContext *s) |
175 { | 175 { |
176 hnode_t *hnodes; | 176 hnode *hnodes; |
177 long x, y; | 177 long x, y; |
178 int prev; | 178 int prev; |
179 unsigned char v = 0; | 179 unsigned char v = 0; |
180 int bit_pos, node_num, dat_pos; | 180 int bit_pos, node_num, dat_pos; |
181 | 181 |