[FFmpeg-cvslog] avcodec/ituh263dec: Correct timestamp recovery for B frames

Michael Niedermayer git at videolan.org
Wed Feb 1 23:01:55 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Feb  1 20:20:07 2017 +0100| [0126cd95ccc37aa327e8eff6e4f58dda4f861adf] | committer: Michael Niedermayer

avcodec/ituh263dec: Correct timestamp recovery for B frames

Improves u263_b-frames_5.avi

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=0126cd95ccc37aa327e8eff6e4f58dda4f861adf
---

 libavcodec/ituh263dec.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/libavcodec/ituh263dec.c b/libavcodec/ituh263dec.c
index 4a8bbf7..31951ab 100644
--- a/libavcodec/ituh263dec.c
+++ b/libavcodec/ituh263dec.c
@@ -928,8 +928,9 @@ int ff_h263_decode_picture_header(MpegEncContext *s)
     }
     /* temporal reference */
     i = get_bits(&s->gb, 8); /* picture timestamp */
-    if( (s->picture_number&~0xFF)+i < s->picture_number)
-        i+= 256;
+
+    i -= (i - (s->picture_number & 0xFF) + 128) & ~0xFF;
+
     s->picture_number= (s->picture_number&~0xFF) + i;
 
     /* PTYPE starts here */



More information about the ffmpeg-cvslog mailing list