comparison h263.c @ 5273:101f20612a94 libavcodec

Split ff_set_mpeg4_time() and move the non mpeg4 specific part into mpegvideo_enc.c.
author aurel
date Tue, 10 Jul 2007 14:37:33 +0000
parents 7583133469f1
children c6bc608d2659
comparison
equal deleted inserted replaced
5272:b51c25603164 5273:101f20612a94
2257 length= (-put_bits_count(pbc))&7; 2257 length= (-put_bits_count(pbc))&7;
2258 if(length) put_bits(pbc, length, (1<<length)-1); 2258 if(length) put_bits(pbc, length, (1<<length)-1);
2259 } 2259 }
2260 2260
2261 /* must be called before writing the header */ 2261 /* must be called before writing the header */
2262 void ff_set_mpeg4_time(MpegEncContext * s, int picture_number){ 2262 void ff_set_mpeg4_time(MpegEncContext * s){
2263 int time_div, time_mod;
2264
2265 assert(s->current_picture_ptr->pts != AV_NOPTS_VALUE);
2266 s->time= s->current_picture_ptr->pts*s->avctx->time_base.num;
2267
2268 time_div= s->time/s->avctx->time_base.den;
2269 time_mod= s->time%s->avctx->time_base.den;
2270
2271 if(s->pict_type==B_TYPE){ 2263 if(s->pict_type==B_TYPE){
2272 s->pb_time= s->pp_time - (s->last_non_b_time - s->time);
2273 assert(s->pb_time > 0 && s->pb_time < s->pp_time);
2274 ff_mpeg4_init_direct_mv(s); 2264 ff_mpeg4_init_direct_mv(s);
2275 }else{ 2265 }else{
2276 s->last_time_base= s->time_base; 2266 s->last_time_base= s->time_base;
2277 s->time_base= time_div; 2267 s->time_base= s->time/s->avctx->time_base.den;
2278 s->pp_time= s->time - s->last_non_b_time;
2279 s->last_non_b_time= s->time;
2280 assert(picture_number==0 || s->pp_time > 0);
2281 } 2268 }
2282 } 2269 }
2283 2270
2284 static void mpeg4_encode_gop_header(MpegEncContext * s){ 2271 static void mpeg4_encode_gop_header(MpegEncContext * s){
2285 int hours, minutes, seconds; 2272 int hours, minutes, seconds;