Mercurial > libavcodec.hg
diff mpegvideo.c @ 1159:13ea348d4cf2 libavcodec
simplify slice encoding (variance of packet size is practically identical)
author | michaelni |
---|---|
date | Sun, 30 Mar 2003 16:22:08 +0000 |
parents | dde68a430ba9 |
children | 9a5c29575902 |
line wrap: on
line diff
--- a/mpegvideo.c Sat Mar 29 14:06:24 2003 +0000 +++ b/mpegvideo.c Sun Mar 30 16:22:08 2003 +0000 @@ -3043,7 +3043,6 @@ s->resync_mb_y=0; s->first_slice_line = 1; s->ptr_lastgob = s->pb.buf; - s->ptr_last_mb_line = s->pb.buf; for(mb_y=0; mb_y < s->mb_height; mb_y++) { s->y_dc_scale= s->y_dc_scale_table[ s->qscale ]; s->c_dc_scale= s->c_dc_scale_table[ s->qscale ]; @@ -3078,7 +3077,7 @@ is_gob_start=0; if(s->codec_id==CODEC_ID_MPEG4){ - if(current_packet_size + s->mb_line_avgsize/s->mb_width >= s->rtp_payload_size + if(current_packet_size >= s->rtp_payload_size && s->mb_y + s->mb_x>0){ if(s->partitioned_frame){ @@ -3096,7 +3095,7 @@ is_gob_start=1; } }else{ - if(current_packet_size + s->mb_line_avgsize*s->gob_index >= s->rtp_payload_size + if(current_packet_size >= s->rtp_payload_size && s->mb_x==0 && s->mb_y>0 && s->mb_y%s->gob_index==0){ h263_encode_gob_header(s, mb_y); @@ -3411,17 +3410,6 @@ } //printf("MB %d %d bits\n", s->mb_x+s->mb_y*s->mb_width, get_bit_count(&s->pb)); } - - - /* Obtain average mb_row size for RTP */ - if (s->rtp_mode) { - if (mb_y==0) - s->mb_line_avgsize = pbBufPtr(&s->pb) - s->ptr_last_mb_line; - else { - s->mb_line_avgsize = (s->mb_line_avgsize + pbBufPtr(&s->pb) - s->ptr_last_mb_line) >> 1; - } - s->ptr_last_mb_line = pbBufPtr(&s->pb); - } } emms_c();