summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--apps/codecs/libspeex/bits.c17
-rw-r--r--apps/codecs/libspeex/modes.c6
-rw-r--r--apps/codecs/libspeex/modes_wb.c12
-rw-r--r--apps/codecs/libspeex/nb_celp.c2
-rw-r--r--apps/codecs/libspeex/speex.c16
-rw-r--r--apps/codecs/libspeex/speex/speex.h4
-rw-r--r--apps/codecs/libspeex/speex/speex_bits.h10
-rw-r--r--apps/codecs/libspeex/speex_callbacks.c9
8 files changed, 58 insertions, 18 deletions
diff --git a/apps/codecs/libspeex/bits.c b/apps/codecs/libspeex/bits.c
index cc63ce0d16..c7a5c14ede 100644
--- a/apps/codecs/libspeex/bits.c
+++ b/apps/codecs/libspeex/bits.c
@@ -60,6 +60,8 @@ void speex_bits_init(SpeexBits *bits)
60} 60}
61#endif 61#endif
62 62
63#if 0
64/* Rockbox: unused */
63void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size) 65void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size)
64{ 66{
65 bits->chars = (char*)buff; 67 bits->chars = (char*)buff;
@@ -69,6 +71,7 @@ void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size)
69 71
70 speex_bits_reset(bits); 72 speex_bits_reset(bits);
71} 73}
74#endif
72 75
73void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size) 76void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size)
74{ 77{
@@ -93,6 +96,7 @@ void speex_bits_destroy(SpeexBits *bits)
93} 96}
94#endif 97#endif
95 98
99#ifdef ROCKBOX_VOICE_ENCODER
96void speex_bits_reset(SpeexBits *bits) 100void speex_bits_reset(SpeexBits *bits)
97{ 101{
98 /* We only need to clear the first byte now */ 102 /* We only need to clear the first byte now */
@@ -102,13 +106,17 @@ void speex_bits_reset(SpeexBits *bits)
102 bits->bitPtr=0; 106 bits->bitPtr=0;
103 bits->overflow=0; 107 bits->overflow=0;
104} 108}
109#endif
105 110
111#if 0
112/* Rockbox: unused */
106void speex_bits_rewind(SpeexBits *bits) 113void speex_bits_rewind(SpeexBits *bits)
107{ 114{
108 bits->charPtr=0; 115 bits->charPtr=0;
109 bits->bitPtr=0; 116 bits->bitPtr=0;
110 bits->overflow=0; 117 bits->overflow=0;
111} 118}
119#endif
112 120
113#if !defined(SPEEX_VOICE_ENCODER) && !defined(ROCKBOX_VOICE_CODEC) 121#if !defined(SPEEX_VOICE_ENCODER) && !defined(ROCKBOX_VOICE_CODEC)
114void speex_bits_read_from(SpeexBits *bits, char *chars, int len) 122void speex_bits_read_from(SpeexBits *bits, char *chars, int len)
@@ -277,6 +285,8 @@ void speex_bits_pack(SpeexBits *bits, int data, int nbBits)
277} 285}
278#endif /* SPEEX_DISABLE_ENCODER */ 286#endif /* SPEEX_DISABLE_ENCODER */
279 287
288#if 0
289/* Rockbox: unused */
280int speex_bits_unpack_signed(SpeexBits *bits, int nbBits) 290int speex_bits_unpack_signed(SpeexBits *bits, int nbBits)
281{ 291{
282 unsigned int d=speex_bits_unpack_unsigned(bits,nbBits); 292 unsigned int d=speex_bits_unpack_unsigned(bits,nbBits);
@@ -287,6 +297,7 @@ int speex_bits_unpack_signed(SpeexBits *bits, int nbBits)
287 } 297 }
288 return d; 298 return d;
289} 299}
300#endif
290 301
291unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits) 302unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits)
292{ 303{
@@ -310,6 +321,8 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits)
310 return d; 321 return d;
311} 322}
312 323
324#if 0
325/* Rockbox: unused */
313unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits) 326unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits)
314{ 327{
315 unsigned int d=0; 328 unsigned int d=0;
@@ -338,6 +351,7 @@ unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits)
338 } 351 }
339 return d; 352 return d;
340} 353}
354#endif
341 355
342int speex_bits_peek(SpeexBits *bits) 356int speex_bits_peek(SpeexBits *bits)
343{ 357{
@@ -366,10 +380,13 @@ int speex_bits_remaining(SpeexBits *bits)
366 return bits->nbBits-((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr); 380 return bits->nbBits-((bits->charPtr<<LOG2_BITS_PER_CHAR)+bits->bitPtr);
367} 381}
368 382
383#if 0
384/* Rockbox: unused */
369int speex_bits_nbytes(SpeexBits *bits) 385int speex_bits_nbytes(SpeexBits *bits)
370{ 386{
371 return ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR); 387 return ((bits->nbBits+BITS_PER_CHAR-1)>>LOG2_BITS_PER_CHAR);
372} 388}
389#endif
373 390
374#ifndef SPEEX_DISABLE_ENCODER 391#ifndef SPEEX_DISABLE_ENCODER
375void speex_bits_insert_terminator(SpeexBits *bits) 392void speex_bits_insert_terminator(SpeexBits *bits)
diff --git a/apps/codecs/libspeex/modes.c b/apps/codecs/libspeex/modes.c
index 20ea287344..d1046f1cfb 100644
--- a/apps/codecs/libspeex/modes.c
+++ b/apps/codecs/libspeex/modes.c
@@ -464,13 +464,13 @@ const SpeexMode speex_nb_mode = {
464 &nb_encoder_ctl, 464 &nb_encoder_ctl,
465 &nb_decoder_ctl, 465 &nb_decoder_ctl,
466#else 466#else
467/* NULL,
467 NULL, 468 NULL,
468 NULL, 469 NULL, */
469 NULL,
470 &nb_decoder_init, 470 &nb_decoder_init,
471 &nb_decoder_destroy, 471 &nb_decoder_destroy,
472 &nb_decode, 472 &nb_decode,
473 NULL, 473/* NULL, */
474 &nb_decoder_ctl, 474 &nb_decoder_ctl,
475#endif 475#endif
476}; 476};
diff --git a/apps/codecs/libspeex/modes_wb.c b/apps/codecs/libspeex/modes_wb.c
index 7fac15b852..93922afa2f 100644
--- a/apps/codecs/libspeex/modes_wb.c
+++ b/apps/codecs/libspeex/modes_wb.c
@@ -264,13 +264,13 @@ const SpeexMode speex_wb_mode = {
264 &sb_encoder_ctl, 264 &sb_encoder_ctl,
265 &sb_decoder_ctl, 265 &sb_decoder_ctl,
266#else 266#else
267/* NULL,
267 NULL, 268 NULL,
268 NULL, 269 NULL, */
269 NULL,
270 &sb_decoder_init, 270 &sb_decoder_init,
271 &sb_decoder_destroy, 271 &sb_decoder_destroy,
272 &sb_decode, 272 &sb_decode,
273 NULL, 273/* NULL, */
274 &sb_decoder_ctl, 274 &sb_decoder_ctl,
275#endif 275#endif
276}; 276};
@@ -348,13 +348,13 @@ const SpeexMode speex_uwb_mode = {
348 &sb_encoder_ctl, 348 &sb_encoder_ctl,
349 &sb_decoder_ctl, 349 &sb_decoder_ctl,
350#else 350#else
351/* NULL,
351 NULL, 352 NULL,
352 NULL, 353 NULL, */
353 NULL,
354 &sb_decoder_init, 354 &sb_decoder_init,
355 &sb_decoder_destroy, 355 &sb_decoder_destroy,
356 &sb_decode, 356 &sb_decode,
357 NULL, 357/* NULL, */
358 &sb_decoder_ctl, 358 &sb_decoder_ctl,
359#endif 359#endif
360}; 360};
diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c
index 98f5e2e240..364f987472 100644
--- a/apps/codecs/libspeex/nb_celp.c
+++ b/apps/codecs/libspeex/nb_celp.c
@@ -1092,7 +1092,7 @@ static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack)
1092#endif 1092#endif
1093 1093
1094/* Just so we don't need to carry the complete wideband mode information */ 1094/* Just so we don't need to carry the complete wideband mode information */
1095static const int wb_skip_table[8] = {0, 36, 112, 192, 352, 0, 0, 0}; 1095static const unsigned short wb_skip_table[8] = {0, 36, 112, 192, 352, 0, 0, 0};
1096 1096
1097int nb_decode(void *state, SpeexBits *bits, void *vout) 1097int nb_decode(void *state, SpeexBits *bits, void *vout)
1098{ 1098{
diff --git a/apps/codecs/libspeex/speex.c b/apps/codecs/libspeex/speex.c
index a77653f21a..0dcfb3f7f6 100644
--- a/apps/codecs/libspeex/speex.c
+++ b/apps/codecs/libspeex/speex.c
@@ -46,34 +46,36 @@
46 46
47#define MAX_IN_SAMPLES 640 47#define MAX_IN_SAMPLES 640
48 48
49 49#ifndef SPEEX_DISABLE_ENCODER
50
51void *speex_encoder_init(const SpeexMode *mode) 50void *speex_encoder_init(const SpeexMode *mode)
52{ 51{
53 return mode->enc_init(mode); 52 return mode->enc_init(mode);
54} 53}
54#endif
55 55
56void *speex_decoder_init(const SpeexMode *mode) 56void *speex_decoder_init(const SpeexMode *mode)
57{ 57{
58 return mode->dec_init(mode); 58 return mode->dec_init(mode);
59} 59}
60 60
61#ifndef SPEEX_DISABLE_ENCODER
61void speex_encoder_destroy(void *state) 62void speex_encoder_destroy(void *state)
62{ 63{
63 (*((SpeexMode**)state))->enc_destroy(state); 64 (*((SpeexMode**)state))->enc_destroy(state);
64} 65}
66#endif
65 67
66void speex_decoder_destroy(void *state) 68void speex_decoder_destroy(void *state)
67{ 69{
68 (*((SpeexMode**)state))->dec_destroy(state); 70 (*((SpeexMode**)state))->dec_destroy(state);
69} 71}
70 72
71 73#ifndef SPEEX_DISABLE_ENCODER
72
73int speex_encode_native(void *state, spx_word16_t *in, SpeexBits *bits) 74int speex_encode_native(void *state, spx_word16_t *in, SpeexBits *bits)
74{ 75{
75 return (*((SpeexMode**)state))->enc(state, in, bits); 76 return (*((SpeexMode**)state))->enc(state, in, bits);
76} 77}
78#endif
77 79
78int speex_decode_native(void *state, SpeexBits *bits, spx_word16_t *out) 80int speex_decode_native(void *state, SpeexBits *bits, spx_word16_t *out)
79{ 81{
@@ -177,20 +179,18 @@ int speex_decode_int(void *state, SpeexBits *bits, spx_int16_t *out)
177} 179}
178#endif 180#endif
179 181
180 182#ifndef SPEEX_DISABLE_ENCODER
181
182int speex_encoder_ctl(void *state, int request, void *ptr) 183int speex_encoder_ctl(void *state, int request, void *ptr)
183{ 184{
184 return (*((SpeexMode**)state))->enc_ctl(state, request, ptr); 185 return (*((SpeexMode**)state))->enc_ctl(state, request, ptr);
185} 186}
187#endif
186 188
187int speex_decoder_ctl(void *state, int request, void *ptr) 189int speex_decoder_ctl(void *state, int request, void *ptr)
188{ 190{
189 return (*((SpeexMode**)state))->dec_ctl(state, request, ptr); 191 return (*((SpeexMode**)state))->dec_ctl(state, request, ptr);
190} 192}
191 193
192
193
194int nb_mode_query(const void *mode, int request, void *ptr) 194int nb_mode_query(const void *mode, int request, void *ptr)
195{ 195{
196 const SpeexNBMode *m = (const SpeexNBMode*)mode; 196 const SpeexNBMode *m = (const SpeexNBMode*)mode;
diff --git a/apps/codecs/libspeex/speex/speex.h b/apps/codecs/libspeex/speex/speex.h
index ffb0714f1c..086d492670 100644
--- a/apps/codecs/libspeex/speex/speex.h
+++ b/apps/codecs/libspeex/speex/speex.h
@@ -263,6 +263,7 @@ typedef struct SpeexMode {
263 bitstream compatibility*/ 263 bitstream compatibility*/
264 int bitstream_version; 264 int bitstream_version;
265 265
266#ifndef SPEEX_DISABLE_ENCODER
266 /** Pointer to encoder initialization function */ 267 /** Pointer to encoder initialization function */
267 encoder_init_func enc_init; 268 encoder_init_func enc_init;
268 269
@@ -271,6 +272,7 @@ typedef struct SpeexMode {
271 272
272 /** Pointer to frame encoding function */ 273 /** Pointer to frame encoding function */
273 encode_func enc; 274 encode_func enc;
275#endif
274 276
275 /** Pointer to decoder initialization function */ 277 /** Pointer to decoder initialization function */
276 decoder_init_func dec_init; 278 decoder_init_func dec_init;
@@ -281,8 +283,10 @@ typedef struct SpeexMode {
281 /** Pointer to frame decoding function */ 283 /** Pointer to frame decoding function */
282 decode_func dec; 284 decode_func dec;
283 285
286#ifndef SPEEX_DISABLE_ENCODER
284 /** ioctl-like requests for encoder */ 287 /** ioctl-like requests for encoder */
285 encoder_ctl_func enc_ctl; 288 encoder_ctl_func enc_ctl;
289#endif
286 290
287 /** ioctl-like requests for decoder */ 291 /** ioctl-like requests for decoder */
288 decoder_ctl_func dec_ctl; 292 decoder_ctl_func dec_ctl;
diff --git a/apps/codecs/libspeex/speex/speex_bits.h b/apps/codecs/libspeex/speex/speex_bits.h
index a26fb4ce0c..fee2893380 100644
--- a/apps/codecs/libspeex/speex/speex_bits.h
+++ b/apps/codecs/libspeex/speex/speex_bits.h
@@ -62,7 +62,9 @@ typedef struct SpeexBits {
62void speex_bits_init(SpeexBits *bits); 62void speex_bits_init(SpeexBits *bits);
63 63
64/** Initializes SpeexBits struct using a pre-allocated buffer*/ 64/** Initializes SpeexBits struct using a pre-allocated buffer*/
65/* Rockbox: unused
65void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size); 66void speex_bits_init_buffer(SpeexBits *bits, void *buff, int buf_size);
67*/
66 68
67/** Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data) */ 69/** Sets the bits in a SpeexBits struct to use data from an existing buffer (for decoding without copying data) */
68void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size); 70void speex_bits_set_bit_buffer(SpeexBits *bits, void *buff, int buf_size);
@@ -74,7 +76,9 @@ void speex_bits_destroy(SpeexBits *bits);
74void speex_bits_reset(SpeexBits *bits); 76void speex_bits_reset(SpeexBits *bits);
75 77
76/** Rewind the bit-stream to the beginning (ready for read) without erasing the content */ 78/** Rewind the bit-stream to the beginning (ready for read) without erasing the content */
79/* Rockbox: unused
77void speex_bits_rewind(SpeexBits *bits); 80void speex_bits_rewind(SpeexBits *bits);
81*/
78 82
79/** Initializes the bit-stream from the data in an area of memory */ 83/** Initializes the bit-stream from the data in an area of memory */
80void speex_bits_read_from(SpeexBits *bits, char *bytes, int len); 84void speex_bits_read_from(SpeexBits *bits, char *bytes, int len);
@@ -112,7 +116,9 @@ void speex_bits_pack(SpeexBits *bits, int data, int nbBits);
112 * @param nbBits Number of bits to interpret 116 * @param nbBits Number of bits to interpret
113 * @return A signed integer represented by the bits read 117 * @return A signed integer represented by the bits read
114 */ 118 */
119/* Rockbox: unused
115int speex_bits_unpack_signed(SpeexBits *bits, int nbBits); 120int speex_bits_unpack_signed(SpeexBits *bits, int nbBits);
121*/
116 122
117/** Interpret the next bits in the bit-stream as an unsigned integer 123/** Interpret the next bits in the bit-stream as an unsigned integer
118 * 124 *
@@ -127,7 +133,9 @@ unsigned int speex_bits_unpack_unsigned(SpeexBits *bits, int nbBits);
127 * @param bits Bit-stream to operate on 133 * @param bits Bit-stream to operate on
128 * @return Number of bytes in the stream 134 * @return Number of bytes in the stream
129 */ 135 */
136/* Rockbox: unused
130int speex_bits_nbytes(SpeexBits *bits); 137int speex_bits_nbytes(SpeexBits *bits);
138*/
131 139
132/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position 140/** Same as speex_bits_unpack_unsigned, but without modifying the cursor position
133 * 141 *
@@ -135,7 +143,9 @@ int speex_bits_nbytes(SpeexBits *bits);
135 * @param nbBits Number of bits to look for 143 * @param nbBits Number of bits to look for
136 * @return Value of the bits peeked, interpreted as unsigned 144 * @return Value of the bits peeked, interpreted as unsigned
137 */ 145 */
146/* Rockbox: unused
138unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits); 147unsigned int speex_bits_peek_unsigned(SpeexBits *bits, int nbBits);
148*/
139 149
140/** Get the value of the next bit in the stream, without modifying the 150/** Get the value of the next bit in the stream, without modifying the
141 * "cursor" position 151 * "cursor" position
diff --git a/apps/codecs/libspeex/speex_callbacks.c b/apps/codecs/libspeex/speex_callbacks.c
index 9ffe5245f1..f1de038488 100644
--- a/apps/codecs/libspeex/speex_callbacks.c
+++ b/apps/codecs/libspeex/speex_callbacks.c
@@ -72,6 +72,8 @@ int speex_inband_handler(SpeexBits *bits, SpeexCallback *callback_list, void *st
72 return 0; 72 return 0;
73} 73}
74 74
75#if 0
76/* Rockbox: unused */
75int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data) 77int speex_std_mode_request_handler(SpeexBits *bits, void *state, void *data)
76{ 78{
77 (void)state; 79 (void)state;
@@ -98,6 +100,7 @@ int speex_std_high_mode_request_handler(SpeexBits *bits, void *state, void *data
98 speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m); 100 speex_encoder_ctl(data, SPEEX_SET_HIGH_MODE, &m);
99 return 0; 101 return 0;
100} 102}
103#endif
101 104
102#ifndef DISABLE_VBR 105#ifndef DISABLE_VBR
103int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data) 106int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
@@ -110,6 +113,8 @@ int speex_std_vbr_request_handler(SpeexBits *bits, void *state, void *data)
110} 113}
111#endif /* #ifndef DISABLE_VBR */ 114#endif /* #ifndef DISABLE_VBR */
112 115
116#if 0
117/* Rockbox: unused */
113int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data) 118int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
114{ 119{
115 (void)state; 120 (void)state;
@@ -118,6 +123,7 @@ int speex_std_enh_request_handler(SpeexBits *bits, void *state, void *data)
118 speex_decoder_ctl(data, SPEEX_SET_ENH, &enh); 123 speex_decoder_ctl(data, SPEEX_SET_ENH, &enh);
119 return 0; 124 return 0;
120} 125}
126#endif
121 127
122#ifndef DISABLE_VBR 128#ifndef DISABLE_VBR
123int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data) 129int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *data)
@@ -130,6 +136,8 @@ int speex_std_vbr_quality_request_handler(SpeexBits *bits, void *state, void *da
130} 136}
131#endif /* #ifndef DISABLE_VBR */ 137#endif /* #ifndef DISABLE_VBR */
132 138
139#if 0
140/* Rockbox: unused */
133int speex_std_char_handler(SpeexBits *bits, void *state, void *data) 141int speex_std_char_handler(SpeexBits *bits, void *state, void *data)
134{ 142{
135 (void)state; 143 (void)state;
@@ -139,6 +147,7 @@ int speex_std_char_handler(SpeexBits *bits, void *state, void *data)
139 /*printf("speex_std_char_handler ch=%x\n", ch);*/ 147 /*printf("speex_std_char_handler ch=%x\n", ch);*/
140 return 0; 148 return 0;
141} 149}
150#endif
142 151
143/* Default handler for user callbacks: skip it */ 152/* Default handler for user callbacks: skip it */
144int speex_default_user_handler(SpeexBits *bits, void *state, void *data) 153int speex_default_user_handler(SpeexBits *bits, void *state, void *data)