One of the major drawbacks in block-based discrete cosine transform (BDCT) is the blocking artifacts at low bit rates. In this paper, an adaptive deblocking algorithm based on Markov Random Field (MRF) is proposed. A visibility function of blocking artifacts is introduced which based on human visual system (HVS), together with edge information to construct a new adaptive potential function of MRF. The experiment results show that the proposed algorithm reduces the blocking artifacts effectively and preserves the original edges faithful.