PDA

View Full Version : How to detect Field order ?


GZZ
27th February 2003, 23:18
I have been looking alot at vob files and notice that you can read the field order from the vob file. But bitrate viewer also do this. But it sometimes report the field order wrong. Anyone know how to properly read the field order from the vob file or maybe it change duing the movie ?


GZZ

Xesdeeni
28th February 2003, 15:08
Field order is a strange beast. Normally, fields come sequentially, alternating between even and odd. There is a steady stream of fields that started before your TV was turned on (or you tuned the current channel) and will continue after your TV has moved on. Which field is "first" depends on when you tuned in.

However, we like to group our fields into pairs called frames for a variety of reasons. And Murphy's law dictates that if there are two ways of doing something, some people will do each. So, some people grabbed an even and the next odd to make their frames, while others grabbed an odd and the next even to make their frames. As a result, for any given device that handles frames, the order of the fields within the frame must be either implicitly or explicitly defined.

As I understand it, the field order for DV is bottom field first. (I'm switching from the more ambiguous even/odd to the more descriptive top/bottom when I want to be specific.) The field order for DVDs is top field first.

Since the field polarity is indicated in the analog signal, it is technially possible to change field order in mid-stream by outputting two odd or two even fields (it's even possible to output only one type of field, which is what old video game consoles did). But if the order of the fields changed mid-stream, the TV would need to re-sync, which would cause a visible glitch of some type (depending on the display, this could be barely visible or extremely obvious). So I believe this is avoided like the plague.

For DVDs, the field order only really applies if the DVD is encoded as interlaced. If the DVD is encoded progressively, the player can actually output either field first (although there are usually flags in the stream that indicate a preferred order).

So A) the field order from a DVD should always be top field first, and B) the field order should never change.

Xesdeeni

GZZ
1st March 2003, 00:53
Thanks for the info, but it might don't change and might be Top field first.


A)
But the problem is to detect the correct settings. Must times Extra on PAL DVDs are interlaced and Buttom Field (not top field). My point is how to detect it from the vob file. if you look a mpucoder site about reading info in the vob file you will notice a byte which tell you if it top or bottom field order. But if you use this info, its sometime not correct. :(

B)
But I could understand on your little 'speech' that if the frame a progressiv, the field order is ALWAYS Top Field first ????

mpucoder
1st March 2003, 02:04
Each and every frame in an interlace sequence has (among others) a flag called TFF (Top Field First). If set the fields of the frame are to be inserted into the display sequence starting with the top field. And if clear, the opposite. The flag is used in conjunction with RFF (Repeat First Field) for pulldown. Normally the very first frame of a sequnce, whether it is pulldown or not, should have TFF set, and RFF clear. This may be what bitrate viewer is looking at, since, if TFF is not set, it would mean the bottom field would display first. That can lead to problems, since the player should begin decoding when it is ready to display the top field, ending up with the bottom field in the first display frame, and the top field in the next..
If the source is truly bottom field first, then the first frame should be encoded with a generated top field (black, interpolated, or duplicate of bottom) to start things off right. Or the very first (bottom) field can be discarded.

Bottom line - the DVD player begins displaying each sequence with the top field. If sequences are butted together and the previous sequence created an odd number of displayed fields, an extra bottom field is generated before the next sequence begins.

B) A progressive frame, although encoded as 2 fields, has no temporal order to the fields. Still, the TFF flag should be set properly to account for the decoder wanting to display the top field first.