Allow encoding frames with more than 2800 lines.
authorMartin Fiedler <martin.fiedler@gmx.net>
Sun, 20 Sep 2009 14:08:44 +0000 (14:08 +0000)
committerCarl Eugen Hoyos <cehoyos@rainbow.studorg.tuwien.ac.at>
Sun, 20 Sep 2009 14:08:44 +0000 (14:08 +0000)
Patch by Martin Fiedler, martin fiedler gmx net

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

libavcodec/mpeg12enc.c

index 013b395..eacb5bb 100644 (file)
@@ -327,7 +327,12 @@ static av_always_inline void put_qscale(MpegEncContext *s)
 }
 
 void ff_mpeg1_encode_slice_header(MpegEncContext *s){
+    if (s->height > 2800) {
+        put_header(s, SLICE_MIN_START_CODE + (s->mb_y & 127));
+        put_bits(&s->pb, 3, s->mb_y >> 7);  /* slice_vertical_position_extension */
+    } else {
     put_header(s, SLICE_MIN_START_CODE + s->mb_y);
+    }
     put_qscale(s);
     put_bits(&s->pb, 1, 0); /* slice extra information */
 }