Changeset 626:f7076b318cdf in roaraudio
- Timestamp:
- 08/20/08 13:09:58 (16 years ago)
- Branch:
- default
- Phase:
- public
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
libroardsp/convert.c
r624 r626 57 57 } else if ( to == 1 ) { 58 58 if ( bits == 8 ) { 59 return -1;59 return roar_conv_chans_nto18(out, in, samples, from); 60 60 } else if ( bits == 16 ) { 61 61 return roar_conv_chans_nto116(out, in, samples, from); … … 88 88 for (c = to - 1; c >= 0; c--) 89 89 op[i*to + c] = ip[i]; 90 91 return 0; 92 } 93 94 int roar_conv_chans_nto18 (void * out, void * in, int samples, int from) { 95 int8_t * ip = (int8_t*) in, * op = (int8_t*) out; 96 int i; 97 int c; 98 register int s; 99 100 samples /= from; 101 102 for (i = samples - 1; i >= 0; i--) { 103 s = 0; 104 105 for (c = 0; c < from; c++) 106 s += ip[i*from + c]; 107 108 s /= from; 109 op[i] = s; 110 } 90 111 91 112 return 0;
Note: See TracChangeset
for help on using the changeset viewer.