Changeset 2394:73bdb0b3efd8 in roaraudio


Ignore:
Timestamp:
08/17/09 02:31:08 (15 years ago)
Author:
phi
Branch:
default
Phase:
public
Message:

added support for 32 bit so remove

File:
1 edited

Legend:

Unmodified
Added
Removed
  • libroardsp/remove.c

    r2391 r2394  
    192192} 
    193193 
     194int roar_remove_so32 (int32_t * subout, int32_t * in, int samples, struct roar_remove_state * state) { 
     195 int i; 
     196 register int64_t s; 
     197 register int64_t peak; 
     198 
     199 if ( state == NULL ) { 
     200  for (i = 0; i < samples; i++) { 
     201   s  = -subout[i]; 
     202   s +=  in[i]; 
     203   subout[i] = s; 
     204  } 
     205 } else { 
     206  peak = 4294967295UL; 
     207  for (i = 0; i < samples; i++) { 
     208   s  = -subout[i]; 
     209   s +=  in[i]; 
     210   s  = s < 0 ? -s : s; // we true 32 bit, not int operation here 
     211   if ( s > peak ) 
     212    peak = s; 
     213  } 
     214 
     215  for (i = 0; i < samples; i++) { 
     216   s  = -subout[i]; 
     217   s *=  4294967295UL; 
     218   s /=  peak; 
     219   s +=  in[i]; 
     220   subout[i] = s; 
     221  } 
     222 } 
     223 
     224 return 0; 
     225} 
     226 
    194227//ll 
Note: See TracChangeset for help on using the changeset viewer.