Hi, Jean-Marc Valin wrote:> Not sure I understand your question. Change the order of what within what?In cb_search, we iterate nb_subvect times over a codebook, finding nb_subvect codebook entries to quantize the excitation signal. After finding these nb_subvect codebook entries, they're written into the stream: /*save indices*/ for (i=0;i<nb_subvect;i++) { ind[i]=nind[0][i]; speex_bits_pack(bits,ind[i],params->shape_bits+have_sign); } I want to know if I'm correct in that I can just do sth like this without any effect on the encoded signal: /*put optimal values into array*/ for (i=0;i<nb_subvect;i++) { ind[i]=nind[0][i]; } /*Change the order of the values in the array*/ // this is what I mean by "changing the order" int tmp=ind[0]; ind[0]=ind[nb_subvect]; ind[nb_subvect]=tmp; /*save indices*/ for (i=0;i<nb_subvect;i++) { speex_bits_pack(bits,ind[i],params->shape_bits+have_sign); } Regards, Bj?rn -- Questionable day. Ask somebody something. -- Important! Please recognize my new GPG Public Key! Bj?rn Thalheim gpg fingerprint: 2F22 AAEB 1818 1548 EC78 1AE8 9D2E FCB4 0980 28CC download key: wget http://www.ifsr.de/~bjoern/gpg/public_key.asc See also: http://www.ifsr.de/~bjoern/gpg/key.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20060918/e7d43245/signature.pgp
Well, you could change the order in the encoder as long as you reverse it in the decoder as well. Jean-Marc Bj?rn Thalheim a ?crit :> Hi, > > Jean-Marc Valin wrote: >> Not sure I understand your question. Change the order of what within what? > > In cb_search, we iterate nb_subvect times over a codebook, finding > nb_subvect codebook entries to quantize the excitation signal. After > finding these nb_subvect codebook entries, they're written into the stream: > > /*save indices*/ > for (i=0;i<nb_subvect;i++) > { > ind[i]=nind[0][i]; > speex_bits_pack(bits,ind[i],params->shape_bits+have_sign); > } > > I want to know if I'm correct in that I can just do sth like this > without any effect on the encoded signal: > > /*put optimal values into array*/ > for (i=0;i<nb_subvect;i++) > { > ind[i]=nind[0][i]; > } > /*Change the order of the values in the array*/ > // this is what I mean by "changing the order" > int tmp=ind[0]; ind[0]=ind[nb_subvect]; ind[nb_subvect]=tmp; > /*save indices*/ > for (i=0;i<nb_subvect;i++) > { > speex_bits_pack(bits,ind[i],params->shape_bits+have_sign); > } > > Regards, > > Bj?rn > > > > > ------------------------------------------------------------------------ > > _______________________________________________ > Speex-dev mailing list > Speex-dev@xiph.org > http://lists.xiph.org/mailman/listinfo/speex-dev
Hi, Jean-Marc Valin wrote:> Well, you could change the order in the encoder as long as you reverse > it in the decoder as well.Ok, I see that in the split_cb_shape_sign_unquant function, that each coefficient is tied to it's position in the nb_subvect exc coefficients. Honestly, I have problems understanding what exactly the codebook search works like. If you have the time to to that, Jean-Marc, I would appreciate some hints on the following: 1. What is the point in multiplying a codebook index with some number ant adding a loop variable to it as done in the exc unquant function. for (j=0;j<subvect_size;j++) exc[subvect_size*i+j]+=s*0.03125*shape_cb[ind[i]*subvect_size+j]; 2. How does the CB search function split_cb_search_shape_sign work? I know the parameter N defines the number of candidates for each of the nb_subvect CB line numbers which are later on written into the stream. But especially, how the best_ntarget list is being updated, I am a little clueless. Regards, Bj?rn PS: for me personally, I'd like to know how to change the cb id found while keeping the error introduced by this low. -- Many a writer seems to think he is never profound except when he can't understand his own meaning. -- George D. Prentice -- Important! Please recognize my new GPG Public Key! Bj?rn Thalheim gpg fingerprint: 2F22 AAEB 1818 1548 EC78 1AE8 9D2E FCB4 0980 28CC download key: wget http://www.ifsr.de/~bjoern/gpg/public_key.asc See also: http://www.ifsr.de/~bjoern/gpg/key.html -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 252 bytes Desc: OpenPGP digital signature Url : http://lists.xiph.org/pipermail/speex-dev/attachments/20060919/b7bf65d5/signature.pgp