Added #ifdef for BILINEAR_SAMPLING