the only exception to my advice about custom codecs is when you are writing a low level, high performance network transport i was working on such a thing last year and it is the single case where extreme performance and optimisation is warranted if the data volume is less than 1Mbit typical average throughput it's not worth optimising it