Alpha Thinktink
2014-Jun-04 23:41 UTC
[opus] opus_multistream_encode_float not working in libopus 1.1
On Wed, Jun 4, 2014 at 4:31 PM, Timothy B. Terriberry <tterribe at xiph.org> wrote:> Alpha Thinktink wrote: >> max_data_bytes=-11 > > That value is passed in by you. I also don't think passing such a value > would have worked in earlier releases. It indicates the size of the > buffer you are passing to the encoder to receive the encoded output.Actually, I'm passing a massive buffer size. The debugger shows I'm passing 10200 bytes, which lines up with my source code: while(RemoveFloatSamples(ack,packetsamplescount)) { char *tout=new char[1275*2*Fnch]; int len=encode_float(e_state,ack,packetframescount,tout,1275*2*Fnch); if(len>0) { AddOpusPacket(tout,len,packetframescount*rscale); } else { delete [] tout; delete [] ack; Ferror=-1; return 0; } }
Mark Harris
2014-Jun-05 00:08 UTC
[opus] opus_multistream_encode_float not working in libopus 1.1
On Wed, Jun 4, 2014 at 4:41 PM, Alpha Thinktink <alphathinktink at gmail.com> wrote:> > >> max_data_bytes=-11 >This can happen with multistream cbr if the bitrate is set too low, to a value that would allow less than 4 bytes per stream, per packet. What bitrate are you using? Perhaps you set it to a value in kb/s instead of b/s. -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.xiph.org/pipermail/opus/attachments/20140604/d334eff6/attachment.htm
Alpha Thinktink
2014-Jun-05 01:32 UTC
[opus] opus_multistream_encode_float not working in libopus 1.1
On Wed, Jun 4, 2014 at 5:08 PM, Mark Harris <mark.hsj at gmail.com> wrote:> On Wed, Jun 4, 2014 at 4:41 PM, Alpha Thinktink <alphathinktink at gmail.com> > wrote: >> >> >> max_data_bytes=-11 > > > This can happen with multistream cbr if the bitrate is set too low, to a > value that would allow less than 4 bytes per stream, per packet. What > bitrate are you using? Perhaps you set it to a value in kb/s instead of > b/s.I just verified I'm not sending in kb/s. The user sets the value as either Auto (-1000), Max (-1), or Specify --> between 512000-500 The value is passed, as-is, to the encoder ctl function. However, it looks like it's getting closer: Quadraphonic signal: 4800b/s=go 4799b/s=no-go, so anything below 4800 doesn't work. Stereo signal (as 2chan uncoupled): 1600b/s=go 1599b/s=no-go, here nothing below 1600 works. However, before testing different bitrates I've had it set on Auto, which is no-go on v1.1 Testing Max also is no-go v1.1 However, v1.1-beta and earlier works. Please remember that everything still works with v1.1-beta and previous. I just tested it to make sure as well. v1.1 release is the only version I see problems with hard cbr multistream.
Alpha Thinktink
2014-Jun-05 04:41 UTC
[opus] opus_multistream_encode_float not working in libopus 1.1
In debugging I saw: opus_multistream_encoder.c line 760 if(!vbr) max_data_bytes = IMIN(max_data_bytes, 3*st->bitrate_bps/(3*8*Fs/frame_size)); max_data_bytes after this code becomes -2 where as before it was 10200. I suspect it was because st->bitrate_bps was set to -1000 to indicate Auto bitrate. I imagine Max bitrate (-1) has a slightly similar effect. then in the same c file line 846 curr_max = max_data_bytes - tot_size; curr_max becomes -2 as tot_size was 0. then line 848 curr_max -= IMAX(0,4*(st->layout.nb_streams-s-1)-1); cur_max becomes -13 as nb_streams was 4 and s was 0. then line 849 curr_max = IMIN(curr_max,MS_FRAME_TMP); which left curr_max at -13 The result at line 853 is opus_encode_native is called with parameters so thusly: (encoder state pointer, buf pointer, frame_size=960, tmp_data pointer, curr_max=-13, lsb_depth=24, pcm pointer, analysis_frame_size=960, c1=0, c2=-1, st->layout.nb_channels=4, downmix pointer, float_api=1); I don't know what to suggest as I've never tinkered with the opus library internals, nor have I ever compiled it before today and do not know what it looked like in previous versions. Sorry.
Jean-Marc Valin
2014-Jun-21 05:32 UTC
[opus] opus_multistream_encode_float not working in libopus 1.1
Hi, I just checked in a fix for the bug you reported. Let me know if it works. Cheers, Jean-Marc On 05/06/14 12:41 AM, Alpha Thinktink wrote:> In debugging I saw: > opus_multistream_encoder.c > line 760 > if(!vbr) > max_data_bytes = IMIN(max_data_bytes, > 3*st->bitrate_bps/(3*8*Fs/frame_size)); > > max_data_bytes after this code becomes -2 where as before it was > 10200. I suspect it was because st->bitrate_bps was set to -1000 to > indicate Auto bitrate. I imagine Max bitrate (-1) has a slightly > similar effect. > > then in the same c file > line 846 > curr_max = max_data_bytes - tot_size; > > curr_max becomes -2 as tot_size was 0. > > then line 848 > > curr_max -= IMAX(0,4*(st->layout.nb_streams-s-1)-1); > > cur_max becomes -13 as nb_streams was 4 and s was 0. > > then line 849 > > curr_max = IMIN(curr_max,MS_FRAME_TMP); > > which left curr_max at -13 > > The result at line 853 is opus_encode_native is called with parameters > so thusly: > (encoder state pointer, buf pointer, frame_size=960, tmp_data pointer, > curr_max=-13, lsb_depth=24, pcm pointer, analysis_frame_size=960, > c1=0, c2=-1, st->layout.nb_channels=4, downmix pointer, float_api=1); > > > I don't know what to suggest as I've never tinkered with the opus > library internals, nor have I ever compiled it before today and do not > know what it looked like in previous versions. Sorry. > _______________________________________________ > opus mailing list > opus at xiph.org > http://lists.xiph.org/mailman/listinfo/opus >
Seemingly Similar Threads
- opus_multistream_encode_float not working in libopus 1.1
- opus_multistream_encode_float not working in libopus 1.1
- [PATCH] Fix ambisonics bitrate when bitrate_bps is OPUS_AUTO
- [PATCH] Apply equal bit allocation to ambisonic channels
- patch to fix error in src/opus_multistream_encoder.c when DISABLE_FLOAT_API is defined