mirror of
https://github.com/FFmpeg/FFmpeg.git
synced 2025-01-08 13:22:53 +02:00
10l (interlaced b frame decoding fix)
Originally committed as revision 3160 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
parent
8b58ed6384
commit
b876b5c5f7
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user