Use sparse masks for entropy_cpp