Changeset 4112:215f5e16823a in roaraudio


Ignore:
Timestamp:
08/06/10 16:46:06 (14 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

some fist cleanup

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/convert.c

    r4111 r4112  
    12291229 
    12301230   if ( (int)pos_in == 0 ) { 
    1231     y[0] = ip[c]; 
    1232     y[1] = ip[channels + c]; 
     1231    y[0] = ip[0 * channels + c]; 
     1232    y[1] = ip[1 * channels + c]; 
    12331233    y[2] = ip[2 * channels + c]; 
    12341234    x_val = pos_in; 
     
    12371237     * We will assume this value, by linearly extrapolating the two preceding values. From causual testing, this is not audible. */ 
    12381238    y[0] = ip[((int)pos_in - 1) * channels + c]; 
    1239     y[1] = ip[(int)pos_in * channels + c]; 
     1239    y[1] = ip[((int)pos_in    ) * channels + c]; 
    12401240    y[2] = y[1] * 2.0 - y[0]; 
    1241     /* We have to clip this value. */ 
    1242     if ( (int32_t)y[2] > 0x7FFE ) 
    1243      y[2] = 0x7FFE; 
    1244     else if ( (int32_t)y[2] < -0x7FFE ) 
    1245      y[2] = -0x7FFE; 
    1246  
    12471241    x_val = pos_in - (int)pos_in + 1.0; 
    12481242   } else { 
    12491243    y[0] = ip[((int)pos_in - 1) * channels + c]; 
    1250     y[1] = ip[(int)pos_in * channels + c]; 
     1244    y[1] = ip[((int)pos_in    ) * channels + c]; 
    12511245    y[2] = ip[((int)pos_in + 1) * channels + c]; 
    12521246    x_val = pos_in - (int)pos_in + 1.0; 
     
    12571251   int32_t temp = (int32_t)(poly[2]*x_val*x_val + poly[1]*x_val + poly[0] + 0.5); 
    12581252   /* temp could be out of bounds, so need to check this */ 
    1259    if (temp > 0x7FFE ) 
    1260     out[x * channels + c] = 0x7FFE; 
    1261    else if (temp < -0x7FFE) 
     1253   if (temp > 0x7FFE ) { 
     1254    out[x * channels + c] =  0x7FFE; 
     1255   } else if (temp < -0x7FFE) { 
    12621256    out[x * channels + c] = -0x7FFE; 
    1263    else 
     1257   } else { 
    12641258    out[x * channels + c] = (int16_t)temp; 
     1259   } 
    12651260  } 
    12661261 } 
Note: See TracChangeset for help on using the changeset viewer.