MPEG Video Compression Standard

Figure 10.7 shows the syntax for the group of pictures header. The data elements have the same meaning as the MPEG-1 GOP (see Figure 8.7). The closed_gop flag is set to 1 if the pictures in the GOP do not depend on pictures outside the GOP. Thus, if B-pictures preceding the first I-picture in the GOP (in display order) depend only upon backward motion vectors, the closed_gop flag is set to 1 . It is set to 0 if forward motion vectors are used, because these vectors reference pictures outside the group.
group_of_pictures_header() { /* from ISO 13818--2 6.2.2.6 */ group_start_code (32); /* r/w 0x000001B8 */ time_code (25); /* r/w time code */ closed_gop(1); ...