------- Comment #1 from rmansfield at qnx dot com  2006-03-10 18:23 -------
When attaching the test case, I experience a internal error with gcc bugzilla
which I reported to dberlin. I am going to attach the test case in a comment. 
I attempted to reduce the test case, but it changed reg. allocation which made
reproducing it difficult.

#include <stdlib.h>
#include <stdio.h>

# define M           14  
# define PIT_MIN     30  
# define SS_AUDIO_SAMPLE_SIZE 2

int main(int argc, char *argv[]) {
        int     iMarkEvntDelayTime      = 0;
        int iSampleRate                 = 0;
        int iBlockSize                  = 0;
        int t_op;
        int corr[19999];
        int f_io4[19999];

        int daten[19999];

   t_op = wbe_ol_pitch_estimate( daten, corr, f_io4);

        return EXIT_SUCCESS;
}

#define PIT_MIN 30
#define PIT_MAX 193
#define L_SUBFR_LB  60 
#define DIM (3*L_SUBFR_LB)
#define OLPX_SHIFT 4

int
wbe_ol_pitch_estimate
(
 short *x_i,                           
 int *corr,                         
 int *x_local                       
)

{

   int    temp, temp1;               
   int  energy;                     
   int    denom;                       
   int    thresh, thresh2;           

   int *x_t1_ptr, *x_t2_ptr;
   int *x_t_max;
   int *x;

   int     i,index,p;

   for (i=0; i < PIT_MIN; i++)
      corr[i] = 0;

   x = x_local;
   for (i = -PIT_MAX; i < DIM; i++)
   {
      *(x++) = x_i[i]>>OLPX_SHIFT;
   }


   x = x_local+PIT_MAX;              
   x_t_max = x +DIM;                   
   x_t1_ptr = x;                      
   x_t2_ptr = x-PIT_MIN;               
   energy= 0;                          
   temp = 0;                          

   while( x_t1_ptr < x_t_max)
   {
      temp1 = (int)(*x_t2_ptr);      
      temp +=   (*x_t1_ptr) * temp1;  
      energy += temp1 * temp1;        
      x_t1_ptr++;
      x_t2_ptr++;
   }

   denom = energy>>10;
   if (denom <= 0) denom=1;           
   corr[PIT_MIN] = temp/denom;         


   index   = PIT_MIN;                  

   for( i=PIT_MIN+1; i<PIT_MAX; i++)   
   {
      temp = 0;                      
      x_t1_ptr = x;                  
      x_t2_ptr = x-i;                 
      while( x_t1_ptr < x_t_max)      
      {
         temp +=  (*x_t1_ptr) * (*x_t2_ptr);     
         x_t1_ptr++;
         x_t2_ptr++;

      }

      temp1 = (int)x[DIM-i];
      temp1 *= temp1;
      energy -= temp1;
      temp1 = (int)x[-i];
      temp1 *= temp1;
      energy += temp1;

      /* calculate the normalized correlation temp/energy */

      denom = energy>>10;
      if (denom <= 0) denom=1;         

      temp = temp/denom;               
      corr[i] = temp;                
      thresh = (temp>>2) + (temp>>1);  
      if( i<((index<<1)-5))            
         if( temp > corr[index] )
            index = i;

      if( i>=((index<<1)-5))
         if( thresh > corr[index] )
            index = i;
   }


   thresh2=(corr[index]>>1);        
   p = index/3;
   for( i=p-5; i<p+5; i++)
   {
      if( thresh2 < corr[i] )
      {
         index = i;
         thresh2=(corr[index]>>1);     
      }
   }

   return( index );
}                     


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26636

Reply via email to