Mercurial > libavcodec.hg
comparison huffyuv.c @ 8308:61cfb1dcfae5 libavcodec
More POSIX _t namespace cleanup.
author | michael |
---|---|
date | Fri, 12 Dec 2008 16:21:23 +0000 |
parents | 4525dcd81357 |
children | 7a463923ecd1 |
comparison
equal
deleted
inserted
replaced
8307:bf5bc1f4cba0 | 8308:61cfb1dcfae5 |
---|---|
263 | 263 |
264 #if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) | 264 #if defined(CONFIG_HUFFYUV_ENCODER) || defined(CONFIG_FFVHUFF_ENCODER) |
265 typedef struct { | 265 typedef struct { |
266 uint64_t val; | 266 uint64_t val; |
267 int name; | 267 int name; |
268 } heap_elem_t; | 268 } HeapElem; |
269 | 269 |
270 static void heap_sift(heap_elem_t *h, int root, int size) | 270 static void heap_sift(HeapElem *h, int root, int size) |
271 { | 271 { |
272 while(root*2+1 < size) { | 272 while(root*2+1 < size) { |
273 int child = root*2+1; | 273 int child = root*2+1; |
274 if(child < size-1 && h[child].val > h[child+1].val) | 274 if(child < size-1 && h[child].val > h[child+1].val) |
275 child++; | 275 child++; |
276 if(h[root].val > h[child].val) { | 276 if(h[root].val > h[child].val) { |
277 FFSWAP(heap_elem_t, h[root], h[child]); | 277 FFSWAP(HeapElem, h[root], h[child]); |
278 root = child; | 278 root = child; |
279 } else | 279 } else |
280 break; | 280 break; |
281 } | 281 } |
282 } | 282 } |
283 | 283 |
284 static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){ | 284 static void generate_len_table(uint8_t *dst, uint64_t *stats, int size){ |
285 heap_elem_t h[size]; | 285 HeapElem h[size]; |
286 int up[2*size]; | 286 int up[2*size]; |
287 int len[2*size]; | 287 int len[2*size]; |
288 int offset, i, next; | 288 int offset, i, next; |
289 | 289 |
290 for(offset=1; ; offset<<=1){ | 290 for(offset=1; ; offset<<=1){ |