GOP (Group of pictures)

greenspun.com : LUSENET : Video CD : One Thread

The term GOP has emerged a few times in this forum but not at sufficient length for one to appreciate its importance. I would be dlighted if someone can explain briefly the phenomenon and tell us how it can affect the quality of an mpeg file.

Thanks in advance.

-- Daniel S Lee (siangneng@sp.edu.sg), January 14, 2000

Answers

I will resume since you can get deeper on this in any MPEG F.A.Q. A MPEG file is an array of frames as you know. This frames can be either I, P, or B.

I (intra)= full independent frames, much like a .JPEG picture. These frames are the main ones and the key for the other kinds to exist.

P (progressive)= it's built up of information related to previous I frames (or previous P frames also). The information in P frames is much like "this pixel has moved from here to there" without repeating the information of the pixel itself (technically not exactly this but you can think about it this way).

B (bidirectional)= it's built up of information related to both previous and/or future I or P frames, but B frames are not a reference for anyone, not even for themselves.

In MPEG it is legal almost any kind of arrangement with the order of the 3 kind of frames, but you have to balance quality vs filesize. A MPEG consisting only of I frames is mainly a M-JPEG file: great quality but heavy filesize. So you have to iterate some P and B frames between the I ones to save some bytes; but too many P and B frames and you'll end up with blockiness, "bloodiness", and nasty artifacts in the video.

Going back to your question, GOP is the number of P plus B frames between 2 consecutive I frames, plus 1. Given that you have a fixed bitrate, the larger the GOP, then more bits can be allocated for each I frame, thus having better I frames, but having also the drawbacks mentioned before. So, like everything, it's a matter of balance. A GOP of 15 is regularly used for 30fps/NTSC and a GOP of 12 for 25fps/PAL.

-- Matias (petrellm@telefonica.com.ar), January 14, 2000.


Thank you very much for your response.

If I understand you correctly, when GOP size is reduced, quality will increase. Would there be problem reducing the GOP size lower than 15 or 12? Does with order of the P and B frames within the group affect quality as well? Is there an ideal order for them?

Thanks once again.

-- Daniel S Lee (siangneng@sp.edu.sg), January 14, 2000.


Daniel: Sure you can try reducing the GOP. But if you say "so reducing GOP will improve picture quality", allow me this comparisson:

You have a budget of $70 a week (a.k.a. bitrate) for your lunch. There are 3 restaurants: "Elegant's" (a.k.a. I frames), "Average's" (a.k.a. P frames), and "McDonalds" (a.k.a. B frames). You must choose one of these restaurants each day of the week.

Would you think that choosing "Elegant's" every day (a.k.a. GOP=1) will lead to a better lunch (a.k.a. quality)?? No, because with 10 bucks per lunch the best food you will have at this excellent restaurant is bread with butter.

On the other hand, if you have some of your lunchs at McDonald's and Average's (a.k.a. larger GOP)you will save more money and thus have a pretty good lunch at Elegant's once or twice a week. Got the hint? ;-)

A small GOP doesn't lead to good quality "per se" unless you have a very large bitrate (like having a budget of $700 instead of $70), but this is not the case in the world of VCD. Have in mind that P and B frames use the information stored inside the I frames, so the better the I frames, the better will be the P and B ones. A large GOP leads to better I frames.

But also, P and B frames both have bad handling of abrupt scene changes or fastmoving pans, so too many of these ones and you'll have blockiness and bloodiness (moving objects that leave an anoying trail).

At the end, slightly reducing the GOP may be desirable with sports/fastmoving/amateur videos; and slightly increasing GOP may be desirable with talkingheads/slowmoving/landscape/professional videos. As I said before, it's a matter of balance. Perform some testing and decide for youself. Good luck!!

-- Matias (petrellm@telefonica.com.ar), January 17, 2000.


Moderation questions? read the FAQ