The corner separation and the related secondary flow have great impact on the compressor performance, and non-axisymmetric endwall contouring is proved effective in improving compressor efficiency. The aim of the study is to improve the compressor performance by two local endwall contouring strategies at the design and off-design conditions. The endwall is parameterized and the Bezier curve is used to loft the endwall surface. The design of the contoured endwall is based on a multi-point optimization method to minimize the aerodynamic pressure loss. In order to identify the influence of the contoured endwall, a detailed flow analysis is conducted on four effective contoured endwall designs. The selected endwall geometries exhibit great control ability on the corner separation and significantly reduce the pressure loss at the two operating conditions. The directional concave near the leading edge can induce strong streamwise pressure gradient and accelerate the endwall flow, greatly reducing the cross-passage pressure gradient. The convex structures near the concave edge and at the outlet can block the cross-flow and prevent the interaction between the cross-flow and the suction corner flow. The benefit of the contoured endwall is mainly due to the re-distributed endwall static pressure and blocking of the cross-flow movement. In terms of the control effect, the shape of the concave also matters and better control effect is observed on the deep and wide concave. The flow will be guided by the concave, and the best suppression on corner separation is observed on the concave which follows the suction side. The results also indicate that the relief of the hub corner separation slightly increases the shroud pressure loss.