What should I watch out to reach highest-possible performance with my app and Xvid?
Xvid internally operates in YV12 colorspace format. So if any possible you should try to work with this colorspace in your application too (e.g. capture in YV12 from a camera or render YV12 video directly to the screen) to avoid unneeded colorspace conversions. Such conversions are costly and reduce overall performance. Also, you should try to avoid unneeded memcpys on picture data and instead better exchange pointers to your input/output buffers with Xvid. Especially for HD resolutions, such mem I/O can be costly.