RefLayerPicWidthInSamples - 1, xRef) (G-15) yRef = Min( (RefLayerPicHeightInSamples - 1, yRef) (G-16) The reference layer macroblock address mbAddrRefLayer and a luma location ( xB, yB ) relative to the upper-left sample of the reference layer macroblock mbAddrRefLayer are derived as follows: If MbaffFrameFlag is equal to 0 and RefLayerMbaffFrameFlag is equal to 0, the following ordered steps are specified: 1. The reference layer macroblock address mbAddrRefLayer is derived by mbAddrRefLayer = yRef / 16) * RefLayerPicWidthInMbs+(xRe: (G-17) 2. The luma location (xB, yB ) is derived as follows: If mbAddrRefLayer is not available, ( xB, yB ) is marked as not available. Otherwise (mbAddrRefLayer is available), ( xB, yB ) is set equal to ( xRef % 16, yRef% 16). Otherwise (MbaffFrameFlag is equal to 1 or RefLayerMbaffFrameFlag is equal to 1), the following ordered steps are specified: NOTE 2 - When MbaffFrameFlag is equal to 1 or RefLayerMbaffFrameFlag is equal to 1, field_pic_flag and RefLayerFieldPicFlag are both equal to 0 (see clause G.7.4.3.4). 1. A virtual reference layer macroblock address virtMbAddrRefLayer is derived as follows: If RefLayerMbaffFrameFlag is equal to 1, virtMbAddrRefLayer is derived by virtMbAddrRefLayer RefLayerPicWidthInMbs + xRef / 16) + (yRef% 32) / 16 (G-18) Otherwise (RefLayerMbaffFrameFlag is equal to 0), virtMbAddrRefLayer is derived by virtMbAddrRefLayer = (yRef/16) RefLayerPicWidthInMbs + / (G-19) 2. The reference layer macroblock address mbAddrRefLayer and the luma location xB, yB ) are derived as follows: If fieldMbFlag is equal to 0 and refLayerFieldMbRef[ virtMbAddrRefLayer ] is equal to 1, the field-to- frame reference layer macroblock conversion process as specified in clause G.6.1.1 is invoked with virtMbAddrRefLayer, (xRef, yRef), and refLayerMbType as the inputs and the outputs are assigned to mbAddrRefLayer and (xB, yB ). Rec. ITU-T H.264 (01/2012) Otherwise, if fieldMbFlag is equal to 1 and refLayerFieldMbRef[ virtMbAddrRefLayer ] is equal to 0, the frame-to-field referenc