Mercurial > libavcodec.hg
comparison h263.c @ 8644:0b13b33e175e libavcodec
avoid duplication of dquant_code
author | stefang |
---|---|
date | Sat, 24 Jan 2009 14:26:40 +0000 |
parents | 04423b2f6e0b |
children | 6c220a238087 |
comparison
equal
deleted
inserted
replaced
8643:1fa3e8a72ca5 | 8644:0b13b33e175e |
---|---|
893 } | 893 } |
894 } | 894 } |
895 } | 895 } |
896 } | 896 } |
897 | 897 |
898 static const int dquant_code[5]= {1,0,9,2,3}; | |
899 | |
898 void mpeg4_encode_mb(MpegEncContext * s, | 900 void mpeg4_encode_mb(MpegEncContext * s, |
899 DCTELEM block[6][64], | 901 DCTELEM block[6][64], |
900 int motion_x, int motion_y) | 902 int motion_x, int motion_y) |
901 { | 903 { |
902 int cbpc, cbpy, pred_x, pred_y; | 904 int cbpc, cbpy, pred_x, pred_y; |
903 PutBitContext * const pb2 = s->data_partitioning ? &s->pb2 : &s->pb; | 905 PutBitContext * const pb2 = s->data_partitioning ? &s->pb2 : &s->pb; |
904 PutBitContext * const tex_pb = s->data_partitioning && s->pict_type!=FF_B_TYPE ? &s->tex_pb : &s->pb; | 906 PutBitContext * const tex_pb = s->data_partitioning && s->pict_type!=FF_B_TYPE ? &s->tex_pb : &s->pb; |
905 PutBitContext * const dc_pb = s->data_partitioning && s->pict_type!=FF_I_TYPE ? &s->pb2 : &s->pb; | 907 PutBitContext * const dc_pb = s->data_partitioning && s->pict_type!=FF_I_TYPE ? &s->pb2 : &s->pb; |
906 const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0; | 908 const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1) && !s->data_partitioning ? 1 : 0; |
907 const int dquant_code[5]= {1,0,9,2,3}; | |
908 | 909 |
909 // printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y); | 910 // printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y); |
910 if (!s->mb_intra) { | 911 if (!s->mb_intra) { |
911 int i, cbp; | 912 int i, cbp; |
912 | 913 |
1266 int cbpc, cbpy, i, cbp, pred_x, pred_y; | 1267 int cbpc, cbpy, i, cbp, pred_x, pred_y; |
1267 int16_t pred_dc; | 1268 int16_t pred_dc; |
1268 int16_t rec_intradc[6]; | 1269 int16_t rec_intradc[6]; |
1269 int16_t *dc_ptr[6]; | 1270 int16_t *dc_ptr[6]; |
1270 const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1); | 1271 const int interleaved_stats= (s->flags&CODEC_FLAG_PASS1); |
1271 const int dquant_code[5]= {1,0,9,2,3}; | |
1272 | 1272 |
1273 //printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y); | 1273 //printf("**mb x=%d y=%d\n", s->mb_x, s->mb_y); |
1274 if (!s->mb_intra) { | 1274 if (!s->mb_intra) { |
1275 /* compute cbp */ | 1275 /* compute cbp */ |
1276 cbp= get_p_cbp(s, block, motion_x, motion_y); | 1276 cbp= get_p_cbp(s, block, motion_x, motion_y); |