annotate libaf/af_format_alaw.h @ 28238:1bf9023840f9

Rename libaf/af_format_alaw.c --> libaf/af_format_alaw.h and libaf/af_format_ulaw.c --> libaf/af_format_ulaw.h. Both files are not compiled but used as standard headers, so there is no reason for them not be named like any other header file.
author diego
date Mon, 05 Jan 2009 22:05:19 +0000
parents libaf/af_format_alaw.c@ef06790a305d
children 0f1b5b68af32
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
28229
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
1 /*
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
2 * Copyright (C) 2002 Anders Johansson ajh@watri.uwa.edu.au
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
3 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
4 * This file is based on a part of libsndfile, the work of
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
5 * Erik de Castro Lopo <erikd@zip.com.au>.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
6 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
7 * This file is part of MPlayer.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
8 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
9 * MPlayer is free software; you can redistribute it and/or modify
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
10 * it under the terms of the GNU General Public License as published by
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
11 * the Free Software Foundation; either version 2 of the License, or
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
12 * (at your option) any later version.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
13 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
14 * MPlayer is distributed in the hope that it will be useful,
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
17 * GNU General Public License for more details.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
18 *
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
19 * You should have received a copy of the GNU General Public License along
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
20 * with MPlayer; if not, write to the Free Software Foundation, Inc.,
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
21 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
72d0b1444141 Replace informal license notices by standard license header
diego
parents: 25170
diff changeset
22 */
8167
e8832e66babd New features:
anders
parents:
diff changeset
23
28238
1bf9023840f9 Rename libaf/af_format_alaw.c --> libaf/af_format_alaw.h and
diego
parents: 28237
diff changeset
24 #ifndef MPLAYER_AF_FORMAT_ALAW_H
1bf9023840f9 Rename libaf/af_format_alaw.c --> libaf/af_format_alaw.h and
diego
parents: 28237
diff changeset
25 #define MPLAYER_AF_FORMAT_ALAW_H
8167
e8832e66babd New features:
anders
parents:
diff changeset
26
e8832e66babd New features:
anders
parents:
diff changeset
27 #include <inttypes.h>
e8832e66babd New features:
anders
parents:
diff changeset
28
e8832e66babd New features:
anders
parents:
diff changeset
29 #include "af.h"
e8832e66babd New features:
anders
parents:
diff changeset
30
e8832e66babd New features:
anders
parents:
diff changeset
31 // Conversion tables (the function are below)
e8832e66babd New features:
anders
parents:
diff changeset
32 static short alaw_decode [128] =
e8832e66babd New features:
anders
parents:
diff changeset
33 { -5504, -5248, -6016, -5760, -4480, -4224, -4992, -4736,
e8832e66babd New features:
anders
parents:
diff changeset
34 -7552, -7296, -8064, -7808, -6528, -6272, -7040, -6784,
e8832e66babd New features:
anders
parents:
diff changeset
35 -2752, -2624, -3008, -2880, -2240, -2112, -2496, -2368,
e8832e66babd New features:
anders
parents:
diff changeset
36 -3776, -3648, -4032, -3904, -3264, -3136, -3520, -3392,
e8832e66babd New features:
anders
parents:
diff changeset
37 -22016, -20992, -24064, -23040, -17920, -16896, -19968, -18944,
e8832e66babd New features:
anders
parents:
diff changeset
38 -30208, -29184, -32256, -31232, -26112, -25088, -28160, -27136,
e8832e66babd New features:
anders
parents:
diff changeset
39 -11008, -10496, -12032, -11520, -8960, -8448, -9984, -9472,
e8832e66babd New features:
anders
parents:
diff changeset
40 -15104, -14592, -16128, -15616, -13056, -12544, -14080, -13568,
e8832e66babd New features:
anders
parents:
diff changeset
41 -344, -328, -376, -360, -280, -264, -312, -296,
e8832e66babd New features:
anders
parents:
diff changeset
42 -472, -456, -504, -488, -408, -392, -440, -424,
e8832e66babd New features:
anders
parents:
diff changeset
43 -88, -72, -120, -104, -24, -8, -56, -40,
e8832e66babd New features:
anders
parents:
diff changeset
44 -216, -200, -248, -232, -152, -136, -184, -168,
e8832e66babd New features:
anders
parents:
diff changeset
45 -1376, -1312, -1504, -1440, -1120, -1056, -1248, -1184,
e8832e66babd New features:
anders
parents:
diff changeset
46 -1888, -1824, -2016, -1952, -1632, -1568, -1760, -1696,
e8832e66babd New features:
anders
parents:
diff changeset
47 -688, -656, -752, -720, -560, -528, -624, -592,
e8832e66babd New features:
anders
parents:
diff changeset
48 -944, -912, -1008, -976, -816, -784, -880, -848
e8832e66babd New features:
anders
parents:
diff changeset
49 } ; /* alaw_decode */
e8832e66babd New features:
anders
parents:
diff changeset
50
e8832e66babd New features:
anders
parents:
diff changeset
51 static unsigned char alaw_encode [2049] =
e8832e66babd New features:
anders
parents:
diff changeset
52 { 0xD5, 0xD4, 0xD7, 0xD6, 0xD1, 0xD0, 0xD3, 0xD2, 0xDD, 0xDC, 0xDF, 0xDE,
e8832e66babd New features:
anders
parents:
diff changeset
53 0xD9, 0xD8, 0xDB, 0xDA, 0xC5, 0xC4, 0xC7, 0xC6, 0xC1, 0xC0, 0xC3, 0xC2,
e8832e66babd New features:
anders
parents:
diff changeset
54 0xCD, 0xCC, 0xCF, 0xCE, 0xC9, 0xC8, 0xCB, 0xCA, 0xF5, 0xF5, 0xF4, 0xF4,
e8832e66babd New features:
anders
parents:
diff changeset
55 0xF7, 0xF7, 0xF6, 0xF6, 0xF1, 0xF1, 0xF0, 0xF0, 0xF3, 0xF3, 0xF2, 0xF2,
e8832e66babd New features:
anders
parents:
diff changeset
56 0xFD, 0xFD, 0xFC, 0xFC, 0xFF, 0xFF, 0xFE, 0xFE, 0xF9, 0xF9, 0xF8, 0xF8,
e8832e66babd New features:
anders
parents:
diff changeset
57 0xFB, 0xFB, 0xFA, 0xFA, 0xE5, 0xE5, 0xE5, 0xE5, 0xE4, 0xE4, 0xE4, 0xE4,
e8832e66babd New features:
anders
parents:
diff changeset
58 0xE7, 0xE7, 0xE7, 0xE7, 0xE6, 0xE6, 0xE6, 0xE6, 0xE1, 0xE1, 0xE1, 0xE1,
e8832e66babd New features:
anders
parents:
diff changeset
59 0xE0, 0xE0, 0xE0, 0xE0, 0xE3, 0xE3, 0xE3, 0xE3, 0xE2, 0xE2, 0xE2, 0xE2,
e8832e66babd New features:
anders
parents:
diff changeset
60 0xED, 0xED, 0xED, 0xED, 0xEC, 0xEC, 0xEC, 0xEC, 0xEF, 0xEF, 0xEF, 0xEF,
e8832e66babd New features:
anders
parents:
diff changeset
61 0xEE, 0xEE, 0xEE, 0xEE, 0xE9, 0xE9, 0xE9, 0xE9, 0xE8, 0xE8, 0xE8, 0xE8,
e8832e66babd New features:
anders
parents:
diff changeset
62 0xEB, 0xEB, 0xEB, 0xEB, 0xEA, 0xEA, 0xEA, 0xEA, 0x95, 0x95, 0x95, 0x95,
e8832e66babd New features:
anders
parents:
diff changeset
63 0x95, 0x95, 0x95, 0x95, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94, 0x94,
e8832e66babd New features:
anders
parents:
diff changeset
64 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x97, 0x96, 0x96, 0x96, 0x96,
e8832e66babd New features:
anders
parents:
diff changeset
65 0x96, 0x96, 0x96, 0x96, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91, 0x91,
e8832e66babd New features:
anders
parents:
diff changeset
66 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x90, 0x93, 0x93, 0x93, 0x93,
e8832e66babd New features:
anders
parents:
diff changeset
67 0x93, 0x93, 0x93, 0x93, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92, 0x92,
e8832e66babd New features:
anders
parents:
diff changeset
68 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9D, 0x9C, 0x9C, 0x9C, 0x9C,
e8832e66babd New features:
anders
parents:
diff changeset
69 0x9C, 0x9C, 0x9C, 0x9C, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F, 0x9F,
e8832e66babd New features:
anders
parents:
diff changeset
70 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x9E, 0x99, 0x99, 0x99, 0x99,
e8832e66babd New features:
anders
parents:
diff changeset
71 0x99, 0x99, 0x99, 0x99, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98, 0x98,
e8832e66babd New features:
anders
parents:
diff changeset
72 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9B, 0x9A, 0x9A, 0x9A, 0x9A,
e8832e66babd New features:
anders
parents:
diff changeset
73 0x9A, 0x9A, 0x9A, 0x9A, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85,
e8832e66babd New features:
anders
parents:
diff changeset
74 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x85, 0x84, 0x84, 0x84, 0x84,
e8832e66babd New features:
anders
parents:
diff changeset
75 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84, 0x84,
e8832e66babd New features:
anders
parents:
diff changeset
76 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87, 0x87,
e8832e66babd New features:
anders
parents:
diff changeset
77 0x87, 0x87, 0x87, 0x87, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86,
e8832e66babd New features:
anders
parents:
diff changeset
78 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x86, 0x81, 0x81, 0x81, 0x81,
e8832e66babd New features:
anders
parents:
diff changeset
79 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81, 0x81,
e8832e66babd New features:
anders
parents:
diff changeset
80 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80,
e8832e66babd New features:
anders
parents:
diff changeset
81 0x80, 0x80, 0x80, 0x80, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83,
e8832e66babd New features:
anders
parents:
diff changeset
82 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x83, 0x82, 0x82, 0x82, 0x82,
e8832e66babd New features:
anders
parents:
diff changeset
83 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82, 0x82,
e8832e66babd New features:
anders
parents:
diff changeset
84 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D, 0x8D,
e8832e66babd New features:
anders
parents:
diff changeset
85 0x8D, 0x8D, 0x8D, 0x8D, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C,
e8832e66babd New features:
anders
parents:
diff changeset
86 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8C, 0x8F, 0x8F, 0x8F, 0x8F,
e8832e66babd New features:
anders
parents:
diff changeset
87 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F, 0x8F,
e8832e66babd New features:
anders
parents:
diff changeset
88 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E, 0x8E,
e8832e66babd New features:
anders
parents:
diff changeset
89 0x8E, 0x8E, 0x8E, 0x8E, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89,
e8832e66babd New features:
anders
parents:
diff changeset
90 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x89, 0x88, 0x88, 0x88, 0x88,
e8832e66babd New features:
anders
parents:
diff changeset
91 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88, 0x88,
e8832e66babd New features:
anders
parents:
diff changeset
92 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B, 0x8B,
e8832e66babd New features:
anders
parents:
diff changeset
93 0x8B, 0x8B, 0x8B, 0x8B, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A,
e8832e66babd New features:
anders
parents:
diff changeset
94 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0x8A, 0xB5, 0xB5, 0xB5, 0xB5,
e8832e66babd New features:
anders
parents:
diff changeset
95 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5,
e8832e66babd New features:
anders
parents:
diff changeset
96 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5, 0xB5,
e8832e66babd New features:
anders
parents:
diff changeset
97 0xB5, 0xB5, 0xB5, 0xB5, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4,
e8832e66babd New features:
anders
parents:
diff changeset
98 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4,
e8832e66babd New features:
anders
parents:
diff changeset
99 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4, 0xB4,
e8832e66babd New features:
anders
parents:
diff changeset
100 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7,
e8832e66babd New features:
anders
parents:
diff changeset
101 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7,
e8832e66babd New features:
anders
parents:
diff changeset
102 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB7, 0xB6, 0xB6, 0xB6, 0xB6,
e8832e66babd New features:
anders
parents:
diff changeset
103 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6,
e8832e66babd New features:
anders
parents:
diff changeset
104 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6, 0xB6,
e8832e66babd New features:
anders
parents:
diff changeset
105 0xB6, 0xB6, 0xB6, 0xB6, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1,
e8832e66babd New features:
anders
parents:
diff changeset
106 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1,
e8832e66babd New features:
anders
parents:
diff changeset
107 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1, 0xB1,
e8832e66babd New features:
anders
parents:
diff changeset
108 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0,
e8832e66babd New features:
anders
parents:
diff changeset
109 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0,
e8832e66babd New features:
anders
parents:
diff changeset
110 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB0, 0xB3, 0xB3, 0xB3, 0xB3,
e8832e66babd New features:
anders
parents:
diff changeset
111 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3,
e8832e66babd New features:
anders
parents:
diff changeset
112 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3, 0xB3,
e8832e66babd New features:
anders
parents:
diff changeset
113 0xB3, 0xB3, 0xB3, 0xB3, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2,
e8832e66babd New features:
anders
parents:
diff changeset
114 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2,
e8832e66babd New features:
anders
parents:
diff changeset
115 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2, 0xB2,
e8832e66babd New features:
anders
parents:
diff changeset
116 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD,
e8832e66babd New features:
anders
parents:
diff changeset
117 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD,
e8832e66babd New features:
anders
parents:
diff changeset
118 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBD, 0xBC, 0xBC, 0xBC, 0xBC,
e8832e66babd New features:
anders
parents:
diff changeset
119 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC,
e8832e66babd New features:
anders
parents:
diff changeset
120 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC, 0xBC,
e8832e66babd New features:
anders
parents:
diff changeset
121 0xBC, 0xBC, 0xBC, 0xBC, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF,
e8832e66babd New features:
anders
parents:
diff changeset
122 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF,
e8832e66babd New features:
anders
parents:
diff changeset
123 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF, 0xBF,
e8832e66babd New features:
anders
parents:
diff changeset
124 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE,
e8832e66babd New features:
anders
parents:
diff changeset
125 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE,
e8832e66babd New features:
anders
parents:
diff changeset
126 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xBE, 0xB9, 0xB9, 0xB9, 0xB9,
e8832e66babd New features:
anders
parents:
diff changeset
127 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9,
e8832e66babd New features:
anders
parents:
diff changeset
128 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9, 0xB9,
e8832e66babd New features:
anders
parents:
diff changeset
129 0xB9, 0xB9, 0xB9, 0xB9, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8,
e8832e66babd New features:
anders
parents:
diff changeset
130 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8,
e8832e66babd New features:
anders
parents:
diff changeset
131 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8, 0xB8,
e8832e66babd New features:
anders
parents:
diff changeset
132 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
e8832e66babd New features:
anders
parents:
diff changeset
133 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB,
e8832e66babd New features:
anders
parents:
diff changeset
134 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBB, 0xBA, 0xBA, 0xBA, 0xBA,
e8832e66babd New features:
anders
parents:
diff changeset
135 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA,
e8832e66babd New features:
anders
parents:
diff changeset
136 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA, 0xBA,
e8832e66babd New features:
anders
parents:
diff changeset
137 0xBA, 0xBA, 0xBA, 0xBA, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5,
e8832e66babd New features:
anders
parents:
diff changeset
138 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5,
e8832e66babd New features:
anders
parents:
diff changeset
139 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5,
e8832e66babd New features:
anders
parents:
diff changeset
140 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5,
e8832e66babd New features:
anders
parents:
diff changeset
141 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5,
e8832e66babd New features:
anders
parents:
diff changeset
142 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA5, 0xA4, 0xA4, 0xA4, 0xA4,
e8832e66babd New features:
anders
parents:
diff changeset
143 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4,
e8832e66babd New features:
anders
parents:
diff changeset
144 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4,
e8832e66babd New features:
anders
parents:
diff changeset
145 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4,
e8832e66babd New features:
anders
parents:
diff changeset
146 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4,
e8832e66babd New features:
anders
parents:
diff changeset
147 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4, 0xA4,
e8832e66babd New features:
anders
parents:
diff changeset
148 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7,
e8832e66babd New features:
anders
parents:
diff changeset
149 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7,
e8832e66babd New features:
anders
parents:
diff changeset
150 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7,
e8832e66babd New features:
anders
parents:
diff changeset
151 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7,
e8832e66babd New features:
anders
parents:
diff changeset
152 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7, 0xA7,
e8832e66babd New features:
anders
parents:
diff changeset
153 0xA7, 0xA7, 0xA7, 0xA7, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
e8832e66babd New features:
anders
parents:
diff changeset
154 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
e8832e66babd New features:
anders
parents:
diff changeset
155 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
e8832e66babd New features:
anders
parents:
diff changeset
156 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
e8832e66babd New features:
anders
parents:
diff changeset
157 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6,
e8832e66babd New features:
anders
parents:
diff changeset
158 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA6, 0xA1, 0xA1, 0xA1, 0xA1,
e8832e66babd New features:
anders
parents:
diff changeset
159 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1,
e8832e66babd New features:
anders
parents:
diff changeset
160 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1,
e8832e66babd New features:
anders
parents:
diff changeset
161 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1,
e8832e66babd New features:
anders
parents:
diff changeset
162 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1,
e8832e66babd New features:
anders
parents:
diff changeset
163 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1, 0xA1,
e8832e66babd New features:
anders
parents:
diff changeset
164 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
e8832e66babd New features:
anders
parents:
diff changeset
165 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
e8832e66babd New features:
anders
parents:
diff changeset
166 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
e8832e66babd New features:
anders
parents:
diff changeset
167 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
e8832e66babd New features:
anders
parents:
diff changeset
168 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0, 0xA0,
e8832e66babd New features:
anders
parents:
diff changeset
169 0xA0, 0xA0, 0xA0, 0xA0, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3,
e8832e66babd New features:
anders
parents:
diff changeset
170 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3,
e8832e66babd New features:
anders
parents:
diff changeset
171 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3,
e8832e66babd New features:
anders
parents:
diff changeset
172 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3,
e8832e66babd New features:
anders
parents:
diff changeset
173 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3,
e8832e66babd New features:
anders
parents:
diff changeset
174 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA3, 0xA2, 0xA2, 0xA2, 0xA2,
e8832e66babd New features:
anders
parents:
diff changeset
175 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2,
e8832e66babd New features:
anders
parents:
diff changeset
176 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2,
e8832e66babd New features:
anders
parents:
diff changeset
177 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2,
e8832e66babd New features:
anders
parents:
diff changeset
178 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2,
e8832e66babd New features:
anders
parents:
diff changeset
179 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2, 0xA2,
e8832e66babd New features:
anders
parents:
diff changeset
180 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD,
e8832e66babd New features:
anders
parents:
diff changeset
181 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD,
e8832e66babd New features:
anders
parents:
diff changeset
182 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD,
e8832e66babd New features:
anders
parents:
diff changeset
183 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD,
e8832e66babd New features:
anders
parents:
diff changeset
184 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD, 0xAD,
e8832e66babd New features:
anders
parents:
diff changeset
185 0xAD, 0xAD, 0xAD, 0xAD, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC,
e8832e66babd New features:
anders
parents:
diff changeset
186 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC,
e8832e66babd New features:
anders
parents:
diff changeset
187 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC,
e8832e66babd New features:
anders
parents:
diff changeset
188 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC,
e8832e66babd New features:
anders
parents:
diff changeset
189 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC,
e8832e66babd New features:
anders
parents:
diff changeset
190 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAC, 0xAF, 0xAF, 0xAF, 0xAF,
e8832e66babd New features:
anders
parents:
diff changeset
191 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF,
e8832e66babd New features:
anders
parents:
diff changeset
192 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF,
e8832e66babd New features:
anders
parents:
diff changeset
193 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF,
e8832e66babd New features:
anders
parents:
diff changeset
194 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF,
e8832e66babd New features:
anders
parents:
diff changeset
195 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF, 0xAF,
e8832e66babd New features:
anders
parents:
diff changeset
196 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE,
e8832e66babd New features:
anders
parents:
diff changeset
197 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE,
e8832e66babd New features:
anders
parents:
diff changeset
198 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE,
e8832e66babd New features:
anders
parents:
diff changeset
199 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE,
e8832e66babd New features:
anders
parents:
diff changeset
200 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE, 0xAE,
e8832e66babd New features:
anders
parents:
diff changeset
201 0xAE, 0xAE, 0xAE, 0xAE, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9,
e8832e66babd New features:
anders
parents:
diff changeset
202 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9,
e8832e66babd New features:
anders
parents:
diff changeset
203 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9,
e8832e66babd New features:
anders
parents:
diff changeset
204 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9,
e8832e66babd New features:
anders
parents:
diff changeset
205 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9,
e8832e66babd New features:
anders
parents:
diff changeset
206 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA9, 0xA8, 0xA8, 0xA8, 0xA8,
e8832e66babd New features:
anders
parents:
diff changeset
207 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8,
e8832e66babd New features:
anders
parents:
diff changeset
208 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8,
e8832e66babd New features:
anders
parents:
diff changeset
209 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8,
e8832e66babd New features:
anders
parents:
diff changeset
210 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8,
e8832e66babd New features:
anders
parents:
diff changeset
211 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8, 0xA8,
e8832e66babd New features:
anders
parents:
diff changeset
212 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,
e8832e66babd New features:
anders
parents:
diff changeset
213 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,
e8832e66babd New features:
anders
parents:
diff changeset
214 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,
e8832e66babd New features:
anders
parents:
diff changeset
215 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,
e8832e66babd New features:
anders
parents:
diff changeset
216 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB, 0xAB,
e8832e66babd New features:
anders
parents:
diff changeset
217 0xAB, 0xAB, 0xAB, 0xAB, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
e8832e66babd New features:
anders
parents:
diff changeset
218 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
e8832e66babd New features:
anders
parents:
diff changeset
219 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
e8832e66babd New features:
anders
parents:
diff changeset
220 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
e8832e66babd New features:
anders
parents:
diff changeset
221 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA,
e8832e66babd New features:
anders
parents:
diff changeset
222 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0xAA, 0x2A
e8832e66babd New features:
anders
parents:
diff changeset
223 } ; /* alaw_encode */
e8832e66babd New features:
anders
parents:
diff changeset
224
e8832e66babd New features:
anders
parents:
diff changeset
225 /* Convert from alaw to signd int8 to signed int32 or float */
e8832e66babd New features:
anders
parents:
diff changeset
226 static int from_alaw(void* in, void* out, int len, int bps, int format)
e8832e66babd New features:
anders
parents:
diff changeset
227 {
e8832e66babd New features:
anders
parents:
diff changeset
228 register int i;
e8832e66babd New features:
anders
parents:
diff changeset
229 // Make sure the input parametrs are OK
e8832e66babd New features:
anders
parents:
diff changeset
230 if(format & (AF_FORMAT_SPECIAL_MASK | AF_FORMAT_US))
e8832e66babd New features:
anders
parents:
diff changeset
231 return AF_ERROR;
e8832e66babd New features:
anders
parents:
diff changeset
232
e8832e66babd New features:
anders
parents:
diff changeset
233 // Convert to int or to float
e8832e66babd New features:
anders
parents:
diff changeset
234 if((format & AF_FORMAT_POINT_MASK) == AF_FORMAT_I){
e8832e66babd New features:
anders
parents:
diff changeset
235 switch(bps){
e8832e66babd New features:
anders
parents:
diff changeset
236 case(1):
e8832e66babd New features:
anders
parents:
diff changeset
237 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
238 if(((int8_t*)in)[i] & 0x80)
e8832e66babd New features:
anders
parents:
diff changeset
239 ((int8_t*)out)[i] = (-1 * alaw_decode[(((int8_t*)in)[i]) & 0x7F]) >> 8;
e8832e66babd New features:
anders
parents:
diff changeset
240 else
e8832e66babd New features:
anders
parents:
diff changeset
241 ((int8_t*)out)[i] = (alaw_decode[(((int8_t*)in)[i]) & 0x7F]) >> 8;
e8832e66babd New features:
anders
parents:
diff changeset
242 }
e8832e66babd New features:
anders
parents:
diff changeset
243 break;
e8832e66babd New features:
anders
parents:
diff changeset
244 case(2):
e8832e66babd New features:
anders
parents:
diff changeset
245 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
246 if(((int8_t*)in)[i] & 0x80)
e8832e66babd New features:
anders
parents:
diff changeset
247 ((int16_t*)out)[i] = -1 * alaw_decode[(((int8_t*)in)[i]) & 0x7F];
e8832e66babd New features:
anders
parents:
diff changeset
248 else
e8832e66babd New features:
anders
parents:
diff changeset
249 ((int16_t*)out)[i] = alaw_decode[(((int8_t*)in)[i]) & 0x7F];
e8832e66babd New features:
anders
parents:
diff changeset
250 }
e8832e66babd New features:
anders
parents:
diff changeset
251 break;
e8832e66babd New features:
anders
parents:
diff changeset
252 case(4):
e8832e66babd New features:
anders
parents:
diff changeset
253 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
254 if(((int8_t*)in)[i] & 0x80)
e8832e66babd New features:
anders
parents:
diff changeset
255 ((int32_t*)out)[i] = (-1 * alaw_decode[(((int8_t*)in)[i]) & 0x7F]) << 16;
e8832e66babd New features:
anders
parents:
diff changeset
256 else
e8832e66babd New features:
anders
parents:
diff changeset
257 ((int32_t*)out)[i] = (alaw_decode[(((int8_t*)in)[i]) & 0x7F]) << 16;
e8832e66babd New features:
anders
parents:
diff changeset
258 }
e8832e66babd New features:
anders
parents:
diff changeset
259 break;
e8832e66babd New features:
anders
parents:
diff changeset
260 default:
e8832e66babd New features:
anders
parents:
diff changeset
261 return AF_ERROR;
e8832e66babd New features:
anders
parents:
diff changeset
262 }
e8832e66babd New features:
anders
parents:
diff changeset
263 }
e8832e66babd New features:
anders
parents:
diff changeset
264 else{
e8832e66babd New features:
anders
parents:
diff changeset
265 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
266 if(((int8_t*)in)[i] & 0x80)
e8832e66babd New features:
anders
parents:
diff changeset
267 ((float*)out)[i] = -1.0/32768.0 * (float)alaw_decode[(((int8_t*)in)[i]) & 0x7F];
e8832e66babd New features:
anders
parents:
diff changeset
268 else
e8832e66babd New features:
anders
parents:
diff changeset
269 ((float*)out)[i] = +1.0/32768.0 * (float)alaw_decode[(((int8_t*)in)[i]) & 0x7F];
e8832e66babd New features:
anders
parents:
diff changeset
270 }
e8832e66babd New features:
anders
parents:
diff changeset
271 }
e8832e66babd New features:
anders
parents:
diff changeset
272 return AF_OK;
e8832e66babd New features:
anders
parents:
diff changeset
273 }
e8832e66babd New features:
anders
parents:
diff changeset
274
24595
85f669a84e7a cosmetics: misc typo fixes
diego
parents: 22748
diff changeset
275 /* Convert from signed int8 to signed int32 or float to alaw */
8167
e8832e66babd New features:
anders
parents:
diff changeset
276 static int to_alaw(void* in, void* out, int len, int bps, int format)
e8832e66babd New features:
anders
parents:
diff changeset
277 {
e8832e66babd New features:
anders
parents:
diff changeset
278 register int i;
e8832e66babd New features:
anders
parents:
diff changeset
279 // Make sure the input parametrs are OK
e8832e66babd New features:
anders
parents:
diff changeset
280 if(format & (AF_FORMAT_SPECIAL_MASK | AF_FORMAT_US))
e8832e66babd New features:
anders
parents:
diff changeset
281 return AF_ERROR;
e8832e66babd New features:
anders
parents:
diff changeset
282
e8832e66babd New features:
anders
parents:
diff changeset
283 // Convert from int or to float
e8832e66babd New features:
anders
parents:
diff changeset
284 if((format & AF_FORMAT_POINT_MASK) == AF_FORMAT_I){
e8832e66babd New features:
anders
parents:
diff changeset
285 switch(bps){
e8832e66babd New features:
anders
parents:
diff changeset
286 case(1):
e8832e66babd New features:
anders
parents:
diff changeset
287 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
288 if(((int8_t*)in)[i] >= 0)
e8832e66babd New features:
anders
parents:
diff changeset
289 ((int8_t*)out)[i] = alaw_encode[((int8_t*)in)[i] << 4];
e8832e66babd New features:
anders
parents:
diff changeset
290 else
e8832e66babd New features:
anders
parents:
diff changeset
291 ((int8_t*)out)[i] = 0x7F & alaw_encode[-((int8_t*)in)[i] << 4];
e8832e66babd New features:
anders
parents:
diff changeset
292 }
e8832e66babd New features:
anders
parents:
diff changeset
293 break;
e8832e66babd New features:
anders
parents:
diff changeset
294 case(2):
e8832e66babd New features:
anders
parents:
diff changeset
295 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
296 if(((int16_t*)in)[i] >= 0)
e8832e66babd New features:
anders
parents:
diff changeset
297 ((int8_t*)out)[i] = alaw_encode[((int16_t*)in)[i] / 16];
e8832e66babd New features:
anders
parents:
diff changeset
298 else
e8832e66babd New features:
anders
parents:
diff changeset
299 ((int8_t*)out)[i] = 0x7F & alaw_encode[((int16_t*)in)[i] / -16];
e8832e66babd New features:
anders
parents:
diff changeset
300 }
e8832e66babd New features:
anders
parents:
diff changeset
301 break;
e8832e66babd New features:
anders
parents:
diff changeset
302 case(4):
e8832e66babd New features:
anders
parents:
diff changeset
303 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
304 if(((int32_t*)in)[i] >= 0)
e8832e66babd New features:
anders
parents:
diff changeset
305 ((int8_t*)out)[i] = alaw_encode[((int32_t*)in)[i] >> (16 + 4)];
e8832e66babd New features:
anders
parents:
diff changeset
306 else
e8832e66babd New features:
anders
parents:
diff changeset
307 ((int8_t*)out)[i] = 0x7F & alaw_encode[-((int32_t*)in)[i] >> (16 + 4)];
e8832e66babd New features:
anders
parents:
diff changeset
308 }
e8832e66babd New features:
anders
parents:
diff changeset
309 break;
e8832e66babd New features:
anders
parents:
diff changeset
310 default:
e8832e66babd New features:
anders
parents:
diff changeset
311 return AF_ERROR;
e8832e66babd New features:
anders
parents:
diff changeset
312 }
e8832e66babd New features:
anders
parents:
diff changeset
313 }
e8832e66babd New features:
anders
parents:
diff changeset
314 else{
e8832e66babd New features:
anders
parents:
diff changeset
315 for(i=0;i<len;i++){
e8832e66babd New features:
anders
parents:
diff changeset
316 if(((float*)in)[i] >= 0)
e8832e66babd New features:
anders
parents:
diff changeset
317 ((int8_t*)out)[i] = alaw_encode[(int)(32767.0/16.0 * ((float*)in)[i])];
e8832e66babd New features:
anders
parents:
diff changeset
318 else
e8832e66babd New features:
anders
parents:
diff changeset
319 ((int8_t*)out)[i] = 0x7F & alaw_encode[(int)(-32767.0/16.0 * ((float*)in)[i])];
e8832e66babd New features:
anders
parents:
diff changeset
320 }
e8832e66babd New features:
anders
parents:
diff changeset
321 }
e8832e66babd New features:
anders
parents:
diff changeset
322 return AF_OK;
e8832e66babd New features:
anders
parents:
diff changeset
323 }
28238
1bf9023840f9 Rename libaf/af_format_alaw.c --> libaf/af_format_alaw.h and
diego
parents: 28237
diff changeset
324 #endif /* MPLAYER_AF_FORMAT_ALAW_H */