Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[linuxtv-softmpeg] Re: Chroma artifacting



Peter Urbanec wrote:

I'll have a read of the standard to see if I can get a clear answer on how the streams are supposed to be encoded.

OK. Got a bit more info. It would appear that the coding of fields and frames can pretty much switch at any point in the video sequence. The chroma and luma ordering is different depending on whether the picture is progressive, or top_field_first=0 or 1. In particular, half the chroma samples for the first field actually reside in the second field which is yet to be seen. The top field will always contain the first half of chroma samples - irrespective of whether it comes first or second.

I have not had a chance to actually take a look at what the libsoftmpeg code does. I figured I'll share the information I have, just in case someone else gets a chance to investigate the source code before I can. I probably won't have any time to look at the code for the next month or so - I am flat out getting our product finished for NAB.

Excerpts from the Standard:

6.1.1.1 Progressive and interlaced sequences

This Specification deals with coding of both progressive and interlaced sequences. The output of the decoding process, for interlaced sequences, consists of a series of reconstructed fields that are separated in time by a field period. The two fields of a frame may be coded separately (field-pictures). Alternatively the two fields may be coded together as a frame (frame-pictures). Both frame pictures and field pictures may be used in a single video sequence. In progressive sequences each picture in the sequence shall be a frame picture. The sequence, at the output of the decoding process, consists of a series of reconstructed frames that are separated in time by a frame period.

6.1.1.8 4:2:0 format

In this format the Cb and Cr matrices shall be one half the size of the Y-matrix in both horizontal and vertical dimensions. The Y-matrix shall have an even number of lines and samples.

NOTE - When interlaced frames are coded as field pictures, the picture reconstructed from each of these field pictures shall have a Y-matrix with half the number of lines as the corresponding frame. Thus, the total number of lines in the Y-matrix of an entire frame shall be divisible by four.

The luminance and chrominance samples are positioned as shown in Figure 6-l.

X Represents luminance samples
0 Represents chrominance samples

----------------
|X X|X X|X X|X X
|0 |0 |0 |0
|X X|X X|X X|X X
----------------
|X X|X X|X X|X X
|0 |0 |0 |0
|X X|X X|X X|X X
----------------
|X X|X X|X X|X X
|0 |0 |0 |0
|X X|X X|X X|X X
----------------

Figure 6-l - The position of luminance and chrominance samples - 4:2:0 data


In order to further specify the organisation, Figures 6-2 and 6-3 show the vertical and temporal positioning of the samples in an interlaced frame. Figure 6-4 shows the vertical and temporal positioning of the samples in a progressive frame. In each field of an interlaced frame, the chrominance samples do not lie (vertically) mid way between the luminance samples of the field, this is so that the spatial location of the chrominance samples in the frame is the same whether the frame is represented as a single frame-picture or two field-pictures.

Top Bottom
Field Field
X
0
X
X
0
X
X
0
X
X
0
--------->
Time

Figure 6-2 - Vertical and temporal positions of samples in an interlaced frame with top_field_first = 1



Bottom Top
Field Field
X
0
X
X
0
X
X
0
X
X
0
--------->
Time

Figure 6-3 - Vertical and temporal positions of samples in an interlaced frame with top_field_first = 0



Frame
X
0
X
X
0
X
X
0
X
X
0
X
------->
Time

Figure 6-4 - Vertical and temporal positions of samples in a progressive frame


--
"Beauty lies in the hands of the beer holder."




--
Info: To unsubscribe send a mail to ecartis@linuxtv.org with "unsubscribe linuxtv-softmpeg" as subject.



Home | Main Index | Thread Index