<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=iso-8859-1">
<META content="MSHTML 6.00.6000.16481" name=GENERATOR></HEAD>
<BODY style="MARGIN: 4px 4px 1px; FONT: 10pt Tahoma">
<DIV>for the bits init I am using speex_bits_set_bit_buffer and I don't use the write to or read from because the data is already in the buffer I am reading from and I am writing to the final buffer so I don't need to move arrays around. </DIV>
<DIV> </DIV>
<DIV>what part is the vocoder part of the decode?</DIV>
<DIV>Thanks for your help!</DIV>
<DIV> </DIV>
<DIV>-Mike<BR><BR>>>> Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> 08/06/07 7:00 PM >>><BR></DIV>
<DIV style="COLOR: #000000">> I am aware that some of these functions are only not called because I<BR>> don't do a GET_ in the ctl functions or don't use ALLOC to initialize<BR>> the bit buffer, but some of these I am not entirely sure why they would<BR>> or would not be used. I would like to know if they are just rarely<BR>> called functions and that I could be breaking the codec by removing them<BR>> or if all that I removed is just fine.<BR><BR>Assuming you're not changing your code, there are very few functions<BR>that would be "rarely called" (either it is every time, or it's not).<BR>The only exception might be the packet loss concealment function<BR>(nb_decode_lost).<BR><BR>> these are the functions that I removed:<BR>> <BR>> In bits.c:<BR>> speex_bits_init<BR>> speex_bits_init_buffer<BR>> speex_bits_destroy<BR>> speex_bits_reset<BR>> speex_bits_rewind<BR>> speex_bits_read_from<BR>> speex_bits_flush<BR>> speex_bits_read_whole_bytes<BR>> speex_bits_write<BR>> speex_bits_write_whole_bytes<BR>> speex_bits_unpack_signed<BR>> speex_bits_peek_unsigned<BR>> speex_bits_peek<BR>> speex_bits_nbytes<BR>> speex_bits_insert_terminator<BR><BR>You probably don't need most of these, but I'm surprised you're not at<BR>least using speex_bits_init(), speex_bits_read_from() and<BR>speex_bits_write(). What are you using instead?<BR><BR>> In cd_search.c:<BR>> noise_codebook_quant<BR>> noise_codebook_unquant<BR><BR>No need for that (assuming you only want 8 kbps).<BR><BR>> In filters.c:<BR>> compute_rms<BR>> syn_percep_zero16<BR>> qmf_decomp<BR>> qmf_synth<BR><BR>No need for that.<BR><BR>> In ltp.c:<BR>> forced_pitch_quant<BR>> forced_pitch_unquant<BR><BR>No need for that.<BR><BR>> In math_approx.c:<BR>> spx_ilog2<BR>> _spx_cos_pi_2<BR>> spx_cos_norm<BR>> spx_exp2<BR>> spx_atan<BR><BR>No need for that.<BR><BR>> In nb_celp.c:<BR>> nb_encoder_destroy<BR>> nb_decoder_destroy<BR><BR>No need for that if you never plan on freeing the memory<BR><BR>> In quant_lsp.c:<BR>> lsp_quant_nb<BR>> lsp_unquant_nb<BR>> lsp_quant_high<BR>> lsp_unquant_high<BR><BR>No need for that if you just want 8 kbps.<BR><BR>> In speex.c:<BR>> speex_encoder_destroy<BR>> speex_decoder_destroy<BR>> speex_encode<BR>> speex_decode<BR>> nb_mode_query<BR>> wb_mode_query<BR>> speex_lib_ctl<BR><BR>No need for that if you're not using them in your code.<BR><BR>> In speex_callbacks.c:<BR>> speex_inband_handler<BR>> speex_std_mode_request_handler<BR>> speex_std_low_mode_request_handler<BR>> speex_std_high_mode_request_handler<BR>> speex_std_vbr_request_handler<BR>> speex_std_enh_request_handler<BR>> speex_std_vbr_quality_request_handler<BR>> speex_std_char_handler<BR>> speex_default_user_handler<BR><BR>No need for that.<BR><BR>> In vbr.c:<BR>> vbr_analysis<BR>> vbr_destroy<BR><BR>No need for that.<BR><BR>> In vq.c:<BR>> vq_index<BR>> vq_nbest_sign<BR><BR>No need for those.<BR><BR><BR>So yes, there's a lot of stuff you can remove. You can also get rid of<BR>the stereo preprocess, mdf files. You can also remove the VBR part of<BR>the narrowband encoder and the vocoder part of the decoder. As I was<BR>saying, there are very few codepaths that are only taken sometimes. So<BR>unless a bit of code was executed in your test, it's very likely you<BR>don't need it (packet loss concealment being the exception, because it's<BR>only needed when you lose packets).<BR><BR> Jean-Marc<BR></DIV></BODY></HTML>