Software to recover from jpeg compression better?

Images compressed by jpeg lose more or less quality, but they do it in some distinctive ways that are characteristic of the jpeg method.

By doing principle component analysis on the three color channels of jpegs I have found that the third eigenvector absorbs all these square regions that have vertical or horizontal sinusoidal-looking bands, with sudden color changes at the edges of the squares. These squares are not the pixels; there a size something like the geometric mean of the pixel size and the image size.

Anyhoo, to improve the quality of an image that was compressed more than I wish it had been, I can imagine using PCA to isolate the artifacts and then reconstructing a different version for that channel. I can imagine moving into the Fourier domain and knocking down the series of harmonic peaks that correspond to those squares. I can even imagine software that identifies edges that are not vertical or horizontal, and doing a kind of blur along the edge plus a kind of sharpening across the edge, to improve on the jaggies.

A bit of software designed specifically to repair or hide jpeg damage could do quite a lot of good.

Anybody know of any?