[FFmpeg-cvslog] r21836 - in trunk/libavcodec: cavs.h cavsdec.c

stefang subversion
Mon Feb 15 17:43:45 CET 2010


Author: stefang
Date: Mon Feb 15 17:43:45 2010
New Revision: 21836

Log:
add heuristic to discern the old sample clips from streams encoded
with rm52j encoder, a marker_bit has been added in the I-Frame syntax

Modified:
   trunk/libavcodec/cavs.h
   trunk/libavcodec/cavsdec.c

Modified: trunk/libavcodec/cavs.h
==============================================================================
--- trunk/libavcodec/cavs.h	Mon Feb 15 17:37:13 2010	(r21835)
+++ trunk/libavcodec/cavs.h	Mon Feb 15 17:43:45 2010	(r21836)
@@ -160,6 +160,7 @@ typedef struct {
     int aspect_ratio;
     int mb_width, mb_height;
     int pic_type;
+    int stream_revision; ///<0 for samples from 2006, 1 for rm52j encoder
     int progressive;
     int pic_structure;
     int skip_mode_flag; ///< select between skip_count or one skip_flag per MB

Modified: trunk/libavcodec/cavsdec.c
==============================================================================
--- trunk/libavcodec/cavsdec.c	Mon Feb 15 17:37:13 2010	(r21835)
+++ trunk/libavcodec/cavsdec.c	Mon Feb 15 17:43:45 2010	(r21836)
@@ -483,6 +483,15 @@ static int decode_pic(AVSContext *h) {
         h->pic_type = FF_I_TYPE;
         if(get_bits1(&s->gb))
             skip_bits(&s->gb,24);//time_code
+        /* old sample clips were all progressive and no low_delay,
+           bump stream revision if detected otherwise */
+        if((s->low_delay) || !(show_bits(&s->gb,9) & 1))
+            h->stream_revision = 1;
+        /* similarly test top_field_first and repeat_first_field */
+        else if(show_bits(&s->gb,11) & 3)
+            h->stream_revision = 1;
+        if(h->stream_revision > 0)
+            skip_bits(&s->gb,1); //marker_bit
     }
     /* release last B frame */
     if(h->picture.data[0])



More information about the ffmpeg-cvslog mailing list