Skip to main content

Topic: Has anyone tried the Opus decoder library with floats and 8 channels? (Read 2195 times) previous topic - next topic

0 Members and 1 Guest are viewing this topic.
  • lithopsian
  • [*][*][*][*]
Has anyone tried the Opus decoder library with floats and 8 channels?
I noticed that my CPU usage goes through the roof (ie. maxes out, around 10x what a 7 channel track takes) when decoding 8 channel Opus tracks, but only when it is outputting samples as floats.  The integer call runs at expected levels.  It appears to be due to the library itself rather than something dumb in my own code.  I can't really tell if it happens in libopusfile or libopus.
  • Last Edit: 14 March, 2014, 11:07:34 AM by lithopsian

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Has anyone tried the Opus decoder library with floats and 8 channels?
Reply #1
Sounds like a problem with denormals.

  • jmvalin
  • [*][*][*][*][*]
  • Developer
Has anyone tried the Opus decoder library with floats and 8 channels?
Reply #2
Sounds like a problem with denormals.


Denormals would not only cause problems with the float output because it's the same codepath until the very end. It would have to be problems in the application code, not in libopus.

  • lithopsian
  • [*][*][*][*]
Has anyone tried the Opus decoder library with floats and 8 channels?
Reply #3
Sounds like a problem with denormals.


Denormals would not only cause problems with the float output because it's the same codepath until the very end. It would have to be problems in the application code, not in libopus.

Seems unlikely to be in the application code.  Just slapping this in an infinite loop causes the issue:
Code: [Select]
ret=opus_read_float(info->opus_file, values, values_to_read, &cur_link);


Obviously there is also a read callback but that is simply an fread call that knows nothing about whether the decoder will be dealing with floats or how many channels there might be.

I'd like to try with more files, but 7.1 Opus files are pretty thin on the ground.

  • saratoga
  • [*][*][*][*][*]
Has anyone tried the Opus decoder library with floats and 8 channels?
Reply #4
Profile it?

  • lvqcl
  • [*][*][*][*][*]
  • Developer
Has anyone tried the Opus decoder library with floats and 8 channels?
Reply #5
What is opus_read_float? I cannot find this function anywhere.

  • lithopsian
  • [*][*][*][*]
Has anyone tried the Opus decoder library with floats and 8 channels?
Reply #6
Sorry, its op_read_float.  op_read (returns int) doesn't have the same issues.
http://www.opus-codec.org/docs/opusfile_api-0.5.pdf

  • lithopsian
  • [*][*][*][*]
Has anyone tried the Opus decoder library with floats and 8 channels?
Reply #7
I had some time to dig into this today.  jmvalin is right, it is an application issue and not a library issue.  The loop timer collapses to zero when the total bitrate goes past 32 * 8 (* 48000).  On a longer track I think it would settle down once the internal buffer was full, but on short test tracks it just thrashes the decoder as hard as it can go.