5
$\begingroup$

I am wondering what would be the right approach to extract top and bottom fields from a YUV 4:2:0 frame.

In the YUV 4:2:0 representation, Luma and Chroma samples are located as shown below:

Y Y Y Y Y Y Y Y
c     c     c    c
Y Y Y Y Y Y Y Y

Y Y Y Y Y Y Y Y
c     c     c    c
Y Y Y Y Y Y Y Y

Hence, one needs to be careful while extracting chroma top and bottom fields (due to the chroma offset problem). I have tried a few methods (using asymmetric filters and such), but none have been satisfactory.

Are there some good resources (papers) on this problem?

$\endgroup$
2
$\begingroup$

Assuming the encoder properly low-pass filtered the chroma before sampling (which may not always be true), chroma samples from the adjacent macroblocks might need to be used to properly reconstruct (interpolate) any per pixel color. Those samples may exist due to motion compensation from previous fields, or might need to be inferred by reflecting, duplicating or extrapolating edge data.

$\endgroup$
0
$\begingroup$

Here is a quick reference that shows difference between various chroma formats - 4:2:0, 4:2:2 etc. As can be seen that in both cases, chroma samples are not aligned with the luma samples. Hence, for proper pixels reproduction filtering is required before the display can be applied.

Probably one of the best source to look at is the MSSG (MPEG software simulation group) which is an official reference code base for MPEG 1 & 2 encoding and decoding. If you look at the code, you will realize the conversion from the 4:2:0 to 4:4:4 is done in two steps i.e. 4:2:0 to 4:2:2 and then 4:2:2 to 4:4:4 (horizontal). It uses 5 stage poly phase FIR filter which you can sneak into the code.

However, the standard doesn't really specify which filter should be applied. Here is one of the best reference that describes the effect of different filtering and provides further references as well.

Accordingly,

In practice, chroma subsampling artifacts for 4:2:2 and progressive 4:2:0 formats are rarely noticed even where it is poorly implemented (e.g. with nearest neighbour or box resampling). In particular, 4:2:2 is commonly referred to (and sometimes marketed) as “visually lossless”, even though it is not actually visually lossless in all circumstances (e.g. red text on a black background) [6]. But while chroma subsampling is not entirely visually lossless, it seems to be good enough that many people do not notice otherwise.

...

On the other hand, 4:1:1 and interlaced 4:2:0 formats can be problematic as they effectively subsample the chroma by 4X in one direction (interlaced 4:2:0 effectively subsamples 4X vertically since each interlaced field is subsampled individually).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.