// ----------------------------------------------------------------------------------------------------------
// Feature Mean subtraction and Cov reduction for a segment and cluster (segment is considerred to be the minimum time unit to perform this).
void computeZeroOne(const DoubleVector &featureMean,const DoubleVector &featureStd,FeatureServer & fs,unsigned long begin, unsigned long length,Config &config) {
  unsigned long vectsize=fs.getVectSize();                                       // Get the vect size (number of coeff)
  Feature f;
  fs.seekFeature(begin);
  for (unsigned long idxFrame=0;idxFrame<length;idxFrame++){                     // for all the features of the segment
    fs.readFeature(f,0);  
    // Get the feature;
    for (unsigned int i = 0; i < vectsize; i++)       {                  // For each coeff
      f[i]=(f[i]-featureMean[i])/featureStd[i];    // Apply the 0 mean 1 cov normalisation
    }
    fs.writeFeature(f);
  }
}
// ----------------------------------------------------------------------------------------------------------
// Feature Warping giving a source(tab of histo, one by coeff) and a target distribution 
// for a segment and cluster (segment is the minimum time unit to perform this)
void computeWarp(Histo *histoT,Histo &destH,FeatureServer & fs,unsigned long begin, unsigned long length,Config &config) {  
  unsigned long vectsize=fs.getVectSize();                                       // Get the vect size (number of coeff)
  Feature f;
  fs.seekFeature(begin);
  for (unsigned long idxFrame=0;idxFrame<length;idxFrame++){                     // for all the features of the segment
    fs.readFeature(f,0);  
    // Get the feature;
    for (unsigned int i = 0; i < vectsize; i++){    // For each coeff
      f[i]=warping(f[i],histoT[i],destH);           // Apply the warping function
    }
    fs.writeFeature(f);
  }
}