er is a frame macroblock pair, mixedModeEdgeFlag is set equal to 1. Otherwise, mixedModeEdgeFlag is set equal to 0. The variable bS is derived as follows: If the block edge is also a macroblock edge and any of the following conditions are true, a value of bS equal to 4 is the output: the samples Po and qo are both in frame macroblocks and either or both of the samples Po or qo is in a macroblock coded using an Intra macroblock prediction mode, the samples Po and qo are both in frame macroblocks and either or both of the samples Po or qo is in a macroblock that is in a slice with slice_type equal to SP or SI, MbaffFrameFlag is equal to 1 or field_pic_flag is equal to 1, and verticalEdgeFlag is equal to 1, and either or both of the samples Po or qo is in a macroblock coded using an Intra macroblock prediction mode, MbaffFrameFlag is equal to 1 or field_pic_flag is equal to 1, and verticalEdgeFlag is equal to 1, and either or both of the samples Po or qo is in a macroblock that is in a slice with slice_type equal to SP or SI. Rec. ITU-T H.264 (01/2012) Otherwise, if any of the following conditions are true, a value of bS equal to 3 is the output: mixedModeEdgeFlag is equal to 0 and either or both of the samples Po or qo is in a macroblock coded using an Intra macroblock prediction mode, mixedModeEdgeFlag is equal to 0 and either or both of the samples Po or qo is in a macroblock that is in a slice with slice_type equal to SP or SI, mixedModeEdgeFlag is equal to 1, verticalEdgeFlag is equal to 0, and either or both of the samples Po or qo is in a macroblock coded using an Intra macroblock prediction mode, mixedModeEdgeFlag is equal to 1, verticalEdgeFlag is equal to 0, and either or both of the samples Po or qo is in a macroblock that is in a slice with slice_type equal to SP or SI. Otherwise, if any of the following conditions are true, a value of bS equal to 2 is the output: transform_size_8x8_flag is equal to 1 for the macroblock containing the sample Po and the 8x8 luma transform block associated with the 8x8 lum