From: Miguel F. <mig...@us...> - 2003-06-11 23:09:00
|
Update of /cvsroot/xine/xine-lib/src/libffmpeg In directory sc8-pr-cvs1:/tmp/cvs-serv5062/src/libffmpeg Modified Files: xine_decoder.c Log Message: - add VO_INTERLACED_FLAG to get_frame - do not trust progressive_frame for detecting NTSC 3:2, quote: 'the alternating progressive_frame encoding problem. This is a problem where the progressive_frame flag alternates between true and false every frame, when it really should have been set to "true" all the time.' 'There is a lot of content that is affected by this issue, because it's caused by a dumb decision by a very big company that made a very popular MPEG encoder. They've since fixed the encoder, but there are apparently still authoring companies that use it, because the problem is on a lot of high-profile current discs, like Disney's "Monsters Inc." and "Beauty and the Beast".' http://www.hometheaterhifi.com/volume_8_2/dvd-benchmark-special-report-chroma-bug-4-2001.html Index: xine_decoder.c =================================================================== RCS file: /cvsroot/xine/xine-lib/src/libffmpeg/xine_decoder.c,v retrieving revision 1.123 retrieving revision 1.124 diff -u -r1.123 -r1.124 --- xine_decoder.c 6 Jun 2003 19:42:04 -0000 1.123 +++ xine_decoder.c 11 Jun 2003 23:08:56 -0000 1.124 @@ -101,6 +101,7 @@ float aspect_ratio; int xine_aspect_ratio; + int frame_flags; int output_format; yuv_planes_t yuv; @@ -166,7 +167,7 @@ height, this->xine_aspect_ratio, this->output_format, - VO_BOTH_FIELDS); + VO_BOTH_FIELDS|this->frame_flags); /* use drawn as a decoder flag. * if true: free this frame on release_buffer. @@ -804,6 +805,26 @@ /* decode video frame(s) */ + + /* flag for interlaced streams */ + this->frame_flags = 0; + /* FIXME: which codecs can be interlaced? + FIXME: check interlaced DCT and other codec specific info. */ + switch( codec_type ) { + case BUF_VIDEO_DV: + this->frame_flags |= VO_INTERLACED_FLAG; + break; + case BUF_VIDEO_MPEG: + this->frame_flags |= VO_INTERLACED_FLAG; + break; + case BUF_VIDEO_MJPEG: + this->frame_flags |= VO_INTERLACED_FLAG; + break; + case BUF_VIDEO_HUFFYUV: + this->frame_flags |= VO_INTERLACED_FLAG; + break; + } + /* skip decoding b frames if too late */ this->context->hurry_up = (this->skipframes > 2) ? 1:0; @@ -888,7 +909,7 @@ this->context->height, this->xine_aspect_ratio, this->output_format, - VO_BOTH_FIELDS); + VO_BOTH_FIELDS|this->frame_flags); free_img = 1; } @@ -911,7 +932,7 @@ img->height, this->xine_aspect_ratio, this->output_format, - VO_BOTH_FIELDS); + VO_BOTH_FIELDS|this->frame_flags); free_img = 1; img->bad_frame = 0; } @@ -937,14 +958,6 @@ img->pts = buf->pts; buf->pts = 0; img->duration = this->video_step; - - /* FIXME: which codecs can be interlaced? - FIXME: check interlaced DCT and other codec specific info. */ - if( codec_type == BUF_VIDEO_DV || - codec_type == BUF_VIDEO_MPEG || - codec_type == BUF_VIDEO_MJPEG || - codec_type == BUF_VIDEO_HUFFYUV ) - img->progressive_frame = 0; this->skipframes = img->draw(img, this->stream); if( this->skipframes < 0 ) |