Julien Chavanton
2016-Mar-15 12:18 UTC
[opus] Question on opus_decoder output sampling rate
Hi, another question on the same topic Speex resampler at 44.1kHz seems to be very CPU intensive on Android (even more than the Opus encoder) While Speex at 48kHz is just fine. I wonder any alternate solutions or ideas ? Improve it, look for alternate solution ... I am guessing the NEON optimization are still used for both, etc. On Thu, Apr 2, 2015 at 4:46 PM, Jean-Marc Valin <jmvalin at jmvalin.ca> wrote:> The encoder and decoder can handle, 8, 12, 16, 24 and 48 kHz > input/output. If doesn't matter what it gets encoded to/decoded from. > you can initialize a decoder at 8 kHz and it'll still decode 48 kHz > audio fine (you just won't get the high frequencies obviously). For > sampling rates other than 8/12/16/24/48, then you'll have to do > resampling. Have a look at the speexdsp resampler if you don't already > have one. > > Cheers, > > Jean-Marc > > On 02/04/15 10:42 AM, Julien Chavanton wrote: > > Hi, is there any way to tell the decoder the output sampling Fz we want ? > > > > opus_decoder_create = Sampling rate of input signal (Hz) > > > > Considering this example (VoIP-out from WebRTC/RTP) > > > > MICROPHONE(44.1/48kHz) >> [encoder created at 48kHz but with > > internalSampleRate set to 8kHz]>> INTERNET >> [decoder(created with > > 48kHz)] >> 48kHz(?) >> G.711(8kHz) > > > > This leaves us with the only option to re-sample even if the internal > > sample rate was set to 8kHz. > > > > This may not seem like a big problem since we could simply resample but > > on a server with a lot of load this could be significant ? > > > > https://tools.ietf.org/html/draft-ietf-payload-rtp-opus-08 > > Is not very clear on these points. > > > > Regards > > Julien > > > > > > _______________________________________________ > > opus mailing list > > opus at xiph.org > > http://lists.xiph.org/mailman/listinfo/opus > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20160315/6e52de16/attachment.htm
Hi Julien, Quote from : http://dspguru.com/dsp/faqs/multirate/resampling "The problem is that for resampling factors close to 1.0, the interpolation factor can be quite large. For example, in the case described above of changing from the sampling rate from 48 kHz to 44.1 kHz, the ratio is only 0.91875, yet the interpolation factor is 147!" My guess is that Opus would perform similar to Speex if you'd have to have it resample to 44.1 khz. Cheers,Dragos From: Julien Chavanton <jchavanton at gmail.com> To: Jean-Marc Valin <jmvalin at jmvalin.ca> Cc: opus at xiph.org Sent: Tuesday, March 15, 2016 1:18 PM Subject: Re: [opus] Question on opus_decoder output sampling rate Hi, another question on the same topic Speex resampler at 44.1kHz seems to be very CPU intensive on Android (even more than the Opus encoder) While Speex at 48kHz is just fine. I wonder any alternate solutions or ideas ? Improve it, look for alternate solution ... I am guessing the NEON optimization are still used for both, etc. On Thu, Apr 2, 2015 at 4:46 PM, Jean-Marc Valin <jmvalin at jmvalin.ca> wrote: The encoder and decoder can handle, 8, 12, 16, 24 and 48 kHz input/output. If doesn't matter what it gets encoded to/decoded from. you can initialize a decoder at 8 kHz and it'll still decode 48 kHz audio fine (you just won't get the high frequencies obviously). For sampling rates other than 8/12/16/24/48, then you'll have to do resampling. Have a look at the speexdsp resampler if you don't already have one. Cheers, ? ? ? ? Jean-Marc On 02/04/15 10:42 AM, Julien Chavanton wrote:> Hi, is there any way to tell the decoder the output sampling Fz we want ? > > opus_decoder_create = Sampling rate of input signal (Hz) > > Considering this example (VoIP-out from WebRTC/RTP) > > MICROPHONE(44.1/48kHz) >> [encoder created at 48kHz but with > internalSampleRate set to 8kHz]>> INTERNET >> [decoder(created with > 48kHz)] >> 48kHz(?) >> G.711(8kHz) > > This leaves us with the only option to re-sample even if the internal > sample rate was set to 8kHz. > > This may not seem like a big problem since we could simply resample but > on a server with a lot of load this could be significant ? > > https://tools.ietf.org/html/draft-ietf-payload-rtp-opus-08 > Is not very clear on these points. > > Regards > Julien > > > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >_______________________________________________ opus mailing list opus at xiph.org http://lists.xiph.org/mailman/listinfo/opus -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20160315/21a81898/attachment.htm
Julien Chavanton
2016-Mar-15 17:22 UTC
[opus] Question on opus_decoder output sampling rate
Hi Dragos, thank you for your information, I noticed that with 44.1k greatest common factor is very high, 300 with 48k. However do you think that we should expect that resampling would require more CPU then the Opus encoder for Silk for example ? OR can we expect some alternate solution/improvement/tuning. On Tue, Mar 15, 2016 at 4:54 PM, Dragos Oancea <droancea at yahoo.com> wrote:> Hi Julien, > > Quote from : > http://dspguru.com/dsp/faqs/multirate/resampling > > "The problem is that for resampling factors close to 1.0, the > interpolation factor can be quite large. For example, in the case described > above of changing from the sampling rate from 48 kHz to 44.1 kHz, the ratio > is only 0.91875, yet the interpolation factor is 147!" > > My guess is that Opus would perform similar to Speex if you'd have to have > it resample to 44.1 khz. > > Cheers, > Dragos > > ------------------------------ > *From:* Julien Chavanton <jchavanton at gmail.com> > *To:* Jean-Marc Valin <jmvalin at jmvalin.ca> > *Cc:* opus at xiph.org > *Sent:* Tuesday, March 15, 2016 1:18 PM > *Subject:* Re: [opus] Question on opus_decoder output sampling rate > > Hi, another question on the same topic > > Speex resampler at 44.1kHz seems to be very CPU intensive on Android (even > more than the Opus encoder) > > While Speex at 48kHz is just fine. > > I wonder any alternate solutions or ideas ? > Improve it, look for alternate solution ... > > I am guessing the NEON optimization are still used for both, etc. > > > On Thu, Apr 2, 2015 at 4:46 PM, Jean-Marc Valin <jmvalin at jmvalin.ca> > wrote: > > The encoder and decoder can handle, 8, 12, 16, 24 and 48 kHz > input/output. If doesn't matter what it gets encoded to/decoded from. > you can initialize a decoder at 8 kHz and it'll still decode 48 kHz > audio fine (you just won't get the high frequencies obviously). For > sampling rates other than 8/12/16/24/48, then you'll have to do > resampling. Have a look at the speexdsp resampler if you don't already > have one. > > Cheers, > > Jean-Marc > > On 02/04/15 10:42 AM, Julien Chavanton wrote: > > Hi, is there any way to tell the decoder the output sampling Fz we want ? > > > > opus_decoder_create = Sampling rate of input signal (Hz) > > > > Considering this example (VoIP-out from WebRTC/RTP) > > > > MICROPHONE(44.1/48kHz) >> [encoder created at 48kHz but with > > internalSampleRate set to 8kHz]>> INTERNET >> [decoder(created with > > 48kHz)] >> 48kHz(?) >> G.711(8kHz) > > > > This leaves us with the only option to re-sample even if the internal > > sample rate was set to 8kHz. > > > > This may not seem like a big problem since we could simply resample but > > on a server with a lot of load this could be significant ? > > > > https://tools.ietf.org/html/draft-ietf-payload-rtp-opus-08 > > Is not very clear on these points. > > > > Regards > > Julien > > > > > > _______________________________________________ > > opus mailing list > > opus at xiph.org > > http://lists.xiph.org/mailman/listinfo/opus > > > > > > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus > > >-------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20160315/b2110b33/attachment-0001.htm
Jean-Marc Valin
2016-Mar-15 17:41 UTC
[opus] Question on opus_decoder output sampling rate
On 03/15/2016 11:54 AM, Dragos Oancea wrote:> "The problem is that for resampling factors close to 1.0, the > interpolation factor can be quite large. For example, in the case > described above of changing from the sampling rate from 48 kHz to 44.1 > kHz, the ratio is only 0.91875, yet the interpolation factor is 147!"The quote above assumes a totally stupid resampler, which does not represent the Speex resampler. Note that there's a quality parameter in the Speex resampler that allows you to trade quality for complexity. Jean-Marc> My guess is that Opus would perform similar to Speex if you'd have to > have it resample to 44.1 khz. > > Cheers, > Dragos > > ------------------------------------------------------------------------ > *From:* Julien Chavanton <jchavanton at gmail.com> > *To:* Jean-Marc Valin <jmvalin at jmvalin.ca> > *Cc:* opus at xiph.org > *Sent:* Tuesday, March 15, 2016 1:18 PM > *Subject:* Re: [opus] Question on opus_decoder output sampling rate > > Hi, another question on the same topic > > Speex resampler at 44.1kHz seems to be very CPU intensive on Android > (even more than the Opus encoder) > > While Speex at 48kHz is just fine. > > I wonder any alternate solutions or ideas ? > Improve it, look for alternate solution ... > > I am guessing the NEON optimization are still used for both, etc. > > > On Thu, Apr 2, 2015 at 4:46 PM, Jean-Marc Valin <jmvalin at jmvalin.ca > <mailto:jmvalin at jmvalin.ca>> wrote: > > The encoder and decoder can handle, 8, 12, 16, 24 and 48 kHz > input/output. If doesn't matter what it gets encoded to/decoded from. > you can initialize a decoder at 8 kHz and it'll still decode 48 kHz > audio fine (you just won't get the high frequencies obviously). For > sampling rates other than 8/12/16/24/48, then you'll have to do > resampling. Have a look at the speexdsp resampler if you don't already > have one. > > Cheers, > > Jean-Marc > > On 02/04/15 10:42 AM, Julien Chavanton wrote: > > Hi, is there any way to tell the decoder the output sampling Fz we > want ? > > > > opus_decoder_create = Sampling rate of input signal (Hz) > > > > Considering this example (VoIP-out from WebRTC/RTP) > > > > MICROPHONE(44.1/48kHz) >> [encoder created at 48kHz but with > > internalSampleRate set to 8kHz]>> INTERNET >> [decoder(created with > > 48kHz)] >> 48kHz(?) >> G.711(8kHz) > > > > This leaves us with the only option to re-sample even if the internal > > sample rate was set to 8kHz. > > > > This may not seem like a big problem since we could simply > resample but > > on a server with a lot of load this could be significant ? > > > > https://tools.ietf.org/html/draft-ietf-payload-rtp-opus-08 > > Is not very clear on these points. > > > > Regards > > Julien > > > > > > _______________________________________________ > > opus mailing list > > opus at xiph.org <mailto:opus at xiph.org> > > http://lists.xiph.org/mailman/listinfo/opus > > > > > > _______________________________________________ > opus mailing list > opus at xiph.org <mailto:opus at xiph.org> > http://lists.xiph.org/mailman/listinfo/opus > >