Internal patch prior (e.g. self-similarity) has achieved a great success in image denoising. However, it is a challenging task to utilize clean external natural patches for denoising. Natural image patch comes from very complex distributions which are hard to learn without supervision. In this paper, we use an autoencoder to discover and utilize these underlying distributions to learn a compact representation that is more robust to realistic noises. By exploiting learned external prior and internal self-similarity jointly, we develop an efficient patch sparse coding scheme for real-world image denoising. Numerical experiments demonstrate that the proposed method outperforms many state-of-the-art denoising methods, especially on removing realistic noise.