[opus] Antw: Re: Antw: Re: Possible bug in Opus 1.3

Ulrich Windl Ulrich.Windl at rz.uni-regensburg.de
Mon Nov 5 10:16:54 UTC 2018


>>> Jan Stary <hans at stare.cz> schrieb am 05.11.2018 um 11:05 in Nachricht
<20181105100534.GB44329 at www.stare.cz>:
> (Are we off‑list now by intention?)

No, just fooled by the list defaults (some need just reply, others need reply
to all)

> 
>> Did you also try to listen at the beginning, shortly before the real tone 
> appears in the audible spectrum? While significantly larger, Opus had 
> produced significant ghost noise (much less than Vorbis did)...
> 
> Yes. But given that these are not audible sounds,
> the various codecs might use various strategies of throwing them away.

No, the thing was (listening with headphones) that I hear artefacts when
noting was expected to be heared, or at least something completely different
was expected to be heared (the artefects were in the audible spectrum while the
original was still below 20 Hz or so).

> I have no solid knowledge of what e.g. Ogg vs Opus does, but I would
> just throw away any frequency below, say, 15 Hz. Maybe they do/don't,
> and this might be the result.

Maybe. If handling them correctly with the psychoacoustic model, these should
not survive anyway, I guess.
In practice if you make recordings with wind, you also have such low-frequency
noise, so it's not a purely artificial thing...

> 
>> > 
>> >> On 48kHz on Opus: I'm unsure. I thought Opus can't handle 96kHz
>> >> and it downsamples automatically.
>> > 
>> > Apparently it did (and also reduced the 24bit to 16bit).
>> > 
>> >> Why using 96kHz in the original: AFAIK Vorbis and Opus both use
>> >> frequency components to encode the file.
>> > 
>> > What frequency components are those,
>> > in a sweep from 0 to 20kHz?
>> 
>> The frequency component at any time should be more or less exactly one
>> (THE frequency).
> 
> Exactly. So what frequencies above 48kHz are there
> to be sampled at 96kHz?

None. Do we want to discuss the Nyquist theorem? (AFAIR it's for pure sinus
waves and is says "at least").

> 
>> >> With higher sampling frequencies in the original,
>> >> I was expecting to reduce the aliasing effects for higher frequencies.
>> > 
>> > What higher frequencies?
>> 
>> If you plot a 44.1kHz sine wave
> 
> But you stop at 20kHz.

OK, Nyquist again. Maybe really look how the waveform looks like. Or are you
saying Opus really ignores any extra samples at that frequencies?

> 
>> at 16kHz or higher,
> 
> The sample bit width has nothing to do with it.

? 16kHz is a frequency, not a bit resolution.

> 
>> it does not look much like a sine wave any more.
>> So my expectation was that applying DCT on that could add
>> some "ghost frequencies" that did not exist in the original.
> 
> It would be quite sad if the processing used during compression
> added frequencies ABOVE the orginal, forcing the user to upsample.

Yes, but I'm afraid that's how it works.

Regards,
Ulrich

> 
> 	Regards,
> 
> 		Jan
> 
>> >> On Oct 26 01:38:34, Ulrich.Windl at rz.uni‑regensburg.de wrote:
>> >> > Playing with Opus 1.3 I converted a tone sweep with a sample rate of
96kHz 
> 
>> > (just for fun). Before I had converted that from WAV to FLAC, and to
Vorbis 
> 
>> > without problems.
>> >> 
>> >> 30s=312Hz, 35s=625Hz, 40s=1.25kHz, 45s=2.5kHz, 50s=5kHz, 55s=10kHz, 
>> > 60s=20kHz
>> >> so it seems the frequency rises logarithmically.)
>> >> 
>> >> $ sox ‑c 1 ‑r 96k ‑b 16 ‑n /tmp/sweep.wav synth 60 sin create 1‑20 gain
‑3
>> >> 
>> >> > With Opus I noticed that the file size for 48kHz and 48 kbps
>> >> > compared to 96kHz Vorbis at 31kbps is about double the size
>> >> 
>> >> Your opusenc line says "‑‑bitrate 56 ‑‑vbr",
>> >> so where does the 48 come from?
>> >> 
>> >> Anyway:
>> >> 
>> >> $ flac sweep.wav
>> >> $ oggenc sweep.wav
>> >> $ opusenc sweep.wav sweep.opus
>> >> $ ls ‑l sweep.*
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel   2635692 Nov  1 08:49 sweep.flac
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel    215185 Nov  1 08:49 sweep.ogg 
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel    660815 Nov  1 08:49 sweep.opus
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel  11520044 Nov  1 08:49 sweep.wav
>> >> 
>> >> So for me it is actualy about three times the size of an ogg
>> >> (and about 6% the size of the original wav).
>> >> 
>> >> I am not sure why you are using 96kHz in the original,
>> >> but doing the same with a 48kHz original wav results in
>> >> 
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel  1468106 Nov  1 08:51 sweep.flac
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel   113787 Nov  1 08:51 sweep.ogg
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel   611386 Nov  1 08:51 sweep.opus
>> >> ‑rw‑r‑‑r‑‑  1 hans  wheel  5760044 Nov  1 08:51 sweep.wav
>> >> 
>> >> All of them approximately halve, but opus does not.
>> >> Is that expected?
>> >> 
>> >> > and it sounds even worse (than Vorbis)
>> >> > (there is a lot of noise in the lower frequencies
>> >> > when a low frequency tone is being played).
>> >> 
>> >> Are you sure your speakers/headphones can even reproduce
>> >> such low frequencies accurately? I doubt it.
>> >> 
>> >> > Here is what opusinfo outputs:
>> >> > 
>> >> > Processing file
"D:\Work\Ulrich\Musik\Vega\Opus\Audacity\Test‑Sweeps\02 
>> > Sweep (0
>> >> > ‑20kHz at 96kHz) log.opus"...
>> >> > 
>> >> > New logical stream (#1, serial: 000028fd): type opus
>> >> > Encoded with libopus 1.3, libopusenc 0.2.1
>> >> > User comments section follows...
>> >> >         ENCODER=opusenc from opus‑tools 0.2‑3‑gf5f571b
>> >> >         ENCODER_OPTIONS=‑‑bitrate 56 ‑‑vbr ‑‑comp 5
>> >> >         ALBUM=Test‑Sweeps
>> >> >         ARTIST=Audacity
>> >> >         COMMENT=60s logarithmic sweep (0‑20kHz): 5s=10Hz, 10s=20Hz, 
>> > 15s=39Hz, 20
>> >> > s=78Hz, 25s=156Hz, 30s=312Hz, 35s=625Hz, 40s=1.25kHz, 45s=2.5kHz, 
> 50s=5kHz, 
>> > 55s=
>> >> > 10kHz, 60s=20kHz
>> >> >         COMMENTS=60s logarithmisch
>> >> >         DATE=2016
>> >> >         TITLE=Sweep (0‑20kHz at 96kHz) log
>> >> >         TRACKNUMBER=2
>> >> > Opus stream 1:
>> >> >         Pre‑skip: 312
>> >> >         Playback gain: 0 dB
>> >> >         Channels: 1
>> >> >         Original sample rate: 96000 Hz
>> >> >         Packet duration:   20.0ms (max),   20.0ms (avg),   20.0ms
(min)
>> >> >         Page duration:   1000.0ms (max),  983.9ms (avg),   20.0ms
(min)
>> >> >         Total data length: 637535 bytes (overhead: 1.07%)
>> >> >         Playback length: 1m:00.000s
>> >> >         Average bitrate: 85 kbit/s, w/o overhead: 84.09 kbit/s
>> >> > Logical stream 1 ended
>> >> > 
>> >> > 
>> >> > Here is the encoding output for a manual test:
>> >> 
>> >> Wait, so there are two opus files at play here?
>> >> How exactly did you create each? Is this the 48kHz one?
>> >> Post the files you are describing.
>> >> 
>> >>     Jan
>> >> 
>> >> 
>> >> > C:\Program Files
(x86)\foobar2000\codecs\opus‑tools‑0.2‑opus‑1.3>opusenc.exe 
>> > ‑‑b
>> >> > itrate 56 ‑‑vbr
"D:\Work\Ulrich\Musik\Vega\FLAC\Audacity\Test‑Sweeps\02 
>> > Sweep (0
>> >> > ‑20kHz at 96kHz) log.flac" "D:\Work\Ulrich\Musik\test.opus"
>> >> > Encoding using libopus 1.3 (audio)
>> >> > ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
>> >> >    Input: 96 kHz, 1 channel
>> >> >   Output: 1 channel (1 uncoupled)
>> >> >           20ms packets, 56 kbit/s VBR
>> >> >  Preskip: 312
>> >> > 
>> >> > Encoding complete
>> >> > ‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑‑
>> >> >        Encoded: 1 minute and 0.02 seconds
>> >> >        Runtime: 1 second
>> >> >                 (60.02x realtime)
>> >> >          Wrote: 749625 bytes, 3001 packets, 63 pages
>> >> >        Bitrate: 98.9456 kbit/s (without overhead)
>> >> >  Instant rates: 44 to 122.4 kbit/s
>> >> >                 (110 to 306 bytes per packet)
>> >> >       Overhead: 0.972% (container+metadata)
>> >> > 
>> >> 
>> >> _______________________________________________
>> >> 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 
>> 
>> 
>> 





More information about the opus mailing list