Compactness of special functions of bounded higher variation