comparison mpegvideo_enc.c @ 9431:932543edc1d2 libavcodec

Rename pbBufPtr() to put_bits_ptr(). The new name is more readable and consistent with the FFmpeg naming style.
author stefano
date Mon, 13 Apr 2009 16:59:38 +0000
parents bf274494b66e
children 483ba97736f8
comparison
equal deleted inserted replaced
9430:e806d2145e72 9431:932543edc1d2
1319 s->vbv_delay_ptr[2] |= vbv_delay<<3; 1319 s->vbv_delay_ptr[2] |= vbv_delay<<3;
1320 } 1320 }
1321 s->total_bits += s->frame_bits; 1321 s->total_bits += s->frame_bits;
1322 avctx->frame_bits = s->frame_bits; 1322 avctx->frame_bits = s->frame_bits;
1323 }else{ 1323 }else{
1324 assert((pbBufPtr(&s->pb) == s->pb.buf)); 1324 assert((put_bits_ptr(&s->pb) == s->pb.buf));
1325 s->frame_bits=0; 1325 s->frame_bits=0;
1326 } 1326 }
1327 assert((s->frame_bits&7)==0); 1327 assert((s->frame_bits&7)==0);
1328 1328
1329 return s->frame_bits/8; 1329 return s->frame_bits/8;
2109 ff_mpeg4_init_partitions(s); 2109 ff_mpeg4_init_partitions(s);
2110 } 2110 }
2111 } 2111 }
2112 2112
2113 assert((put_bits_count(&s->pb)&7) == 0); 2113 assert((put_bits_count(&s->pb)&7) == 0);
2114 current_packet_size= pbBufPtr(&s->pb) - s->ptr_lastgob; 2114 current_packet_size= put_bits_ptr(&s->pb) - s->ptr_lastgob;
2115 2115
2116 if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){ 2116 if(s->avctx->error_rate && s->resync_mb_x + s->resync_mb_y > 0){
2117 int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y; 2117 int r= put_bits_count(&s->pb)/8 + s->picture_number + 16 + s->mb_x + s->mb_y;
2118 int d= 100 / s->avctx->error_rate; 2118 int d= 100 / s->avctx->error_rate;
2119 if(r % d == 0){ 2119 if(r % d == 0){
2120 current_packet_size=0; 2120 current_packet_size=0;
2121 #ifndef ALT_BITSTREAM_WRITER 2121 #ifndef ALT_BITSTREAM_WRITER
2122 s->pb.buf_ptr= s->ptr_lastgob; 2122 s->pb.buf_ptr= s->ptr_lastgob;
2123 #endif 2123 #endif
2124 assert(pbBufPtr(&s->pb) == s->ptr_lastgob); 2124 assert(put_bits_ptr(&s->pb) == s->ptr_lastgob);
2125 } 2125 }
2126 } 2126 }
2127 2127
2128 if (s->avctx->rtp_callback){ 2128 if (s->avctx->rtp_callback){
2129 int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x; 2129 int number_mb = (mb_y - s->resync_mb_y)*s->mb_width + mb_x - s->resync_mb_x;
2601 write_slice_end(s); 2601 write_slice_end(s);
2602 2602
2603 /* Send the last GOB if RTP */ 2603 /* Send the last GOB if RTP */
2604 if (s->avctx->rtp_callback) { 2604 if (s->avctx->rtp_callback) {
2605 int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x; 2605 int number_mb = (mb_y - s->resync_mb_y)*s->mb_width - s->resync_mb_x;
2606 pdif = pbBufPtr(&s->pb) - s->ptr_lastgob; 2606 pdif = put_bits_ptr(&s->pb) - s->ptr_lastgob;
2607 /* Call the RTP callback to send the last GOB */ 2607 /* Call the RTP callback to send the last GOB */
2608 emms_c(); 2608 emms_c();
2609 s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb); 2609 s->avctx->rtp_callback(s->avctx, s->ptr_lastgob, pdif, number_mb);
2610 } 2610 }
2611 2611