For all VLCs here, the number of bits of the VLC is write-only, because it is hardcoded at the call site. Therefore one can replace these VLC structures with the only thing that is actually used: The pointer to the VLCElem table. And in some cases one can even avoid this.
Showing the changes to libavcodec (6 of 6 files). Show all
Unified · Split
| @@ -104,7 +104,7 @@ static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v) · 103 unmodified lines | ||
| 104 | 104 | height = v->s.mb_height >> v->field_mode; |
| 105 | 105 | stride = v->s.mb_stride; |
| 106 | 106 | invert = get_bits1(gb); |
| 107 | − imode = get_vlc2(gb, ff_vc1_imode_vlc.table, VC1_IMODE_VLC_BITS, 1); | |
| 107 | + imode = get_vlc2(gb, ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 1); | |
| 108 | 108 | |
| 109 | 109 | *raw_flag = 0; |
| 110 | 110 | switch (imode) { |
| @@ -126,7 +126,7 @@ static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v) · 15 unmodified lines | ||
| 126 | 126 | y = offset = 0; |
| 127 | 127 | // decode bitplane as one long line |
| 128 | 128 | for (; y < height * width; y += 2) { |
| 129 | − code = get_vlc2(gb, ff_vc1_norm2_vlc.table, VC1_NORM2_VLC_BITS, 1); | |
| 129 | + code = get_vlc2(gb, ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 1); | |
| 130 | 130 | *planep++ = code & 1; |
| 131 | 131 | offset++; |
| 132 | 132 | if (offset == width) { |
| @@ -146,7 +146,7 @@ static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v) · 13 unmodified lines | ||
| 146 | 146 | if (!(height % 3) && (width % 3)) { // use 2x3 decoding |
| 147 | 147 | for (y = 0; y < height; y += 3) { |
| 148 | 148 | for (x = width & 1; x < width; x += 2) { |
| 149 | − code = get_vlc2(gb, ff_vc1_norm6_vlc.table, VC1_NORM6_VLC_BITS, 2); | |
| 149 | + code = get_vlc2(gb, ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 2); | |
| 150 | 150 | if (code < 0) { |
| 151 | 151 | av_log(v->s.avctx, AV_LOG_DEBUG, "invalid NORM-6 VLC\n"); |
| 152 | 152 | return -1; |
| @@ -166,7 +166,7 @@ static int bitplane_decoding(uint8_t* data, int *raw_flag, VC1Context *v) · 13 unmodified lines | ||
| 166 | 166 | planep += (height & 1) * stride; |
| 167 | 167 | for (y = height & 1; y < height; y += 2) { |
| 168 | 168 | for (x = width % 3; x < width; x += 3) { |
| 169 | − code = get_vlc2(gb, ff_vc1_norm6_vlc.table, VC1_NORM6_VLC_BITS, 2); | |
| 169 | + code = get_vlc2(gb, ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 2); | |
| 170 | 170 | if (code < 0) { |
| 171 | 171 | av_log(v->s.avctx, AV_LOG_DEBUG, "invalid NORM-6 VLC\n"); |
| 172 | 172 | return -1; |
| @@ -765,7 +765,7 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) · 592 unmodified lines | ||
| 765 | 765 | /* Hopefully this is correct for P-frames */ |
| 766 | 766 | v->s.mv_table_index = get_bits(gb, 2); //but using ff_vc1_ tables |
| 767 | 767 | v->cbptab = get_bits(gb, 2); |
| 768 | − v->cbpcy_vlc = &ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 768 | + v->cbpcy_vlc = ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 769 | 769 | |
| 770 | 770 | if (v->dquant) { |
| 771 | 771 | av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n"); |
| @@ -804,7 +804,7 @@ int ff_vc1_parse_frame_header(VC1Context *v, GetBitContext* gb) · 32 unmodified lines | ||
| 804 | 804 | |
| 805 | 805 | v->s.mv_table_index = get_bits(gb, 2); |
| 806 | 806 | v->cbptab = get_bits(gb, 2); |
| 807 | − v->cbpcy_vlc = &ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 807 | + v->cbpcy_vlc = ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 808 | 808 | |
| 809 | 809 | if (v->dquant) { |
| 810 | 810 | av_log(v->s.avctx, AV_LOG_DEBUG, "VOP DQuant info\n"); |
| @@ -1061,19 +1061,19 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 250 unmodified lines | ||
| 1061 | 1061 | "Imode: %i, Invert: %i\n", status>>1, status&1); |
| 1062 | 1062 | v->mbmodetab = get_bits(gb, 2); |
| 1063 | 1063 | if (v->fourmvswitch) |
| 1064 | − v->mbmode_vlc = &ff_vc1_intfr_4mv_mbmode_vlc[v->mbmodetab]; | |
| 1064 | + v->mbmode_vlc = ff_vc1_intfr_4mv_mbmode_vlc[v->mbmodetab]; | |
| 1065 | 1065 | else |
| 1066 | − v->mbmode_vlc = &ff_vc1_intfr_non4mv_mbmode_vlc[v->mbmodetab]; | |
| 1066 | + v->mbmode_vlc = ff_vc1_intfr_non4mv_mbmode_vlc[v->mbmodetab]; | |
| 1067 | 1067 | v->imvtab = get_bits(gb, 2); |
| 1068 | − v->imv_vlc = &ff_vc1_1ref_mvdata_vlc[v->imvtab]; | |
| 1068 | + v->imv_vlc = ff_vc1_1ref_mvdata_vlc[v->imvtab]; | |
| 1069 | 1069 | // interlaced p-picture cbpcy range is [1, 63] |
| 1070 | 1070 | v->icbptab = get_bits(gb, 3); |
| 1071 | − v->cbpcy_vlc = &ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1071 | + v->cbpcy_vlc = ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1072 | 1072 | v->twomvbptab = get_bits(gb, 2); |
| 1073 | − v->twomvbp_vlc = &ff_vc1_2mv_block_pattern_vlc[v->twomvbptab]; | |
| 1073 | + v->twomvbp_vlc = ff_vc1_2mv_block_pattern_vlc[v->twomvbptab]; | |
| 1074 | 1074 | if (v->fourmvswitch) { |
| 1075 | 1075 | v->fourmvbptab = get_bits(gb, 2); |
| 1076 | − v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1076 | + v->fourmvbp_vlc = ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1077 | 1077 | } |
| 1078 | 1078 | } |
| 1079 | 1079 | } |
| @@ -1158,7 +1158,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 78 unmodified lines | ||
| 1158 | 1158 | /* Hopefully this is correct for P-frames */ |
| 1159 | 1159 | v->s.mv_table_index = get_bits(gb, 2); //but using ff_vc1_ tables |
| 1160 | 1160 | v->cbptab = get_bits(gb, 2); |
| 1161 | − v->cbpcy_vlc = &ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 1161 | + v->cbpcy_vlc = ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 1162 | 1162 | } else if (v->fcm == ILACE_FRAME) { // frame interlaced |
| 1163 | 1163 | v->qs_last = v->s.quarter_sample; |
| 1164 | 1164 | v->s.quarter_sample = 1; |
| @@ -1167,18 +1167,18 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 2 unmodified lines | ||
| 1167 | 1167 | v->mbmodetab = get_bits(gb, 3); |
| 1168 | 1168 | v->imvtab = get_bits(gb, 2 + v->numref); |
| 1169 | 1169 | if (!v->numref) |
| 1170 | − v->imv_vlc = &ff_vc1_1ref_mvdata_vlc[v->imvtab]; | |
| 1170 | + v->imv_vlc = ff_vc1_1ref_mvdata_vlc[v->imvtab]; | |
| 1171 | 1171 | else |
| 1172 | − v->imv_vlc = &ff_vc1_2ref_mvdata_vlc[v->imvtab]; | |
| 1172 | + v->imv_vlc = ff_vc1_2ref_mvdata_vlc[v->imvtab]; | |
| 1173 | 1173 | v->icbptab = get_bits(gb, 3); |
| 1174 | − v->cbpcy_vlc = &ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1174 | + v->cbpcy_vlc = ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1175 | 1175 | if ((v->mv_mode == MV_PMODE_INTENSITY_COMP && |
| 1176 | 1176 | v->mv_mode2 == MV_PMODE_MIXED_MV) || v->mv_mode == MV_PMODE_MIXED_MV) { |
| 1177 | 1177 | v->fourmvbptab = get_bits(gb, 2); |
| 1178 | − v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1179 | − v->mbmode_vlc = &ff_vc1_if_mmv_mbmode_vlc[v->mbmodetab]; | |
| 1178 | + v->fourmvbp_vlc = ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1179 | + v->mbmode_vlc = ff_vc1_if_mmv_mbmode_vlc[v->mbmodetab]; | |
| 1180 | 1180 | } else { |
| 1181 | − v->mbmode_vlc = &ff_vc1_if_1mv_mbmode_vlc[v->mbmodetab]; | |
| 1181 | + v->mbmode_vlc = ff_vc1_if_1mv_mbmode_vlc[v->mbmodetab]; | |
| 1182 | 1182 | } |
| 1183 | 1183 | } |
| 1184 | 1184 | if (v->dquant) { |
| @@ -1234,16 +1234,16 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 49 unmodified lines | ||
| 1234 | 1234 | "Imode: %i, Invert: %i\n", status>>1, status&1); |
| 1235 | 1235 | v->mbmodetab = get_bits(gb, 3); |
| 1236 | 1236 | if (v->mv_mode == MV_PMODE_MIXED_MV) |
| 1237 | − v->mbmode_vlc = &ff_vc1_if_mmv_mbmode_vlc[v->mbmodetab]; | |
| 1237 | + v->mbmode_vlc = ff_vc1_if_mmv_mbmode_vlc[v->mbmodetab]; | |
| 1238 | 1238 | else |
| 1239 | − v->mbmode_vlc = &ff_vc1_if_1mv_mbmode_vlc[v->mbmodetab]; | |
| 1239 | + v->mbmode_vlc = ff_vc1_if_1mv_mbmode_vlc[v->mbmodetab]; | |
| 1240 | 1240 | v->imvtab = get_bits(gb, 3); |
| 1241 | − v->imv_vlc = &ff_vc1_2ref_mvdata_vlc[v->imvtab]; | |
| 1241 | + v->imv_vlc = ff_vc1_2ref_mvdata_vlc[v->imvtab]; | |
| 1242 | 1242 | v->icbptab = get_bits(gb, 3); |
| 1243 | − v->cbpcy_vlc = &ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1243 | + v->cbpcy_vlc = ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1244 | 1244 | if (v->mv_mode == MV_PMODE_MIXED_MV) { |
| 1245 | 1245 | v->fourmvbptab = get_bits(gb, 2); |
| 1246 | − v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1246 | + v->fourmvbp_vlc = ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1247 | 1247 | } |
| 1248 | 1248 | v->numref = 1; // interlaced field B pictures are always 2-ref |
| 1249 | 1249 | } else if (v->fcm == ILACE_FRAME) { |
| @@ -1268,16 +1268,16 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 18 unmodified lines | ||
| 1268 | 1268 | av_log(v->s.avctx, AV_LOG_DEBUG, "MB Skip plane encoding: " |
| 1269 | 1269 | "Imode: %i, Invert: %i\n", status>>1, status&1); |
| 1270 | 1270 | v->mbmodetab = get_bits(gb, 2); |
| 1271 | − v->mbmode_vlc = &ff_vc1_intfr_non4mv_mbmode_vlc[v->mbmodetab]; | |
| 1271 | + v->mbmode_vlc = ff_vc1_intfr_non4mv_mbmode_vlc[v->mbmodetab]; | |
| 1272 | 1272 | v->imvtab = get_bits(gb, 2); |
| 1273 | − v->imv_vlc = &ff_vc1_1ref_mvdata_vlc[v->imvtab]; | |
| 1273 | + v->imv_vlc = ff_vc1_1ref_mvdata_vlc[v->imvtab]; | |
| 1274 | 1274 | // interlaced p/b-picture cbpcy range is [1, 63] |
| 1275 | 1275 | v->icbptab = get_bits(gb, 3); |
| 1276 | − v->cbpcy_vlc = &ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1276 | + v->cbpcy_vlc = ff_vc1_icbpcy_vlc[v->icbptab]; | |
| 1277 | 1277 | v->twomvbptab = get_bits(gb, 2); |
| 1278 | − v->twomvbp_vlc = &ff_vc1_2mv_block_pattern_vlc[v->twomvbptab]; | |
| 1278 | + v->twomvbp_vlc = ff_vc1_2mv_block_pattern_vlc[v->twomvbptab]; | |
| 1279 | 1279 | v->fourmvbptab = get_bits(gb, 2); |
| 1280 | − v->fourmvbp_vlc = &ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1280 | + v->fourmvbp_vlc = ff_vc1_4mv_block_pattern_vlc[v->fourmvbptab]; | |
| 1281 | 1281 | } else { |
| 1282 | 1282 | v->mv_mode = get_bits1(gb) ? MV_PMODE_1MV : MV_PMODE_1MV_HPEL_BILIN; |
| 1283 | 1283 | v->qs_last = v->s.quarter_sample; |
| @@ -1295,7 +1295,7 @@ int ff_vc1_parse_frame_header_adv(VC1Context *v, GetBitContext* gb) · 11 unmodified lines | ||
| 1295 | 1295 | "Imode: %i, Invert: %i\n", status>>1, status&1); |
| 1296 | 1296 | v->s.mv_table_index = get_bits(gb, 2); |
| 1297 | 1297 | v->cbptab = get_bits(gb, 2); |
| 1298 | − v->cbpcy_vlc = &ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 1298 | + v->cbpcy_vlc = ff_vc1_cbpcy_p_vlc[v->cbptab]; | |
| 1299 | 1299 | } |
| 1300 | 1300 | |
| 1301 | 1301 | if (v->dquant) { |
| @@ -279,7 +279,7 @@ typedef struct VC1Context{ · 278 unmodified lines | ||
| 279 | 279 | */ |
| 280 | 280 | uint8_t mvrange; ///< Extended MV range flag |
| 281 | 281 | uint8_t pquantizer; ///< Uniform (over sequence) quantizer in use |
| 282 | − VLC *cbpcy_vlc; ///< CBPCY VLC table | |
| 282 | + const VLCElem *cbpcy_vlc; ///< CBPCY VLC table | |
| 283 | 283 | int tt_index; ///< Index for Transform Type tables (to decode TTMB) |
| 284 | 284 | uint8_t* mv_type_mb_plane; ///< bitplane for mv_type == (4MV) |
| 285 | 285 | uint8_t* direct_mb_plane; ///< bitplane for "direct" MBs |
| @@ -334,10 +334,10 @@ typedef struct VC1Context{ · 48 unmodified lines | ||
| 334 | 334 | int intcomp; |
| 335 | 335 | uint8_t lumscale2; ///< for interlaced field P picture |
| 336 | 336 | uint8_t lumshift2; |
| 337 | − VLC* mbmode_vlc; | |
| 338 | − VLC* imv_vlc; | |
| 339 | − VLC* twomvbp_vlc; | |
| 340 | − VLC* fourmvbp_vlc; | |
| 337 | + const VLCElem *mbmode_vlc; | |
| 338 | + const VLCElem *imv_vlc; | |
| 339 | + const VLCElem *twomvbp_vlc; | |
| 340 | + const VLCElem *fourmvbp_vlc; | |
| 341 | 341 | uint8_t twomvbp; |
| 342 | 342 | uint8_t fourmvbp; |
| 343 | 343 | uint8_t* fieldtx_plane; |
| @@ -227,7 +227,7 @@ static void vc1_put_blocks_clamped(VC1Context *v, int put_signed) · 226 unmodified lines | ||
| 227 | 227 | * @param _dmv_y Vertical differential for decoded MV |
| 228 | 228 | */ |
| 229 | 229 | #define GET_MVDATA(_dmv_x, _dmv_y) \ |
| 230 | − index = 1 + get_vlc2(gb, ff_vc1_mv_diff_vlc[s->mv_table_index].table, \ | |
| 230 | + index = 1 + get_vlc2(gb, ff_vc1_mv_diff_vlc[s->mv_table_index], \ | |
| 231 | 231 | VC1_MV_DIFF_VLC_BITS, 2); \ |
| 232 | 232 | if (index > 36) { \ |
| 233 | 233 | mb_has_coeffs = 1; \ |
| @@ -282,7 +282,7 @@ static av_always_inline void get_mvdata_interlaced(VC1Context *v, int *dmv_x, · 48 unmodified lines | ||
| 282 | 282 | } |
| 283 | 283 | extend_x = v->dmvrange & 1; |
| 284 | 284 | extend_y = (v->dmvrange >> 1) & 1; |
| 285 | − index = get_vlc2(gb, v->imv_vlc->table, bits, 3); | |
| 285 | + index = get_vlc2(gb, v->imv_vlc, bits, 3); | |
| 286 | 286 | if (index == esc) { |
| 287 | 287 | *dmv_x = get_bits(gb, v->k_x); |
| 288 | 288 | *dmv_y = get_bits(gb, v->k_y); |
| @@ -519,7 +519,7 @@ static int vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, · 230 unmodified lines | ||
| 519 | 519 | GetBitContext *gb = &v->s.gb; |
| 520 | 520 | int index, run, level, lst, sign; |
| 521 | 521 | |
| 522 | − index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3); | |
| 522 | + index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset], AC_VLC_BITS, 3); | |
| 523 | 523 | if (index < 0) |
| 524 | 524 | return index; |
| 525 | 525 | if (index != ff_vc1_ac_sizes[codingset] - 1) { |
| @@ -530,7 +530,7 @@ static int vc1_decode_ac_coeff(VC1Context *v, int *last, int *skip, · 4 unmodified lines | ||
| 530 | 530 | } else { |
| 531 | 531 | int escape = decode210(gb); |
| 532 | 532 | if (escape != 2) { |
| 533 | − index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset].table, AC_VLC_BITS, 3); | |
| 533 | + index = get_vlc2(gb, ff_vc1_ac_coeff_table[codingset], AC_VLC_BITS, 3); | |
| 534 | 534 | if (index >= ff_vc1_ac_sizes[codingset] - 1U) |
| 535 | 535 | return AVERROR_INVALIDDATA; |
| 536 | 536 | run = vc1_index_decode_table[codingset][index][0]; |
| @@ -1124,10 +1124,10 @@ static int vc1_decode_p_block(VC1Context *v, int16_t block[64], int n, · 587 unmodified lines | ||
| 1124 | 1124 | s->bdsp.clear_block(block); |
| 1125 | 1125 | |
| 1126 | 1126 | if (ttmb == -1) { |
| 1127 | − ttblk = ff_vc1_ttblk_to_tt[v->tt_index][get_vlc2(gb, ff_vc1_ttblk_vlc[v->tt_index].table, VC1_TTBLK_VLC_BITS, 1)]; | |
| 1127 | + ttblk = ff_vc1_ttblk_to_tt[v->tt_index][get_vlc2(gb, ff_vc1_ttblk_vlc[v->tt_index], VC1_TTBLK_VLC_BITS, 1)]; | |
| 1128 | 1128 | } |
| 1129 | 1129 | if (ttblk == TT_4X4) { |
| 1130 | − subblkpat = ~(get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index].table, VC1_SUBBLKPAT_VLC_BITS, 1) + 1); | |
| 1130 | + subblkpat = ~(get_vlc2(gb, ff_vc1_subblkpat_vlc[v->tt_index], VC1_SUBBLKPAT_VLC_BITS, 1) + 1); | |
| 1131 | 1131 | } |
| 1132 | 1132 | if ((ttblk != TT_8X8 && ttblk != TT_4X4) |
| 1133 | 1133 | && ((v->ttmbf || (ttmb != -1 && (ttmb & 8) && !first_block)) |
| @@ -1328,7 +1328,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 194 unmodified lines | ||
| 1328 | 1328 | } else if (mb_has_coeffs) { |
| 1329 | 1329 | if (s->mb_intra) |
| 1330 | 1330 | s->ac_pred = get_bits1(gb); |
| 1331 | − cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1331 | + cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1332 | 1332 | GET_MQUANT(); |
| 1333 | 1333 | } else { |
| 1334 | 1334 | mquant = v->pq; |
| @@ -1337,7 +1337,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 2 unmodified lines | ||
| 1337 | 1337 | s->current_picture.qscale_table[mb_pos] = mquant; |
| 1338 | 1338 | |
| 1339 | 1339 | if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) |
| 1340 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, | |
| 1340 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], | |
| 1341 | 1341 | VC1_TTMB_VLC_BITS, 2); |
| 1342 | 1342 | if (!s->mb_intra) ff_vc1_mc_1mv(v, 0); |
| 1343 | 1343 | dst_idx = 0; |
| @@ -1393,7 +1393,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 49 unmodified lines | ||
| 1393 | 1393 | int intra_count = 0, coded_inter = 0; |
| 1394 | 1394 | int is_intra[6], is_coded[6]; |
| 1395 | 1395 | /* Get CBPCY */ |
| 1396 | − cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1396 | + cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1397 | 1397 | for (i = 0; i < 6; i++) { |
| 1398 | 1398 | val = ((cbp >> (5 - i)) & 1); |
| 1399 | 1399 | s->dc_val[0][s->block_index[i]] = 0; |
| @@ -1445,7 +1445,7 @@ static int vc1_decode_p_mb(VC1Context *v) · 45 unmodified lines | ||
| 1445 | 1445 | s->ac_pred = 0; |
| 1446 | 1446 | } |
| 1447 | 1447 | if (!v->ttmbf && coded_inter) |
| 1448 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); | |
| 1448 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); | |
| 1449 | 1449 | for (i = 0; i < 6; i++) { |
| 1450 | 1450 | dst_idx += i >> 2; |
| 1451 | 1451 | off = (i & 4) ? 0 : ((i & 1) * 8 + (i & 2) * 4 * s->linesize); |
| @@ -1539,9 +1539,9 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 87 unmodified lines | ||
| 1539 | 1539 | skipped = v->s.mbskip_table[mb_pos]; |
| 1540 | 1540 | if (!skipped) { |
| 1541 | 1541 | if (v->fourmvswitch) |
| 1542 | − idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_4MV_MBMODE_VLC_BITS, 2); // try getting this done | |
| 1542 | + idx_mbmode = get_vlc2(gb, v->mbmode_vlc, VC1_INTFR_4MV_MBMODE_VLC_BITS, 2); // try getting this done | |
| 1543 | 1543 | else |
| 1544 | − idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); // in a single line | |
| 1544 | + idx_mbmode = get_vlc2(gb, v->mbmode_vlc, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); // in a single line | |
| 1545 | 1545 | switch (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0]) { |
| 1546 | 1546 | /* store the motion vector type in a flag (useful later) */ |
| 1547 | 1547 | case MV_PMODE_INTFR_4MV: |
| @@ -1583,7 +1583,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 35 unmodified lines | ||
| 1583 | 1583 | fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); |
| 1584 | 1584 | mb_has_coeffs = get_bits1(gb); |
| 1585 | 1585 | if (mb_has_coeffs) |
| 1586 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1586 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1587 | 1587 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 1588 | 1588 | GET_MQUANT(); |
| 1589 | 1589 | s->current_picture.qscale_table[mb_pos] = mquant; |
| @@ -1617,13 +1617,13 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 27 unmodified lines | ||
| 1617 | 1617 | } else { // inter MB |
| 1618 | 1618 | mb_has_coeffs = ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][3]; |
| 1619 | 1619 | if (mb_has_coeffs) |
| 1620 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1620 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1621 | 1621 | if (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_2MV_FIELD) { |
| 1622 | − v->twomvbp = get_vlc2(gb, v->twomvbp_vlc->table, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 1622 | + v->twomvbp = get_vlc2(gb, v->twomvbp_vlc, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 1623 | 1623 | } else { |
| 1624 | 1624 | if ((ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_4MV) |
| 1625 | 1625 | || (ff_vc1_mbmode_intfrp[v->fourmvswitch][idx_mbmode][0] == MV_PMODE_INTFR_4MV_FIELD)) { |
| 1626 | − v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 1626 | + v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 1627 | 1627 | } |
| 1628 | 1628 | } |
| 1629 | 1629 | s->mb_intra = v->is_intra[s->mb_x] = 0; |
| @@ -1672,7 +1672,7 @@ static int vc1_decode_p_mb_intfr(VC1Context *v) · 42 unmodified lines | ||
| 1672 | 1672 | GET_MQUANT(); // p. 227 |
| 1673 | 1673 | s->current_picture.qscale_table[mb_pos] = mquant; |
| 1674 | 1674 | if (!v->ttmbf && cbp) |
| 1675 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); | |
| 1675 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); | |
| 1676 | 1676 | for (i = 0; i < 6; i++) { |
| 1677 | 1677 | s->dc_val[0][s->block_index[i]] = 0; |
| 1678 | 1678 | dst_idx += i >> 2; |
| @@ -1742,7 +1742,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 63 unmodified lines | ||
| 1742 | 1742 | |
| 1743 | 1743 | mquant = v->pq; /* Lossy initialization */ |
| 1744 | 1744 | |
| 1745 | − idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2); | |
| 1745 | + idx_mbmode = get_vlc2(gb, v->mbmode_vlc, VC1_IF_MBMODE_VLC_BITS, 2); | |
| 1746 | 1746 | if (idx_mbmode <= 1) { // intra MB |
| 1747 | 1747 | v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. |
| 1748 | 1748 | s->mb_intra = 1; |
| @@ -1757,7 +1757,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 8 unmodified lines | ||
| 1757 | 1757 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 1758 | 1758 | mb_has_coeffs = idx_mbmode & 1; |
| 1759 | 1759 | if (mb_has_coeffs) |
| 1760 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2); | |
| 1760 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_ICBPCY_VLC_BITS, 2); | |
| 1761 | 1761 | dst_idx = 0; |
| 1762 | 1762 | for (i = 0; i < 6; i++) { |
| 1763 | 1763 | v->a_avail = v->c_avail = 0; |
| @@ -1792,7 +1792,7 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 28 unmodified lines | ||
| 1792 | 1792 | ff_vc1_mc_1mv(v, 0); |
| 1793 | 1793 | mb_has_coeffs = !(idx_mbmode & 2); |
| 1794 | 1794 | } else { // 4-MV |
| 1795 | − v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 1795 | + v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 1796 | 1796 | for (i = 0; i < 4; i++) { |
| 1797 | 1797 | dmv_x = dmv_y = pred_flag = 0; |
| 1798 | 1798 | if (v->fourmvbp & (8 >> i)) |
| @@ -1804,13 +1804,13 @@ static int vc1_decode_p_mb_intfi(VC1Context *v) · 5 unmodified lines | ||
| 1804 | 1804 | mb_has_coeffs = idx_mbmode & 1; |
| 1805 | 1805 | } |
| 1806 | 1806 | if (mb_has_coeffs) |
| 1807 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1807 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1808 | 1808 | if (cbp) { |
| 1809 | 1809 | GET_MQUANT(); |
| 1810 | 1810 | } |
| 1811 | 1811 | s->current_picture.qscale_table[mb_pos] = mquant; |
| 1812 | 1812 | if (!v->ttmbf && cbp) { |
| 1813 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); | |
| 1813 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); | |
| 1814 | 1814 | } |
| 1815 | 1815 | dst_idx = 0; |
| 1816 | 1816 | for (i = 0; i < 6; i++) { |
| @@ -1914,12 +1914,12 @@ static int vc1_decode_b_mb(VC1Context *v) · 97 unmodified lines | ||
| 1914 | 1914 | return 0; |
| 1915 | 1915 | } |
| 1916 | 1916 | if (direct) { |
| 1917 | − cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1917 | + cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1918 | 1918 | GET_MQUANT(); |
| 1919 | 1919 | s->mb_intra = 0; |
| 1920 | 1920 | s->current_picture.qscale_table[mb_pos] = mquant; |
| 1921 | 1921 | if (!v->ttmbf) |
| 1922 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); | |
| 1922 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); | |
| 1923 | 1923 | dmv_x[0] = dmv_y[0] = dmv_x[1] = dmv_y[1] = 0; |
| 1924 | 1924 | ff_vc1_pred_b_mv(v, dmv_x, dmv_y, direct, bmvtype); |
| 1925 | 1925 | vc1_b_mc(v, dmv_x, dmv_y, direct, bmvtype); |
| @@ -1952,11 +1952,11 @@ static int vc1_decode_b_mb(VC1Context *v) · 26 unmodified lines | ||
| 1952 | 1952 | } |
| 1953 | 1953 | if (s->mb_intra) |
| 1954 | 1954 | s->ac_pred = get_bits1(gb); |
| 1955 | − cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1955 | + cbp = get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 1956 | 1956 | GET_MQUANT(); |
| 1957 | 1957 | s->current_picture.qscale_table[mb_pos] = mquant; |
| 1958 | 1958 | if (!v->ttmbf && !s->mb_intra && mb_has_coeffs) |
| 1959 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); | |
| 1959 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); | |
| 1960 | 1960 | } |
| 1961 | 1961 | } |
| 1962 | 1962 | dst_idx = 0; |
| @@ -2025,7 +2025,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 62 unmodified lines | ||
| 2025 | 2025 | mquant = v->pq; /* Lossy initialization */ |
| 2026 | 2026 | s->mb_intra = 0; |
| 2027 | 2027 | |
| 2028 | − idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_IF_MBMODE_VLC_BITS, 2); | |
| 2028 | + idx_mbmode = get_vlc2(gb, v->mbmode_vlc, VC1_IF_MBMODE_VLC_BITS, 2); | |
| 2029 | 2029 | if (idx_mbmode <= 1) { // intra MB |
| 2030 | 2030 | v->is_intra[s->mb_x] = 0x3f; // Set the bitfield to all 1. |
| 2031 | 2031 | s->mb_intra = 1; |
| @@ -2040,7 +2040,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 8 unmodified lines | ||
| 2040 | 2040 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 2041 | 2041 | mb_has_coeffs = idx_mbmode & 1; |
| 2042 | 2042 | if (mb_has_coeffs) |
| 2043 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_ICBPCY_VLC_BITS, 2); | |
| 2043 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_ICBPCY_VLC_BITS, 2); | |
| 2044 | 2044 | dst_idx = 0; |
| 2045 | 2045 | for (i = 0; i < 6; i++) { |
| 2046 | 2046 | v->a_avail = v->c_avail = 0; |
| @@ -2118,7 +2118,7 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 71 unmodified lines | ||
| 2118 | 2118 | if (fwd) |
| 2119 | 2119 | bmvtype = BMV_TYPE_FORWARD; |
| 2120 | 2120 | v->bmvtype = bmvtype; |
| 2121 | − v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 2121 | + v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 2122 | 2122 | for (i = 0; i < 4; i++) { |
| 2123 | 2123 | dmv_x[0] = dmv_y[0] = pred_flag[0] = 0; |
| 2124 | 2124 | dmv_x[1] = dmv_y[1] = pred_flag[1] = 0; |
| @@ -2134,13 +2134,13 @@ static int vc1_decode_b_mb_intfi(VC1Context *v) · 9 unmodified lines | ||
| 2134 | 2134 | mb_has_coeffs = idx_mbmode & 1; |
| 2135 | 2135 | } |
| 2136 | 2136 | if (mb_has_coeffs) |
| 2137 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 2137 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 2138 | 2138 | if (cbp) { |
| 2139 | 2139 | GET_MQUANT(); |
| 2140 | 2140 | } |
| 2141 | 2141 | s->current_picture.qscale_table[mb_pos] = mquant; |
| 2142 | 2142 | if (!v->ttmbf && cbp) { |
| 2143 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); | |
| 2143 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); | |
| 2144 | 2144 | } |
| 2145 | 2145 | dst_idx = 0; |
| 2146 | 2146 | for (i = 0; i < 6; i++) { |
| @@ -2200,7 +2200,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 53 unmodified lines | ||
| 2200 | 2200 | skipped = v->s.mbskip_table[mb_pos]; |
| 2201 | 2201 | |
| 2202 | 2202 | if (!skipped) { |
| 2203 | − idx_mbmode = get_vlc2(gb, v->mbmode_vlc->table, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); | |
| 2203 | + idx_mbmode = get_vlc2(gb, v->mbmode_vlc, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 2); | |
| 2204 | 2204 | if (ff_vc1_mbmode_intfrp[0][idx_mbmode][0] == MV_PMODE_INTFR_2MV_FIELD) { |
| 2205 | 2205 | twomv = 1; |
| 2206 | 2206 | v->blk_mv_type[s->block_index[0]] = 1; |
| @@ -2228,7 +2228,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 21 unmodified lines | ||
| 2228 | 2228 | fieldtx = v->fieldtx_plane[mb_pos] = get_bits1(gb); |
| 2229 | 2229 | mb_has_coeffs = get_bits1(gb); |
| 2230 | 2230 | if (mb_has_coeffs) |
| 2231 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 2231 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 2232 | 2232 | v->s.ac_pred = v->acpred_plane[mb_pos] = get_bits1(gb); |
| 2233 | 2233 | GET_MQUANT(); |
| 2234 | 2234 | s->current_picture.qscale_table[mb_pos] = mquant; |
| @@ -2323,12 +2323,12 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 88 unmodified lines | ||
| 2323 | 2323 | if (!skipped) { // inter MB |
| 2324 | 2324 | mb_has_coeffs = ff_vc1_mbmode_intfrp[0][idx_mbmode][3]; |
| 2325 | 2325 | if (mb_has_coeffs) |
| 2326 | − cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc->table, VC1_CBPCY_P_VLC_BITS, 2); | |
| 2326 | + cbp = 1 + get_vlc2(&v->s.gb, v->cbpcy_vlc, VC1_CBPCY_P_VLC_BITS, 2); | |
| 2327 | 2327 | if (!direct) { |
| 2328 | 2328 | if (bmvtype == BMV_TYPE_INTERPOLATED && twomv) { |
| 2329 | − v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc->table, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 2329 | + v->fourmvbp = get_vlc2(gb, v->fourmvbp_vlc, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 2330 | 2330 | } else if (bmvtype == BMV_TYPE_INTERPOLATED || twomv) { |
| 2331 | − v->twomvbp = get_vlc2(gb, v->twomvbp_vlc->table, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 2331 | + v->twomvbp = get_vlc2(gb, v->twomvbp_vlc, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 1); | |
| 2332 | 2332 | } |
| 2333 | 2333 | } |
| 2334 | 2334 | |
| @@ -2438,7 +2438,7 @@ static int vc1_decode_b_mb_intfr(VC1Context *v) · 103 unmodified lines | ||
| 2438 | 2438 | GET_MQUANT(); // p. 227 |
| 2439 | 2439 | s->current_picture.qscale_table[mb_pos] = mquant; |
| 2440 | 2440 | if (!v->ttmbf && cbp) |
| 2441 | − ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index].table, VC1_TTMB_VLC_BITS, 2); | |
| 2441 | + ttmb = get_vlc2(gb, ff_vc1_ttmb_vlc[v->tt_index], VC1_TTMB_VLC_BITS, 2); | |
| 2442 | 2442 | for (i = 0; i < 6; i++) { |
| 2443 | 2443 | s->dc_val[0][s->block_index[i]] = 0; |
| 2444 | 2444 | dst_idx += i >> 2; |
| @@ -102,26 +102,26 @@ const uint8_t ff_vc1_pquant_table[3][32] = { · 101 unmodified lines | ||
| 102 | 102 | * @todo TODO move this into the context |
| 103 | 103 | */ |
| 104 | 104 | //@{ |
| 105 | −VLC ff_vc1_imode_vlc; | |
| 106 | −VLC ff_vc1_norm2_vlc; | |
| 107 | −VLC ff_vc1_norm6_vlc; | |
| 105 | +VLCElem ff_vc1_imode_vlc[1 << VC1_IMODE_VLC_BITS]; | |
| 106 | +VLCElem ff_vc1_norm2_vlc[1 << VC1_NORM2_VLC_BITS]; | |
| 107 | +VLCElem ff_vc1_norm6_vlc[556]; | |
| 108 | 108 | /* Could be optimized, one table only needs 8 bits */ |
| 109 | −VLC ff_vc1_ttmb_vlc[3]; | |
| 110 | −VLC ff_vc1_mv_diff_vlc[4]; | |
| 111 | −VLC ff_vc1_cbpcy_p_vlc[4]; | |
| 112 | −VLC ff_vc1_icbpcy_vlc[8]; | |
| 113 | −VLC ff_vc1_4mv_block_pattern_vlc[4]; | |
| 114 | −VLC ff_vc1_2mv_block_pattern_vlc[4]; | |
| 115 | −VLC ff_vc1_ttblk_vlc[3]; | |
| 116 | −VLC ff_vc1_subblkpat_vlc[3]; | |
| 117 | −VLC ff_vc1_intfr_4mv_mbmode_vlc[4]; | |
| 118 | −VLC ff_vc1_intfr_non4mv_mbmode_vlc[4]; | |
| 119 | −VLC ff_vc1_if_mmv_mbmode_vlc[8]; | |
| 120 | −VLC ff_vc1_if_1mv_mbmode_vlc[8]; | |
| 121 | −VLC ff_vc1_1ref_mvdata_vlc[4]; | |
| 122 | −VLC ff_vc1_2ref_mvdata_vlc[8]; | |
| 109 | +const VLCElem *ff_vc1_ttmb_vlc[3]; | |
| 110 | +const VLCElem *ff_vc1_mv_diff_vlc[4]; | |
| 111 | +const VLCElem *ff_vc1_cbpcy_p_vlc[4]; | |
| 112 | +const VLCElem *ff_vc1_icbpcy_vlc[8]; | |
| 113 | +const VLCElem *ff_vc1_4mv_block_pattern_vlc[4]; | |
| 114 | +const VLCElem *ff_vc1_2mv_block_pattern_vlc[4]; | |
| 115 | +const VLCElem *ff_vc1_ttblk_vlc[3]; | |
| 116 | +const VLCElem *ff_vc1_subblkpat_vlc[3]; | |
| 117 | +const VLCElem *ff_vc1_intfr_4mv_mbmode_vlc[4]; | |
| 118 | +const VLCElem *ff_vc1_intfr_non4mv_mbmode_vlc[4]; | |
| 119 | +const VLCElem *ff_vc1_if_mmv_mbmode_vlc[8]; | |
| 120 | +const VLCElem *ff_vc1_if_1mv_mbmode_vlc[8]; | |
| 121 | +const VLCElem *ff_vc1_1ref_mvdata_vlc[4]; | |
| 122 | +const VLCElem *ff_vc1_2ref_mvdata_vlc[8]; | |
| 123 | 123 | |
| 124 | −VLC ff_vc1_ac_coeff_table[8]; | |
| 124 | +const VLCElem *ff_vc1_ac_coeff_table[8]; | |
| 125 | 125 | |
| 126 | 126 | //@} |
| 127 | 127 | |
| @@ -56,42 +56,42 @@ extern const uint8_t ff_vc1_mbmode_intfrp[2][15][4]; · 55 unmodified lines | ||
| 56 | 56 | */ |
| 57 | 57 | //@{ |
| 58 | 58 | #define VC1_IMODE_VLC_BITS 4 |
| 59 | −extern VLC ff_vc1_imode_vlc; | |
| 59 | +extern VLCElem ff_vc1_imode_vlc[1 << VC1_IMODE_VLC_BITS]; | |
| 60 | 60 | #define VC1_NORM2_VLC_BITS 3 |
| 61 | −extern VLC ff_vc1_norm2_vlc; | |
| 61 | +extern VLCElem ff_vc1_norm2_vlc[1 << VC1_NORM2_VLC_BITS]; | |
| 62 | 62 | #define VC1_NORM6_VLC_BITS 9 |
| 63 | −extern VLC ff_vc1_norm6_vlc; | |
| 63 | +extern VLCElem ff_vc1_norm6_vlc[556]; | |
| 64 | 64 | /* Could be optimized, one table only needs 8 bits */ |
| 65 | 65 | #define VC1_TTMB_VLC_BITS 9 //12 |
| 66 | −extern VLC ff_vc1_ttmb_vlc[3]; | |
| 66 | +extern const VLCElem *ff_vc1_ttmb_vlc[3]; | |
| 67 | 67 | #define VC1_MV_DIFF_VLC_BITS 9 //15 |
| 68 | −extern VLC ff_vc1_mv_diff_vlc[4]; | |
| 68 | +extern const VLCElem *ff_vc1_mv_diff_vlc[4]; | |
| 69 | 69 | #define VC1_CBPCY_P_VLC_BITS 9 //14 |
| 70 | −extern VLC ff_vc1_cbpcy_p_vlc[4]; | |
| 70 | +extern const VLCElem *ff_vc1_cbpcy_p_vlc[4]; | |
| 71 | 71 | #define VC1_ICBPCY_VLC_BITS 9 |
| 72 | −extern VLC ff_vc1_icbpcy_vlc[8]; | |
| 72 | +extern const VLCElem *ff_vc1_icbpcy_vlc[8]; | |
| 73 | 73 | #define VC1_4MV_BLOCK_PATTERN_VLC_BITS 6 |
| 74 | −extern VLC ff_vc1_4mv_block_pattern_vlc[4]; | |
| 74 | +extern const VLCElem *ff_vc1_4mv_block_pattern_vlc[4]; | |
| 75 | 75 | #define VC1_2MV_BLOCK_PATTERN_VLC_BITS 3 |
| 76 | −extern VLC ff_vc1_2mv_block_pattern_vlc[4]; | |
| 76 | +extern const VLCElem *ff_vc1_2mv_block_pattern_vlc[4]; | |
| 77 | 77 | #define VC1_TTBLK_VLC_BITS 5 |
| 78 | −extern VLC ff_vc1_ttblk_vlc[3]; | |
| 78 | +extern const VLCElem *ff_vc1_ttblk_vlc[3]; | |
| 79 | 79 | #define VC1_SUBBLKPAT_VLC_BITS 6 |
| 80 | −extern VLC ff_vc1_subblkpat_vlc[3]; | |
| 80 | +extern const VLCElem *ff_vc1_subblkpat_vlc[3]; | |
| 81 | 81 | #define VC1_INTFR_4MV_MBMODE_VLC_BITS 9 |
| 82 | −extern VLC ff_vc1_intfr_4mv_mbmode_vlc[4]; | |
| 82 | +extern const VLCElem *ff_vc1_intfr_4mv_mbmode_vlc[4]; | |
| 83 | 83 | #define VC1_INTFR_NON4MV_MBMODE_VLC_BITS 6 |
| 84 | −extern VLC ff_vc1_intfr_non4mv_mbmode_vlc[4]; | |
| 84 | +extern const VLCElem *ff_vc1_intfr_non4mv_mbmode_vlc[4]; | |
| 85 | 85 | #define VC1_IF_MMV_MBMODE_VLC_BITS 5 |
| 86 | −extern VLC ff_vc1_if_mmv_mbmode_vlc[8]; | |
| 86 | +extern const VLCElem *ff_vc1_if_mmv_mbmode_vlc[8]; | |
| 87 | 87 | #define VC1_IF_1MV_MBMODE_VLC_BITS 5 |
| 88 | −extern VLC ff_vc1_if_1mv_mbmode_vlc[8]; | |
| 88 | +extern const VLCElem *ff_vc1_if_1mv_mbmode_vlc[8]; | |
| 89 | 89 | #define VC1_1REF_MVDATA_VLC_BITS 9 |
| 90 | −extern VLC ff_vc1_1ref_mvdata_vlc[4]; | |
| 90 | +extern const VLCElem *ff_vc1_1ref_mvdata_vlc[4]; | |
| 91 | 91 | #define VC1_2REF_MVDATA_VLC_BITS 9 |
| 92 | −extern VLC ff_vc1_2ref_mvdata_vlc[8]; | |
| 92 | +extern const VLCElem *ff_vc1_2ref_mvdata_vlc[8]; | |
| 93 | 93 | |
| 94 | −extern VLC ff_vc1_ac_coeff_table[8]; | |
| 94 | +extern const VLCElem *ff_vc1_ac_coeff_table[8]; | |
| 95 | 95 | |
| 96 | 96 | #define VC1_IF_MBMODE_VLC_BITS 5 // as a placeholder for VC1_IF_MMV_MBMODE_VLC_BITS |
| 97 | 97 | // or VC1_IF_1MV_MBMODE_VLC_BITS since they are the same |
| @@ -469,122 +469,92 @@ av_cold void ff_vc1_init_transposed_scantables(VC1Context *v) · 468 unmodified lines | ||
| 469 | 469 | v->top_blk_sh = 3; |
| 470 | 470 | } |
| 471 | 471 | |
| 472 | −static const uint16_t vlc_offs[] = { | |
| 473 | − 0, 520, 552, 616, 1128, 1160, 1224, 1740, 1772, 1836, 1900, 2436, | |
| 474 | − 2986, 3050, 3610, 4154, 4218, 4746, 5326, 5390, 5902, 6554, 7658, 8342, | |
| 475 | − 9304, 9988, 10630, 11234, 12174, 13006, 13560, 14232, 14786, 15432, 16350, 17522, | |
| 476 | − 20372, 21818, 22330, 22394, 23166, 23678, 23742, 24820, 25332, 25396, 26460, 26980, | |
| 477 | − 27048, 27592, 27600, 27608, 27616, 27624, 28224, 28258, 28290, 28802, 28834, 28866, | |
| 478 | − 29378, 29412, 29444, 29960, 29994, 30026, 30538, 30572, 30604, 31120, 31154, 31186, | |
| 479 | − 31714, 31746, 31778, 32306, 32340, 32372 | |
| 480 | −}; | |
| 481 | − | |
| 482 | 472 | static av_cold void vc1_init_static(void) |
| 483 | 473 | { |
| 484 | 474 | static VLCElem vlc_table[32372]; |
| 485 | − | |
| 486 | − VLC_INIT_STATIC(&ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, | |
| 487 | − vc1_norm2_bits, 1, 1, | |
| 488 | − vc1_norm2_codes, 1, 1, 1 << VC1_NORM2_VLC_BITS); | |
| 489 | − VLC_INIT_STATIC(&ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, | |
| 490 | − vc1_norm6_bits, 1, 1, | |
| 491 | − vc1_norm6_codes, 2, 2, 556); | |
| 492 | − VLC_INIT_STATIC(&ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, | |
| 493 | − vc1_imode_bits, 1, 1, | |
| 494 | − vc1_imode_codes, 1, 1, 1 << VC1_IMODE_VLC_BITS); | |
| 475 | + VLCInitState state = VLC_INIT_STATE(vlc_table); | |
| 476 | + | |
| 477 | + VLC_INIT_STATIC_TABLE(ff_vc1_norm2_vlc, VC1_NORM2_VLC_BITS, 4, | |
| 478 | + vc1_norm2_bits, 1, 1, | |
| 479 | + vc1_norm2_codes, 1, 1, 0); | |
| 480 | + VLC_INIT_STATIC_TABLE(ff_vc1_norm6_vlc, VC1_NORM6_VLC_BITS, 64, | |
| 481 | + vc1_norm6_bits, 1, 1, | |
| 482 | + vc1_norm6_codes, 2, 2, 0); | |
| 483 | + VLC_INIT_STATIC_TABLE(ff_vc1_imode_vlc, VC1_IMODE_VLC_BITS, 7, | |
| 484 | + vc1_imode_bits, 1, 1, | |
| 485 | + vc1_imode_codes, 1, 1, 0); | |
| 495 | 486 | for (int i = 0; i < 3; i++) { |
| 496 | − ff_vc1_ttmb_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 0]]; | |
| 497 | − ff_vc1_ttmb_vlc[i].table_allocated = vlc_offs[i * 3 + 1] - vlc_offs[i * 3 + 0]; | |
| 498 | − vlc_init(&ff_vc1_ttmb_vlc[i], VC1_TTMB_VLC_BITS, 16, | |
| 499 | − vc1_ttmb_bits[i], 1, 1, | |
| 500 | − vc1_ttmb_codes[i], 2, 2, VLC_INIT_USE_STATIC); | |
| 501 | − ff_vc1_ttblk_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 1]]; | |
| 502 | − ff_vc1_ttblk_vlc[i].table_allocated = vlc_offs[i * 3 + 2] - vlc_offs[i * 3 + 1]; | |
| 503 | − vlc_init(&ff_vc1_ttblk_vlc[i], VC1_TTBLK_VLC_BITS, 8, | |
| 504 | − vc1_ttblk_bits[i], 1, 1, | |
| 505 | − vc1_ttblk_codes[i], 1, 1, VLC_INIT_USE_STATIC); | |
| 506 | − ff_vc1_subblkpat_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 2]]; | |
| 507 | − ff_vc1_subblkpat_vlc[i].table_allocated = vlc_offs[i * 3 + 3] - vlc_offs[i * 3 + 2]; | |
| 508 | − vlc_init(&ff_vc1_subblkpat_vlc[i], VC1_SUBBLKPAT_VLC_BITS, 15, | |
| 509 | − vc1_subblkpat_bits[i], 1, 1, | |
| 510 | − vc1_subblkpat_codes[i], 1, 1, VLC_INIT_USE_STATIC); | |
| 511 | − } | |
| 512 | − for (int i = 0; i < 4; i++) { | |
| 513 | − ff_vc1_4mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 9]]; | |
| 514 | − ff_vc1_4mv_block_pattern_vlc[i].table_allocated = vlc_offs[i * 3 + 10] - vlc_offs[i * 3 + 9]; | |
| 515 | − vlc_init(&ff_vc1_4mv_block_pattern_vlc[i], VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, | |
| 516 | − vc1_4mv_block_pattern_bits[i], 1, 1, | |
| 517 | − vc1_4mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); | |
| 518 | − ff_vc1_cbpcy_p_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 10]]; | |
| 519 | − ff_vc1_cbpcy_p_vlc[i].table_allocated = vlc_offs[i * 3 + 11] - vlc_offs[i * 3 + 10]; | |
| 520 | − vlc_init(&ff_vc1_cbpcy_p_vlc[i], VC1_CBPCY_P_VLC_BITS, 64, | |
| 521 | − vc1_cbpcy_p_bits[i], 1, 1, | |
| 522 | − vc1_cbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); | |
| 523 | − ff_vc1_mv_diff_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 11]]; | |
| 524 | − ff_vc1_mv_diff_vlc[i].table_allocated = vlc_offs[i * 3 + 12] - vlc_offs[i * 3 + 11]; | |
| 525 | − vlc_init(&ff_vc1_mv_diff_vlc[i], VC1_MV_DIFF_VLC_BITS, 73, | |
| 526 | − vc1_mv_diff_bits[i], 1, 1, | |
| 527 | − vc1_mv_diff_codes[i], 2, 2, VLC_INIT_USE_STATIC); | |
| 528 | − } | |
| 529 | − for (int i = 0; i < 8; i++) { | |
| 530 | − ff_vc1_ac_coeff_table[i].table = &vlc_table[vlc_offs[i * 2 + 21]]; | |
| 531 | − ff_vc1_ac_coeff_table[i].table_allocated = vlc_offs[i * 2 + 22] - vlc_offs[i * 2 + 21]; | |
| 532 | − vlc_init(&ff_vc1_ac_coeff_table[i], AC_VLC_BITS, ff_vc1_ac_sizes[i], | |
| 533 | − &vc1_ac_tables[i][0][1], 8, 4, | |
| 534 | − &vc1_ac_tables[i][0][0], 8, 4, VLC_INIT_USE_STATIC); | |
| 535 | − /* initialize interlaced MVDATA tables (2-Ref) */ | |
| 536 | − ff_vc1_2ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 2 + 22]]; | |
| 537 | − ff_vc1_2ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 2 + 23] - vlc_offs[i * 2 + 22]; | |
| 538 | − vlc_init(&ff_vc1_2ref_mvdata_vlc[i], VC1_2REF_MVDATA_VLC_BITS, 126, | |
| 539 | − vc1_2ref_mvdata_bits[i], 1, 1, | |
| 540 | − vc1_2ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); | |
| 487 | + ff_vc1_ttmb_vlc[i] = | |
| 488 | + ff_vlc_init_tables(&state, VC1_TTMB_VLC_BITS, 16, | |
| 489 | + vc1_ttmb_bits[i], 1, 1, | |
| 490 | + vc1_ttmb_codes[i], 2, 2, 0); | |
| 491 | + ff_vc1_ttblk_vlc[i] = | |
| 492 | + ff_vlc_init_tables(&state, VC1_TTBLK_VLC_BITS, 8, | |
| 493 | + vc1_ttblk_bits[i], 1, 1, | |
| 494 | + vc1_ttblk_codes[i], 1, 1, 0); | |
| 495 | + ff_vc1_subblkpat_vlc[i] = | |
| 496 | + ff_vlc_init_tables(&state, VC1_SUBBLKPAT_VLC_BITS, 15, | |
| 497 | + vc1_subblkpat_bits[i], 1, 1, | |
| 498 | + vc1_subblkpat_codes[i], 1, 1, 0); | |
| 541 | 499 | } |
| 542 | 500 | for (int i = 0; i < 4; i++) { |
| 501 | + ff_vc1_4mv_block_pattern_vlc[i] = | |
| 502 | + ff_vlc_init_tables(&state, VC1_4MV_BLOCK_PATTERN_VLC_BITS, 16, | |
| 503 | + vc1_4mv_block_pattern_bits[i], 1, 1, | |
| 504 | + vc1_4mv_block_pattern_codes[i], 1, 1, 0); | |
| 505 | + ff_vc1_cbpcy_p_vlc[i] = | |
| 506 | + ff_vlc_init_tables(&state, VC1_CBPCY_P_VLC_BITS, 64, | |
| 507 | + vc1_cbpcy_p_bits[i], 1, 1, | |
| 508 | + vc1_cbpcy_p_codes[i], 2, 2, 0); | |
| 509 | + ff_vc1_mv_diff_vlc[i] = | |
| 510 | + ff_vlc_init_tables(&state, VC1_MV_DIFF_VLC_BITS, 73, | |
| 511 | + vc1_mv_diff_bits[i], 1, 1, | |
| 512 | + vc1_mv_diff_codes[i], 2, 2, 0); | |
| 543 | 513 | /* initialize 4MV MBMODE VLC tables for interlaced frame P picture */ |
| 544 | − ff_vc1_intfr_4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 37]]; | |
| 545 | − ff_vc1_intfr_4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 38] - vlc_offs[i * 3 + 37]; | |
| 546 | − vlc_init(&ff_vc1_intfr_4mv_mbmode_vlc[i], VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, | |
| 547 | − vc1_intfr_4mv_mbmode_bits[i], 1, 1, | |
| 548 | − vc1_intfr_4mv_mbmode_codes[i], 2, 2, VLC_INIT_USE_STATIC); | |
| 514 | + ff_vc1_intfr_4mv_mbmode_vlc[i] = | |
| 515 | + ff_vlc_init_tables(&state, VC1_INTFR_4MV_MBMODE_VLC_BITS, 15, | |
| 516 | + vc1_intfr_4mv_mbmode_bits[i], 1, 1, | |
| 517 | + vc1_intfr_4mv_mbmode_codes[i], 2, 2, 0); | |
| 549 | 518 | /* initialize NON-4MV MBMODE VLC tables for the same */ |
| 550 | − ff_vc1_intfr_non4mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 38]]; | |
| 551 | − ff_vc1_intfr_non4mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 39] - vlc_offs[i * 3 + 38]; | |
| 552 | − vlc_init(&ff_vc1_intfr_non4mv_mbmode_vlc[i], VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, | |
| 553 | − vc1_intfr_non4mv_mbmode_bits[i], 1, 1, | |
| 554 | − vc1_intfr_non4mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); | |
| 519 | + ff_vc1_intfr_non4mv_mbmode_vlc[i] = | |
| 520 | + ff_vlc_init_tables(&state, VC1_INTFR_NON4MV_MBMODE_VLC_BITS, 9, | |
| 521 | + vc1_intfr_non4mv_mbmode_bits[i], 1, 1, | |
| 522 | + vc1_intfr_non4mv_mbmode_codes[i], 1, 1, 0); | |
| 555 | 523 | /* initialize interlaced MVDATA tables (1-Ref) */ |
| 556 | − ff_vc1_1ref_mvdata_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 39]]; | |
| 557 | − ff_vc1_1ref_mvdata_vlc[i].table_allocated = vlc_offs[i * 3 + 40] - vlc_offs[i * 3 + 39]; | |
| 558 | − vlc_init(&ff_vc1_1ref_mvdata_vlc[i], VC1_1REF_MVDATA_VLC_BITS, 72, | |
| 559 | − vc1_1ref_mvdata_bits[i], 1, 1, | |
| 560 | − vc1_1ref_mvdata_codes[i], 4, 4, VLC_INIT_USE_STATIC); | |
| 561 | − } | |
| 562 | − for (int i = 0; i < 4; i++) { | |
| 524 | + ff_vc1_1ref_mvdata_vlc[i] = | |
| 525 | + ff_vlc_init_tables(&state, VC1_1REF_MVDATA_VLC_BITS, 72, | |
| 526 | + vc1_1ref_mvdata_bits[i], 1, 1, | |
| 527 | + vc1_1ref_mvdata_codes[i], 4, 4, 0); | |
| 563 | 528 | /* Initialize 2MV Block pattern VLC tables */ |
| 564 | − ff_vc1_2mv_block_pattern_vlc[i].table = &vlc_table[vlc_offs[i + 49]]; | |
| 565 | − ff_vc1_2mv_block_pattern_vlc[i].table_allocated = vlc_offs[i + 50] - vlc_offs[i + 49]; | |
| 566 | − vlc_init(&ff_vc1_2mv_block_pattern_vlc[i], VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, | |
| 567 | − vc1_2mv_block_pattern_bits[i], 1, 1, | |
| 568 | − vc1_2mv_block_pattern_codes[i], 1, 1, VLC_INIT_USE_STATIC); | |
| 529 | + ff_vc1_2mv_block_pattern_vlc[i] = | |
| 530 | + ff_vlc_init_tables(&state, VC1_2MV_BLOCK_PATTERN_VLC_BITS, 4, | |
| 531 | + vc1_2mv_block_pattern_bits[i], 1, 1, | |
| 532 | + vc1_2mv_block_pattern_codes[i], 1, 1, 0); | |
| 569 | 533 | } |
| 570 | 534 | for (int i = 0; i < 8; i++) { |
| 535 | + ff_vc1_ac_coeff_table[i] = | |
| 536 | + ff_vlc_init_tables(&state, AC_VLC_BITS, ff_vc1_ac_sizes[i], | |
| 537 | + &vc1_ac_tables[i][0][1], 8, 4, | |
| 538 | + &vc1_ac_tables[i][0][0], 8, 4, 0); | |
| 539 | + /* initialize interlaced MVDATA tables (2-Ref) */ | |
| 540 | + ff_vc1_2ref_mvdata_vlc[i] = | |
| 541 | + ff_vlc_init_tables(&state, VC1_2REF_MVDATA_VLC_BITS, 126, | |
| 542 | + vc1_2ref_mvdata_bits[i], 1, 1, | |
| 543 | + vc1_2ref_mvdata_codes[i], 4, 4, 0); | |
| 571 | 544 | /* Initialize interlaced CBPCY VLC tables (Table 124 - Table 131) */ |
| 572 | − ff_vc1_icbpcy_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 53]]; | |
| 573 | − ff_vc1_icbpcy_vlc[i].table_allocated = vlc_offs[i * 3 + 54] - vlc_offs[i * 3 + 53]; | |
| 574 | − vlc_init(&ff_vc1_icbpcy_vlc[i], VC1_ICBPCY_VLC_BITS, 63, | |
| 575 | − vc1_icbpcy_p_bits[i], 1, 1, | |
| 576 | − vc1_icbpcy_p_codes[i], 2, 2, VLC_INIT_USE_STATIC); | |
| 545 | + ff_vc1_icbpcy_vlc[i] = | |
| 546 | + ff_vlc_init_tables(&state, VC1_ICBPCY_VLC_BITS, 63, | |
| 547 | + vc1_icbpcy_p_bits[i], 1, 1, | |
| 548 | + vc1_icbpcy_p_codes[i], 2, 2, 0); | |
| 577 | 549 | /* Initialize interlaced field picture MBMODE VLC tables */ |
| 578 | − ff_vc1_if_mmv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 54]]; | |
| 579 | − ff_vc1_if_mmv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 55] - vlc_offs[i * 3 + 54]; | |
| 580 | − vlc_init(&ff_vc1_if_mmv_mbmode_vlc[i], VC1_IF_MMV_MBMODE_VLC_BITS, 8, | |
| 581 | − vc1_if_mmv_mbmode_bits[i], 1, 1, | |
| 582 | − vc1_if_mmv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); | |
| 583 | − ff_vc1_if_1mv_mbmode_vlc[i].table = &vlc_table[vlc_offs[i * 3 + 55]]; | |
| 584 | − ff_vc1_if_1mv_mbmode_vlc[i].table_allocated = vlc_offs[i * 3 + 56] - vlc_offs[i * 3 + 55]; | |
| 585 | − vlc_init(&ff_vc1_if_1mv_mbmode_vlc[i], VC1_IF_1MV_MBMODE_VLC_BITS, 6, | |
| 586 | − vc1_if_1mv_mbmode_bits[i], 1, 1, | |
| 587 | − vc1_if_1mv_mbmode_codes[i], 1, 1, VLC_INIT_USE_STATIC); | |
| 550 | + ff_vc1_if_mmv_mbmode_vlc[i] = | |
| 551 | + ff_vlc_init_tables(&state, VC1_IF_MMV_MBMODE_VLC_BITS, 8, | |
| 552 | + vc1_if_mmv_mbmode_bits[i], 1, 1, | |
| 553 | + vc1_if_mmv_mbmode_codes[i], 1, 1, 0); | |
| 554 | + ff_vc1_if_1mv_mbmode_vlc[i] = | |
| 555 | + ff_vlc_init_tables(&state, VC1_IF_1MV_MBMODE_VLC_BITS, 6, | |
| 556 | + vc1_if_1mv_mbmode_bits[i], 1, 1, | |
| 557 | + vc1_if_1mv_mbmode_codes[i], 1, 1, 0); | |
| 588 | 558 | } |
| 589 | 559 | ff_msmp4_vc1_vlcs_init_once(); |
| 590 | 560 | } |