Alexander Chemeris
2008-Jan-25 13:01 UTC
[Speex-dev] How to get size of WB frame in bits/bytes?
Hi, Is there any way to determine frame size in bits or bytes of encoded frame in WB mode for given quality? That is I need to know how many bits encoded frame will occupy in RTP packet. I see SPEEX_SUBMODE_BITS_PER_FRAME request, but it works like this only for NB mode, and for WB mode it return size of WB "subframe" (?) only. -- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000
Jean-Marc Valin
2008-Jan-25 13:11 UTC
[Speex-dev] How to get size of WB frame in bits/bytes?
Alexander Chemeris a ?crit :> Hi, > > Is there any way to determine frame size in bits or bytes of > encoded frame in WB mode for given quality? That is I need > to know how many bits encoded frame will occupy in RTP > packet. I see SPEEX_SUBMODE_BITS_PER_FRAME request, > but it works like this only for NB mode, and for WB mode > it return size of WB "subframe" (?) only.SPEEX_SUBMODE_BITS_PER_FRAME should definitely work for both narrowband and wideband. How are you using it and what value does it return? Jean-Marc
Alexander Chemeris
2008-Jan-25 13:45 UTC
[Speex-dev] How to get size of WB frame in bits/bytes?
On 1/26/08, Jean-Marc Valin <jean-marc.valin@usherbrooke.ca> wrote:> Alexander Chemeris a ?crit : > > Is there any way to determine frame size in bits or bytes of > > encoded frame in WB mode for given quality? That is I need > > to know how many bits encoded frame will occupy in RTP > > packet. I see SPEEX_SUBMODE_BITS_PER_FRAME request, > > but it works like this only for NB mode, and for WB mode > > it return size of WB "subframe" (?) only. > > SPEEX_SUBMODE_BITS_PER_FRAME should definitely work for both > narrowband and wideband. How are you using it and what value does > it return?Well, it works in the way it is supposed to work (I guess), but not in a way I want it to work. In case of WB it maps passed value to one of SpeexSBMode::submodes elements, which are SpeexSubmode. And then it just return value of corresponding SpeexSubmode::bits_per_frame. As far as I understand how Speex is working it is only number of bits in WB part of frame, and I have to retrive number of bits in NB part of frame and then summ them up. But mapping of quality values to NB/WB submode pairs are hidden inside libspeex and is not accessible from API. Am I correct? -- Regards, Alexander Chemeris. SIPez LLC. SIP VoIP, IM and Presence Consulting http://www.SIPez.com tel: +1 (617) 273-4000