Mercurial > libavcodec.hg
comparison ws-snd1.c @ 12433:46724a37cc2d libavcodec
Hopefully fix the fate-ws_snd breakage on PPC
author | vitor |
---|---|
date | Sat, 28 Aug 2010 21:17:49 +0000 |
parents | 7dd2a45249a9 |
children | 7915312dd862 |
comparison
equal
deleted
inserted
replaced
12432:f61e22f8cf28 | 12433:46724a37cc2d |
---|---|
17 * You should have received a copy of the GNU Lesser General Public | 17 * You should have received a copy of the GNU Lesser General Public |
18 * License along with FFmpeg; if not, write to the Free Software | 18 * License along with FFmpeg; if not, write to the Free Software |
19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA |
20 */ | 20 */ |
21 | 21 |
22 #include <inttypes.h> | |
22 #include "libavutil/intreadwrite.h" | 23 #include "libavutil/intreadwrite.h" |
23 #include "avcodec.h" | 24 #include "avcodec.h" |
24 | 25 |
25 /** | 26 /** |
26 * @file | 27 * @file |
29 * Reference documents about VQA format and its audio codecs | 30 * Reference documents about VQA format and its audio codecs |
30 * can be found here: | 31 * can be found here: |
31 * http://www.multimedia.cx | 32 * http://www.multimedia.cx |
32 */ | 33 */ |
33 | 34 |
34 static const char ws_adpcm_2bit[] = { -2, -1, 0, 1}; | 35 static const int8_t ws_adpcm_2bit[] = { -2, -1, 0, 1}; |
35 static const char ws_adpcm_4bit[] = { | 36 static const int8_t ws_adpcm_4bit[] = { |
36 -9, -8, -6, -5, -4, -3, -2, -1, | 37 -9, -8, -6, -5, -4, -3, -2, -1, |
37 0, 1, 2, 3, 4, 5, 6, 8 }; | 38 0, 1, 2, 3, 4, 5, 6, 8 }; |
38 | 39 |
39 #define CLIP8(a) if(a>127)a=127;if(a<-128)a=-128; | 40 #define CLIP8(a) if(a>127)a=127;if(a<-128)a=-128; |
40 | 41 |
118 out_size -= 2; | 119 out_size -= 2; |
119 } | 120 } |
120 break; | 121 break; |
121 case 2: /* no compression */ | 122 case 2: /* no compression */ |
122 if (count & 0x20) { /* big delta */ | 123 if (count & 0x20) { /* big delta */ |
123 char t; | 124 int8_t t; |
124 t = count; | 125 t = count; |
125 t <<= 3; | 126 t <<= 3; |
126 sample += t >> 3; | 127 sample += t >> 3; |
127 *samples++ = sample << 8; | 128 *samples++ = sample << 8; |
128 out_size--; | 129 out_size--; |