Lines Matching refs:sample
37 static unsigned char alaw_encode (int sample) ;
174 unsigned char alaw_encode (int sample) in alaw_encode() argument
198 sign = ((~sample) >> 8) & 0x80 ; /* set aside the sign */ in alaw_encode()
200 sample = -sample ; /* get magnitude */ in alaw_encode()
201 if (sample > ACLIP) in alaw_encode()
202 sample = ACLIP ; /* clip the magnitude */ in alaw_encode()
205 if (sample >= 256) in alaw_encode()
206 { exponent = exp_lut [(sample >> 8) & 0x7F] ; in alaw_encode()
207 mantissa = (sample >> (exponent + 3)) & 0x0F ; in alaw_encode()
211 Alawbyte = (sample >> 4) ; in alaw_encode()
221 int sign, exponent, mantissa, sample ; in alaw_decode() local
229 sample = exp_lut [exponent] + (mantissa << (exponent + 3)) ; in alaw_decode()
232 sample = (Alawbyte << 4) + 8 ; in alaw_decode()
234 sample = -sample ; in alaw_decode()
236 return sample ; in alaw_decode()