Keep your original counter.
Time the amount of time_between_each incr, or, decr. For that timer, have a maximum limiter on it, say 100ms. (1 Sec). From that top value, subtract +1 from it:
Speed_factor = 101 - (time_between_each_pulse);
Now, for your position:
accelerating_counter_position = ((accelerating_counter_position + counter) * speed_factor);
counter=accelerating_counter_position;
<<< Remember to Clear your timer whenever there is a encoder pulse>>>
Whats going on here is if you are turning your encoder so slow that it's more than 100ms, the accelerating_counter_position will inc or dec by 1 for each counter inc and dec by 1.
If you turn your encoder so fast that the timer is 0ms, the inc and dec of accelerating_counter_position for each pulse will be 101x per step.
This would be the means if you did not want to alter your existing rotary decoder's code directly.
You will need to use the CPU real time timer to make this work good.
You will also need to play with my factors to achieve the acceleration curve VS rotation speed you like.
Make sure that you filter out small switch debouncing noise when using a mechanical encoder in between steps. Unlike the +/-1 inc & dec which self correct, mechanical noise now may mean and additional +100, -90 or similar now that the size of the bounce can be considered different velocity, therefor, a different amount of addition and subtraction may create a spurious reaction.
Good luck.