Gen compressed audio, Opus

SGDK only sub forum

Moderator: Stef

Post Reply
cero
Very interested
Posts: 340
Joined: Mon Nov 30, 2015 1:55 pm

Gen compressed audio, Opus

Post by cero »

I checked Vorbis' RAM usage, and while Tremor has a low-RAM branch, it's still too much for an unaided Genesis. Though I see someone used it with a 32x.

Opus being the latest craze, I have an interesting quote:
The amount of RAM that Opus requires depends on several factors:
1) Whether you're encoding and/or decoding
2) The number of channels
3) Whether you built as fixed-point or float (I assume fixed-point)
4) If you're encoding, it further depends on the mode you're using

In all cases, the RAM requirements are split between the "state" that
needs to be preserved across calls to the encoder or decoder, and the
stack that it only needed during a call.

For example, a fixed-point stereo decoder state takes about 25 kB to
hold, and IIRC the actual decoding takes about 8 kB of stack. Expect the
encoder to take more RAM though.
http://lists.xiph.org/pipermail/opus/20 ... 02823.html

Thus, a fixed-point mono decoder, targeting 8-bit 16kHz, would be possible on a plain Genesis, bringing great quality with it. Now the only question is how fast it'd be. I'll try it out and see what happens.
Mask of Destiny
Very interested
Posts: 628
Joined: Thu Nov 30, 2006 6:30 am

Re: Gen compressed audio, Opus

Post by Mask of Destiny »

I'm almost positive it's going to be vastly slower than realtime. Opus is more CPU intensive than Vorbis and even Vorbis is probably unrealistic on anything slower than a 68040.
cero
Very interested
Posts: 340
Joined: Mon Nov 30, 2015 1:55 pm

Re: Gen compressed audio, Opus

Post by cero »

On my desktop, Vorbis is 480x realtime while Opus is 240x realtime decoding. Both using C code at -O2. It's possible it'd be too slow, but nobody else has measured it yet ;)
cero
Very interested
Posts: 340
Joined: Mon Nov 30, 2015 1:55 pm

Re: Gen compressed audio, Opus

Post by cero »

First results are in: Opus runs successfully on the Genesis, and needs even less RAM than expected.

Downside: the current build, completely unoptimized C and -O2, took 57.5 seconds to decode 400ms of audio, making it 0.0069x realtime. :D

I might try O3 later, sadly without PGO since that doesn't work on embedded and autoFDO isn't there in 4.8.
Stef
Very interested
Posts: 3131
Joined: Thu Nov 30, 2006 9:46 pm
Location: France - Sevres
Contact:

Re: Gen compressed audio, Opus

Post by Stef »

57 second to half of second of sound ? outch ! that will really require insane optimization :p
cero
Very interested
Posts: 340
Joined: Mon Nov 30, 2015 1:55 pm

Re: Gen compressed audio, Opus

Post by cero »

-O3: 27s, 0.015x realtime. Dropping it here, may Google preserve this to all eternity.
Post Reply