Improving the codec algorithms