summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThom Johansen <thomj@rockbox.org>2007-11-18 23:17:25 +0000
committerThom Johansen <thomj@rockbox.org>2007-11-18 23:17:25 +0000
commitc31818ccf0d7acadb91e95ba02980ced209489e0 (patch)
tree5342137633a5ee1414963d7f12c0764a79fdc7d8
parentc46de8ab734fa3a848056a7b69806859c4b582df (diff)
downloadrockbox-c31818ccf0d7acadb91e95ba02980ced209489e0.tar.gz
rockbox-c31818ccf0d7acadb91e95ba02980ced209489e0.zip
Disable some UWB mode stuff and lost package handling in voice codec.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@15676 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libspeex/modes_wb.c8
-rw-r--r--apps/codecs/libspeex/nb_celp.c4
-rw-r--r--apps/codecs/libspeex/sb_celp.c6
3 files changed, 18 insertions, 0 deletions
diff --git a/apps/codecs/libspeex/modes_wb.c b/apps/codecs/libspeex/modes_wb.c
index af16cdd775..8e351db60d 100644
--- a/apps/codecs/libspeex/modes_wb.c
+++ b/apps/codecs/libspeex/modes_wb.c
@@ -52,7 +52,11 @@
52#define NULL 0 52#define NULL 0
53#endif 53#endif
54 54
55#ifndef ROCKBOX_VOICE_CODEC
55const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode}; 56const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, &speex_uwb_mode};
57#else
58const SpeexMode * const speex_mode_list[SPEEX_NB_MODES] = {&speex_nb_mode, &speex_wb_mode, NULL};
59#endif
56 60
57extern const signed char hexc_table[]; 61extern const signed char hexc_table[];
58extern const signed char hexc_10_32_table[]; 62extern const signed char hexc_10_32_table[];
@@ -279,6 +283,7 @@ const SpeexMode speex_wb_mode = {
279 283
280 284
281 285
286#ifndef ROCKBOX_VOICE_CODEC
282/* Split-band "ultra-wideband" (32 kbps) CELP mode*/ 287/* Split-band "ultra-wideband" (32 kbps) CELP mode*/
283static const SpeexSBMode sb_uwb_mode = { 288static const SpeexSBMode sb_uwb_mode = {
284 &speex_wb_mode, 289 &speex_wb_mode,
@@ -303,6 +308,7 @@ static const SpeexSBMode sb_uwb_mode = {
303#endif 308#endif
304 2 309 2
305}; 310};
311#endif
306 312
307int wb_mode_query(const void *mode, int request, void *ptr) 313int wb_mode_query(const void *mode, int request, void *ptr)
308{ 314{
@@ -329,6 +335,7 @@ int wb_mode_query(const void *mode, int request, void *ptr)
329} 335}
330 336
331 337
338#ifndef ROCKBOX_VOICE_CODEC
332const SpeexMode speex_uwb_mode = { 339const SpeexMode speex_uwb_mode = {
333 &sb_uwb_mode, 340 &sb_uwb_mode,
334 wb_mode_query, 341 wb_mode_query,
@@ -355,6 +362,7 @@ const SpeexMode speex_uwb_mode = {
355 &sb_decoder_ctl, 362 &sb_decoder_ctl,
356#endif 363#endif
357}; 364};
365#endif
358 366
359/* We have defined speex_lib_get_mode() as a macro in speex.h */ 367/* We have defined speex_lib_get_mode() as a macro in speex.h */
360#undef speex_lib_get_mode 368#undef speex_lib_get_mode
diff --git a/apps/codecs/libspeex/nb_celp.c b/apps/codecs/libspeex/nb_celp.c
index 49e2403d8b..9ddac46f37 100644
--- a/apps/codecs/libspeex/nb_celp.c
+++ b/apps/codecs/libspeex/nb_celp.c
@@ -1032,6 +1032,7 @@ const spx_word16_t attenuation[10] = {1., 0.961, 0.852, 0.698, 0.527, 0.368, 0.2
1032 1032
1033#endif 1033#endif
1034 1034
1035#ifndef ROCKBOX_VOICE_CODEC
1035static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack) 1036static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack)
1036{ 1037{
1037 int i; 1038 int i;
@@ -1093,6 +1094,7 @@ static void nb_decode_lost(DecState *st, spx_word16_t *out, char *stack)
1093 if (st->pitch_gain_buf_idx > 2) /* rollover */ 1094 if (st->pitch_gain_buf_idx > 2) /* rollover */
1094 st->pitch_gain_buf_idx = 0; 1095 st->pitch_gain_buf_idx = 0;
1095} 1096}
1097#endif
1096 1098
1097/* Just so we don't need to carry the complete wideband mode information */ 1099/* Just so we don't need to carry the complete wideband mode information */
1098static const int wb_skip_table[8] = {0, 36, 112, 192, 352, 0, 0, 0}; 1100static const int wb_skip_table[8] = {0, 36, 112, 192, 352, 0, 0, 0};
@@ -1130,11 +1132,13 @@ int nb_decode(void *state, SpeexBits *bits, void *vout)
1130 } else 1132 } else
1131 { 1133 {
1132 /* If bits is NULL, consider the packet to be lost (what could we do anyway) */ 1134 /* If bits is NULL, consider the packet to be lost (what could we do anyway) */
1135#ifndef ROCKBOX_VOICE_CODEC
1133 if (!bits) 1136 if (!bits)
1134 { 1137 {
1135 nb_decode_lost(st, out, stack); 1138 nb_decode_lost(st, out, stack);
1136 return 0; 1139 return 0;
1137 } 1140 }
1141#endif
1138 1142
1139 if (st->encode_submode) 1143 if (st->encode_submode)
1140 { 1144 {
diff --git a/apps/codecs/libspeex/sb_celp.c b/apps/codecs/libspeex/sb_celp.c
index b12ca71f4b..424d590b89 100644
--- a/apps/codecs/libspeex/sb_celp.c
+++ b/apps/codecs/libspeex/sb_celp.c
@@ -844,6 +844,7 @@ void sb_decoder_destroy(void *state)
844*/ 844*/
845} 845}
846 846
847#ifndef ROCKBOX_VOICE_CODEC
847static void sb_decode_lost(SBDecState *st, spx_word16_t *out, int dtx, char *stack) 848static void sb_decode_lost(SBDecState *st, spx_word16_t *out, int dtx, char *stack)
848{ 849{
849 int i; 850 int i;
@@ -881,6 +882,7 @@ static void sb_decode_lost(SBDecState *st, spx_word16_t *out, int dtx, char *sta
881 882
882 return; 883 return;
883} 884}
885#endif
884 886
885int sb_decode(void *state, SpeexBits *bits, void *vout) 887int sb_decode(void *state, SpeexBits *bits, void *vout)
886{ 888{
@@ -917,11 +919,13 @@ int sb_decode(void *state, SpeexBits *bits, void *vout)
917 return ret; 919 return ret;
918 } 920 }
919 921
922#ifndef ROCKBOX_VOICE_CODEC
920 if (!bits) 923 if (!bits)
921 { 924 {
922 sb_decode_lost(st, out, dtx, stack); 925 sb_decode_lost(st, out, dtx, stack);
923 return 0; 926 return 0;
924 } 927 }
928#endif
925 929
926 if (st->encode_submode) 930 if (st->encode_submode)
927 { 931 {
@@ -951,11 +955,13 @@ int sb_decode(void *state, SpeexBits *bits, void *vout)
951 /* If null mode (no transmission), just set a couple things to zero*/ 955 /* If null mode (no transmission), just set a couple things to zero*/
952 if (st->submodes[st->submodeID] == NULL) 956 if (st->submodes[st->submodeID] == NULL)
953 { 957 {
958#ifndef ROCKBOX_VOICE_CODEC
954 if (dtx) 959 if (dtx)
955 { 960 {
956 sb_decode_lost(st, out, 1, stack); 961 sb_decode_lost(st, out, 1, stack);
957 return 0; 962 return 0;
958 } 963 }
964#endif
959 965
960 for (i=0;i<st->frame_size;i++) 966 for (i=0;i<st->frame_size;i++)
961 out[st->frame_size+i]=VERY_SMALL; 967 out[st->frame_size+i]=VERY_SMALL;