Finding out the better parameter set (OffsetA and OffsetB) for conducting the de-blocking process of H.264/AVC, is capable of improving visual quality, said eliminating the resultant blocking artifact. Identifying which edges belong to blocking regions relies on the perceptual judging process of human beings. In fact, this subjective assessment may not exactly match existing objective assessing measurements, and the meaning of high PSNR does not always stand for less blocking artifacts. In this paper, we first introduce a new criterion for measuring the block boundary distortion by comparing the source video and the reconstructed video prior to the deblocking process. By jointly optimizing the objective picture quality and the blocky energy, the deblocking parameters decision process can find out a good balance between signal matching and blocky elimination, and therefore, maximize the effect of the built-in deblocking process. In our experiments, the proposed method can efficiently pick a better deblocking parameter set from all 169 possibilities for each coded frame and result in a better visual quality.