r18381 - in trunk/libavcodec: mpeg12.c mpegvideo.c
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381 Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake. Modified: trunk/libavcodec/mpeg12.c trunk/libavcodec/mpegvideo.c Modified: trunk/libavcodec/mpeg12.c ============================================================================== --- trunk/libavcodec/mpeg12.c Wed Apr 8 22:26:18 2009 (r18380) +++ trunk/libavcodec/mpeg12.c Wed Apr 8 22:48:44 2009 (r18381) @@ -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(AVCodecC 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(AVCodecC 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. */ Modified: trunk/libavcodec/mpegvideo.c ============================================================================== --- trunk/libavcodec/mpegvideo.c Wed Apr 8 22:26:18 2009 (r18380) +++ trunk/libavcodec/mpegvideo.c Wed Apr 8 22:48:44 2009 (r18381) @@ -444,6 +444,9 @@ av_cold int MPV_common_init(MpegEncConte { 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){
Hi Michael, On 4/8/2009 1:48 PM, michael wrote:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake.
Frist, thanks a lot for the fix.
Modified: trunk/libavcodec/mpegvideo.c ============================================================================== --- trunk/libavcodec/mpegvideo.c Wed Apr 8 22:26:18 2009 (r18380) +++ trunk/libavcodec/mpegvideo.c Wed Apr 8 22:48:44 2009 (r18381) @@ -444,6 +444,9 @@ av_cold int MPV_common_init(MpegEncConte { 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){
Would you mind if I reindent the code ? Also this apply to last commit for mpegvideo.h about this issue. Is the fix still needed/wanted ? -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA checking for life_signs in -lkenny... no FFmpeg maintainer http://www.ffmpeg.org
On Wed, Apr 08, 2009 at 03:09:02PM -0700, Baptiste Coudurier wrote: [...]
Modified: trunk/libavcodec/mpegvideo.c ============================================================================== --- trunk/libavcodec/mpegvideo.c Wed Apr 8 22:26:18 2009 (r18380) +++ trunk/libavcodec/mpegvideo.c Wed Apr 8 22:48:44 2009 (r18381) @@ -444,6 +444,9 @@ av_cold int MPV_common_init(MpegEncConte { 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){
Would you mind if I reindent the code ?
feel free to fix as much wrong indention as you like, iam always happy if i dont have to :) (note i mean just really wrong, i dont mean nitpicking about { and spaces before and after and such)
Also this apply to last commit for mpegvideo.h about this issue. Is the fix still needed/wanted ?
the last fix is still wanted, yes [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB The misfortune of the wise is better than the prosperity of the fool. -- Epicurus
On Thu, Apr 09, 2009 at 02:09:08AM +0200, Michael Niedermayer wrote:
On Wed, Apr 08, 2009 at 03:09:02PM -0700, Baptiste Coudurier wrote: [...]
Modified: trunk/libavcodec/mpegvideo.c ============================================================================== --- trunk/libavcodec/mpegvideo.c Wed Apr 8 22:26:18 2009 (r18380) +++ trunk/libavcodec/mpegvideo.c Wed Apr 8 22:48:44 2009 (r18381) @@ -444,6 +444,9 @@ av_cold int MPV_common_init(MpegEncConte { 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){
Would you mind if I reindent the code ?
feel free to fix as much wrong indention as you like, iam always happy if i dont have to :)
(note i mean just really wrong, i dont mean nitpicking about { and spaces before and after and such)
Done. [...] -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA checking for life_signs in -lkenny... no FFmpeg maintainer http://www.ffmpeg.org
On 4/8/2009 1:48 PM, michael wrote:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake.
I believe this commit broke interlaced encoding in 320x240. I'm investigating. ffmpeg -i <file> -flags +ildct test.m2v ffplay test.m2v: [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA FFmpeg maintainer http://www.ffmpeg.org
Baptiste Coudurier wrote:
On 4/8/2009 1:48 PM, michael wrote:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake.
I believe this commit broke interlaced encoding in 320x240. I'm investigating.
ffmpeg -i <file> -flags +ildct test.m2v
ffplay test.m2v:
[mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors
And here is the patch. -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA FFmpeg maintainer http://www.ffmpeg.org
On 5/20/2009 10:58 PM, Baptiste Coudurier wrote:
Baptiste Coudurier wrote:
On 4/8/2009 1:48 PM, michael wrote:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake. I believe this commit broke interlaced encoding in 320x240. I'm investigating.
ffmpeg -i <file> -flags +ildct test.m2v
ffplay test.m2v:
[mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors
And here is the patch.
Any problem with it ? It will fix non mod 32 interlaced encoding. -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA FFmpeg maintainer http://www.ffmpeg.org
On Wed, May 20, 2009 at 10:58:49PM -0700, Baptiste Coudurier wrote:
Baptiste Coudurier wrote:
On 4/8/2009 1:48 PM, michael wrote:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake.
I believe this commit broke interlaced encoding in 320x240. I'm investigating.
ffmpeg -i <file> -flags +ildct test.m2v
ffplay test.m2v:
[mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors
And here is the patch. [...] mpegvideo_enc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 3e24f4fec2798ee5c2246bed821de13401d82179 interlaced_encoding_not_mul32.patch
ok [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Complexity theory is the science of finding the exact solution to an approximation. Benchmarking OTOH is finding an approximation of the exact
Michael Niedermayer wrote:
On Wed, May 20, 2009 at 10:58:49PM -0700, Baptiste Coudurier wrote:
Baptiste Coudurier wrote:
On 4/8/2009 1:48 PM, michael wrote:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake. I believe this commit broke interlaced encoding in 320x240. I'm investigating.
ffmpeg -i <file> -flags +ildct test.m2v
ffplay test.m2v:
[mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors [mpeg2video @ 0x9bb320]Warning MVs not available [mpeg2video @ 0x9bb320]concealing 20 DC, 20 AC, 20 MV errors
And here is the patch. [...] mpegvideo_enc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 3e24f4fec2798ee5c2246bed821de13401d82179 interlaced_encoding_not_mul32.patch
ok
Thanks, applied. -- Baptiste COUDURIER GnuPG Key Id: 0x5C1ABAAA Key fingerprint 8D77134D20CC9220201FC5DB0AC9325C5C1ABAAA FFmpeg maintainer http://www.ffmpeg.org
michael <subversion <at> mplayerhq.hu> writes:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake.
This also broke VCR2 decoding: The u-v swap does not work anymore. To test it, both 8865 and 18381 have to be reverted (or the three relevant lines in 1255ff commented out). Carl Eugen
On Sun, Jan 24, 2010 at 07:47:59PM +0000, Carl Eugen Hoyos wrote:
michael <subversion <at> mplayerhq.hu> writes:
Author: michael Date: Wed Apr 8 22:48:44 2009 New Revision: 18381
Log: Fix mb_height for interlaced mpeg2. This correctly fixes issue961, thanks to steven warren for spoting my mistake.
This also broke VCR2 decoding: The u-v swap does not work anymore. To test it, both 8865 and 18381 have to be reverted (or the three relevant lines in 1255ff commented out).
maybe the newly added vars have to be set in vcr2_init_sequence() commit welcome if thats it [...] -- Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB Thouse who are best at talking, realize last or never when they are wrong.
Michael Niedermayer <michaelni <at> gmx.at> writes:
This also broke VCR2 decoding: The u-v swap does not work anymore. To test it, both 8865 and 18381 have to be reverted (or the three relevant lines in 1255ff commented out).
maybe the newly added vars have to be set in vcr2_init_sequence() commit welcome if thats it
Done. Thank you for the hint, Carl Eugen
participants (4)
-
baptiste.coudurier@gmail.com -
cehoyos@ag.or.at -
michaelni@gmx.at -
subversion@mplayerhq.hu