s->time= s->picture_number*(int64_t)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate; time_div= s->time/s->time_increment_resolution; time_mod= s->time%s->time_increment_resolution;
void mpeg4_encode_picture_header(MpegEncContext * s, int picture_number){    int time_incr;    int time_div, time_mod;        if(s->pict_type==I_TYPE) mpeg4_encode_vol_header(s);        s->time= s->picture_number*(int64_t)FRAME_RATE_BASE*s->time_increment_resolution/s->frame_rate;    time_div= s->time/s->time_increment_resolution;    time_mod= s->time%s->time_increment_resolution;//printf("num:%d rate:%d base:%d\n", s->picture_number, s->frame_rate, FRAME_RATE_BASE);        if(get_bit_count(&s->pb)!=0) mpeg4_stuffing(&s->pb);    put_bits(&s->pb, 16, 0);	        /* vop header */    put_bits(&s->pb, 16, 0x1B6);	/* vop header */    put_bits(&s->pb, 2, s->pict_type - 1);	/* pict type: I = 0 , P = 1 */    if(s->pict_type==B_TYPE){        s->bp_time= s->last_non_b_time - s->time;    }else{        s->last_time_base= s->time_base;        s->time_base= time_div;        s->pp_time= s->time - s->last_non_b_time;        s->last_non_b_time= s->time;    }    time_incr= time_div - s->last_time_base;    while(time_incr--)        put_bits(&s->pb, 1, 1);            put_bits(&s->pb, 1, 0);    put_bits(&s->pb, 1, 1);	/* marker */    put_bits(&s->pb, s->time_increment_bits, time_mod);	/* time increment */    put_bits(&s->pb, 1, 1);	/* marker */    put_bits(&s->pb, 1, 1);	/* vop coded */    if (    s->pict_type == P_TYPE         || (s->pict_type == S_TYPE && s->vol_sprite_usage==GMC_SPRITE)) {        s->no_rounding ^= 1;	put_bits(&s->pb, 1, s->no_rounding);	/* rounding type */    }    put_bits(&s->pb, 3, 0);	/* intra dc VLC threshold */    //FIXME sprite stuff    put_bits(&s->pb, 5, s->qscale);    if (s->pict_type != I_TYPE)	put_bits(&s->pb, 3, s->f_code);	/* fcode_for */    if (s->pict_type == B_TYPE)	put_bits(&s->pb, 3, s->b_code);	/* fcode_back */    //    printf("****frame %d\n", picture_number);}