Hello stefanop, you can use the same vpu encode api as mpeg4/h.264 to encode mjpeg, just set different format.
mxc_vpu_test is open source, suppose you can get the source from our formal release.
The only work you need to do is adjust the memory pool to allow large memory allocation and set proper value for 'VPU_ENC_BITS_BUF_SIZE' accordingly just like mentioned above.
For the libimxvpuapi, it was developed by third-party, you can ask help in this community
or you can get NXP formal release package from BSP NXP offical site.
Regards