Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

Disable some unused code in speex to save binsize.

git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29949 a1c6a512-1295-4272-9138-f99709370657

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