Mercurial > libavcodec.hg
comparison vp6.c @ 11943:3f5b35e5f4de libavcodec
vp6: convert VLA to fixed size
author | mru |
---|---|
date | Thu, 24 Jun 2010 09:02:44 +0000 |
parents | 85ee3d14b906 |
children | d8364962cc4a |
comparison
equal
deleted
inserted
replaced
11942:ce4b71c171aa | 11943:3f5b35e5f4de |
---|---|
34 | 34 |
35 #include "vp56.h" | 35 #include "vp56.h" |
36 #include "vp56data.h" | 36 #include "vp56data.h" |
37 #include "vp6data.h" | 37 #include "vp6data.h" |
38 | 38 |
39 #define VP6_MAX_HUFF_SIZE 12 | |
39 | 40 |
40 static void vp6_parse_coeff(VP56Context *s); | 41 static void vp6_parse_coeff(VP56Context *s); |
41 static void vp6_parse_coeff_huffman(VP56Context *s); | 42 static void vp6_parse_coeff_huffman(VP56Context *s); |
42 | 43 |
43 static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, | 44 static int vp6_parse_header(VP56Context *s, const uint8_t *buf, int buf_size, |
213 } | 214 } |
214 | 215 |
215 static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], | 216 static void vp6_build_huff_tree(VP56Context *s, uint8_t coeff_model[], |
216 const uint8_t *map, unsigned size, VLC *vlc) | 217 const uint8_t *map, unsigned size, VLC *vlc) |
217 { | 218 { |
218 Node nodes[2*size], *tmp = &nodes[size]; | 219 Node nodes[2*VP6_MAX_HUFF_SIZE], *tmp = &nodes[size]; |
219 int a, b, i; | 220 int a, b, i; |
220 | 221 |
221 /* first compute probabilities from model */ | 222 /* first compute probabilities from model */ |
222 tmp[0].count = 256; | 223 tmp[0].count = 256; |
223 for (i=0; i<size-1; i++) { | 224 for (i=0; i<size-1; i++) { |