def aligned(value, func='vdec', aligned='w'):
    """Align specific size of 'w' or 'h' according to input func.

    Args:
        value (int): Input value to be aligned.
        func (str, optional): Alinged method for specified function. Defaults to 'vdec'.
        aligned (str, optional): Aligne `w` or `h`. Defaults to 'w'.
    
    Raises:
        ValueError: Input `func` not in ['jpegd', 'pngd', 'vdec', 'resize', 'crop', 'crop_and_paste', 'encode']
        ValueError: Input aligned not in ['w', 'h']

    Returns:
        [int]: A aligned value.
    """
    if func not in ['jpegd', 'pngd', 'vdec', 'resize', 'crop', 'crop_and_paste', 'encode']:
        raise ValueError(
            f"Aligned func only support:'jpegd','vdec','resize','crop','crop_and_paste'.")

    if aligned not in ['w', 'h']:
        raise ValueError(f"Aligned func only support w or h aligned.")

    if func == 'jpegd' or func == 'pngd':
        if aligned == 'w':
            alignment = 128
        else:
            alignment = 16
    else:
        if aligned == 'w':
            alignment = 16
        else:
            alignment = 2

    formal = ((value + alignment - 1) // alignment) * alignment
    return formal