changeset 953:9eb066d6e0db libavcodec

mpeg4 header encoding bugfix
author michaelni
date Fri, 03 Jan 2003 23:21:52 +0000
parents f348d302a51e
children 13aec7e50c52
files avcodec.h h263.c mpegvideo.h
diffstat 3 files changed, 19 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/avcodec.h	Thu Jan 02 12:48:09 2003 +0000
+++ b/avcodec.h	Fri Jan 03 23:21:52 2003 +0000
@@ -5,8 +5,8 @@
 
 #define LIBAVCODEC_VERSION_INT 0x000406
 #define LIBAVCODEC_VERSION     "0.4.6"
-#define LIBAVCODEC_BUILD       4650
-#define LIBAVCODEC_BUILD_STR   "4650"
+#define LIBAVCODEC_BUILD       4651
+#define LIBAVCODEC_BUILD_STR   "4651"
 
 enum CodecID {
     CODEC_ID_NONE, 
@@ -147,6 +147,7 @@
 #define CODEC_FLAG_LOW_DELAY      0x00080000 /* force low delay / will fail on b frames */
 #define CODEC_FLAG_ALT_SCAN       0x00100000 /* use alternate scan */
 #define CODEC_FLAG_TRELLIS_QUANT  0x00200000 /* use trellis quantization */
+#define CODEC_FLAG_GLOBAL_HEADER  0x00400000 /* place global headers in extradata instead of every keyframe */
 
 /* codec capabilities */
 
@@ -894,7 +895,7 @@
      * decoding: unused
      */
     int last_predictor_count;
-    
+
     /**
      * pre pass for motion estimation
      * encoding: set by user.
@@ -902,6 +903,20 @@
      */
     int pre_me;
 
+    /**
+     * motion estimation pre pass compare function
+     * encoding: set by user.
+     * decoding: unused
+     */
+    int me_pre_cmp;
+    
+    /**
+     * ME pre pass diamond size & shape
+     * encoding: set by user.
+     * decoding: unused
+     */
+    int pre_dia_size;
+
 } AVCodecContext;
 
 typedef struct AVCodec {
--- a/h263.c	Thu Jan 02 12:48:09 2003 +0000
+++ b/h263.c	Fri Jan 03 23:21:52 2003 +0000
@@ -1727,11 +1727,9 @@
     int time_div, time_mod;
     
     if(s->pict_type==I_TYPE){
-        if(picture_number - s->last_vo_picture_number >= 300 || picture_number==0){
+        if(!(s->flags&CODEC_FLAG_GLOBAL_HEADER)){
             mpeg4_encode_visual_object_header(s);
             mpeg4_encode_vol_header(s, 0, 0);
-
-            s->last_vo_picture_number= picture_number;
         }
         mpeg4_encode_gop_header(s);
     }
--- a/mpegvideo.h	Thu Jan 02 12:48:09 2003 +0000
+++ b/mpegvideo.h	Fri Jan 03 23:21:52 2003 +0000
@@ -443,7 +443,6 @@
     INT8 (*field_select_table)[2];   /* wtf, no really another table for interlaced b frames */
     int t_frame;                     /* time distance of first I -> B, used for interlaced b frames */
     int padding_bug_score;           /* used to detect the VERY common padding bug in MPEG4 */
-    int last_vo_picture_number;      /* last picture number for which we added a VOS/VO/VOL header */
 
     /* divx specific, used to workaround (many) bugs in divx5 */
     int divx_version;