 as the inputs and the output is the sample location (xRefMax16, yRefMax16) in units of 1/16-th sample. With Z being replaced by L for chromaFlag equal to 0 and C for chromaFlag equal to 1, the variables refW, refH, refMbW, and refMbH are derived by = RefLayerPicWidthInSamplesz (G-314) = RefLayerPicHeightInSamplesz (G-315) refMbW = ( chromaFlag ==0) 16 RefLayerMbWidthC ) (G-316) refMbH = ( chromaFlag ==0) ? 16 : RefLayerMbHeightC ) (G-317) The variables xOffset, yOffset, refArrayW, and refArrayH are derived by xOffset = (xRefMin16>>4) (G-318) yOffset = (yRefMin16>>4) (G-319) refArrayW = ( RRefMax16>> 4) - xOffset (G-320) refArrayH = yRefMax16>> 4) - yOffset (G-321) 5. The variables yRefScale and yRefAdd are derived as follows: If RefLayerFrameMbsOnlyFlag is equal to 1 or RefLayerFieldPicFlag is equal to 1, yRefScale is set equal to 1 and yRefAdd is set equal to 0. Otherwise (RefLayerFrameMbsOnlyFlag is equal to 0 and RefLayerFieldPicFlag is equal to 0), yRefScale is set equal to 2 and yRefAdd is set equal to botFieldFlag. Each sample refSampleArray[ X, y ] and each transform block identification refTransBlkIdc[ : X, y with X = (refArrayW - 1) and y=0. (refArrayH - 1) are derived as specified in the following ordered steps: A reference layer sample location (xRef, yRef) is derived by: xRef = Max(0,Min(refW-1,x+ - xOffset ) (G-322) yRef = yRefScale *Max( Min( refH / yRefScale - 1, yOffset ) + yRefAdd (G-323) 2. The sample refSampleArray[ X, y ] is derived by refSampleArray[ X, y ] = refLayerPicSamples[xRef,yRef (G-324) 3. The transform block identification refTransBlkIdc| X, y ] is derived by invoking the derivation process for reference layer transform block identifications as specified in clause G.8.6.3.2.1 with the reference layer sample location xRef, yRef), chromaFlag, refMbW, refMbH, refLayerFieldMbFlag, and refLayerCTrafo as the inputs and assigning the output to refTransBlkIdc[ X, y ]. G.8.6.3.2.1 Derivation process for reference layer transform block identifications Inputs to this process are: a reference 