comparison dv.c @ 4666:c43d2a68ec57 libavcodec

kill av_mallocz_static()
author michael
date Wed, 14 Mar 2007 12:15:34 +0000
parents 5b6f5e7ed3a0
children c23a5c8263bc
comparison
equal deleted inserted replaced
4665:9b35cbf0b25b 4666:c43d2a68ec57
78 static RL_VLC_ELEM dv_rl_vlc[1184]; 78 static RL_VLC_ELEM dv_rl_vlc[1184];
79 /* VLC encoding lookup table */ 79 /* VLC encoding lookup table */
80 static struct dv_vlc_pair { 80 static struct dv_vlc_pair {
81 uint32_t vlc; 81 uint32_t vlc;
82 uint8_t size; 82 uint8_t size;
83 } (*dv_vlc_map)[DV_VLC_MAP_LEV_SIZE] = NULL; 83 } dv_vlc_map[DV_VLC_MAP_RUN_SIZE][DV_VLC_MAP_LEV_SIZE];
84 84
85 static void dv_build_unquantize_tables(DVVideoContext *s, uint8_t* perm) 85 static void dv_build_unquantize_tables(DVVideoContext *s, uint8_t* perm)
86 { 86 {
87 int i, q, j; 87 int i, q, j;
88 88
120 uint8_t new_dv_vlc_len[NB_DV_VLC*2]; 120 uint8_t new_dv_vlc_len[NB_DV_VLC*2];
121 uint8_t new_dv_vlc_run[NB_DV_VLC*2]; 121 uint8_t new_dv_vlc_run[NB_DV_VLC*2];
122 int16_t new_dv_vlc_level[NB_DV_VLC*2]; 122 int16_t new_dv_vlc_level[NB_DV_VLC*2];
123 123
124 done = 1; 124 done = 1;
125
126 dv_vlc_map = av_mallocz_static(DV_VLC_MAP_LEV_SIZE*DV_VLC_MAP_RUN_SIZE*sizeof(struct dv_vlc_pair));
127 if (!dv_vlc_map)
128 return AVERROR(ENOMEM);
129 125
130 /* dv_anchor lets each thread know its Id */ 126 /* dv_anchor lets each thread know its Id */
131 for (i=0; i<DV_ANCHOR_SIZE; i++) 127 for (i=0; i<DV_ANCHOR_SIZE; i++)
132 dv_anchor[i] = (void*)(size_t)i; 128 dv_anchor[i] = (void*)(size_t)i;
133 129