added routine to detect MSB for all pixels in code block