title: SSE parallelization
body: <p>Hi I am trying to improve the performance of this code, suposing that I have a machine capable of handling 4 threads. I first thought about making omp parallel but then I saw that this function was inside a for loop so creating threads so many times was not very efficient. So i would like to know how to implement it with SSE that would be more efficient:</p>
  
  <pre><code>unsigned char cubicInterpolate_paralelo(unsigned char p[4], unsigned char x) {
      unsigned char resultado;
      unsigned char intermedio;
      intermedio = + x*(3.0*(p[1] - p[2]) + p[3] - p[0]);
  
      resultado = p[1] + 0.5 * x *(p[2] - p[0] + x*(2.0*p[0] - 5.0*p[1] + 4.0*p[2] - p[3] + x*(3.0*(p[1] - p[2]) + p[3] - p[0])));
      return resultado;
  }
  
  unsigned char bicubicInterpolate_paralelo (unsigned char p[4][4], unsigned char x, unsigned char y) {
      unsigned char arr[4],valorPixelCanal;
      arr[0] = cubicInterpolate_paralelo(p[0], y);
      arr[1] = cubicInterpolate_paralelo(p[1], y);
      arr[2] = cubicInterpolate_paralelo(p[2], y);
      arr[3] = cubicInterpolate_paralelo(p[3], y);
  
      valorPixelCanal = cubicInterpolate_paralelo(arr, x);
      return valorPixelCanal;
  }
  </code></pre>
  
  <p>this is used inside some nested for:</p>
  
  <pre><code>for(i=0; i&lt;z_img.width(); i++) {
          for(j=0; j&lt;z_img.height(); j++) {
              //For R,G,B
              for(c=0; c&lt;3; c++) { 
  
                  for(l=0; l&lt;4; l++){
                      for(k=0; k&lt;4; k++){
  
                          arr[l][k] = img(i/zFactor +l, j/zFactor +k, 0, c); 
                      }
                  }
  
                  color[c] = bicubicInterpolate_paralelo(arr, (unsigned char)(i%zFactor)/zFactor, (unsigned char)(j%zFactor)/zFactor);
              }
              z_img.draw_point(i,j,color);
          }
      }
  </code></pre>