But judges and PTO examiners have been getting it wrong so long they don't even know what's right anymore. But the letter of the law is quite clear and the SCOTUS is starting to come down harder on the side of the law, especially since rulings like Bilski.
Generally, I'm against software patents due to their easily abused nature (to the point where I think sacrificing all software patents would be a net benefit), but I find it very hard to argue that the person who came up with that codec shouldn't be able to patent their invention. Yes, it's math at the end of the day, but it's still novel math. Putting existing things together in actually novel ways should be patentable.
Novel math is still abstract, and as such, strictly ineligible. Software is the same, in that it is purely abstract. It will take time for the courts to catch up to reality, but they have trended in that direction.
Whether I agree or not that, as you say, "...novel ways should be patentable." they are, by the letter of the enacting law, ineligible.
That it involves not just some singular "let's do an X" moment, but tons of math, hard work, novel techniques for better compression, faster decoding, etc?
I think you'll find this takes a little more work than "Hey, wouldn't it be great to make audio files smaller?"