36 for (
int i=0;
i<8192;
i++) {
40 for (
int i=8192;
i<2*8192;
i++) {
41 m_lut[
i] = 24576 + 0.5f*(
i-8192);
44 for (
int i=2*8192;
i<3*8192;
i++) {
45 m_lut[
i] = 24576 + 4096 + 0.25f*(
i-2*8192);
48 for (
int i=3*8192;
i<4*8192;
i++) {
49 m_lut[
i] = 24576 + 4096 + 2048 + 0.125f*(
i-3*8192);
55 for (
int i=0;
i<4096;
i++) {
59 for (
int i=4096;
i<2*4096;
i++) {
60 m_lut[
i] = 24576 + 0.5f*(
i-4096);
63 for (
int i=2*4096;
i<3*4096;
i++) {
64 m_lut[
i] = 24576 + 2048 + 0.25f*(
i-2*4096);
67 for (
int i=3*4096;
i<4*4096;
i++) {
68 m_lut[
i] = 24576 + 2048 + 1024 + 0.125f*(
i-3*4096);
71 for (
int i=4*4096;
i<5*4096;
i++) {
72 m_lut[
i] = 24576 + 2048 + 1024 + 512 + 0.0625f*(
i-4*4096);
75 for (
int i=5*4096;
i<6*4096;
i++) {
76 m_lut[
i] = 24576 + 2048 + 1024 + 512 + 256 + 0.03125f*(
i-5*4096);
79 for (
int i=6*4096;
i<7*4096;
i++) {
80 m_lut[
i] = 24576 + 2048 + 1024 + 512 + 256 + 128 + 0.015625f*(
i-6*4096);
83 for (
int i=7*4096;
i<8*4096;
i++) {
84 m_lut[
i] = 24576 + 2048 + 1024 + 512 + 256 + 128 + 64 + 0.0078125f*(
i-7*4096);
90 for (
int i=-16384;
i<16384;
i++) {
97 for (
int i=-16384;
i<16384;
i++) {
104 int16_t sign = sample < 0 ? -1 : 1;
111 return m_lut[sample/2 + 16384];
156 for (; ((number & mask) != mask && position >= 5); mask >>= 1, position--) {
159 lsb = (number >> ((position == 4) ? (1) : (position - 4))) & 0x0f;
161 return (sign | ((position - 4) << 4) | lsb) ^ 0x55;
194 for (; ((number & mask) != mask && position >= 5); mask >>= 1, position--) {
197 lsb = (number >> (position - 4)) & 0x0f;
199 return (~(sign | ((position - 5) << 4) | lsb));
int8_t MuLaw_Encode(int16_t number)
static const uint16_t MULAW_MAX
Fixed< IntType, IntBits > abs(Fixed< IntType, IntBits > const &x)
int8_t compress8(int16_t sample)
void fillLUT2()
8 bands (default)
static const uint16_t MULAW_BIAS
void fillALaw()
A-law compression to 8 bits.
int8_t ALaw_Encode(int16_t number)
void fillULaw()
u-law compression to 8 bits
int16_t compress(int16_t sample)
static const uint16_t ALAW_MAX