People verification is a challenging and important task which finds many applications in modern surveillance and video retrieval systems. In this problem, metric learning approaches have played an important role by trying to bridge the semantic gap between image features and people's identities. However, we believe that the traditional Mahalanobis distance is limited in capturing the diversity of visual phenomenon, and hence insufficient for complicated tasks such as people verification. In this paper, we introduce a novel discriminant function which generalizes the classical Mahalanobis distance. Our approach considers a quadratic function directly on the space of image pairs. The resulting decision boundary is therefore in a general shape and not limited to ellipsoids enforced by Mahalanobis distance. To achieve computational efficiency, we develop a generalized SVM-type solver in dual space. Experimental results on the "Labeled Faces in the Wild" dataset show that our method outperforms the classical Mahalanobis distance in the people verification problem.