<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>I'm glad to hear that my data size can be shrunk considerably, however I do not know the minimum values that I would set the static arrays to be. I hate to be a bother but could you tell me the minimum values for these arrays/structures in the state structure? Thanks!</DIV>
<DIV> </DIV>
<DIV><STRONG>encode:</STRONG></DIV>
<DIV>stack</DIV>
<DIV>winBuf</DIV>
<DIV>excBuf</DIV>
<DIV>swBuf</DIV>
<DIV>lagWindow</DIV>
<DIV>old_lsp</DIV>
<DIV>old_qlsp</DIV>
<DIV>mem_sp</DIV>
<DIV>mem_sw</DIV>
<DIV>mem_sw_whole</DIV>
<DIV>mem_exc</DIV>
<DIV>mem_exc2</DIV>
<DIV>pi_gain</DIV>
<DIV>pitch</DIV>
<DIV> </DIV>
<DIV><STRONG>decode:</STRONG></DIV>
<DIV>stack</DIV>
<DIV>excBuf</DIV>
<DIV>interp_qlpc</DIV>
<DIV>old_qlsp</DIV>
<DIV>mem_sp</DIV>
<DIV>pi_gain<BR><BR>>>> Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> 08/06/07 7:04 PM >>><BR></DIV>
<DIV style="COLOR: #000000">Last thing. All the codebooks are stored as tables of char, so you're<BR>probably wasting a lot of space from the fact that chars on C5x are<BR>16-bit long. You might be able to pack the values in one 16-bit value<BR>and unpack in the code. As for the memory allocation in the encoder, the<BR>best is to use C99 variable-size arrays (VAR_ARRAYS) or alloca<BR>(USE_ALLOCA). Otherwise, you can make the static array much smaller. For<BR>8 kbps, the total RAM requirement (not counting code or static tables)<BR>should be around 4 kB (2 kWords).<BR><BR> Jean-Marc<BR><BR>Michael Jacobson a écrit :<BR>> Hi,<BR>> <BR>> I am using speex 1.2beta2 on a narrowband 16-bit, 8khz system that has<BR>> a severe program space problem and will not fit speex in its normal<BR>> operation. In an attempt to shrink speex I placed a breakpoint in every<BR>> function and ran a decode and encode and removed the breakpoints that I<BR>> hit. in the functions that had a breakpoint that I didn't hit I<BR>> commented out those functions (as well as some functions that I know I<BR>> won't hit). <BR>> <BR>> 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>> I did get a .patch file from Jim Crichton as well to shrink nb_celp,<BR>> but is there anything else I can do to shrink the code or am I reaching<BR>> my limit? Thanks.<BR>> <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>> In cd_search.c:<BR>> noise_codebook_quant<BR>> noise_codebook_unquant<BR>> <BR>> In filters.c:<BR>> compute_rms<BR>> syn_percep_zero16<BR>> qmf_decomp<BR>> qmf_synth<BR>> <BR>> In ltp.c:<BR>> forced_pitch_quant<BR>> forced_pitch_unquant<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>> In nb_celp.c:<BR>> nb_encoder_destroy<BR>> nb_decoder_destroy<BR>> <BR>> In quant_lsp.c:<BR>> lsp_quant_nb<BR>> lsp_unquant_nb<BR>> lsp_quant_high<BR>> lsp_unquant_high<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>> 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>> In vbr.c:<BR>> vbr_analysis<BR>> vbr_destroy<BR>> <BR>> In vq.c:<BR>> vq_index<BR>> vq_nbest_sign<BR>> <BR>> <BR>> <BR>> <BR>> <BR>> ------------------------------------------------------------------------<BR>> <BR>> _______________________________________________<BR>> Speex-dev mailing list<BR>> Speex-dev@xiph.org<BR>> <A href="http://lists.xiph.org/mailman/listinfo/speex-dev">http://lists.xiph.org/mailman/listinfo/speex-dev</A><BR></DIV></BODY></HTML>