Mercurial > libavcodec.hg
comparison h263.c @ 2034:9629c1180d5f libavcodec
10l (interlaced b frame decoding fix)
author | michael |
---|---|
date | Wed, 26 May 2004 19:42:00 +0000 |
parents | f089d25c82f0 |
children | 6a9472a09ffc |
comparison
equal
deleted
inserted
replaced
2033:6852ecebb82a | 2034:9629c1180d5f |
---|---|
5416 check_marker(gb, "before fixed_vop_rate"); | 5416 check_marker(gb, "before fixed_vop_rate"); |
5417 | 5417 |
5418 if (get_bits1(gb) != 0) { /* fixed_vop_rate */ | 5418 if (get_bits1(gb) != 0) { /* fixed_vop_rate */ |
5419 skip_bits(gb, s->time_increment_bits); | 5419 skip_bits(gb, s->time_increment_bits); |
5420 } | 5420 } |
5421 | |
5422 s->t_frame=0; | |
5421 | 5423 |
5422 if (s->shape != BIN_ONLY_SHAPE) { | 5424 if (s->shape != BIN_ONLY_SHAPE) { |
5423 if (s->shape == RECT_SHAPE) { | 5425 if (s->shape == RECT_SHAPE) { |
5424 skip_bits1(gb); /* marker */ | 5426 skip_bits1(gb); /* marker */ |
5425 width = get_bits(gb, 13); | 5427 width = get_bits(gb, 13); |
5689 | 5691 |
5690 if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further | 5692 if(IS_3IV1) time_increment= get_bits1(gb); //FIXME investigate further |
5691 else time_increment= get_bits(gb, s->time_increment_bits); | 5693 else time_increment= get_bits(gb, s->time_increment_bits); |
5692 | 5694 |
5693 // printf("%d %X\n", s->time_increment_bits, time_increment); | 5695 // printf("%d %X\n", s->time_increment_bits, time_increment); |
5694 //printf(" type:%d modulo_time_base:%d increment:%d\n", s->pict_type, time_incr, time_increment); | 5696 //av_log(s->avctx, AV_LOG_DEBUG, " type:%d modulo_time_base:%d increment:%d t_frame %d\n", s->pict_type, time_incr, time_increment, s->t_frame); |
5695 if(s->pict_type!=B_TYPE){ | 5697 if(s->pict_type!=B_TYPE){ |
5696 s->last_time_base= s->time_base; | 5698 s->last_time_base= s->time_base; |
5697 s->time_base+= time_incr; | 5699 s->time_base+= time_incr; |
5698 s->time= s->time_base*s->time_increment_resolution + time_increment; | 5700 s->time= s->time_base*s->time_increment_resolution + time_increment; |
5699 if(s->workaround_bugs&FF_BUG_UMP4){ | 5701 if(s->workaround_bugs&FF_BUG_UMP4){ |
5711 if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){ | 5713 if(s->pp_time <=s->pb_time || s->pp_time <= s->pp_time - s->pb_time || s->pp_time<=0){ |
5712 // printf("messed up order, seeking?, skiping current b frame\n"); | 5714 // printf("messed up order, seeking?, skiping current b frame\n"); |
5713 return FRAME_SKIPED; | 5715 return FRAME_SKIPED; |
5714 } | 5716 } |
5715 | 5717 |
5716 if(s->t_frame==0) s->t_frame= s->time - s->last_time_base; | 5718 if(s->t_frame==0) s->t_frame= s->pb_time; |
5717 if(s->t_frame==0) s->t_frame=1; // 1/0 protection | 5719 if(s->t_frame==0) s->t_frame=1; // 1/0 protection |
5718 //printf("%Ld %Ld %d %d\n", s->last_non_b_time, s->time, s->pp_time, s->t_frame); fflush(stdout); | |
5719 s->pp_field_time= ( ROUNDED_DIV(s->last_non_b_time, s->t_frame) | 5720 s->pp_field_time= ( ROUNDED_DIV(s->last_non_b_time, s->t_frame) |
5720 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; | 5721 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; |
5721 s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame) | 5722 s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame) |
5722 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; | 5723 - ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2; |
5723 } | 5724 } |
5725 //av_log(s->avctx, AV_LOG_DEBUG, "last nonb %Ld last_base %d time %Ld pp %d pb %d t %d ppf %d pbf %d\n", s->last_non_b_time, s->last_time_base, s->time, s->pp_time, s->pb_time, s->t_frame, s->pp_field_time, s->pb_field_time); | |
5724 | 5726 |
5725 s->current_picture_ptr->pts= s->time*(int64_t)AV_TIME_BASE / s->time_increment_resolution; | 5727 s->current_picture_ptr->pts= s->time*(int64_t)AV_TIME_BASE / s->time_increment_resolution; |
5726 if(s->avctx->debug&FF_DEBUG_PTS) | 5728 if(s->avctx->debug&FF_DEBUG_PTS) |
5727 av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %f\n", s->current_picture_ptr->pts/(float)AV_TIME_BASE); | 5729 av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %f\n", s->current_picture_ptr->pts/(float)AV_TIME_BASE); |
5728 | 5730 |
5729 check_marker(gb, "before vop_coded"); | 5731 check_marker(gb, "before vop_coded"); |
5730 | 5732 |
5731 /* vop coded */ | 5733 /* vop coded */ |
5732 if (get_bits1(gb) != 1){ | 5734 if (get_bits1(gb) != 1){ |
5733 av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n"); | 5735 av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n"); |