for chromaFlag equal to 1, the variables refW, refH, scaledW, and scaledH are derived by = RefLayerPicWidthInSamplesz (G-30) = RefLayerPicHeightInSamplesz +RefLayerFieldPicFlag) (G-31) scaledW = ScaledRefLayerPicWidthInSamplesz (G-32) scaledH = ScaledRefLayerPicHeightInSamplesz + field_pic_flag ) (G-33) Rec. ITU-T H.264 (01/2012) 2. When frame_mbs_only_flag is equal to 0 and RefLayerFrameMbsOnlyFlag is equal to 1, the variable scaledH is modified by scaledH = scaledH / 2 (G-34) 3. The variables refPhaseX, refPhaseY, phaseX, phaseY, subW, and subH are derived by refPhaseX = (chromaFlag == 0) )?01 ref_layer_chroma_phase_x_plus1_flag-1)) (G-35) refPhaseY = ( chromaFlag ==0)?01 (ref_layer_chroma_phase_y_plus1-1)) (G-36) phaseX = ( chromaFlag 0)?0: (chroma_phase_x_plus1_flag-1)) (G-37) phaseY = ( ( chromaFlag ==0)?0 (chroma_phase_y_plus1-1) (G-38) = ( (chromaFlag ==0)?1 SubWidthC ) (G-39) =((chromaFlag ==0)?1 SubHeightC ) (G-40) 4. When RefLayerFrameMbsOnlyFlag is equal to 0 or frame_mbs_only_flag is equal to 0, the following applies: If RefLayerFrameMbsOnlyFlag is equal to 1, the variables phaseY and refPhaseY are modified by phaseY =phaseY+4*botFieldFlag+3-subH = (G-41) refPhaseY = refPhaseY + 2 (G-42) Otherwise (RefLayerFrameMbsOnlyFlag is equal to 0), the variables phaseY and refPhaseY are modified phaseY = phaseY+4*botFieldFlag (G-43) refPhaseY = refPhaseY + 4 * botFieldFlag (G-44) 5. The variables shiftX and shiftY are derived by shiftX = (levelIdc <= 30) ? 16 : (31 Ceil( Log2( refW)) (G-45) shiftY = ( levelIde 30) ? 16 : (31 - Ceil( Log2( refH (G-46) 6. The variables scaleX and scaleY are derived by scaleX = ( ( refW shiftX) + scaledW >> 1) / scaledW (G-47) scaleY = ( (refH shiftY ) (scaledH >> 1) / scaledH (G-48) 7. The variables offsetX, addX, and deltaX are derived by offsetX = ScaledRefLayerLeftOffset / subW (G-49) addX = ( ( (refW*(2+phaseX)) shiftX-2))+(scaledW>>1))/scaledW (1<<(shiftX-5)) (G-50) deltaX = (2 + refPhaseX (G-51) 8. The variables offsetY, addY, and deltaY are derived as follows: If RefLayerF