Hi Andrzej,
I did not find a simple way to predict the bit stream length
without repeating lots of code lines.
On the other hand, I also did not see an effect on the run time,
so the simple iteration looked good enough to me.
If you find different results, I'll try again.
In the meantime I was working on other improvements
in the existing filters, found some more special cases which
can be improved, but the effect will probably be smaller.
Gerd