comparison msmpeg4.c @ 10818:514dc1c87b2e libavcodec

Rename most non static h263 tables so their name contains h263.
author michael
date Fri, 08 Jan 2010 17:51:48 +0000
parents 9abebeca7d1b
children 030e30b050e4
comparison
equal deleted inserted replaced
10817:d1fe22d92a65 10818:514dc1c87b2e
574 v2_mb_type[cbp&3][0]); 574 v2_mb_type[cbp&3][0]);
575 if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C; 575 if((cbp&3) != 3) coded_cbp= cbp ^ 0x3C;
576 else coded_cbp= cbp; 576 else coded_cbp= cbp;
577 577
578 put_bits(&s->pb, 578 put_bits(&s->pb,
579 cbpy_tab[coded_cbp>>2][1], 579 ff_h263_cbpy_tab[coded_cbp>>2][1],
580 cbpy_tab[coded_cbp>>2][0]); 580 ff_h263_cbpy_tab[coded_cbp>>2][0]);
581 581
582 s->misc_bits += get_bits_diff(s); 582 s->misc_bits += get_bits_diff(s);
583 583
584 h263_pred_motion(s, 0, 0, &pred_x, &pred_y); 584 h263_pred_motion(s, 0, 0, &pred_x, &pred_y);
585 msmpeg4v2_encode_motion(s, motion_x - pred_x); 585 msmpeg4v2_encode_motion(s, motion_x - pred_x);
635 v2_mb_type[(cbp&3) + 4][1], 635 v2_mb_type[(cbp&3) + 4][1],
636 v2_mb_type[(cbp&3) + 4][0]); 636 v2_mb_type[(cbp&3) + 4][0]);
637 } 637 }
638 put_bits(&s->pb, 1, 0); /* no AC prediction yet */ 638 put_bits(&s->pb, 1, 0); /* no AC prediction yet */
639 put_bits(&s->pb, 639 put_bits(&s->pb,
640 cbpy_tab[cbp>>2][1], 640 ff_h263_cbpy_tab[cbp>>2][1],
641 cbpy_tab[cbp>>2][0]); 641 ff_h263_cbpy_tab[cbp>>2][0]);
642 }else{ 642 }else{
643 if (s->pict_type == FF_I_TYPE) { 643 if (s->pict_type == FF_I_TYPE) {
644 put_bits(&s->pb, 644 put_bits(&s->pb,
645 ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]); 645 ff_msmp4_mb_i_table[coded_cbp][1], ff_msmp4_mb_i_table[coded_cbp][0]);
646 } else { 646 } else {
1144 } 1144 }
1145 1145
1146 if (!s->mb_intra) { 1146 if (!s->mb_intra) {
1147 int mx, my, cbpy; 1147 int mx, my, cbpy;
1148 1148
1149 cbpy= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1); 1149 cbpy= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1);
1150 if(cbpy<0){ 1150 if(cbpy<0){
1151 av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y); 1151 av_log(s->avctx, AV_LOG_ERROR, "cbpy %d invalid at %d %d\n", cbp, s->mb_x, s->mb_y);
1152 return -1; 1152 return -1;
1153 } 1153 }
1154 1154
1164 s->mv[0][0][0] = mx; 1164 s->mv[0][0][0] = mx;
1165 s->mv[0][0][1] = my; 1165 s->mv[0][0][1] = my;
1166 } else { 1166 } else {
1167 if(s->msmpeg4_version==2){ 1167 if(s->msmpeg4_version==2){
1168 s->ac_pred = get_bits1(&s->gb); 1168 s->ac_pred = get_bits1(&s->gb);
1169 cbp|= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors 1169 cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors
1170 } else{ 1170 } else{
1171 s->ac_pred = 0; 1171 s->ac_pred = 0;
1172 cbp|= get_vlc2(&s->gb, cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors 1172 cbp|= get_vlc2(&s->gb, ff_h263_cbpy_vlc.table, CBPY_VLC_BITS, 1)<<2; //FIXME check errors
1173 if(s->pict_type==FF_P_TYPE) cbp^=0x3C; 1173 if(s->pict_type==FF_P_TYPE) cbp^=0x3C;
1174 } 1174 }
1175 } 1175 }
1176 1176
1177 s->dsp.clear_blocks(s->block[0]); 1177 s->dsp.clear_blocks(s->block[0]);
1324 &v2_dc_lum_table[0][0], 8, 4, 1472); 1324 &v2_dc_lum_table[0][0], 8, 4, 1472);
1325 INIT_VLC_STATIC(&v2_dc_chroma_vlc, DC_VLC_BITS, 512, 1325 INIT_VLC_STATIC(&v2_dc_chroma_vlc, DC_VLC_BITS, 512,
1326 &v2_dc_chroma_table[0][1], 8, 4, 1326 &v2_dc_chroma_table[0][1], 8, 4,
1327 &v2_dc_chroma_table[0][0], 8, 4, 1506); 1327 &v2_dc_chroma_table[0][0], 8, 4, 1506);
1328 1328
1329 INIT_VLC_STATIC(&cbpy_vlc, CBPY_VLC_BITS, 16, 1329 INIT_VLC_STATIC(&ff_h263_cbpy_vlc, CBPY_VLC_BITS, 16,
1330 &cbpy_tab[0][1], 2, 1, 1330 &ff_h263_cbpy_tab[0][1], 2, 1,
1331 &cbpy_tab[0][0], 2, 1, 64); 1331 &ff_h263_cbpy_tab[0][0], 2, 1, 64);
1332 INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4, 1332 INIT_VLC_STATIC(&v2_intra_cbpc_vlc, V2_INTRA_CBPC_VLC_BITS, 4,
1333 &v2_intra_cbpc[0][1], 2, 1, 1333 &v2_intra_cbpc[0][1], 2, 1,
1334 &v2_intra_cbpc[0][0], 2, 1, 8); 1334 &v2_intra_cbpc[0][0], 2, 1, 8);
1335 INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8, 1335 INIT_VLC_STATIC(&v2_mb_type_vlc, V2_MB_TYPE_VLC_BITS, 8,
1336 &v2_mb_type[0][1], 2, 1, 1336 &v2_mb_type[0][1], 2, 1,
1355 INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64, 1355 INIT_VLC_STATIC(&ff_msmp4_mb_i_vlc, MB_INTRA_VLC_BITS, 64,
1356 &ff_msmp4_mb_i_table[0][1], 4, 2, 1356 &ff_msmp4_mb_i_table[0][1], 4, 2,
1357 &ff_msmp4_mb_i_table[0][0], 4, 2, 536); 1357 &ff_msmp4_mb_i_table[0][0], 4, 2, 536);
1358 1358
1359 INIT_VLC_STATIC(&v1_intra_cbpc_vlc, V1_INTRA_CBPC_VLC_BITS, 8, 1359 INIT_VLC_STATIC(&v1_intra_cbpc_vlc, V1_INTRA_CBPC_VLC_BITS, 8,
1360 intra_MCBPC_bits, 1, 1, 1360 ff_h263_intra_MCBPC_bits, 1, 1,
1361 intra_MCBPC_code, 1, 1, 64); 1361 ff_h263_intra_MCBPC_code, 1, 1, 64);
1362 INIT_VLC_STATIC(&v1_inter_cbpc_vlc, V1_INTER_CBPC_VLC_BITS, 25, 1362 INIT_VLC_STATIC(&v1_inter_cbpc_vlc, V1_INTER_CBPC_VLC_BITS, 25,
1363 inter_MCBPC_bits, 1, 1, 1363 ff_h263_inter_MCBPC_bits, 1, 1,
1364 inter_MCBPC_code, 1, 1, 104); 1364 ff_h263_inter_MCBPC_code, 1, 1, 104);
1365 1365
1366 INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4, 1366 INIT_VLC_STATIC(&ff_inter_intra_vlc, INTER_INTRA_VLC_BITS, 4,
1367 &table_inter_intra[0][1], 2, 1, 1367 &table_inter_intra[0][1], 2, 1,
1368 &table_inter_intra[0][0], 2, 1, 8); 1368 &table_inter_intra[0][0], 2, 1, 8);
1369 } 1369 }