One important thing to note is that when compressing wavelet coefficients is that the coefficients have to be on the same "subband" before compression.
Intuitively, we want to compress the average coefficients together and the detail coefficients together, but not average + detail together.
In other words, if you perform the Haar wavelet transform, you need to stop the transform as soon as the remaining samples fit into an IDX block.
The coefficients within a block cannot be further transformed, since that would create many more subbands within a block and hence when you compress, you will be mixing coefficients across subbands and that's bad.
So, basically we have two options:
Stop the Haar transform once you get to the level of an IDX block.
One important thing to note is that when compressing wavelet coefficients is that the coefficients have to be on the same "subband" before compression. Intuitively, we want to compress the average coefficients together and the detail coefficients together, but not average + detail together. In other words, if you perform the Haar wavelet transform, you need to stop the transform as soon as the remaining samples fit into an IDX block. The coefficients within a block cannot be further transformed, since that would create many more subbands within a block and hence when you compress, you will be mixing coefficients across subbands and that's bad.
So, basically we have two options: