artIdx. When the macroblock partitioning does not consist of sub-macroblocks, subMbPartIdx is set equal to 0. The following steps are specified for each macroblock partition or for each sub-macroblock partition. The functions MbPartWidth(), MbPartHeight(), SubMbPartWidth(), and SubMbPartHeight() describing the width and height of macroblock partitions and sub-macroblock partitions are specified in Tables 7-13, 7-14, 7-17, and 7-18. The range of the macroblock partition index mbPartIdx is derived as follows: If mb_type is equal to B_Skip or B_Direct_16x16, mbPartIdx proceeds over values 0..3. - Otherwise (mb_type is not equal to B_Skip or B_Direct_16x16), mbPartIdx proceeds over values 0..NumMbPart(mb_type) - 1. For each value of mbPartIdx, the variables partWidth and partHeight for each macroblock partition or sub-macroblock partition in the macroblock are derived as follows: If mb_type is not equal to P_8x8, P_8x8ref0, B_Skip, B_Direct_16x16, or B_8x8, subMbPartIdx is set equal to 0, and partWidth and partHeight are derived as: Rec. ITU-T H.264 (01/2012) partWidth=MbPartWidth(mb_type) (8-152) partHeight = MbPartHeight( mb_type) (8-153) Otherwise, if mb_type is equal to P 8x8 or P_8x8ref0, or mb_type is equal to B_8x8 and sub_mb_type[mbPartIdx] is not equal to B_Direct_8x8, subMbPartIdx proceeds over values 0..NumSubMbPart(sub_mb_type[mbPartIdx])-1, - and partWidth and partHeight are derived as: partWidth =SubMbPartWidth(sub_mb_type[ mbPartIdx (8-154) partHeight=SubMbPartHeight(sub_mb_type[mbPartIdx]) = (8-155) Otherwise (mb_type is equal to B_Skip or B_Direct_16x16, or mb_type is equal to B 8x8 and sub_mb_type[mbPartIdx ] is equal to B_Direct_8x8), subMbPartIdx proceeds over values 0..3, and partWidth and partHeight are derived as: partWidth = 4 (8-156) partHeight = 4 (8-157) When ChromaArrayType is not equal to 0, the variables partWidthC and partHeightC are derived as: partWidthC=partWidth/SubWidthC (8-158) partHeightC = partHeight / SubHeightC (8-159) Let the variable MvCnt be initially set equal to 0 before 