[FFmpeg-cvslog] mpeg4videodec: Parse newpred headers

Michael Niedermayer git at videolan.org
Sun Aug 11 17:46:42 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Aug 11 17:35:30 2013 +0200| [8e119a22c48295507aa2b54954b4c5e525ec3a2f] | committer: Michael Niedermayer

mpeg4videodec: Parse newpred headers

This is untested due to lack of a non broken file using new pred

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavcodec/mpeg4videodec.c |   17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/libavcodec/mpeg4videodec.c b/libavcodec/mpeg4videodec.c
index 63508ef..84a0dac 100644
--- a/libavcodec/mpeg4videodec.c
+++ b/libavcodec/mpeg4videodec.c
@@ -356,6 +356,17 @@ static int mpeg4_decode_sprite_trajectory(MpegEncContext * s, GetBitContext *gb)
     return 0;
 }
 
+static int decode_new_pred(MpegEncContext *s, GetBitContext *gb){
+    int len = FFMIN(s->time_increment_bits + 3, 15);
+
+    get_bits(gb, len);
+    if (get_bits1(gb))
+        get_bits(gb, len);
+    check_marker(gb, "after new_pred");
+
+    return 0;
+}
+
 /**
  * Decode the next video packet.
  * @return <0 if something went wrong
@@ -438,7 +449,8 @@ int ff_mpeg4_decode_video_packet_header(MpegEncContext *s)
             }
         }
     }
-    //FIXME new-pred stuff
+    if (s->new_pred)
+        decode_new_pred(s, &s->gb);
 
     return 0;
 }
@@ -2024,6 +2036,9 @@ static int decode_vop_header(MpegEncContext *s, GetBitContext *gb){
             av_log(s->avctx, AV_LOG_ERROR, "vop not coded\n");
         return FRAME_SKIPPED;
     }
+    if (s->new_pred)
+        decode_new_pred(s, gb);
+
     if (s->shape != BIN_ONLY_SHAPE && ( s->pict_type == AV_PICTURE_TYPE_P
                           || (s->pict_type == AV_PICTURE_TYPE_S && s->vol_sprite_usage==GMC_SPRITE))) {
         /* rounding type for motion estimation */



More information about the ffmpeg-cvslog mailing list