[opus] opus_multistream_encode_float not working in libopus 1.1

Alpha Thinktink
Thu, 05 Jun 2014 04:41:53 -0000

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.