int Rawdata_PreProcess(void * ptr_rawdata_addr_header[],int N,int data_length,void *out_data)
{

   //int rpp_valid_flag = -1;
   int temp_length = 0;
   temp_length = data_length;//>>1;
   int32_t *temp_buff = new int32_t[temp_length];

   uint64_t *ptr_rawdata_addr_header_buff = new uint64_t[N];


   //copy N frames rawdata header addr to a buff
   uint64_t * temp = ptr_rawdata_addr_header_buff;
   for(int i=0; i<N; i++){
       *temp = *(uint64_t *)ptr_rawdata_addr_header++;
       qDebug() << * (uint16_t *) *temp;
       temp++;
   }

   //a
   for (int i=0; i<temp_length; i++){
       *temp_buff++ = 0;
   }

   // sum all rawdata
   temp = ptr_rawdata_addr_header_buff;

   for(int j = 0;j < temp_length; j++){
       for(int i = 0; i< N; i++){

            temp_buff[j] += * (uint16_t *)(temp[i] + j);
       }
       qDebug()<<"sum"<<j<<"="<<temp_buff[j];
   }


#if 0
   //
   uint32_t * ptr_rawdata;
   ptr_rawdata = rawdata;

   for(int j = 0;j < temp_length; j++){
       for(int i = 0; i< N; i++){
            temp_buff += ** ptr_rawdata;
            temp_buff ++;
            ptr_rawdata ++;
            qDebug()<<"temp_buff"<<temp_buff;
            qDebug()<<"ptr_rawdata"<<ptr_rawdata;
       }

   }


   for(int i= 0;i < N;i++)
   {
        out_data  =(int16_t*) rawdata[i];
        for(int j = 0;j < temp_length; j++)
        {
             temp_buff[j] += ((int16_t*)out_data)[j];
        }
        rpp_valid_flag++;
   }

   if(rpp_valid_flag)
   {
       for(int m = 0; m < temp_length;m++)
       {
            temp_buff_new[m] = int16_t(temp_buff[m]/N);
       }


       rpp_valid_flag = 1;
   }


   delete[] temp_buff;
   delete[] temp_buff_new;
   return rpp_valid_flag;
#endif
}


int main(int argc, char *argv[])
{

    int16_t a1[]= {1, 2, 3, 4, 5, 6};
    int16_t a2[]= {10, 20, 30, 40, 50, 60};
    int16_t a3[]= {100, 200, 300, 400, 500, 600};
    int16_t a4[]= {1000, 2000, 3000, 4000, 5000, 6000};
    void * ms_data[]={a1, a2, a3, a4};
    int16_t * out_data[6];