Mercurial > libavcodec.hg
comparison vc1dec.c @ 10260:48aebab3bac1 libavcodec
Use ff_msmpeg4_decode_init to initialize ff_msmp4_mb_i_vlc since static
VLC tables should only be initialized from one place.
This initializes/calculates more VLC tables than necessary for VC1 decoding,
but this is only done once and only a small overhead in time and space (maybe
30 kB) it seems not worth adding a separate function.
author | reimar |
---|---|
date | Thu, 24 Sep 2009 10:49:47 +0000 |
parents | 38cfe222e1a4 |
children | 71a38fce15bc |
comparison
equal
deleted
inserted
replaced
10259:21add4db7e53 | 10260:48aebab3bac1 |
---|---|
122 ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i+22] - vlc_offs[i+21]; | 122 ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i+22] - vlc_offs[i+21]; |
123 init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, vc1_ac_sizes[i], | 123 init_vlc(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, vc1_ac_sizes[i], |
124 &vc1_ac_tables[i][0][1], 8, 4, | 124 &vc1_ac_tables[i][0][1], 8, 4, |
125 &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC); | 125 &vc1_ac_tables[i][0][0], 8, 4, INIT_VLC_USE_NEW_STATIC); |
126 } | 126 } |
127 //FIXME: switching to INIT_VLC_STATIC() results in incorrect decoding | |
128 init_vlc(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64, | |
129 &ff_msmp4_mb_i_table[0][1], 4, 2, | |
130 &ff_msmp4_mb_i_table[0][0], 4, 2, INIT_VLC_USE_STATIC); | |
131 done = 1; | 127 done = 1; |
132 } | 128 } |
133 | 129 |
134 /* Other defaults */ | 130 /* Other defaults */ |
135 v->pq = -1; | 131 v->pq = -1; |
2998 } | 2994 } |
2999 | 2995 |
3000 if(ff_h263_decode_init(avctx) < 0) | 2996 if(ff_h263_decode_init(avctx) < 0) |
3001 return -1; | 2997 return -1; |
3002 if (vc1_init_common(v) < 0) return -1; | 2998 if (vc1_init_common(v) < 0) return -1; |
2999 // only for ff_msmp4_mb_i_table | |
3000 if (ff_msmpeg4_decode_init(s) < 0) return -1; | |
3003 | 3001 |
3004 avctx->coded_width = avctx->width; | 3002 avctx->coded_width = avctx->width; |
3005 avctx->coded_height = avctx->height; | 3003 avctx->coded_height = avctx->height; |
3006 if (avctx->codec_id == CODEC_ID_WMV3) | 3004 if (avctx->codec_id == CODEC_ID_WMV3) |
3007 { | 3005 { |