1. An implantable medical device (IMD) comprising: a memory; an analog to digital converter (ADC) configured to receive an analog waveform and sample the waveform into digitized data; a predictive encoding module operatively coupled with the ADC to receive at least a subset of the digitized data from the ADC and to generate an encoded waveform data point for each of an equivalent data point from the subset of the digitized data; and an entropy encoding module operatively coupled with the predictive encoding module and configured to replace one or more encoded waveform data points with a codeword for a data point or for a predefined string of data points when a predetermined condition is met, wherein the codeword is stored into the memory responsive to the predetermined condition being met and the encoded waveform data point is stored into the memory responsive to the predetermined condition not being met.