Decoding MS and LR is just sum and difference, both ways, and can be done in analog or digital.
To decode MS into LR, it's simply L = M + S and R = M - S
To encode MS from LR (like the MS compressors do), M = L/2 + R/2 while S = L/2 - R/2. You can then compress the mid bit separately as you wish, and then decode the compressed signal back to LR.
The point of it all for compression, as far as I understand, is to avoid some of the compression stereo phase problems becuase you are only in effect compressing a mono signal.
An analog MS to LR schematic can be found
here.
I've just bought the Paia MS microphone kit which adopts the usual MS recording technique - rather than a cariod and an omni, it used 3 cardiods but sums them all into a balanced LR signal within the box. I suspect at some point I'll upgrade the supplied electret mics with better capsules, but the principle of the thing looks sound.[/url]