title: Optimize image buffer
body: <p>Here is a code that decodes a WebM frame and put them in a buffer</p>
  
  <pre><code>image-&gt;planes[p] = pointer to the top left pixel 
  
  image-&gt;linesize[p] = strides betwen rows 
  
  framesArray = vector of unsigned char*
  
       while ( videoDec-&gt;getImage(*image) == VPXDecoder::NO_ERROR)
                          {
  
  
  
                                  const int w = image-&gt;getWidth(p);
                                  const int h = image-&gt;getHeight(p);
  
                                  int offset = 0;
                                  for (int y = 0; y &lt; h; y++)
                                  {
                                     // fwrite(image-&gt;planes[p] + offset, 1, w, pFile);
                                      for(int i=0;i&lt;w;i++){
                                          framesArray.at(count)[i+(w*y)] = *(image-&gt;planes[p]+offset+ i) ;
  
                                  }
  
                                  offset += image-&gt;linesize[p];
  
  
  
                              }
  }
  .............................
  </code></pre>
  
  <p>How can I write intro buffer line by line not pixel by pixel or optimize the writing of frame intro buffer? </p>