This is a fast mode decision implementation based on JM18.4 software (H.264/AVC refering software)