summaryrefslogtreecommitdiff
path: root/libavcodec/h263.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2004-05-26 19:42:00 +0000
committerMichael Niedermayer <michaelni@gmx.at>2004-05-26 19:42:00 +0000
commitb876b5c5f7e78ceb62bdd61c3995fa2fa648869c (patch)
treedbf25de25688aa2feb78b66c3df7a17a1c2bd321 /libavcodec/h263.c
parent8b58ed6384df471cd58fd0ea1ad6a6acdde6b787 (diff)
10l (interlaced b frame decoding fix)
Originally committed as revision 3160 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/h263.c')
-rw-r--r--libavcodec/h263.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/libavcodec/h263.c b/libavcodec/h263.c
index 24ba4b09ac..9175eff0ef 100644
--- a/libavcodec/h263.c
+++ b/libavcodec/h263.c
@@ -5418,6 +5418,8 @@ static int decode_vol_header(MpegEncContext *s, GetBitContext *gb){
if (get_bits1(gb) != 0) { /* fixed_vop_rate */
skip_bits(gb, s->time_increment_bits);
}
+
+ s->t_frame=0;
if (s->shape != BIN_ONLY_SHAPE) {
if (s->shape == RECT_SHAPE) {
@@ -5691,7 +5693,7 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
else time_increment= get_bits(gb, s->time_increment_bits);
// printf("%d %X\n", s->time_increment_bits, time_increment);
-//printf(" type:%d modulo_time_base:%d increment:%d\n", s->pict_type, time_incr, time_increment);
+//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);
if(s->pict_type!=B_TYPE){
s->last_time_base= s->time_base;
s->time_base+= time_incr;
@@ -5713,19 +5715,19 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
return FRAME_SKIPED;
}
- if(s->t_frame==0) s->t_frame= s->time - s->last_time_base;
+ if(s->t_frame==0) s->t_frame= s->pb_time;
if(s->t_frame==0) s->t_frame=1; // 1/0 protection
-//printf("%Ld %Ld %d %d\n", s->last_non_b_time, s->time, s->pp_time, s->t_frame); fflush(stdout);
s->pp_field_time= ( ROUNDED_DIV(s->last_non_b_time, s->t_frame)
- ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
s->pb_field_time= ( ROUNDED_DIV(s->time, s->t_frame)
- ROUNDED_DIV(s->last_non_b_time - s->pp_time, s->t_frame))*2;
}
+//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);
s->current_picture_ptr->pts= s->time*(int64_t)AV_TIME_BASE / s->time_increment_resolution;
if(s->avctx->debug&FF_DEBUG_PTS)
av_log(s->avctx, AV_LOG_DEBUG, "MPEG4 PTS: %f\n", s->current_picture_ptr->pts/(float)AV_TIME_BASE);
-
+
check_marker(gb, "before vop_coded");
/* vop coded */