comparison mpeg4videoenc.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 d1fe22d92a65
children 8a4984c5cacc
comparison
equal deleted inserted replaced
10817:d1fe22d92a65 10818:514dc1c87b2e
313 bits_tab= uni_mpeg4_intra_rl_bits; 313 bits_tab= uni_mpeg4_intra_rl_bits;
314 len_tab = uni_mpeg4_intra_rl_len; 314 len_tab = uni_mpeg4_intra_rl_len;
315 } else { 315 } else {
316 if(last_index<0) return; 316 if(last_index<0) return;
317 i = 0; 317 i = 0;
318 rl = &rl_inter; 318 rl = &ff_h263_rl_inter;
319 bits_tab= uni_mpeg4_inter_rl_bits; 319 bits_tab= uni_mpeg4_inter_rl_bits;
320 len_tab = uni_mpeg4_inter_rl_len; 320 len_tab = uni_mpeg4_inter_rl_len;
321 } 321 }
322 322
323 /* AC coefs */ 323 /* AC coefs */
695 cbpy = cbp >> 2; 695 cbpy = cbp >> 2;
696 cbpy ^= 0xf; 696 cbpy ^= 0xf;
697 if(s->mv_type==MV_TYPE_16X16){ 697 if(s->mv_type==MV_TYPE_16X16){
698 if(s->dquant) cbpc+= 8; 698 if(s->dquant) cbpc+= 8;
699 put_bits(&s->pb, 699 put_bits(&s->pb,
700 inter_MCBPC_bits[cbpc], 700 ff_h263_inter_MCBPC_bits[cbpc],
701 inter_MCBPC_code[cbpc]); 701 ff_h263_inter_MCBPC_code[cbpc]);
702 702
703 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); 703 put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
704 if(s->dquant) 704 if(s->dquant)
705 put_bits(pb2, 2, dquant_code[s->dquant+2]); 705 put_bits(pb2, 2, dquant_code[s->dquant+2]);
706 706
707 if(!s->progressive_sequence){ 707 if(!s->progressive_sequence){
708 if(cbp) 708 if(cbp)
720 ff_h263_encode_motion_vector(s, motion_x - pred_x, 720 ff_h263_encode_motion_vector(s, motion_x - pred_x,
721 motion_y - pred_y, s->f_code); 721 motion_y - pred_y, s->f_code);
722 }else if(s->mv_type==MV_TYPE_FIELD){ 722 }else if(s->mv_type==MV_TYPE_FIELD){
723 if(s->dquant) cbpc+= 8; 723 if(s->dquant) cbpc+= 8;
724 put_bits(&s->pb, 724 put_bits(&s->pb,
725 inter_MCBPC_bits[cbpc], 725 ff_h263_inter_MCBPC_bits[cbpc],
726 inter_MCBPC_code[cbpc]); 726 ff_h263_inter_MCBPC_code[cbpc]);
727 727
728 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); 728 put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
729 if(s->dquant) 729 if(s->dquant)
730 put_bits(pb2, 2, dquant_code[s->dquant+2]); 730 put_bits(pb2, 2, dquant_code[s->dquant+2]);
731 731
732 assert(!s->progressive_sequence); 732 assert(!s->progressive_sequence);
733 if(cbp) 733 if(cbp)
750 ff_h263_encode_motion_vector(s, s->mv[0][1][0] - pred_x, 750 ff_h263_encode_motion_vector(s, s->mv[0][1][0] - pred_x,
751 s->mv[0][1][1] - pred_y, s->f_code); 751 s->mv[0][1][1] - pred_y, s->f_code);
752 }else{ 752 }else{
753 assert(s->mv_type==MV_TYPE_8X8); 753 assert(s->mv_type==MV_TYPE_8X8);
754 put_bits(&s->pb, 754 put_bits(&s->pb,
755 inter_MCBPC_bits[cbpc+16], 755 ff_h263_inter_MCBPC_bits[cbpc+16],
756 inter_MCBPC_code[cbpc+16]); 756 ff_h263_inter_MCBPC_code[cbpc+16]);
757 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); 757 put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
758 758
759 if(!s->progressive_sequence){ 759 if(!s->progressive_sequence){
760 if(cbp) 760 if(cbp)
761 put_bits(pb2, 1, s->interlaced_dct); 761 put_bits(pb2, 1, s->interlaced_dct);
762 } 762 }
813 813
814 cbpc = cbp & 3; 814 cbpc = cbp & 3;
815 if (s->pict_type == FF_I_TYPE) { 815 if (s->pict_type == FF_I_TYPE) {
816 if(s->dquant) cbpc+=4; 816 if(s->dquant) cbpc+=4;
817 put_bits(&s->pb, 817 put_bits(&s->pb,
818 intra_MCBPC_bits[cbpc], 818 ff_h263_intra_MCBPC_bits[cbpc],
819 intra_MCBPC_code[cbpc]); 819 ff_h263_intra_MCBPC_code[cbpc]);
820 } else { 820 } else {
821 if(s->dquant) cbpc+=8; 821 if(s->dquant) cbpc+=8;
822 put_bits(&s->pb, 1, 0); /* mb coded */ 822 put_bits(&s->pb, 1, 0); /* mb coded */
823 put_bits(&s->pb, 823 put_bits(&s->pb,
824 inter_MCBPC_bits[cbpc + 4], 824 ff_h263_inter_MCBPC_bits[cbpc + 4],
825 inter_MCBPC_code[cbpc + 4]); 825 ff_h263_inter_MCBPC_code[cbpc + 4]);
826 } 826 }
827 put_bits(pb2, 1, s->ac_pred); 827 put_bits(pb2, 1, s->ac_pred);
828 cbpy = cbp >> 2; 828 cbpy = cbp >> 2;
829 put_bits(pb2, cbpy_tab[cbpy][1], cbpy_tab[cbpy][0]); 829 put_bits(pb2, ff_h263_cbpy_tab[cbpy][1], ff_h263_cbpy_tab[cbpy][0]);
830 if(s->dquant) 830 if(s->dquant)
831 put_bits(dc_pb, 2, dquant_code[s->dquant+2]); 831 put_bits(dc_pb, 2, dquant_code[s->dquant+2]);
832 832
833 if(!s->progressive_sequence){ 833 if(!s->progressive_sequence){
834 put_bits(dc_pb, 1, s->interlaced_dct); 834 put_bits(dc_pb, 1, s->interlaced_dct);
1253 init_uni_dc_tab(); 1253 init_uni_dc_tab();
1254 1254
1255 init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]); 1255 init_rl(&ff_mpeg4_rl_intra, ff_mpeg4_static_rl_table_store[0]);
1256 1256
1257 init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len); 1257 init_uni_mpeg4_rl_tab(&ff_mpeg4_rl_intra, uni_mpeg4_intra_rl_bits, uni_mpeg4_intra_rl_len);
1258 init_uni_mpeg4_rl_tab(&rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len); 1258 init_uni_mpeg4_rl_tab(&ff_h263_rl_inter, uni_mpeg4_inter_rl_bits, uni_mpeg4_inter_rl_len);
1259 } 1259 }
1260 1260
1261 s->min_qcoeff= -2048; 1261 s->min_qcoeff= -2048;
1262 s->max_qcoeff= 2047; 1262 s->max_qcoeff= 2047;
1263 s->intra_ac_vlc_length = uni_mpeg4_intra_rl_len; 1263 s->intra_ac_vlc_length = uni_mpeg4_intra_rl_len;