gaps in frame_num specified in clause 8.2.5.2. The variable FrameNumOffset is derived as specified by the following pseudo-code: if( IdrPicFlag == 1) FrameNumOffset = 0 else if( prevFrameNum > frame_num) (8-11) rameNumOffset=prevFrameNumOffset+MaxFrameNum = FrameNumOffset = prevFrameNumOffset The variable tempPicOrderCnt is derived as specified by the following pseudo-code: if( IdrPicFlag ==1) tempPicOrderCnt = 0 else if( nal ref idc = = 0) (8-12) tempPicOrderCnt 2* FrameNumOffset + frame_num) - 1 tempPicOrderCnt 2* *(FrameNumOffset+frame_num) Rec. ITU-T H.264 (01/2012) The variables TopFieldOrderCnt or BottomFieldOrderCnt are derived as specified by the following pseudo-code: if( !field_pic_flag) TopFieldOrderCnt=tempPicOrderCnt BottomFieldOrderCnt = tempPicOrderCnt (8-13) } else if( bottom_field_flag) BottomFieldOrderCnt=tempPicOrderCnt = TopFieldOrderCnt=tempPicOrderCnt NOTE 2 - Picture order count type 2 cannot be used in a coded video sequence that contains consecutive non-reference pictures that would result in more than one of these pictures having the same value of TopFieldOrderCnt or more than one of these pictures having the same value of BottomFieldOrderCnt. NOTE 3 - Picture order count type 2 results in an output order that is the same as the decoding order. 8.2.2 Decoding process for macroblock to slice group map Inputs to this process are the active picture parameter set and the slice header of the slice to be decoded. Output of this process is a macroblock to slice group map MbToSliceGroupMap. This process is invoked at the start of every slice. NOTE - The output of this process is equal for all slices of a picture. When num_slice_groups_minusl is equal to 1 and slice_group_map_type is equal to 3, 4, or 5, slice groups 0 and 1 have a size and shape determined by slice_group_change_direction_flagas shown in Table 8-1 and specified in clauses 8.2.2.4 to 8.2.2.6. Table 8-1 - Refined slice group map type slice_group_map_type slice_group_change_direction_flag refined slice group map type Box-out clockwi