dougp:
You could look at offloading the encoder inputs to hardware.http://www.ti.com/lit/ug/tiduaa8/tiduaa8.pdf
http://www.ichaus.de/keyword/Encoder%20iCs
LS7366R datasheet(1/13 Pages) LSI | 32-BIT QUADRATURE COUNTER WITH SERIAL INTERFACE
Thank you for the links. The reference design is really interesting. The others seem to be too expensive for my project.
Found a small board with LS7366R but it costs 30$ a piece, i might need to look at some other solution.