                 xcoord[bin] = prev + newbin;
                 yval[bin]   = -(num*num) / (4.0f * denB) + hist[prev];
 
+#ifdef LOWE_ORIENTATION_MAX
                 if( yval[bin] > y_max[0] ) {
                     y_max[2]  = y_max[1];
                     y_max[1]  = y_max[0];


    float factor = __fdividef( -0.5f, (sigw * sigw) );
    int sq_thres  = rad * rad;
    int32_t xmin = max(1,     (int32_t)floor(x - rad));
    int32_t xmax = min(w - 2, (int32_t)floor(x + rad));
    int32_t ymin = max(1,     (int32_t)floor(y - rad));

            ext->orientation = th;

            nangles++;
#ifdef LOWE_ORIENTATION_MAX
            // Lowe wants at most 3 orientations at every extremum
            if (nangles > 2) break;
#else // LOWE_ORIENTATION_MAX
            // OpenCV and VLFeat allow 4 orientations at every extremum
            if (nangles > 3) break;
#endif // LOWE_ORIENTATION_MAX
        }
    }
}
