Home | History | Annotate | Download | only in srec

Lines Matching defs:pcm

28  * InputStream which transforms 16 bit pcm data to ulaw data.
81 int pcm = (0xff & pcmBuf[pcmOffset++]) + (pcmBuf[pcmOffset++] << 8);
82 pcm = (pcm * coef) >> SCALE_BITS;
85 if (pcm >= 0) {
86 ulaw = pcm <= 0 ? 0xff :
87 pcm <= 30 ? 0xf0 + (( 30 - pcm) >> 1) :
88 pcm <= 94 ? 0xe0 + (( 94 - pcm) >> 2) :
89 pcm <= 222 ? 0xd0 + (( 222 - pcm) >> 3) :
90 pcm <= 478 ? 0xc0 + (( 478 - pcm) >> 4) :
91 pcm <= 990 ? 0xb0 + (( 990 - pcm) >> 5) :
92 pcm <= 2014 ? 0xa0 + ((2014 - pcm) >> 6) :
93 pcm <= 4062 ? 0x90 + ((4062 - pcm) >> 7) :
94 pcm <= 8158 ? 0x80 + ((8158 - pcm) >> 8) :
97 ulaw = -1 <= pcm ? 0x7f :
98 -31 <= pcm ? 0x70 + ((pcm - -31) >> 1) :
99 -95 <= pcm ? 0x60 + ((pcm - -95) >> 2) :
100 -223 <= pcm ? 0x50 + ((pcm - -223) >> 3) :
101 -479 <= pcm ? 0x40 + ((pcm - -479) >> 4) :
102 -991 <= pcm ? 0x30 + ((pcm - -991) >> 5) :
103 -2015 <= pcm ? 0x20 + ((pcm - -2015) >> 6) :
104 -4063 <= pcm ? 0x10 + ((pcm - -4063) >> 7) :
105 -8159 <= pcm ? 0x00 + ((pcm - -8159) >> 8) :
113 * Compute the maximum of the absolute value of the pcm samples.
115 * @param pcmBuf array containing 16 bit pcm data.
116 * @param offset offset of start of 16 bit pcm data.
117 * @param length number of pcm samples (not number of input bytes)
118 * @return maximum abs of pcm data values
123 int pcm = (0xff & pcmBuf[offset++]) + (pcmBuf[offset++] << 8);
124 if (pcm < 0) pcm = -pcm;
125 if (pcm > max) max = pcm;
131 * Create an InputStream which takes 16 bit pcm data and produces ulaw data.
132 * @param in InputStream containing 16 bit pcm data.
133 * @param max pcm value corresponding to maximum ulaw value.