[SCM] libav/experimental: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spotting my mistake.

siretart at users.alioth.debian.org siretart at users.alioth.debian.org
Sun Jun 30 16:43:32 UTC 2013


The following commit has been merged in the experimental branch:
commit 0127b86108c3e2c7b63c7996b10c62877030b706
Author: Michael Niedermayer <michaelni at gmx.at>
Date:   Wed Apr 8 20:48:44 2009 +0000

    Fix mb_height for interlaced mpeg2.
    This correctly fixes issue961, thanks to steven warren for spotting my mistake.
    
    Originally committed as revision 18381 to svn://svn.ffmpeg.org/ffmpeg/trunk

diff --git a/libavcodec/mpeg12.c b/libavcodec/mpeg12.c
index f4e4958..573ae32 100644
--- a/libavcodec/mpeg12.c
+++ b/libavcodec/mpeg12.c
@@ -1160,7 +1160,7 @@ typedef struct Mpeg1Context {
     int slice_count;
     int swap_uv;//indicate VCR2
     int save_aspect_info;
-    int save_width, save_height;
+    int save_width, save_height, save_progressive_seq;
     AVRational frame_rate_ext;       ///< MPEG-2 specific framerate modificator
 
 } Mpeg1Context;
@@ -1238,6 +1238,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){
         s1->save_width != s->width ||
         s1->save_height != s->height ||
         s1->save_aspect_info != s->aspect_ratio_info||
+        s1->save_progressive_seq != s->progressive_sequence ||
         0)
     {
 
@@ -1256,6 +1257,7 @@ static int mpeg_decode_postinit(AVCodecContext *avctx){
         s1->save_aspect_info = s->aspect_ratio_info;
         s1->save_width = s->width;
         s1->save_height = s->height;
+        s1->save_progressive_seq = s->progressive_sequence;
 
         /* low_delay may be forced, in this case we will have B-frames
          * that behave like P-frames. */
diff --git a/libavcodec/mpegvideo.c b/libavcodec/mpegvideo.c
index bf1831f..e1bec68 100644
--- a/libavcodec/mpegvideo.c
+++ b/libavcodec/mpegvideo.c
@@ -444,6 +444,9 @@ av_cold int MPV_common_init(MpegEncContext *s)
 {
     int y_size, c_size, yc_size, i, mb_array_size, mv_table_size, x, y, threads;
 
+    if(s->codec_id == CODEC_ID_MPEG2VIDEO && !s->progressive_sequence)
+        s->mb_height = (s->height + 31) / 32 * 2;
+    else
     s->mb_height = (s->height + 15) / 16;
 
     if(s->avctx->pix_fmt == PIX_FMT_NONE){

-- 
Libav/FFmpeg packaging



More information about the pkg-multimedia-commits mailing list