From: <th...@sh...> - 2005-05-25 20:22:25
|
Hi! I have a question about the YUV420 chrominance field of an interlaced picture. Consider a picture where the top field lines are red and the bottom field lines are green. If this image was coded in mpeg2 in an interlaced field fashion (As an I-P pair) all would be well, The fields would be separate images all red and all green. However if they are mixed together in a frame format, as is done for interlaced streams by the libmpeg2 decoder and some hardware decoders, what would happen to the picture as the chroma field is subsampled 2 by 2? Would the colors mix and both fields turn yellow or how are the colors distinguished between the two fields? If anybody could shed some light on this I'd be thankful. /Thomas |
From: Billy B. <ve...@du...> - 2005-05-26 12:08:48
|
Thomas Hellstr=F6m (th...@sh...): > I have a question about the YUV420 chrominance field of an interlaced > picture. >=20 > Consider a picture where the top field lines are red and the bottom > field lines are green. >=20 > If this image was coded in mpeg2 in an interlaced field fashion (As an > I-P pair) all would be well, The fields would be separate images all > red and all green. >=20 > However if they are mixed together in a frame format, as is done for > interlaced streams by the libmpeg2 decoder and some hardware decoders, > what would happen to the picture as the chroma field is subsampled 2 > by 2? Would the colors mix and both fields turn yellow or how are the > colors distinguished between the two fields? In 4:2:0, if you know that the content is interlaced, then every second chroma scanline should be from the other field. The frame you have is two fields and needs to be displayed as two separate images (one red, one green). The MPEG-2 spec describes how chroma is interlaced, but it's the obvious way. -Billy |
From: Thomas <uni...@sh...> - 2005-05-26 12:57:34
|
Hi! > Thomas Hellstr=F6m (th...@sh...): > >> I have a question about the YUV420 chrominance field of an interlaced >> picture. >> >> Consider a picture where the top field lines are red and the bottom >> field lines are green. >> >> If this image was coded in mpeg2 in an interlaced field fashion (As an >> I-P pair) all would be well, The fields would be separate images all >> red and all green. >> >> However if they are mixed together in a frame format, as is done for >> interlaced streams by the libmpeg2 decoder and some hardware decoders, >> what would happen to the picture as the chroma field is subsampled 2 >> by 2? Would the colors mix and both fields turn yellow or how are the >> colors distinguished between the two fields? > > In 4:2:0, if you know that the content is interlaced, then every > second chroma scanline should be from the other field. The frame you > have is two fields and needs to be displayed as two separate images (on= e > red, one green). > > The MPEG-2 spec describes how chroma is interlaced, but it's the > obvious way. > > -Billy > Thanks. So am I then correct in assuming that just blindly sending off a composited interlaced frame YUV420 image to Xv, for example, would give color artefacts, two red lines followed by two green etc.. /Thomas > > ------------------------------------------------------- > SF.Net email is sponsored by: GoToMeeting - the easiest way to collabor= ate > online with coworkers and clients while avoiding the high cost of trave= l > and > communications. There is no equipment to buy and you can meet as often = as > you want. Try it free.http://ads.osdn.com/?ad_idt02&alloc_id=16135&op=3D= click > _______________________________________________ > xine-devel mailing list > xin...@li... > https://lists.sourceforge.net/lists/listinfo/xine-devel > |
From: Billy B. <ve...@du...> - 2005-05-26 13:13:07
|
Thomas Hellstr=F6m (uni...@sh...): > > In 4:2:0, if you know that the content is interlaced, then every > > second chroma scanline should be from the other field. The frame > > you have is two fields and needs to be displayed as two separate > > images (one red, one green). >=20 > So am I then correct in assuming that just blindly sending off a > composited interlaced frame YUV420 image to Xv, for example, would > give color artefacts, two red lines followed by two green etc.. It would look like crap, yes. You should ideally split each frame into two fields and send them each one at a time to Xv at a smooth framerate. -Billy |
From: Miguel F. <mfr...@gm...> - 2005-05-26 13:29:58
|
Hi Thomas, On 5/26/05, Thomas Hellstr=F6m <uni...@sh...> wrote: > > In 4:2:0, if you know that the content is interlaced, then every > > second chroma scanline should be from the other field. The frame you > > have is two fields and needs to be displayed as two separate images (on= e > > red, one green). > > > > The MPEG-2 spec describes how chroma is interlaced, but it's the > > obvious way. > > > > -Billy > > >=20 > Thanks. > So am I then correct in assuming that just blindly sending off a > composited interlaced frame YUV420 image to Xv, for example, would give > color artefacts, two red lines followed by two green etc.. afair, my video card (matrox) assumed that the Xv YUV420 image is always progressive, therefore giving these color artefacts you say. if you want to make some tests about this, check our yv12_to_yuy2 conversion function (src/xine-utils/color.c). there is a "progressive" parameter so it should perform the correct conversion depending on the image source... =20 Miguel |
From: Peter G. <pgu...@el...> - 2005-05-26 11:24:16
|
For interlaced video 4:2:0 chroma is also interlaced. More than that, chroma values are biased 1/4 to a corresponding field. You may read the MPEG-2 video standard, but you can also check upsampling code at ftp://ftp.mpegtv.com/pub/mpeg/mssg/mpeg2vidcodec_v12.tar.gz (src/mpeg2dec/store.c, convert420to422()) to get some idea how interlaced video is handled in MPEG standards. Peter Thomas Hellström wrote: > Hi! > > I have a question about the YUV420 chrominance field of an interlaced > picture. > > Consider a picture where the top field lines are red and the bottom > field lines are green. > > If this image was coded in mpeg2 in an interlaced field fashion (As an > I-P pair) all would be well, The fields would be separate images all > red and all green. > > However if they are mixed together in a frame format, as is done for > interlaced streams by the libmpeg2 decoder and some hardware decoders, > what would happen to the picture as the chroma field is subsampled 2 > by 2? Would the colors mix and both fields turn yellow or how are the > colors distinguished between the two fields? > > If anybody could shed some light on this I'd be thankful. > > /Thomas > > > > > > ------------------------------------------------------- > SF.Net email is sponsored by: GoToMeeting - the easiest way to > collaborate > online with coworkers and clients while avoiding the high cost of > travel and > communications. There is no equipment to buy and you can meet as often as > you want. Try it > free.http://ads.osdn.com/?ad_id=7402&alloc_id=16135&op=click > _______________________________________________ > xine-devel mailing list > xin...@li... > https://lists.sourceforge.net/lists/listinfo/xine-devel |
From: Thomas <uni...@sh...> - 2005-05-27 08:34:32
|
Hi! > For interlaced video 4:2:0 chroma is also interlaced. More than that, > chroma values are biased 1/4 to a corresponding field. You may read the > MPEG-2 video standard, but you can also check upsampling code at > ftp://ftp.mpegtv.com/pub/mpeg/mssg/mpeg2vidcodec_v12.tar.gz > (src/mpeg2dec/store.c, convert420to422()) to get some idea how > interlaced video is handled in MPEG standards. > > Peter > Thanks. The reason I'm asking is not really that I'm going to code something like this myself, but rather to understand how the hardware video engines handle this, and how to trick the Unichrome Pro hardware deintelacer to start working :) If I understand all of this correctly, as xine typically sends an interlaced frame as a standard Xv image, unless deinterlacing is active, there should be some color artefacts. Ideally, both Xv and XvMC should have a flag (progressive_frame?) for eac= h frame sent to tell the hardware how to handle the image. At least the Unichrome video engines seem to have a flag UV_FIELD that I guess should be set if the chroma data is interlaced, but there doesn't seem to be anything in the Xv / XvMC API that allows this flag to be sent with a picture. One option would be to have an optional Xv / XvMC attribute that the player could toggle depending on the image format. /Thomas |