Conventional pointwise adaptive contrast enhancement is very effective in adjusting the contrast of medical images with large regional brightness differences. However, the pointwise algorithm is computationally intensive, thus limiting its practical application. Two existing stepwise algorithms cut down the computational overhead by adopting regional interpolation and averaging techniques respectively. Based on these two stepwise algorithms, we describe an adaptive contrast enhancement in which a new kind of variable image filter suitable for array multiplication is employed. Experiments show that the new algorithm can avoid the generation of blocking effects and effectively reduce image distortion in enhancement. Moreover, the speed of the algorithm can be adjusted according to different requirements.