Best way to convert other formats to HD mp4 (for iPad) ? without loosing quality

I have some 1080p mkv and some avi clips of live performance music but i want those to be converted to mp4 so that i can view them on my iPad and also add them to iTunes library.

I tried some but they are resulting in loss of video and audio quality.......

What's the best converter ?