def CodedBlockPattern(mb_type):
    """
    >>> CodedBlockPattern(0)
    (None, None)
    >>> CodedBlockPattern(12)
    (2, 0)
    >>> CodedBlockPattern(13)
    (0, 15)
    """
    if mb_type > 25:
        raise Exception('unknown mb_type %d' % (mb_type))
    if mb_type == 0 or mb_type == 25:
        return None, None
    chroma = (mb_type - 1) // 4 % 3
    luma = 0 if mb_type <= 12 else 15
    return chroma, luma