title: Is there a good library or algorithm that help convert planar image to interleaved image fast(C++)?
body: <p>I am developing a video playback application which will display video files that contain raw planar  image data frame by frame. The data it contains is 8-bit rgb (no alpha at this moment). The hardware here only accept interleaved image data. As a result, I need to convert the planar image data into interleaved image data. What I did was to memmove or memcpy on the planar data. However, when processing HD content, this will take up a lot of time since the data is raw data. I have tried implementing with two threads, one for processing the other one for displaying. It turns out that displaying processed interleaved data is really quick  but the processing thread is not able to keep up with it. Consequently, the frame rate is heavily affected because of the speed of processing.</p>
  
  <p>I do have idea that to pre-process everything and save it in memory(number of frames of those video clips are relatively small). When needed, I will just display the processed data in the memory. Actually I tested this approach, it is fairly fast(60fps). However, this seems to suboptimal because I will either have a really slow first run or need to wait for some time before playback starts. Moreover, when file size gets big, it is impossible to do that due to memory limitation.</p>
  
  <p>So I am looking for any image processing library or algorithm that does planar->interleaved quickly. I did try gil from boost but the performance is not quite good.  </p>