Browse code

mpeg1 overflowing dc coeff fix

Originally committed as revision 2674 to svn://svn.ffmpeg.org/ffmpeg/trunk

Michael Niedermayer authored on 2004/01/07 06:16:59
Showing 1 changed files
... ...
@@ -197,11 +197,16 @@ AVStream *add_video_stream(AVFormatContext *oc, int codec_id)
197 197
     c->frame_rate = STREAM_FRAME_RATE;  
198 198
     c->frame_rate_base = 1;
199 199
     c->gop_size = 12; /* emit one intra frame every twelve frames at most */
200
-    if (c->codec_id == CODEC_ID_MPEG1VIDEO ||
201
-        c->codec_id == CODEC_ID_MPEG2VIDEO) {
200
+    if (c->codec_id == CODEC_ID_MPEG2VIDEO) {
202 201
         /* just for testing, we also add B frames */
203 202
         c->max_b_frames = 2;
204 203
     }
204
+    if (c->codec_id == CODEC_ID_MPEG1VIDEO){
205
+        /* needed to avoid using macroblocks in which some coeffs overflow 
206
+           this doesnt happen with normal video, it just happens here as the 
207
+           motion of the chroma plane doesnt match the luma plane */
208
+        c->mb_decision=2;
209
+    }
205 210
     // some formats want stream headers to be seperate
206 211
     if(!strcmp(oc->oformat->name, "mp4") || !strcmp(oc->oformat->name, "mov") || !strcmp(oc->oformat->name, "3gp"))
207 212
         c->flags |= CODEC_FLAG_GLOBAL_HEADER;